:root {
  --ink: #26332c;
  --muted: #6e786f;
  --line: #dfdfcf;
  --surface: #fffef9;
  --canvas: #fff8e9;
  --primary: #24745b;
  --primary-dark: #19543f;
  --primary-soft: #e4f4e9;
  --warm: #f7cc57;
  --pink: #e97591;
  --danger: #b42318;
  --shadow-sm: 0 6px 20px rgba(27, 64, 44, .07);
  --shadow: 0 20px 56px rgba(27, 64, 44, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 86% 7%, rgba(188,232,203,.58), transparent 24%), radial-gradient(circle at 5% 76%, rgba(247,204,87,.22), transparent 22%), var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 16px; color: white; background: var(--primary-dark); border-radius: 8px; }
.skip-link:focus { top: 16px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 760; letter-spacing: -.03em; }
.brand-copy { line-height: 1.05; }
.brand-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--primary); border-radius: 14px; transform: rotate(-3deg); box-shadow: 0 7px 0 #b7dacb; }
.brand-mark svg { width: 22px; }
.city-switch { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px 4px 13px; font-size: 14px; font-weight: 650; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 999px; }
.city-switch select { width: auto; min-height: 30px; padding: 0 22px 0 0; color: var(--ink); appearance: auto; background: transparent; border: 0; border-radius: 0; font-weight: 700; cursor: pointer; }
.city-switch select:focus { box-shadow: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.status-dot { width: 7px; height: 7px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 4px var(--primary-soft); }
.shell { max-width: 1240px; margin: auto; padding: 42px 24px 70px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 38px; align-items: end; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 720px; margin: 0; font-size: clamp(36px, 4.7vw, 58px); line-height: 1.08; letter-spacing: -.055em; }
.hero h1 span { display: inline-block; padding: 0 9px 4px; background: var(--warm); border-radius: 10px; transform: rotate(-1deg); }
.hero > p:last-child { max-width: 630px; margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.hero-copy > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.hero-wish { position: relative; padding: 25px 92px 25px 26px; color: #40725e; background: rgba(255,254,249,.72); border: 1px solid rgba(36,116,91,.22); border-radius: 24px; box-shadow: 0 14px 35px rgba(66,71,48,.08); }
.hero-wish strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; letter-spacing: .12em; }
.hero-wish p { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.75; }
.bus-doodle { position: absolute; right: 8px; top: -54px; width: 105px; color: var(--primary); stroke-width: 2.5; }
.bus-doodle rect { fill: var(--warm); }
.notice { display: flex; align-items: center; gap: 12px; margin: -12px 0 24px; padding: 14px 16px; color: #745012; background: #fff6df; border: 1px solid #efd896; border-radius: 14px; }
.notice svg { flex: 0 0 auto; width: 22px; }
.notice strong, .notice span { display: block; }
.notice span { font-size: 14px; }
.workspace { display: grid; grid-template-columns: minmax(330px, 440px) minmax(0, 1fr); gap: 34px; align-items: start; }
.form-card { padding: 28px; background: rgba(255,254,249,.94); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.step-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.step-number { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; color: white; background: var(--primary); border-radius: 11px; font-weight: 750; box-shadow: 0 5px 0 #b7dacb; }
.step-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.step-heading p { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.input-shell { display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.input-shell:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input-shell svg { flex: 0 0 auto; width: 20px; color: var(--primary); }
input, textarea { width: 100%; min-height: 48px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; outline: none; }
.input-shell input { border: 0; }
textarea { display: block; min-height: 134px; padding: 12px 13px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input-shell input:focus { box-shadow: none; }
::placeholder { color: #9aa59f; }
.divider { height: 1px; margin: 28px 0; background: var(--line); }
.arrival-field { margin-top: 18px; }
.arrival-field input { padding: 0 11px; }
.arrival-field span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.input-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; padding: 4px; background: #f0f4f1; border-radius: 12px; }
.tab { min-height: 42px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-weight: 650; }
.tab.active { color: var(--primary-dark); background: white; box-shadow: 0 2px 8px rgba(35,66,49,.08); }
.tab span { margin-left: 4px; padding: 2px 5px; color: var(--primary); background: var(--primary-soft); border-radius: 5px; font-size: 10px; }
.field-help { margin: 7px 2px 0; color: var(--muted); font-size: 12px; }
.upload-zone { display: grid; place-items: center; min-height: 150px; padding: 20px; text-align: center; background: #fafcf9; border: 1px dashed #b8c9bd; border-radius: 14px; cursor: pointer; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone svg { width: 28px; margin-bottom: 8px; color: var(--primary); }
.upload-zone span { color: var(--muted); font-size: 12px; font-weight: 400; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ocr-progress { margin-top: 12px; padding: 10px 12px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 10px; font-size: 13px; }
#ocrReview { margin-top: 18px; }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; border-radius: 12px; font-weight: 720; transition: background .2s, transform .15s, box-shadow .2s; }
.primary-button { margin-top: 22px; color: white; background: var(--primary); border: 0; box-shadow: 0 8px 0 #b7dacb; }
.primary-button:hover { background: var(--primary-dark); }
.primary-button:active, .secondary-button:active { transform: scale(.985); }
.primary-button:disabled { cursor: wait; opacity: .58; }
.primary-button svg { width: 20px; }
.secondary-button { margin-top: 10px; color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #b9dac7; }
.text-button { display: block; min-height: 44px; margin: 5px auto -10px; color: var(--muted); background: none; border: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.form-error { margin: 16px 0 -8px; padding: 10px 12px; color: var(--danger); background: #fef3f2; border-radius: 9px; font-size: 13px; }
.results-area { min-width: 0; padding-top: 8px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.results-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.sort-button { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 12px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 10px; }
.sort-button svg { width: 18px; }
.empty-state { padding: 42px 28px; text-align: center; background: rgba(255,255,255,.55); border: 1px dashed #cdd9d1; border-radius: var(--radius); }
.map-illustration { max-width: 280px; margin: 0 auto 12px; color: #aebdb4; }
.map-illustration svg { width: 100%; }
.map-illustration .road { stroke: #d9e3dc; stroke-width: 16; }
.map-illustration .thin { stroke-width: 8; }
.map-illustration .route { stroke: var(--primary); stroke-width: 3; stroke-dasharray: 6 7; }
.map-illustration circle { fill: var(--surface); stroke: var(--primary); }
.map-illustration .pin { fill: var(--primary); stroke: var(--primary); }
.map-illustration .pin-core { fill: white; stroke: white; }
.empty-state h3 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { max-width: 500px; margin: auto; color: var(--muted); font-size: 14px; }
.loading-list, .results-list { display: grid; gap: 14px; }
.skeleton { height: 158px; background: linear-gradient(90deg, #e8eeea 25%, #f5f8f6 45%, #e8eeea 65%); background-size: 300% 100%; border-radius: 18px; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.summary { margin-bottom: 14px; padding: 14px 16px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 13px; font-size: 14px; }
.visual-overview { margin-bottom: 18px; padding: 22px; background: rgba(255,254,249,.94); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 18px; padding: 4px; background: #f0f4f1; border-radius: 12px; }
.mode-tab { min-height: 44px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-weight: 680; }
.mode-tab.active { color: white; background: var(--primary); box-shadow: 0 5px 12px rgba(22,122,80,.18); }
.visual-head, .map-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.visual-head h3, .map-head h3 { margin: 0; font-size: 17px; }
.visual-head p, .map-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.chart-legend, .map-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 11px; }
.chart-legend span, .map-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend b { font-weight: 600; }
.chart-legend i, .map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.morning-dot, .home-dot { background: var(--primary); }
.company-dot { background: #e66b4e; }
.commute-chart { display: grid; gap: 7px; margin: 17px 0 24px; }
.comparison-item { overflow: hidden; border: 1px solid transparent; border-radius: 13px; transition: border-color .2s, background .2s, box-shadow .2s; }
.comparison-item.expanded { background: #f8fbf9; border-color: #b9d3c2; box-shadow: 0 6px 18px rgba(27,64,44,.07); }
.chart-row { display: grid; grid-template-columns: 22px minmax(82px, 120px) minmax(150px, 1fr) 24px; align-items: center; gap: 8px; width: 100%; min-height: 55px; padding: 7px 8px; color: var(--ink); text-align: left; background: transparent; border: 1px solid transparent; border-radius: 11px; }
.chart-row:hover, .chart-row.selected { background: #eff7f2; border-color: #b9d3c2; transform: translateY(-1px); }
.chart-rank { display: grid; place-items: center; width: 22px; height: 22px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 7px; font-size: 11px; font-weight: 750; }
.chart-name { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.chart-bars { display: grid; gap: 4px; }
.chart-bar { display: flex; align-items: center; width: var(--bar); min-width: 54px; height: 17px; padding: 0 5px; border-radius: 4px; }
.chart-bar b { color: white; font-size: 9px; white-space: nowrap; }
.morning-bar { background: var(--primary); }
.driving-bar { background: #d47b35; }
.chart-na { color: var(--muted); font-size: 10px; }
.expand-icon { width: 20px; color: var(--muted); transition: transform .2s; }
.comparison-item.expanded .expand-icon { transform: rotate(180deg); }
.inline-detail { padding: 4px 12px 14px 42px; }
.inline-route { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; color: #34463c; font-size: 12px; line-height: 1.65; }
.inline-route .mode-icon { margin-top: 1px; }
.inline-route > span { min-width: 0; overflow-wrap: anywhere; }
.inline-map-button { min-height: 42px; margin-top: 7px; padding: 0; color: var(--primary); background: none; border: 0; font-size: 12px; font-weight: 680; }
.estimate-note { margin: 6px 2px 0; color: #80511f; font-size: 10px; }
.map-head { margin: 0 2px 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.route-map { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 750 / 360; overflow: hidden; background: #edf2ee; border: 1px solid #d7e3da; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.route-map img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.route-map img.loading { opacity: .35; }
#mapLoading { position: absolute; color: var(--primary-dark); font-size: 13px; font-weight: 650; }
.map-markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.map-number, .map-company { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 999px; box-shadow: 0 3px 10px rgba(16,53,35,.28); }
.map-number { width: 31px; height: 31px; padding: 0; color: white; background: var(--primary); border: 3px solid white; font-size: 12px; font-weight: 800; pointer-events: auto; transition: transform .18s, background .18s; }
.map-number:hover, .map-number.selected { z-index: 3; background: #0b5635; transform: translate(-50%, -50%) scale(1.18); }
.map-company { min-width: 42px; height: 28px; padding: 0 8px; color: white; background: #dd684e; border: 2px solid white; font-size: 10px; font-weight: 750; }
.map-zoom { position: absolute; z-index: 4; top: 12px; right: 12px; display: grid; overflow: hidden; background: rgba(255,255,255,.95); border: 1px solid #cfdcd3; border-radius: 10px; box-shadow: 0 5px 16px rgba(22,55,36,.16); }
.map-zoom button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--ink); background: transparent; border: 0; font-size: 22px; font-weight: 500; line-height: 1; }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-zoom button:hover { color: var(--primary); background: var(--primary-soft); }
.map-zoom button:disabled { cursor: not-allowed; opacity: .35; }
.map-locations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.map-locations button { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px; color: var(--ink); text-align: left; background: #f7f9f7; border: 1px solid transparent; border-radius: 9px; }
.map-locations button:hover, .map-locations button.selected { border-color: #9fc5ad; background: var(--primary-soft); transform: translateY(-1px); }
.map-locations b { display: grid; flex: 0 0 auto; place-items: center; width: 23px; height: 23px; color: white; background: var(--primary); border-radius: 50%; font-size: 10px; }
.map-locations span { min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
.mode-icon { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }
.mode-icon svg { width: 17px; }
.departure-advice { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 7px; padding: 11px 12px; color: var(--primary-dark); background: #fff0b7; border-radius: 11px; }
.departure-advice span { font-size: 12px; }
.departure-advice strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.departure-advice small { color: var(--muted); font-size: 10px; text-align: right; }
.error-card { padding: 18px; color: var(--danger); background: #fffafa; border: 1px solid #f1c5c2; border-radius: 16px; }
.error-card strong { display: block; color: var(--ink); margin-bottom: 3px; }
.error-card p { margin: 0; font-size: 13px; }
footer { display: grid; gap: 5px; padding: 30px 24px; color: #7b8780; text-align: center; font-size: 12px; }
footer strong { color: var(--primary); font-size: 14px; }
.admin-shell { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.admin-card { width: min(100%, 620px); padding: 38px; background: rgba(255,254,249,.94); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.admin-card h1 { margin: 0 0 14px; font-size: clamp(28px, 5vw, 42px); line-height: 1.15; letter-spacing: -.045em; }
.admin-card > p:not(.eyebrow):not(.admin-help) { margin: 0 0 24px; color: var(--muted); line-height: 1.75; }
.admin-link { text-decoration: none; }
.admin-help { margin: 15px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.ocr-candidates { display: grid; gap: 8px; margin-top: 12px; }
.candidate-chip { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 11px; background: #eff9f2; border: 1px solid #b8dcc5; border-radius: 12px; cursor: pointer; }
.candidate-chip input { flex: 0 0 auto; width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--primary); }
.candidate-chip span, .candidate-chip b, .candidate-chip small { display: block; min-width: 0; }
.candidate-chip b { font-size: 12px; }
.candidate-chip small { margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.candidate-empty { margin: 0; padding: 11px; color: #80511f; background: #fff6df; border-radius: 10px; font-size: 12px; }
.ocr-raw { margin-top: 12px; color: var(--muted); font-size: 12px; }
.ocr-raw summary { min-height: 44px; padding: 12px 2px; cursor: pointer; }
.ocr-raw textarea { margin-top: 6px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, .upload-zone:focus-within { outline: 3px solid rgba(22,122,80,.28); outline-offset: 2px; }

@media (max-width: 860px) {
  .shell { padding-top: 24px; }
  .hero { grid-template-columns: 1fr; }
  .hero-wish { max-width: 620px; }
  .workspace { grid-template-columns: 1fr; }
  .results-area { padding-top: 15px; }
}
@media (max-width: 520px) {
  .topbar { height: 64px; padding: 0 16px; }
  .shell { padding: 22px 16px 52px; }
  .hero { margin-bottom: 28px; }
  .hero h1 { font-size: 36px; }
  .hero > p:last-child { font-size: 16px; }
  .hero-wish { padding: 22px 20px; }
  .bus-doodle { display: none; }
  .form-card { padding: 21px 17px; border-radius: 18px; }
  .visual-overview { padding: 16px 12px; }
  .visual-head, .map-head { display: block; }
  .chart-legend, .map-legend { justify-content: flex-start; margin-top: 7px; }
  .chart-row { grid-template-columns: 22px 72px minmax(100px, 1fr) 20px; gap: 5px; }
  .inline-detail { padding-left: 10px; }
  .map-locations { grid-template-columns: 1fr; }
  .map-number { width: 29px; height: 29px; }
  .map-zoom { top: 8px; right: 8px; }
  .map-zoom button { width: 38px; height: 38px; }
  .departure-advice { grid-template-columns: auto 1fr; }
  .departure-advice small { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
