/* さかのぼり録音 管理画面。受付で毎日見る画面なので、紙のように落ち着いた色と大きめの文字にする */
:root {
  color-scheme: light;
  --paper: #f5f2ec;
  --surface: #fffdf9;
  --ink: #23292b;
  --ink-soft: #5d6668;
  --line: #ded8cc;
  --accent: #1f5f63;
  --accent-ink: #ffffff;
  --accent-soft: #e2eeec;
  --warn: #8a4b00;
  --warn-soft: #fbedd5;
  --mark: #9b3d14;
  --mark-soft: #fbe6da;
  --muted-soft: #ecebe7;
  --radius-s: 6px;
  --radius-l: 14px;
  --shadow: 0 1px 2px rgb(35 41 43 / 6%), 0 6px 18px rgb(35 41 43 / 6%);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
}

a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ヘッダ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { color: var(--ink); font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tenant { color: var(--ink-soft); font-size: .9rem; overflow-wrap: anywhere; }
.account form { margin: 0; }

main.wrap { padding-top: 24px; padding-bottom: 64px; }

.page-title { font-size: 1.6rem; line-height: 1.3; margin: 0 0 16px; letter-spacing: .02em; overflow-wrap: anywhere; }
.crumb { margin: 0 0 8px; font-size: .95rem; }
.empty, .count, .hint { color: var(--ink-soft); }
.count { margin: 16px 0 8px; font-size: .9rem; }
.sub { color: var(--ink-soft); font-size: .9em; }
.bad { color: var(--warn); font-weight: 700; }

/* ボタン */
button, input { font: inherit; }
.btn-primary, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px; border-radius: var(--radius-s);
  cursor: pointer; text-decoration: none; transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 700; }
.btn-primary:hover { background: #174b4e; }
.btn-primary:active { background: #113a3c; }
.btn-quiet { background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
.btn-quiet:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-quiet.is-disabled { color: var(--ink-soft); opacity: .45; cursor: default; }
.btn-quiet.is-disabled:hover { border-color: var(--line); background: var(--surface); }

/* ログイン */
.login-card { max-width: 420px; margin: 24px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 28px 24px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.5rem; }
.lead { margin: 0 0 20px; color: var(--ink-soft); font-size: .95rem; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack label { font-weight: 700; font-size: .95rem; }
.stack input { min-height: 48px; padding: 8px 12px; border: 1px solid #c9c2b4; border-radius: var(--radius-s); background: #fff; color: var(--ink); width: 100%; }
.stack input + label { margin-top: 10px; }
.stack button { margin-top: 18px; }
.alert { background: var(--warn-soft); color: var(--warn); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: var(--radius-s); margin: 0 0 16px; }

/* 箱の一覧 */
.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.device { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 18px 20px; }
.device.is-stale { border-color: #e2b46a; border-left: 6px solid var(--warn); }
.device-link { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; text-decoration: none; }
.device-name { color: var(--ink); font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.device-open { color: var(--accent); font-size: .95rem; }
.device-link:hover .device-open { text-decoration: underline; }
.flag { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-s); font-size: .95rem; }
.flag-warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.flag-muted { background: var(--muted-soft); color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 20px; margin: 14px 0 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--ink-soft); font-size: .8rem; letter-spacing: .04em; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 箱の1日 */
.device-summary { margin: -8px 0 20px; color: var(--ink-soft); font-size: .95rem; }
.day-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.day-label { margin: 0; text-align: center; font-size: 1.1rem; line-height: 1.4; }
.day-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 8px; font-size: .9rem; color: var(--ink-soft); }
.day-pick input { min-height: 44px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }

.marks { background: var(--mark-soft); border-radius: var(--radius-l); padding: 14px 18px; margin: 20px 0 8px; }
.marks h3 { margin: 0 0 6px; font-size: 1rem; color: var(--mark); }
.marks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-variant-numeric: tabular-nums; }
.marks li { display: inline-flex; align-items: center; gap: 6px; }
.marks .hint { margin: 6px 0 0; font-size: .85rem; }
.mark-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mark); flex: none; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; display: grid; grid-template-columns: 9.5em 1fr; align-items: center; gap: 6px 12px; }
.row.is-marked { border-color: #e7b9a1; border-left: 6px solid var(--mark); background: #fffaf6; }
.row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.row-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { background: var(--mark); color: #fff; font-size: .75rem; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.row audio { width: 100%; min-width: 0; height: 40px; }
.row-gap { display: block; background: transparent; border-style: dashed; color: var(--ink-soft); font-size: .85rem; text-align: center; padding: 6px 12px; }

.notice-page { text-align: center; padding: 48px 0; }

@media (max-width: 560px) {
  .page-title { font-size: 1.35rem; }
  .row { grid-template-columns: 1fr; }
  .day-nav { grid-template-columns: 1fr 1fr; }
  .day-label { grid-column: 1 / -1; grid-row: 1; }
  .login-card { padding: 22px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
