@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f3f1ea;
  --panel: #ffffff;
  --ink: #16302b;
  --muted: #55665f;
  --line: #cfd6ce;
  --deep: #12403a;
  --on-deep: #f3f1ea;
  --strong: #12403a;
  --on-strong: #f3f1ea;
  --accent: #c8401f;
  --on-accent: #ffffff;
  --link: #0b5e52;
  --warn-bg: #fbefd5;
  --warn-ink: #5c3d00;
  --warn-line: #e3c98c;
  --missing: #a23214;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1f1c;
    --panel: #16302b;
    --ink: #edf1ea;
    --muted: #a8b8b1;
    --line: #2f4a44;
    --deep: #0a2925;
    --on-deep: #edf1ea;
    --strong: #7fd6c6;
    --on-strong: #0e1f1c;
    --accent: #f0683f;
    --on-accent: #0e1f1c;
    --link: #7fd6c6;
    --warn-bg: #3a2d10;
    --warn-ink: #f6dfa8;
    --warn-line: #6b5420;
    --missing: #ff9c7d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.45 'Atkinson Hyperlegible', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, th {
  font-family: 'Barlow Condensed', 'Atkinson Hyperlegible', system-ui, sans-serif;
  font-weight: 600;
}

.top {
  background: var(--deep);
  color: var(--on-deep);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 14px;
}
.top h1 {
  margin: 0 auto;
  max-width: 720px;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

main, .foot {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.pick { padding-top: 20px; }

.picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.picker:focus-within {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.picker.is-busy { opacity: 0.55; }
.picker-main {
  min-height: 56px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.1875rem;
}
.picker-second {
  margin-top: 10px;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.status {
  min-height: 1.45em;
  margin: 12px 0 0;
  color: var(--muted);
}

.hint {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.hint h2 {
  margin: 0 0 6px;
  font-size: 1.3125rem;
  line-height: 1.2;
}
.hint p { margin: 0 0 8px; }
.hint p:last-child { margin-bottom: 0; }

.empty {
  margin: 24px 0;
  color: var(--muted);
}

.table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin-top: 24px;
}
.table-head h2 {
  margin: 0;
  font-size: 1.5rem;
}
.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
}
.c-time { width: 48%; }
.c-action { width: 46px; }

th {
  padding: 8px 10px;
  border-bottom: 2px solid var(--strong);
  font-size: 1.0625rem;
  text-align: left;
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: 0; }

td span { display: block; }
.date { font-weight: 700; }
.note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.filename {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.missing {
  color: var(--missing);
  font-weight: 700;
}
.place {
  display: block;
  color: var(--link);
  text-underline-offset: 3px;
}
.place span { text-decoration: underline; }

td.col-action {
  padding: 2px 0 0;
  text-align: center;
}
.delete {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--strong);
  color: var(--on-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.button-quiet {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.foot {
  margin-top: 32px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 28px);
  color: var(--muted);
  font-size: 0.9375rem;
}
.foot p { margin: 0 0 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] { display: none !important; }
