:root{
  --bg:#cfd9df;
  --card:#3f464a;
  --text:#e8eff2;
  --muted:#a8b3b9;
  --accent:#9fd3f6;
}
html,body{min-height:100%;}
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background:linear-gradient(180deg,var(--bg),#dfe8ee);
  color:var(--text);
}
.wrap{max-width:820px;margin:0 auto;padding:24px max(12px, env(safe-area-inset-left)) 64px max(12px, env(safe-area-inset-right));}

.toggle{display:flex;justify-content:center;align-items:center;margin:12px 0 24px;}
.seg-toggle{position:relative; display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:0; appearance:none; border:none; background:#5b646a; color:#e9f0f5; font-weight:800; font-size:18px; padding:4px; border-radius:999px; letter-spacing:.08em; cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.12); min-width:240px;}
.seg-toggle .seg-option{z-index:1; text-align:center; padding:10px 16px; user-select:none; transition:color .18s ease;}
.seg-toggle .seg-thumb{position:absolute; top:4px; left:4px; width:calc(50% - 4px); height:calc(100% - 8px); background:#e9f0f5; border-radius:999px; box-shadow:0 6px 16px rgba(0,0,0,.18); transform:translateX(0%); transition:transform .2s ease, background-color .2s ease;}
.seg-toggle:hover{background:#6a757b;}
.seg-toggle:focus-visible{outline:3px solid var(--accent); outline-offset:3px;}
.seg-toggle[data-dir="go"] .seg-option:nth-child(1){color:#394043;}
.seg-toggle[data-dir="back"] .seg-thumb{transform:translateX(100%);} 
.seg-toggle[data-dir="back"] .seg-option:nth-child(2){color:#394043;}

.card{background:var(--card); border-radius:18px; padding:20px 24px; margin:18px 0; box-shadow: 0 10px 24px rgba(0,0,0,.15);} 
.card header{display:flex; align-items:center; justify-content:space-between;}
.card h2{margin:0; font-size:28px; letter-spacing:.08em;}
.card h2 small{font-size:14px; color:var(--muted); margin-left:8px; font-weight:600;}
.badge{background:#535c61; padding:6px 10px; border-radius:999px; color:#dbe7ee; font-size:14px; transition:background-color .2s ease,color .2s ease; text-decoration:none;}
.badge:hover{background:#5b646a;}
.badge.low{background:#2e7d32; color:#e9f6ea;}
.badge.mid{background:#f1c40f; color:#1b1f22;}
.badge.high{background:#e74c3c; color:#fff;}

.grid{display:grid; gap:16px; margin-top:14px; align-items:center;}
.grid.two{grid-template-columns: 1fr 1fr;}
.grid.three{grid-template-columns: repeat(3, 1fr);} 

.stop .stop-name{font-size:20px; font-weight:700; margin-bottom:10px; text-align:center; display:flex; justify-content:center;}
.meta{display:flex; gap:24px; color:var(--muted); font-weight:700;}
.times{display:grid; grid-template-columns: 1fr 2px 1fr; align-items:end; gap:16px; margin-top:8px;}
.times .side{display:flex; flex-direction:column; align-items:center;}
.label-over{color:var(--muted); font-weight:700; margin-bottom:6px;}
.big-wrap{display:flex; align-items:flex-end; gap:10px;}
.small-note{color:var(--muted); font-weight:800; font-size:14px; letter-spacing:.03em;}
.big{font-size:70px; font-weight:800; line-height:1;}
.unit{color:var(--muted); font-weight:700; padding-bottom:10px;}
.divider{width:2px; height:72px; background:#6a757b; justify-self:center; align-self:center;}

.bike .label, .taxi .label, .rideshare .label{color:var(--muted); font-weight:700; margin-bottom:8px;}
.bike .big, .taxi .big, .rideshare .big{font-size:70px;}

/* Timetable */
.timetable{display:flex; flex-direction:column; gap:10px; margin-top:16px;}
.tt-row{display:grid; grid-template-columns: 56px 1fr; align-items:baseline; gap:12px;}
.tt-hour{font-weight:800; color:#d0d8dd; letter-spacing:.06em;}
.tt-mins{display:flex; flex-wrap:wrap; gap:10px; align-items:baseline;}
.ttm{font-weight:800; font-size:20px;}
.muted{color:var(--muted);}

/* line colors */
.legend{display:inline-flex; align-items:center; gap:8px;}
.legend:before{content:''; display:inline-block; width:14px; height:14px; border-radius:3px;}
.legend-23:before{background:#8f9aa1;} /* 湘23 */
.legend-25:before{background:#e74c3c;} /* 湘25 */
.legend-28:before{background:#f1c40f;} /* 湘28 */
.legend-24:before{background:#2ecc71;} /* 湘24 */
.m-23{color:#c5cdd3;}
.m-25{color:#ff6b5a;}
.m-28{color:#ffe07a;}
.m-24{color:#b8f0c9;}
/* 辻 lines */
.legend-t34:before{background:#3498db;} /* 辻34 */
.legend-t35:before{background:#9b59b6;} /* 辻35 */
.m-t34{color:#8ec9f3;}
.m-t35{color:#d1a7e6;}
/* fallback */
.legend-other:before{background:#95a5a6;} /* default gray */
.m-other{color:#cfd8dc;}

@media (max-width: 720px){
  .card{padding:25px 18px;}
  .big{font-size:70px;}
  .bike .big, .taxi .big{font-size:64px;}
}

@media (max-width: 520px){
  .card:not(.bike) .grid.two{grid-template-columns: 1fr;}
  .card .grid.three{grid-template-columns: 1fr;}
  .big{font-size:60px;}
  .bike .big, .taxi .big{font-size:52px;}
  .divider{height:54px;}
}

@media (max-width: 380px){
  .big{font-size:48px;}
  .bike .big, .taxi .big{font-size:44px;}
}
