:root {
  color-scheme: light;
  --ink: #193b32;
  --body: #35443d;
  --muted: #63746a;
  --paper: #faf9f3;
  --line: #d9e1d7;
  --green: #dfead6;
  --accent: #173f35;
  --warm: #f4e3c7;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a {
  color: var(--ink);
  text-underline-offset: 0.24em;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid #976321;
  outline-offset: 4px;
}
input:focus-visible {
  outline-offset: 1px;
}
input {
  accent-color: var(--accent);
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.35;
}
h1 {
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  letter-spacing: -0.045em;
  margin-bottom: 1.25rem;
  font-weight: 750;
}
h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  margin: 0.45rem 0 0.7rem;
}
h3 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
}
h4 {
  font-size: 1.2rem;
  margin: 0.2rem 0;
}
p {
  margin-bottom: 0.9rem;
}
.site-header,
.hero,
.page-body,
.site-footer {
  width: min(1100px, calc(100% - 48px));
  margin-inline: auto;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: serif;
  font-size: 1.4rem;
}
.brand-small {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  font-weight: 500;
  margin-top: 4px;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.9rem;
}
nav a {
  text-decoration: none;
  padding-block: 8px;
}
nav a:hover {
  text-decoration: underline;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding-block: 66px 60px;
}
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.71rem;
  letter-spacing: 0.13em;
  font-weight: 700;
  text-transform: uppercase;
}
.lead {
  max-width: 650px;
  font-size: 1.08rem;
  line-height: 1.95;
}
.hero-copy > .eyebrow {
  margin-bottom: 20px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 46px;
  padding: 11px 20px;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.5;
}
.button:hover {
  background: #285446;
}
.hero-button {
  margin-top: 12px;
}
.button:disabled {
  opacity: 0.48;
  cursor: default;
}
.button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: #a5b6a5;
}
.button.secondary:hover {
  background: #e8eee3;
}
.hero-note {
  padding: 26px;
  border-radius: 140px 140px 10px 10px;
  background: var(--green);
  text-align: center;
  min-height: 332px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.note-label {
  font-family: Georgia, "Songti SC", serif;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}
.days-number {
  font-family: Georgia, serif;
  font-size: 5.5rem;
  color: var(--ink);
  line-height: 1;
  margin: 15px 0 12px;
}
.days-number span {
  font-size: 1rem;
  padding-left: 5px;
}
.hero-note p {
  margin-bottom: 0;
}
.note-rule {
  width: 36px;
  height: 1px;
  background: #92aa8a;
  margin: 18px auto;
}
.small {
  font-size: 0.82rem;
}
.section {
  padding-block: 42px;
  border-top: 1px solid var(--line);
}
.section-heading {
  margin-bottom: 26px;
  max-width: 760px;
}
.section-heading > p {
  color: var(--muted);
  margin-bottom: 0;
}
.conditions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.note-card,
.budget-card {
  padding: 28px;
  background: #f0f2e9;
  border-radius: 8px;
  min-width: 0;
}
.check-list {
  margin: 0;
  padding-left: 1.25em;
}
.check-list li + li {
  margin-top: 16px;
}
.budget-card {
  border: 1px solid var(--line);
  background: #fff;
  padding-top: 15px;
  margin: 0;
}
.budget-card legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--ink);
}
.budget-card > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 6px;
}
input[type="number"] {
  padding: 7px 10px;
  min-height: 44px;
  border: 1px solid #a5b6a5;
  border-radius: 5px;
  background: white;
  color: var(--ink);
  width: 100%;
  max-width: 130px;
}
.budget-card > p {
  font-size: 0.85rem;
}
.budget-card .microcopy {
  margin-top: 12px;
  margin-bottom: 0;
}
.day-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px;
  margin-top: 20px;
}
.day-top {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: start;
}
.day-top h3 {
  margin: 6px 0 12px;
}
.day-budget {
  font-size: 0.78rem;
  color: var(--muted);
  flex: 0 0 175px;
}
.day-budget input {
  display: block;
  margin-top: 4px;
  max-width: 110px;
}
.day-note {
  max-width: 820px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 26px;
}
.stops {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.stop {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.stop-heading {
  display: flex;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.stop-number {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 5px;
}
.tag {
  font-size: 0.67rem;
  color: #607756;
}
.area {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0;
}
.stop > p {
  font-size: 0.92rem;
}
.stop .visit-note {
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 2px solid #d3dacb;
  padding-left: 12px;
}
.stop-actions {
  margin-top: auto;
  padding: 14px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 9px;
}
.select-stop {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
  min-height: 40px;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin: 0;
}
.minutes-label {
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.minutes-label input {
  max-width: 95px;
}
.source-link {
  margin-top: 12px;
  font-size: 0.8rem;
  align-self: start;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.summary-card {
  padding: 22px;
  border-radius: 8px;
  background: var(--green);
}
.summary-card.over {
  background: var(--warm);
}
.summary-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.summary-card p {
  margin-bottom: 5px;
  font-size: 0.85rem;
}
.summary-card .balance {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.1rem;
  margin-top: 12px;
}
.summary-card ul {
  margin: 12px 0 0;
  padding-left: 1.2em;
  font-size: 0.8rem;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0 12px;
}
.text-button {
  background: none;
  border: 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 10px 6px;
}
.microcopy {
  font-size: 0.78rem;
  color: var(--muted);
}
.notice {
  width: 100%;
  padding: 18px;
  background: var(--warm);
  border-radius: 6px;
}
.fallback > p {
  max-width: 800px;
}
.closure-note {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 16px;
  border-left: 2px solid #bfcdad;
  margin-top: 20px;
}
.source-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 35px;
}
.source-list li {
  padding-top: 13px;
  border-top: 1px solid #e5e8df;
  min-width: 0;
}
.source-list a {
  font-size: 0.87rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.source-list p {
  font-size: 0.76rem;
  margin: 6px 0 0;
  color: var(--muted);
}
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 26px 44px;
  color: var(--muted);
  font-size: 0.78rem;
}
.site-footer p {
  margin-bottom: 4px;
}
.site-footer a {
  display: inline-block;
  margin-top: 12px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  padding: 8px 16px;
  background: white;
  z-index: 20;
}
.skip-link:focus {
  top: 8px;
}
.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;
}
@media (max-width: 760px) {
  .site-header,
  .hero,
  .page-body,
  .site-footer {
    width: calc(100% - 36px);
  }
  .site-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
    min-height: auto;
  }
  nav {
    gap: 8px 22px;
    font-size: 0.84rem;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-block: 34px;
  }
  .hero-note {
    min-height: auto;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 80px 1fr;
    text-align: left;
    gap: 0 18px;
    padding: 20px;
  }
  .note-label {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.76rem;
  }
  .days-number {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: 4.2rem;
    margin: 0;
    align-self: center;
  }
  .hero-note > p:not(.days-number) {
    grid-column: 2;
    font-size: 0.8rem;
  }
  .hero-note .small,
  .note-rule {
    display: none;
  }
  .conditions-grid,
  .source-list {
    grid-template-columns: 1fr;
  }
  .section {
    padding-block: 30px;
  }
  .day-card {
    padding: 22px;
  }
  .day-top {
    flex-direction: column;
    gap: 4px;
  }
  .day-budget {
    flex: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  .day-budget input {
    max-width: 90px;
    margin-top: 0;
  }
  .note-card,
  .budget-card {
    padding: 20px;
  }
  .stops {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 360px) {
  .site-header,
  .hero,
  .page-body,
  .site-footer {
    width: calc(100% - 28px);
  }
  .day-card {
    padding: 17px;
  }
  h1 {
    font-size: 1.9rem;
  }
  .hero-note {
    padding: 16px;
    gap: 0 12px;
  }
  .button {
    padding: 11px 15px;
    font-size: 0.9rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  .site-header nav,
  .hero-button,
  .result-actions,
  .skip-link,
  .stop-actions,
  .budget-card,
  #action-status {
    display: none !important;
  }
  .site-header,
  .hero,
  .page-body,
  .site-footer {
    width: 100%;
  }
  .hero {
    display: block;
    padding: 18px 0;
  }
  .hero-note {
    display: none;
  }
  .section {
    padding-block: 18px;
  }
  .day-card,
  .summary-card,
  .stop {
    break-inside: avoid;
  }
  .day-budget {
    display: none;
  }
  .stops,
  .summary-grid,
  .conditions-grid {
    display: block;
  }
  a {
    color: black;
  }
  h1 {
    font-size: 25pt;
  }
}
