
/* Layout: one narrow column, month total up top, then on-call shifts and removals as logbook lists. */
:root {
  --bg: #f3f4f7; --surface: #ffffff; --line: #dcdfe7; --fg: #1b1f2a; --muted: #5d6475;
  --accent: #2f4a7a; --accent-fg: #ffffff; --brass: #9a6b1f;
  --weekday: #2f4a7a; --weekend: #7a3f6b; --wkam: #2f6b72; --wkpm: #5b3f86; --holiday: #9a6b1f; --off: #8a909c;
  --danger: #a33a32; --ok: #2f6b4a;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12151c; --surface: #1a1e28; --line: #2c3241; --fg: #e8eaf0; --muted: #9aa1b2;
  --accent: #8fa9dc; --accent-fg: #10131a; --brass: #d6a75a;
  --weekday: #8fa9dc; --weekend: #d394c4; --wkam: #7cc3c9; --wkpm: #b9a2ee; --holiday: #d6a75a; --off: #7d8495;
  --danger: #e2786f; --ok: #7cc29c; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #12151c; --surface: #1a1e28; --line: #2c3241; --fg: #e8eaf0; --muted: #9aa1b2;
  --accent: #8fa9dc; --accent-fg: #10131a; --brass: #d6a75a;
  --weekday: #8fa9dc; --weekend: #d394c4; --wkam: #7cc3c9; --wkpm: #b9a2ee; --holiday: #d6a75a; --off: #7d8495;
  --danger: #e2786f; --ok: #7cc29c; color-scheme: dark }

html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
.wrap { max-width: 620px; margin: 0 auto; padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px; }
h1, h2 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand small { display: block; font-family: var(--f-body); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--muted); }
.iconbtn:hover { color: var(--fg); border-color: var(--muted); }

.month { display: flex; align-items: center; gap: 8px; }
.month h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; flex: 1; }
.total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.total .big { font-family: var(--f-display); font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.total .unit { color: var(--muted); font-weight: 500; }
.total .pay { margin-left: auto; color: var(--brass); font-family: var(--f-mono); font-size: 15px; }
.breakdown { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; margin-top: 12px; font-size: 14px; }
.breakdown .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breakdown .cnt { color: var(--muted); text-align: right; }
.breakdown .hrs { text-align: right; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 2px; flex: none; background: var(--c, var(--muted)); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.small { padding: 6px 10px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .lab { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; box-sizing: border-box; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: end; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 6px; font-size: 14px; line-height: 1.2; }
.seg button small { display: block; color: var(--muted); font-size: 12px; font-family: var(--f-mono); margin-top: 2px; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.seg button[aria-pressed="true"] small { color: inherit; opacity: .8; }

.sec { display: flex; flex-direction: column; gap: 8px; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { font-size: 12px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.date { text-align: center; line-height: 1.1; }
.date b { display: block; font-family: var(--f-display); font-size: 20px; font-weight: 700; }
.date span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.what { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.what .t { font-weight: 500; overflow-wrap: anywhere; }
.what .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.right { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.typesel { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 4px 6px; font-size: 13px; max-width: 120px; }
.hrs { font-family: var(--f-mono); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
li.off .hrs, li.off .t { color: var(--off); text-decoration: line-through; }
.del { background: none; border: 0; color: var(--muted); padding: 4px 6px; font-size: 18px; line-height: 1; border-radius: 6px; }
.del:hover { color: var(--danger); }
.empty { padding: 18px 14px; color: var(--muted); font-size: 14px; text-align: center; }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--brass); background: var(--surface); border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.notice.err { border-left-color: var(--danger); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 20; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
@media (max-width: 420px) { .total .big { font-size: 46px; } .list li { grid-template-columns: 44px 1fr auto; gap: 10px; padding: 10px 12px; } .typesel { max-width: 96px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

[hidden] { display: none !important; }
.login { max-width: 360px; margin: 18vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 0; }
.subhead { font-family: var(--f-display); font-size: 15px; font-weight: 700; margin: 4px 0 0; }
.linkrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
