/* Umbrella application styles (V5). Colors, faces, radii and motion come from tokens.css.
   Layout: the document is the one scroller. The app is a centered column (max 430px); the header is sticky inside it,
   the bottom navigation is fixed to the viewport, and focused work (editing, paying, picking roles) opens as a
   fixed full-screen layer that covers everything, including the navigation, and locks the page behind it. */
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--backdrop); color: var(--ink); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
/* while a layer or sheet is open the page behind it is pinned where it was, so closing it never jumps */
html.locked body { position: fixed; left: 0; right: 0; overflow: hidden; width: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.display, h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.mono, .tnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wm { font-family: var(--font-brand); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.eyebrow { font-family: var(--font-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--tan); }
/* atmosphere: fixed, never scrolls, sits under everything */
.atmosphere { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(70% 36% at 50% -8%, rgba(200,32,47,.14) 0%, transparent 60%), radial-gradient(50% 30% at 100% 8%, rgba(196,173,140,.06) 0%, transparent 60%), linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 64px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 100%; opacity: .45; }
/* the app column */
.stage { position: relative; z-index: 1; min-height: 100dvh; }
.column { position: relative; width: 100%; max-width: 430px; margin: 0 auto; min-height: 100dvh; background: var(--bg); padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .column { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.rail { display: none; }
@media (min-width: 1024px) { .rail { display: flex; position: fixed; left: max(24px, calc(50% - 215px - 340px)); top: 50%; transform: translateY(-50%); width: 300px; flex-direction: column; gap: 24px; z-index: 1; } }
@media (max-width: 1280px) and (min-width: 1024px) { .rail { left: 24px; width: 260px; } }
.gutter { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
@media (min-width: 1024px) { .gutter { padding-left: 20px; padding-right: 20px; } }
.safe-top { padding-top: env(safe-area-inset-top, 0px); }
/* header: sticky inside the column */
.hdr { position: sticky; top: 0; z-index: 20; }
.glass { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1); }
.brand-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 4px 8px 4px 4px; margin-left: -4px; transition: background-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.brand-btn:active { transform: scale(.97); background: var(--surface-2); }
@media (hover: hover) { .brand-btn:hover { background: var(--surface-2); } }
/* bottom navigation: fixed to the viewport, same width as the column */
.tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 430px; z-index: 30; padding-bottom: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); border-top: 1px solid var(--line); }
@media (min-width: 1024px) { .tabbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h); font-size: 10.5px; font-weight: 600; color: var(--muted); transition: color var(--dur-1) var(--ease); }
.tab.on { color: var(--ink); } .tab.on .ico { color: var(--red); }
.tab .ico { transition: transform var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease); }
.tab.on .ico { transform: translateY(-1px); }
.tab-mark { width: 50px; height: 50px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out); }
.tab.on .tab-mark { background: var(--red); border-color: var(--red); transform: translateY(-2px); }
.tab .badge { position: absolute; top: 8px; left: 50%; margin-left: 8px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
/* full-screen layers */
.layer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg); }
.layer-col { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; top: 0; bottom: 0; }
@media (min-width: 1024px) { .layer { background: transparent; } .layer > .layer-col { background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.layer .screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.sheet-wrap.lite .scrim { background: transparent; pointer-events: none; }
.sheet { position: relative; width: 100%; max-width: 430px; max-height: 92%; background: var(--surface); border-radius: 30px 30px 0 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: var(--shadow); }
.sheet.half { max-height: 58%; }
.sheet .screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.grabber { width: 40px; height: 5px; border-radius: 999px; background: var(--surface-3); margin: 10px auto 4px; flex: none; }
/* controls */
.field { width: 100%; height: 46px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: var(--r-md); padding: 0 14px; font-size: 14.5px; font-family: inherit; transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
textarea.field { height: auto; padding: 12px 14px; line-height: 1.5; }
.field:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field::placeholder { color: var(--muted); opacity: 1; }   /* S6-M8: hint text keeps 4.5:1; at .7 it was 2.9 to 3.8 */
.panel-black .field::placeholder { color: rgba(244,241,234,.6); }   /* the black panel stays black in the light theme too */
/* D-3 (Stage 6): iPhone Safari zooms the page in when a field under 16 px takes focus, so on touch screens every field is
   at least 16 px, whatever size its template asks for (this outranks the ! utilities); the signature line keeps its 18 px.
   A mouse and keyboard keep 14.5 px. */
@media (pointer: coarse) {
  input.field, textarea.field, select.field { font-size: 16px !important; }
  input.field.font-display { font-size: 18px !important; }
}
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* S6-M8: a heading or layer that takes focus after a render needs no ring; a focused control is never left under the
   fixed tab bar or a layer's footer (WCAG 2.4.11) */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus, [role="dialog"]:focus { outline: none; }
html { scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
.layer .screen, .sheet .screen { scroll-padding-bottom: 96px; }
.chk { accent-color: var(--red); width: 18px; height: 18px; }
button { font-family: inherit; }
.press { transition: transform var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease), filter var(--dur-1) var(--ease); }
.press:active { transform: scale(.975); }
@media (hover: hover) { .press:hover { filter: brightness(1.06); } }
.grid, .grid > * { min-width: 0; }
.noscroll::-webkit-scrollbar { display: none; } .noscroll { scrollbar-width: none; }
.hair { height: 1px; background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent); }
/* section surfaces */
.panel-tan { background: linear-gradient(160deg, var(--panel-tan-2) 0%, var(--panel-tan) 70%); color: var(--panel-tan-ink); border: 1px solid var(--panel-tan-line); }
.panel-tan .eyebrow { color: var(--panel-tan-muted); } .panel-tan .muted, .panel-tan .text-muted { color: var(--panel-tan-muted) !important; }
/* no brighter corner and a faint mark: text anywhere on the panel, under the mark or in a row, keeps 4.5:1 (S6-M8) */
.panel-red { background: radial-gradient(120% 90% at 100% 0%, var(--panel-red) 45%, var(--panel-red-2) 100%); color: var(--panel-red-ink); }
.panel-red .eyebrow { color: var(--panel-red-muted); }
.panel-black { background: var(--panel-black); color: var(--white); }
/* the waiting card */
.waiting { position: relative; overflow: hidden; border-radius: var(--r-xl); }
.waiting .mark { position: absolute; right: -8%; top: -12%; width: 62%; opacity: .06; pointer-events: none; mix-blend-mode: screen; }
.waiting .mark svg { width: 100%; height: auto; }
.waiting .count { font-family: var(--font-display); font-size: 72px; line-height: .86; font-weight: 700; letter-spacing: -.03em; }
.waiting .row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.12); border: 1px solid var(--panel-red-line); color: var(--panel-red-ink); text-align: left; width: 100%; transition: background-color var(--dur-1) var(--ease); }
.waiting .row:active { background: rgba(255,255,255,.2); }
@media (hover: hover) { .waiting .row:hover { background: rgba(255,255,255,.18); } }
.waiting .row .n { font-family: var(--font-display); font-weight: 700; min-width: 22px; }
/* job cards: a quiet red wash so the thing you can act on is the warmest object on the screen */
.jobcard { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--red-tint) 0%, transparent 55%), var(--surface); border: 1px solid color-mix(in srgb, var(--red-line) 55%, var(--line)); border-radius: var(--r-lg); }
.jobcard::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--red); opacity: .9; }
.jobcard.quiet { background: var(--surface); border-color: var(--line); } .jobcard.quiet::before { background: var(--tan); }
/* the umbrella header: mark on one side, type on the other; the mark grows a little with the scroll */
.umb-head { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; }
@media (max-width: 359px) { .umb-head { grid-template-columns: 1fr; } }
.umb-head .mark { position: relative; height: 140px; display: flex; align-items: center; justify-content: center; overflow: visible; }
.umb-head .mark .glow { position: absolute; inset: 10% 0 0; background: radial-gradient(60% 60% at 50% 60%, rgba(200,32,47,.35) 0%, transparent 70%); opacity: var(--p, 0); transition: opacity var(--dur-2) linear; }
.umb-head .mark svg { position: relative; width: 112px; height: 112px; transform: translateY(calc(8px - 8px * var(--p, 0))) scale(calc(.78 + .22 * var(--p, 0))); opacity: calc(.55 + .45 * var(--p, 0)); transform-origin: 50% 70%; will-change: transform, opacity; }
.roster-row { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.roster-row:last-child { border-bottom: 0; }
/* notifications */
.notif { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 12px 10px 12px 12px; border-radius: var(--r-md); transition: background-color var(--dur-1) var(--ease); }
.notif.unread { background: var(--surface-2); }
.notif .x { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
@media (hover: hover) { .notif .x:hover { background: var(--surface-3); color: var(--ink); } }
/* role picker */
.role-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.role-row:last-child { border-bottom: 0; }
.role-row .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.role-row.on .box { background: var(--red); border-color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; max-width: 100%; }
.chip.primary { border-color: var(--red-line); background: var(--red-soft); }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* map */
.map { position: relative; overflow: hidden; background: var(--map-ocean); user-select: none; cursor: grab; touch-action: pan-y; }
.map.free { touch-action: none; } .map.dragging { cursor: grabbing; }
.map canvas { display: block; width: 100%; height: 100%; }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.map-pins .pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; will-change: transform; }
.map-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity var(--dur-2) ease; pointer-events: none; }
.map-hint.show { opacity: 1; }
.map-label { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--map-label); white-space: nowrap; pointer-events: none; }
.map-city { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; color: var(--map-label); font-size: 10px; font-weight: 600; white-space: nowrap; }
.map-city i { width: 5px; height: 5px; border-radius: 50%; background: var(--tan); opacity: .8; display: block; }
/* motion */
.rise { animation: rise var(--dur-3) var(--ease) both; } .fade { animation: fade var(--dur-2) ease-out both; }
.sheet-in { animation: sheet 360ms var(--ease-out) both; } .push-in { animation: push 300ms var(--ease-out) both; }
.drop-in { animation: drop var(--dur-3) var(--ease-out) both; }
.stagger > * { animation: rise 480ms var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 20ms } .stagger > *:nth-child(2) { animation-delay: 70ms } .stagger > *:nth-child(3) { animation-delay: 120ms } .stagger > *:nth-child(4) { animation-delay: 170ms } .stagger > *:nth-child(5) { animation-delay: 220ms } .stagger > *:nth-child(6) { animation-delay: 270ms } .stagger > *:nth-child(n+7) { animation-delay: 320ms }
.leaving { animation: leave 260ms var(--ease) both; }
@keyframes rise { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheet { from { transform: translateY(100%) } to { transform: none } }
@keyframes push { from { transform: translateX(40px); opacity: .4 } to { transform: none; opacity: 1 } }
@keyframes drop { from { transform: translateY(-110%); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes leave { to { transform: translateX(40px); opacity: 0; height: 0; margin: 0; padding-top: 0; padding-bottom: 0 } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--red) } 100% { box-shadow: 0 0 0 9px transparent } }
.ping { animation: ring 1.6s ease-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1) } 50% { opacity: .45; transform: scale(.7) } }
.livedot { animation: livepulse 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 1px transparent } 50% { box-shadow: inset 0 0 0 1px var(--red-line) } }
.newglow { animation: glow 1.2s ease-in-out 3; }
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.float { animation: float 3.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg) } } .spin { animation: spin 1.1s linear infinite; }
.umb-canopy { transform-origin: 24px 25px; animation: canopy 1s cubic-bezier(.2,1.25,.3,1) both; }
.umb-stem { transform-origin: 24px 24px; animation: stem 550ms 50ms var(--ease) both; }
@keyframes canopy { from { transform: scale(.08,.04) } 65% { transform: scale(1.05,1.08) } to { transform: scale(1) } }
@keyframes stem { from { transform: scaleY(0) } to { transform: scaleY(1) } }
.rain { position: absolute; width: 2px; height: 22px; border-radius: 2px; background: linear-gradient(var(--tan), transparent); opacity: 0; animation: rain 1.4s linear infinite; }
@keyframes rain { 0% { transform: translateY(-40px); opacity: 0 } 15% { opacity: .9 } 80% { opacity: .9 } 100% { transform: translateY(70px); opacity: 0 } }
.booked-text { animation: rise 600ms 900ms var(--ease) both; }
.ring-prog { transition: stroke-dasharray 600ms var(--ease); }
.dotgrid { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
@media (prefers-reduced-motion: reduce) {
  .rise, .fade, .sheet-in, .push-in, .drop-in, .stagger > *, .leaving, .ping, .livedot, .newglow, .umb-canopy, .umb-stem, .rain, .booked-text, .spin, .float { animation: none !important; }
  .umb-head .mark svg, .umb-head .mark .glow { --p: 1; transition: none; }
  .press, .field, .tab, .tab .ico, .tab-mark { transition: none; }
}

/* Help and support (S6-M9): native disclosure, so keyboards and screen readers get expand and collapse for free */
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 16px; font-weight: 600; font-size: 14.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { display: inline-flex; transition: transform var(--dur-1) var(--ease); }
.faq details[open] summary .chev { transform: rotate(90deg); }
.faq .answer { padding: 0 16px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .faq summary .chev { transition: none; } }
