/* ============================================================
   Formosa 訂位系統 — 員工端
   手寫 CSS，無建置步驟。放在 public/css/app.css
   ============================================================ */

:root {
    /* 底色：工作面是紙，導覽是墨 */
    --ink:          #16191f;
    --ink-soft:     #262b34;
    --paper:        #f7f7f5;
    --card:         #ffffff;
    --line:         #dcdcd6;
    --line-soft:    #ebebe6;

    --text:         #1c1f26;
    --text-soft:    #5f6672;
    --text-faint:   #929aa6;

    /* 深松綠：取自戶外區的植栽與燈籠，主要動作用 */
    --pine:         #1f4e46;
    --pine-hover:   #17403a;
    --pine-tint:    #e6efec;

    /* 語意色只有兩個真正重要：待處理 vs 已確認 */
    --wait:         #92400e;
    --wait-bg:      #fdf3d7;
    --wait-line:    #e8c766;

    --ok:           #14603a;
    --ok-bg:        #e2f2e8;
    --ok-line:      #8ec5a5;

    --alert:        #9f1239;
    --alert-bg:     #fdeaef;

    --radius:       6px;
    --shadow-card:  0 1px 2px rgba(22, 25, 31, .07);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai",
                 "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* 時間與人數一律等寬數字，讓欄位像真的訂位簿一樣對齊 */
.num, td, th, time { font-variant-numeric: tabular-nums; }

/* 位置代號是識別碼不是文字，用等寬字讓 A1 / VIP14 一眼可掃 */
.code {
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    font-weight: 600;
    letter-spacing: .01em;
}

a { color: var(--pine); }

/* ── 頂部導覽 ────────────────────────────────────────────── */
.topbar {
    background: var(--ink);
    color: #fff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 52px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar__brand {
    font-weight: 650;
    letter-spacing: .02em;
    white-space: nowrap;
}
.topbar__nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar__nav a {
    color: #b9c0cc;
    text-decoration: none;
    padding: 6px 11px;
    border-radius: var(--radius);
    font-size: 14px;
}
.topbar__nav a:hover { background: var(--ink-soft); color: #fff; }
.topbar__nav a[aria-current="page"] { background: var(--ink-soft); color: #fff; }
.topbar__nav .badge-count {
    display: inline-block;
    margin-left: 5px;
    background: var(--wait-line);
    color: #3d2c04;
    border-radius: 9px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
}
.topbar__user { color: #8b93a1; font-size: 13px; white-space: nowrap; }
.topbar__user form { display: inline; }
.topbar__user button {
    background: none; border: 0; color: #b9c0cc;
    cursor: pointer; font: inherit; padding: 0 0 0 10px;
}
.topbar__user button:hover { color: #fff; text-decoration: underline; }

/* ── 版面 ────────────────────────────────────────────────── */
.wrap { max-width: 1500px; margin: 0 auto; padding: 18px 16px 60px; }
.stack > * + * { margin-top: 14px; }

.page-head {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.page-head h1 { font-size: 19px; font-weight: 650; margin: 0; }
.page-head .sub { color: var(--text-soft); font-size: 13px; }

/* ── 通知條 ──────────────────────────────────────────────── */
.notice {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid;
}
.notice--wait  { background: var(--wait-bg);  border-color: var(--wait-line);  color: var(--wait); }
.notice--alert { background: var(--alert-bg); border-color: #f0aabd;           color: var(--alert); }
.notice--ok    { background: var(--ok-bg);    border-color: var(--ok-line);    color: var(--ok); }
.notice strong { font-weight: 650; }
.notice__spacer { flex: 1; }

/* ── 按鈕 ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 14px; line-height: 1;
    padding: 8px 13px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: #f1f1ee; }
.btn:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.btn--primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn--primary:hover { background: var(--pine-hover); }
.btn--danger  { color: var(--alert); border-color: #f0aabd; }
.btn--danger:hover { background: var(--alert-bg); }
.btn--sm { padding: 5px 9px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 視圖切換：一組分段控制項 */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button {
    font: inherit; font-size: 14px;
    padding: 8px 14px;
    border: 0; border-right: 1px solid var(--line);
    background: var(--card); color: var(--text-soft);
    cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.segmented button:hover:not([aria-pressed="true"]) { background: #f1f1ee; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar__spacer { flex: 1; }

/* ── 看板 ────────────────────────────────────────────────── */
.board {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.board table { border-collapse: collapse; width: 100%; }

.board thead th {
    position: sticky; top: 0;
    background: #f2f2ef;
    border-bottom: 1px solid var(--line);
    padding: 7px 8px;
    font-size: 12px; font-weight: 650;
    color: var(--text-soft);
    text-align: center;
    white-space: nowrap;
    z-index: 10;
}
.board thead th .day {
    display: block; font-size: 13px; color: var(--text); font-weight: 700;
}
.board thead th.is-today { background: var(--pine-tint); color: var(--pine); }

.board th.seat-col, .board td.seat-col {
    position: sticky; left: 0;
    background: var(--card);
    border-right: 1px solid var(--line);
    text-align: left;
    padding: 6px 10px;
    min-width: 108px;
    z-index: 5;
}
.board thead th.seat-col { background: #f2f2ef; z-index: 15; }
.board td.seat-col .cap { display: block; font-size: 11.5px; color: var(--text-faint); }

.board tr.area-band td {
    background: var(--ink);
    color: #e8eaee;
    font-size: 12px; font-weight: 650;
    letter-spacing: .06em;
    padding: 5px 10px;
    position: sticky; left: 0;
}
.board tbody td {
    border-bottom: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
    padding: 3px;
    vertical-align: top;
    min-width: 138px;
}

/* 桌牌 —— 這是整個系統的簽名元件。
   它刻意做成一張紙卡的樣子，跟你們放在桌上的預定時間牌對應，
   所以螢幕和列印稿長得一樣，員工不用學兩套東西。 */
.slip {
    display: block;
    text-decoration: none; color: inherit;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 3px;
    padding: 5px 7px;
    box-shadow: var(--shadow-card);
    min-height: 52px;
}
.slip:hover { filter: brightness(.98); }
.slip:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.slip--wait { background: var(--wait-bg); border-color: var(--wait-line); }
.slip--ok   { background: var(--ok-bg);   border-color: var(--ok-line); }
.slip__time { font-weight: 700; font-size: 15px; }
.slip__who  { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip__note {
    font-size: 12px; color: var(--text-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slip__flag { font-size: 11px; font-weight: 700; color: var(--wait); letter-spacing: .04em; }

/* 空位：留白的橫線，跟列印稿一樣可以手寫 */
.empty-slot {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    min-height: 52px;
    border-radius: 3px;
    background-image: repeating-linear-gradient(
        to bottom, transparent, transparent 16px,
        var(--line-soft) 16px, var(--line-soft) 17px
    );
}

.empty-slot:hover { background-color: var(--pine-tint); }
.empty-slot:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }

/* 桌牌現在是按鈕 */
button.slip {
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

/* ── 對話框 ──────────────────────────────────────────────── */
.modal-bg {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(22, 25, 31, .55);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 20px;
    overflow-y: auto;
}
.modal {
    background: var(--card);
    border-radius: 10px;
    width: 100%; max-width: 520px;
    box-shadow: 0 18px 48px rgba(0,0,0,.34);
}
.modal__head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--line-soft);
}
.modal__head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.modal__sub { margin: 4px 0 0; font-size: 13px; color: var(--text-soft); }
.modal__x {
    margin-left: auto; background: none; border: 0;
    font-size: 24px; line-height: 1; color: var(--text-faint);
    cursor: pointer; padding: 0 4px;
}
.modal__x:hover { color: var(--text); }
.modal__body { padding: 16px 20px; }
.modal__foot {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--line-soft);
}

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.hint {
    margin: 12px 0 0; padding: 9px 11px;
    background: var(--pine-tint); color: var(--pine);
    border-radius: var(--radius); font-size: 13px;
}

.pill {
    display: inline-block; padding: 1px 8px;
    border-radius: 10px; font-size: 12px; font-weight: 650;
    border: 1px solid;
}
.pill--wait { background: var(--wait-bg); border-color: var(--wait-line); color: var(--wait); }
.pill--ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok); }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-soft); font-size: 13px; }
.kv dd { margin: 0; }

.logs { margin-top: 16px; font-size: 13px; }
.logs summary { cursor: pointer; color: var(--text-soft); }
.logs__row {
    display: flex; gap: 12px; padding: 5px 0;
    border-bottom: 1px solid var(--line-soft);
}
.logs__row:last-child { border-bottom: 0; }

/* ── 月曆熱力圖 ──────────────────────────────────────────── */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month__cell {
    font: inherit; text-align: left; cursor: pointer;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 10px 11px;
}
.month__cell:hover { border-color: var(--pine); }
.month__cell[data-today="1"] { box-shadow: inset 0 0 0 2px var(--pine); }
.month__dow  { font-size: 11px; color: var(--text-faint); }
.month__day  { font-size: 17px; font-weight: 650; }
.month__load { font-size: 12px; color: var(--text-soft); margin-top: 3px; }
.month__cell[data-load="0"] .month__load { color: var(--text-faint); }
.month__cell[data-load="1"] { background: #eef4f1; }
.month__cell[data-load="2"] { background: #dbe9e3; }
.month__cell[data-load="3"] { background: #c3dbd2; }
.month__cell[data-load="4"] { background: #a7cabd; }

/* ── 圖例 ────────────────────────────────────────────────── */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid; display: inline-block; }
.legend i.wait  { background: var(--wait-bg); border-color: var(--wait-line); }
.legend i.ok    { background: var(--ok-bg);   border-color: var(--ok-line); }
.legend i.free  { background: var(--card);    border-color: var(--line); }

/* ── 登入 ────────────────────────────────────────────────── */
.login {
    min-height: 100vh;
    display: grid; place-items: center;
    background: var(--ink);
    padding: 20px;
}
.login__card {
    background: var(--card);
    border-radius: 10px;
    padding: 30px 28px;
    width: 100%; max-width: 360px;
    box-shadow: 0 12px 34px rgba(0,0,0,.32);
}
.login__card h1 { margin: 0 0 4px; font-size: 20px; }
.login__card p.sub { margin: 0 0 22px; color: var(--text-soft); font-size: 13.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea {
    width: 100%; font: inherit;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--pine); outline-offset: -1px; border-color: var(--pine);
}
.field .err { color: var(--alert); font-size: 12.5px; margin-top: 4px; }

/* ── 空狀態 ──────────────────────────────────────────────── */
.blank {
    text-align: center; padding: 46px 20px;
    color: var(--text-soft);
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}


/* ============================================================
   會員端
   ============================================================ */
body.member { background: var(--paper); }

.mbar {
    background: var(--ink); color: #fff;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 16px;
    position: sticky; top: 0; z-index: 50;
}
.mbar__brand { font-weight: 650; }
.mbar__nav { display: flex; gap: 4px; }
.mbar__nav a {
    color: #b9c0cc; text-decoration: none;
    padding: 6px 11px; border-radius: var(--radius); font-size: 14px;
}
.mbar__nav a[aria-current="page"] { background: var(--ink-soft); color: #fff; }
.mbar__lang { display: flex; gap: 2px; margin-left: auto; }
.mbar__lang a {
    color: #8b93a1; text-decoration: none;
    padding: 4px 8px; border-radius: 4px; font-size: 13px;
}
.mbar__lang a.is-on { background: var(--ink-soft); color: #fff; }
.mbar__out button {
    background: none; border: 0; color: #b9c0cc;
    font: inherit; font-size: 13px; cursor: pointer;
}

.mwrap { max-width: 780px; margin: 0 auto; padding: 18px 14px 60px; }
.mtitle { font-size: 17px; font-weight: 650; margin: 22px 0 4px; }

.daybar {
    display: flex; align-items: center; gap: 14px; justify-content: center;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 10px;
}
.daybar__label { text-align: center; min-width: 170px; }
.daybar__label strong { display: block; font-size: 17px; }
.daybar__label span { font-size: 13px; color: var(--text-soft); }

.lead-note { font-size: 13px; color: var(--text-soft); margin: 0; }

.zone { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.zone__head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-soft); }
.zone__head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.zone__head p { margin: 3px 0 0; font-size: 13px; color: var(--text-soft); }
.zone__flag { color: var(--wait) !important; }

.avail { width: 100%; border-collapse: collapse; }
.avail thead th {
    font-size: 12px; font-weight: 600; color: var(--text-soft);
    padding: 6px 4px; border-bottom: 1px solid var(--line-soft);
}
.avail tbody th {
    text-align: left; padding: 8px 10px; font-weight: 500;
    border-bottom: 1px solid var(--line-soft); min-width: 96px;
}
.avail tbody th .cap,
.avail tbody th .tnote {
    display: block; font-size: 11.5px; color: var(--text-faint); font-weight: 400;
}
.avail tbody td { padding: 4px 3px; border-bottom: 1px solid var(--line-soft); text-align: center; }

.cell {
    display: block; width: 100%;
    padding: 9px 4px; border-radius: 5px;
    font: inherit; font-size: 12.5px; line-height: 1.2;
    border: 1px solid transparent;
}
.cell--free {
    background: var(--pine-tint); color: var(--pine);
    border-color: #bcd6ce; cursor: pointer; font-weight: 600;
}
.cell--free:hover { background: #d5e6e0; }
.cell--free:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.cell--taken  { background: #f0f0ed; color: var(--text-faint); }
.cell--closed { background: transparent; color: var(--line); }

.rcard {
    display: flex; gap: 14px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 13px 15px;
}
.rcard__main { flex: 1; min-width: 200px; }
.rcard__when { display: flex; align-items: baseline; gap: 9px; }
.rcard__when strong { font-size: 17px; }
.rcard__where { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-soft); margin-top: 2px; }
.rcard__note { margin: 6px 0 0; font-size: 13px; color: var(--text-soft); }
.rcard__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rcard__code { font-size: 12px; color: var(--text-faint); }

.hist { width: 100%; border-collapse: collapse; background: var(--card);
        border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; }
.hist td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.hist tr:last-child td { border-bottom: 0; }

.login__note { margin: 16px 0 0; font-size: 12.5px; color: var(--text-soft); text-align: center; }
.login__lang { display: flex; justify-content: center; gap: 10px; margin-top: 14px; font-size: 13px; }
.login__lang a { color: var(--text-faint); text-decoration: none; }
.login__lang a.is-on { color: var(--pine); font-weight: 600; }

@media (max-width: 520px) {
    .avail tbody th { min-width: 72px; padding: 8px 6px; font-size: 13px; }
    .cell { font-size: 11.5px; padding: 8px 2px; }
    .rcard__side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}



/* ── 平面圖（餐廳自己的 floor plan + 疊在上面的可點區域）────── */
.picker { display: flex; gap: 8px; flex-wrap: wrap; }
.picker__btn {
    flex: 1 1 auto; min-width: 108px;
    display: flex; flex-direction: column; gap: 2px;
    font: inherit; text-align: left; cursor: pointer;
    background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 9px 12px;
}
.picker__btn small { font-size: 11.5px; color: var(--text-faint); }
.picker__btn:hover:not([disabled]) { border-color: var(--pine); }
.picker__btn[aria-selected="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.picker__btn[aria-selected="true"] small { color: rgba(255,255,255,.72); }
.picker__btn[disabled] { opacity: .42; cursor: not-allowed; }

/* 麵包屑 */
.crumb { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.crumb strong { font-size: 16px; }
.crumb__desc { font-size: 12.5px; color: var(--text-soft); }

/* 第二層：底圖 + 可點區域 */
.planmap {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
}
.planmap img { display: block; width: 100%; height: auto; }

.hotspot {
    position: absolute;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px;
    font: inherit; line-height: 1.15;
    border-radius: 5px;
    border: 2px solid;
    padding: 0;
    min-width: 34px; min-height: 30px;
}
.hotspot__code  { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 13px; }
.hotspot__state { font-size: 10px; }

.hotspot--free {
    background: rgba(20, 96, 58, .82); border-color: #0d4b2c; color: #fff;
    cursor: pointer;
}
.hotspot--free:hover  { background: rgba(20, 96, 58, .95); transform: scale(1.04); }
.hotspot--free:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }

.hotspot--taken  { background: rgba(60, 64, 72, .58); border-color: rgba(40,44,52,.7); color: rgba(255,255,255,.86); cursor: not-allowed; }
.hotspot--closed { background: rgba(120, 124, 132, .34); border-color: rgba(120,124,132,.5); color: rgba(255,255,255,.8); cursor: not-allowed; }

.plan-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-soft); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid; display: inline-block; }
.plan-legend i.free   { background: rgba(20,96,58,.82);    border-color: #0d4b2c; }
.plan-legend i.taken  { background: rgba(60,64,72,.58);    border-color: rgba(40,44,52,.7); }
.plan-legend i.closed { background: rgba(120,124,132,.34); border-color: rgba(120,124,132,.5); }

.plan-list { font-size: 13.5px; }
.plan-list summary { cursor: pointer; color: var(--text-soft); font-size: 13px; }
.plan-list ul { list-style: none; margin: 10px 0 0; padding: 0; }
.plan-list li {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.plan-list li > .btn, .plan-list li > .muted { margin-left: auto; }
.plan-list .cap, .plan-list .tnote { color: var(--text-faint); font-size: 12px; }
.plan-list .muted { color: var(--text-faint); font-size: 12.5px; }

.lead-note--flag { color: var(--wait); }
.field label small { font-weight: 400; color: var(--text-faint); margin-left: 4px; }

@media (max-width: 640px) {
    .picker__btn { min-width: calc(50% - 4px); padding: 8px 10px; }
    .hotspot__code  { font-size: 11px; }
    .hotspot__state { font-size: 9px; }
    .hotspot { min-width: 30px; min-height: 26px; border-width: 1.5px; }
}


/* ── 平面圖校正（後台）───────────────────────────────────── */
.calib { display: grid; grid-template-columns: 1fr 280px; gap: 14px; align-items: start; }
.calib__map .planmap { border-color: var(--pine); }
.calib__side {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px;
}
.calib__count { margin: 0 0 8px; font-size: 13px; color: var(--text-soft); font-weight: 600; }
.calib__list { list-style: none; margin: 0 0 10px; padding: 0; max-height: 460px; overflow-y: auto; }
.calib__list li {
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid var(--line-soft); padding: 2px 0;
}
.calib__list li.is-on { background: var(--pine-tint); border-radius: 4px; }
.calib__pick {
    flex: 1; display: flex; align-items: baseline; gap: 8px;
    font: inherit; text-align: left; cursor: pointer;
    background: none; border: 0; padding: 7px 6px;
}
.calib__pick .num { font-size: 11.5px; color: var(--text-faint); }
.calib__todo { font-size: 11px; color: var(--wait); font-weight: 600; }

.hotspot--picked {
    background: rgba(180, 83, 9, .84); border-color: #7c3d06; color: #fff;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, .35);
}

.inline-field { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-soft); }
.inline-field input { width: 68px; font: inherit; padding: 5px 7px;
    border: 1px solid var(--line); border-radius: var(--radius); }

@media (max-width: 860px) {
    .calib { grid-template-columns: 1fr; }
}


/* ── 單張平面圖 ─────────────────────────────────────────── */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 13.5px; cursor: pointer;
    background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 13px;
}
.chip:hover { border-color: var(--pine); }
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip__n {
    font-size: 12px; font-weight: 700;
    background: var(--ok-bg); color: var(--ok);
    border-radius: 999px; padding: 1px 7px;
}
.chip__n.is-none { background: #ececea; color: var(--text-faint); }
.chip[aria-pressed="true"] .chip__n { background: rgba(255,255,255,.9); color: var(--pine); }

/* 手機上讓底圖維持可讀寬度，用橫向捲動而不是縮到看不見 */
.mapscroll {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}
.planmap { position: relative; line-height: 0; min-width: 100%; }
.planmap img { display: block; width: 100%; height: auto; }

.hotspot {
    position: absolute;
    display: flex; align-items: center; justify-content: center;
    font: inherit; line-height: 1;
    border-radius: 4px;
    border: 2px solid;
    padding: 0;
}
.hotspot__code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700; font-size: 11px;
    white-space: nowrap;
}

.hotspot--free {
    background: rgba(20, 96, 58, .84); border-color: #0b4227; color: #fff;
    cursor: pointer;
}
.hotspot--free:hover { background: rgba(20, 96, 58, .96); }
.hotspot--free:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }

.hotspot--taken  { background: rgba(148, 32, 58, .74); border-color: #6d1329; color: #fff; cursor: not-allowed; }
.hotspot--closed { background: rgba(110, 114, 122, .5); border-color: rgba(70,74,82,.6); color: rgba(255,255,255,.9); cursor: not-allowed; }

.hotspot.is-dim { opacity: .16; cursor: default; }
.planmap.is-focused img { filter: saturate(.35) brightness(1.03); }

.plan-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-soft); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid; display: inline-block; }
.plan-legend i.free   { background: rgba(20,96,58,.84);   border-color: #0b4227; }
.plan-legend i.taken  { background: rgba(148,32,58,.74);  border-color: #6d1329; }
.plan-legend i.closed { background: rgba(110,114,122,.5); border-color: rgba(70,74,82,.6); }
.plan-legend__hint { color: var(--text-faint); }

.plan-list { font-size: 13.5px; }
.plan-list summary { cursor: pointer; color: var(--text-soft); font-size: 13px; }
.plan-list__group { font-size: 13px; font-weight: 650; margin: 14px 0 4px; color: var(--text-soft); }
.plan-list ul { list-style: none; margin: 0; padding: 0; }
.plan-list li {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.plan-list li > .btn, .plan-list li > .muted { margin-left: auto; }
.plan-list .cap, .plan-list .tnote { color: var(--text-faint); font-size: 12px; }
.plan-list .muted { color: var(--text-faint); font-size: 12.5px; }

.lead-note--flag { color: var(--wait); }
.field label small { font-weight: 400; color: var(--text-faint); margin-left: 4px; }

/* 手機：底圖固定 940px 寬，橫向捲動，方塊才點得到 */
@media (max-width: 940px) {
    .planmap { min-width: 940px; }
    .picker__btn { min-width: calc(50% - 4px); padding: 8px 10px; }
}

/* ============================================================
   列印：拿掉全部介面，只留表格。
   空格保留手寫的橫線，員工在系統掛掉時可以直接寫在紙上。
   ============================================================ */
@media print {
    @page { size: A4 landscape; margin: 10mm; }

    .topbar, .toolbar, .segmented, .notice, .legend, .no-print, .modal-bg { display: none !important; }

    body { background: #fff; font-size: 11px; }
    .wrap { max-width: none; padding: 0; }

    .print-head { display: block !important; margin-bottom: 8px; }
    .print-head h2 { margin: 0; font-size: 15px; }
    .print-head .meta { font-size: 10px; color: #555; }

    .board { border: 1px solid #000; overflow: visible; page-break-inside: auto; }
    .board thead th { position: static; background: #eee !important; border: 1px solid #000; color: #000; }
    .board th.seat-col, .board td.seat-col { position: static; border: 1px solid #000; }
    .board tbody td { border: 1px solid #999; min-width: 0; }
    .board tr.area-band td { background: #ddd !important; color: #000; position: static; }
    .board tr { page-break-inside: avoid; }

    .slip { box-shadow: none; background: #fff !important; border-color: #000 !important; }
    .slip--wait { border-left: 4px solid #000 !important; }
    .empty-slot {
        background-image: repeating-linear-gradient(
            to bottom, transparent, transparent 13px, #bbb 13px, #bbb 14px
        );
    }

    .print-sign { display: block !important; margin-top: 10px; font-size: 10px; }
}
.print-head, .print-sign { display: none; }
