:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --surface: #fff;
  --ink: #1d1d1f;
  --subtle: #606064;
  --accent: #745319;
  --tint: #f5eee1;
  --rule: #e6e6e9;
  --green: #226347;
  --green-bg: #eaf5ee;
  --danger: #9e3629;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "PingFang HK", "Noto Sans HK", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.22,.75,.22,1);
  --radius: 22px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--font); }
h1, h2, h3, p, ul, ol { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #805921; outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; top: 12px; left: 12px; border-radius: 10px; padding: 12px; background: white; }
.site-header { position: sticky; z-index: 3; top: 0; background: #fafafcf2; border-bottom: 1px solid #e7e7e9; }
@supports (backdrop-filter: blur(16px)) { .site-header { background: #fafafce0; backdrop-filter: saturate(1.3) blur(16px); } }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; min-height: 65px; }
.brand { display: inline-flex; gap: 9px; align-items: center; justify-self: start; text-decoration: none; min-height: 44px; }
.brand-mark { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid #a58045; position: relative; }
.brand-mark::after { content: ''; width: 13px; height: 13px; position: absolute; top: 4px; left: 3px; border-radius: 50%; box-shadow: 3px 3px 0 #97703b; }
.brand-text { display: grid; line-height: 1; }
.brand-text strong { font: 800 17px/1 "Inter", var(--font); letter-spacing: -.05em; }
.brand-text small { margin-top: 4px; color: var(--subtle); font-size: 8px; letter-spacing: .22em; }
.view-nav, .staff-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.view-nav { border-radius: 100px; padding: 3px; background: #ebebef; }
.nav-button, .staff-tab { min-height: 44px; padding: 7px 16px; border: 0; border-radius: 100px; background: transparent; color: var(--subtle); font-weight: 650; line-height: 1.2; }
.nav-button[aria-pressed=true], .staff-tab[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #1d1d1f13; }
.account-switch { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 12px; }
.account-switch select { width: auto; background: transparent; padding: 6px 8px; border: 0; border-radius: 8px; color: var(--ink); font-weight: 650; font-size: 13px; }
.account-auth { justify-self: end; display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--subtle); font-size: 13px; }
.account-auth form { margin: 0; }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.auth-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 100px; background: #ededf0; color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; }
.auth-link:hover { background: #e1e1e6; }
.hero-inner { margin-top: 22px; min-height: 253px; display: grid; grid-template-columns: minmax(0, 1fr) 44%; align-items: center; position: relative; isolation: isolate; overflow: hidden; border-radius: 28px; background: radial-gradient(ellipse at 82% 52%,#eae5da,#f5f3ee 34%,#fff 68%); }
.hero-copy { position: relative; z-index: 1; padding: 29px clamp(26px, 4.5vw, 65px); }
.hero-copy h1, .intro h1 { font-weight: 760; line-height: 1.12; letter-spacing: -.055em; font-size: clamp(36px, 5vw, 63px); }
.next-step { margin-top: 15px; }
.next-title { display: flex; align-items: center; gap: 7px; font-size: clamp(16px, 2vw, 21px); font-weight: 720; letter-spacing: -.02em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #438762; box-shadow: 0 0 0 3px #4387621c; flex: none; }
.next-description { margin-top: 1px; color: var(--subtle); font-size: 14px; }
.next-step .button { margin-top: 12px; }
.hero-visual { position: absolute; z-index: 0; inset: 0 4% 0 50%; display: grid; place-items: center; pointer-events: none; }
.hero-visual img { width: min(85%, 289px); height: auto; max-height: 254px; object-fit: contain; filter: drop-shadow(0 13px 13px #6e573b28); animation: product-arrival 500ms var(--ease) both; }
@keyframes product-arrival { from { opacity: 0; transform: translateY(10px) rotate(-3deg) scale(.97); } to { opacity: 1; transform: none; } }
.workspace { display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 22px; padding-block: 22px 56px; align-items: start; }
.sidebar { min-width: 0; padding: 17px; border-radius: var(--radius); background: var(--surface); }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-label h2, .section-label h3 { font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
.section-label > span { color: var(--subtle); font-size: 12px; }
.submission-list { display: grid; gap: 5px; }
.submission { position: relative; width: 100%; padding: 10px 11px; min-height: 54px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; }
.submission[aria-pressed=true] { background: #f1f1f3; border-color: #eeedf1; }
.submission[aria-pressed=true]::before { content: ''; position: absolute; left: 0; top: 25%; bottom: 25%; width: 2px; border-radius: 2px; background: #a88751; }
.submission-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.submission strong { font-weight: 720; font-size: 13px; overflow-wrap: anywhere; }
.submission small { display: block; color: var(--subtle); margin-top: 2px; font-size: 12px; }
.sidebar-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 16px; border: 1px solid transparent; border-radius: 100px; text-decoration: none; font-weight: 670; line-height: 1.25; }
.button-primary { background: var(--ink); border-color: var(--ink); color: white; }
.button-secondary { background: #f0f0f3; color: var(--ink); border-color: #ededf0; }
.sidebar-actions .button { font-size: 13px; padding-inline: 11px; }
.button, .submission, .nav-button, .staff-tab { transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease); }
@media (hover: hover) { .button-primary:hover { background: #3e3e42; } .button-secondary:hover, .submission:not([aria-pressed=true]):hover { background: #e8e8ed; } .nav-button:hover, .staff-tab:hover { color: var(--ink); } }
.button:active { transform: scale(.975); }
.panel { background: var(--surface); border: 1px solid #ededf0; border-radius: var(--radius); padding: clamp(16px, 2.4vw, 27px); min-width: 0; }
.order-panel { border: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h2 { font-size: clamp(20px, 3vw, 29px); letter-spacing: -.035em; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.order-kicker { color: var(--subtle); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; white-space: nowrap; color: #4d4c52; background: #eeeef1; padding: 4px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-ready { color: var(--green); background: var(--green-bg); }
.status-complete { color: #4d4c52; background: #eeeef1; }
.meta-grid { display: grid; grid-template-columns: 1.2fr .9fr 1fr; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #f6f6f8; }
.meta-item { display: grid; align-content: start; gap: 3px; }
.meta-item small, .card-copy small, .muted, .timeline small, .timeline time { color: var(--subtle); }
.meta-item strong { font-size: 13px; }
.order-section { margin-top: 23px; }
.card-list, .timeline { list-style: none; padding: 0; }
.card-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.card-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card-copy small { display: block; margin-top: 2px; font-size: 12px; }
.card-thumb { width: 36px; height: 46px; border-radius: 7px; background: var(--tint); color: var(--accent); display: grid; place-items: center; flex: none; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-actions { font-size: 13px; flex: none; max-width: 42%; text-align: right; }
.card-actions .button { font-size: 13px; }
.batch-row { display: grid; grid-template-columns: minmax(0,1fr) fit-content(50%); }
.batch-row .card-actions { max-width: none; justify-self: end; }
.batch-track { grid-column: 1/-1; display: flex; gap: 4px; max-width: 224px; height: 4px; margin-top: -5px; }
.batch-track span { flex: 1; border-radius: 99px; background: #e8e8ed; }
.batch-track span.reached { background: #aa8a53; }
.card-ready .card-thumb { background: #eaf5ee; color: var(--green); }
.timeline-step { display: grid; grid-template-columns: 1fr auto; gap: 8px; border-left: 1px solid var(--rule); margin-left: 5px; padding: 0 0 13px 16px; position: relative; }
.timeline-step::before { content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #a8a7ae; }
.timeline-step.is-current::before { background: #997038; box-shadow: 0 0 0 3px #99703820; }
.timeline time { font-size: 12px; white-space: nowrap; }
.order-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; font-weight: 650; padding: 4px 0; }
.notification-history summary { min-height: 44px; cursor: pointer; font-weight: 650; }
.intro { padding: 32px 0 19px; }
.intro h1 { font-size: clamp(33px, 5vw, 52px); }
.section-kicker { color: #50248f; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.staff-branch { display: inline-flex; margin-top: 9px; padding: 5px 10px; border-radius: 999px; background: #e7f5f4; color: #174c4b; font-size: 13px; font-weight: 750; }
#staff-content { min-height: 45vh; margin-bottom: 42px; }
.staff-login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr); gap: clamp(22px, 5vw, 64px); align-items: start; max-width: 820px; margin: 12px auto 42px; }
.staff-login-copy h2 { margin-top: 6px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.04em; line-height: 1.12; }
.staff-login-copy > p:last-child { margin-top: 10px; color: var(--subtle); }
.staff-login-form { display: grid; gap: 12px; padding: 16px; border: 1px solid #e5e0eb; border-radius: 16px; background: #fbfaff; }
.staff-scope-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; margin: 0 0 14px; padding: 9px 12px; border-left: 3px solid #47c1bf; border-radius: 2px 10px 10px 2px; background: #f0fbfa; color: #244746; font-size: 13px; }
.staff-scope-note strong { color: #230051; }
.staff-nav { margin: 0 0 14px; padding: 4px; border-radius: 16px; background: #eaeaec; width: fit-content; }
.staff-tab { border-radius: 12px; }
#staff-reset { color: var(--danger); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 15px; align-items: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; gap: 4px; font-weight: 650; min-width: 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid #d5d5da; background: white; color: var(--ink); font-size: 16px; }
.account-switch select { width: auto; padding: 6px 8px; background: transparent; border: 0; font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: #775522; }
.staff-form, .dialog-form { display: grid; gap: 12px; }
.staff-form fieldset { border: 1px solid var(--rule); border-radius: 11px; padding: 10px 12px; min-width: 0; }
.staff-form legend { font-weight: 700; }
.staff-form .button, .dialog-form .button { justify-self: start; }
.staff-form .panel { border-radius: 15px; }
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { border-bottom: 1px solid var(--rule); padding: 10px 8px; text-align: left; vertical-align: top; }
.notice, .empty { padding: 12px 13px; color: var(--subtle); border-radius: 10px; background: #f6f6f8; }
.notice { margin-block: 8px; }
.site-footer { border-top: 1px solid var(--rule); color: var(--subtle); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; min-height: 65px; font-size: 12px; }
.footer-inner strong { color: var(--ink); font-size: 11px; letter-spacing: .08em; }
.modal { padding: 0; border: 0; border-radius: 24px; width: min(480px, calc(100% - 30px)); max-height: calc(100dvh - 34px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 90px #1d1d1f30; }
.modal[open] { animation: sheet-in 220ms var(--ease) both; }
.modal::backdrop { background: #14141966; animation: fade-in 160ms ease-out both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-inner { padding: 25px; position: relative; }
.dialog-inner h2 { margin: 0 44px 13px 0; letter-spacing: -.03em; }
.dialog-inner h2:focus, #grade-value:focus { outline: none; }
.dialog-inner p, .dialog-inner ol, .dialog-inner dl { margin: 9px 0; }
.dialog-close { position: absolute; top: 11px; right: 11px; border: 0; border-radius: 50%; background: #eeeef1; color: var(--ink); width: 44px; height: 44px; font-size: 24px; }
.draft-card { margin-bottom: 8px; }
.form-feedback:empty { display: none; }
.form-feedback, [role=alert] { color: var(--danger); }
.slab { position: relative; overflow: hidden; padding: 10px; border-radius: 17px; border: 1px solid #d5d0c7; box-shadow: 0 12px 30px #1e1b1517, inset 0 0 0 4px #fff9; background: linear-gradient(153deg,#fbfaf7,#eae6dd); color: var(--ink); margin: 3px auto 17px; max-width: 244px; }
.slab-label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 50px; border-radius: 8px; background: #fffdf7; padding: 9px; font-size: 12px; }
.slab-label strong { color: var(--accent); font-size: 18px; font-weight: 800; }
.grade-cover { width: 55px; height: 15px; border-radius: 5px; background: linear-gradient(90deg,#e3dfd5,#f2eee4,#dfd9cd); }
.is-revealed .grade-cover { display: none; }
.slab-art { display: grid; place-items: center; gap: 10px; min-height: 170px; padding: 14px; text-align: center; }
.slab-art > span { display: grid; place-items: center; width: 82px; height: 110px; border: 1px solid #cabc9b; border-radius: 8px; background: #f9f4e9; color: var(--accent); font-size: 32px; }
.slab-art img { max-height: 165px; width: auto; object-fit: contain; }
.slab.reveal-motion::after { content: ''; position: absolute; inset: 0 -90%; background: linear-gradient(110deg,transparent 44%,#fff9 49%,transparent 54%); transform: translateX(44%); animation: foil-sweep 520ms var(--ease) both; pointer-events: none; }
@keyframes foil-sweep { from { transform: translateX(-44%); opacity: 0; } 24% { opacity: .75; } to { transform: translateX(44%); opacity: 0; } }
#grade-actions { display: flex; flex-wrap: wrap; justify-content: center; }
.pickup-qr { display: grid; place-items: center; }
.pickup-qr img { width: 150px; height: 150px; object-fit: contain; image-rendering: pixelated; }
.pickup-code, .receipt-id { font: 700 clamp(16px,4vw,24px)/1.4 var(--mono); overflow-wrap: anywhere; }
.pickup-code { text-align: center; background: #f4f4f6; border-radius: 9px; padding: 7px; }
.receipt-details { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; }
.receipt-details dd { margin: 0; }
.toast { position: fixed; z-index: 5; right: 16px; bottom: 16px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: white; animation: sheet-in 180ms var(--ease) both; }
.check-row { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 5px 0; }
.check-row small { display: block; color: var(--subtle); font-family: var(--mono); overflow-wrap: anywhere; }
.batch-form + .batch-form, .pickup-form { border-top: 1px solid var(--rule); padding-top: 14px; }
.intake-card { margin: 0; }
.label-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 6px; margin-block: 10px; }
.bag-label { display: grid; justify-items: center; text-align: center; border: 1px solid var(--rule); border-radius: 4px; padding: 6px; overflow-wrap: anywhere; }
.bag-label img { width: 86px; height: 86px; image-rendering: pixelated; }
@media (max-width: 850px) {
  .shell { width: min(100% - 36px, 1120px); }
  .workspace { grid-template-columns: 225px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { grid-template-columns: 1fr auto; min-height: 0; padding-block: 3px 8px; gap: 2px; }
  .view-nav { grid-row: 2; grid-column: 1/-1; }
  .nav-button { flex: 1; }
  .account-switch { grid-column: 2; grid-row: 1; }
  .account-auth { grid-column: 2; grid-row: 1; }
  .account-switch span, .brand-text small { display: none; }
  .account-name { display: none; }
  .hero-inner { min-height: 185px; margin-top: 13px; border-radius: 21px; grid-template-columns: minmax(0,1fr) 29%; }
  .hero-copy { padding: 17px 14px; }
  .hero-copy h1 { font-size: clamp(32px, 8.3vw, 45px); }
  .hero-visual { inset: 0 1% 0 56%; }
  .hero-visual img { width: 100%; max-height: 172px; }
  .next-step { margin-top: 9px; }
  .next-description { font-size: 13px; }
  .next-order { display: none; }
  .next-step .button { margin-top: 8px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 11px; padding-block: 12px 28px; }
  .sidebar { padding: 13px; border-radius: 18px; }
  .sidebar-actions { margin-top: 6px; }
  .sidebar-actions .button { flex: 1; }
  .panel { border-radius: 18px; }
  .meta-grid { grid-template-columns: 1fr 1fr; padding: 10px; }
  .meta-item:last-child { grid-column: 1/-1; }
  .field-grid { gap: 8px; }
  .staff-login { grid-template-columns: 1fr; gap: 20px; margin-top: 2px; }
  .dialog-inner { padding: 19px; }
  .timeline-step { grid-template-columns: 1fr; gap: 2px; }
}
@media print {
  .site-header { position: static; }
  body:has(#print-receipt) > :not(dialog) { display: none !important; }
  .modal[open] { border: 0; position: static; margin: 0; max-height: none; width: 100%; box-shadow: none; }
  .modal::backdrop, .modal form, .modal button { display: none !important; }
  body.printing-labels * { visibility: hidden; }
  body.printing-labels .label-list, body.printing-labels .label-list * { visibility: visible; }
  body.printing-labels .label-list { position: absolute; inset: 0 auto auto 0; width: 100%; }
  body.printing-guest-receipt * { visibility: hidden; }
  body.printing-guest-receipt .desk-receipt,
  body.printing-guest-receipt .desk-receipt * { visibility: visible; }
  body.printing-guest-receipt .desk-receipt { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; box-shadow: none; }
  body.printing-guest-receipt .desk-receipt button { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, .modal::backdrop { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
