.sheet-toolbar,.sheet-peek,.mobile-nav-icon{display:none}
@media(max-width:900px){
 :root{--mobile-header:calc(56px + env(safe-area-inset-top,0px));--mobile-nav:calc(66px + env(safe-area-inset-bottom,0px));--mobile-vh:100dvh;--sheet-height:64dvh}
 html,body{width:100%;height:var(--mobile-vh);overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%}body{background:var(--bg)}
 header{height:var(--mobile-header);position:fixed;left:0;right:0;top:0;z-index:900;padding:env(safe-area-inset-top,0px) 12px 0;display:flex;align-items:center;align-content:center;flex-wrap:nowrap;gap:10px;background:var(--surface)}
 .brand,html[data-theme=dark] .brand{width:128px;height:44px;margin:0;padding:0 5px;border-radius:5px;display:flex;align-items:center;flex-shrink:0}.brand img{height:42px;width:100%;object-fit:contain}.city{font-size:10px;font-weight:600;display:flex;padding:0;margin:0 auto 0 6px;gap:6px;min-width:0}.city small{display:none}.city .dot{width:4px;height:4px}
 header .icon,header>.icon:last-child{position:static;right:auto;top:auto;margin:0;width:44px;height:44px;flex:0 0 44px;background:transparent;border:0;display:grid;place-items:center;border-radius:8px}.icon svg{width:19px;height:19px}
 header nav{position:fixed;left:0;right:0;bottom:0;z-index:1100;width:100%;height:var(--mobile-nav);margin:0;padding:5px max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));display:flex;align-items:stretch;justify-content:space-around;gap:3px;background:var(--surface);border-radius:0;box-shadow:0 -5px 24px #1a1a1a10}
 nav .nav{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;flex:1;min-width:0;min-height:55px;margin:0;padding:6px 2px;font-size:10px;font-weight:550;line-height:1.15;border-radius:9px;background:none;color:var(--sub)}
 nav .nav.active,html[data-theme=dark] nav .nav.active{background:var(--accent-soft);color:var(--accent-ink);box-shadow:none}nav .nav:hover{background:var(--accent-soft);color:var(--accent-ink)}.mobile-nav-icon{display:block;width:22px;height:22px}.mobile-nav-icon svg{width:22px;height:22px;display:block}
 main{position:fixed;left:0;right:0;top:var(--mobile-header);bottom:auto;height:calc(var(--mobile-vh) - var(--mobile-header) - var(--mobile-nav));width:100%;padding:0;margin:0;display:block;gap:0;overflow:hidden;background:var(--bg);min-height:0}
 .mapwrap{position:absolute;inset:0;width:100%;height:100%;margin:0;min-height:0;border:0;border-radius:0;z-index:1}.maptop{left:12px;right:12px;top:12px;align-items:flex-start}.maptag{min-height:38px;max-width:calc(100% - 58px);font-size:10px;padding:10px 12px;gap:8px;border-radius:8px;box-shadow:0 3px 15px #1a1a1a15}.maptag b{display:none}.floating{min-width:44px;height:44px;padding:10px;border-radius:9px;font-size:0;justify-content:center;box-shadow:0 3px 15px #1a1a1a15}.floating:before{content:'↻';font:24px/1 Inter,sans-serif}
 .mapcontrols{right:12px;top:68px;gap:8px}.mapcontrols button{width:44px;height:44px;border-radius:9px;box-shadow:0 3px 15px #1a1a1a15}.mapcontrols button svg{width:20px;height:20px}.lg-control-zoom,.mapbottom{display:none!important}.lg-control-attribution{max-width:100%;font-size:7px!important}.lg-control-container .lg-bottom{bottom:var(--sheet-height);transition:bottom .22s ease}.sheet-dragging .lg-control-container .lg-bottom{transition:none}
 aside#mobileSheet{position:absolute;left:0;right:0;bottom:0;width:100%;min-width:0;height:var(--sheet-height);max-height:calc(100% - 8px);z-index:700;display:flex;flex-direction:column;overflow:hidden;background:var(--surface);border:0;border-radius:20px 20px 0 0;box-shadow:0 -9px 34px #1a1a1a26;transition:height .24s cubic-bezier(.2,.8,.2,1);will-change:height;padding:0;isolation:isolate;min-height:0}
 aside#mobileSheet:before{display:none}.sheet-dragging aside#mobileSheet{transition:none}.sheet-toolbar{display:flex;align-items:center;min-height:46px;flex:0 0 46px;padding:0 14px;gap:8px;background:var(--surface);z-index:10}.sheet-toolbar button{border:0;background:none;color:var(--sub);min-height:44px;font-size:11px;font-weight:550;touch-action:manipulation}.sheet-toolbar #sheetToggle{position:relative;display:flex;align-items:center;flex:1;gap:9px;text-align:left;padding:9px 0 0;touch-action:none;cursor:grab;color:var(--ink)}.sheet-toolbar #sheetToggle:active{cursor:grabbing}.sheet-grip{position:absolute;left:calc(50% + 28px);top:6px;transform:translateX(-50%);height:4px;width:36px;background:var(--line);border-radius:9px}.sheet-chevron{font-size:19px;line-height:1;margin-left:auto;color:var(--muted);padding:0 10px}.sheet-toolbar #showMobileMap{color:var(--accent);padding:9px 7px 0;min-width:61px;font-size:11px}
 #plannerPanel{min-height:0;flex:1;overflow-x:hidden;overflow-y:auto;padding:6px 18px 24px;scrollbar-width:none;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-top:8px;scroll-padding-bottom:70px}#plannerPanel::-webkit-scrollbar{display:none}.planner-intro{margin-bottom:13px}.planner-intro .eyebrow,.planner-intro p{display:none}.planner-intro h1{font-size:23px;font-weight:700;letter-spacing:-.7px;margin:0 0 10px}.journey-scope{min-height:40px;margin-bottom:13px;padding:3px;border-radius:9px}.journey-scope button{min-height:36px;padding:7px 6px;gap:7px;font-size:12px;border-radius:6px}.journey-scope button svg{height:17px;width:17px}
 .journey-fields{padding:0 14px;border-radius:10px}.journey-field{height:62px;gap:11px}.field-inner>label{font-size:8px;margin-bottom:4px;letter-spacing:1px}.field-inner>input{font-size:16px;font-weight:450;line-height:23px;height:25px;padding:0}.journey-field>button{height:44px;min-width:32px;display:grid;place-items:center;padding:0}.journey-field>button svg{height:21px;width:21px}.swap{width:36px;height:36px;top:44px;right:8px;border-radius:8px}.swap svg{width:17px;height:17px}.point{width:10px;height:10px}
 .journey-options{margin:7px 0;min-height:44px;gap:10px}.journey-options button,.journey-options select{font-size:11px;min-height:44px}.journey-options select{max-width:155px;padding:8px}.journey-options button{padding:6px 0}.search-journey{min-height:50px;border-radius:10px;font-size:14px;padding:14px 16px}.search-journey>span:last-child{font-size:21px}.planner-note{font-family:Inter,sans-serif;font-size:9px;line-height:1.5;margin:10px 0 19px}#journeyTimeWrap{padding:12px;gap:9px}#journeyTimeWrap input{font-size:16px;min-height:44px;max-width:100%;padding:8px}#journeyTimeWrap label{font-size:11px}#journeyNow{min-height:44px;font-size:12px}
 .suggestions{top:calc(100% + 2px);left:-14px;right:-14px;border-radius:10px;padding:5px;max-height:min(240px,34vh);box-shadow:0 7px 24px #1a1a1a29;z-index:100}.suggestions button{padding:12px;min-height:52px;font-size:14px;line-height:1.5;border-radius:7px}.suggestions small{font-size:11px;line-height:1.4;margin-top:2px}.suggestions p{font-size:12px}.welcome-heading h2{font-size:13px}.welcome-heading>span{font-size:7px}.quick-journey{min-height:64px;padding:12px;border-radius:9px;gap:11px}.quick-journey strong{font-size:12px;font-weight:550;line-height:1.5}.quick-journey small{font-size:11px;line-height:1.5}.quick-icon{width:35px;height:35px}.quick-icon svg{height:19px;width:19px}.welcome-tip p{font-size:11px}.welcome-tip{padding:13px}
 .asidefoot{display:none}.has-journeys .journey-scope,.has-journeys .planner-intro,.has-journeys #journeyForm{display:none}.has-journeys .edit-journey{display:flex;min-height:52px;border-radius:9px;padding:13px 12px}.edit-journey>span:first-child{font-size:13px;max-width:77%}.edit-journey>span:last-child{font-size:10px}.results-heading{margin:18px 0 12px}.results-heading h2{font-size:14px}.results-heading>span{font-size:9px}.journey-card,.journey-card.selected{border-radius:10px;margin:11px 0}.journey-card-head{padding:16px;min-height:100px}.journey-card-top{gap:8px;margin-bottom:13px}.journey-duration{font-size:25px}.journey-duration small{font-size:12px}.journey-distance{font-size:11px}.journey-arrival{font-size:11px}.best-route{font-size:6px;padding:5px 6px;letter-spacing:.3px}.journey-foot{font-size:10px;margin-top:12px}.line-chip{font-size:12px;padding:5px 8px;min-height:26px;border-radius:5px}.line-chip svg{height:14px;width:14px}.walk-chip{font-size:10px}.journey-instructions,.journey-card.selected .journey-instructions,html[data-theme=dark] .journey-card.selected .journey-instructions{padding:4px 12px 17px;margin:0 6px 6px}.instruction{gap:10px;padding-top:15px}.instruction-icon{width:31px;height:31px;flex:0 0 31px}.instruction-icon svg{height:17px;width:17px}.instruction-title{font-size:13px;line-height:1.7}.instruction-content p{font-size:11px;line-height:1.7}.instruction-time{font-size:11px;min-width:35px;padding-top:6px}.instruction-content details{font-size:11px;margin-top:8px}.instruction-content summary{min-height:40px;display:flex;align-items:center}.instruction-content details ul{margin-top:0}.instruction-content li{padding:5px 0;font-size:11px}.instruction-content .alight{font-size:12px!important}.transfer-wait{margin-left:41px;font-size:11px;padding:9px 10px}.route-source{font-size:10px;line-height:1.7;margin:18px 1px}.journey-error{font-size:13px;padding:15px}.journey-loading{padding:30px 0;font-size:13px}
 .intro{padding:6px 18px 14px}.intro .eyebrow,.intro p{display:none}.intro h1{font-size:23px;line-height:1.2;margin:0}.intro h1 br{display:none}.tabs{margin:0 18px 12px;min-height:44px;padding:3px;border-radius:9px}.tabs button{min-height:38px;font-size:12px;border-radius:6px}#busPanel{padding:0 18px 12px;min-height:0;flex:1}.searchbox{min-height:48px;padding:8px 12px;border-radius:9px;flex-shrink:0}.searchbox input{font-size:16px}.chips{flex-shrink:0;gap:6px;margin:10px 0 14px}.chips button{font-size:11px;min-height:38px;padding:8px 11px;border-radius:7px}.listhead{flex-shrink:0}.listhead h2{font-size:14px}.listhead>span{font-size:10px}.vehicle{min-height:65px;gap:12px;padding:12px 0}.badge{height:36px;min-width:42px;font-size:14px}.vtext strong{font-size:13px}.vtext small{font-size:10px;line-height:1.5}.vtime,.vtime b{font-size:10px}.star{width:44px;min-width:44px;height:44px;font-size:23px;padding:7px}.rail-badge{min-width:58px;font-size:11px}.rail-options{padding:9px 0;flex-shrink:0}.rail-options select{min-height:44px;font-size:13px;padding:9px}.rail-options label{min-height:38px;font-size:11px}.rail-options p{font-size:10px;line-height:1.5}.stoprow{min-height:60px;padding:11px 8px;margin:5px 0}.stoprow strong{font-size:13px}.stoprow small{font-size:11px}.empty{font-size:13px}
 .sheet-peek{display:none;background:var(--soft);border:0;border-radius:9px;margin:0 18px 10px;padding:10px 12px;min-height:44px;align-items:center;justify-content:space-between;text-align:left;gap:10px;font-size:13px;color:var(--ink)}.sheet-peek>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sheet-peek>span:last-child{font-size:22px;color:var(--accent)}body[data-sheet=collapsed] .sheet-peek{display:flex}body[data-sheet=collapsed] #plannerPanel,body[data-sheet=collapsed] .intro,body[data-sheet=collapsed] .tabs,body[data-sheet=collapsed] #busPanel{display:none!important}body[data-sheet=collapsed] .sheet-chevron{transform:rotate(180deg)}
 body.keyboard-open{--mobile-nav:0px}body.keyboard-open header nav{display:none}body.keyboard-open .planner-intro,body.keyboard-open #plannerWelcome,body.keyboard-open .planner-note{display:none}body.keyboard-open .journey-scope{margin-bottom:10px}body.keyboard-open #plannerPanel{padding-bottom:16px}body.keyboard-open .suggestions{max-height:min(190px,30vh)}
 dialog{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:calc(var(--mobile-vh) - 70px);border-radius:20px 20px 0 0;padding:25px 22px calc(24px + env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain}.close{width:44px;height:44px;top:6px;right:9px;font-size:27px}dialog h2{font-size:23px;padding-right:23px}dialog p{font-size:13px}.rail-route-button{min-height:48px;font-size:13px}.rail-meta span{font-size:10px}.timeline{max-height:45vh}.timeline li{font-size:13px;padding-block:12px}.timeline small{font-size:11px}.fine{font-size:10px!important}#toast{bottom:calc(var(--mobile-nav) + 14px);font-size:13px;padding:14px 16px;max-width:calc(100% - 28px);width:max-content;z-index:3000}
}
@media(max-width:360px){.brand,html[data-theme=dark] .brand{width:112px}.city{font-size:9px;margin-left:0}.journey-card-head{padding:13px}.journey-card-top{gap:6px}.journey-duration{font-size:22px}.journey-arrival{font-size:10px}.best-route{font-size:5px;padding:4px}#plannerPanel{padding-inline:15px}.sheet-toolbar{padding-inline:12px}.instruction-title{font-size:12px}.journey-options select{max-width:145px}}
@media(max-width:900px) and (max-height:500px){:root{--mobile-header:48px;--mobile-nav:54px}.brand,.brand img,html[data-theme=dark] .brand{height:40px}.sheet-toolbar{min-height:40px;flex-basis:40px}.sheet-toolbar button{min-height:38px}nav .nav{min-height:49px;flex-direction:row;gap:7px}.mobile-nav-icon,.mobile-nav-icon svg{height:19px;width:19px}.planner-intro{display:none}.journey-field{height:54px}.swap{top:38px}.mapcontrols{top:12px;right:12px;display:flex;gap:7px}.maptop{right:120px}.floating{display:none}.maptag{max-width:100%}}
@media(max-width:900px){body[data-sheet=full] .planner-intro{display:none}}
.nav-label-mobile{display:none}
@media(max-width:900px){nav .nav-label-desktop{display:none}nav .nav-label-mobile{display:block;font-size:11px;line-height:1.2}.intro{display:none}}

@media(max-width:900px){aside#mobileSheet{overflow:clip}.tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0}.tabs button{min-height:44px;padding:8px 3px;font-size:10px;white-space:nowrap}.coach-list{max-height:none}}

/* Mobile home planner */
@media (max-width: 900px) {
  body.planning:not(.has-journeys) #mobileSheet {
    --home-gutter: clamp(14px, 4.5vw, 24px);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 36px rgb(0 0 0 / 14%);
  }

  body.planning:not(.has-journeys) .sheet-toolbar {
    padding-inline: var(--home-gutter);
    min-height: 48px;
    flex-basis: 48px;
  }

  body.planning:not(.has-journeys) #sheetTitle {
    font-size: 13px;
    font-weight: 650;
  }

  body.planning:not(.has-journeys) #showMobileMap {
    font-size: 12px;
    font-weight: 650;
  }

  body.planning:not(.has-journeys) #plannerPanel {
    padding: 6px var(--home-gutter) 24px;
  }

  body.planning:not(.has-journeys) .planner-intro {
    margin-bottom: 12px;
  }

  body.planning:not(.has-journeys) .planner-intro h1 {
    margin: 0;
    font-size: clamp(23px, 6vw, 30px);
    line-height: 1.13;
    letter-spacing: -.035em;
    text-wrap: balance;
  }

  body.planning:not(.has-journeys) .journey-scope {
    margin-bottom: 10px;
    border-radius: 12px;
  }

  body.planning:not(.has-journeys) .journey-scope button {
    min-height: 44px;
    font-size: 13px;
    border-radius: 9px;
  }

  body.planning:not(.has-journeys) .journey-fields {
    padding-inline: 12px;
    border-radius: 15px;
  }

  body.planning:not(.has-journeys) .journey-field {
    height: 58px;
    gap: 10px;
  }

  body.planning:not(.has-journeys) .field-inner > label {
    font-size: 9px;
    letter-spacing: .09em;
  }

  body.planning:not(.has-journeys) .journey-field > button,
  body.planning:not(.has-journeys) #swapJourney {
    width: 44px;
    min-width: 44px;
    height: 44px;
    touch-action: manipulation;
  }

  body.planning:not(.has-journeys) #swapJourney {
    top: 36px;
    right: 6px;
  }

  body.planning:not(.has-journeys) .journey-field:last-child .field-inner {
    margin-inline-end: 40px;
  }

  body.planning:not(.has-journeys) .journey-options {
    column-gap: 8px;
    row-gap: 0;
    margin: 4px 0 8px;
  }

  body.planning:not(.has-journeys) .journey-options :is(button, select) {
    font-size: 12px;
  }

  body.planning:not(.has-journeys) #rememberJourneyStartWrap {
    min-height: 44px;
    margin: 0;
    font-size: 12px;
  }

  body.planning:not(.has-journeys) .search-journey {
    min-height: 52px;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 700;
    touch-action: manipulation;
  }

  body.planning:not(.has-journeys) .planner-note {
    font-size: 11px;
    line-height: 1.55;
  }

  body.planning:not(.has-journeys) #plannerPanel :is(button, select, input):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

/* Give the transport and city controls their own row on narrow phones. */
@media (max-width: 420px) {
  body.planning:not(.has-journeys) {
    --mobile-header: calc(102px + env(safe-area-inset-top, 0px));
  }

  body.planning:not(.has-journeys) > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    grid-template-rows: 46px 48px;
    align-content: center;
    column-gap: 4px;
    padding-inline: max(12px, env(safe-area-inset-left, 0px))
      max(12px, env(safe-area-inset-right, 0px));
  }

  body.planning:not(.has-journeys) > header > .city {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }

  body.planning:not(.has-journeys) > header > #info {
    grid-column: 2;
    grid-row: 1;
  }

  body.planning:not(.has-journeys) > header > #theme {
    grid-column: 3;
    grid-row: 1;
  }
}

/* Reveal the home interface after the splash has left the screen. */
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .mobile-home-enter body.planning:not(.has-journeys) :is(
    header > .brand, header > .city, header > .icon, header > .hdr-tools,
    #mobileSheet, header > nav, .maptop, .mapcontrols
  ) {
    animation: mobile-home-enter 380ms cubic-bezier(.23, .74, .25, 1) var(--home-entry-delay, 0ms) both;
  }

  .mobile-home-enter header > :is(.brand, .city, .icon) {
    --home-entry-y: -22px;
  }

  .mobile-home-enter header > .brand { --home-entry-x: -16px; --home-entry-y: 0px; }
  .mobile-home-enter :is(header > .icon, header > .hdr-tools) { --home-entry-x: 12px; }
  .mobile-home-enter header > .city { --home-entry-delay: 20ms; }
  .mobile-home-enter :is(.maptop, .mapcontrols) {
    --home-entry-x: 18px;
    --home-entry-y: 0px;
    --home-entry-delay: 35ms;
  }
  .mobile-home-enter #mobileSheet { --home-entry-y: 36px; --home-entry-delay: 0ms; }
  .mobile-home-enter header > nav { --home-entry-y: 24px; --home-entry-delay: 55ms; }
}

@keyframes mobile-home-enter {
  from { opacity: .35; translate: var(--home-entry-x, 0px) var(--home-entry-y, 0px); }
  to { opacity: 1; translate: 0 0; }
}
