/* Shared role workspaces. Role selection never grants API access. */
.workspace-active{--paper:#101b17;--white:#192720;--ink:#eff5ec;--muted:#b0bfad;--line:#3a4b3e;background:var(--paper);color:var(--ink)}
.workspace-active .topbar{background:#14221b;padding-block:18px}.workspace-active .topbar .button,.workspace-active .topbar a{color:var(--ink)}
.workspace-active .topbar .lime,.workspace-active .lime{color:#172b21}.workspace-active .outline,.workspace-active .light{color:var(--ink);border-color:#71806f}
.workspace-active .welcome{padding:32px 0 24px}.workspace-active .welcome h1{font-size:clamp(35px,4vw,52px);margin-bottom:12px}.workspace-active .trail-art{height:115px;width:220px}.workspace-active .trail-art svg{height:100px}.workspace-active .trail-art span{display:none}
.workspace-active .account-gate{padding:16px 20px}.workspace-active .account-gate .small{display:none}
.workspace-active input,.workspace-active select,.workspace-active textarea{color:var(--ink);background:#101c16;border-color:#64735f;color-scheme:dark}
.workspace-active input[type=checkbox]{accent-color:var(--lime)}.workspace-active .section-tabs{display:none}
.workspace-active .filters,.workspace-active th,.workspace-active .event-list-row,.workspace-active .event-create,.workspace-active .event-setup-grid>details,.workspace-active .event-map-card,.workspace-active .event-score-card{background:#1b2d22}
.workspace-active .pill{background:#2d422b;border-color:#5b7550;color:#e3f4d5}.workspace-active .notice,.workspace-active .event-demo{background:#2b3d27;border-color:#62794c;color:#edf6dc}.workspace-active .error{background:#402c22;color:#ffe2ce;border-color:#b7805a}
.workspace-active .event-secret{background:#3b3622;color:#fff3ca}.workspace-active .event-secret textarea{background:#201f14;color:#fff6cf}.workspace-active .event-ranking .time{color:var(--lime)}
.workspace-active .panel-section{padding:24px 0 36px}.workspace-active .section-heading h2{font-size:32px}.workspace-active .stat-value{color:var(--lime)}.workspace-active .group-card,.workspace-active .best-card,.workspace-active .route-copy{background:var(--white)}
.workspace-nav{margin:22px 0 0;border-bottom:1px solid var(--line);padding:0 0 18px;gap:8px}.workspace-nav .button{font-size:12px;white-space:normal}.workspace-sections{display:flex;gap:7px;flex-wrap:wrap;padding:20px 0;margin:0 0 8px;border-bottom:1px solid var(--line)}
.workspace-sections .button{padding:9px 12px;min-height:40px;font-size:12px;border-color:transparent;font-weight:500}.workspace-sections [aria-current=page]{background:#334a2b;border-color:#829566;color:#dcffae;font-weight:700}
.workspace-heading{font-size:30px;margin:20px 0 8px}.workspace-heading:focus{outline:none}.workspace-status{min-height:18px;margin-bottom:8px}.workspace-grid{margin:16px 0;gap:20px}.workspace-grid:empty{display:none}
.dashboard{display:grid;gap:22px}.dashboard-intro h3{font-size:22px;margin-bottom:6px}.dashboard-intro p{margin:0}.dashboard-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.dashboard-metrics:empty{display:none}.dashboard-metric{padding:22px;border:1px solid var(--line);border-radius:7px;background:var(--white)}.dashboard-metric strong{display:block;font:600 42px/1.3 'Barlow Condensed',Arial,sans-serif;color:var(--lime)}.dashboard-metric p{margin:5px 0 0}.dashboard-actions{display:flex;gap:10px;flex-wrap:wrap}.dashboard-row{display:flex;align-items:center;flex-wrap:wrap;gap:14px;padding:18px;background:var(--white);border:1px solid var(--line);border-radius:5px}.dashboard-row strong{margin-right:auto}.dashboard-row .button{font-size:11px}.workspace-card>.workspace-list>.workspace-card{background:#15221b}.workspace-card>h3{line-height:1.3}.assignment-status{grid-column:1/-1;font-size:12px;margin:0}.workspace-active .stats{margin:22px 0}.workspace-active footer{border-color:var(--line);color:var(--muted)}
.workspace-active :focus-visible{outline:3px solid var(--lime);outline-offset:3px}.workspace-form>button,.workspace-active button,.workspace-active summary{min-height:42px}.workspace-active summary{display:flex;align-items:center;gap:8px;cursor:pointer}.workspace-active summary:before{content:'+';color:var(--lime);margin-right:4px}.workspace-active details[open]>summary:before{content:'−'}.workspace-active .course-map{color:#172b21}.workspace-active .event-positions{margin-top:12px}
@media(min-width:1000px){.workspace-active .shell{max-width:1500px}.workspace-sections{position:sticky;top:0;z-index:5;background:var(--paper)}.workspace-active .workspace-card{padding:26px}.workspace-active .workspace-form{column-gap:24px}.workspace-active .workspace-grid{max-width:1180px}}
@media(max-width:700px){.workspace-active .trail-art{display:none}.workspace-active .welcome{padding:24px 0 18px}.workspace-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-nav .button{padding:11px 8px}.workspace-sections{gap:6px;padding:14px 0}.workspace-sections .button{white-space:normal;text-align:left;flex:0 1 auto}.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dashboard-metric{padding:17px}.dashboard-metric strong{font-size:34px}.workspace-active .workspace-card{padding:17px}.workspace-active .account-gate{padding:16px;align-items:start}.dashboard-row{gap:10px}.dashboard-row .button{width:100%;text-align:center}.workspace-active .section-heading{display:block}.workspace-active .section-heading>p{margin-top:12px}.workspace-active .topbar nav{display:none}.workspace-active .auth-actions{gap:7px}.workspace-active .auth-actions .button{padding:10px}.workspace-active .shell{padding-inline:5%}.workspace-active .button{white-space:normal}.workspace-active .event-live-grid{min-width:0}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.button:hover:not(:disabled){transform:none}}

/* Keep the first screen focused on the current task, with a persistent desktop sidebar. */
.workspace-active .welcome{display:none}.workspace-active .topbar{padding:13px 4%;gap:20px}.workspace-active .topbar .brand{font-size:23px}.workspace-active .topbar .auth-actions .button{padding:9px 12px}.workspace-active .account-gate{border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px 0;background:transparent}.workspace-active .account-gate p{font-size:11px;margin:3px 0 0}.workspace-active .account-gate .button{padding:8px 12px;min-height:38px}.workspace-active .account-gate .state-dot{background:var(--lime)}
#workspace-panels{display:grid;grid-template-columns:210px minmax(0,1fr);gap:28px;align-items:start;padding:22px 0 36px}.workspace-sidebar{position:sticky;top:18px}.workspace-role{display:block;font-size:11px;color:var(--muted);font-weight:600}.workspace-role select{font-size:12px;font-weight:600;margin-top:6px}.workspace-sections{position:static;display:flex;flex-direction:column;gap:4px;border:0;padding:15px 0;margin:0}.workspace-sections .button{display:block;text-align:left;width:100%;padding:10px 12px;font-size:12px}.workspace-main{min-width:0}.workspace-heading{margin:0 0 4px;font-size:30px}.workspace-status{margin:0 0 10px;font-size:11px;min-height:17px}.workspace-grid{margin:12px 0}.workspace-active .stats{margin:10px 0 20px}.workspace-active .stat{padding:18px}.workspace-active .stat-value{font-size:38px}.dashboard{gap:18px}.dashboard-intro h3{font-size:18px}.workspace-mobile-nav{display:none}.workspace-static:empty{display:none}.workspace-active .stats{grid-template-columns:repeat(4,minmax(0,1fr))}.workspace-active .section-heading{margin-bottom:18px}.workspace-active .workspace-card{padding:21px}.workspace-active .workspace-card h3{font-size:20px}.workspace-active .dashboard-metric{padding:18px}.workspace-active #events-toggle{display:none}
@media(max-width:850px){#workspace-panels{grid-template-columns:175px minmax(0,1fr);gap:18px}.workspace-active .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-active .topbar nav{display:none}}
@media(max-width:650px){#workspace-panels{display:block;padding:16px 0 30px}.workspace-sidebar{position:static;display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}.workspace-sections{display:none}.workspace-mobile-nav{display:block;font-size:11px;font-weight:600;color:var(--muted)}.workspace-mobile-nav select{margin-top:6px}.workspace-role select,.workspace-mobile-nav select{font-size:12px;padding:9px 7px;min-height:42px}.workspace-active .topbar{gap:10px;padding:12px 5%;display:grid;grid-template-columns:1fr auto;align-items:center}.workspace-active .topbar .language-picker{margin:0;justify-self:end}.workspace-active .auth-actions{grid-column:1/-1;justify-content:flex-end;gap:8px}.workspace-active .auth-actions .button{padding:7px 10px;min-height:34px;font-size:11px}.workspace-active .topbar .brand{font-size:23px}.workspace-active .account-gate{align-items:center;gap:8px;padding:10px 0}.workspace-active .account-gate strong{font-size:12px}.workspace-active .account-gate p{max-width:210px;font-size:10px}.workspace-active .account-gate .button{font-size:10px;padding:7px 10px;min-height:34px}.workspace-active .account-gate .gate-actions{flex-wrap:nowrap}.workspace-active .account-gate #preview{display:none}.workspace-heading{font-size:28px}.workspace-active .stats{gap:1px;margin:8px 0 16px}.workspace-active .stat{padding:14px}.workspace-active .stat-label{font-size:10px}.workspace-active .stat-value{font-size:32px}.workspace-active .stat-note{font-size:9px}.workspace-active .dashboard-intro h3{font-size:17px}.dashboard-actions .button{flex:1;text-align:center;padding:10px;font-size:11px}.workspace-active .workspace-card{padding:17px}.workspace-active .workspace-card h3{font-size:18px}.workspace-active .panel-section{padding:14px 0 25px}.workspace-active .section-heading h2{font-size:28px}}

@media(max-width:650px){.workspace-active .account-gate{flex-direction:row;text-align:left}.workspace-active .account-gate .gate-actions{width:auto;flex-shrink:0}.workspace-active .account-gate>div:first-child{min-width:0}.workspace-active .account-gate strong{overflow-wrap:anywhere}.workspace-active .account-gate #identity{display:inline}.workspace-active .account-gate #auth-status{max-width:220px}.workspace-active .account-gate .state-dot{margin-right:5px}}

.workspace-utilities{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;font-size:11px}.workspace-role>.button{display:block;margin-top:10px;text-align:center}

/* Collapse preserves DOM, forms and pending requests. The view switch stays in the top bar. */
#workspace-view{margin-left:auto;min-width:150px}#workspace-view[hidden]{display:none}.workspace-role{display:flex;align-items:center;gap:10px;font-size:11px;white-space:nowrap}.workspace-role select{margin:0;width:auto;min-width:145px}.workspace-role-name{font-size:12px;color:var(--ink)}
#workspace-menu-toggle{width:100%;padding:10px 8px;font-size:12px}#workspace-panels.menu-collapsed{grid-template-columns:88px minmax(0,1fr)}.workspace-sections[hidden]{display:none}
.service-shell .welcome[hidden]{display:none}.service-shell .signed-out{padding:28px 0;max-width:720px}.service-shell:not(.workspace-active) .topbar nav{display:none}.service-shell:not(.workspace-active) .account-gate{margin-top:30px}
@media(max-width:650px){#workspace-panels,#workspace-panels.menu-collapsed{display:block}.workspace-sidebar{display:block;margin-bottom:14px}.workspace-sidebar .workspace-sections:not([hidden]){display:flex;max-height:55vh;overflow-y:auto;padding-bottom:12px}#workspace-menu-toggle{width:auto;min-width:92px}#workspace-view{grid-column:1/-1;grid-row:2;margin:0}.workspace-active .auth-actions{grid-row:3}.workspace-role select{flex:1}.workspace-role-name{display:block}.workspace-active .workspace-sidebar .button{min-height:44px}.workspace-active .topbar{row-gap:8px}}
.calendar-save{border:2px solid #90ae55;margin-bottom:24px}.calendar-save h2{font-size:28px}.calendar-save-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}.calendar-source{text-decoration:underline}.calendar-save p{overflow-wrap:anywhere}@media(max-width:650px){.calendar-save-actions{flex-direction:column}.calendar-save-actions .button{width:100%}}

.workspace-active .empty{background:var(--white);color:var(--ink);border:1px solid var(--line)}
.workspace-active .empty p{color:var(--muted)}
.topbar-tools{display:contents}
.topbar .account-menu-toggle{display:none}
@media(max-width:700px){
  .service-shell .topbar{position:relative;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:12px;padding:8px 5%;min-height:60px}
  .service-shell .topbar .brand{font-size:21px;min-width:0;gap:8px}
  .service-shell .topbar .brand svg{width:26px;height:26px;flex-shrink:0}
  .service-shell .topbar .account-menu-toggle{display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;flex-shrink:0;border-radius:8px}
  .service-shell .topbar-tools{display:none}
  .service-shell .account-menu-open .topbar-tools{display:flex;flex-direction:column;align-items:stretch;gap:16px;position:absolute;top:calc(100% + 6px);right:5%;width:min(320px,90vw);max-height:calc(100dvh - 90px);overflow-y:auto;z-index:1000;padding:18px;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 30px #0004}
  .service-shell .topbar-tools .language-picker{margin:0;align-self:stretch}
  .service-shell .topbar-tools select{width:100%;font-size:16px;min-height:44px}
  .service-shell .topbar-tools .auth-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:0}
  .service-shell .topbar-tools .auth-actions .button{min-height:44px;width:100%;font-size:14px;padding:10px 12px}
}

.attendance-proposal{padding:16px;border:1px solid var(--line);border-left:3px solid var(--lime);border-radius:8px;background:var(--white)}.attendance-proposal p:last-child{margin-bottom:0}.attendance-search{min-width:0}.attendance-suggestions{display:grid;gap:8px;margin-top:8px}.attendance-suggestions .button{white-space:normal;text-align:left;min-height:44px}.attendance-search input{font-size:16px}

.race-hub{grid-column:1/-1;min-width:0}
.race-head{display:flex;gap:1rem;align-items:end;flex-wrap:wrap;margin-bottom:1rem}
.race-head label{display:grid;gap:.4rem;flex:1;min-width:12rem}
.race-head select{width:100%;padding:.75rem;font:inherit}
.race-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.race-tabs [aria-current="true"]{background:var(--lime,#d2ed67);color:#14241c;border-color:transparent}
.race-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:start}
.race-content>.race-details{grid-column:1/-1}
.race-details{border:1px solid #71807755;border-radius:12px;padding:1rem}
.race-details summary{cursor:pointer;font-weight:650;padding:.25rem 0}
.race-details[open]>summary{margin-bottom:1rem}
.race-details .workspace-card{margin:.75rem 0}
.race-card canvas{width:180px;height:180px;max-width:100%;display:block;margin:1rem 0;image-rendering:pixelated}
.race-ready,.race-score{display:block;font-size:1.25rem}
.race-schedule-row{display:grid;gap:.3rem;border-bottom:1px solid #71807755;padding:.75rem 0}
.race-notice{padding:1rem 0;border-bottom:1px solid #71807755}
.race-notice.important{border-left:4px solid var(--lime,#d2ed67);padding-left:1rem}
.race-hub video{width:100%;max-width:420px}
.race-hub .preserve-lines{white-space:pre-wrap;overflow-wrap:anywhere}
.race-status{min-height:1.5em}
.race-hub button{white-space:normal}
@media(max-width:700px){.race-content{grid-template-columns:1fr}.race-tabs .button{flex:1;padding:.65rem .5rem}.race-head{align-items:stretch}.race-details{padding:.75rem}}
.topbar-tools{display:contents}
.topbar .account-menu-toggle{display:none}
@media(max-width:700px){
  .service-shell .topbar{position:relative;display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:12px;padding:8px 5%;min-height:60px}
  .service-shell .topbar .brand{font-size:21px;min-width:0;gap:8px}
  .service-shell .topbar .brand svg{width:26px;height:26px;flex-shrink:0}
  .service-shell .topbar .account-menu-toggle{display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;flex-shrink:0;border-radius:8px}
  .service-shell .topbar-tools{display:none}
  .service-shell .account-menu-open .topbar-tools{display:flex;flex-direction:column;align-items:stretch;gap:16px;position:absolute;top:calc(100% + 6px);right:5%;width:min(320px,90vw);max-height:calc(100dvh - 90px);overflow-y:auto;z-index:1000;padding:18px;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 30px #0004}
  .service-shell .topbar-tools .language-picker{margin:0;align-self:stretch}
  .service-shell .topbar-tools select{width:100%;font-size:16px;min-height:44px}
  .service-shell .topbar-tools .auth-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:0}
  .service-shell .topbar-tools .auth-actions .button{min-height:44px;width:100%;font-size:14px;padding:10px 12px}
}

.attendance-proposal{padding:16px;border:1px solid var(--line);border-left:3px solid var(--lime);border-radius:8px;background:var(--white)}.attendance-proposal p:last-child{margin-bottom:0}.attendance-search{min-width:0}.attendance-suggestions{display:grid;gap:8px;margin-top:8px}.attendance-suggestions .button{white-space:normal;text-align:left;min-height:44px}.attendance-search input{font-size:16px}

/* Keep nested service/access forms readable on narrow screens. */
.workspace-form .offering-editor,.workspace-form .offering-editor fieldset{display:flex;flex-direction:column;gap:14px;min-width:0;grid-column:1/-1}
.workspace-form .offering-editor>p{margin:0;line-height:1.5}
.workspace-form .offering-editor label{min-width:0;width:100%;box-sizing:border-box}
.workspace-form .offering-editor[hidden],.workspace-form .offering-editor [hidden]{display:none!important}

.community-panel{margin:1rem 0;padding:1rem}.community-panel>summary{font-weight:700;cursor:pointer}.community-card{border-top:1px solid #bcc9b6;padding:1rem 0;margin-top:1rem}.community-card label{display:block;margin:.65rem 0}.community-card input:not([type=checkbox]),.community-card textarea{display:block;width:100%;max-width:45rem;padding:.6rem}.community-card textarea{min-height:8rem}.community-card button{margin:.4rem .5rem .4rem 0}.community-card .plain-text{white-space:pre-wrap;overflow-wrap:anywhere}
.community-card label.community-consent{display:flex;align-items:flex-start;gap:.65rem}.community-consent input[type=checkbox]{display:inline-block;width:1.25rem;height:1.25rem;min-height:0;flex:0 0 1.25rem;margin:.15rem 0 0;accent-color:#c4f35b}
.suggestions-toggle{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:1150;border:1px solid #17231b;border-radius:999px;padding:14px 20px;background:#d4f36a;color:#17231b;font:700 15px system-ui;box-shadow:0 4px 20px #0003;cursor:pointer}
.suggestions-dialog{position:fixed;inset:auto max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) auto;margin:0;width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;border:1px solid #617064;border-radius:18px;padding:24px;background:var(--paper,#f6f7f3);color:var(--ink,#17231b);box-shadow:0 12px 50px #0004}
.suggestions-dialog::backdrop{background:#10201566}
.suggestions-close{float:right}
.suggestions-dialog form{display:grid;gap:12px;margin:24px 0}
.suggestions-dialog textarea{box-sizing:border-box;width:100%;resize:vertical;font:inherit;padding:12px}
.suggestions-dialog button{min-height:44px;cursor:pointer}
.suggestions-dialog button:disabled{cursor:wait;opacity:.65}
.suggestions-list article{border-top:1px solid #61706455;padding:18px 0;overflow-wrap:anywhere}
.suggestions-list p{white-space:pre-wrap}
.suggestions-toggle:focus-visible,.suggestions-dialog :focus-visible{outline:3px solid #428056;outline-offset:3px}
.crew-filters{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0;align-items:end}.crew-filters input,.crew-filters select{padding:12px;max-width:100%;box-sizing:border-box}.crew-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px}.crew-card{border:1px solid #ccd3c8;background:#fff;padding:20px;margin:16px 0;overflow-wrap:anywhere}.crew-card h3{font-size:1.5rem}.crew-card p{white-space:pre-wrap}.crew-map{height:340px;border-radius:12px;z-index:0;margin:20px 0}.crew-form{display:grid;gap:16px;margin:24px 0}.crew-form label{display:grid;gap:6px}.crew-form input,.crew-form textarea,.crew-form select{width:100%;box-sizing:border-box;padding:12px;font:inherit}.crew-form input[type=checkbox]{width:auto;justify-self:start}.crew-form textarea{min-height:100px}.crew-panel summary{font-size:1.3rem;font-weight:800;cursor:pointer}.crew-panel .button{margin:6px;white-space:normal}.crew-state{font-weight:800;border-left:4px solid #a7c344;padding:12px}.crew-pin{background:#17231b;color:#d4f66b;border:2px solid #d4f66b;border-radius:50%;text-align:center;font-size:20px;line-height:28px}.crew-places{display:flex;flex-wrap:wrap;gap:8px}@media(max-width:600px){.crew-filters>*{max-width:100%}.crew-filters input{width:100%}.crew-card .button{display:block;text-align:center}}

.crew-card{color:#17231b}.crew-form input,.crew-form textarea,.crew-form select{background:#fff;color:#17231b}

[data-crew-alert][hidden]{display:none}.crew-panel [data-crew-alert]:not([hidden]){background:#d4f66b;color:#17231b;border:2px solid #17231b}.crew-panel [role=status]:not(:empty){padding:12px;border-left:4px solid #d4f66b}
