/* タイム君 — 紙のタイムカードと朱の打刻印 */

:root {
  color-scheme: light dark;
  --paper: #F5F6F2;
  --surface: #FFFFFF;
  --surface-2: #EDF0E9;
  --ink: #1C2321;
  --ink-2: #4A544E;
  --ink-3: #6F7973;
  --rule: #DCE0D8;
  --rule-strong: #BFC6BA;
  --stamp: #A83E2B;
  --stamp-press: #8E3322;
  --on-stamp: #FFFFFF;
  --stamp-soft: rgba(168, 62, 43, .10);
  --ok: #2E6A4E;
  --ok-soft: rgba(46, 106, 78, .12);
  --rest: #35607F;
  --rest-soft: rgba(53, 96, 127, .12);
  --warn: #85600F;
  --warn-soft: rgba(138, 100, 16, .13);
  --backdrop: rgba(10, 14, 13, .45);
  --shadow: 0 1px 2px rgba(28, 35, 33, .06), 0 14px 34px -24px rgba(28, 35, 33, .5);
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --tabbar-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131719;
    --surface: #1B2123;
    --surface-2: #242C2E;
    --ink: #E7EBE6;
    --ink-2: #B0B9B3;
    --ink-3: #8C958F;
    --rule: #2B3336;
    --rule-strong: #3E484B;
    --stamp: #E0795F;
    --stamp-press: #EC907A;
    --on-stamp: #1A0F0B;
    --stamp-soft: rgba(224, 121, 95, .15);
    --ok: #7FC7A2;
    --ok-soft: rgba(127, 199, 162, .14);
    --rest: #8DB8D6;
    --rest-soft: rgba(141, 184, 214, .15);
    --warn: #D9AE58;
    --warn-soft: rgba(217, 174, 88, .15);
    --backdrop: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -24px rgba(0, 0, 0, .9);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.boot { padding: 40px 16px; text-align: center; color: var(--ink-3); }

/* ---------------------------------------------------------------- layout */

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
  display: grid;
  gap: 16px;
}
.page.wide { max-width: 56rem; }
.page-head h1 { font-size: 1.35rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.card h2 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }

.stack { display: grid; gap: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 480px) { .two.narrow-stack { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--rule);
}
.tabbar a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-size: .72rem;
  color: var(--ink-3);
  text-decoration: none;
}
.tabbar a.on { color: var(--stamp); font-weight: 700; }
.tabbar .icon { width: 24px; height: 24px; }

.subnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: none;
}
.subnav a {
  flex: none;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: .95rem;
}
.subnav a.on { color: var(--ink); border-bottom-color: var(--stamp); font-weight: 700; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- forms */

.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > .label { font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.hint { font-size: .8rem; color: var(--ink-3); }

input:not([type="checkbox"]), select {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 16px; /* iOS が勝手に拡大しないように */
}
input[type="time"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.eye-btn {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); cursor: pointer;
}
.eye-btn:hover { color: var(--ink); background: var(--surface-2); }
.eye-btn[aria-pressed="true"] { color: var(--stamp); }
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
input:disabled { background: var(--surface-2); color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: 20px; height: 20px; accent-color: var(--stamp); }

.form-error { color: var(--stamp); font-size: .9rem; font-weight: 700; }
.form-error:empty { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { cursor: default; opacity: .38; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .88rem; border-radius: 8px; }
.btn.primary { background: var(--stamp); color: var(--on-stamp); }
.btn.primary:hover:not(:disabled) { background: var(--stamp-press); }
.btn.outline { background: var(--surface); border-color: var(--rule-strong); color: var(--ink); }
.btn.link { background: none; min-height: 36px; padding: 4px 6px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn.link.danger { color: var(--stamp); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.icon-btn.disabled { opacity: .3; }

/* ---------------------------------------------------------------- login */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(24rem, 100%);
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.login-title { font-size: 1.15rem; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 800; letter-spacing: .04em; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--stamp);
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: bottom center;
}
.brand-mark::before { height: 9px; transform: translateX(-50%); }
.brand-mark::after { height: 7px; transform: translateX(-50%) rotate(-90deg); }

/* ---------------------------------------------------------------- punch */

.punch-head { display: grid; justify-items: center; gap: 6px; padding: 12px 0 4px; }
.punch-date { color: var(--ink-2); font-weight: 700; }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.03em; }
.clock-hm { font-size: clamp(3.6rem, 19vw, 4.6rem); font-weight: 500; }
.clock-s { font-size: 1.4rem; color: var(--ink-3); margin-left: 2px; }

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--surface-2);
}
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-working { color: var(--ok); background: var(--ok-soft); }
.state-on_break { color: var(--rest); background: var(--rest-soft); }
.state-done { color: var(--ink-2); background: var(--surface-2); }
.state-off { color: var(--ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.state-missing_out { color: var(--stamp); background: var(--stamp-soft); }

.punch-actions { display: grid; gap: 10px; }
.btn.big { min-height: 68px; font-size: 1.28rem; border-radius: 14px; letter-spacing: .06em; }
.btn.big b { font-weight: 500; letter-spacing: 0; }
.btn.big.confirm { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.timecard {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 6px 16px 10px;
  box-shadow: var(--shadow);
}
.tc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--rule);
}
.tc-row > span:first-child { color: var(--ink-2); }
.tc-row.total { border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 11px; }
.tc-row.total > span:first-child { color: var(--ink); font-weight: 700; }
.tc-row.total .num { color: var(--stamp); font-size: 1.25rem; font-weight: 600; }
.tc-empty { padding: 14px 0 8px; color: var(--ink-3); text-align: center; }
.tc-note { font-size: .8rem; color: var(--warn); padding-top: 6px; }

.ask { border-color: var(--rest); box-shadow: inset 4px 0 0 var(--rest); }
.ask h2 { color: var(--rest); }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: .92rem;
  text-decoration: none;
}
.banner.alert { background: var(--stamp-soft); color: var(--stamp); font-weight: 700; }

/* ---------------------------------------------------------------- records */

.period { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.period-label { display: grid; justify-items: center; line-height: 1.3; }
.period-label strong { font-size: 1.08rem; }
.period-label span { font-size: .82rem; }

.totals { display: flex; gap: 8px; margin: 0; }
.totals > div {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px 12px;
}
.totals dt { font-size: .76rem; color: var(--ink-3); }
.totals dd { margin: 0; font-size: 1.3rem; font-weight: 600; }
.totals .warn dd { color: var(--warn); }

.days { list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.days li + li { border-top: 1px solid var(--rule); }
.day {
  width: 100%;
  display: grid;
  grid-template-columns: 3.1rem 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.day:hover { background: var(--surface-2); }
.day.blank .day-date { color: var(--ink-3); }
.day-date { display: grid; line-height: 1.15; }
.day-date .num { font-size: .98rem; font-weight: 600; }
.day-date small { font-size: .72rem; color: var(--ink-3); }
.day-date.sun small { color: var(--stamp); }
.day-date.sat small { color: var(--rest); }
.day-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
.day-break { font-size: .8rem; }
.day-total { font-size: 1.05rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.chip.alert { color: var(--stamp); background: var(--stamp-soft); }
.chip.info { color: var(--warn); background: var(--warn-soft); }
.chip.state-working { color: var(--ok); background: var(--ok-soft); }
.chip.state-on_break { color: var(--rest); background: var(--rest-soft); }

.break-list { display: grid; gap: 8px; }
.break-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.danger-zone { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--rule); }

.history { list-style: none; display: grid; gap: 12px; }
.history li { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px dashed var(--rule); font-size: .92rem; }
.history-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

/* ---------------------------------------------------------------- leave */

.leave-balance {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 20px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lb-label { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.lb-value { display: flex; align-items: baseline; gap: 4px; line-height: 1.05; }
.lb-value .num { font-size: 3.6rem; font-weight: 500; color: var(--ink); }
.lb-value small { font-size: 1.1rem; color: var(--ink-2); font-weight: 700; }
.leave-balance .muted { font-size: .86rem; }

.obligation { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; flex: 1; max-width: 16rem; }
.cell { height: 16px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.cell.full { background: var(--ok); box-shadow: none; }
.cell.half { background: linear-gradient(90deg, var(--ok) 50%, var(--surface-2) 50%); }
.obligation p b { font-size: 1.3rem; }
.warn-text { color: var(--warn); font-weight: 700; font-size: .92rem; }
.ok-text { color: var(--ok); font-weight: 700; font-size: .92rem; }

.leave-list { list-style: none; display: grid; }
.leave-row { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: .94rem; }
.leave-row:first-child { border-top: 0; padding-top: 0; }
.leave-row.dim > .leave-row-head { opacity: .55; }
.leave-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.muted { color: var(--ink-3); background: var(--surface-2); }
.banner.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }

.seg { display: flex; gap: 8px; border: 0; margin: 0; padding: 0; }
.seg legend { font-size: .86rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.seg input:checked + span { border-color: var(--stamp); color: var(--stamp); background: var(--stamp-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--stamp); outline-offset: 2px; }

fieldset.group { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; }
fieldset.group legend { padding: 0 6px; font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.toolbar-title { font-size: 1.05rem; }
a.staff-row { text-decoration: none; }

/* ---------------------------------------------------------------- me */

.me-name { display: grid; }
.me-name strong { font-size: 1.15rem; }
.steps { padding-left: 1.3rem; display: grid; gap: 4px; font-size: .92rem; }
.sub-section { border-top: 1px solid var(--rule); padding-top: 16px; }
.sub-section h3 { font-size: .98rem; }

/* ---------------------------------------------------------------- admin */

.board-date { font-weight: 700; color: var(--ink-2); }
.board-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface-2);
}
.count b { font-size: 1.1rem; }
.count.state-off { background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.count.state-working { color: var(--ok); background: var(--ok-soft); }
.count.state-on_break { color: var(--rest); background: var(--rest-soft); }

.board, .staff-list, .attention { list-style: none; }
.board { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.board li + li, .staff-list li + li { border-top: 1px solid var(--rule); }
.board-row {
  display: grid;
  grid-template-columns: minmax(6rem, 1.4fr) auto minmax(5.5rem, 1fr) 3.4rem;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
}
.board-row:hover { background: var(--surface-2); }
.board-name { display: grid; line-height: 1.25; min-width: 0; }
.board-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-name small { font-size: .74rem; }
.board-times { color: var(--ink-2); font-size: .92rem; }
.board-total { text-align: right; font-weight: 600; }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: .8rem;
  background: var(--surface-2);
  color: var(--ink-2);
}
.attention { display: grid; gap: 10px; }
.att { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: .94rem; }
.att-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

.staff-list { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.staff-row {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.staff-row:hover { background: var(--surface-2); }
.staff-row.inactive { opacity: .55; }
.staff-name { display: flex; gap: 10px; align-items: baseline; }
.staff-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: .74rem;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.tag.strong { background: var(--ink); color: var(--paper); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.alert { background: var(--stamp-soft); color: var(--stamp); font-weight: 700; }

/* ---------------------------------------------------------------- 給与 */

table.sheet { min-width: 30rem; }
table.sheet th.num, table.sheet td.num { text-align: right; }
table.sheet td.strong { font-weight: 700; }
table.sheet tr.monthly td:first-child { color: var(--ink-2); }
table.sheet .tag { margin-left: 6px; }
.banner.ok-banner { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.warn-list { padding-left: 1.2rem; display: grid; gap: 4px; font-size: .92rem; color: var(--warn); }
.staff-row { align-items: start; }

/* ---------------------------------------------------------------- dialog */

dialog.sheet {
  width: min(34rem, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: var(--backdrop); }
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.sheet-head h2 { font-size: 1.05rem; }
.sheet-body { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet-body .timecard { box-shadow: none; }
.note { font-size: .9rem; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }

@media (max-width: 560px) {
  dialog.sheet {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  .board-row { grid-template-columns: 1fr auto; }
  .board-times { grid-column: 1; font-size: .85rem; }
  .board-total { grid-column: 2; }
}

/* ---------------------------------------------------------------- toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: .94rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--stamp); color: var(--on-stamp); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* お試し用などの目印の帯（TIMEKUN_LABEL があるときだけ） */
.env-label {
  position: sticky; top: 0; z-index: 50;
  padding: 6px 12px; text-align: center;
  font-size: .85rem; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: #B4532A;
}

/* シフト */
.shift-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.shift-row {
  width: 100%; min-height: 48px; display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: 4px 10px;
  padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface);
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
}
.shift-row.weekend { background: var(--surface-2); }
.shift-row.on { border-color: var(--stamp); box-shadow: inset 4px 0 0 var(--stamp); }
.shift-row:disabled { opacity: .55; cursor: default; }
.shift-date { font-weight: 700; display: flex; align-items: baseline; gap: 4px; }
.shift-date small { font-size: .78rem; color: var(--ink-3); font-weight: 400; }
.shift-time { font-weight: 700; }
.shift-sub { grid-column: 2 / 4; font-size: .82rem; line-height: 1.4; }
.table-scroll { overflow-x: auto; }
table.shift-table { min-width: 0; border-collapse: collapse; }
table.shift-table th, table.shift-table td { padding: 2px 4px; text-align: center; white-space: nowrap; }
table.shift-table thead th, table.shift-table tbody th { position: sticky; background: var(--surface); }
table.shift-table thead th { top: 0; }
table.shift-table tbody th { left: 0; text-align: left; }
table.shift-table tr.weekend th, table.shift-table tr.weekend td { background: var(--surface-2); }
.shift-cell {
  position: relative; min-width: 6.4rem; min-height: 34px; padding: 4px 6px; border: 1px dashed var(--rule-strong);
  border-radius: 6px; background: transparent; font: inherit; font-size: .85rem; color: var(--ink); cursor: pointer;
}
.shift-cell.on { border-style: solid; border-color: var(--stamp); background: var(--stamp-soft); font-weight: 700; }
.shift-cell .dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--rest); }
.week-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.week-pick { position: relative; }
.week-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.week-pick span {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--rule-strong);
  border-radius: 8px; background: var(--surface); font-weight: 700;
}
.week-pick input:checked + span { background: var(--stamp); border-color: var(--stamp); color: var(--on-stamp); }
.week-pick input:focus-visible + span { outline: 2px solid var(--stamp); outline-offset: 2px; }
table.shift-table thead th .bulk-btn { margin-top: 4px; min-height: 28px; padding: 2px 10px; font-size: .78rem; }
.shift-row.short { background: var(--warn-soft); }
.headcount {
  justify-self: end; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.headcount.short { background: var(--warn); color: var(--surface); }
.need-note { color: var(--warn); font-weight: 700; }
.need-note.small { font-size: .72rem; display: block; max-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-info { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.day-info.short { background: var(--warn-soft); }
.day-info p { margin: 0; }
.day-btn {
  display: grid; gap: 2px; justify-items: start; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.day-btn:hover { background: var(--surface-2); }
.day-btn .headcount { justify-self: start; }
table.shift-table tr.short th, table.shift-table tr.short td { background: var(--warn-soft); }
table.shift-table tbody th { min-width: 7.5rem; }
.day-note { color: var(--ink-3); font-size: .82rem; }
.day-note.small { font-size: .72rem; display: block; max-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-row.closed { background: var(--surface-2); border-style: dashed; }
table.shift-table tr.closed th, table.shift-table tr.closed td { background: var(--surface-2); }
[hidden] { display: none !important; }
.pattern-rows { display: grid; gap: 6px; }
.pattern-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; align-items: center; }
.pattern-row input[type="time"] { min-width: 0; width: 100%; }
.pattern-row input:disabled { opacity: .45; }

/* 会社の休みカレンダー */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cal-month h3 { margin: 0 0 6px; font-size: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .82rem; }
.cal-head { color: var(--ink-3); font-size: .72rem; }
.cal-day { padding: 3px 0; border-radius: 4px; border: 1px solid transparent; }
.cal-day.closed { background: var(--surface-2); color: var(--ink-3); }
.cal-day.holiday { color: #B4322A; font-weight: 700; }
.cal-day.open { border-color: #3C8A5A; }
.cal-notes { margin: 6px 0 0; font-size: .75rem; color: var(--ink-3); line-height: 1.5; }
.cal-range { display: grid; grid-template-columns: minmax(7rem, auto) 1fr auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }

/* スポットの人 */
.spot-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.spot-head h2 { margin: 0; }
.spot-row .btn { margin: 0 12px 10px; }

/* 扶養メーター */
.fuyo-days { gap: 2px; }
.fuyo-meter progress { width: 100%; height: 14px; accent-color: var(--stamp); }
.fuyo-left { font-size: 1.15rem; font-weight: 700; margin: 0; }
.fuyo-meter .banner { margin: 0; }
.pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pay-row { display: grid; grid-template-columns: 6.5rem 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
table.fuyo-table th, table.fuyo-table td { padding: 6px 10px; white-space: nowrap; }
