@font-face {
  font-family: "Archivo Black";
  src: url("../fonts/archivo-black-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #160d0b;
  --red: #e10600;
  --gold: #e6a817;
  --gold-2: #f3c969;
  --yellow: #ffe14a;
  --cream: #fff6ee;
  --paper: #fffaf6;
  --blush: #f4cfc6;
  --blue: #1a3fbf;
  --magenta: #e4378b;
  --teal: #0c6e62;
  --deep: #7a1024;
  --pink: #ffb7d5;
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --han: "Songti SC", "Songti TC", "Hiragino Mincho ProN", "PMingLiU", "Noto Serif CJK SC", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--blush);
  background-image: radial-gradient(rgba(22, 13, 11, 0.055) 0.65px, transparent 0.75px);
  background-size: 5px 5px;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button, .log-btn { touch-action: manipulation; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--yellow); color: var(--ink); }

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.stage {
  padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
}

.poster {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 4px var(--gold);
}

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  color: var(--gold);
  pointer-events: none;
  z-index: 3;
}
.corner-tl { top: 8px; left: 8px; }
.corner-tr { top: 8px; right: 8px; transform: scaleX(-1); }
.corner-bl, .corner-br { color: var(--red); }
.corner-bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.corner-br { bottom: 8px; right: 8px; transform: scale(-1); }

.masthead {
  background: var(--ink);
  color: var(--cream);
  padding: 22px 18px 16px;
  border-bottom: 6px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.seal, .switch-han, .spine, .group-han, .art-slot, .mini-seal {
  font-family: var(--han);
}

.seal {
  width: 84px;
  height: 84px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px var(--red);
  font-size: 42px;
  line-height: 1;
}

.brand-copy { min-width: 0; flex: 1; }
.brand-copy h1 { display: flex; flex-direction: column; align-items: flex-start; }

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.3rem, 14vw, 6.5rem);
  line-height: 0.78;
  letter-spacing: -0.045em;
  color: var(--red);
  text-transform: uppercase;
}

.tag {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.issue {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
}

.spine {
  writing-mode: vertical-rl;
  margin: 0;
  letter-spacing: 0.42em;
  font-size: 0.78rem;
  color: var(--gold-2);
}

.cmyk {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}
.cmyk i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.cmyk i:nth-child(1) { background: #14a3d6; }
.cmyk i:nth-child(2) { background: var(--magenta); }
.cmyk i:nth-child(3) { background: var(--yellow); }
.cmyk i:nth-child(4) { background: var(--cream); }

.switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 16px 14px;
  border-bottom: 3px solid var(--ink);
}

.switcher button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 7px 4px 8px;
}

.switcher button[aria-current="page"] {
  background: var(--red);
  color: var(--cream);
}

.switch-han { font-size: 0.95rem; line-height: 1; }
.switch-en {
  font-family: var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

#main { padding: 16px 16px 8px; }

.datebar-wrap { margin-bottom: 14px; }

.datebar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
}

.nav-btn:active, .log-btn:active, .group-card:active { transform: translateY(1px); }

.dateline { text-align: center; min-width: 0; }
.kicker {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.date-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.date-year {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

.today-jump {
  display: block;
  margin: 8px auto 0;
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 4px 10px;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 8px 8px 7px;
  min-width: 0;
}
.stat:nth-child(2) { background: var(--yellow); }
.stat-value {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.stat-label {
  margin-top: 3px;
  font-style: italic;
  font-size: 0.86rem;
}

.caption, .side-copy, .archive-copy, .sheet-note, .history, .quiet, .empty-copy {
  font-style: italic;
}

.caption { margin: 0 0 12px; }

.entry-list, .week-list, .ex-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  text-align: left;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px;
  position: relative;
}

.entry.is-fresh { animation: stamp 0.7s ease; }

@keyframes stamp {
  from { background: var(--yellow); }
  to { background: var(--paper); }
}

.art-slot, .mini-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  font-size: 24px;
  line-height: 1;
  flex: none;
  overflow: hidden;
}
.art-slot img { width: 100%; height: 100%; object-fit: cover; }

.entry-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.entry-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.gear, .ex-meta, .group-count, .sheet-kicker {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.entry-name, .ex-name {
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.entry-meta { font-size: 0.95rem; }
.history { color: var(--ink); font-size: 0.92rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  background: var(--ink);
  color: var(--cream);
  padding: 4px 7px;
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.best {
  flex: none;
  background: var(--gold);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-family: var(--display);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  transform: rotate(3deg);
}

.empty {
  border: 2px dashed var(--ink);
  padding: 22px 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(225, 6, 0, 0.08), transparent 55%),
    var(--paper);
}
.empty-flower { width: 72px; height: 72px; color: var(--red); margin: 0 auto 8px; }
.empty-title {
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.log-bar {
  margin: 0 0 14px;
}

.log-btn, .btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--red);
  color: var(--cream);
  border: 2px solid var(--ink);
  padding: 7px 7px 7px 16px;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.05rem;
  text-align: left;
}

.log-btn-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  display: grid;
  place-items: center;
  flex: none;
}

.day-side { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.side-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px;
}
.side-title, .sheet-heading h2 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  font-size: 1.25rem;
  font-weight: 400;
}
.side-copy { margin: 6px 0 10px; }
.side-volume {
  margin-top: 10px;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.seal-row, .week-seals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mini-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.week-seals, .month-view .seal-row { margin-bottom: 12px; }

.mini-day {
  width: auto;
  min-width: 0;
  min-height: 48px;
  border: 2px solid var(--ink);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 0;
}
.mini-dow {
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}
.mini-num { font-family: var(--display); font-size: 1rem; line-height: 1; }
.mini-day.is-anchor { background: var(--red); color: var(--cream); }
.mini-day.is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.mini-day.has-log:not(.is-anchor) { background: var(--yellow); }

.mini-seal { width: 36px; height: 36px; font-size: 16px; }

.tone-red { background: var(--red); color: var(--cream); }
.tone-blue { background: var(--blue); color: var(--cream); }
.tone-gold { background: var(--gold); color: var(--ink); }
.tone-magenta { background: var(--magenta); color: var(--cream); }
.tone-yellow { background: var(--yellow); color: var(--ink); }
.tone-ink { background: var(--ink); color: var(--cream); }
.tone-deep { background: var(--deep); color: var(--cream); }
.tone-pink { background: var(--pink); color: var(--ink); }
.tone-teal { background: var(--teal); color: var(--cream); }
.tone-cream { background: #fff1a8; color: var(--ink); }
.tone-sun { background: var(--ink); color: var(--yellow); }
.tone-split {
  background: linear-gradient(135deg, var(--red) 0 48%, var(--blue) 48% 100%);
  color: var(--cream);
}

.week-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 10px;
  min-height: 72px;
}
.week-row.is-today { box-shadow: inset 4px 0 0 var(--gold); }
.week-row.has-log { background: var(--paper); }
.week-date { display: flex; flex-direction: column; min-width: 46px; }
.week-dow {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.week-num { font-family: var(--display); font-size: 1.45rem; line-height: 0.9; }
.week-names {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.week-rest { font-style: italic; }
.week-count {
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--display);
  font-size: 0.85rem;
}
.week-row:not(.has-log) .week-count { background: transparent; color: var(--ink); border: 2px solid var(--ink); }

.dow-row, .month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.dow {
  text-align: center;
  font-family: var(--display);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 4px;
}
.month-grid { margin-top: 4px; }
.month-cell {
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 2px;
}
.month-cell.is-weekend:not(.has-log) { background: #ffe8df; }
.month-cell.is-anchor:not(.has-log) { background: var(--yellow); }
.month-cell.has-log { background: var(--red); color: var(--cream); }
.month-cell.is-today { box-shadow: inset 0 0 0 3px var(--gold); }
.month-cell.is-muted { opacity: 0.4; }
.cell-num { font-family: var(--display); font-size: 0.92rem; line-height: 1; }
.cell-sets { font-family: var(--serif); font-style: italic; font-size: 0.68rem; }

.colophon {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 16px 18px;
  align-items: center;
}
.unit {
  display: flex;
  border: 2px solid var(--ink);
}
.unit button {
  min-width: 46px;
  min-height: 36px;
  padding: 6px 10px;
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.unit button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.archive-btn {
  font-family: var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: end;
}
.save-note {
  grid-column: 1 / -1;
  font-style: italic;
  font-size: 0.92rem;
}
.save-note.is-error { color: var(--red); font-style: normal; font-family: var(--display); letter-spacing: 0.02em; font-size: 0.78rem; }

#sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: min(880px, calc(100dvh - 24px));
  margin: auto;
  padding: 0;
  border: 3px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  overflow: auto;
}
#sheet::backdrop { background: rgba(22, 13, 11, 0.62); }

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ink);
  color: var(--cream);
  padding: 12px;
}
.sheet-head-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}
.sheet-heading { min-width: 0; text-align: center; }
.sheet-heading h2 {
  font-size: 1.15rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.sheet-sub { font-style: italic; color: var(--gold-2); font-size: 0.92rem; }
.sheet-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.3rem;
}
.sheet-spacer { width: 42px; height: 42px; }
.sheet-body {
  padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sheet-kicker { color: var(--red); }
.sheet-note { margin-top: -6px; }

.search, .text-input {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px;
  font-size: 1rem;
}
.search:focus, .text-input:focus { outline-offset: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-btn {
  flex: none;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 6px 10px;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip-btn.is-on { background: var(--ink); color: var(--cream); }

.group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.group-card {
  min-height: 112px;
  border: 2px solid var(--ink);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
}
.group-card:nth-child(odd) { transform: rotate(-0.7deg); }
.group-card:nth-child(even) { transform: rotate(0.7deg); }
.group-card:hover, .group-card:focus-visible { transform: rotate(0deg); }
.group-han { font-size: 2rem; line-height: 1; }
.group-name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  line-height: 1;
}
.group-count { opacity: 0.85; }

.ex-row { display: flex; gap: 6px; align-items: stretch; }
.ex-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 8px;
}
.ex-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-remove, .set-remove {
  width: 42px;
  flex: none;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--display);
  font-size: 1.2rem;
}

.quiet { margin-bottom: 4px; }

.add-set, .add-custom, .btn-ghost, .btn-danger {
  width: 100%;
  border: 2px solid var(--ink);
  background: transparent;
  min-height: 46px;
  padding: 10px 12px;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.btn-danger { background: var(--ink); color: var(--cream); }
.add-custom { background: var(--yellow); }

.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }
.field .text-input { font-family: var(--serif); letter-spacing: 0; text-transform: none; font-size: 1rem; }

.set-line {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr) 42px;
  grid-template-areas:
    "index reps remove"
    "index weight remove";
  gap: 8px;
  align-items: end;
}
.set-index {
  grid-area: index;
  align-self: center;
  font-family: var(--display);
  font-size: 1rem;
}
.set-line .stepper:nth-child(2) { grid-area: reps; }
.set-line .stepper:nth-child(3) { grid-area: weight; }
.set-remove { grid-area: remove; align-self: center; height: 100%; }

.stepper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stepper-controls {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  border: 2px solid var(--ink);
  background: white;
}
.stepper-controls button {
  min-height: 44px;
  font-family: var(--display);
  font-size: 1.2rem;
}
.stepper-controls input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  text-align: center;
  background: transparent;
  font-family: var(--display);
  font-size: 1.05rem;
  padding: 8px 2px;
}
.stepper-controls input::placeholder { color: #8d6f66; font-family: var(--serif); font-style: italic; }

#set-list { display: flex; flex-direction: column; gap: 12px; }

.last-banner, .confirm-box {
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 10px;
}
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.confirm-actions .btn-ghost, .confirm-actions .btn-danger { min-height: 42px; }

.text-btn {
  justify-self: center;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px;
}
.text-btn.danger, .sheet-error { color: var(--red); }
.sheet-error { font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.02em; min-height: 0; }
.sheet-error:empty { display: none; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.file-btn { position: relative; display: grid; place-items: center; cursor: pointer; }
.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 420px) {
  .seal { width: 64px; height: 64px; font-size: 32px; }
  .spine { display: none; }
  .wordmark { font-size: 3.15rem; }
  .corner { width: 26px; height: 26px; }
}

@media (max-width: 640px) {
  #sheet[open] {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
  }
}

@media (min-width: 720px) {
  html { font-size: 18px; }
  .stage { padding: 32px 24px 48px; }
  .poster {
    box-shadow:
      0 0 0 6px var(--blush),
      0 0 0 9px var(--gold),
      0 0 0 12px var(--ink);
  }
}

@media (min-width: 860px) {
  .day-spread {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(230px, 0.75fr);
    gap: 18px;
    align-items: start;
  }
  .day-side { margin-top: 0; position: sticky; top: 16px; }
  .week-list {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
  }
  .week-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    min-height: 210px;
  }
  .week-count { justify-self: start; }
}

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

@media print {
  body { background: white; }
  .stage { padding: 0; }
  .poster { box-shadow: none; }
  .log-bar, .switcher, .colophon, .corner { display: none; }
}

/* Faded botanical stationery edition. */
:root {
  --ink: #493f32;
  --red: #a84435;
  --gold: #b49351;
  --gold-2: #d6bc80;
  --yellow: #e8d598;
  --cream: #f7eedc;
  --paper: #faf3e5;
  --blush: #e9e1d3;
  --blue: #57727c;
  --magenta: #ad6d78;
  --teal: #5e7865;
  --deep: #815147;
  --pink: #e5bbab;
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --rule: #b8a888;
}
body {
  background-image: radial-gradient(ellipse at 15% 10%, #f6efe4, transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%2384765e' opacity='.09' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  background-size: auto, 180px 180px;
}
.stage { padding: 32px 22px 48px; }
.poster {
  max-width: 1040px;
  border: 1px solid var(--rule);
  padding: 9px;
  background: var(--cream);
  box-shadow: 0 12px 48px #59472f14, 0 2px 5px #59472f12;
}
.poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath opacity='.4' filter='url(%23n)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
}
.corner { display: none; }
.masthead {
  position: relative; overflow: hidden; padding: 28px 32px 20px;
  background: #94b8a2;
  color: var(--ink); border: 1px solid var(--gold); min-height: 250px;
}
.masthead::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eedebcf5 0%, #eedebce8 48%, #eedebc44 75%, #eedebc22 100%); }
.masthead > * { position: relative; }
.masthead-eyebrow { font-size: .66rem; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 25px; }
.brand { gap: 20px; max-width: 470px; }
.seal { width: 70px; height: 78px; border-radius: 3px; font-size: 42px; background: transparent; border: 2px solid var(--red); color: var(--red); box-shadow: inset 0 0 0 3px #ead7a5, inset 0 0 0 4px var(--red); transform: rotate(-4deg); }
.wordmark { font-family: "Archivo Black", sans-serif; font-size: 5.4rem; color: var(--red); letter-spacing: -.06em; text-shadow: 1px 1px #ead7a5; }
.tag { font-size: 1rem; letter-spacing: .07em; text-transform: none; color: var(--ink); margin-top: 12px; }
.issue { color: #655339; font-size: .65rem; letter-spacing: .13em; margin-top: 8px; }
.spine { color: var(--red); font-size: .92rem; }
.masthead-bottom { display: flex; justify-content: space-between; margin-top: 28px; font-size: .76rem; color: #6b5636; }
.masthead-bottom span:first-child { letter-spacing: .25em; font-family: var(--han); }
.masthead-bottom span:last-child { font-style: italic; }
.switcher { padding: 0; gap: 0; border-bottom: 1px solid var(--rule); margin: 0 23px; }
.switcher button { flex-direction: row; justify-content: center; gap: 9px; border: 0; padding: 17px 4px; position: relative; }
.switcher button[aria-current="page"] { background: transparent; color: var(--red); }
.switcher button[aria-current="page"]::after { content: ""; position: absolute; bottom: -1px; left: 20%; right: 20%; height: 3px; background: var(--red); }
.switch-en { font-size: .85rem; letter-spacing: .1em; }
.switch-han { font-size: .9rem; opacity: .8; }
#main { padding: 28px 24px 20px; }
.datebar-wrap { margin-bottom: 24px; }
.date-title { font-size: 2.25rem; margin: 7px 0 3px; font-weight: 400; }
.kicker { color: var(--red); font-size: .63rem; }
.date-year { color: #7d725d; font-size: .85rem; }
.nav-btn { width: 42px; height: 42px; border: 1px solid var(--rule); background: transparent; }
.stats { gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.stat, .stat:nth-child(2) { border: 0; background: transparent; padding: 17px 12px; text-align: center; }
.stat + .stat { border-left: 1px solid #b8a88866; }
.stat-value { font-size: 2rem; font-weight: 400; color: var(--red); }
.stat-label { font-size: .83rem; color: #786c56; margin-top: 7px; }
.log-btn, .btn-primary { border: 1px solid #913c30; padding: 10px 12px 10px 20px; font-size: .92rem; text-transform: none; letter-spacing: .04em; background: linear-gradient(110deg, #b65343, #a84435); }
.log-btn-icon { width: 32px; height: 32px; background: transparent; color: var(--cream); border: 1px solid #f7eedc66; }
.empty { border: 1px solid #cbbd9f; background: #f5e9d14d; min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
.empty-flower { width: 54px; height: 54px; color: var(--gold); margin-bottom: 17px; }
.empty-title { text-transform: none; font-size: 1.65rem; color: var(--teal); font-style: italic; }
.empty-copy { max-width: 270px; font-size: .93rem; margin-top: 8px; color: #796b55; }
.day-side { gap: 20px; }
.side-card { border: 1px solid var(--rule); padding: 20px 16px; background: #ede6cf70; }
.side-card:nth-child(2) { background: #e2e7d555; }
.side-title { font-size: 1.05rem; text-transform: none; color: var(--teal); padding-bottom: 12px; border-bottom: 1px solid #b8a88877; margin-bottom: 14px; }
.side-copy { font-size: .94rem; line-height: 1.55; color: #766a55; }
.mini-day { border: 0; background: transparent; min-height: 58px; gap: 9px; }
.mini-dow { font-size: .63rem; }
.mini-num { font-size: 1rem; }
.mini-day.is-anchor { background: var(--teal); }
.mini-day.is-today { box-shadow: none; outline: 1px solid var(--gold); outline-offset: 3px; }
.entry, .week-row, .month-cell, .ex-pick { border: 1px solid var(--rule); }
.entry { padding: 18px 14px; background: #faf3e599; }
.entry-name, .ex-name { font-size: 1.25rem; font-weight: 600; }
.gear, .ex-meta { color: #7c715d; font-size: .6rem; }
.chip { background: #e5e7d8; color: #465f4e; border: 1px solid #b7c1a6; font-size: .83rem; }
.art-slot, .mini-seal { border: 1px solid #887b5e; }
.colophon { border-top: 1px solid var(--rule); margin: 0 24px; padding: 16px 0 8px; }
.unit { border: 1px solid var(--rule); }
.unit button { font-size: .65rem; min-height: 30px; }
.unit button[aria-pressed="true"] { background: var(--teal); }
.archive-btn { color: #74664e; font-size: .68rem; }
.save-note { font-size: .73rem; color: #82745c; }
#sheet { border: 1px solid var(--rule); box-shadow: 0 12px 70px #33271933; }
#sheet::backdrop { background: #39372b88; backdrop-filter: blur(3px); }
.sheet-head { background: #e8dec5; color: var(--ink); border-bottom: 1px solid var(--rule); padding: 18px 14px; }
.sheet-heading h2 { text-transform: none; font-size: 1.4rem; color: var(--red); }
.sheet-sub { color: #75664f; }
.sheet-icon { border: 1px solid var(--rule); color: var(--ink); }
.sheet-body { padding: 22px; gap: 16px; }
.search, .text-input, .chip-btn, .group-card, .ex-remove, .set-remove, .add-set, .add-custom, .btn-ghost, .btn-danger, .stepper-controls, .last-banner, .confirm-box { border-width: 1px; border-color: var(--rule); }
.group-card:nth-child(n) { transform: none; }
.group-card { padding: 15px; min-height: 120px; }
.group-name { text-transform: none; font-size: 1.15rem; }
.group-count { font-size: .62rem; }
.stepper-controls { background: var(--paper); }
.stepper-controls input { border-width: 1px; border-color: var(--rule); }
button { transition: background-color .15s, color .15s; }
.nav-btn:hover, .entry:hover, .ex-pick:hover { background-color: #e9dfc7; }
.log-btn:hover { filter: brightness(1.06); }
@media (min-width: 860px) {
  .day-spread { grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); gap: 32px; }
  .day-side { padding-top: 8px; }
}
@media (max-width: 600px) {
  .stage { padding: 12px 10px 24px; }
  .poster { padding: 5px; }
  .masthead { min-height: 218px; padding: 22px 18px 16px; background-position: right 40%; background-size: 48% auto; }
  .masthead::before { background: linear-gradient(90deg, #eedebcf5, #eedebce8 48%, #eedebc55 85%); }
  .masthead-eyebrow { font-size: .54rem; letter-spacing: .12em; margin-bottom: 26px; }
  .brand { gap: 15px; }
  .seal { width: 51px; height: 62px; font-size: 32px; }
  .wordmark { font-size: 4.2rem; }
  .spine { display: none; }
  .tag { font-size: .92rem; }
  .masthead-bottom { font-size: .65rem; margin-top: 23px; }
  .switcher { margin: 0 12px; }
  #main { padding: 24px 12px 18px; }
  .date-title { font-size: 2rem; }
  .empty { min-height: 215px; }
  .day-side { margin-top: 22px; }
  .colophon { margin: 0 12px; }
}
.masthead { background-image: none; }
.masthead::after {
  content: ""; position: absolute; inset: 0 0 0 48%; z-index: 0;
  background: none;
  opacity: .58;
  mask-image: linear-gradient(90deg, transparent, #000 65%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 65%);
}
.masthead::before { z-index: 1; }
.masthead > * { z-index: 2; }
@media (max-width: 600px) { .masthead::after { inset-inline-start: 45%; opacity: .42; } }

/* Vitality edition: jade, rose and saffron with an original floral frame. */
:root {
  --ink: #293f3b;
  --red: #aa433b;
  --gold: #b18b43;
  --gold-2: #e1bc71;
  --yellow: #e4be6e;
  --cream: #ead0bf;
  --paper: #f1ddcc;
  --blush: #8eaca3;
  --teal: #386d60;
  --rule: #ac9178;
}
body {
  background-color: #83a59c;
  background-image: radial-gradient(ellipse at 15% 0%, #b1c6b5, transparent 75%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23344038' opacity='.12' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
.poster { padding: 13px 35px; border: 1px solid #385b50; background: #eac6b3; box-shadow: 0 14px 45px #1e473b30, inset 0 0 0 4px #c7a15d, inset 0 0 0 6px #4f7060; }
.ornament { position: absolute; top: 7px; bottom: 7px; width: 23px; background: url('../assets/floral-border.svg') center top / 23px auto repeat-y; pointer-events: none; }
.ornament-left { left: 7px; }
.ornament-right { right: 7px; transform: scaleX(-1); }
.masthead { background: #88aa91; border: 1px solid #577966; min-height: 270px; }
.masthead::before { background: linear-gradient(90deg, #88aa91f5, #88aa91d9 37%, #88aa9100 70%); }
.masthead::after { inset: 0; background: none; opacity: 1; mask-image: none; -webkit-mask-image: none; }
.masthead-eyebrow, .issue, .masthead-bottom { color: #274b40; }
.seal { box-shadow: inset 0 0 0 3px #88aa91, inset 0 0 0 4px var(--red); }
.wordmark { text-shadow: 1px 1px #d1b785; }
.switcher { background: #dcb49f; margin: 0; border-bottom: 1px solid #af7f69; }
.switcher button[aria-current="page"] { background: #e6bda6; }
#main { background: #ebcabb; border-left: 1px solid #c4a18b; border-right: 1px solid #c4a18b; }
.stats { background: #e9b697; border-color: #b27d61; }
.stat + .stat { border-color: #b27d6177; }
.stat:nth-child(2) { background: #e8c278; }
.stat:nth-child(3) { background: #b3c2a0; }
.stat-label { color: #514f36; }
.empty { position: relative; background: #a9be9b; border: 1px solid #758b64; box-shadow: inset 0 0 0 5px #a9be9b, inset 0 0 0 6px #d4c283; }
.empty::before, .empty::after { content: "❧"; position: absolute; color: #647d53; font-size: 2.5rem; top: 8px; }
.empty::before { left: 12px; }
.empty::after { right: 12px; transform: scaleX(-1); }
.empty-title { color: #315347; }
.empty-copy { color: #3f5546; }
.empty-flower { color: #996c35; }
.side-card { background: #a3bab0; border-color: #6f9181; box-shadow: inset 0 0 0 4px #a3bab0, inset 0 0 0 5px #c8b680; }
.side-card:nth-child(2) { background: #dfb090; border-color: #b78765; box-shadow: inset 0 0 0 4px #dfb090, inset 0 0 0 5px #c79170; }
.side-title { color: #315849; border-color: #547b6177; }
.side-copy { color: #5d493d; }
.mini-day.is-anchor { color: #f5e6d0; }
.entry, .ex-pick { background: #e2cdb7; }
.week-row { background: #b1c2a3; }
.week-row:nth-child(even) { background: #e5ba98; }
.week-row.has-log { background: #d7bf7b; }
.month-cell { background: #b5c5a4; border-color: #7f997b; }
.month-cell.is-weekend:not(.has-log) { background: #e0ad94; }
.month-cell.is-anchor:not(.has-log) { background: #e5bf73; }
.month-cell.has-log, .mini-day.is-anchor { color: #fff1de; }
.colophon { margin: 0; padding: 18px 24px 10px; border-color: #b58f73; background: #dfb79e; }
.archive-btn, .save-note { color: #604c3e; }
#sheet { background: #e5c5b2; }
.sheet-head { background: #97b59e; }
.search, .text-input, .stepper-controls { background: #f0daca; }
.group-card { color: #f8e7cf; }
.tone-gold, .tone-yellow, .tone-pink, .tone-cream { color: #3d4330; }
.log-btn, .btn-primary { color: #fff0d9; }
.log-btn-icon { color: #fff0d9; }
@media (max-width: 600px) {
  .stage { padding: 8px 5px 20px; }
  .poster { padding: 8px 23px; }
  .ornament { width: 14px; background-size: 17px auto; top: 5px; bottom: 5px; }
  .ornament-left { left: 5px; } .ornament-right { right: 5px; }
  .masthead { padding: 20px 14px 14px; min-height: 226px; }
  .masthead::before { background: linear-gradient(90deg, #88aa91ed, #88aa91c4 45%, #88aa9133); }
  .masthead-eyebrow { font-size: .48rem; letter-spacing: .1em; }
  .brand { gap: 12px; }
  .wordmark { font-size: 3.7rem; }
  .masthead-bottom { font-size: .58rem; }
  #main { padding: 24px 10px 18px; }
  .colophon { padding: 16px 10px 10px; }
}

/* Direct training copy in the daily empty state. */
.empty-title { font-style: normal; font-weight: 600; }
.empty-copy { font-style: normal; }

/* Optimized original tiger artwork; smaller download on phone screens. */
.masthead::after {
  background: url('../assets/tiger-bamboo-1600.webp') 68% center / cover no-repeat;
}
.masthead::before {
  background: linear-gradient(90deg, #88aa91d9 0%, #88aa91b0 35%, #88aa9122 65%, transparent 100%);
}
@media (max-width: 600px) {
  .masthead::after {
    background-image: url('../assets/tiger-bamboo-960.webp');
    background-position: 64% center;
  }
  .masthead::before {
    background: linear-gradient(90deg, #88aa91ee 0%, #88aa91cc 40%, #88aa9144 80%);
  }
}
@media (min-width: 601px) and (max-width: 859px) {
  .wordmark { font-size: 4.2rem; }
  .spine { display: none; }
}
.masthead-bottom span:last-child { color: #f3dfb4; text-shadow: 0 1px 3px #203e33; }
@media (max-width: 600px) {
  .masthead-bottom span:last-child { color: #274b40; text-shadow: none; }
}

/* Lift Scroll masthead. */
.wordmark { display: flex; flex-direction: column; gap: .05em; font-size: 3.25rem; line-height: .86; letter-spacing: -.045em; }
.brand { gap: 18px; max-width: 470px; }
@media (min-width: 860px) { .wordmark { font-size: 3.65rem; } }
@media (max-width: 600px) {
  .wordmark { font-size: clamp(2rem, 8.8vw, 2.75rem); }
  .brand { gap: 12px; }
  .tag { margin-top: 10px; }
}
@media (min-width: 601px) and (max-width: 859px) { .wordmark { font-size: 2.7rem; } }

/* Align the wordmark with the masthead eyebrow. */
.brand { gap: 0; }
.brand-copy { flex: 0 1 auto; }
.spine { margin-left: 24px; }
.masthead-eyebrow {
  color: #203e33;
  font-weight: 600;
  text-shadow: 0 1px 2px #e7eed4, 0 0 8px #e7eed4cc;
}

/* Keep the unit toggle fitted to its two buttons. */
.unit { width: max-content; justify-self: start; }

/* Journal information and support. */
.switcher { grid-template-columns: repeat(3, minmax(0, 1fr)) 52px; align-items: center; }
.footer-actions .info-button {
  width: 30px; height: 30px; padding: 0; justify-self: center;
  border: 1px solid #657662; border-radius: 50%; color: #315849;
  font-family: var(--serif); font-size: 1.05rem; font-style: italic;
}
.footer-actions .info-button:hover { background: #c7bc91; }
.info-body { line-height: 1.55; }
.info-section { border-top: 1px solid var(--rule); padding-top: 16px; }
.info-section h3 { font-size: 1.1rem; font-weight: 600; color: var(--teal); margin-bottom: 5px; }
.info-support { background: #d3b77b66; padding: 16px; border: 1px solid var(--gold); }
.coffee-link {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 12px 16px; color: #fff0d9;
  background: #a84435; border: 1px solid #913c30; text-decoration: none;
}
.coffee-link:hover { background: #923b30; }
@media (max-width: 600px) {
  .switcher { grid-template-columns: repeat(3, minmax(0, 1fr)) 38px; }
  .switcher button { gap: 5px; }
  .switch-en { font-size: .75rem; }
  .footer-actions .info-button { width: 27px; height: 27px; }
}

.app-logo { width: 96px; height: 96px; align-self: center; border: 1px solid var(--gold); box-shadow: 0 0 0 3px #c8ad73; }

/* Header meets the floral frame; information sits below Archive. */
.switcher { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.poster { padding-top: 7px; }
.masthead { margin-inline: -5px; border: 0; }
.footer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; justify-self: end; }
.footer-actions .info-button { display: grid; place-items: center; }
@media (max-width: 600px) {
  .poster { padding-top: 5px; }
  .masthead { margin-inline: -4px; }
}

/* A small aged-bronze information coin in the footer corner. */
.colophon { position: relative; padding-bottom: 22px; }
.footer-actions { display: block; align-self: start; }
.footer-actions .info-button {
  position: absolute; right: 9px; bottom: 8px;
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1px solid #655035;
  background:
    radial-gradient(ellipse at 27% 20%, #eed39888, transparent 45%),
    conic-gradient(from 25deg, #ac884d, #d7b872, #8c713f, #c6a56a, #8b7547, #d4b575, #ac884d);
  color: #50452c;
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600; font-style: italic;
  text-shadow: 0 1px 0 #f3dca6, 0 -1px 0 #65503566;
  box-shadow: inset 0 1px 1px #fff0bd, inset 0 -2px 2px #59462999,
    0 2px 0 #725b39, 0 4px 6px #493b3144;
  isolation: isolate;
  transition: transform .15s ease, box-shadow .15s ease;
}
.footer-actions .info-button::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px solid #765f3d; box-shadow: 0 1px 0 #f1d79799, inset 0 1px 0 #f1d79788;
  pointer-events: none;
}
.footer-actions .info-button::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 1px dotted #735e3999; pointer-events: none;
  background: radial-gradient(ellipse at 75% 80%, #486c5533, transparent 65%);
  z-index: -1;
}
.footer-actions .info-button:hover { background-color: #c7a668; transform: translateY(-1px) rotate(-5deg); }
.footer-actions .info-button:active { transform: translateY(2px); box-shadow: inset 0 1px 2px #5f4e3a66, 0 1px 0 #725b39; }
.colophon .save-note { padding-right: 48px; }

/* Fill the framed body without outer side gutters. */
#main { padding-inline: 0; margin-inline: -5px; border-inline: 0; }
.switcher, .colophon { margin-inline: -5px; }
.datebar-wrap { padding-inline: 14px; }
.caption { padding-inline: 16px; }
@media (max-width: 600px) {
  #main, .switcher, .colophon { margin-inline: -4px; }
  .datebar-wrap { padding-inline: 10px; }
}

/* Optical centering for the italic engraved i. */
.footer-actions .info-button > span {
  display: block;
  line-height: 1;
  transform: translate(-1px, 2px);
}
