:root {
  --night: #081928;
  --night-deep: #05121f;
  --ink: #122331;
  --paper: #f5f0de;
  --paper-soft: #e9e4d3;
  --mint: #9df7cf;
  --mint-deep: #2eaf87;
  --orange: #ffbe72;
  --line: rgba(245, 240, 222, 0.2);
  --shadow: 0 24px 70px rgba(3, 11, 19, 0.3);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--paper);
  background: var(--night-deep);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--night-deep); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.site-header { align-items: center; display: flex; justify-content: space-between; margin: 0 auto; max-width: 1280px; padding: 24px 38px; }
.brand { align-items: center; display: flex; font-size: 1.05rem; font-weight: 800; gap: 10px; letter-spacing: .04em; }
.brand-mark { align-items: center; border: 1px solid var(--mint); border-radius: 50%; color: var(--mint); display: inline-flex; height: 26px; justify-content: center; width: 26px; }
.header-note { color: rgba(245,240,222,.62); font-size: .78rem; letter-spacing: .06em; margin: 0; }
main { margin: 0 auto; max-width: 1280px; padding: 0 38px 80px; }
.hero { align-items: center; background: linear-gradient(100deg, rgba(8,25,40,.97) 8%, rgba(8,25,40,.78) 52%, rgba(8,25,40,.38)), url('/assets/station-clock-hero.jpg') center 41% / cover; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 5vw; min-height: 410px; overflow: hidden; padding: 58px clamp(24px, 6vw, 88px); position: relative; }
.hero::after { background: linear-gradient(90deg, transparent, rgba(157,247,207,.15)); content: ''; inset: 0; pointer-events: none; position: absolute; }
.hero-copy, .hero-clock { position: relative; z-index: 1; }
.eyebrow { color: var(--mint); font-size: .68rem; font-weight: 800; letter-spacing: .19em; margin: 0 0 15px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(3.7rem, 8vw, 7.8rem); font-weight: 500; letter-spacing: -.09em; line-height: .88; margin-bottom: 26px; max-width: 780px; }
h1 em { color: var(--mint); font-style: normal; }
h2 { font-size: clamp(1.65rem, 2.4vw, 2.5rem); letter-spacing: -.045em; margin-bottom: 0; }
.hero-lede { color: rgba(245,240,222,.8); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.9; margin-bottom: 26px; max-width: 620px; }
.route-line { align-items: center; color: var(--orange); display: flex; font-size: .77rem; font-weight: 800; gap: 14px; letter-spacing: .08em; }
.route-line b { color: var(--mint); font-size: 1.2rem; }
.hero-clock { align-items: center; aspect-ratio: 1; background: rgba(5,18,31,.78); border: 1px solid rgba(157,247,207,.7); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; justify-self: end; max-height: 300px; min-height: 220px; min-width: 220px; padding: 30px; width: min(25vw, 300px); }
.hero-clock::before { border: 1px dashed rgba(157,247,207,.38); border-radius: 50%; content: ''; inset: 13px; position: absolute; }
.clock-kicker, .next-run-label { color: var(--mint); font-size: .65rem; font-weight: 800; letter-spacing: .16em; }
.hero-clock strong { color: var(--paper); font-size: clamp(3rem, 6vw, 5.3rem); font-weight: 400; letter-spacing: -.09em; line-height: 1; margin: 12px 0; }
.clock-caption { color: rgba(245,240,222,.62); font-size: .75rem; }
.clock-hand { background: var(--orange); bottom: 50%; height: 2px; left: 50%; position: absolute; transform-origin: left center; width: 32%; }
.clock-hand-hour { transform: rotate(-55deg); }
.clock-hand-minute { background: var(--mint); transform: rotate(25deg); width: 41%; }
.control-board, .results, .comparison, .limits { background: var(--paper); color: var(--ink); }
.control-board { box-shadow: var(--shadow); margin: -28px 7% 0; padding: clamp(26px, 4vw, 48px); position: relative; z-index: 2; }
.board-heading, .result-heading, .comparison-heading { align-items: flex-start; display: flex; justify-content: space-between; }
.board-heading h2, .result-heading h2 { color: var(--ink); }
.live-badge { align-items: center; color: var(--mint-deep); display: inline-flex; font-size: .76rem; font-weight: 800; gap: 8px; letter-spacing: .04em; }
.live-badge span { background: var(--mint-deep); border-radius: 50%; height: 8px; width: 8px; }
.form-grid { align-items: end; display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .85fr) auto; margin-top: 36px; }
label { display: grid; gap: 8px; }
label > span { font-size: .86rem; font-weight: 800; }
label small { color: rgba(18,35,49,.56); font-size: .72rem; }
input, select { background: #fffdf6; border: 1px solid rgba(18,35,49,.28); border-radius: 2px; color: var(--ink); min-height: 53px; padding: 12px 15px; width: 100%; }
input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.08rem; letter-spacing: .05em; }
select { font-size: 1rem; }
.primary-button { align-items: center; background: var(--night); border: 0; color: var(--paper); display: inline-flex; font-weight: 800; gap: 14px; justify-content: center; min-height: 53px; padding: 12px 20px; text-decoration: none; }
.primary-button:hover { background: #14344e; }
.primary-button span { color: var(--mint); font-size: 1.3rem; }
.syntax-help { color: rgba(18,35,49,.68); font-size: .8rem; line-height: 1.7; margin: 18px 0 0; }
code { background: rgba(46,175,135,.12); color: #167258; padding: 2px 5px; }
.preset-strip { align-items: center; border-top: 1px solid rgba(18,35,49,.16); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 20px; }
.preset-title { color: rgba(18,35,49,.54); font-size: .65rem; font-weight: 800; letter-spacing: .14em; margin-right: 6px; }
.preset-strip button, .result-actions button { background: transparent; border: 1px solid rgba(18,35,49,.24); color: var(--ink); min-height: 42px; padding: 8px 13px; }
.preset-strip button:hover, .result-actions button:hover { border-color: var(--mint-deep); color: var(--mint-deep); }
.message { font-size: .8rem; line-height: 1.6; margin: 12px 0 0; padding: 10px 12px; }
.message.error { background: #ffe2d6; color: #8e2e16; }
.message.warning { background: #fff0d5; color: #845019; }
.message.success { background: #dcefe6; color: #17694f; }
.message.info { background: #e4ecf2; color: #315169; }
.results { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.35fr); margin-top: 28px; }
.result-primary { border-right: 1px solid rgba(18,35,49,.16); padding: clamp(26px, 4vw, 48px); }
.cron-description { color: rgba(18,35,49,.68); font-size: .9rem; line-height: 1.75; margin: 22px 0 28px; }
.next-run-block { border-left: 4px solid var(--mint-deep); padding: 14px 0 14px 18px; }
.next-run-block strong { display: block; font-size: clamp(1.65rem, 3vw, 2.8rem); font-weight: 500; letter-spacing: -.06em; line-height: 1.15; margin: 9px 0; }
.next-run-iso { color: rgba(18,35,49,.58); display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; overflow-wrap: anywhere; }
.result-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.result-actions button { min-height: 44px; }
.saved-badge { color: var(--mint-deep); font-size: .72rem; font-weight: 800; }
.board-table-wrap { padding: clamp(26px, 4vw, 48px); }
.table-caption { align-items: baseline; display: flex; font-size: 1.08rem; font-weight: 800; justify-content: space-between; margin-bottom: 15px; }
.table-note { color: rgba(18,35,49,.52); font-size: .7rem; font-weight: 400; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; min-width: 540px; width: 100%; }
th, td { border-bottom: 1px solid rgba(18,35,49,.13); padding: 13px 10px; text-align: left; }
thead th { color: rgba(18,35,49,.55); font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; }
tbody th { color: var(--mint-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; font-weight: 700; }
tbody td { font-size: .85rem; }
tbody td:last-child { color: rgba(18,35,49,.56); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.comparison { align-items: start; display: grid; gap: 42px; grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr); margin-top: 28px; padding: clamp(26px, 4vw, 48px); }
.comparison-heading { display: block; }
.comparison-heading p:last-child { color: rgba(18,35,49,.63); font-size: .83rem; line-height: 1.7; margin: 18px 0 0; max-width: 380px; }
.comparison-table { min-width: 560px; }
.comparison-table th, .comparison-table td { padding: 15px 12px; }
.limits { display: grid; gap: 42px; grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr); margin-top: 28px; padding: clamp(26px, 4vw, 48px); }
.limits-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.limits-grid p { border-top: 2px solid var(--mint-deep); font-size: .82rem; line-height: 1.75; margin: 0; padding-top: 13px; }
.limits-grid strong { color: var(--mint-deep); }
.site-footer { color: rgba(245,240,222,.53); display: flex; font-size: .72rem; justify-content: space-between; letter-spacing: .05em; margin: 0 auto; max-width: 1280px; padding: 27px 38px 45px; }
.noscript { background: var(--orange); color: var(--ink); padding: 16px; text-align: center; }
.not-found main { padding-top: 16vh; }
.not-found h1 { font-size: clamp(3rem, 8vw, 6.8rem); max-width: 850px; }
.not-found main > p:not(.eyebrow) { color: rgba(245,240,222,.72); line-height: 1.8; max-width: 500px; }
.link-button { margin-top: 20px; }

@media (max-width: 850px) {
  .site-header, main, .site-footer { padding-left: 20px; padding-right: 20px; }
  .header-note { display: none; }
  .hero { gap: 20px; grid-template-columns: 1fr 210px; min-height: 350px; padding: 38px 25px; }
  .hero-clock { min-height: 190px; min-width: 190px; width: 190px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .primary-button { grid-column: 1 / -1; }
  .results, .comparison, .limits { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
  .results > *, .comparison > *, .limits > *, .table-scroll { min-width: 0; max-width: 100%; width: 100%; }
  .result-primary { border-bottom: 1px solid rgba(18,35,49,.16); border-right: 0; }
  .limits-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .site-header { padding-bottom: 18px; padding-top: 18px; }
  main { padding-bottom: 48px; }
  .hero { display: block; min-height: 475px; padding: 38px 22px 25px; }
  h1 { font-size: clamp(3.6rem, 17vw, 5.2rem); margin-bottom: 20px; }
  .hero-lede { font-size: .95rem; line-height: 1.75; }
  .hero-clock { margin: 25px auto 0; min-height: 160px; min-width: 160px; width: 160px; }
  .hero-clock strong { font-size: 2.8rem; }
  .clock-caption { font-size: .66rem; }
  .control-board { margin: -20px 0 0; padding: 24px 20px; }
  .board-heading, .result-heading { display: block; }
  .live-badge { margin-top: 13px; }
  .form-grid { display: block; margin-top: 26px; }
  .form-grid label + label { margin-top: 17px; }
  .primary-button { margin-top: 17px; width: 100%; }
  .preset-strip { align-items: flex-start; display: grid; grid-template-columns: repeat(2, 1fr); }
  .preset-title { grid-column: 1 / -1; }
  .preset-strip button { min-height: 44px; }
  .results, .comparison, .limits { margin-top: 18px; }
  .result-primary, .board-table-wrap, .comparison, .limits { padding: 24px 20px; }
  .next-run-block strong { font-size: 1.7rem; }
  .limits-grid { display: block; }
  .limits-grid p + p { margin-top: 20px; }
  .site-footer { display: block; line-height: 1.9; padding-bottom: 28px; }
  .site-footer span { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  :root { color: #111; }
  body, .control-board, .results, .comparison, .limits { background: white; color: #111; }
  .site-header, .hero, .control-board, .comparison, .limits { box-shadow: none; }
  .hero { min-height: auto; }
  .hero-clock, .preset-strip, .result-actions, .site-footer { display: none; }
  .results { margin-top: 0; }
}
