/* Apple's Human Interface Guidelines, applied (design rules A1–A2; DECISIONS #93).
   Loaded last so these minimums win everywhere. */

/* A1. Text is never smaller than 11 points. */
#app .eyebrow,#app .app-footer-note,#dialog-root .app-footer-note,#app .tiny,#dialog-root .tiny,
#app small,#dialog-root small,#app .nav span,#app .nav small,#app .tag,#dialog-root .tag,
#app .home-discovery-reason,#app .stop-order,#app .review-watch-steps strong,#app .review-watch-steps small,
#app .gc-route-add,#app .gc-route-update,#app .ce-legend,#app .ce-legend b,#app .gc-estimate-note,
#app .gc-shell label,#app .gc-shell small,#app .mile small{font-size:max(11px,1em)}
#app .eyebrow,#app .app-footer-note,#dialog-root .app-footer-note,#app .tiny,#dialog-root .tiny,
#app small,#dialog-root small,#app .nav span,#app .tag,#dialog-root .tag,#app .home-discovery-reason,
#app .stop-order,#app .review-watch-steps small,#app .ce-legend,#app .gc-estimate-note,#app .gc-shell small,#app .mile small{font-size:11px}
#app .review-watch-steps strong,#app .gc-route-add,#app .gc-route-update,#app .gc-shell label{font-size:12px}

/* A2. Every tap target is at least 44 × 44 points. */
#app button,#dialog-root button,#app [role=button],#dialog-root [role=button]{min-height:44px}
#app .icon-btn,#dialog-root .icon-btn,#app .gc-shell button,#app .text-btn,#dialog-root .text-btn{min-width:44px}
#app .gc-shell button{min-height:44px}
#app .search .icon-btn{width:44px;height:44px}
#app .jump-today,#app .jump-race,#app .course-label,#app .map-filter-toggle,#app .map-cheer-add,#app .gc-back,
#dialog-root .weather-sites button,#dialog-root .segmented button{min-height:44px}
/* Links inside sentences keep their look but get a taller tap area. */
#app p a,#dialog-root p a,#dialog-root .note-source a,#app .note-source a{display:inline-block;padding-block:15px;margin-block:-15px}
/* Controls whose own rules set a smaller height. */
#app.home-page .calendar-nav .calendar-controls button,#app.home-page .calendar-nav .calendar-controls button:is(.jump-today,.jump-race){height:44px;min-height:44px;min-width:44px}
#app .explore-search-wrap .explore-search .icon-btn,#app .explore-search .icon-btn{width:44px;height:44px;min-height:44px}
#app.map-page .map-filter-toggle,#app.map-page .map-cheer-add,#app.map-page .text-btn,#app .map-toolbar button{min-height:44px;height:auto}
#app .nav small{font-size:11px}
/* These floors must win over every older rule, so they are marked important. */
#app .nav .add-nav small{font-size:11px!important}
#app .explore-search-wrap .icon-btn{width:44px!important;height:44px!important;min-width:44px!important}
#app.map-page .map-toolbar button,#app.map-page .map-filter-toggle,#app.map-page .map-cheer-add,#app.map-page .text-btn{min-height:44px!important;height:44px!important}
#app .course-label,#app.map-page .course-label{font-size:11px!important}

/* A5. Text contrast at least 4.5:1 in light mode too. */
[data-appearance=light] #app .gc-runner-chip:has(input:checked){background:#dfe6ff}
[data-appearance=light] #app .gc-runner-chip:has(input:checked) strong{color:#141a2b}
[data-appearance=light] #app .gc-runner-chip:has(input:checked) small{color:#3a4660}
[data-appearance=light] #app .home-discovery-reason{color:#2a5a1c}
[data-appearance=light] #app .mile small{color:#4a5a14}

/* A34. Sheets: Close on the leading (left) side, like Apple's sheets. */
#dialog-root .sheet-head{flex-direction:row-reverse;justify-content:flex-end}
/* Sheet title and Close sit on the same line, centered on each other. */
#dialog-root .sheet-head{align-items:center!important;min-height:44px}
#dialog-root .sheet-head h2{margin:0;padding-top:0!important;line-height:1.2}

/* iPhone edges (Ethan's screenshot, Oct 31, 2026): on phones the app fills the whole screen,
   the header starts below the clock and camera, and the menu sits just above the home bar.
   refresh.css had fixed 14px / 12px values that ignored the iPhone's safe areas, and
   100dvh left a gap at the bottom when opened from the home screen. */
@media (max-width:99999px){
 #app.app-shell{position:fixed;inset:0;height:auto;max-width:none;margin:0}
 #app .appbar{padding-top:calc(env(safe-area-inset-top) + 8px)!important}
 #app .nav{bottom:max(6px,calc(env(safe-area-inset-bottom) - 10px))!important}
 #app .app-content{padding-bottom:calc(96px + max(6px,calc(env(safe-area-inset-bottom) - 10px)))}
 #app.map-page .map-place-sheet{bottom:calc(84px + max(6px,calc(env(safe-area-inset-bottom) - 10px)))}
}
/* Opened from the iPhone home screen, the page can come out one status bar short at the bottom.
   There the app uses the full screen height. */
@media (max-width:99999px){
 html.is-standalone,html.is-standalone body{height:100%;min-height:100lvh}
 html.is-standalone #app.app-shell{bottom:auto;height:100lvh}
}
@media (max-width:99999px) and (display-mode:standalone){#app.app-shell{bottom:auto;height:100lvh}}
/* A1: the weather sheet's labels and hours at 11pt or more (seen once the forecast loads). */
#dialog-root .weather-metrics span,#dialog-root .weather-metrics p,#dialog-root .weather-summary .eyebrow,#dialog-root .weather-summary p,#dialog-root .hourly-weather span,#dialog-root .hourly-weather small,#dialog-root .race-window p,#dialog-root .race-window span{font-size:12px!important}
/* A2 on the map's place card. */
#app.map-page .map-place-more{min-height:44px}
#app.map-page .map-place-close{width:44px;height:44px;min-width:44px}
#dialog-root .eyebrow{font-size:11px!important}
#dialog-root .stop-order{font-size:11px!important}
#app .route-row .mile small{font-size:11px}
#app .gc-shell .gc-leg-description,#app .gc-shell .gc-label,#app .gc-shell .gc-leg-top span{font-size:11px!important}
/* Every search bar has a ✕ clear on its right (Ethan, Nov 1, 2026); hidden only while empty. */
.search-clear{width:44px;height:44px;min-width:44px;display:grid;place-items:center;background:none!important;border:0;color:var(--muted);flex:none;padding:0}
input:placeholder-shown~.search-clear{visibility:hidden}
/* A2: one face in the header is still a 44px tap target. */
#app .appbar .avatar-stack{min-width:44px;justify-content:center}

/* Text-size floor (Nov 3 designer walk-through): nothing a person needs to read is under 12px,
   and notes and fine print are 13px (Apple's footnote). Only the tiny "AM/PM" beside a big
   time and the "+3" in a face bubble stay smaller, because they sit next to a bigger label. */
#app .eyebrow,#app.look-c .home-title .eyebrow,#dialog-root .eyebrow,#app .add-nav small,#app .course-label{font-size:12px!important}
#app nav.nav span,#app nav.nav .nav-label{font-size:12px}
#app .app-footer-note,#app .app-footer-note .text-btn{font-size:13px}
#app small.clash,#app .live-note,#dialog-root .sheet-source{font-size:13px}
#app .racepass-kicker,#app .racepass-label,#app .race-pass dt,#app dt{font-size:12px}
#app .racepass-metrics dt,#app .race-quick-actions button,#app .review-plan-tools button,#app .desktop-map-tools .text-btn{font-size:12px}
#app .section-heading .text-btn{font-size:15px}

/* One button size everywhere (Nov 3 designer walk-through): main and second buttons are 50px
   tall, 17px semibold, with 12px corners, Apple's standard. Two side by side still fit at 320px. */
/* Small buttons on the map's place card, inside a heading line and on pass estimates stay compact; the big setup-crew buttons stay big. */
#app :is(button,a):is(.primary,.secondary):not(.map-selection *,.review-plan-heading *,.pass-estimate-card *,.setup-crew .step-stack *),#dialog-root :is(button,a):is(.primary,.secondary):not(.pass-estimate-card *){min-height:50px!important;font-size:17px!important;font-weight:600!important;border-radius:12px!important;line-height:1.2!important}
@media (max-width:359px){#app .two-actions>:is(.primary,.secondary),#dialog-root .two-actions>:is(.primary,.secondary),#app .pick-use{font-size:15px!important;padding-left:10px;padding-right:10px}}
#app .crew-link input{min-height:50px;box-sizing:border-box}
/* The sample banner is one short line: the label on the left, Start My Own on the right (Nov 3 designer). */
#app .sample-label{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:2px 16px!important;font-size:13px!important}
#app .sample-label>span{min-width:0}
#app .sample-label .sample-exit{flex:none;font-size:15px;min-height:44px;padding:0 4px}
