:root {
  color-scheme: light;
  --page: #f7f7f1;
  --surface: #fffefa;
  --ink: #172c27;
  --muted: #566963;
  --line: #dde5dd;
  --forest: #133c34;
  --green: #1c5448;
  --green-hover: #103a31;
  --soft-green: #edf4ed;
  --cream: #eef1d9;
  --amber: #fbf2de;
  --red: #923d34;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, button[type="submit"] { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
input, select, textarea { min-width: 0; width: 100%; }
a { color: var(--green); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #27816d; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

.site-nav {
  border-bottom: 1px solid #dde5dd;
  margin-bottom: 14px;
}

.nav-inner {
  width: min(calc(100% - 32px), 1180px);
  min-height: 70px;
  margin: 0 auto;
  padding-block: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 35px;
  height: 35px;
  color: var(--cream);
  background: var(--forest);
  border-radius: 12px;
}

.brand-mark svg { width: 23px; height: 23px; }
.nav-actions, .hero-actions, .hero-meta, .stop-actions, .route-chips, .form-actions, .route-link-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-actions { justify-content: end; }
.shell { width: min(calc(100% - 32px), 1180px); margin-inline: auto; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 23px;
  border: 1px solid #1a4c41;
  border-radius: 23px;
  padding: clamp(25px, 6vw, 49px);
  color: #fbfbf2;
  background: radial-gradient(ellipse at right top, #256153, transparent 64%), var(--forest);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: 0;
  right: 0;
  width: min(84%, 500px);
  height: 100%;
  opacity: .58;
  background: repeating-radial-gradient(ellipse 63% 160% at 100% 6%, transparent 0 11px, #c4e4d338 12px 13px, transparent 14px 28px);
  mask-image: linear-gradient(110deg, transparent, #000 58%);
}

.hero-copy { min-width: 0; }
.eyebrow {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 760;
  letter-spacing: .05em;
}
.hero .eyebrow { color: #c3d9ce; }
.hero h1, .login-card h1 {
  margin-top: 6px;
  font-size: clamp(2.06rem, 8.5vw, 4rem);
  font-weight: 850;
  letter-spacing: -.07em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}
.hero-copy > p:not(.eyebrow) { margin-top: 11px; color: #e1ebe1; font-size: .93rem; }
.hero-meta { margin-top: 13px; color: #e1ebe1; font-size: .88rem; }
.hero-meta > * { overflow-wrap: anywhere; }
.hero-actions { flex: 0 0 auto; }

.status-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid #dfe8dc;
  border-radius: 999px;
  color: #34594e;
  background: #eaf1e7;
  font-size: .73rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-pill svg { flex: 0 0 auto; width: 13px; height: 13px; }
.hero .status-pill { color: #e0eee2; border-color: #ffffff38; background: #ffffff10; }

.button, .icon-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  text-align: center;
  color: var(--green);
  background: transparent;
  font-size: .86rem;
  font-weight: 770;
  line-height: 1.25;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.button svg, .icon-button svg { flex: 0 0 auto; width: 17px; height: 17px; }
.button.primary { background: var(--green); color: white; }
.button.secondary { border-color: var(--line); background: var(--surface); }
.button.quiet { padding-inline: 9px; }
.button.danger, .icon-button.danger { color: var(--red); }
.icon-button { width: 44px; padding: 0; flex: none; color: var(--muted); }
.hero .button.primary { color: var(--forest); background: var(--cream); }
.hero .button.secondary, .hero .button.quiet { color: #f4f7ef; background: #ffffff0c; border-color: #ffffff3d; }
.hero :focus-visible { outline-color: #f0f2c9; }
@media (hover: hover) {
  .button.primary:hover { background: var(--green-hover); }
  .button.secondary:hover, .button.quiet:hover, .icon-button:hover { background: var(--soft-green); }
  .hero .button.primary:hover { background: #fffde5; }
  .hero .button.secondary:hover, .hero .button.quiet:hover { background: #ffffff28; }
  .button.danger:hover, .icon-button.danger:hover { background: #f8e9e5; }
}

.demo-banner, .notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid #e4dcc8;
  border-radius: 11px;
  color: #63543b;
  background: var(--amber);
  font-size: .81rem;
}
.demo-banner:not([hidden]) + .hero { margin-top: 10px; }
.hero + .demo-banner, .hero + .notice { margin-top: 12px; }
.demo-banner svg, .notice svg { flex: none; width: 17px; height: 17px; margin-top: 2px; }
.demo-message { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; overflow-wrap: anywhere; }
.demo-message strong { font-weight: 850; }
.notice { margin-block: 12px; }
.notice.error, .notice[role="alert"] { color: #762e27; background: #fbeeea; border-color: #edcfc8; }

.app-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 17px;
}
.app-head label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.trip-switcher { min-height: 44px; max-width: 100%; }
.hero .trip-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: .8rem; }
.trip-switcher select, select.trip-switcher { width: auto; max-width: 100%; }
.hero .trip-switcher select { min-width: 80px; max-width: min(170px, 100%); color: #fbfbf2; border-color: #ffffff3d; background: #204a40; font-size: .86rem; }

.app-grid { display: grid; align-items: start; gap: 14px; margin-top: 15px; }
.timeline-panel, .map-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 2px 9px #163a2c05;
}
.panel-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 15px;
  min-width: 0;
}
.panel-head h2 { font-weight: 850; font-size: 1.22rem; letter-spacing: -.05em; line-height: 1.25; }
.panel-head p { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.panel-head .button { flex: none; }

.date-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 1px 15px 12px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.date-tab {
  flex: 0 0 auto;
  min-width: 65px;
  min-height: 46px;
  padding: 5px 10px;
  display: inline-grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: .81rem;
  font-weight: 740;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.date-label { display: block; font-weight: 700; font-size: .67rem; line-height: 1.2; }
.date-tab[aria-selected="true"], .date-tab[aria-pressed="true"], .date-tab.active, .date-tab.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.date-tab:focus-visible { outline-offset: -3px; }
.date-tab[aria-selected="true"]:focus-visible, .date-tab[aria-pressed="true"]:focus-visible { outline-color: #fff; }
@media (hover: hover) {
  .date-tab:not([aria-selected="true"]):not([aria-pressed="true"]):not(.active):not(.is-active):hover { background: var(--soft-green); }
}

.timeline {
  --time-width: 43px;
  --marker-width: 20px;
  --track: calc(var(--time-width) + var(--marker-width) / 2);
  padding: 15px 15px 19px;
  margin: 0;
  list-style: none;
}
.stop {
  position: relative;
  display: grid;
  grid-template-columns: var(--time-width) var(--marker-width) minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}
.stop-time::after, .route-row::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: var(--track);
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d5e1d6;
}
.stop:first-child .stop-time::after { top: 19px; }
.stop:last-child .stop-time::after { height: 20px; }
.stop:first-child:last-child .stop-time::after { display: none; }
.stop + .stop:not(.has-route) { padding-top: 8px; }
.stop-time {
  position: relative;
  align-self: stretch;
  grid-column: 1;
  grid-row: 2;
  padding-top: 10px;
  color: #2a594d;
  font-size: .85rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}
.stop-marker {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-top: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #3a7061;
  color: white;
  font-size: .63rem;
  font-weight: 810;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stop-marker svg { width: 11px; height: 11px; }
.stop-card {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 3px;
  min-width: 0;
  margin-left: 4px;
  border: 1px solid #e7ebe3;
  border-radius: 12px;
  padding: 10px;
  background: #fcfcf7;
  overflow-wrap: anywhere;
}
.stop-card[aria-current="true"], .stop-card.is-active, .stop-card.is-selected, .stop[aria-current="true"] .stop-card {
  border-color: #94b5a6;
  background: #f0f5eb;
}
.stop-title {
  display: block;
  grid-column: 1;
  grid-row: 1;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 840;
  letter-spacing: -.035em;
  line-height: 1.34;
}
button.stop-title { padding: 0; border: 0; background: none; text-align: left; }
button.stop-title:hover { text-decoration: underline; text-underline-offset: 4px; }
.stop-address, .stop-note { margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.stop-address {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  min-width: 0;
  color: #376558;
}
button.stop-address {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-height: 31px;
  padding: 4px 0;
  margin-top: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: start;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: #9cb7ad;
  text-underline-offset: 3px;
}
button.stop-address > .icon { flex: none; margin-top: 2px; }
.stop-note { grid-column: 1 / -1; grid-row: 3; color: #415c52; white-space: pre-wrap; }
.stop-address svg, .stop-note svg { flex: none; width: 13px; height: 13px; }
.stop-actions { grid-column: 2; grid-row: 1 / span 2; gap: 1px; justify-content: flex-end; margin-block: -5px; }
.stop-actions .button { padding-inline: 7px; font-size: .75rem; }

.route-row {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 7px;
  padding-block: 3px;
  padding-inline-start: calc(var(--time-width) + var(--marker-width) + 4px);
}
.route-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; min-width: 0; }
.route-tools .button { padding-inline: 5px; font-size: .72rem; }
.route-source {
  flex: 1 0 100%;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.route-chips, .route-link-group { gap: 4px; }
.route-link-group { flex: 1 0 100%; }
.route-chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #354e44;
  background: #eaf0e8;
  border: 1px solid #dce7db;
  border-radius: 7px;
  font-size: .73rem;
  font-weight: 760;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
button.route-chip, a.route-chip { min-height: 37px; }
.route-chip svg { flex: none; width: 13px; height: 13px; }
.route-chip + .route-chip, .route-chip.transit, .route-chip[data-mode="transit"] { background: #eaf0f2; border-color: #dce5eb; color: #2e5264; }
.route-chip[data-unavailable], .route-chip.is-unavailable { color: #646b64; border-color: #e6e7df; background: #f1f2ed; }
.route-link-group a { display: inline-flex; align-items: center; min-height: 34px; padding-inline: 3px; font-size: .75rem; }

.map-frame { height: clamp(285px, 67vw, 390px); position: relative; z-index: 0; overflow: hidden; background: #e9eee4; }
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-canvas > svg, .map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.demo-map-pin:focus-visible { outline: none; }
.demo-map-pin:focus-visible circle[r="17"] { stroke: #f2ca99; stroke-width: 5px; }
.map-empty {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: #edf1e8;
  font-size: .88rem;
}
.map-empty > svg { width: 29px; height: 29px; color: var(--green); }
.map-empty strong { color: var(--ink); }
.map-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 48px;
  padding: 11px 15px;
  border-top: 1px solid var(--line);
}
.map-details { min-width: 0; }
.map-caption, .map-key, .map-summary, .section-legend { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.map-caption, .map-key { font-weight: 750; }
.map-summary:not(:empty) { margin-top: 3px; }
.map-key, .map-link { display: inline-flex; align-items: center; gap: 5px; }
.map-link { min-height: 26px; font-size: .8rem; font-weight: 780; text-underline-offset: 3px; }
.map-link svg, .map-key svg { flex: none; width: 14px; height: 14px; }
.section-legend { margin: 10px 15px 0; }
.check-summary { color: var(--muted); font-size: .82rem; }

.empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 172px;
  padding: 21px 13px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}
.empty strong, .empty h3 { color: var(--ink); }
.empty > svg { width: 26px; height: 26px; color: var(--green); }

.footer {
  margin: 0 auto;
  padding: 18px 0 calc(20px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

dialog, .dialog {
  width: min(calc(100% - 30px), 490px);
  max-height: calc(100vh - 26px);
  max-height: calc(100dvh - 26px);
  padding: clamp(17px, 4vw, 25px);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 15px 45px #112c242f;
  overflow-y: auto;
}
dialog::backdrop { background: #142d2580; }
.dialog h2, dialog h2 { margin-bottom: 13px; font-size: 1.27rem; letter-spacing: -.04em; }
.dialog .panel-head { min-height: auto; margin-bottom: 10px; padding: 0; }
.dialog .panel-head h2 { margin-bottom: 0; }
.dialog form > p { color: var(--muted); font-size: .82rem; }
.dialog .section-legend { margin: 0; }
.dialog #delete-item { margin-inline-end: auto; color: var(--red); }
.form-fields, .login-form { display: grid; gap: 12px; }
.form-fields label, .login-form label, .field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: #36524a;
  font-size: .82rem;
  font-weight: 730;
}
.form-fields small { color: var(--muted); font-weight: 500; }
.form-fields .split, .form-fields .field-row, .form-fields .form-row, .form-fields .form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #cfdad1;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-size: 1rem;
  font-weight: 500;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--green); }
input::placeholder, textarea::placeholder { color: #64756c; }
input[type="date"], input[type="time"] { appearance: none; }
input::-webkit-date-and-time-value { text-align: left; }
textarea { min-height: 74px; resize: vertical; }
.form-actions { margin-top: 15px; justify-content: flex-end; }

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 140px);
  padding: 22px 0;
}
.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(19px, 5vw, 33px);
  background: var(--surface);
  box-shadow: 0 8px 28px #1742370b;
}
.login-card h1 { font-size: clamp(1.7rem, 7vw, 2.35rem); }
.login-card > p:not(.eyebrow) { margin-top: 10px; color: var(--muted); font-size: .85rem; }
.login-form { margin-top: 20px; }
.login-form .button.primary { margin-top: 3px; }

@media (min-width: 670px) {
  .nav-inner, .shell { width: min(calc(100% - 48px), 1180px); }
  .hero { flex-direction: row; align-items: flex-end; border-radius: 27px; }
  .hero-actions { justify-content: flex-end; }
  .app-grid { gap: 18px; }
  .panel-head { padding: 15px 19px; }
  .panel-head h2 { font-size: 1.34rem; }
  .date-tabs { padding-inline: 19px; }
  .timeline { --time-width: 50px; --marker-width: 24px; padding-inline: 19px; }
  .stop-card { padding: 13px; }
  .stop-time { padding-top: 14px; font-size: .91rem; }
  .stop-marker { margin-top: 15px; }
  .stop:first-child .stop-time::after { top: 23px; }
  .stop:last-child .stop-time::after { height: 24px; }
  .map-overlay { padding-inline: 19px; }
  .section-legend { margin-inline: 19px; }
}

@media (min-width: 875px) {
  .nav-inner { min-height: 75px; }
  .app-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .map-panel { position: sticky; top: 15px; }
  .map-frame { height: clamp(340px, 40vw, 428px); }
}

@media (max-width: 373px) {
  .nav-inner, .shell { width: calc(100% - 24px); }
  .nav-actions { gap: 4px; }
  .panel-head, .date-tabs, .timeline { padding-inline: 10px; }
  .timeline { --marker-width: 19px; }
  .section-legend { margin-inline: 10px; }
}

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