:root {
  --paper: #f4f0e7;
  --paper-deep: #e8e0d2;
  --card: #fffdf7;
  --ink: #172129;
  --ink-soft: #49545a;
  --line: #cfc6b6;
  --orange: #e66035;
  --yellow: #f4c453;
  --sage: #91a584;
  --blue: #86a9bd;
  --red: #b94235;
  --white: #fffdf7;
  --shadow: 0 18px 50px rgba(23, 33, 41, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --content: 1180px;
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--yellow);
  border-radius: 8px;
  font-weight: 700;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

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

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(20px, calc((100vw - var(--content)) / 2));
  color: var(--white);
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  width: 40px;
  align-items: center;
  justify-content: space-between;
}

.brand-mark span {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
}

.brand-mark span:nth-child(2) {
  position: relative;
}

.brand-mark span:nth-child(2)::before,
.brand-mark span:nth-child(2)::after {
  position: absolute;
  top: 4px;
  width: 13px;
  height: 1px;
  content: "";
  background: var(--yellow);
}

.brand-mark span:nth-child(2)::before {
  right: 7px;
}

.brand-mark span:nth-child(2)::after {
  left: 7px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.compact-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 40px;
  padding: 9px;
  place-items: center;
  border-radius: 50%;
}

.icon-button svg,
.search-field svg,
.dialog-search svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.compact-button {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tools-button {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--yellow);
}

.private-button {
  color: var(--white);
  border-color: rgba(244, 196, 83, 0.62);
}

.private-button.unlocked {
  color: var(--ink);
  background: var(--sage);
  border-color: var(--sage);
}

.icon-button:hover,
.compact-button:hover {
  color: var(--ink);
  background: var(--white);
}

.masthead {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  padding: 74px max(24px, calc((100vw - var(--content)) / 2)) 68px;
  color: var(--white);
  background: var(--ink);
}

.masthead::before,
.masthead::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.masthead::before {
  width: 300px;
  height: 300px;
  right: 13%;
  top: 54px;
  border: 1px solid rgba(244, 196, 83, 0.28);
}

.masthead::after {
  width: 12px;
  height: 12px;
  right: calc(13% + 144px);
  top: 42px;
  background: var(--orange);
  box-shadow: 0 324px 0 var(--yellow);
}

.masthead-copy {
  position: relative;
  z-index: 2;
  width: min(760px, 64%);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.masthead h1 {
  max-width: 740px;
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(3.4rem, 8vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.deck {
  max-width: 590px;
  margin: 28px 0 0;
  color: rgba(255, 253, 247, 0.72);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.masthead-board {
  position: absolute;
  z-index: 3;
  top: 70px;
  right: max(24px, calc((100vw - var(--content)) / 2));
  display: grid;
  width: 340px;
  grid-template-columns: 136px 1fr;
  overflow: hidden;
  background: var(--card);
  color: var(--ink);
  border-radius: 4px 28px 4px 28px;
  box-shadow: 22px 22px 0 rgba(230, 96, 53, 0.85);
}

.date-plaque {
  display: flex;
  min-height: 200px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
}

.date-plaque span,
.date-plaque small {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.date-plaque strong {
  margin: 3px 0;
  font-family: Georgia, serif;
  font-size: 4.8rem;
  font-weight: 500;
  line-height: 1;
}

.trip-stats {
  display: grid;
  padding: 22px;
}

.trip-stats p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.trip-stats p:last-child {
  border: 0;
}

.trip-stats strong {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
}

.trip-stats span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.route-wordmark {
  position: absolute;
  right: max(24px, calc((100vw - var(--content)) / 2));
  bottom: 28px;
  color: rgba(255, 255, 255, 0.36);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.notice-strip {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 10px max(24px, calc((100vw - var(--content)) / 2));
  background: var(--yellow);
}

.notice-strip p {
  flex: 1;
  margin: 0;
  font-size: 0.88rem;
}

.notice-strip button {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.notice-pulse {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(185, 66, 53, 0.15);
}

.modebar {
  display: flex;
  max-width: var(--content);
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  background: var(--paper-deep);
  border-radius: 999px;
}

.segmented-control button,
.filter-row button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.segmented-control button {
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.segmented-control button[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
}

.journey-state {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}

.app-shell {
  display: grid;
  max-width: var(--content);
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 46px;
  margin: 0 auto;
  padding: 36px 0 100px;
}

.day-rail {
  position: sticky;
  top: 88px;
  height: calc(100vh - 112px);
  overflow: auto;
  scrollbar-width: thin;
}

.rail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 10px;
}

.rail-heading span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.rail-heading small {
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.day-list {
  position: relative;
  padding: 5px 0 5px 24px;
}

.day-list::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 10px;
  width: 1px;
  content: "";
  background: var(--line);
}

.day-nav-button {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.day-nav-button::before {
  position: absolute;
  left: -19px;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--paper);
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
}

.day-nav-button[aria-current="date"] {
  background: var(--card);
  box-shadow: 0 8px 24px rgba(23, 33, 41, 0.08);
}

.day-nav-button[aria-current="date"]::before {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 0 5px rgba(230, 96, 53, 0.15);
}

.day-nav-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.day-nav-title {
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.status-dot.confirmed,
.status-dot.booked {
  background: var(--sage);
}

.status-dot.alert,
.status-dot.critical {
  background: var(--red);
}

.status-dot.suggested {
  background: var(--yellow);
}

main {
  min-width: 0;
}

.loading-card {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.loading-card p {
  color: var(--ink-soft);
}

.loading-mark {
  width: 38px;
  height: 38px;
  border: 3px solid var(--paper-deep);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.day-hero {
  position: relative;
  overflow: hidden;
  padding: 38px 40px 36px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-lg) var(--radius-lg) 8px 8px;
}

.day-hero::after {
  position: absolute;
  width: 210px;
  height: 210px;
  right: -48px;
  bottom: -72px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.day-hero-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.day-counter,
.status-badge {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.day-counter {
  color: var(--yellow);
}

.status-badge {
  padding: 5px 9px;
  color: var(--ink);
  background: var(--blue);
  border-radius: 999px;
}

.status-badge.confirmed,
.status-badge.booked {
  background: var(--sage);
}

.status-badge.alert,
.status-badge.critical {
  color: var(--white);
  background: var(--red);
}

.status-badge.suggested {
  background: var(--yellow);
}

.day-heading-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
}

.calendar-tile {
  display: grid;
  height: 104px;
  place-items: center;
  align-content: center;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 2px 20px 2px 20px;
}

.calendar-tile strong {
  font-family: Georgia, serif;
  font-size: 3.25rem;
  font-weight: 500;
  line-height: 0.95;
}

.calendar-tile span {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.day-title h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2.1rem, 5vw, 3.65rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.day-route {
  margin: 10px 0 0;
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.day-summary {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 24px 0 0 132px;
  color: rgba(255, 253, 247, 0.74);
}

.day-facts {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.day-facts div {
  min-width: 0;
}

.day-facts dt {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.day-facts dd {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.quick-panel {
  margin-top: 14px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px 8px var(--radius-md) var(--radius-md);
}

.quick-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.quick-panel-head h3 {
  margin: 0;
  font-size: 0.9rem;
}

.quick-panel-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-link {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  background: var(--paper);
  border-color: var(--ink-soft);
}

.link-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 900;
}

.link-icon.apple { background: var(--orange); }
.link-icon.google { background: var(--blue); }
.link-icon.app { background: #5966a9; }
.link-icon.official { background: var(--sage); }
.link-icon.phone { background: #4d8b69; }
.link-icon.source { background: var(--ink-soft); }

.quick-link strong,
.quick-link small {
  display: block;
}

.quick-link strong {
  font-size: 0.76rem;
  line-height: 1.3;
}

.quick-link small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.markdown-body {
  margin-top: 22px;
  padding: 34px 40px 44px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.private-panel {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  padding: 22px 24px;
  color: var(--white);
  background: #283c34;
  border-radius: var(--radius-md);
}

.private-panel::after {
  position: absolute;
  right: -34px;
  bottom: -52px;
  width: 150px;
  height: 150px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.private-panel h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.private-panel-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.private-panel-head h3 {
  margin: 0;
}

.private-panel-head button {
  padding: 6px 10px;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
}

.private-panel .private-fields {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin: 0;
}

.private-panel dt {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.private-panel dd {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.private-panel dd a,
.private-map-link {
  color: var(--yellow);
  overflow-wrap: anywhere;
}

.private-expenses {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.private-cost-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.private-cost-summary > div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.private-cost-summary span,
.private-cost-summary strong {
  display: block;
}

.private-cost-summary span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.private-cost-summary strong {
  margin-top: 4px;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.private-payment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.private-payment-summary > div {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
}

.private-payment-summary span,
.private-payment-summary strong {
  display: block;
}

.private-payment-summary span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.private-payment-summary strong {
  margin-top: 3px;
  font-size: 0.82rem;
}

.private-cost-note {
  margin: 10px 0 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  line-height: 1.55;
}

.private-expense-card {
  margin-top: 10px;
  padding: 14px;
  color: var(--ink);
  background: #f7f1e7;
  border-radius: 12px;
}

.private-expense-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(34, 49, 43, 0.14);
}

.private-expense-card header strong {
  font-size: 0.88rem;
}

.private-expense-card header span {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  white-space: nowrap;
}

.private-expense-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
}

.private-expense-card dt {
  color: var(--ink-soft);
}

.private-expense-card dd {
  color: var(--ink);
}

.private-payment-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.private-payment-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(90px, 0.7fr) minmax(100px, 1fr);
  gap: 8px 12px;
  align-items: baseline;
  padding: 9px 10px;
  background: rgba(23, 33, 41, 0.045);
  border-left: 3px solid var(--line);
  border-radius: 6px;
}

.private-payment-row.timing-prepaid {
  border-left-color: var(--sage);
}

.private-payment-row.timing-at_property {
  border-left-color: var(--orange);
}

.private-payment-row span {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.private-payment-row strong {
  font-size: 0.78rem;
}

.private-payment-row em,
.private-payment-row small {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-style: normal;
}

.private-payment-row small {
  grid-column: 1 / -1;
}

.private-expense-card dd a,
.private-expense-card .private-map-link {
  color: var(--orange);
}

.private-map-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 900;
}

.markdown-body h2,
.markdown-body h3 {
  color: var(--ink);
}

.markdown-body h2 {
  position: relative;
  margin: 2.6rem 0 1rem;
  padding-top: 1.4rem;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.65rem;
  font-weight: 500;
  border-top: 1px solid var(--line);
}

.markdown-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.markdown-body h3 {
  margin: 2rem 0 0.7rem;
  font-size: 1rem;
}

.markdown-body p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.markdown-body strong {
  color: var(--ink);
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.7rem 0 1.4rem;
  padding-left: 1.3rem;
}

.markdown-body li {
  margin: 0.55rem 0;
  padding-left: 0.25rem;
}

.markdown-body blockquote {
  margin: 1.2rem 0 1.7rem;
  padding: 16px 18px 16px 20px;
  color: var(--ink);
  background: #f6e8dc;
  border-left: 5px solid var(--orange);
  border-radius: 0 12px 12px 0;
}

.markdown-body blockquote p {
  margin: 0;
  color: inherit;
}

.markdown-body a {
  color: #225d7b;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.task-item {
  list-style: none;
  margin-left: -1.1rem !important;
}

.task-item label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  cursor: pointer;
}

.task-item input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--orange);
}

.task-item input:checked + span {
  color: #6f777b;
  text-decoration: line-through;
}

.day-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.day-pager button {
  min-height: 46px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.day-pager button:last-child {
  justify-self: end;
}

.day-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.day-pager span {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.overview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.overview-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.search-field,
.dialog-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field {
  width: min(340px, 100%);
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-field input,
.dialog-search input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-row button {
  padding: 7px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.filter-row button[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.overview-card {
  position: relative;
  display: grid;
  min-height: 240px;
  grid-template-rows: auto 1fr auto;
  padding: 24px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(23, 33, 41, 0.06);
}

.overview-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.overview-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overview-card-date {
  color: var(--orange);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 900;
}

.overview-card h3 {
  margin: 24px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.15;
}

.overview-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.overview-card-route {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem !important;
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-soft);
}

dialog {
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

dialog::backdrop {
  background: rgba(23, 33, 41, 0.72);
}

.search-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dialog-header {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.dialog-search {
  flex: 1;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 999px;
}

.dialog-header > button {
  padding: 8px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.dialog-results {
  max-height: 570px;
  overflow: auto;
  padding: 10px 18px 22px;
}

.search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 15px 8px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.search-result time {
  color: var(--orange);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 800;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 3px;
  color: var(--ink-soft);
}

.tools-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.tools-panel {
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 32px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.tools-topline,
.critical-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.tools-topline h2,
.critical-panel h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 2.5rem;
  font-weight: 500;
}

.tools-topline > button,
.critical-topline > button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.35rem;
}

.tools-intro {
  max-width: 720px;
  margin: 12px 0 28px;
  color: var(--ink-soft);
}

.tool-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-group {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.tool-group h3 {
  margin: 0 0 14px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.tool-group .quick-link {
  margin-top: 8px;
}

.critical-dialog {
  width: min(620px, calc(100vw - 32px));
}

.auth-dialog {
  width: min(480px, calc(100vw - 32px));
}

.auth-panel {
  position: relative;
  padding: 34px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 2.3rem;
  font-weight: 500;
}

.auth-panel > p:not(.eyebrow, .auth-error) {
  color: var(--ink-soft);
}

.auth-panel label {
  display: block;
  margin: 24px 0 14px;
}

.auth-panel label span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.auth-panel input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.auth-panel small {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}

.lock-mark {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  margin-bottom: 22px;
  padding: 0 12px;
  color: var(--white);
  background: #283c34;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.auth-error {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
}

.critical-panel {
  padding: 30px;
  background: var(--card);
  border-radius: var(--radius-lg);
}

.critical-topline span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.critical-panel ol {
  margin: 22px 0;
  padding-left: 1.4rem;
}

.critical-panel li {
  margin: 14px 0;
  color: var(--ink-soft);
}

.primary-button {
  width: 100%;
  padding: 13px 18px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 26px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-day-nav {
  display: none;
}

footer {
  display: flex;
  max-width: var(--content);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 28px 0 46px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

footer a {
  font-weight: 800;
}

@media (max-width: 1228px) {
  .modebar,
  .app-shell,
  footer {
    margin-right: 24px;
    margin-left: 24px;
  }
}

@media (max-width: 900px) {
  .masthead {
    min-height: 610px;
  }

  .masthead-copy {
    width: 100%;
  }

  .masthead-board {
    top: auto;
    right: auto;
    bottom: 78px;
    left: 24px;
  }

  .app-shell {
    display: block;
    margin: 0;
    padding: 24px 20px 112px;
  }

  .day-rail {
    display: none;
  }

  .modebar {
    margin: 0;
    padding: 20px;
  }

  .mobile-day-nav {
    position: fixed;
    z-index: 40;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 16px;
    display: grid;
    min-height: 56px;
    grid-template-columns: 56px 1fr 56px;
    overflow: hidden;
    background: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    box-shadow: var(--shadow);
  }

  .mobile-day-nav button {
    color: var(--white);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-weight: 800;
  }

  .mobile-day-nav button + button {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
  }

  .mobile-day-nav button:disabled {
    opacity: 0.3;
  }

  .route-wordmark {
    left: 24px;
    right: auto;
  }

  .quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 58px;
    padding: 8px 14px;
  }

  .brand span:last-child,
  #print-button,
  #install-button {
    display: none;
  }

  .private-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    overflow: hidden;
    padding: 7px 0;
    color: transparent;
    font-size: 0;
    white-space: nowrap;
  }

  .private-button::before {
    content: "锁";
    color: var(--white);
    font-size: 0.78rem;
  }

  .private-button.unlocked::before {
    content: "开";
    color: var(--ink);
  }

  .compact-button {
    min-height: 38px;
    padding: 7px 11px;
  }

  .masthead {
    min-height: 570px;
    padding: 54px 20px 58px;
  }

  .masthead h1 {
    font-size: clamp(3.35rem, 18vw, 5.3rem);
  }

  .deck {
    font-size: 0.96rem;
  }

  .masthead-board {
    right: 20px;
    bottom: 72px;
    left: 20px;
    width: auto;
    grid-template-columns: 118px 1fr;
    box-shadow: 12px 12px 0 rgba(230, 96, 53, 0.85);
  }

  .date-plaque {
    min-height: 180px;
  }

  .route-wordmark {
    right: 20px;
    bottom: 20px;
    left: 20px;
    overflow: hidden;
    font-size: 0.57rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notice-strip {
    align-items: flex-start;
    padding: 12px 18px;
  }

  .notice-strip p {
    line-height: 1.45;
  }

  .notice-strip button {
    flex: 0 0 auto;
  }

  .modebar {
    align-items: flex-start;
    gap: 12px;
  }

  .journey-state {
    padding-top: 7px;
    text-align: right;
    font-size: 0.64rem;
  }

  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .day-hero {
    padding: 24px 22px 26px;
    border-radius: 22px 22px 6px 6px;
  }

  .day-heading-grid {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 16px;
  }

  .calendar-tile {
    height: 86px;
  }

  .calendar-tile strong {
    font-size: 2.7rem;
  }

  .day-title h2 {
    font-size: 2rem;
  }

  .day-route {
    font-size: 0.66rem;
  }

  .day-summary {
    margin-left: 0;
    font-size: 0.87rem;
  }

  .day-facts {
    grid-template-columns: 1fr;
  }

  .quick-panel {
    padding: 18px 16px;
  }

  .quick-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .markdown-body {
    padding: 26px 22px 34px;
    border-radius: 16px;
  }

  .markdown-body h2 {
    font-size: 1.45rem;
  }

  .day-pager span {
    display: none;
  }

  .day-pager {
    grid-template-columns: 1fr 1fr;
  }

  .overview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .overview-grid,
  .tool-groups {
    grid-template-columns: 1fr;
  }

  .tools-panel,
  .critical-panel,
  .auth-panel {
    padding: 22px 18px;
  }

  .private-panel .private-fields,
  .private-expense-card dl,
  .private-cost-summary,
  .private-payment-summary {
    grid-template-columns: 1fr;
  }

  .private-payment-row {
    grid-template-columns: 1fr auto;
  }

  .private-payment-row em {
    grid-column: 1 / -1;
  }

  .tools-topline h2,
  .critical-panel h2 {
    font-size: 2rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 20px;
    padding-bottom: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .masthead,
  .notice-strip,
  .modebar,
  .day-rail,
  .mobile-day-nav,
  .quick-panel,
  .private-panel,
  .day-pager,
  footer {
    display: none !important;
  }

  .app-shell {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .day-hero {
    color: #000;
    background: #fff;
    border: 1px solid #777;
  }

  .day-hero::after {
    display: none;
  }

  .day-route,
  .day-summary,
  .day-facts dt {
    color: #333;
  }

  .markdown-body {
    padding: 24px 0;
    border: 0;
    box-shadow: none;
  }
}
