/* 遅延ものさし — 駅の案内サインの視覚言語（明るい地・墨のゴシック・路線カラー帯） */
:root {
  --paper: #f4f5f4;      /* 駅構内の明るい壁 */
  --card: #ffffff;
  --ink: #23282d;        /* 墨 */
  --ink-soft: #5c646c;
  --sign: #1d4370;       /* 案内サインの紺 */
  --rule: #d9dcde;
  --caution: #9a5b00;    /* 参考値などの注意書き */
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "palt";
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* ---- ヘッダー：サービス名は看板のように ---- */
header { padding: 28px 0 6px; }
.brand {
  display: inline-block;
  background: var(--sign);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .06em;
  padding: 6px 14px;
  border-radius: 3px;
}
.tagline { margin: 10px 0 0; color: var(--ink-soft); font-size: 13.5px; }

/* ---- 検索 ---- */
.searchbox { position: relative; margin-top: 18px; }
#q {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 13px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
}
#q::placeholder { color: #9aa1a8; }
#q:focus { outline: 3px solid var(--sign); outline-offset: 1px; border-color: var(--sign); }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(29, 43, 60, .14);
  overflow: hidden;
}
.suggest button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%;
  padding: 11px 14px;
  font: inherit; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  color: var(--ink); cursor: pointer;
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button:focus-visible { background: #eef2f6; outline: none; }
.suggest .kind { color: var(--ink-soft); font-size: 12px; flex-shrink: 0; }

/* ---- 結果 ---- */
#result { margin-top: 26px; }
.station-head { display: flex; align-items: baseline; gap: 10px; }
.station-head h2 { margin: 0; font-size: 24px; }
.station-head .suffix { color: var(--ink-soft); font-size: 14px; }

/* 絞り込み（任意操作） */
.filters { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.seg { display: flex; border: 1.5px solid var(--sign); border-radius: 6px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 13px; padding: 6px 12px;
  background: var(--card); color: var(--sign); border: 0; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--sign); }
.seg button[aria-pressed="true"] { background: var(--sign); color: #fff; }
.seg button:focus-visible { outline: 3px solid var(--sign); outline-offset: -3px; }
#hour {
  font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1.5px solid var(--sign); border-radius: 6px;
  background: var(--card); color: var(--sign);
}

/* 路線カード：左の帯が現地サインと同じ路線カラー */
a.line-card { color: inherit; text-decoration: none; }
a.line-card:hover, a.line-card:focus-visible { border-color: var(--sign); outline: none; box-shadow: 0 0 0 1.5px var(--sign); }
.line-card {
  display: flex;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-top: 12px;
  overflow: hidden;
}
.line-card .band { width: 10px; flex-shrink: 0; }
.line-card .body { padding: 12px 14px 13px; flex: 1; min-width: 0; }
.line-card .name { font-weight: 700; font-size: 16px; }
.line-card .op { color: var(--ink-soft); font-size: 12.5px; margin-left: 8px; font-weight: 400; }

.verdict { margin-top: 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.verdict .lead { font-size: 13.5px; color: var(--ink-soft); }
.verdict .min {
  font-size: 34px; font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.verdict .min .unit { font-size: 16px; font-weight: 700; margin-left: 2px; }
.verdict .min.calm { font-size: 22px; font-weight: 700; color: #1d6b3f; }
.subline { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
.subline .warn { color: var(--caution); }
.tailline { font-size: 12.5px; margin-top: 7px; color: var(--ink-soft); }
.tailline.has { color: #a33517; font-weight: 600; }

.line-card.nodata { background: #eceeee; }
.line-card.nodata .band { background: #b7bcc0; }
.line-card.nodata .note { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

.empty { color: var(--ink-soft); margin-top: 20px; }

.also { margin-top: 30px; font-size: 13.5px; }
.also a { color: var(--sign); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--sign); padding-bottom: 1px; }

/* ---- フッター：出典と境界の明示 ---- */
footer {
  margin-top: 44px; padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft); font-size: 12px; line-height: 1.9;
}
footer strong { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .line-card { animation: rise .18s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(4px); } }
}
