/* 照顧紀錄系統 (原教保交班系統) 視覺系統
   配色與元件沿用庭芳各系統同一套語彙(中央、示範站、物資管理系統)：暖白底、墨綠灰字、庭芳洋紅。
   token 與基礎元件照物資管理系統複製，交班系統自己的元件寫在檔尾。手機優先，電腦同樣好用。 */
:root {
  --bg: #F7F7F3; --surface: #FFFFFF; --surface-2: #F1F2EE; --ink: #303735; --ink-2: #4A524F;
  --muted: #66706D; --ph: #9AA19E; --line: #E3E6E1; --line-2: #D5DAD4;
  --primary: #E4007F; --primary-dark: #B10063; --primary-soft: #FDEEF6; --on-primary: #FFFFFF;
  --ok: #1E6B3C; --ok-soft: #E6F3EA; --warn: #9A5B00; --warn-soft: #FFF3DD; --late: #B3261E; --late-soft: #FCEBE8;
  --focus: rgba(228,0,127,.22);
  --shadow-1: 0 1px 2px rgba(48,55,53,.05), 0 6px 20px rgba(48,55,53,.06);
  --shadow-2: 0 12px 40px rgba(48,55,53,.22);
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151817; --surface: #1D2120; --surface-2: #252a28; --ink: #ECEEEB; --ink-2: #CDD2CE;
    --muted: #9AA39F; --ph: #6F7874; --line: #2E3432; --line-2: #3A413E;
    --primary: #FF4DA6; --primary-dark: #FF7ABD; --primary-soft: #3A1C2B; --on-primary: #1B0A12;
    --ok: #6FD19A; --ok-soft: #173325; --warn: #F2B357; --warn-soft: #3A2C12; --late: #FF8A80; --late-soft: #3D1C1A;
    --focus: rgba(255,77,166,.3);
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-2: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151817; --surface: #1D2120; --surface-2: #252a28; --ink: #ECEEEB; --ink-2: #CDD2CE;
  --muted: #9AA39F; --ph: #6F7874; --line: #2E3432; --line-2: #3A413E;
  --primary: #FF4DA6; --primary-dark: #FF7ABD; --primary-soft: #3A1C2B; --on-primary: #1B0A12;
  --ok: #6FD19A; --ok-soft: #173325; --warn: #F2B357; --warn-soft: #3A2C12; --late: #FF8A80; --late-soft: #3D1C1A;
  --focus: rgba(255,77,166,.3); color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* [hidden] 的預設權重最低，任何自己寫的 display 都蓋得過它，所以要 !important */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: var(--fs-md); line-height: 1.6; color: var(--ink); background: var(--bg);
       min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-dark); }
.mono { font-family: var(--mono); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── 卡片、按鈕、輸入 ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-weight: 700;
       background: var(--primary); color: var(--on-primary); padding: 11px 20px; border-radius: 999px; transition: background .15s, transform .06s;
       box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 28%, transparent); white-space: nowrap; }
@media (hover: hover) { .btn:hover { background: var(--primary-dark); } }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
@media (hover: hover) { .btn.ghost:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); } }
.btn.danger { background: var(--surface); color: var(--late); border: 1.5px solid color-mix(in srgb, var(--late) 40%, var(--line)); box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.actions { display: flex; gap: var(--s2); margin-top: var(--s4); }
.actions .btn { flex: 1; }
.field { display: block; }
.field > span { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=tel], select, textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-md); padding: 10px 12px; outline: none; }
/* 介面對齊鐵律 (2026-10-20)：單行輸入框、日期框、下拉選單一律固定高度並關掉瀏覽器內建外觀。
   Safari 的下拉選單與日期框會用自己內建的高度、不管 padding，跟旁邊的框和按鈕對不齊；下拉箭頭改自己畫。 */
input[type=text], input[type=search], input[type=number], input[type=date], input[type=tel], select {
  height: 48px; -webkit-appearance: none; appearance: none; line-height: 1.3; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-datetime-edit { padding: 0; }
select { padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A524F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select:disabled { opacity: .55; cursor: default; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder { color: var(--ph); }

/* 空狀態與轉圈圈同高(100px)：院生頁跳下一位時轉圈圈換成「還沒有紀錄」版面不會抖(Jacky 2026-09-25) */
.empty { min-height: 100px; box-sizing: border-box; display: grid; align-content: center; justify-items: center; padding: var(--s4); text-align: center; color: var(--muted); }  /* 用 grid 不用 flex column：中文純文字當匿名 flex item 會被一字一行折起來 */
.empty svg { width: 40px; height: 40px; opacity: .45; margin-bottom: var(--s2); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; border-radius: 999px; padding: 2px 9px; line-height: 1.6; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.late { background: var(--late-soft); color: var(--late); } .chip.muted { background: var(--surface-2); color: var(--muted); }
.chip.primary { background: var(--primary-soft); color: var(--primary-dark); }
.banner { border-radius: var(--r-md); padding: 12px 14px; display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s3); font-size: var(--fs-sm); }
.banner b { display: block; font-size: var(--fs-md); }
.banner.late { background: var(--late-soft); color: var(--late); } .banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.ok { background: var(--ok-soft); color: var(--ok); } .banner.info { background: var(--primary-soft); color: var(--primary-dark); }
.banner .btn { margin-left: auto; }
/* ── 彈窗與 toast ── */
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(21,24,23,.5); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); width: 100%; max-width: 420px; box-shadow: var(--shadow-2); max-height: 86vh; overflow: auto; }
.modal h3 { font-size: var(--fs-lg); margin-bottom: var(--s3); }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; background: var(--ink); color: var(--bg);
         padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-2); font-weight: 600; max-width: calc(100vw - 32px); text-align: center; }
.toast .tfno { font-family: var(--mono); font-size: var(--fs-xl); display: block; }
@media (min-width: 720px) { .toast { bottom: 32px; } }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 100px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s4); color: var(--muted); }

/* ── 登入頁(版面照示範站 demo.tinfun.org.tw，Jacky 指定的各系統登入範本)── */
.gate { max-width: 26rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; text-align: center; }
.gate .logo { width: 88px; height: 88px; border-radius: 50%; display: block; margin: 0 auto .7rem; box-shadow: 0 6px 18px rgba(48,55,53,.16); }
.gate h1 { font-size: 1.45rem; margin-bottom: 1rem; }
.gate .card { --欄寬: 200px; max-width: 16rem; margin: 0 auto; padding: 1.5rem 1.4rem; text-align: left; }
.gate .field { width: var(--欄寬); margin: 0 auto 1.1rem; }
.gate #code { font-size: 28px; letter-spacing: 12px; text-align: center; padding: 10px 0 10px 12px; border-width: 2px; }
.gate .login-actions { display: flex; gap: .6rem; width: var(--欄寬); margin: 0 auto; }
.gate .login-actions .btn { flex: 1 1 0; padding: .85em 0; font-size: 1.05rem; }
.gate .login-actions .btn svg { width: 30px; height: 30px; }
.gate .forgot { width: var(--欄寬); margin: 1rem auto 0; text-align: right; font-size: .875rem; }
.gate .forgot a { color: var(--muted); text-underline-offset: 3px; }
.gate .notice { max-width: 22rem; margin: 1rem auto 0; }

/* ══ 交班系統自己的元件 ══════════════════════════════════════ */

/* ── 頂欄：左邊品牌，右邊名字選單(手機)或一排文字連結(電腦) ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent);
       backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 880px; margin: 0 auto; padding: var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s3); min-height: 56px; }
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--fs-lg); letter-spacing: .02em;
         white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
/* 頂欄：點院徽回系統入口 apps.tinfun.org.tw、點系統名稱回本系統首頁 (跨系統鐵律，2026-10-14 Jacky 定) */
.brand a { display: flex; align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: none; }
.me { margin-left: auto; position: relative; }
.me-links { display: flex; align-items: center; gap: var(--s4); font-size: var(--fs-sm); white-space: nowrap; }
.me-links b { color: var(--ink); }
.me-links a, .me-links button { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0;
                                height: 34px; display: inline-flex; align-items: center; padding: 0; font: inherit; cursor: pointer; }   /* 跟「呼叫 AI」同高 34 */
.me-links a:hover, .me-links button:hover { color: var(--primary-dark); }
.me-btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 14px;
          display: none; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r-md); box-shadow: var(--shadow-2); min-width: 200px; padding: 6px; z-index: 30; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px;
        border-radius: var(--r-sm); cursor: pointer; color: var(--ink); text-decoration: none; font-size: var(--fs-md); }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
@media (max-width: 719px) {
  .me-links { display: none; }
  .me-btn { display: flex; }
  .top { background: var(--bg); }
  .brand span { font-size: var(--fs-md); }
  /* 印尼文系統名稱較長：手機上名稱可以折行，右邊兩顆按鈕不被擠出畫面 (2026-10-20) */
  .brand { min-width: 0; white-space: normal; }
  .brand-logo { flex: none; }
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; }   /* 手機頂欄是不透明底色，模糊沒有意義又吃效能 */
  .brand-name span { line-height: 1.25; }
  .me { flex: none; }
}
@media (min-width: 720px) { .menu { display: none !important; } }

main { max-width: 880px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); }
.page-title { font-size: var(--fs-xl); font-weight: 800; letter-spacing: .01em; }
.section-title { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); letter-spacing: .08em; margin: var(--s5) 0 var(--s3);
                 display: flex; align-items: center; gap: var(--s2); }
.section-title a { margin-left: auto; font-weight: 600; letter-spacing: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600;
        font-size: var(--fs-sm); padding: 6px 0; margin-bottom: var(--s2); }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--primary-dark); }
.head-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }

/* ── 首頁上半：四個生活班，手機兩欄、電腦四欄 ── */
.class-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (min-width: 720px) { .class-grid { grid-template-columns: repeat(4, 1fr); } }
.class-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2);
             min-height: 120px; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface);
             border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none;
             transition: transform .08s, border-color .15s, box-shadow .15s; }
.class-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.class-btn:active { transform: scale(.98); }
.class-btn .num { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
                  background: var(--primary-soft); color: var(--primary-dark); font-size: var(--fs-2xl); font-weight: 800; }
.class-btn b { font-size: var(--fs-lg); }
.class-btn small { color: var(--muted); font-size: var(--fs-xs); }

/* ── 院生名單 ── */
.list { display: flex; flex-direction: column; gap: var(--s2); }
.row-link { display: flex; align-items: center; gap: var(--s3); padding: 14px var(--s4); background: var(--surface);
            border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; min-height: 64px; }
.row-link:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.row-link .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-link .name { font-weight: 700; font-size: var(--fs-lg); line-height: 1.35; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-link .name .nm { min-width: 0; overflow-wrap: anywhere; }
/* 最近一則放名字下面，手機上才有空間；最多兩行 */
.row-link .latest { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; overflow: hidden;
                    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* 最近一則：內容在前、時間在後，時間用庭芳洋紅區分(Jacky 2026-09-24) */
.row-link .latest .when { color: var(--primary-dark); margin-left: 8px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-link .latest.none { color: var(--muted); }   /* 原本 --ph，深色模式對比只有 3.6 (全系統 UI/UX 審查 2026-11-09) */
.row-link .chev { color: var(--ph); flex: none; }
.row-link .chev svg { width: 18px; height: 18px; display: block; }

/* ── 院生頁：上面紀錄、下面寫 ── */
.composer { position: sticky; bottom: 0; z-index: 10; background: var(--bg); padding: var(--s3) 0 calc(var(--s3) + env(safe-area-inset-bottom));
            border-top: 1px solid var(--line); margin-top: var(--s4); }
/* 文字框約 7 行高，長一點的語音整理結果不用捲(Jacky 2026-09-24) */
.composer textarea { min-height: 190px; resize: vertical; line-height: 1.6; font-size: var(--fs-md); }
/* 按鈕列：印尼文字比較長，四顆要塞得進 375px 手機(Jacky 2026-09-24)。
   左右留白縮小、不設最小寬度；還是太擠時文字鈕可以縮，平均分掉剩下的寬度，不會超出畫面 */
/* 按鈕列(Jacky 2026-09-24 第二次調)：麥克風 60px，三顆文字鈕同高、字 18px，平均撐滿整排；
   中印兩種語言在 375px 寬都不超出框框(印尼文 Berikutnya 最長) */
/* 一排五顆：麥克風、相機、下一位、取消、儲存(Jacky 2026-10-03)。375 寬要塞得下印尼文(Lanjut／Batal／Simpan)：
   圓鈕 56px、字級隨螢幕寬縮、文字鈕不換行 */
.composer .bar { display: flex; gap: 6px; margin-top: var(--s3); align-items: center; }
.composer .bar .btn { min-width: 0; height: 56px; font-size: clamp(15px, 4.5vw, 18px); padding: 0 6px; white-space: nowrap; }
.composer .bar .btn:not(.mic) { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }   /* 寬度跟著字走：Simpan 比 Batal 寬 */
.composer .bar .btn.send { margin-left: 0; }
.mic { width: 56px; height: 56px !important; border-radius: 50%; padding: 0 !important; flex: none !important; }
.mic.camera { display: inline-grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--primary-dark); border: 1.5px solid var(--line-2); box-shadow: none; }
.mic.camera svg { width: 26px; height: 26px; }
.mic.camera[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.mic.camera input { display: none; }
.composer .photo-row[hidden] { display: none; }
.mic svg { width: 30px; height: 30px; }
.mic.rec { background: var(--late); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--late) 45%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.rec-time { font-variant-numeric: tabular-nums; color: var(--late); font-weight: 700; font-size: var(--fs-sm); }
/* 院生頁錄音秒數貼在麥克風下緣，不佔按鈕列寬度 (全系統 UI/UX 審查 2026-11-09)：原本放在麥克風右邊，
   iPhone 印尼文擠不下會掉到下一行，麥克風被頂高 12.8px，跟旁邊四顆不在同一條中線；中文也低 10px */
.composer #micSlot { position: relative; display: inline-flex; flex: none; }
.composer #micSlot .rec-time { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); font-size: var(--fs-xs); line-height: 16px;
                               padding: 0 6px; border-radius: 999px; background: var(--bg); white-space: nowrap; pointer-events: none; }
.hint { color: var(--muted); font-size: var(--fs-sm); }

.entries { display: flex; flex-direction: column; gap: var(--s3); }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.entry .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.entry .meta b { color: var(--ink-2); font-size: var(--fs-sm); }
.entry .text { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-md); }
.entry .more { margin-top: var(--s2); font-size: var(--fs-sm); }
.entry .more summary { cursor: pointer; color: var(--muted); }
.entry .more .orig { margin-top: 6px; padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--r-sm);
                     white-space: pre-wrap; color: var(--ink-2); }
.entry .tools { margin-top: var(--s2); display: flex; gap: var(--s2); }
.entry.mine { border-left: 3px solid var(--primary); }
.load-more { display: block; margin: var(--s3) auto 0; }

/* ── 總結 ── */
.summary { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.summary-card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--s3); font-size: var(--fs-sm); color: var(--muted); }

/* 已修改：可以點的小標籤；修改歷史放卡片裡 */
button.chip { border: 0; cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 700; }
button.chip[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary-dark); }
.history .orig { margin-top: 6px; padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--r-sm); white-space: pre-wrap; color: var(--ink-2); font-size: var(--fs-sm); }
.history .orig .meta { margin-bottom: 2px; }
.modal textarea { width: 100%; min-height: 140px; }

/* 院生頁紀錄：內容在前，作者、時間、標籤在下面一行；時間用洋紅(Jacky 2026-09-24) */
.entry .meta.after { margin: 8px 0 0; }
.entry .meta .when { color: var(--primary-dark); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 生活班名單頁：頂欄以下的「回首頁＋班名」黏住不動，只有名單捲動(Jacky 2026-09-24)。
   top 對齊頂欄實際高度(app.js 量好放進 --top-h)；底色蓋住捲上來的卡片 */
.sticky-head { position: sticky; top: var(--top-h, 57px); z-index: 15; background: var(--bg);
               margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s3); padding: var(--s4) var(--s4) var(--s3);
               border-bottom: 1px solid var(--line); }
.sticky-head .head-row { margin-bottom: 0; }

/* ── 管理頁(只在電腦版) ── */
.admin-tabs { display: flex; gap: 4px; margin-bottom: var(--s4); border-bottom: 1px solid var(--line); padding-bottom: var(--s2); }
.admin-tabs .tab { padding: 8px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); text-decoration: none; }
.admin-tabs .tab[aria-current="page"] { background: var(--primary-soft); color: var(--primary-dark); }
.admin-tabs .tab:hover { color: var(--ink); }
.me-links [hidden] { display: none; }
table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-size: var(--fs-sm); }
table.grid th, table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.off td { color: var(--muted); }
/* 表格裡的下拉與按鈕同高 38 */
table.grid select { width: auto; height: 38px; padding: 0 32px 0 10px; background-position: right 10px center; background-size: 14px; }
table.grid .btn { height: 38px; padding: 0 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: end; margin-bottom: var(--s3); }
.toolbar .field { min-width: 150px; }
.toolbar .btn { height: 48px; }   /* 跟篩選的輸入框、下拉同高 */
.toolbar .spacer { flex: 1; }
/* 按鈕旁的一行提示 (依院生匯出：還有幾則沒翻好)：跟按鈕同高，字在中線上 */
.toolbar-note { height: 48px; display: inline-flex; align-items: center; color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.pick { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: var(--s2); }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row input { width: 18px; height: 18px; }
.modal:has(.pick) { max-width: 520px; }
/* 語音辨識等待中：文字框變淡、提示字用洋紅顯示秒數 */
/* 輸入框提示字 (照顧紀錄改版) 用 muted：Safari 預設淡灰對比只有 2.35 (批次一 UI/UX 審查)，Jacky 用 Safari */
.composer textarea::placeholder { color: var(--muted); }
.composer textarea.waiting { background: var(--primary-soft); }
.composer textarea.waiting::placeholder { color: var(--primary-dark); font-weight: 700; }
/* 取消放在送出左邊，跟送出一組靠右 */
/* 院生頁上方：返回連結＋跳到院生的下拉，同一行 */
.nav-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.nav-row .back { margin-bottom: 0; }
.nav-row select { margin-left: auto; width: auto; max-width: 60%; height: 46px; padding: 0 38px 0 12px; font-size: var(--fs-lg); font-weight: 700; }
/* 院生頁的這一列固定在頂欄下(Jacky 2026-09-25)：下拉選單就是院生名字，大字標題拿掉了 */
.nav-row.sticky-head { margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s3); padding: var(--s3) var(--s4); }
/* 首頁總結內文：在卡片裡自己捲(約 60% 畫面高)，捲到底不帶動整頁；整頁照常可捲(Jacky 2026-09-24) */
.summary.scroll { max-height: 60vh; overflow-y: auto; /* 實際高度由 app.js 的 量總結框 依畫面算 */ overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 4px; }
/* 紀錄卡：作者與時間接在內容後面，都用洋紅 */
.entry .inline-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-left: 10px; font-size: var(--fs-xs); vertical-align: baseline; }
.entry .inline-meta .who, .entry .inline-meta .when { color: var(--primary-dark); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 名單名字後面的本班則數 */
.row-link .name .count { flex: none; color: var(--primary-dark); font-weight: 700; font-size: var(--fs-md); }

/* ── 紀錄附照片(票 16，2026-10-03)：寫紀錄時的待傳縮圖列、紀錄卡的照片列、看大圖 ── */
.photo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: var(--s2); }
.photo-row .thumb { position: relative; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-row .thumb.uploading img { opacity: .45; }
.photo-row .thumb .spin { position: absolute; inset: 0; display: grid; place-items: center; }
.photo-row .thumb .spin .spinner { width: 22px; height: 22px; border-width: 2px; }
.photo-row .thumb .rm { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(48,55,53,.75); color: #fff; font-size: 16px; line-height: 24px; text-align: center; padding: 0; cursor: pointer; }
.photo-add { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; }
.photo-add input { display: none; }
.photo-add svg { width: 20px; height: 20px; }
.photo-add[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.entry .photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.entry .photos img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); }
.modal.photo-view { max-width: 96vw; padding: var(--s3); background: #000; }
.modal.photo-view img { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; }
.modal.photo-view .actions { justify-content: center; margin-top: var(--s3); }
.modal .photo-row { margin: var(--s3) 0; }

/* 加入同仁：姓名搜尋與部門篩選(Jacky 2026-10-03) */
.pick-filter { display: flex; gap: 8px; margin: var(--s2) 0 var(--s3); }
.pick-filter input { flex: 1 1 auto; min-width: 0; }
.pick-filter select { flex: none; width: auto; }
.pick-row[hidden] { display: none; }
.pick-empty { padding: var(--s4); text-align: center; color: var(--muted); }

/* 作廢的紀錄(2026-10-04)：劃掉、變淡，照片也淡；按鈕仍可按(恢復) */
.entry.voided .text, .entry.voided .photos { opacity: .55; }
.entry.voided .text { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.entry.voided .inline-meta { text-decoration: none; }
.btn.danger-text { color: var(--late); }

/* ── 呼叫 AI (2026-10-20)：頂欄按鈕與對話視窗。手機全螢幕、電腦置中大視窗 ── */
.ai-btn { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #f3bfdc;
          background: var(--primary-soft); color: var(--primary-dark); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; white-space: nowrap; line-height: 1; }
.ai-btn svg { width: 16px; height: 16px; flex: none; }
.me-links .ai-btn { text-decoration: none; padding: 0 12px; color: var(--primary-dark); }
.me-links .ai-btn:hover { color: var(--primary-dark); background: #fbe1ef; }
.ai-btn.narrow { display: none; }
.me { display: flex; align-items: center; gap: var(--s2); }
.me-btn { height: 34px; padding: 0 14px; }
@media (max-width: 719px) { .ai-btn.narrow { display: inline-flex; } }
/* 彈窗 90、toast 95 要在 AI 面板 (80) 上面，不然在 AI 裡的提示會被蓋住 (2026-10-20) */
body.ai-open { overflow: hidden; overscroll-behavior: none; }
html:has(body.ai-open) { overscroll-behavior: none; }
/* 對話開著時背後頂欄的模糊效果關掉：iPhone 上它在背後一直重算，滑動會頓 */
body.ai-open .top { backdrop-filter: none; -webkit-backdrop-filter: none; }
/* 高度由程式跟著 visualViewport 設；沒有 visualViewport 的瀏覽器用 100dvh */
.ai-panel { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; z-index: 80; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; background: rgba(21,24,23,.45); display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.ai-box { background: var(--bg); width: 100%; max-width: 720px; height: min(86vh, 820px); max-height: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow-2); display: flex; flex-direction: column; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s4); border-bottom: 1px solid var(--line); background: var(--surface); }
.ai-head b { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-lg); color: var(--primary-dark); }
.ai-head b svg { width: 20px; height: 20px; }
.ai-left { font-size: var(--fs-sm); color: var(--muted); margin-left: auto; }
.ai-left.none { color: var(--late); font-weight: 700; }
.ai-x { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--ink-2); padding: 0; }
@media (hover: hover) { .ai-x:hover { background: var(--surface-2); } } .ai-x svg { width: 20px; height: 20px; }
.ai-main { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
/* 標題列與按鈕列不能拖：CSS 擋，不用 JS(非 passive 的 touchmove 會讓捲動先等主執行緒) */
.ai-head, .ai-bar { touch-action: none; }
.ai-new { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
          background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-2); cursor: pointer; }
.ai-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); overscroll-behavior: contain; touch-action: pan-y; }
.ai-hello { color: var(--ink-2); } .ai-hello p { margin: 0 0 var(--s3); } .ai-hello .hint { color: var(--muted); font-size: var(--fs-sm); }
.ai-ex { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s3); }
.chip-btn { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
@media (hover: hover) { .chip-btn:hover { border-color: var(--primary); } }
.ai-msg { display: flex; flex-direction: column; max-width: 88%; }
.ai-msg.me { align-self: flex-end; align-items: flex-end; } .ai-msg.ai { align-self: flex-start; }
.ai-bubble { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: var(--fs-md); }
.ai-msg.me .ai-bubble { background: var(--primary-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.ai-msg.ai .ai-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.err .ai-bubble { background: var(--late-soft); color: var(--late); border-color: transparent; }
.ai-wait { color: var(--muted); }
/* 回答框用滿整個寬度；複製鈕在回答框下面、跟回答框右邊切齊 (2026-10-20 Jacky：放右邊太佔回答的寬度) */
.ai-msg.ai { flex-direction: column; align-items: flex-end; gap: 6px; max-width: 100%; }
.ai-msg.ai .ai-bubble { min-width: 0; max-width: 100%; align-self: stretch; }
.ai-copy { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px;
           border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.ai-copy svg { width: 15px; height: 15px; flex: none; }
@media (hover: hover) { .ai-copy:hover { color: var(--primary-dark); border-color: #f3bfdc; } }
.ai-copy.done { color: var(--primary-dark); background: var(--primary-soft); border-color: #f3bfdc; }
.ai-foot { border-top: 1px solid var(--line); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--surface); }
.ai-foot textarea { width: 100%; min-height: 84px; resize: none; font-size: var(--fs-md); line-height: 1.55; overscroll-behavior: contain; display: block; }
/* 鍵盤開著時面板底部已在鍵盤上方，不用再讓出 Home 指示條的空間 */
.ai-panel.kb .ai-foot { padding-bottom: var(--s3); }
.ai-note { margin: 0 0 var(--s2); padding: 8px 12px; border-radius: var(--r-sm); background: var(--late-soft); color: var(--late); font-size: var(--fs-sm); font-weight: 600; }
/* 自己貼的長文字摺成 8 行，按「展開」看全部 */
.ai-msg.me.fold .ai-bubble { max-height: calc(1.65em * 8 + 20px); overflow: hidden; }
.ai-more { margin-top: 4px; border: 0; background: none; color: var(--primary-dark); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; padding: 4px 6px; }
.ai-bar { display: flex; gap: var(--s2); margin-top: var(--s2); align-items: center; }
.ai-bar .btn { height: 48px; padding: 0 18px; font-size: var(--fs-md); }
.ai-bar .ai-clear { margin-right: auto; }
.ai-bar .ai-mic { width: 48px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }
.ai-bar .ai-mic svg { width: 22px; height: 22px; }
.ai-bar .ai-mic.rec { background: var(--late); color: #fff; border-color: var(--late); }
@media (max-width: 719px) {
  .ai-panel { padding: 0; }
  .ai-box { max-width: none; height: 100%; border-radius: 0; }
}

/* 首頁最上面：我這班要寫的院生 (院生分配票 01，2026-10-31)
   標題一列 (標題、班別、進度，窄螢幕放不下就折到下一列)；院生一列一位：勾、名字、生活班、誰寫過、箭頭，同一條中線。
   介面對齊鐵律：每一列的元件都是單行、align-items:center，交付前用 Playwright WebKit 量過。 */
#myshift:not(:empty) { margin-bottom: var(--s4); }
.my-shift { padding: var(--s3) 0 var(--s2); }
.my-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s2); }
.my-title { font-size: var(--fs-md); font-weight: 800; line-height: 1.5; margin-right: auto; }
.my-head .chip { height: 24px; line-height: 20px; }
.my-rows { display: flex; flex-direction: column; }
.my-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px var(--s4); color: var(--ink); text-decoration: none;
          border-top: 1px solid var(--line); }
@media (hover: hover) { .my-row:hover { background: var(--primary-soft); } }
.my-row .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.my-row.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.my-row .tick svg { width: 14px; height: 14px; display: block; }
.my-name { flex: none; font-weight: 700; font-size: var(--fs-md); line-height: 22px; white-space: nowrap; }
.my-class { flex: none; font-size: var(--fs-xs); line-height: 22px; color: var(--muted); white-space: nowrap; }
.my-by { flex: 0 1 auto; min-width: 0; margin-left: auto; font-size: var(--fs-xs); line-height: 22px; color: var(--ok); font-weight: 600;
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-row:not(.done) .my-class { margin-right: auto; }
.my-row.done .my-name { color: var(--ink-2); }
.my-row .chev { flex: none; color: var(--ph); width: 18px; height: 18px; }
.my-row .chev svg { width: 18px; height: 18px; display: block; }
.my-hint { margin-bottom: 0; align-items: center; line-height: 1.5; }

/* 今天還沒有生活紀錄的記號 (照顧紀錄改版票 01，規格 D18、預設值 12)：名字前一個小圓點，有了就消失。
   有紀錄的人留同寬空位 (visibility hidden)，名字上下對齊；我這班與生活班清單共用。
   顏色用提醒色 (warn，同首頁提醒橫幅)：未寫的空心勾是淺灰框，做成 8px 圓點在白底上看不出來，所以不照抄。
   介面對齊鐵律：圓點是 flex 子元素、align-items:center，跟名字同一條中線，交付前用 Playwright WebKit 量過。 */
.life-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); visibility: hidden; }
.life-dot.miss { visibility: visible; }
.my-row .life-dot { margin-right: -4px; }   /* 跟名字近一點 (列的間距 10px，圓點與名字 6px) */

/* ── 首頁「寫紀錄」(照顧紀錄改版票 04，規格 E23 到 E32) ──
   首頁最上面整寬一顆：麥克風圖示＋兩行字 (寫紀錄／先講院生名字，再講內容)；錄音中、等待、候選、打字都畫在同一個位置。
   介面對齊鐵律：同一列的元件 align-items:center，按鈕列同高 52px；交付前用 Playwright WebKit (iPhone 13、電腦 1280) 量過。 */
#quick { margin-bottom: var(--s4); }
.quick-btn { width: 100%; min-height: 72px; padding: 12px 20px; border-radius: var(--r-lg); gap: 12px; justify-content: center; }
.quick-btn svg { width: 30px; height: 30px; }
.quick-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; min-width: 0; }
.quick-label b { font-size: var(--fs-xl); font-weight: 800; }
.quick-label small { font-size: var(--fs-sm); font-weight: 600; opacity: .92; white-space: normal; text-align: left; }
.quick-card { display: flex; flex-direction: column; gap: var(--s3); }
.quick-title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.4; }
/* 錄音中、等待：停止鈕 (同院生頁的紅色圓鈕)、兩行字、秒數同一條中線 */
.quick-rec { flex-direction: row; align-items: center; min-height: 88px; }
.quick-rec .spinner { flex: none; width: 32px; height: 32px; }
.quick-rec-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.quick-rec-text b { font-size: var(--fs-md); }
.quick-rec-text small { font-size: var(--fs-sm); color: var(--muted); }
.quick-rec .rec-time { flex: none; font-size: var(--fs-lg); line-height: 1; }
.quick-wait { font-size: var(--fs-md); color: var(--primary-dark); font-variant-numeric: tabular-nums; }
/* 候選：大按鈕，名字大字在左、生活班在右，手機一欄、電腦三欄 */
.cand-list { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
@media (min-width: 720px) { .cand-list { grid-template-columns: repeat(3, 1fr); } }
/* 候選卡是這個畫面最顯眼的 (票 04 審查第 6 點)：洋紅粗框、淡洋紅底 */
.cand-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 64px; padding: 0 var(--s4);
            border: 2px solid var(--primary); border-radius: var(--r-md); background: var(--primary-soft); color: var(--ink); cursor: pointer; text-align: left;
            box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 18%, transparent); }
.cand-btn b { font-size: var(--fs-xl); font-weight: 800; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.cand-btn span { flex: none; font-size: var(--fs-sm); color: var(--primary-dark); font-weight: 700; line-height: 1.3; }
@media (hover: hover) { .cand-btn:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); } }
.quick-none { width: 100%; height: 52px; }
/* 取消：小的文字鈕，放在卡片最下面靠右 */
.quick-foot { display: flex; justify-content: flex-end; margin-top: calc(-1 * var(--s1)); }
.link-btn { height: 36px; padding: 0 var(--s2); border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 600;
            text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { .link-btn:hover { color: var(--primary-dark); } }
/* 列出候選時下面的區塊變淡、不能點 (票 04 審查第 2 點) */
.quick-dim { opacity: .35; pointer-events: none; }
/* 打字卡的麥克風鈕 (重新錄音)：跟取消、送出同高 52 */
.quick-actions .btn.mic { width: 52px; height: 52px !important; }
.cand-btn:active { transform: scale(.98); }
.quick-said { font-size: var(--fs-sm); color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s2) var(--s3);
              overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-wrap; word-break: break-word; }
.quick-said span { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.quick-actions { margin-top: 0; }
.quick-actions .btn { height: 52px; padding: 0 12px; white-space: normal; line-height: 1.25; text-align: center; }
.quick-classes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
@media (min-width: 720px) { .quick-classes { grid-template-columns: repeat(4, 1fr); } }
.quick-classes .btn { height: 52px; text-decoration: none; }
.quick-card textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.quick-card textarea::placeholder { color: var(--ph); }
.quick-why { margin-bottom: 0; align-items: center; }
.banner.carry { align-items: center; }
.banner.carry .btn { flex: none; height: 34px; }
/* 院生頁的草稿狀態 (寫紀錄帶來、還沒儲存)：名字換成可點的「換人」按鈕，跟下拉同高 46px；儲存或取消後變回下拉 */
.who-btn { margin-left: auto; height: 46px; max-width: 70%; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; cursor: pointer;
           border: 1.5px solid var(--primary); border-radius: var(--r-md); background: var(--primary-soft); color: var(--ink); font: inherit; }
.who-name { flex: none; font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; white-space: nowrap; }   /* 名字一定完整顯示 (同仁要核對是誰) */
.who-tag { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--primary-dark); line-height: 1; }
.who-tag svg { width: 14px; height: 14px; display: block; }
/* 印尼文「Ganti penghuni」太長：手機上只留換人圖示，名字不被擠掉 (完整說明在 title 與 aria-label) */
@media (max-width: 719px) { html[lang="id"] .who-tag-text { display: none; } }
.nav-row:not(.draft) .who-btn { display: none; }
.nav-row.draft #jump { display: none; }
/* 換人視窗：先四個生活班，再一列一位 */
.swap-classes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.swap-classes .btn { height: 52px; }
.swap-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.swap-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 52px; padding: 0 var(--s4); border: 0;
            border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-lg); font-weight: 700; cursor: pointer; text-align: left; }
.swap-row:last-child { border-bottom: 0; }
.swap-row:disabled { cursor: default; color: var(--muted); }
.swap-row svg { width: 18px; height: 18px; color: var(--ph); flex: none; }
@media (hover: hover) { .swap-row:not(:disabled):hover { background: var(--primary-soft); } }
