/* Auto Shift — スマホ優先。色の約束: 青=操作, 緑=正常, 黄/橙=要確認, 赤=不足・重大, 灰=補助 */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --tap: 44px; --radius: 12px; --radius-sm: 8px;
  --font: 16px; --font-sm: 15px; --font-xs: 13px; --font-lg: 20px;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #eef2f7; --border: #d9dee6;
  --text: #1b2430; --muted: #66707d;
  --blue: #1769d6; --blue-bg: #e4eefb; --blue-text: #0f4ea8;
  --green: #2aa15f; --green-bg: #e3f5ea; --green-text: #1b7a45;
  --orange: #e2a300; --orange-bg: #fff3d6; --orange-text: #8a5a00;
  --red: #d8463a; --red-bg: #fde7e4; --red-text: #a62b21;
  --grey: #9aa5b4; --grey-bg: #eceff3;
  --rank-a: #ead9ff; --rank-b: #d6e8ff; --rank-c: #dcf3e3; --rank-d: #e9ecf0;
  --header-h: 52px; --tabs-h: 56px;
  --shadow: 0 2px 10px rgba(20, 30, 50, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720; --surface: #182230; --surface-2: #1f2b3a; --border: #2c3a4c;
    --text: #e8edf3; --muted: #9aa7b6;
    --blue: #4b8ff0; --blue-bg: #1b3050; --blue-text: #9cc4ff;
    --green: #3fbf78; --green-bg: #173826; --green-text: #8fe0b1;
    --orange: #f0b429; --orange-bg: #3b2e0e; --orange-text: #ffd57a;
    --red: #ef6b5f; --red-bg: #44201c; --red-text: #ffb0a7;
    --grey: #7d8896; --grey-bg: #243040;
    --rank-a: #3d2a5c; --rank-b: #223a5c; --rank-c: #1f4631; --rank-d: #2a3340;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: var(--font); line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: var(--font-lg); }
h2 { font-size: 17px; }
h3 { font-size: var(--font); }
p { margin: 0; }
ul { margin: 0; padding-left: 1.2em; }
a { color: var(--blue); }
[hidden] { display: none !important; }

/* ---------- レイアウト ---------- */
.header { position: sticky; top: 0; z-index: 20; height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); display: flex; align-items: center; gap: var(--space-2); padding-left: var(--space-2); padding-right: var(--space-2); background: var(--surface); border-bottom: 1px solid var(--border); }
.header .title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.header .icon-btn { width: var(--tap); height: var(--tap); border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: var(--blue); flex: none; }
.header .icon-btn:active { background: var(--surface-2); }
.header .spacer { width: var(--tap); flex: none; }
.main { padding: var(--space-3) var(--space-3) calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--space-5)); max-width: 1100px; margin: 0 auto; }
.main.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-5)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; min-height: var(--tap); }
.tabs button .ico { font-size: 22px; line-height: 1; }
.tabs button.active { color: var(--blue); font-weight: 700; }
.tabs[hidden] { display: none; }

/* 週バー */
.weekbar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.weekbar .period { flex: 1; text-align: center; font-weight: 700; font-size: var(--font); border: 0; background: transparent; min-height: var(--tap); white-space: nowrap; }
.weekbar .period small { display: block; font-weight: 400; color: var(--muted); font-size: var(--font-xs); }

/* ---------- 部品 ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-4); margin-bottom: var(--space-3); }
.card h2 { margin-bottom: var(--space-2); }
.card .sub { color: var(--muted); font-size: var(--font-sm); }
.row { display: flex; align-items: center; gap: var(--space-2); }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--font-xs); }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: var(--space-3); }
.mb { margin-bottom: var(--space-3); }
.stack > * + * { margin-top: var(--space-2); }

.btn { min-height: var(--tap); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--font); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.secondary { background: var(--blue-bg); border-color: transparent; color: var(--blue-text); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red-text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--font-sm); }
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: var(--font-sm); white-space: nowrap; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.sm { min-height: 28px; padding: 0 10px; font-size: var(--font-xs); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: var(--font-xs); font-weight: 600; white-space: nowrap; }
.badge.red { background: var(--red-bg); color: var(--red-text); }
.badge.orange { background: var(--orange-bg); color: var(--orange-text); }
.badge.green { background: var(--green-bg); color: var(--green-text); }
.badge.blue { background: var(--blue-bg); color: var(--blue-text); }
.badge.grey { background: var(--grey-bg); color: var(--muted); }

.banner { border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-3); font-size: var(--font-sm); border-left: 5px solid; }
.banner.red { background: var(--red-bg); color: var(--red-text); border-color: var(--red); }
.banner.orange { background: var(--orange-bg); color: var(--orange-text); border-color: var(--orange); }
.banner.green { background: var(--green-bg); color: var(--green-text); border-color: var(--green); }
.banner.blue { background: var(--blue-bg); color: var(--blue-text); border-color: var(--blue); }
.banner.grey { background: var(--grey-bg); color: var(--muted); border-color: var(--grey); }
.banner strong { display: block; margin-bottom: 4px; }
.banner ul { margin-top: 4px; }

.seg { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; margin-bottom: var(--space-3); }
.seg button { flex: 1; min-height: 38px; border: 0; background: transparent; border-radius: 6px; color: var(--muted); font-size: var(--font-sm); font-weight: 600; white-space: nowrap; padding: 0 4px; }
.seg button.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
.seg.tight button { font-size: var(--font-xs); }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: var(--space-3); }
.list .item { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: inherit; font-size: var(--font); }
.list .item:first-child { border-top: 0; }
.list .item.tap:active { background: var(--surface-2); }
.list .item .chev { color: var(--grey); margin-left: auto; }
.list .item .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-3); }
.field > label, .field > .label { font-size: var(--font-xs); color: var(--muted); font-weight: 600; }
.field input[type=text], .field input[type=number], .field input[type=search], .field select, .field textarea, .input, select.input {
  min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: var(--font); width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); }
.field.inline > label { font-size: var(--font); color: var(--text); font-weight: 500; flex: 1; }
.field.inline select, .field.inline input { width: auto; min-width: 110px; }
.field .hint { font-size: var(--font-xs); color: var(--muted); }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--grey); border: 0; flex: none; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 23px; }
.timepair { display: flex; align-items: center; gap: 6px; }
.timepair select { flex: 1; }

.segctl { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segctl button { min-height: 36px; padding: 0 10px; border: 0; background: var(--surface); color: var(--muted); font-size: var(--font-xs); border-left: 1px solid var(--border); white-space: nowrap; }
.segctl button:first-child { border-left: 0; }
.segctl button.on { background: var(--blue); color: #fff; }

/* ---------- 表 ---------- */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3); }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--font-sm); overflow: hidden; }
.tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl th { font-size: var(--font-xs); color: var(--muted); font-weight: 600; background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.name, .tbl th.name { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.tap { cursor: pointer; }
.tbl tr.tap:active td { background: var(--surface-2); }
.tbl td.dim, .tbl tr.dim td { color: var(--muted); }
.tbl .seghead td { background: var(--surface-2); font-size: var(--font-xs); color: var(--muted); font-weight: 700; padding: 4px 8px; }
.tbl.sticky-first { width: auto; min-width: 100%; }
.tbl.sticky-first th:first-child, .tbl.sticky-first td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border); }
.tbl.sticky-first th:first-child { background: var(--surface-2); }

/* 勤務希望グリッド */
.req-grid td.cell { padding: 0; }
.req-grid td.cell button { width: 100%; min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: var(--font-sm); font-weight: 600; color: var(--text); padding: 2px 4px; }
.req-grid td.cell button.empty { color: var(--grey); font-weight: 400; }
.req-grid td.cell button.ng { color: var(--muted); font-weight: 400; }
.req-grid td.cell button.pending { color: var(--orange-text); }
.req-grid td.cell button.today { box-shadow: inset 0 0 0 2px var(--blue-bg); }
.req-grid td.name { padding-top: 0; padding-bottom: 0; }
.req-grid td.name button { border: 0; background: transparent; padding: 0; font-weight: 600; text-align: left; min-height: 44px; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.req-grid th.dow.weekend { color: var(--red-text); }

/* 日別 */
.daynav { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.daynav .date { flex: 1; text-align: center; font-weight: 700; font-size: 18px; }
.dowchips { display: flex; gap: 4px; margin-bottom: var(--space-3); }
.dowchips button { flex: 1; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: var(--font-sm); font-weight: 600; color: var(--text); position: relative; padding: 0; }
.dowchips button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.dowchips button .mark { position: absolute; top: 1px; right: 4px; font-size: 11px; color: var(--red); font-weight: 700; }
.dowchips button.active .mark { color: #fff; }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
.statusbar button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: var(--font-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.statusbar button.red { background: var(--red-bg); border-color: transparent; color: var(--red-text); }
.statusbar button.orange { background: var(--orange-bg); border-color: transparent; color: var(--orange-text); }
.statusbar button.green { background: var(--green-bg); border-color: transparent; color: var(--green-text); }
.statusbar button.grey { background: var(--grey-bg); border-color: transparent; color: var(--muted); }
.statusbar button.open { outline: 2px solid var(--blue); }
.detail-panel { background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: var(--space-3); margin-bottom: var(--space-3); font-size: var(--font-sm); }
.detail-panel li + li { margin-top: 4px; }
.pin { color: var(--muted); font-size: var(--font-xs); }
.rankmark { color: var(--orange-text); font-weight: 700; }
.worktotal { font-size: 17px; font-weight: 700; }
.worktotal small { font-weight: 400; color: var(--muted); font-size: var(--font-xs); margin-left: 4px; }

/* 週間 */
.weekcols { display: flex; gap: var(--space-2); overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3) var(--space-2); scroll-snap-type: x proximity; }
.weekcol { flex: none; width: 176px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-2); scroll-snap-align: start; display: flex; flex-direction: column; }
.weekcol.short { box-shadow: var(--shadow), inset 0 3px 0 var(--red); }
.weekcol .head { border: 0; background: transparent; width: 100%; text-align: left; padding: 4px 4px 6px; font-weight: 700; font-size: var(--font); color: var(--blue); min-height: var(--tap); display: flex; flex-direction: column; justify-content: center; }
.weekcol .head small { color: var(--muted); font-weight: 500; font-size: var(--font-xs); }
.weekcol .badges { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 6px; min-height: 24px; }
.weekcol .seglabel { font-size: 11px; color: var(--muted); font-weight: 700; padding: 6px 4px 2px; border-top: 1px solid var(--border); }
.weekcol .line { display: flex; gap: 4px; padding: 4px; font-size: var(--font-sm); align-items: baseline; border: 0; background: transparent; width: 100%; text-align: left; color: inherit; min-height: 32px; }
.weekcol .line .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.weekcol .line .tm { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); font-size: 12px; flex: none; }
.weekcol .line.unfilled .nm { color: var(--red-text); font-weight: 500; }
.weekcol .foot { margin-top: auto; border-top: 1px solid var(--border); padding: 6px 4px 2px; font-size: var(--font-sm); font-weight: 700; }
.weekcol .foot small { color: var(--muted); font-weight: 400; font-size: var(--font-xs); }

/* 詳細ビュー */
.detail-wrap { overflow: auto; touch-action: pan-x pan-y pinch-zoom; margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3) var(--space-3); }
.detail-grid { display: flex; gap: 0; min-width: 1330px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: 13px; }
.detail-grid .dcol { flex: 1; min-width: 190px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.detail-grid .dcol:first-child { border-left: 0; }
.detail-grid .dcell { padding: 4px 6px; border-bottom: 1px solid var(--border); min-height: 28px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.detail-grid .dcell.head { background: var(--surface-2); font-weight: 700; justify-content: center; font-size: 14px; }
.detail-grid .dcell.head.weekend { color: var(--red-text); }
.detail-grid .dcell.note { font-size: 12px; color: var(--muted); white-space: normal; min-height: 36px; }
.detail-grid .dcell.seg { background: var(--surface-2); font-size: 11px; color: var(--muted); font-weight: 700; justify-content: center; }
.detail-grid .dcell.asg { justify-content: space-between; font-variant-numeric: tabular-nums; }
.detail-grid .dcell.asg .nm { font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.detail-grid .dcell.asg .hr { color: var(--muted); font-size: 11px; }
.detail-grid .dcell.rank-A { background: var(--rank-a); } .detail-grid .dcell.rank-B { background: var(--rank-b); }
.detail-grid .dcell.rank-C { background: var(--rank-c); } .detail-grid .dcell.rank-D { background: var(--rank-d); }
.detail-grid .dcell.unfilled { color: var(--red-text); justify-content: center; font-style: italic; }
.detail-grid .dcell.stat { justify-content: space-between; font-size: 12px; }
.detail-grid .dcell.stat b { font-variant-numeric: tabular-nums; }
.detail-grid .dcell.stat.over b { color: var(--orange-text); }
.detail-grid .filler { flex: 1; }

/* PNG */
.png-preview { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; display: block; }

/* ---------- シート（下から出るモーダル） ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 24, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--surface); width: 100%; max-width: 720px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .18s ease; padding-bottom: env(safe-area-inset-bottom); }
.sheet .sheet-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--border); flex: none; }
.sheet .sheet-head h2 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .sheet-head .icon-btn { width: var(--tap); height: var(--tap); border: 0; background: transparent; border-radius: 50%; font-size: 22px; color: var(--muted); flex: none; }
.sheet .sheet-body { padding: var(--space-4); overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.sheet .sheet-foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); flex: none; display: flex; gap: var(--space-2); }
.sheet .sheet-foot .btn { flex: 1; }
.dialog .sheet { border-radius: 18px; margin: 0 var(--space-4) var(--space-4); max-width: 480px; }
.dialog .sheet .sheet-body { white-space: pre-wrap; }
.sheet-backdrop.dialog { align-items: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.parse-result { border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--font-sm); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.parse-result.ok { background: var(--green-bg); color: var(--green-text); }
.parse-result.bad { background: var(--red-bg); color: var(--red-text); }
.parse-result.none { background: var(--grey-bg); color: var(--muted); font-weight: 400; }

.cand-list .item { display: flex; align-items: center; gap: var(--space-2); }
.cand-list .item .reason { color: var(--muted); font-size: var(--font-xs); margin-left: auto; white-space: nowrap; }
.cand-list .item.no { color: var(--muted); }
.cand-list .item.selected { background: var(--blue-bg); }
.rank-badge { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px; font-size: var(--font-xs); font-weight: 700; padding: 1px 4px; background: var(--grey-bg); color: var(--text); }
.rank-badge.A { background: var(--rank-a); } .rank-badge.B { background: var(--rank-b); } .rank-badge.C { background: var(--rank-c); } .rank-badge.D { background: var(--rank-d); }

/* トースト */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast { background: #222b36; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: var(--font-sm); box-shadow: var(--shadow); max-width: 90vw; animation: fade .2s ease; }
.toast.red { background: var(--red); } .toast.green { background: var(--green); } .toast.orange { background: var(--orange); color: #222; }

/* 進捗 */
.progress { height: 10px; background: var(--grey-bg); border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--blue); width: 0; transition: width .2s; }

/* 配置設定 */
.slot-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; margin-bottom: 8px; }
.slot-row { display: grid; grid-template-columns: 1fr auto 1fr 40px; gap: 6px; align-items: center; }
.slot-row select, .slot-row2 select { min-height: 40px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--font-sm); min-width: 0; }
.slot-row .x, .slot-row2 .x { width: 40px; height: 40px; border: 0; background: transparent; color: var(--red-text); font-size: 20px; }
.slot-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; margin-top: 6px; }
.slot-row2.three { grid-template-columns: 72px 1fr 40px; }
.slot-sub { margin: 4px 0 0; }
.slot-sub summary { font-size: var(--font-xs); color: var(--muted); cursor: pointer; min-height: 28px; display: flex; align-items: center; }
.pos-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pos-grid .pl { font-size: var(--font-sm); }

/* 印刷 */
.print-area { display: none; }
@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-area img { width: 100%; }
  @page { size: A4 landscape; margin: 8mm; }
}

@media (min-width: 700px) {
  .weekcol { width: 200px; }
  .tabs button { font-size: 13px; }
}
