:root {  color-scheme: light; /* 不論手機設定深色或淺色，一律顯示淺色 */
  --bg: #f4f7f5; --card: #fff; --ink: #1d2a26; --muted: #66756f; --line: #dfe7e3;
  --brand: #1f8a70; --brand-ink: #fff; --head: #d3efe3;
  --vs: #1763c6; --r: #1c8a4a;
  --rest: #d8231c; --nat: #d9730d; --sp: #8a3fc4; --offo: #7b8782;
  --day: #f0f3f1; --offday: #dfe3e1;
  --sw: #dcecff; --sc: #d8f3dc; --sk: #e6dcff; --sd: #ffe6c2; /* 白班 A/B/J・中班 C・小夜 K・值班 D/M */
  --me: #fff3a8; --warn: #fff4d6; --danger: #c62828;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; line-height: 1.45; padding-bottom: 76px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 12px; }
.wrap.wide { max-width: 1100px; }
.topbar { background: var(--head); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar .wrap { padding-top: 8px; padding-bottom: 8px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title-row h1 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.logo { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.me-pick { max-width: 9.5em; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.datebar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.datebar .date-main { flex: 1; text-align: center; font-weight: 700; font-size: 1.1rem; position: relative; }
.datebar input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; min-height: 42px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.chips { display: flex; gap: 4px; margin-top: 6px; }
.chip-day { flex: 1; min-width: 0; text-align: center; padding: 4px 0; border-radius: 10px; border: 1px solid transparent; background: transparent; font-size: .8rem; line-height: 1.25; }
.chip-day b { display: block; font-size: .95rem; }
.chip-day.sel { background: var(--brand); color: var(--brand-ink); }
.chip-day.today { border-color: var(--brand); }
.chip-day.wk { color: var(--rest); }
.chip-day.sel.wk { color: var(--brand-ink); }
.chip-day small { display: block; font-size: .7rem; opacity: .85; min-height: 1em; }

main { padding-top: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden; }
.card > h2 { margin: 0; padding: 10px 14px; font-size: 1rem; background: var(--head); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card > h2 small { font-weight: 400; color: var(--muted); }
.card .body { padding: 10px 14px; }
.notice { background: var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
.err { color: var(--danger); }
.muted { color: var(--muted); }
.pills { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.pill.me-banner { background: var(--me); border-color: transparent; font-weight: 600; }

/* 醫師 */
.vs, .rr { font-weight: 700; white-space: nowrap; }
.vs { color: var(--vs); } .rr { color: var(--r); }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; color: #fff; }
.tag.vs { background: var(--vs); color: #fff; } .tag.rr { background: var(--r); color: #fff; }
.card .body.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.blk { border-bottom: 1px dashed var(--line); padding: 8px 0; }
.blk:last-child { border: 0; }
.cols .blk .docs { gap: 2px 10px; }
.cols .blk-h .rooms { display: none; }
.blk-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.blk-h b { font-size: 1rem; }
.blk-h .rooms { font-size: .82rem; color: var(--muted); }
.docs { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 6px; }
.room { background: var(--day); border-radius: 8px; padding: 4px 8px; font-size: .92rem; display: flex; justify-content: space-between; gap: 6px; }
.room span:first-child { color: var(--muted); }
.room span:last-child { font-weight: 600; text-align: right; }

/* 人力 */
details.grp { border-top: 1px solid var(--line); }
details.grp:first-of-type { border-top: 0; }
details.grp > summary { padding: 10px 14px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; list-style: none; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary::after { content: '▾'; color: var(--muted); margin-left: 8px; }
details.grp[open] > summary::after { content: '▴'; }
details.grp > summary span { flex: 1; }
details.grp > summary small { font-weight: 400; color: var(--muted); }
.grp-open { border-top: 1px solid var(--line); padding-bottom: 4px; }
.grp-open:first-of-type { border-top: 0; }
.grp-h { padding: 8px 14px 4px; font-weight: 700; display: flex; justify-content: space-between; }
.grp-r { display: flex; align-items: center; gap: 10px; }
.leader { background: var(--head); border-radius: 999px; padding: 1px 10px; font-size: .85rem; font-weight: 700; }
.grp-h small { font-weight: 400; color: var(--muted); }
.person.docp { cursor: default; }
.person small { margin-left: auto; font-size: .75rem; }
.ppl { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 10px; padding: 0 14px 10px; }
.person { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 8px; font-size: 1rem; border: 0; background: transparent; text-align: left; }
.person.me { background: var(--me); }
.code { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; border-radius: 6px; padding: 0 5px; font-size: .9rem; }
.cc-day { background: var(--sw); } .cc-mid { background: var(--sc); } .cc-night { background: var(--sk); } .cc-duty { background: var(--sd); } .cc-other { background: var(--day); }
.cc-rest { color: var(--rest); font-weight: 800; } .cc-nat { color: var(--nat); font-weight: 800; } .cc-sp { color: var(--sp); font-weight: 800; } .cc-offo { color: var(--offo); } .cc-none { color: var(--muted); }
.offgrid { padding: 8px 14px 12px; display: grid; gap: 6px; }
.offrow { display: flex; gap: 8px; align-items: baseline; }
.offrow b { min-width: 3.2em; }

/* 個人月曆 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { text-align: center; font-weight: 600; padding: 4px 0; background: var(--head); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9rem; }
.cal-h.wk { color: var(--rest); }
.cal-cell { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); min-height: 62px; padding: 3px 2px; text-align: center; display: flex; flex-direction: column; justify-content: space-between; align-items: center; border-radius: 0; }
.cal-cell small { font-size: .72rem; color: var(--muted); align-self: flex-start; padding-left: 3px; }
.cal-cell .big { font-size: 1.25rem; font-weight: 700; padding-bottom: 4px; }
.cal-cell.wk { background: var(--offday); }
.mx thead th.offh { background: color-mix(in srgb, var(--head) 70%, var(--offday)); }
.outer-line { padding: 2px 0; } .outer-line.first { font-weight: 700; margin-top: 6px; }
.announce { white-space: pre-wrap; }
.cal-cell.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal-cell.selc { background: var(--me); }
.sumrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 12px; }
.sumbox { text-align: center; background: var(--day); border-radius: 10px; padding: 6px 2px; font-size: .85rem; }
.sumbox b { display: block; font-size: 1.2rem; }

/* 矩陣 */
.mx-scroll { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.mx { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 100%; }
.mx th, .mx td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; padding: 0; }
.mx thead th { position: sticky; top: 0; z-index: 3; background: var(--head); padding: 4px 1px; font-size: .74rem; line-height: 1.2; min-width: 38px; }
.mx thead th b { display: block; font-size: .92rem; }
.mx thead th.wk { color: var(--rest); }
.mx .nm { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; padding: 4px 6px; white-space: nowrap; font-weight: 600; font-size: .86rem; width: 64px; min-width: 64px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .mx .nm { width: 90px; min-width: 90px; max-width: 90px; font-size: 1rem; } .mx thead th { min-width: 56px; } }
.cal-cell .big.code { background: none; }
.zoom { display: inline-flex; gap: 4px; } .zoom .btn { padding: 6px 10px; min-width: 38px; }
.mx-scroll { --z: 1; max-height: calc(100vh - 200px); }
.mx-scroll .mx thead th { min-width: calc(38px * var(--z)); font-size: calc(.74rem * var(--z)); padding: calc(4px * var(--z)) 0; }
.mx-scroll .mx thead th b { font-size: calc(.92rem * var(--z)); }
.mx-scroll .mx .nm { width: calc(64px * var(--z)); min-width: calc(64px * var(--z)); max-width: calc(64px * var(--z)); font-size: calc(.86rem * var(--z)); padding: calc(4px * var(--z)) calc(3px * var(--z)); }
.mx-scroll .mx td button { min-height: calc(30px * var(--z)); font-size: max(.8rem, calc(1rem * var(--z))); line-height: 1; padding: 0; }
.mx-scroll .mx .nm { font-size: max(.78rem, calc(.86rem * var(--z))); line-height: 1; padding-top: calc(3px * var(--z)); padding-bottom: calc(3px * var(--z)); width: calc(64px * max(var(--z), .85)); min-width: calc(64px * max(var(--z), .85)); max-width: calc(64px * max(var(--z), .85)); }
@media (min-width: 640px) {
  .mx-scroll .mx thead th { min-width: calc(56px * var(--z)); }
  .mx-scroll .mx .nm { width: calc(90px * var(--z)); min-width: calc(90px * var(--z)); max-width: calc(90px * var(--z)); font-size: max(.8rem, calc(1rem * var(--z))); }
}
.mx thead .nm { z-index: 4; background: var(--head); }
.mx .nm.me { background: var(--me); }
.mx td button { width: 100%; height: 100%; min-height: 40px; border: 0; background: transparent; font-weight: 700; }
.mx td.colsel { background: color-mix(in srgb, var(--me) 45%, transparent); }
.mx td.cc-day button { background: var(--sw); } .mx td.cc-mid button { background: var(--sc); } .mx td.cc-night button { background: var(--sk); } .mx td.cc-duty button { background: var(--sd); } .mx td.cc-other button { background: var(--day); }
.docline { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 2px 14px 6px; padding: 5px 10px; background: var(--day); border-radius: 8px; font-size: .92rem; }
.docline > span:first-child { color: var(--muted); white-space: nowrap; }
.docline > span:last-child { text-align: right; display: flex; gap: 2px 10px; flex-wrap: wrap; justify-content: flex-end; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; font-size: .78rem; margin-bottom: 10px; }
.legend span { padding: 1px 10px; border-radius: 999px; }
.mx td.cc-rest, .mx td.cc-nat, .mx td.cc-sp, .mx td.cc-offo, .mx td.cc-none { background: transparent; }
.mx tr.sepr td, .mx tr.sepr th { border-top: 2px solid var(--line); }
.sel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sel-chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; display: inline-flex; gap: 4px; align-items: center; }
.sel-chip button { border: 0; background: transparent; font-size: 1.1rem; line-height: 1; padding: 0 6px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
input[type=text], input[type=date], input[type=password], input[type=search], select, textarea { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-height: 42px; }
.picklist { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-top: 6px; }
.picklist button { display: flex; justify-content: space-between; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.picklist button:disabled { opacity: .4; }

/* 表單 */
label.f { display: block; margin: 10px 0 4px; font-weight: 600; font-size: .92rem; }
.swap-preview { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; background: var(--day); border-radius: 10px; margin-top: 10px; text-align: center; }
.swap-preview .arrow { font-size: 1.4rem; color: var(--muted); }
.status { white-space: nowrap; flex: none; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st-pending { background: var(--warn); } .st-approved { background: #cdeed8; color: #0d5a2b; } .st-rejected, .st-cancelled { background: #f6d4d4; color: #7a1c1c; }
.seg { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 0; font-weight: 600; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }
.swap-box { background: var(--day); border-radius: 10px; padding: 10px; margin-top: 10px; }
.swap-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.swap-row b { min-width: 4.5em; }
.swap-row .arrow { color: var(--muted); }
.req { padding: 10px 14px; border-top: 1px solid var(--line); }
.req:first-child { border-top: 0; }
.req .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* 底部導覽 */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; text-align: center; padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: .78rem; }
nav.tabs a span { display: block; font-size: 1.3rem; line-height: 1.1; }
nav.tabs a.on { color: var(--brand); font-weight: 700; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 8px; }
.sheet .btn { width: 100%; margin-top: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 4px; }
.keypad .btn { font-size: 1.15rem; font-weight: 600; min-height: 46px; }
@media (hover: none) { .keypad { display: none; } } /* 手機有自己的數字鍵盤，不需要 */
.osk { margin: 10px 0 4px; display: grid; gap: 5px; }
.osk-row { display: flex; gap: 5px; justify-content: center; }
.osk-row button { flex: 1 1 0; min-width: 0; max-width: 54px; min-height: 42px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; font-size: 1.05rem; font-weight: 600; padding: 0; }
.osk-row button.wide { max-width: none; flex: 1.6 1 0; font-size: .9rem; }
.osk-row button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (hover: none) { .osk { display: none; } } /* 手機有自己的鍵盤 */
/* 換班已生效、後台還沒核准的格子 */
.mx td.pend { position: relative; }
.mx td.pend button { box-shadow: inset 0 0 0 3px #f59e0b; }
.mx td.pend::after { content: '⏳'; position: absolute; top: 0; right: 1px; font-size: .62rem; pointer-events: none; }
.cal-cell { position: relative; }
.cal-cell.pend { outline: 3px solid #f59e0b; outline-offset: -3px; }
.cal-cell.pend::after { content: '⏳'; position: absolute; top: 2px; right: 4px; font-size: .75rem; }
.person .pm { margin-left: 2px; font-size: .8rem; }
/* 醫師班表（一天一列，照原本 Excel 的排版） */
.dt-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.dt { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .92rem; }
.dt th, .dt td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: center; white-space: nowrap; line-height: 1.3; }
.dt thead th { position: sticky; z-index: 3; font-weight: 700; }
.dt thead tr:first-child th { top: 0; height: 28px; }
.dt thead tr:nth-child(2) th { top: 29px; font-size: .8rem; }
.dt .g-vs { background: var(--sw); } .dt .g-r { background: var(--sd); } .dt .g-e { background: var(--head); }
.dt th.dc { position: sticky; left: 0; z-index: 2; background: var(--card); min-width: 52px; cursor: pointer; }
.dt thead th.dc { z-index: 5; background: var(--head); top: 0; cursor: default; }
.dt th.dc small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.dt tr.off td, .dt tr.off th.dc { background: var(--offday); }
.dt tr.today th.dc { box-shadow: inset 3px 0 0 var(--brand); }
.dt td .hit { background: var(--me); border-radius: 4px; padding: 0 3px; }
.mask { -webkit-text-security: disc; text-security: disc; }
.mx td.offday { background: var(--offday); }
.mx td.colsel { background: color-mix(in srgb, var(--me) 45%, transparent); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 90%; }

/* 特休 */
.lv-head, .lv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.lv-head span { text-align: center; font-size: .8rem; font-weight: 700; padding: 4px 0; color: var(--muted); }
.lv-head span.wk { color: var(--rest); }
.lv-day { display: flex; flex-direction: column; align-items: stretch; min-height: 76px; padding: 2px 1px 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); text-align: left; font: inherit; color: inherit; overflow: hidden; }
.lv-day.empty { border: 0; background: transparent; }
.lv-day.wk { background: var(--offday); }
.lv-day.hol .lv-n { color: var(--rest); }
.lv-day.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.lv-n { font-size: .78rem; font-weight: 700; padding: 0 3px; display: flex; gap: 2px; align-items: baseline; }
.lv-n small { font-size: .56rem; font-weight: 600; color: var(--rest); white-space: nowrap; overflow: hidden; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 1px 2px; padding: 1px 2px; align-content: flex-start; }
.lv-chip { font-size: .8rem; line-height: 1.25; padding: 0 3px; border-radius: 4px; background: rgba(0,0,0,.06); white-space: nowrap; }
.lv-chip.mine { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.lv-chip.lock { background: rgba(0,0,0,.14); }
.lv-chip.pend { box-shadow: inset 0 0 0 1.5px #f59e0b; }
.lv-chip.hit { background: #ffe38a; color: #000; font-weight: 700; box-shadow: 0 0 0 1.5px #d49a00; }
.lv-chip.dim { opacity: .3; }
.lv-day.frozen, .lv-day.frozen.wk { background: #f9d3d3; border-color: #e08f8f; }
.lv-day.frozen .lv-chip { background: rgba(160,30,30,.14); }
.lv-day.frozen .lv-chip.mine { background: #b42318; color: #fff; }
.lv-weeks { display: flex; flex-direction: column; gap: 10px; }
.lv-week { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 3px 3px 5px; }
.lv-wh, .lv-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.lv-wh { margin-bottom: 3px; }
.lv-dh { display: flex; flex-direction: column; align-items: center; padding: 2px 0; border: 0; border-radius: 6px; background: var(--head, #eef3ef); font: inherit; color: inherit; line-height: 1.15; min-width: 0; }
.lv-dh .lv-wd { font-size: .62rem; color: var(--muted); }
.lv-dh b { font-size: .86rem; }
.lv-dh small { font-size: .52rem; color: var(--rest); white-space: nowrap; overflow: hidden; max-width: 100%; }
.lv-dh.wk { background: var(--offday); } .lv-dh.wk b, .lv-dh.hol b { color: var(--rest); }
.lv-dh.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.lv-dh.frozen { background: #f4c4c4; }
.lv-row { margin-top: 2px; }
.lv-bar { height: 25px; border: 0; border-radius: 6px; background: #cfe3d6; color: #123; font: inherit; font-size: .8rem; font-weight: 700; padding: 0 5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lv-bar.mine { background: var(--brand); color: var(--brand-ink); }
.lv-bar.lock { background: #c9ccd1; }
.lv-bar.pend { box-shadow: inset 0 0 0 2px #f59e0b; }
.lv-bar.frozen { background: #e9a3a3; color: #4a0d0d; } .lv-bar.frozen.mine { background: #b42318; color: #fff; }
.lv-bar.hit { background: #ffe38a; color: #000; box-shadow: 0 0 0 2px #d49a00; }
.lv-bar.dim { opacity: .3; }
.lv-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; } .lv-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lv-none { text-align: center; font-size: .78rem; color: var(--muted); padding: 4px 0; }
.lv-bar.sh { padding: 0 1px; font-size: .72rem; text-align: center; letter-spacing: -.03em; }
.lv-dh.out { opacity: .55; } .lv-dh.out b { font-weight: 600; font-size: .78rem; }
.lv-row { min-height: 25px; }
.lv-week { position: relative; }
.lv-cap { font-size: .74rem; font-weight: 700; color: var(--muted); padding: 1px 4px 3px; }
.lv-lines { position: absolute; left: 3px; right: 3px; top: 22px; bottom: 3px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; pointer-events: none; z-index: 0; }
.lv-lines i { border-left: 1.5px dashed rgba(0,0,0,.28); } .lv-lines i:first-child { border-left: 0; }
.lv-wh, .lv-row { position: relative; z-index: 1; }
.lv-dh.out { opacity: 1; }
.mx td.warn { position: relative; }
.mx td.warn button { box-shadow: inset 0 0 0 3px #dc2626; }
.mx td.warn::after { content: '⚠'; position: absolute; top: 0; right: 1px; font-size: .62rem; color: #dc2626; pointer-events: none; }
.cal-cell.warn { outline: 3px solid #dc2626; outline-offset: -3px; }
.cal-cell.warn::after { content: '⚠'; position: absolute; top: 2px; right: 4px; font-size: .75rem; color: #dc2626; }
.ord { margin: 10px 0; padding: 10px 14px; }
.ord summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ord-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ord-it { display: inline-flex; align-items: center; gap: 4px; background: #eef5ff; border: 1px solid #bcd3f5; border-radius: 999px; padding: 3px 10px 3px 4px; font-size: .95rem; }
.ord-it.me { background: #fff3d6; border-color: #f59e0b; font-weight: 700; }
.ord-it i { font-style: normal; background: #2563eb; color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ord-b { margin-left: 4px; background: #2563eb; color: #fff; border-radius: 999px; min-width: 18px; padding: 0 5px; font-size: .72rem; font-weight: 700; display: inline-block; text-align: center; }
.ord { margin: 6px 0; padding: 6px 12px; }
.ord summary { font-size: .9rem; }
.ord-list { gap: 4px; margin-top: 6px; }
.ord-it { font-size: .82rem; padding: 1px 8px 1px 2px; }
.ord-it i { min-width: 18px; height: 18px; font-size: .7rem; }
.ord-b { margin: 0 4px 0 0; margin-left: 0; min-width: 0; padding: 0 5px; font-size: .68rem; line-height: 1.5; flex: none; }
.lv-legend { margin: 6px 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .78rem; color: var(--muted, #667); }
.lv-ctl { position: sticky; top: var(--tbh, 56px); z-index: 15; display: flex; gap: 6px; padding: 6px 0; background: var(--bg, #f4f6f4); }
.lv-ctl select { flex: 1.2; min-width: 0; } .lv-ctl input { flex: 1; min-width: 0; margin: 0; } .lv-ctl .btn { white-space: nowrap; }
.swrule { margin-bottom: 8px; padding: 8px 12px; } .swrule summary { cursor: pointer; } .swrule ul { margin: 6px 0 0; padding-left: 20px; font-size: .88rem; line-height: 1.6; }
.swt { width: 100%; border-collapse: collapse; font-size: .85rem; }
.swt th, .swt td { padding: 6px 6px; text-align: left; vertical-align: top; }
.swt thead th { font-size: .75rem; color: var(--muted, #667); border-bottom: 1px solid var(--line); font-weight: 600; }
.swt tr.dh th { background: #e7f1ec; font-size: .9rem; padding: 6px 8px; }
.swt tr.dh th small { float: right; font-weight: 400; color: var(--muted, #667); }
.swt tr.dh.past th { background: #eceeed; color: #667; font-size: .8rem; }
.swt tbody tr:not(.dh) td { border-bottom: 1px solid var(--line); }
.swt td.pp div { line-height: 1.5; } .swt td.by small { display: block; color: var(--muted, #667); font-size: .72rem; }
.swt td.tm { font-size: .75rem; color: var(--muted, #667); white-space: nowrap; line-height: 1.5; }
.swt .status { font-size: .72rem; white-space: nowrap; }
.swt td.dt1 { white-space: nowrap; font-weight: 600; } .swt td.dt1 small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.swt tr.hasact td { border-bottom: 0 !important; } .swt tr.act td { padding: 2px 6px 10px; border-bottom: 1px solid var(--line); }
.swt tr.dh[data-g] th { cursor: pointer; user-select: none; }
.swt .car::before { content: '▸'; display: inline-block; width: 1.1em; color: #4b6b5d; }
.swt tr.dh.open .car::before { content: '▾'; }
.swt .pn { color: #b45309; background: #fff3d6; border-radius: 999px; padding: 0 8px; font-size: .75rem; }
.swt tr.dh.nox th { cursor: default; }
