html, body.pos-body { max-width: none !important; width: 100% !important; height: auto; min-height: 100%; margin: 0; }
.pos-body { background: #0f0a1a; color: #fff; font-family: "Noto Sans TC", "PingFang HK", "Microsoft JhengHei", sans-serif; }
html[data-theme="light"] .pos-body { background: #ece8f6; color: #1a1228; }

.pos-top { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 12px; background: var(--brand, #5B21B6); color:#fff; min-height:60px; }
.pos-top-l, .pos-top-r { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pos-top-r { justify-content:flex-end; }
.pos-top select { border:0; border-radius:12px; padding:10px 14px; background:#fff; color:#1a1228; min-height:44px; font-size:16px; }
.pos-top .shop-name { font-size:16px; }
.pos-top #backFloor, .pos-top #goPick { cursor:pointer; font-weight:700; padding:10px 14px; border-radius:12px; background:rgba(255,255,255,.16); min-height:44px; display:inline-flex; align-items:center; }
.pos-stats { display:flex; gap:10px; font-size:11px; opacity:.95; background:rgba(255,255,255,.12); border:0; color:#fff; border-radius:12px; padding:8px 12px; cursor:pointer; min-height:44px; }
.pos-stats b { display:block; font-size:16px; font-family: Outfit, sans-serif; }
.pos-stats div { min-width: 0; }
.nav-chip { display:inline-flex; align-items:center; justify-content:center; gap:4px; padding:10px 14px; min-height:44px; border-radius:999px; background:rgba(255,255,255,.14); color:#fff; text-decoration:none; font-size:15px; font-weight:600; }
.nav-chip i { font-style:normal; min-width:16px; padding:0 5px; border-radius:8px; background:#f59e0b; color:#111; font-size:11px; text-align:center; }
.nav-chip.warn { background:#f59e0b; color:#111; }
.nav-chip.warn i { background:#111; color:#fbbf24; }
.more-wrap { position:relative; }
.more-pop { position:absolute; right:0; top:calc(100% + 6px); min-width:168px; background:#1c142c; color:#fff; border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.35); padding:6px; z-index:50; }
html[data-theme="light"] .more-pop { background:#fff; color:#1a1228; }
.more-pop a { display:block; padding:10px 12px; border-radius:8px; color:inherit; text-decoration:none; font-size:14px; }
.more-pop a:hover { background:#4c1d95; color:#fff; }

.sess-mini { margin:10px 16px 0; display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:13px; }
.legend { display:flex; flex-wrap:wrap; gap:8px; padding:8px 16px 0; font-size:12px; opacity:.9; }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.legend i { width:12px; height:12px; border-radius:4px; display:inline-block; }
.legend .lg-free { background:#2a2040; box-shadow:0 0 0 1px #64748b inset; }
.legend .lg-busy { background:#4c1d95; }
.legend .lg-hold { background:#7c2d12; }
.legend .lg-dirty { background:#334155; }
.legend .lg-call { background:#f59e0b; }
.legend .lg-bill { background:#fb7185; }
.legend .lg-late { background:#f43f5e; }
.zones { display:flex; gap:8px; padding:10px 16px 0; flex-wrap:wrap; align-items:center; }
.zones b { padding:12px 16px; border-radius:16px; background:#2a2040; cursor:pointer; min-height:44px; display:inline-flex; align-items:center; }
html[data-theme="light"] .zones b { background:#fff; box-shadow:0 0 0 1px #d4c8ec; color:#1a1228; }
.zones b.on { background: var(--secondary, #2563EB); color:#fff; box-shadow:none; }
.view-tog { margin-left:auto; display:flex; gap:4px; }
.view-tog em { font-style:normal; padding:6px 10px; border-radius:12px; background:#2a2040; cursor:pointer; font-size:12px; }
html[data-theme="light"] .view-tog em { background:#fff; box-shadow:0 0 0 1px #d4c8ec; color:#1a1228; }
.view-tog em.on { background:#7c3aed; color:#fff; box-shadow:none; }

.floor-wrap { display:grid; grid-template-columns: 1fr minmax(220px, 280px); gap:0; align-items:start; }
.floor { display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:10px; padding:16px; }
.tbl { position:relative; background:#2a2040; border:0; border-radius:16px; padding:18px 8px 12px; color:#fff; text-align:center; min-height:128px; min-width:0; }
html[data-theme="light"] .tbl { background:#fff; color:#1a1228; box-shadow: var(--shadow); }
.tbl b { display:block; font-size:26px; font-family: Outfit, sans-serif; line-height:1.1; }
.tbl .pill { position:absolute; top:6px; right:6px; font-size:10px; font-style:normal; padding:2px 6px; border-radius:8px; background:#475569; color:#fff; }
.tbl .tbl-meta, .tbl .tbl-time { display:block; font-size:12px; margin-top:4px; opacity:.92; }
.tbl .tbl-focus { display:block; margin-top:6px; font-size:18px; font-family: Outfit, sans-serif; font-weight:700; }
.tbl.busy { background:#4c1d95; box-shadow:0 0 0 2px #38bdf8 inset; color:#fff; }
.tbl.busy .pill { background:#38bdf8; color:#0f172a; }
.tbl.take { box-shadow:0 0 0 2px #f59e0b inset; }
.tbl.hold { background:#7c2d12; box-shadow:0 0 0 2px #fbbf24 inset; color:#fff; }
.tbl.hold .pill { background:#fbbf24; color:#111; }
.tbl.dirty { background:#334155; box-shadow:0 0 0 2px #94a3b8 inset; color:#e2e8f0; }
.tbl.linger { box-shadow:0 0 0 2px #f59e0b inset; }
.tbl.late { box-shadow:0 0 0 3px #f43f5e inset; }
.tbl.late .pill { background:#f43f5e; }
.tbl.call { box-shadow:0 0 0 3px #f59e0b inset; animation: pulse 1.4s ease-in-out infinite; }
.tbl.call .pill { background:#f59e0b; color:#111; }
.tbl.bill { box-shadow:0 0 0 3px #fb7185 inset; }
.tbl.bill .pill { background:#fb7185; color:#111; }
@keyframes pulse { 50% { transform: scale(1.02); } }

.floor-side { margin:16px 16px 16px 0; background:#1c142c; border-radius:14px; padding:12px; max-height:calc(100vh - 160px); overflow:auto; }
html[data-theme="light"] .floor-side { background:#fff; color:#1a1228; }
.floor-side h4 { margin:0 0 8px; display:flex; justify-content:space-between; }
.side-row { display:flex; justify-content:space-between; gap:8px; padding:10px 6px; border-bottom:1px solid rgba(255,255,255,.08); cursor:pointer; }
.side-row:hover { background:rgba(124,58,237,.2); }
.side-row b { display:block; }
.side-row small { opacity:.75; }

.qr-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; margin-top:16px; }
.qr-card { background:#fff; color:#111; border-radius:14px; padding:12px; text-align:center; }
.qr-card .qrel svg { width:140px; height:140px; }
.qr-card b { display:block; margin-top:6px; }

.sess-bar { margin:0 0 8px; padding:8px 10px; border-radius:10px; background:#1e1b4b; color:#e0e7ff; font-size:13px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
html[data-theme="light"] .sess-bar { background:#eef2ff; color:#1e1b4b; }
.quick-row { margin-bottom:8px; padding-bottom:8px; border-bottom:1px dashed #4c1d95; }
.dish.quick { outline:2px solid #f59e0b; }
.line.comp .grow { text-decoration: line-through; opacity:.72; }
.line .rush { color:#dc2626; font-weight:700; }

.work { display:grid; grid-template-columns: 1fr minmax(320px, 400px); height: calc(100vh - 56px); min-height: 0; }
.menu { background:#160b24; padding:12px; overflow:auto; min-height:0; }
html[data-theme="light"] .menu { background:#f6f3fb; }
.mcats { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; }
.mcats b { background:#2a2040; padding:12px 16px; border-radius:16px; cursor:pointer; color:#fff; min-height:44px; display:inline-flex; align-items:center; }
.mcats b.on { background: var(--brand, #5B21B6); }
.mcats b i { display:block; font-size:10px; font-style:normal; opacity:.7; font-weight:400; }
.mgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:8px; }
.dish { background:#2a2040; border:0; color:#fff; border-radius:12px; padding:16px 12px; text-align:left; min-height:96px; }
html[data-theme="light"] .dish { background:#fff; color:#1a1228; box-shadow: var(--shadow); }
.dish small { display:block; color:#93c5fd; font-family: Outfit, sans-serif; font-size:15px; margin-top:4px; }
.dish.sold { opacity:.42; text-decoration: line-through; }
.dish.mkt small { color:#fbbf24; }
.dish.set small { color:#86efac; }
.dish.low { outline:2px solid #f59e0b; }

.mod-strip { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.mod-strip b { border:1px solid #7c3aed; border-radius:14px; padding:6px 10px; font-size:12px; cursor:pointer; }
.mod-strip b.on { background:#7c3aed; color:#fff; }
.flav { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.flav b { border:1px solid #7c3aed; border-radius:14px; padding:4px 10px; font-size:12px; cursor:pointer; }
.flav b.on { background:#7c3aed; color:#fff; }

.bill { background:#fff; color:#111; padding:12px 12px 24px; }
html[data-theme="dark"] .bill { background:#1c142c; color:#f4f0ff; }
.bill.ticket-pane { display:flex; flex-direction:column; padding:0; min-height:0; overflow:hidden; }
.bill-head { padding:10px 12px 8px; border-bottom:1px solid var(--line,#eee); }
html[data-theme="dark"] .bill-head { border-color:#3b2d55; }
.bill-head h3 { margin:0 0 6px; font-size:16px; }
.cover-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:13px; }
.cover-row span button { width:44px; height:44px; border:0; border-radius:50%; background:#f3e8ff; color:#5B21B6; font-size:22px; }
.tog { border:0; background:#ede9fe; color:#5B21B6; border-radius:10px; padding:10px 12px; font-size:14px; min-height:44px; width:auto; white-space:nowrap; }
.bill-extra, .act-sheet { padding:8px 12px; border-bottom:1px solid var(--line,#eee); display:none; }
.bill-extra.open, .act-sheet.open { display:block; }
.bill-ticket { flex:1; overflow:auto; padding:8px 12px 12px; min-height:120px; }
.ticket-sec { margin-bottom:10px; }
.ticket-sec h4 { margin:8px 0 4px; font-size:12px; letter-spacing:.04em; text-transform:uppercase; opacity:.7; }
.ticket-sec.new { background:#fff7ed; border-radius:10px; padding:4px 8px; }
html[data-theme="dark"] .ticket-sec.new { background:#3b2410; }
.ticket-sec.old { opacity:.88; }
.line.voided { opacity:.5; }
.line.voided .grow { text-decoration: line-through; }
.line.child { padding-left:12px; }
.line.fresh { background:#dbeafe; border-radius:8px; padding-left:6px; }
html[data-theme="dark"] .line.fresh { background:#1e3a5f; }
.line.unsent .grow { font-weight:700; }
.line { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--line,#eee); gap:6px; }
.line label { margin:0; display:flex; align-items:center; }
.line .grow { flex:1; cursor:pointer; min-width:0; }
.line button { width:44px; height:44px; border:0; border-radius:50%; background:#f3e8ff; color:#5B21B6; font-size:20px; }
.line button.mini { width:auto; min-width:52px; height:44px; border-radius:12px; padding:0 12px; font-size:14px; font-weight:600; white-space:nowrap; }
.bill-sum { padding:4px 12px; }
.bill-dock { padding:10px 12px 14px; border-top:1px solid var(--line,#eee); background:inherit; }
.dock-tot { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.dock-btns { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.dock-btns .btn { margin:0; padding:16px 8px; min-height:56px; font-size:17px; }
.btn.kot-send { background:#16a34a; }
.btn.pay-go { background:#dc2626; }
.btn.ghost { width:100%; margin-top:8px; background:transparent; border:1px solid #c4b5fd; color:inherit; }

.payrow { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.payrow b { flex:1; min-width:88px; text-align:center; border:1px solid #ddd; border-radius:12px; padding:14px 8px; font-size:16px; cursor:pointer; min-height:48px; }
.payrow b.on { border-color:#5B21B6; background:#f3e8ff; color:#5B21B6; }
.searchbox { width:100%; border:0; border-radius:12px; padding:12px 12px; background:#2a2040; color:#fff; font-size:16px; }
html[data-theme="light"] .searchbox { background:#fff; color:#111; }
.tot { font-family: Outfit, sans-serif; font-size:26px; }
.howto { margin: 10px 16px 0; padding: 10px 12px; border-radius: 12px; background: #2a2040; color: #e9d5ff; font-size: 13px; line-height: 1.45; }
html[data-theme="light"] .howto { background: #fff; color: #4c1d95; }
.pos-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.pos-dlg { background: #fff; color: #111; padding: 22px; border-radius: 16px; width: min(440px, 100%); box-shadow: 0 16px 40px rgba(0,0,0,.25); max-height: 92vh; overflow: auto; }
.pos-dlg.wide { width: min(560px, 100%); }
html[data-theme="dark"] .pos-dlg { background: #1c142c; color: #f4f0ff; }
.mini { border: 0; background: var(--brand, #5B21B6); color: #fff; border-radius: 10px; padding: 10px 14px; min-height: 40px; font-size: 14px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; background: rgba(0,0,0,.8); color: #fff; padding: 10px 16px; border-radius: 20px; z-index: 60; display: none; }

@media (max-width: 1100px) {
  .floor-wrap { grid-template-columns: 1fr; }
  .floor-side { margin: 0 16px 16px; max-height: 220px; }
}
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; height: auto; padding-bottom: 248px; }
  .bill.ticket-pane { min-height: 0; overflow: visible; }
  .pos-top { flex-wrap: wrap; gap: 6px; padding: 8px; }
  .pos-top-l { width: 100%; }
  .pos-top-r { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .pos-top-r .nav-chip { flex: 0 0 auto; }
  .pos-stats { padding: 4px 8px; gap: 6px; }
  .pos-stats b { font-size: 14px; }
  .mode-chip { font-size: 12px; padding: 4px 8px; }
  .sess-hint, .sess-h, .legend { display: none; }
  .floor { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .tbl { min-height: 118px; overflow: hidden; }
  .tbl .tbl-focus { overflow-wrap: anywhere; font-size: 16px; }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .mcats, .seat-bar, .mod-strip, .type-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .mcats b, .seat-bar b, .type-bar b { flex: 0 0 auto; }
  .dock-btns { grid-template-columns: 1fr 1fr 1fr; }
  .bill-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: #fff; box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
  html[data-theme="dark"] .bill-dock { background: #1c142c; }
  .zones { padding-right: 12px; overflow-x: auto; flex-wrap: nowrap; }
  .zones b { flex: 0 0 auto; }
  .view-tog { margin-left: 0; width: 100%; margin-top: 6px; }
}
@media (max-width: 420px) {
  .floor { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px; }
  .tbl b { font-size: 22px; }
  .more-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pos-dlg { width: min(100%, 100vw - 16px); padding: 16px; }
}

.pin-wrap { max-width: 420px; margin: 24px auto; text-align: center; padding: 8px 16px 32px; }
.pin-wrap h1 { margin: 8px 0 4px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 20px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #a78bfa; display: block; }
.pin-dots i.on { background: #7c3aed; border-color: #7c3aed; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto 16px; }
.pin-key { min-height: 64px; border: 0; border-radius: 16px; background: #2a2040; color: #fff; font-size: 26px; font-weight: 700; font-family: Outfit, sans-serif; }
html[data-theme="light"] .pin-key { background: #fff; color: #1a1228; box-shadow: 0 0 0 1px #d4c8ec; }
.pin-key:active { transform: scale(.97); background: #5B21B6; color: #fff; }

.more-page { padding: 16px 16px 32px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.more-tile { min-height: 110px; border: 0; border-radius: 16px; background: #2a2040; color: #fff; text-align: left; padding: 16px; }
html[data-theme="light"] .more-tile { background: #fff; color: #1a1228; box-shadow: var(--shadow); }
.more-tile b { display: block; font-size: 18px; margin-bottom: 6px; }
.more-tile small { opacity: .75; font-size: 13px; line-height: 1.35; }
.more-tile:active { transform: scale(.98); }

.step-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; border: 0; border-radius: 14px; background: #5B21B6; color: #fff; font-size: 26px; }
.stepper b { min-width: 36px; text-align: center; font-size: 24px; font-family: Outfit, sans-serif; }
.tea-tog { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 10px 0; }
.dlg-actions { display: flex; gap: 10px; margin-top: 16px; }
.dlg-actions .btn { flex: 1; min-height: 52px; }
.cash-keys b { min-width: 72px; font-size: 18px; font-weight: 700; }

.off-dot { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:#f59e0b; color:#111; font-weight:700; font-size:13px; }
.off-dot i { width:8px; height:8px; border-radius:50%; background:#111; }
.mode-chip { font-size:13px; opacity:.95; padding:6px 10px; border-radius:10px; background:rgba(255,255,255,.14); }
.type-bar { display:flex; gap:8px; padding:10px 16px 0; flex-wrap:wrap; }
.type-bar b { padding:12px 16px; border-radius:16px; background:#2a2040; cursor:pointer; min-height:44px; display:inline-flex; align-items:center; }
html[data-theme="light"] .type-bar b { background:#fff; box-shadow:0 0 0 1px #d4c8ec; color:#1a1228; }
.type-bar b.on { background:#2563EB; color:#fff; box-shadow:none; }
.mod-sheet { position:fixed; inset:0; background:#0f0a1a; z-index:45; display:flex; flex-direction:column; color:#fff; }
html[data-theme="light"] .mod-sheet { background:#f6f3fb; color:#1a1228; }
.mod-sheet h2 { margin:12px 16px 4px; }
.mod-sheet .mod-g { padding:8px 16px 16px; overflow:auto; flex:1; }
.mod-sheet .mod-g h3 { margin:12px 0 8px; }
.mod-opts { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.mod-opts b { min-height:72px; border:0; border-radius:16px; background:#2a2040; color:#fff; padding:14px; display:flex; flex-direction:column; justify-content:center; cursor:pointer; }
html[data-theme="light"] .mod-opts b { background:#fff; color:#1a1228; box-shadow:var(--shadow); }
.mod-opts b.on { background:#7c3aed; color:#fff; }
.mod-dock { padding:12px 16px 20px; display:flex; gap:10px; }
.mod-dock .btn { flex:1; min-height:56px; }
.seat-bar { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.seat-bar b { min-width:48px; min-height:44px; border-radius:12px; background:#2a2040; color:#fff; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
html[data-theme="light"] .seat-bar b { background:#fff; color:#1a1228; box-shadow:0 0 0 1px #d4c8ec; }
.seat-bar b.on { background:#2563EB; color:#fff; }
.num-pad { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:12px 0; }
.num-key { min-height:64px; border:0; border-radius:16px; background:#2a2040; color:#fff; font-size:26px; font-weight:700; font-family:Outfit,sans-serif; }
html[data-theme="light"] .num-key { background:#fff; color:#1a1228; box-shadow:0 0 0 1px #d4c8ec; }
.num-key:active { transform:scale(.97); background:#5B21B6; color:#fff; }
.split-modes { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.split-modes b { flex:1; min-width:90px; text-align:center; padding:12px 8px; border-radius:12px; background:#ede9fe; color:#5B21B6; cursor:pointer; }
.split-modes b.on { background:#5B21B6; color:#fff; }

@media print {
  .pos-top, .howto, .zones, .floor, .menu, .btn, .btn.lite, #toast, .pos-mask, .qr-card button,
  .legend, .floor-side, .sess-mini, .bill-dock, .act-sheet, .more-pop, .nav-chip, .view-tog { display: none !important; }
  .print-sheet { box-shadow: none !important; max-width: 100% !important; margin: 0 !important; color: #000 !important; background: #fff !important; }
  .qr-grid { display: grid !important; }
}
