/*
 * Modernist — the palette and rules of the design doc (「Todoアプリ 改善案」2A).
 * Near-black ground, paper-white text, one red accent, zero corner radius,
 * 2px structural rules between sections and 1px hairlines between rows.
 * Nothing floats: alignment and the strength of the dividers do the organising.
 */
:root {
  --bg: #171615;
  --panel: #201e1d;
  --panel-2: #2a2827;
  /* 2px structural rule / 1px row separator. */
  --line: rgba(243, 242, 242, 0.28);
  --hair: rgba(243, 242, 242, 0.16);
  --text: #f3f2f2;
  --bright: #d7d3d3;
  --muted: #9b9797;
  --dim: #7d7979;
  --faint: #605d5d;
  --accent: #ec3013;
  --accent-soft: #ff563c;
  --accent-pale: #ffb0a0;
  --accent-ink: #ae1800;
  /* Empty half of a bar. */
  --bar: #3a3736;
  --paper: #f3f2f2;
  --break: #3e93ff;
  --long: #8e4ec6;
  --p5: var(--accent);
  --p3: var(--accent-soft);
  --p1: var(--accent-pale);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Archivo, "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-ink); color: var(--paper); }
input, select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 8px 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"]:not(.check) { accent-color: var(--accent); }

/* Buttons — labels sit flush left, even when the button is wider than its text. */
.btn {
  background: transparent;
  border: 1px solid var(--line);
  padding: 9px 14px;
  text-align: left;
  color: var(--text);
}
.btn:hover { background: var(--panel-2); }
.btn:active { border-color: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 800; }
.btn.primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn.primary:active { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.paper { background: var(--paper); border-color: var(--paper); color: var(--accent-ink); font-weight: 800; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.icon-btn { background: transparent; border: none; color: var(--muted); padding: 4px 8px; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--accent-soft); }
.error { color: var(--accent-soft); min-height: 1em; }
.hint { color: var(--dim); font-size: 12px; margin: 4px 0; line-height: 1.6; }
.spacer { flex: 1; }

/* The uppercase, letter-spaced label above a block. */
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--dim); }
.eyebrow.accent { color: var(--accent-soft); }
.eyebrow.muted { color: var(--muted); }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 28px;
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
}
.login-card h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.login-card code { background: var(--panel-2); padding: 1px 5px; font-size: 12px; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr auto auto; height: 100vh; }
.sidebar {
  background: var(--panel);
  border-right: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  gap: 6px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  padding: 2px 14px 12px;
  border-bottom: 2px solid var(--line);
}
.brand .logo { width: 18px; height: 18px; background: var(--accent); display: inline-block; }
.brand .icon-btn { margin-left: auto; }
.nav { display: flex; flex-direction: column; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  padding: 9px 14px 9px 11px;
  color: var(--bright);
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--panel-2); border-left-color: var(--accent); color: var(--text); font-weight: 800; }
.nav-item .ic { width: 18px; text-align: center; opacity: 0.75; }
.nav-item .dot { width: 10px; height: 10px; display: inline-block; }
.nav-item .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-item .count:empty { display: none; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 16px 14px 6px;
  border-top: 2px solid var(--line);
  margin-top: 8px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 0;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.focus-today b { color: var(--text); font-variant-numeric: tabular-nums; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
/* Shown when the API is unreachable: the app keeps working on what it already has. */
.offline {
  background: var(--accent-ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 7px 24px;
  border-bottom: 2px solid var(--line);
}
.main-header {
  display: flex;
  /*
   * The heading is 32px and the search box is 200px; when the column is narrow
   * — a phone, or a desktop window with the detail pane open — they do not
   * share a row. Let the actions drop below rather than squeeze the title.
   */
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 12px;
  border-bottom: 2px solid var(--line);
}
/* The basis is what the heading claims before the actions are made to wrap. */
.title-block { flex: 1 1 200px; min-width: 0; margin-right: auto; }
/* The drawer handle and its scrim; both only appear on narrow screens. */
.menu-btn { display: none; align-self: center; margin-right: 12px; font-size: 18px; }
.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(13, 12, 12, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}
.stamp { color: var(--accent-soft); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
/*
 * Japanese breaks between any two characters, so a display heading that gets
 * squeezed comes out one character per line rather than simply wrapping.
 * Keep it on one line and cut it short instead — the row is 1.25em so the
 * clipping box cannot bite into the glyphs.
 */
.main-header h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
#search { width: 200px; }

/* The FOCUS counter of 2A-01. */
.focus-count { text-align: right; }
.focus-count .n { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.focus-count .n small { font-size: 14px; color: var(--muted); font-weight: 800; }
.focus-count .lbl { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }

.quick-add { border-bottom: 2px solid var(--line); background: var(--panel); }
.quick-add-row { display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.quick-add-row .plus {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent-soft);
  color: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  flex: none;
}
.quick-add input {
  flex: 1;
  padding: 13px 0;
  font-size: 15px;
  background: transparent;
  border: none;
}
.quick-add input:focus { border: none; }
.quick-add .syntax {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  padding: 3px 6px;
  white-space: nowrap;
}

/* 今日の3件 — the band that carries the day's decisions. */
.band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 8px;
  border-bottom: 2px solid var(--line);
}
.band-head .link { background: none; border: none; color: var(--dim); font-size: 11px; padding: 0; }
.band-head .link:hover { color: var(--accent-soft); }
.slots { border-bottom: 2px solid var(--line); }
.slot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--hair);
  cursor: pointer;
}
.slot:last-child { border-bottom: none; }
.slot:hover { background: var(--panel); }
.slot .no {
  width: 28px;
  flex: none;
  font-size: 22px;
  font-weight: 800;
  color: var(--faint);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.slot .body { flex: 1; min-width: 0; }
.slot .t { font-size: 17px; font-weight: 700; line-height: 1.4; word-break: break-word; }
.slot .m { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; margin-top: 3px; }
.slot .m .at { color: var(--accent-soft); font-weight: 700; }
.slot.done { opacity: 0.5; }
.slot.done .t { text-decoration: line-through; color: var(--muted); font-weight: 700; }
.slot.current {
  background: var(--panel);
  border-left: 4px solid var(--accent);
  padding: 16px 24px 16px 20px;
}
.slot.current .no { color: var(--accent); }
.slot.current .t { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.slot .acts { display: flex; gap: 8px; margin-top: 11px; }
.slot.empty { color: var(--dim); }
.slot.empty .fill { margin-left: auto; color: var(--accent-soft); font-size: 12px; font-weight: 800; align-self: center; }

/* Square 2px checkbox, filled once done — the design's list mark. */
.check {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  margin: 2px 0 0;
  flex: none;
  cursor: pointer;
  position: relative;
  background: transparent;
}
.check.big { width: 22px; height: 22px; margin-top: 0; }
.check.p5 { border-color: var(--p5); }
.check.p3 { border-color: var(--p3); }
.check.p1 { border-color: var(--p1); }
.check:checked { background: var(--muted); border-color: var(--muted); }
.check:checked::after {
  content: "✓";
  color: var(--bg);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 24px 6px;
}
.list-head .meta { color: var(--dim); font-size: 11px; }
.task-list { overflow-y: auto; padding-bottom: 40px; }
.group-title {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 16px 24px 6px;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 24px;
  cursor: pointer;
  border-top: 1px solid var(--hair);
  border-left: 3px solid transparent;
}
.task:hover { background: var(--panel); }
.task.selected { background: var(--panel); border-left-color: var(--accent); }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .body { flex: 1; min-width: 0; }
.task .title { color: var(--bright); word-break: break-word; }
.task .sub { display: flex; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 2px; flex-wrap: wrap; }
.task .sub .overdue { color: var(--accent-soft); font-weight: 700; }
.task .sub .today { color: var(--bright); }
.task .pomo-badge { color: var(--muted); font-size: 11px; white-space: nowrap; align-self: center; }
.task.focused .pomo-badge { color: var(--accent-soft); }
/* 「3件へ ↑」 — lift a leftover into an open slot. */
.task .promote {
  align-self: center;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 11px;
  padding: 4px;
  white-space: nowrap;
}
.task .promote:hover { color: var(--accent-soft); }
.empty-state { color: var(--dim); text-align: center; padding: 60px 0; font-size: 13px; }

/* Detail */
.detail {
  width: 360px;
  background: var(--bg);
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--line);
}
/* The accent band of 2A-04: this task is one of the day's picks. */
.detail-band {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--paper);
  padding: 12px 16px;
}
.detail-band .no { font-size: 18px; font-weight: 800; }
.detail-band .lbl { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.detail-band button {
  margin-left: auto;
  background: transparent;
  border: 2px solid rgba(243, 242, 242, 0.6);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}
.detail-band.ghost { background: var(--panel); color: var(--accent-soft); }
.detail-band.ghost .lbl { font-weight: 800; letter-spacing: 0; font-size: 13px; }
.detail-band.ghost button { border: none; color: var(--dim); font-size: 11px; font-weight: 400; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 2px solid var(--line); }
.detail-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: transparent;
  border-color: transparent;
  padding: 0;
}
.detail-title:focus { border-color: transparent; border-bottom-color: var(--accent); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--line); }
.detail-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.detail-grid label.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}
.detail-grid input, .detail-grid select { width: 100%; }
/* A checkbox must not stretch across its grid cell and push its label away. */
.detail-grid input[type="checkbox"] { width: auto; }
#detail-content { min-height: 120px; resize: vertical; margin: 14px 16px; }
.subtasks { padding: 0 16px 14px; }
.subtasks .section-title { padding-left: 0; padding-right: 0; border-top: none; margin-top: 0; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.subtask.done span { text-decoration: line-through; color: var(--muted); }
.subtask span { flex: 1; font-size: 14px; }
.subtask .icon-btn { font-size: 12px; }
#subtask-add input { width: 100%; border: none; border-bottom: 1px solid var(--hair); background: transparent; padding: 8px 0; }
#detail-meta { color: var(--faint); font-size: 11px; padding: 12px 16px; border-top: 2px solid var(--line); margin-top: auto; }

/* Pomodoro — a flat block with a linear bar, as on the mobile 集中 screen. */
.pomo {
  width: 260px;
  background: var(--panel);
  border-left: 2px solid var(--line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pomo.hidden { display: none; }
.pomo-head { display: flex; align-items: center; justify-content: space-between; }
.pomo-phase { font-weight: 800; font-size: 11px; letter-spacing: 0.12em; color: var(--accent-soft); }
.pomo.phase-short_break .pomo-phase { color: var(--break); }
.pomo.phase-long_break .pomo-phase { color: var(--long); }
.pomo-time { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pomo.paused .pomo-time { opacity: 0.6; }
.pomo-track { height: 6px; background: var(--bar); }
.pomo-bar { height: 6px; background: var(--accent); width: 100%; transition: width 0.5s linear; }
.pomo.phase-short_break .pomo-bar { background: var(--break); }
.pomo.phase-long_break .pomo-bar { background: var(--long); }
.pomo-cycle { color: var(--muted); font-size: 12px; letter-spacing: 0.2em; }
.pomo-task { color: var(--muted); font-size: 13px; min-height: 2.6em; overflow: hidden; }
.pomo-controls { display: flex; gap: 8px; }
.pomo-controls .btn { flex: 1; text-align: center; padding: 10px 4px; font-size: 12px; white-space: nowrap; }
.pomo-controls .primary { flex: 1.4; }
.pomo-conn { font-size: 11px; color: var(--muted); margin-top: auto; }
.pomo-conn.ok { color: var(--accent-soft); }
.pomo-conn.bad { color: var(--muted); }

/* Dialog */
dialog {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--line);
  padding: 0;
  width: min(520px, 92vw);
}
dialog::backdrop { background: rgba(13, 12, 12, 0.72); }
.dialog-body { padding: 20px 22px; display: grid; gap: 10px; }
.dialog-body h3 {
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 2px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--dim);
  letter-spacing: 0.12em;
}
.dialog-body h3:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.dialog-body label.inline { display: flex; align-items: center; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-start; margin-top: 12px; }

/* The pick sheet behind 「入れ替える」/「＋ 入れる」. */
.pick-list { max-height: 50vh; overflow-y: auto; border-top: 2px solid var(--line); }
.pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hair);
  padding: 12px 0;
  color: var(--text);
}
.pick-item:hover { background: var(--panel); }
.pick-item .t { flex: 1; min-width: 0; font-size: 15px; }
.pick-item .m { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pick-item .m.overdue { color: var(--accent-soft); font-weight: 700; }
.pick-item[disabled] { opacity: 0.45; cursor: default; }

/*
 * 「今日はここまで。」 — the day closes on a full red field, the one place the
 * accent runs as a ground (readme: the poster statement).
 */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--accent);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 40px clamp(24px, 8vw, 96px);
  overflow-y: auto;
}
.celebrate .stamp { color: var(--paper); font-size: 12px; letter-spacing: 0.18em; }
.celebrate .big { font-size: clamp(72px, 13vw, 140px); font-weight: 800; line-height: 0.9; letter-spacing: -0.03em; margin-top: 18px; font-variant-numeric: tabular-nums; }
.celebrate .lead { font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin-top: 14px; letter-spacing: -0.01em; }
.celebrate .picks { margin-top: 26px; border-top: 2px solid rgba(243, 242, 242, 0.55); max-width: 640px; }
.celebrate .pick { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(243, 242, 242, 0.35); }
.celebrate .pick .no { width: 24px; font-size: 13px; font-weight: 800; }
.celebrate .pick .t { flex: 1; font-size: 17px; }
.celebrate .pick .at { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.celebrate .stats { display: flex; max-width: 640px; border-bottom: 2px solid rgba(243, 242, 242, 0.55); }
.celebrate .stat { flex: 1; padding: 14px 0; }
.celebrate .stat .lbl { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; opacity: 0.8; }
.celebrate .stat .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.celebrate .note { font-size: 14px; line-height: 1.7; opacity: 0.9; padding: 18px 0; max-width: 640px; }
.celebrate .acts { display: flex; gap: 10px; margin-top: auto; padding-top: 20px; }
.celebrate .acts .btn { border-color: rgba(243, 242, 242, 0.7); border-width: 2px; color: var(--paper); }
.celebrate .acts .btn:hover { background: rgba(243, 242, 242, 0.14); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 220px 1fr auto; }
  .pomo { position: fixed; right: 0; bottom: 0; width: 240px; border: 2px solid var(--line); }
  .pomo-time { font-size: 40px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .menu-btn { display: block; }
  /*
   * The lists slide in from the left instead of eating a row of the screen.
   * Everything inside keeps its full-size styling — there is room in a drawer.
   */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, 82vw);
    z-index: 30;
    border-right: 2px solid var(--line);
    transform: translateX(-100%);
    transition: transform 0.18s ease-out;
  }
  .app.menu-open .sidebar { transform: none; }
  .menu-backdrop { display: block; }
  .app.menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  /*
   * The pomodoro pane is a 240px panel pinned over the content — on a phone it
   * covers the list it is meant to sit beside. Drop it, and its toggle with it.
   * The timer itself keeps running.
   */
  .pomo, #btn-toggle-pomo { display: none; }
  /*
   * 「今日の3件」 is a desktop affordance; a phone just shows the day's tasks.
   * renderTasks() puts the picks back into the list when this applies.
   */
  #focus-band, #focus-count, #list-head, .task .promote { display: none; }
  /*
   * Here the heading and the search always take a row each, so the search may
   * as well have the whole of its own. Basis 0 keeps a long list name on the
   * menu button's row instead of pushing itself onto a third one.
   */
  .title-block { flex: 1 1 0; }
  .header-actions { width: 100%; }
  #search { flex: 1; }
  .main-header, .quick-add-row, .band-head, .list-head, .group-title { padding-left: 16px; padding-right: 16px; }
  .slot, .task { padding-left: 16px; padding-right: 16px; }
  .slot.current { padding-left: 12px; }
  .detail { position: fixed; inset: 0; width: auto; z-index: 10; }
}

/*
 * Installed (PWA) window: no browser chrome, so the app itself has to keep clear
 * of the notch and the home indicator.
 */
@media (display-mode: standalone) {
  .sidebar { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .main-header { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .detail-header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .task-list { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  .pomo { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .celebrate {
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }
}
/* Narrow: the sidebar is the top bar, so it alone carries the top inset. */
@media (display-mode: standalone) and (max-width: 760px) {
  .sidebar { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .main-header { padding-top: 16px; }
  .detail-header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
}
