@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces and ink */
  --paper: #F3EEE3;
  --paper-2: #E9E2D2;
  --paper-3: #FBF9F4;
  --ink: #1B1A17;
  --ink-2: #57534A;
  --rule: #CBC2AE;

  /* one accent: it marks only what is on your plan */
  --accent: #C23B1A;
  --accent-ink: #9E2E12;
  --on-accent: #FFFFFF;
  --focus: #1D4ED8;

  /* category tones, used as dots and block edges */
  --c-art: #7A4EA3;
  --c-film: #2F5D8C;
  --c-food: #B87A0A;
  --c-literature: #5F6B1F;
  --c-music: #B23A62;
  --c-outdoors: #2E7D5B;
  --c-walks: #8A5A3C;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --lane-h: 70px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
#events:focus { outline: none; }

.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cat, var(--ink));
  flex: none;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
}
.skip:focus { top: 12px; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--ink); }
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.edition {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.sections {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.sections a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
}
.sections a:hover { border-color: var(--ink); }
.pill {
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
  line-height: 18px;
}
.pill.has-items {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(32px, 4vw, 48px);
}
.hero h1 {
  grid-column: 1 / span 8;
  font-size: clamp(42px, 6.3vw, 98px);
  font-weight: 450;
  line-height: .98;
  letter-spacing: -.028em;
  font-variation-settings: "opsz" 72;
  text-wrap: balance;
}
/* the timetable segment, used as an underline */
.mark {
  background: linear-gradient(var(--accent), var(--accent)) 0 94% / 100% .11em no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero-side {
  grid-column: 9 / -1;
  align-self: end;
  display: grid;
  gap: 20px;
}
.hero-side > p {
  font-size: 17.5px;
  color: var(--ink-2);
  max-width: 44ch;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.stats li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.stats strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

/* ---------- at a glance timeline ---------- */
.glance { padding-bottom: clamp(36px, 5vw, 56px); }
.glance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 14px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chart-scroll { overflow-x: auto; }
.chart { border-top: 2px solid var(--ink); }
.chart-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
}
.chart-ruler {
  position: relative;
  height: 30px;
}
.chart-ruler span {
  position: absolute;
  top: 8px;
  padding-left: 5px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  border-left: 1px solid var(--ink);
  line-height: 1;
  height: 22px;
}
.chart-day { border-bottom: 1px solid var(--ink); }
.chart-daylabel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 0;
}
.chart-daylabel .num {
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
}
.chart-track {
  position: relative;
  height: calc(var(--lanes, 1) * var(--lane-h) + 14px);
  background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / 13) 100%;
}
.block {
  position: absolute;
  top: calc(7px + var(--lane) * var(--lane-h));
  left: var(--l);
  width: calc(var(--w) - 4px);
  height: calc(var(--lane-h) - 6px);
  transition: opacity .2s var(--ease);
}
.block button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 6px 8px 6px 9px;
  border: 1px solid var(--ink);
  border-left: 5px solid var(--cat);
  border-radius: 0;
  background: var(--paper-3);
  text-align: left;
  overflow: hidden;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.block button:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 0 var(--ink);
}
.block-time {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--ink-2);
  white-space: nowrap;
}
.block-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.block.is-saved button {
  background: var(--accent);
  border-color: var(--accent);
  border-left-color: var(--cat);
  color: var(--on-accent);
}
.block.is-saved .block-time { color: rgba(255, 255, 255, .88); }
.block.is-out { opacity: .28; }
.hint {
  display: none;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- toolbar ---------- */
.toolbar-wrap {
  background: var(--paper);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  z-index: 20;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 16px 20px;
  padding-block: 14px 16px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input,
.field select {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper-3);
  font-size: 17px;
}
.field input::placeholder { color: #7A7569; }
.input-icon { position: relative; }
.input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-2);
  pointer-events: none;
}
.input-icon input { padding-left: 42px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231B1A17' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.toggle .box {
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  flex: none;
}
.toggle:hover { background: var(--paper-2); }
.toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.toggle[aria-pressed="true"] .box {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.count {
  align-self: center;
  padding-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ---------- listing ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(32px, 5vw, 72px);
  padding-top: 40px;
  padding-bottom: 104px;
}
.loading {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-2);
}
.day + .day { margin-top: 64px; }
.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.day-head h2 {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 450;
  line-height: 1;
  letter-spacing: -.025em;
  font-variation-settings: "opsz" 72;
}
.day-date {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-2);
}
.day-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 8px 28px;
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--rule);
}
/* each row's top edge is the day's clock: 09:00 on the left, 22:00 on the right */
.span-rule {
  position: absolute;
  top: -1px;
  left: var(--l);
  width: var(--w);
  height: 5px;
  background: var(--ink);
  transition: background-color .2s var(--ease);
}
.event.is-saved .span-rule { background: var(--accent); }
.t-start {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -.02em;
}
.t-end,
.t-dur {
  display: block;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-2);
}
.t-end { margin-top: 10px; }
.event-cat {
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-title {
  margin: 8px 0 10px;
  font-size: clamp(23px, 2.1vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.open {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: text-decoration-color .15s var(--ease);
}
.open::after {
  content: "";
  position: absolute;
  inset: 0;
}
.event:hover .open { text-decoration-color: var(--ink); }
.event-sum {
  max-width: 62ch;
  color: var(--ink-2);
}
.event-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-family: var(--mono);
  font-size: 13.5px;
}
.event-meta span + span::before {
  content: "/";
  margin: 0 10px;
  color: var(--ink-2);
}
.event-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 14px;
}
.go {
  padding: 8px 12px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.event:hover .go {
  background: var(--ink);
  color: var(--paper);
}
.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-ink);
  white-space: nowrap;
}
.saved-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.empty {
  padding: 44px clamp(24px, 4vw, 48px) 48px;
  border: 1px dashed var(--ink-2);
  background: var(--paper-3);
}
.empty-title {
  margin: 10px 0 10px;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.empty-msg {
  max-width: 52ch;
  margin-bottom: 24px;
  color: var(--ink-2);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* ---------- plan ---------- */
.plan { align-self: start; }
.plan-card {
  padding: 26px 24px 24px;
  border: 1px solid var(--ink);
  background: var(--paper-3);
  box-shadow: 6px 6px 0 var(--paper-2);
}
.plan-card h2 {
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
}
.plan-sub { margin-top: 8px; }
.plan-empty {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-2);
}
.plan-empty strong { color: var(--ink); font-weight: 600; }
.plan-day {
  margin-top: 22px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.plan-entry {
  display: grid;
  gap: 2px;
  padding: 12px 0 12px 14px;
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  margin-top: 8px;
}
.plan-time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.plan-open {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.plan-open:hover { text-decoration-color: var(--ink); }
.plan-where {
  font-size: 15px;
  color: var(--ink-2);
}
.clash-flag {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--accent-ink);
}
.plan-total {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
}

/* ---------- footer ---------- */
.footer {
  border-top: 2px solid var(--ink);
  padding: 40px 0 36px;
  background: var(--paper-2);
}
.footer-mark {
  font-size: clamp(50px, 13vw, 196px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.045em;
  font-variation-settings: "opsz" 72;
}
.footer-ruler {
  position: relative;
  height: 34px;
  margin-top: 22px;
  border-top: 1px solid var(--ink);
}
.footer-ruler span {
  position: absolute;
  top: 0;
  height: 12px;
  border-left: 1px solid var(--ink);
}
.footer-ruler span.major { height: 18px; }
.footer-ruler span[data-h]::after {
  content: attr(data-h);
  position: absolute;
  top: 18px;
  left: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.footer-ruler .seg {
  top: -3px;
  height: 6px;
  border: 0;
  background: var(--accent);
}
.footer-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 48px;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- detail sheet ---------- */
dialog.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(620px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-left: 2px solid var(--ink);
  background: var(--paper-3);
  color: var(--ink);
  overflow: hidden;
}
dialog.sheet[open] { animation: sheet-in .28s var(--ease); }
dialog.sheet::backdrop { background: rgba(27, 26, 23, .5); }
@keyframes sheet-in {
  from { transform: translateX(32px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--rule);
}
.sheet-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
}
.close:hover { background: var(--ink); color: var(--paper); }
.close .x { font-size: 18px; line-height: 1; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 28px 36px;
}
.sheet-title {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.022em;
  font-variation-settings: "opsz" 60;
  text-wrap: balance;
}
.ruler-lg {
  position: relative;
  height: 58px;
  margin: 26px 0 26px;
}
.ruler-lg .base {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  border-top: 1px solid var(--ink);
}
.ruler-lg .tick {
  position: absolute;
  top: 26px;
  height: 7px;
  border-left: 1px solid var(--ink);
}
.ruler-lg .tick.major { height: 12px; }
.ruler-lg .tick[data-h]::after {
  content: attr(data-h);
  position: absolute;
  top: 14px;
  left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.ruler-lg .tick.first[data-h]::after { transform: none; left: -1px; }
.ruler-lg .tick.last[data-h]::after { transform: translateX(-100%); }
.ruler-lg .seg {
  position: absolute;
  top: 14px;
  height: 12px;
  background: var(--ink);
  transition: background-color .2s var(--ease);
}
.ruler-lg.is-saved .seg { background: var(--accent); }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0 0 28px;
}
.facts > div {
  padding: 12px 0 14px;
  border-top: 1px solid var(--rule);
}
.facts dt { margin-bottom: 4px; }
.facts dd {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}
.facts .sub {
  display: block;
  font-size: 15px;
  color: var(--ink-2);
}
.sheet-about { margin-bottom: 10px; }
.sheet-text {
  max-width: 60ch;
  font-size: 18px;
  line-height: 1.62;
  white-space: pre-line;
}
.sheet-clash {
  margin-top: 24px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: #F7E7DF;
  font-size: 15.5px;
  color: var(--ink);
}
.sheet-foot {
  padding: 16px 28px 20px;
  border-top: 2px solid var(--ink);
  background: var(--paper-3);
}
.save {
  width: 100%;
  min-height: 54px;
  font-size: 15px;
}
.save[aria-pressed="true"] {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent-ink);
}
.save[aria-pressed="true"]:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.save-icon {
  display: inline-block;
  width: 14px;
  text-align: center;
}
.save-status {
  min-height: 20px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- responsive ---------- */
@media (min-width: 900px) {
  html { scroll-padding-top: 108px; }
  .toolbar-wrap {
    position: sticky;
    top: 0;
  }
  .plan {
    position: sticky;
    top: 118px;
  }
  .plan-card {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

@media (max-width: 1100px) {
  .hero h1 { grid-column: 1 / -1; }
  .hero-side { grid-column: 1 / span 9; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .edition-long { display: none; }
}

@media (max-width: 899px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .plan { order: 2; }
  .chart-scroll {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
  }
  .chart { min-width: 1080px; }
  .hint { display: block; }
  .toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .field-search { grid-column: 1 / -1; }
  .toggle { justify-content: center; }
  .count { grid-column: 1 / -1; padding-top: 0; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .masthead-inner { gap: 12px; min-height: 58px; }
  .wordmark { font-size: 19px; }
  .edition { display: none; }
  .sections a:not(.nav-plan) { display: none; }
  .hero { gap: 20px; }
  .hero-side { grid-column: 1 / -1; }
  .stats strong { font-size: 22px; }
  .glance-head { flex-direction: column; align-items: flex-start; }
  .legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100% + var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding-bottom: 4px;
  }
  .chip { flex: none; }
  .toolbar { gap: 12px; }
  .toggle { padding: 0 12px; }
  .layout { padding-top: 28px; padding-bottom: 72px; }
  .day + .day { margin-top: 48px; }
  .event {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 4px 16px;
    padding: 24px 0 26px;
  }
  .t-start { font-size: 19px; }
  .t-end { margin-top: 6px; font-size: 12.5px; }
  .t-dur { font-size: 12.5px; }
  .event-meta { font-size: 13px; }
  .event-end {
    grid-column: 2;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
  }
  .footer-notes { grid-template-columns: 1fr; }
  .footer-ruler span[data-h]:not(.major)::after { content: none; }

  dialog.sheet {
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    max-height: 92vh;
    max-height: 92dvh;
    border-left: 0;
    border-top: 2px solid var(--ink);
    border-radius: 14px 14px 0 0;
  }
  dialog.sheet[open] { animation-name: sheet-up; }
  .sheet-inner { max-height: 92vh; max-height: 92dvh; }
  .sheet-head { padding: 12px 20px; }
  .sheet-body { padding: 22px 20px 28px; }
  .sheet-foot { padding: 14px 20px 18px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .facts dd { font-size: 16.5px; }
  .sheet-text { font-size: 17px; }
}
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
