.mobile-only { display: none; }
.sheet-content { display: contents; }
.new-trip-button { width: 100%; min-height: 50px; margin: 14px 0; border: 0; border-radius: 12px; background: #266549; color: white; font-size: 17px; font-weight: 800; box-shadow: 0 4px 12px #245d3520; }
.new-trip-button:disabled { opacity: .5; }
#new-trip-dialog { width: min(480px, calc(100vw - 24px)); max-height: 85dvh; overflow-y: auto; border: 0; padding: 24px; border-radius: 20px; color: #253e2c; }
#new-trip-dialog::backdrop { background: #14291c99; }
#new-trip-dialog p { font-size: 13px; line-height: 1.7; }
#new-trip-dialog label { display: block; font-size: 14px; font-weight: 700; margin: 16px 0; }
#new-trip-dialog input { display: block; width: 100%; min-width: 0; margin-top: 8px; padding: 13px; border-radius: 10px; border: 1px solid #bdcebe; background: #f8faf4; font-size: 16px; }
#new-trip-dialog .panel-close { width: 44px; height: 44px; }
#new-trip-error { color: #ad3c36; }
.sheet-content > #close-list { float: right; }
.origin-item { list-style: none; margin-bottom: 12px; border: 1px solid #c7d9f1; background: #edf5ff; border-radius: 14px; padding: 10px; }
#origin-locate { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; padding: 6px 0; background: transparent; color: #184c98; }
#origin-locate b { display: block; font-size: 15px; }
#origin-locate small { display: block; margin-top: 4px; font-size: 12px; }
.origin-index { background: #256cd1; color: white; border-color: #256cd1; box-shadow: none; }
#origin-route-meta { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: #28598c; }
.origin-map-marker { display: flex; align-items: center; border: 3px solid white; border-radius: 20px; background: #216bdb; color: white; padding: 4px 8px; gap: 5px; box-shadow: 0 0 0 5px #2679ff22, 0 3px 9px #0003; }
.origin-map-marker b { font-size: 16px; } .origin-map-marker span { font-size: 11px; }
.day-empty { padding: 20px 12px; border-radius: 12px; background: #f1f5ec; font-size: 14px; color: #354d3b; }
.day-empty p { line-height: 1.7; }
@media (max-width: 760px) {
  :root { --sheet-height: 184px; --safe-bottom: env(safe-area-inset-bottom, 0px); }
  html, body { height: 100%; height: 100dvh; overscroll-behavior: none; }
  button { touch-action: manipulation; }
  .mobile-only { display: block; }
  .mobile-date-nav { position: fixed; top: calc(66px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; z-index: 20; background: #fffefa; border-radius: 16px; box-shadow: 0 4px 16px #15372620; padding: 4px 6px 8px; }
  .date-nav-heading { display: flex; justify-content: space-between; align-items: center; height: 36px; }
  .date-nav-heading button { min-width: 44px; height: 36px; border: 0; background: transparent; color: #244d38; font-size: 26px; }
  .date-nav-heading label { position: relative; font-size: 14px; font-weight: 800; color: #24432f; padding: 7px 14px; }
  #mobile-trip-date { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .mobile-day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .mobile-day-strip button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; height: 58px; border: 0; border-radius: 12px; background: transparent; color: #263e2e; }
  .mobile-day-strip small { font-size: 12px; color: #657469; }
  .mobile-day-strip b { font-size: 19px; }
  .mobile-day-strip .sunday, .mobile-day-strip .sunday small { color: #ba4949; }
  .mobile-day-strip .selected { background: #266549; color: white; }
  .mobile-day-strip .selected small { color: white; }
  .mobile-date-nav[aria-busy=true] { opacity: .6; pointer-events: none; }
  .top-closed .mobile-date-nav { top: calc(10px + env(safe-area-inset-top, 0px)); right: 80px; }
  .mobile-keyboard .mobile-date-nav { display: none; }
  .topbar { top: calc(8px + env(safe-area-inset-top, 0px)); height: 52px; padding: 0 10px; gap: 6px; border-radius: 14px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .brand-mark { flex-shrink: 0; box-shadow: 1px 2px 0 #b5cbb7; }
  .top-actions { margin-left: auto; gap: 4px; }
  .topbar #history-button { font-size: 12px; min-height: 42px; padding: 5px 6px; }
  .topbar #save-button { font-size: 13px; min-height: 40px; padding: 6px 12px; box-shadow: none; transform: none; }
  .topbar #archive-button, .topbar #share-button, .topbar #close-top, .save-status { display: none; }
  #mobile-more { width: 36px; height: 42px; background: transparent; }
  .mobile-menu-open .topbar #archive-button, .mobile-menu-open .topbar #share-button, .mobile-menu-open .topbar #close-top { display: block; position: absolute; right: 0; width: 150px; height: 44px; background: white; border: 1px solid #dce5da; border-radius: 8px; box-shadow: 0 6px 18px #0002; font-size: 14px; }
  .mobile-menu-open .topbar #archive-button { top: 60px; }
  .mobile-menu-open .topbar #share-button { top: 106px; }
  .mobile-menu-open .topbar #close-top { top: 152px; }
  .center-info { top: calc(180px + env(safe-area-inset-top, 0px)); left: 12px; right: auto; width: max-content; max-width: calc(100vw - 78px); padding: 7px 12px; text-align: left; }
  .center-info strong { font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .center-caption { display: none; }
  .top-closed .center-info { top: calc(124px + env(safe-area-inset-top, 0px)); }
  .route-panel { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: calc(var(--sheet-height) + var(--safe-bottom)); max-height: calc(100dvh - 184px - env(safe-area-inset-top, 0px)); padding: 0 0 var(--safe-bottom); border: 1px solid #dce6dc; border-radius: 22px 22px 0 0; background: #fffefa; overflow: hidden; z-index: 16; box-shadow: 0 -8px 28px #183b2426; transition: height .22s ease; }
  .sheet-dragging .route-panel { transition: none; }
  .mobile-sheet-header { flex: 0 0 auto; background: #fffefa; }
  .mobile-sheet-header .new-trip-button { margin: 0 16px 8px; width: calc(100% - 32px); min-height: 48px; }
  #desktop-new-trip { display: none; }
  #sheet-handle { display: flex; align-items: center; justify-content: center; position: relative; gap: 14px; width: 100%; height: 56px; padding-top: 13px; border: 0; background: transparent; color: #294a37; font-size: 13px; font-weight: 700; touch-action: none; cursor: grab; }
  .sheet-grip { position: absolute; top: 9px; left: calc(50% - 22px); width: 44px; height: 5px; background: #a4b5a6; border-radius: 8px; }
  .sheet-chevron { font-size: 20px; }
  .sheet-tabs { display: flex; padding: 0 16px 8px; gap: 8px; }
  .sheet-tabs button { flex: 1; min-height: 44px; border: 1px solid #d6e2d5; border-radius: 11px; background: #f4f7f0; font-size: 15px; font-weight: 700; color: #415c49; }
  .sheet-tabs button.active { background: #256449; border-color: #256449; color: white; }
  .sheet-content { display: block; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 18px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding-top: 12px; }
  .sheet-peek .sheet-content { visibility: hidden; }
  .sheet-tall .weather-bar, .sheet-tall .center-info, .sheet-tall #locate-button { visibility: hidden; }
  .sheet-content > #close-list, .sheet-content > .eyebrow, .sheet-content > .subtitle { display: none; }
  .sheet-content > .trip-date-label { display: none; }
  .route-panel .plan-title { font-size: 23px; }
  .route-panel input, .detail-panel textarea, #trip-date { font-size: 16px; }
  .route-panel .search-box { height: 52px; box-shadow: 0 3px 0 #dbe5db; margin: 16px 0 8px; }
  .route-panel .search-box input { font-size: 16px; }
  .route-panel .search-box button { min-width: 48px; min-height: 44px; }
  .route-panel .mode-button, .route-panel .text-button { min-height: 44px; font-size: 14px; }
  .route-panel .place-item { min-height: 72px; }
  .route-panel .place-text b { font-size: 17px; }
  .route-panel .place-text span, .route-panel .segment-meta { font-size: 14px; }
  .route-panel .segment-label span:last-child { white-space: normal; }
  .route-panel .courses-menu { display: none; }
  .mobile-courses .sheet-content > * { display: none !important; }
  .mobile-courses .sheet-content > .courses-menu { display: block !important; margin: 0; padding: 0; border: 0; background: transparent; }
  .mobile-courses .courses-menu > summary { display: none; }
  .course-button { padding: 15px 12px; gap: 14px; min-height: 92px; }
  .course-button b { font-size: 17px; }
  .course-button small, .course-button em { font-size: 13px; }
  .detail-panel { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 72dvh; padding: 20px 20px calc(24px + var(--safe-bottom)); border-radius: 22px 22px 0 0; background: #fffefa; z-index: 18; overscroll-behavior: contain; }
  .detail-panel > .panel-close { width: 44px; height: 44px; }
  .detail-header h2 { font-size: 24px; }
  .detail-header p { font-size: 14px; }
  .detail-panel .field-label { font-size: 12px; }
  .photo-drop { min-height: 100px; }
  .photo-drop b, .detail-panel .text-button, .detail-panel .danger-button { font-size: 14px; min-height: 44px; }
  .detail-panel .detail-bottom { position: sticky; bottom: -24px; background: #fffefa; padding: 12px 0; margin-top: 18px; }
  .detail-panel .primary-button { min-height: 44px; box-shadow: none; }
  .map-controls, .detail-closed .map-controls { top: calc(220px + env(safe-area-inset-top, 0px)); right: 12px; }
  .map-controls button { width: 42px; height: 42px; }
  #locate-button, .detail-closed #locate-button { right: 12px; bottom: calc(var(--sheet-height) + var(--safe-bottom) + 64px); width: 44px; height: 44px; }
  .weather-bar { bottom: calc(var(--sheet-height) + var(--safe-bottom) + 10px); max-width: calc(100vw - 16px); padding: 7px 9px; }
  .weather-bar #center-weather { font-size: 11px; gap: 6px; }
  .weather-bar #center-weather span + span { padding-left: 6px; }
  .route-pill, .map-footer { display: none; }
  .my-route-info { bottom: calc(var(--sheet-height) + var(--safe-bottom) + 53px); width: calc(100vw - 76px); max-width: 340px; left: 12px; transform: none; font-size: 12px; }
  .list-closed { --sheet-height: 0px !important; }
  #open-list { top: auto; left: 12px; bottom: calc(58px + var(--safe-bottom)); min-height: 44px; font-size: 14px; }
  body:not(.detail-closed) .weather-bar, body:not(.detail-closed) #locate-button, body:not(.detail-closed) #open-list, body:not(.detail-closed) .my-route-info { visibility: hidden; }
  .map-route-label { min-width: 110px; max-width: 145px; padding: 5px 7px; opacity: .94; }
  .map-route-label b { font-size: 10px; }
  #history-dialog { width: calc(100vw - 24px); max-height: 82dvh; padding: 20px; }
  .history-heading .panel-close { width: 44px; height: 44px; }
  .history-record b { font-size: 16px; }
  .history-record span, .history-record small { font-size: 13px; }
  .toast { bottom: calc(145px + var(--safe-bottom)); width: max-content; max-width: calc(100vw - 28px); border-radius: 12px; text-align: center; white-space: normal; }
  .mobile-keyboard .route-panel { height: calc(var(--visual-height, 100dvh) - 70px); max-height: none; bottom: var(--keyboard-offset, 0px); }
  .mobile-keyboard .weather-bar { display: none; }
  @media (max-width: 360px) { .brand { font-size: 13px; } .brand-mark { display: none; } .weather-bar #center-weather { font-size: 10px; } }
  @media (max-height: 500px) { .route-panel { max-height: 78dvh; } .center-info { max-width: 55vw; } }
}
