@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap');
:root {
  color-scheme: light;
  --bg: #f4f8f6;
  --surface: #ffffff;
  --text: #20312b;
  --muted: #71817a;
  --line: #e2ebe6;
  --green: #197a55;
  --green-dark: #125d40;
  --green-soft: #e8f4ed;
  --orange: #d88732;
  --red: #cf554b;
  --shadow: 0 8px 24px rgba(30, 65, 48, .07);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.pwa-edge-fix { display: none; }
.app-header {
  position: sticky; top: 0; z-index: 10;
  min-height: calc(66px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, #edf5f0 0%, #f4f8f6 100%);
  border-bottom: 1px solid rgba(218,232,223,.8);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: white; font-size: 22px; font-weight: 800; }
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 17px; line-height: 1.25; }
.brand-sub { color: var(--muted); font-size: 10px; margin-top: 2px; }
.icon-button { border: 1px solid var(--line); background: white; color: var(--green-dark); border-radius: 50%; width: 34px; height: 34px; font-weight: 700; font-size: 18px; }
.app-main { max-width: 760px; margin: 0 auto; padding: 18px 14px calc(30px + env(safe-area-inset-bottom)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.search-panel { padding: 19px 17px 16px; }
.section-heading, .map-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
h1, h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: .01em; }
h2 { font-size: 17px; }
.free-tag { color: var(--green); background: var(--green-soft); padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.field-label { display: block; margin: 16px 0 6px; color: #62746b; font-size: 11px; font-weight: 700; }
.input-wrap { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.input-wrap:focus-within { border-color: #7ab49a; box-shadow: 0 0 0 3px rgba(25,122,85,.08); }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.field-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.origin-dot { border: 3px solid var(--green); }
.destination-dot { background: var(--red); }
.field-connector { height: 9px; border-left: 1px dashed #a7b8ae; margin-left: 17px; }
.clear-btn { border: 0; background: transparent; color: #8b9992; font-size: 20px; padding: 0 2px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options-grid .field-label { margin-top: 14px; }
select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; color: var(--text); padding: 0 9px; font-size: 11px; }
.primary-button { width: 100%; margin-top: 18px; min-height: 49px; border: 0; border-radius: 13px; background: var(--green); color: white; font-weight: 700; font-size: 14px; box-shadow: 0 5px 12px rgba(25,122,85,.18); }
.primary-button:active { transform: translateY(1px); background: var(--green-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.button-icon { font-size: 20px; margin-right: 7px; vertical-align: -1px; }
.status-line { margin-top: 10px; min-height: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.status-line.error { color: #b13f37; }
.status-line.success { color: var(--green); }
.geocode-choices { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.choice-title { padding: 9px 11px; background: #f5f9f6; color: var(--muted); font-size: 10px; }
.choice-item { display: block; width: 100%; padding: 11px; text-align: left; border: 0; border-top: 1px solid var(--line); background: white; font-size: 12px; color: var(--text); }
.choice-item:active { background: var(--green-soft); }
.results-section { margin-top: 24px; }
.result-heading { margin: 0 2px 12px; }
.secondary-button { border: 1px solid var(--line); background: white; border-radius: 10px; color: var(--green-dark); padding: 8px 12px; font-size: 11px; font-weight: 700; }
.route-cards { display: grid; grid-template-columns: 1fr; gap: 9px; }
.route-card { position: relative; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: left; width: 100%; color: var(--text); }
.route-card.active { border: 2px solid var(--green); padding: 12px 13px; background: #f7fcf8; }
.route-card-top { display: flex; justify-content: space-between; align-items: center; }
.route-name { font-size: 12px; font-weight: 800; }
.route-time { font-size: 20px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.route-meta { display: flex; gap: 12px; margin-top: 3px; color: var(--muted); font-size: 10px; }
.route-chip { background: var(--green-soft); color: var(--green-dark); border-radius: 20px; padding: 4px 8px; font-size: 9px; font-weight: 700; }
.route-chip.alt { background: #f1f3f2; color: #69776f; }
.map-heading { margin: 23px 2px 10px; }
.map-hint { color: var(--muted); font-size: 9px; }
.map-shell { position: relative; height: min(62vh, 430px); min-height: 270px; overflow: hidden; border-radius: 17px; border: 1px solid var(--line); background: #e8efea; box-shadow: var(--shadow); }
#map { position: absolute; inset: 0; }
.map-legend { position: absolute; z-index: 2; left: 10px; bottom: 10px; display: flex; gap: 11px; padding: 8px 10px; background: rgba(255,255,255,.94); border: 1px solid rgba(220,230,224,.9); border-radius: 9px; font-size: 9px; color: #4e6057; }
.legend-line { display: inline-block; width: 18px; height: 4px; border-radius: 4px; margin-right: 4px; vertical-align: middle; background: #9ca9a2; }
.legend-line.selected { background: #17865a; }
.route-details { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #edf1ee; font-size: 11px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span:first-child { color: var(--muted); }
.detail-row strong { text-align: right; }
.list-heading { margin: 22px 2px 10px; }
.notice-panel { display: flex; gap: 10px; margin-top: 20px; padding: 13px; border-radius: 13px; background: #edf3f0; color: #52645b; }
.notice-icon { flex: 0 0 auto; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #d9e9df; color: var(--green-dark); font-weight: 800; font-size: 12px; }
.notice-panel strong { font-size: 11px; }
.notice-panel p { margin: 4px 0 0; font-size: 10px; line-height: 1.7; }
.app-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; color: #98a49d; font-size: 9px; }
.help-dialog { width: calc(100% - 32px); max-width: 480px; border: 1px solid var(--line); border-radius: 18px; padding: 18px; color: var(--text); box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.help-dialog::backdrop { background: rgba(17,35,26,.4); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.help-dialog p, .help-dialog li { font-size: 12px; line-height: 1.8; color: #53645b; }
@media (min-width: 620px) {
  .app-main { padding-top: 26px; }
  .search-panel { padding: 23px; }
  .route-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .pwa-edge-fix {
      display: block; position: fixed; z-index: 30; top: 0; left: 0; right: 0;
      height: 11px; pointer-events: none; background: #edf5f0;
      color: transparent; -webkit-background-clip: text; background-clip: text;
    }
    .app-header {
      background: linear-gradient(to bottom, #edf5f0 0%, #edf5f0 11px, rgba(237,245,240,.96) 40px, #f4f8f6 100%);
    }
  }
}

.footer-link { border: 0; padding: 0; background: transparent; color: #71817a; font: inherit; font-size: 9px; text-decoration: underline; }
.history-entry { margin-top: 14px; font-size: 12px; line-height: 1.8; color: #53645b; }
.history-entry ul { padding-left: 20px; }
