trenalio-theme-switch { display:inline-flex; flex:none; vertical-align:middle; }
trenalio-theme-switch .theme-toggle {
  display:grid; place-items:center; padding:0; width:44px; height:44px; min-height:44px;
  border-radius:50%; border:1px solid var(--line,#dfd7ef); background:#f6f2fd; color:#6847ac; cursor:pointer;
}
.theme-toggle svg { width:21px; height:21px; }
.theme-sun, [data-theme=dark] .theme-moon { display:none; }
[data-theme=dark] .theme-sun { display:inline; }
.welcome-account-tools,.club-account-tools,.login-heading {display:flex;align-items:center;gap:9px;}
.club-account-tools { margin-inline-start:auto; min-width:0; }
.auth-header trenalio-theme-switch { margin-inline-start:auto; margin-inline-end:12px; }
.account-card>trenalio-theme-switch,.legal-page main>trenalio-theme-switch {float:right;}
.header:has(.login-picker) {position:relative; z-index:5;}
.login-picker {position:relative;}
#login-options {
  position:absolute; right:0; top:calc(100% + 8px); width:max-content; max-width:calc(100vw - 32px);
  padding:6px; border:1px solid var(--line); background:white; border-radius:16px;
  box-shadow:0 12px 30px #20163626; text-align:left;
}
#login-options a {display:block; padding:12px 16px; color:var(--ink); font-size:15px; border-radius:10px;}
#login-options a:hover,#login-options a:focus-visible {background:#eee8ff;}
#login-options[hidden],#login-options a[hidden],.club-login [hidden] {display:none;}
.login-heading {justify-content:space-between;margin-bottom:30px;}
.login-heading .brand {margin:0;}
.club-login {font-family:'Segoe UI',Arial,sans-serif;}
.club-login h1 {margin-bottom:24px;text-align:left;}
#login-role {color:var(--muted);font-size:14px;font-weight:600;margin:0 0 8px;}
.club-login .check {display:flex;align-items:center;flex-direction:row;gap:10px;}
.club-login .check input {width:18px;height:18px;min-height:18px;flex:none;margin:0;}
.club-login .account-links {text-align:left;align-items:start;}
@media(max-width:620px){
  .header:has(.login-picker){gap:8px;}
  .welcome-account-tools{gap:6px;}
  .club-account-tools .profile-name strong {max-width:22vw;}
}
:root[data-theme=dark] {
  color-scheme:dark; --ink:#f3effa; --muted:#bcb4ce; --line:#494256; --purple:#c1a7ff; --red:#ffaaa4;
  --surface:#25212f; --raised:#302a3c; --field:#201c29; --accent-surface:#413153;
  background:#17151f; color:var(--ink);
}
[data-theme=dark] body,[data-theme=dark] body:has(.workspace) {
  color:var(--ink); background:radial-gradient(ellipse at 82% 0%,#39294c,transparent 53%),radial-gradient(ellipse at 6% 88%,#262438,transparent 50%),#17151f;
  background-attachment:fixed;
}
[data-theme=dark] :is(.workspace,.auth-rhythm) {background:transparent;color:var(--ink);}
[data-theme=dark] :is(.header,.strip,.app-preview,.beta-invite,.feature,.role-panel,.price-card,.documents,.faq>div:last-child,
 .tour-grid article,.competition-section,.security,.closing,.footer,.paper,.phone-frame,.role-tabs,.phone-screen,
 .sidebar,.panel,.stat,.training-card,.bottomnav,.profile-dropdown summary,.profile-options,.account-card,
 .cookie-banner,.legal-dialog,dialog,.help-topic,.tour-tip,.school-card,.hub-card,.weigh-card,.document-item,
 .sport-picker-list,.import-drop,.athlete-group-option,.group-attendance-table thead) {
  color:var(--ink); background:var(--surface); border-color:var(--line);
}
[data-theme=dark] #login-options {background:var(--surface);}
[data-theme=dark] #login-options a:is(:hover,:focus-visible) {background:var(--accent-surface);}
[data-theme=dark] :is(.topbar,.hub-header) {background:transparent;}
[data-theme=dark] :is(.feature.lavender,.price-card.featured,.role-tabs .active,.plan-label,.format-tags span,
 .tour-number,.week,.week span,.result-pills,.avatar,.notice,.account-result,.training-open,.tile,
 .role-panel .text-link,.sidebar .tournament-switch,.footer-beta,.success-bonus,.legal-draft,.mini-confirm,.account-emblem) {
  background:var(--accent-surface);color:#e3d5ff;border-color:#615073;
}
[data-theme=dark] :is(.phone-demo,.mobile-showcase,.hub-intro,.document-preview,.editor-exercise,.table th,
 .attendance-header,.document-item,.cookie-actions button,.badge,.calendar-date,.week .off,.button:not(.primary),
 dialog .close,.dialog-close,.auth-home,.help-topic,.school-card summary:hover,.attendance-choice,.sport-picker-list [role=option],.document-links button) {
  background:var(--raised);color:var(--ink);border-color:var(--line);
}
[data-theme=dark] :is(button, .button):not(.primary):not(.quiet):not(.text-link):not(.link):not(.theme-toggle) {border-color:var(--line);}
[data-theme=dark] button:where(:not(.primary,.text-link,.link,.quiet,.theme-toggle)) {background-color:var(--raised);color:var(--ink);}
[data-theme=dark] trenalio-theme-switch .theme-toggle {background:#322b3d;color:#f8d98d;border-color:#615570;}
[data-theme=dark] :is(input,select,textarea,.panel input,.panel select,.panel textarea,.auth-rhythm .auth-form input,.day-picker input) {
  color:var(--ink);background-color:var(--field);border-color:#625771;
}
[data-theme=dark] ::placeholder {color:#aaa0ba;}
[data-theme=dark] :is(.sub,.panel .sub,.lead,.micro,.header nav,.strip .wrap,.section-heading>p,.role-panel p,
 .feature p,.feature>small,.price-card>p,.security p,.security li,.documents p,.closing p,.tour-copy p,.fitness-entries span,
 .training-group,.training-coach,.training-time small,.training-info small,.training-members,.training-members small,
 .profile small,.profile-caption small,.topbar .location,.panel .sub,.day-picker,.auth-rhythm .auth-form label,.auth-rhythm .auth-form>.sub,
 .auth-rhythm .auth-form footer,.account-card .account-intro,.cookie-banner p,.legal-small,dialog p,dialog li,.footer-column a,.footer-column button,.footer-column h3,.sidebar nav a,.bottomnav a) {color:var(--muted);}
[data-theme=dark] :is(.text-link,.link,.cookie-banner a,.legal-dialog a,.legal-fields a,.legal-footer a,.legal-footer button,
 .legal-page a,dialog a,.account-links a,.profile-options a,.profile-options button,.fitness-entries .fitness-entry,.feature-icon,.brand-mark,.account-result a) {color:var(--purple);}
[data-theme=dark] :is(.cookie-banner h2,.footer .brand,.auth-rhythm .auth-story h1,.auth-rhythm .auth-form h1,.club-login h1) {color:var(--ink);}
[data-theme=dark] :is(.training-card.selected,.training-card:hover,.sidebar nav a.active,.sidebar nav a:hover,.bottomnav a.active,
 .receipt-method label:has(input:checked),.athlete-group-option:has(input:checked),.sport-picker-list [aria-selected=true],.profile-options a:hover,.profile-options button:hover,
 .header nav a:hover,.role-tabs button.active,.session.active) {color:#e3d5ff;background:var(--accent-surface);border-color:#74628c;}
[data-theme=dark] :is(.badge.green,.present,.attendance-choice.selected.present,.tile.mint,.visited,.weigh-passed) {color:#b1edce;background:#254638;}
[data-theme=dark] :is(.badge.red,.notice.error,.error,.danger,.absent,.attendance-choice.selected.absent) {color:#ffc2c9;background:#492b37;}
[data-theme=dark] :is(.badge.amber,.tile.coral,.attendance-choice.selected.excused) {color:#ffd99f;background:#4b3827;}
[data-theme=dark] :is(.table td,.table th,.row,.profile-caption,.group-attendance-table td) {border-color:var(--line);}
[data-theme=dark] :is(.brand,.person strong,.profile-options strong) {color:var(--ink);}
[data-theme=dark] dialog::backdrop {background:#09080eb3;}
@media print { :root[data-theme=dark] {color-scheme:light;} }

[data-theme=dark] :is(.beta-invite p,.beta-invite small,.local-manual footer span,.local-manual li,.auth-rhythm .auth-story p) {color:var(--muted);}
[data-theme=dark] :is(.beta-invite-label) {color:var(--purple);}
[data-theme=dark] :is(.mobile-chips span,.calendar-week,.local-manual select,.local-manual button,.week .off,.auth-pills span) {background:var(--raised);border-color:var(--line);color:var(--ink);}
[data-theme=dark] :is(.calendar-day,.calendar-blank,.mobile-showcase,.local-guide-entry) {border-color:var(--line);}
[data-theme=dark] :is(.calendar-day.is-today,.import-options,.auth-rhythm .auth-form input[readonly]) {background:var(--raised);}
[data-theme=dark] .auth-rhythm .auth-story {background-image:linear-gradient(110deg,#21162cf0,#20192c99),url('/assets/auth-rhythm.png');}
[data-theme=dark] button.primary,[data-theme=dark] .button.primary {background:linear-gradient(115deg,#7551c9,#633da9);color:white;}
[data-theme=dark] .club-login .account-links {color:var(--muted);}
.club-login .account-links p {margin:0;}
[data-theme=dark] .cookie-banner button {background:var(--raised);color:var(--ink);}
@media(max-width:760px) {
  .header:has(.login-picker) {display:grid;grid-template-columns:minmax(0,1fr) auto;}
  .header:has(.login-picker) nav {grid-column:1/-1; grid-row:2;}
  .login-picker .button.small {min-height:44px;padding:10px 14px;}
}

/* Calendar event tints remain tied to the group; foreground follows the theme. */
[data-theme=dark] .calendar-event {--calendar-event-ink:#f4efff;color:#f4efff;background:#352d48;}
[data-theme=dark] .calendar-event :is(strong,small) {color:inherit;}
[data-theme=dark] .calendar-event.competition {color:#bbf3db;background:#234137;}
[data-theme=dark] .calendar-event.event {color:#ffe1ad;background:#453827;}
[data-theme=dark] .category-button span {background:#514064;color:#fff;font-weight:700;}
.application-intake {box-sizing:border-box;}
.application-intake .intake-methods {display:flex;gap:10px;margin:20px 0;flex-wrap:wrap;}
.application-intake .intake-methods button {flex:1;min-width:180px;}
.application-intake .intake-methods button[aria-pressed=true] {border-color:#805ce2;background:#eee7ff;color:#5934aa;}
.application-intake .intake-upload {padding:18px;border:1px dashed var(--line,#d9d0ee);border-radius:14px;margin:16px 0;}
.application-intake .intake-confirm {display:flex;flex-direction:row;align-items:flex-start;gap:12px;margin:22px 0;padding:16px;border:1px solid var(--line,#ddd4f1);border-radius:14px;line-height:1.5;cursor:pointer;}
.application-intake .intake-confirm input[type=checkbox] {width:20px;height:20px;min-height:20px;min-width:20px;flex:0 0 20px;margin:2px 0 0;padding:0;accent-color:#7950d8;box-shadow:none;}
.application-intake [data-add] {width:auto;}
.application-intake [data-submit] {margin-top:4px;}
.application-intake [data-error]:empty,.application-intake [data-source]:empty {display:none;}
[data-theme=dark] .application-intake .intake-methods button[aria-pressed=true] {background:#49365f;color:#f5eaff;border-color:#aa89e5;}


.tournament-summary > .badge {display:inline-block;margin-bottom:12px;}
.tournament-summary > .badge[data-status="open"] {background:#e0f4e8;color:#205d3d;}
[data-theme=dark] .tournament-summary > .badge[data-status="open"] {background:#233e33;color:#aeebc7;}

.application-intake .intake-participant {margin:12px 0;padding:14px 16px;border-radius:14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;}
.application-intake .intake-external {grid-template-columns:repeat(3,minmax(0,1fr));}
.application-intake .intake-fields {display:contents;}
.application-intake .intake-participant label {display:flex;flex-direction:column;gap:5px;min-width:0;margin:0;line-height:1.4;}
.application-intake .intake-participant :is(input,select) {box-sizing:border-box;width:100%;max-width:100%;min-width:0;margin:0;}
.application-intake .intake-external .intake-fields>label:first-child,.application-intake .intake-external>label {grid-column:span 2;}
.application-intake .intake-participant>p,.application-intake .intake-row-heading {grid-column:1/-1;margin:0;}
.application-intake .intake-row-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;}
.application-intake .intake-row-heading button {margin:0;}
@media(max-width:760px){.application-intake .intake-external {grid-template-columns:repeat(2,minmax(0,1fr));}.application-intake .intake-external .intake-fields>label:first-child {grid-column:auto;}}
@media(max-width:540px){.application-intake .intake-participant {grid-template-columns:minmax(0,1fr);padding:12px;gap:10px;}.application-intake .intake-external>label {grid-column:auto;}}


.application-intake [hidden]{display:none!important;}

[data-theme=dark] .hub-note,
[data-theme=dark] .category-modal .hub-note {color:var(--muted);background:transparent}
[data-theme=dark] :is(.hub,.category-modal) .table-wrap {background:var(--surface);color:var(--ink)}
[data-theme=dark] :is(.hub,.category-modal) table :is(th,td) {border-color:var(--line);background:var(--surface);color:var(--ink)}
[data-theme=dark] :is(.hub,.category-modal) table th,
[data-theme=dark] .stage-stats span {background:var(--raised);color:var(--ink)}
[data-theme=dark] .legal-footer button {background:transparent;color:var(--purple)}
@media(max-width:760px) {
  body:has(.workspace),[data-theme=dark] body:has(.workspace) {background-size:100% 100%;background-attachment:scroll;background-repeat:no-repeat}
  body:has(.more-menu) .workspace {min-height:auto;padding-bottom:0}
}

.application-intake [data-rows] {
  --participant-odd: #f7f4fc;
  --participant-even: #f2f7fa;
}
[data-theme=dark] .application-intake [data-rows] {
  --participant-odd: #2e2838;
  --participant-even: #262e38;
}
.application-intake [data-rows] > .intake-participant:nth-child(odd) {background-color:var(--participant-odd)}
.application-intake [data-rows] > .intake-participant:nth-child(even) {background-color:var(--participant-even)}
