/* Role-based finishing layer. Colours are supplied by the selected club preset. */
body,.layout,.workspace{background:var(--paper);color:var(--ink)}
.card,dialog,.auth,.topbar select,.field input,.field select,.field textarea{background:var(--surface);color:var(--ink)}
input,select,textarea{color:var(--ink);background:var(--surface);border-color:var(--theme-control-border,var(--line));accent-color:var(--theme-toggle-fill,var(--vh-accent))}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.9}
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible{outline-color:var(--theme-focus,var(--vh-focus))}
input:disabled,select:disabled,textarea:disabled,.btn:disabled{background:var(--theme-disabled-fill,var(--elevated));color:var(--theme-disabled-ink,var(--muted));opacity:1;transform:none}
.btn,.btn.light{background:var(--theme-secondary-fill,var(--vh-soft));color:var(--ink);border-color:var(--line)}
.btn:hover:not(:disabled),.btn.light:hover:not(:disabled){background:var(--theme-secondary-pressed,var(--elevated));color:var(--ink)}
.btn.primary{background:var(--theme-action-fill,var(--vh-accent));color:var(--theme-action-ink,var(--vh-accent-ink))}
.btn.primary:hover:not(:disabled),.btn.primary:active:not(:disabled){background:var(--theme-action-pressed,var(--vh-accent));color:var(--theme-action-pressed-ink,var(--vh-accent-ink))}
.btn.danger{background:var(--theme-danger-fill,var(--red-bg));color:var(--theme-danger,var(--red));border-color:transparent}
.btn.danger:hover:not(:disabled){background:var(--theme-danger-pressed,var(--red-bg));color:var(--theme-danger,var(--red))}
.card,.form-section,dialog,.topbar,.workspace-foot,table th,table td{border-color:var(--line)}
.pill{background:var(--elevated);color:var(--ink)}
.pill.green,.notice.green{background:var(--theme-success-fill,var(--green-bg));color:var(--theme-success,var(--green))}
.pill.red,.notice.red,.form-error{background:var(--theme-danger-fill,var(--red-bg));color:var(--theme-danger,var(--red))}
.pill.yellow,.notice,.notice.gold{background:var(--theme-warning-fill,var(--gold-bg));color:var(--theme-warning,var(--gold-ink))}
.context-dot{background:var(--theme-action,var(--olive))}.eyebrow,.vh-module-tile .vh-tile-icon{color:var(--theme-action,var(--olive))}
.bottom-nav{background:var(--surface);border-color:var(--line)}.bottom-nav button{color:var(--muted)}.bottom-nav button.active{background:var(--theme-action-fill,var(--vh-accent));color:var(--theme-action-ink,var(--vh-accent-ink))}
.sidebar{background:var(--theme-sidebar,var(--forest));color:var(--theme-sidebar-ink,#f4eff7);padding-top:24px}
.vh-sidebar-brand{display:flex;align-items:center;gap:12px;margin-bottom:22px;flex-shrink:0;min-width:0}
.sidebar .club-wordmark{font-size:19px;font-weight:750;line-height:1.25;text-align:left;letter-spacing:-.025em;color:var(--theme-sidebar-ink,#f4eff7);margin:0;hyphens:auto;overflow-wrap:anywhere;min-width:0}
.sidebar .logo-button{display:grid;place-items:center;width:48px;height:48px;min-height:0;padding:0;border-radius:10px;background:transparent;flex-shrink:0}
.sidebar .logo-button img{display:block;width:100%;height:100%;border-radius:inherit;object-fit:contain}
.sidebar .logo-button:empty{display:none}
.vh-sidebar-tools{display:grid;gap:8px;margin-bottom:20px}
.sidebar .vh-sidebar-tools .btn{width:100%;background:transparent;border:1px solid var(--theme-sidebar-muted,#c4b6cf);color:var(--theme-sidebar-ink,#f4eff7)}
.sidebar .vh-sidebar-tools .btn:hover{background:var(--theme-sidebar-active);color:var(--theme-sidebar-active-ink)}
.sidebar .nav button,.sidebar-foot button{color:var(--theme-sidebar-muted,#c4b6cf)}
.sidebar .nav button:hover{background:var(--theme-sidebar-active,var(--vh-soft));color:var(--theme-sidebar-active-ink,var(--ink))}
.sidebar .nav button.active{background:var(--theme-sidebar-active,var(--vh-accent));color:var(--theme-sidebar-active-ink,#fff)}
.vh-more-account{margin-top:32px;padding-top:24px;border-top:1px solid var(--line)}
.vh-theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:20px;margin-bottom:24px}
.vh-theme-card{display:block;padding:16px;background:var(--surface);color:var(--ink);border:2px solid var(--line);border-radius:20px;cursor:pointer;margin:0;min-width:0;font-weight:400}
.vh-theme-card:has(input:checked){border-color:var(--theme-action,var(--vh-accent));box-shadow:0 0 0 2px var(--theme-selection-fill,var(--vh-soft))}
.vh-theme-card:focus-within{outline:3px solid var(--theme-focus,var(--vh-focus));outline-offset:4px}
.vh-theme-card-heading{display:flex;align-items:center;gap:12px;font-size:18px;margin-bottom:12px}.vh-theme-card-heading input{width:20px;height:20px;margin:0;flex-shrink:0}
.vh-theme-card p{font-size:13px;color:var(--muted);margin-bottom:16px;min-height:42px}
.vh-theme-group,.vh-theme-inherit{margin-bottom:24px}.vh-theme-group h2{margin:0 0 10px}.vh-theme-inherit p{min-height:0;margin-bottom:0}
.vh-theme-mini{display:grid;grid-template-columns:27% 1fr;min-height:155px;border:1px solid var(--theme-line);border-radius:12px;overflow:hidden;background:var(--theme-background);color:var(--theme-ink)}
.vh-theme-mini-side{display:flex;flex-direction:column;gap:10px;padding:14px 8px;background:var(--theme-sidebar)}
.vh-theme-mini-side span{height:5px;border-radius:3px;background:var(--theme-sidebar-ink);margin-bottom:10px}.vh-theme-mini-side i{height:12px;background:var(--theme-sidebar-muted);border-radius:3px}.vh-theme-mini-side i:first-of-type{background:var(--theme-sidebar-active)}
.vh-theme-mini-main{padding:12px 9px}.vh-theme-mini-main small{display:block;font-size:9px;font-weight:500;color:var(--theme-secondary);margin-bottom:8px}.vh-theme-mini-main>strong{display:block;font-size:11px;color:var(--theme-ink);margin-bottom:12px}
.vh-theme-mini-tile{background:var(--theme-surface);border:1px solid var(--theme-line);padding:9px 6px;border-radius:8px}.vh-theme-mini-tile span{display:block;font-size:8px;line-height:1.3;font-weight:500;margin-bottom:9px;color:var(--theme-ink)}.vh-theme-mini-tile b{display:block;font-size:8px;padding:6px 3px;border-radius:5px;text-align:center;background:var(--theme-action-fill);color:var(--theme-action-ink)}
@media(max-width:600px){.vh-theme-card{padding:18px}.vh-theme-mini{min-height:145px}.vh-theme-grid{grid-template-columns:1fr}}
.quick-actions>button,.secondary-destinations>button,.view-switch [aria-pressed="true"],.calendar-view-switch button[aria-pressed="true"],.administration-switch button[aria-pressed="true"],.skip-link{background:var(--theme-action-fill,var(--vh-accent));color:var(--theme-action-ink,var(--vh-accent-ink))}
.secondary-destinations>button small{color:var(--theme-action-ink,var(--vh-accent-ink));opacity:1}
#toast{background:var(--theme-secondary-fill,var(--surface));color:var(--ink)}#toast.error{background:var(--theme-danger-fill,var(--red-bg));color:var(--theme-danger,var(--red))}
.poll-choice:has(input:checked){border-color:var(--theme-action,var(--olive));background:var(--theme-selection-fill,var(--vh-soft))}
.poll-winner,.poll-result-row.is-leader .poll-option-heading strong::after,.album-art{color:var(--theme-warning,var(--gold-ink))}
.poll-bar,.poll-bar::-webkit-progress-bar{background:var(--line)}
.btn:disabled,.btn.primary:disabled,.btn.danger:disabled,.sidebar .btn:disabled,.sidebar .nav button:disabled{background:var(--theme-disabled-fill,var(--elevated));color:var(--theme-disabled-ink,var(--muted));opacity:1;transform:none;cursor:not-allowed}
.vh-switch input:disabled+.vh-switch-track{opacity:.65}.vh-switch:has(input:disabled){color:var(--theme-disabled-ink,var(--muted));cursor:not-allowed}
.poll-choice input{accent-color:var(--theme-toggle-fill,var(--vh-accent))}
.month-day{border-color:var(--line)}.month-day[aria-pressed=true]{outline-color:var(--theme-focus,var(--vh-focus));background:var(--theme-selection-fill,var(--vh-soft));color:var(--ink)}

[data-theme] .next-event{background:linear-gradient(135deg,var(--surface) 35%,var(--theme-secondary-fill))}

.vh-auth-logo{display:block;object-fit:contain;border-radius:18px;margin-bottom:18px}

/* Kreide & Schiefer dark, from platform/theme-presets.json, before any session loads. */
:root[data-vh-auth]{
  color-scheme:dark;
  --theme-background:#141820;
  --paper:var(--theme-background);
  --theme-surface:#202734;
  --surface:var(--theme-surface);
  --theme-elevated:#303A4A;
  --elevated:var(--theme-elevated);
  --theme-ink:#F1F4F8;
  --ink:var(--theme-ink);
  --theme-secondary:#BDC8D8;
  --muted:var(--theme-secondary);
  --theme-line:#47556A;
  --line:var(--theme-line);
  --theme-control-border:#8C9DB6;
  --theme-action:#BECCE4;
  --olive:var(--theme-action);
  --theme-action-fill:#A2B4D0;
  --vh-accent:var(--theme-action-fill);
  --yellow:var(--theme-action-fill);
  --action-fill:var(--theme-action-fill);
  --theme-action-ink:#15243A;
  --vh-accent-ink:var(--theme-action-ink);
  --theme-action-pressed:#D3DEF1;
  --theme-action-pressed-ink:#15243A;
  --theme-secondary-fill:#2D3A4D;
  --vh-soft:var(--theme-secondary-fill);
  --theme-secondary-pressed:#3C4C64;
  --theme-selection-fill:#41536F;
  --theme-toggle-fill:#647B9B;
  --theme-sidebar:#1C2432;
  --forest:var(--theme-sidebar);
  --theme-sidebar-ink:#F1F4F8;
  --theme-sidebar-muted:#BDC8D8;
  --theme-sidebar-active:#465A78;
  --theme-sidebar-active-ink:#FFFFFF;
  --theme-disabled-fill:#28343B;
  --theme-disabled-ink:#98ACB6;
  --theme-success:#8AD5B1;
  --green:var(--theme-success);
  --theme-success-fill:#1C342C;
  --green-bg:var(--theme-success-fill);
  --theme-danger:#FFADB8;
  --red:var(--theme-danger);
  --theme-danger-fill:#3D242C;
  --red-bg:var(--theme-danger-fill);
  --theme-danger-pressed:#50303A;
  --theme-warning:#EDC274;
  --gold-ink:var(--theme-warning);
  --theme-warning-fill:#3A301E;
  --gold-bg:var(--theme-warning-fill);
  --theme-pending:#EDC274;
  --theme-pending-fill:#3A301E;
  --theme-info:#A5C9EF;
  --theme-info-fill:#203246;
  --theme-focus:#BECCE4;
  --vh-focus:var(--theme-focus);
}

@media(max-width:860px){
  .vh-sidebar-brand{gap:9px}
  .sidebar .club-wordmark{font-size:16px}
  .sidebar .logo-button{width:38px;height:38px}
}

.vh-theme-swatches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:12px}.vh-theme-swatches i{height:10px;border:1px solid var(--theme-line);border-radius:4px;background:var(--theme-elevated)}.vh-theme-swatches i:nth-child(2){background:var(--theme-selection-fill)}.vh-theme-swatches i:nth-child(3){background:var(--theme-sidebar)}.vh-theme-swatches i:nth-child(4){background:var(--theme-action-fill)}

.vh-theme-custom-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 24px;
  padding: 18px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
}
.vh-theme-custom-tile:hover, .vh-theme-custom-tile[data-active] { border-color: var(--theme-action); }
.vh-theme-custom-tile strong { display: block; font-size: 18px; }
.vh-theme-custom-tile small { display: block; margin-top: 4px; color: var(--muted); }
.vh-theme-custom-icon { color: var(--theme-action); }
.vh-theme-custom-icon svg { display: block; width: 25px; height: 25px; }

#modal:has(#vh-theme-custom-form) { width: min(860px, calc(100vw - 32px)); }
.vh-theme-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .62fr);
  gap: 22px;
  margin: 18px 0;
}
.vh-theme-editor-preview {
  display: grid;
  grid-template-columns: minmax(86px, 26%) minmax(0, 1fr);
  align-self: start;
  min-height: 230px;
  background: var(--theme-background);
  color: var(--theme-ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.vh-theme-preview-target {
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.vh-theme-preview-target:hover, .vh-theme-preview-target:focus-visible {
  outline: 2px dashed currentColor;
  outline-offset: -4px;
}
.vh-theme-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 8px;
  border-radius: 0;
  background: var(--theme-sidebar);
  color: var(--theme-sidebar-ink);
}
.vh-theme-editor-sidebar i {
  width: 100%;
  height: 9px;
  border-radius: 4px;
  background: currentColor;
  opacity: .32;
}
.vh-theme-editor-sidebar i:first-of-type { opacity: .64; }
.vh-theme-editor-main { display: grid; align-content: start; gap: 8px; padding: 12px; }
.vh-theme-editor-background { min-height: 40px; background: var(--theme-background); font-size: .8rem; }
.vh-theme-editor-ink { font-size: 1.1rem; font-weight: 750; }
.vh-theme-editor-card {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-line);
  border-radius: 10px;
}
.vh-theme-editor-surface { min-height: 42px; background: var(--theme-surface); }
.vh-theme-editor-action {
  min-height: 42px;
  background: var(--theme-action-fill);
  color: var(--theme-action-ink);
  text-align: center;
  font-weight: 700;
}
.vh-theme-editor-controls { min-width: 0; }
.vh-theme-editor-controls select { max-width: 100%; }
.vh-theme-colors { display: grid; gap: 2px; }
.vh-theme-colour-row:has([data-colour-code]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 38%);
  gap: 8px;
  align-items: center;
}
.vh-theme-colour-row [data-colour-code] {
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.vh-theme-colors label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.vh-theme-colors input[type=color] {
  width: 52px;
  height: 44px;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--theme-control-border, var(--line));
  border-radius: 8px;
  cursor: pointer;
}
@media (max-width: 620px) {
  .vh-theme-editor-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .vh-theme-editor-preview { min-height: 190px; }
}

.vh-right-row {
  gap: 16px;
}

.vh-right-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 0 1 30rem;
  min-width: 0;
}

.vh-right-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: center;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.vh-right-control svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.vh-right-allowed { color: var(--theme-success, var(--green)); background: var(--theme-success-fill, var(--green-bg)); }
.vh-right-conditional { color: var(--theme-info, var(--ink)); background: var(--theme-info-fill, var(--elevated)); }
.vh-right-denied { color: var(--theme-danger, var(--red)); background: var(--theme-danger-fill, var(--elevated)); }
.vh-right-apply { color: var(--theme-action-ink, white); background: var(--theme-action-fill, var(--ink)); cursor: pointer; }
.vh-right-apply:hover { color: var(--theme-action-pressed-ink, white); background: var(--theme-action-pressed, var(--ink)); }
.vh-right-apply:focus-visible { outline: 2px solid var(--theme-focus, var(--ink)); outline-offset: 2px; }

@media (max-width: 840px) {
  .row.vh-right-row { flex-direction: column; align-items: stretch; }
  .vh-right-controls { flex: auto; width: min(100%, 30rem); }
}

.row.vh-member-rights-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) repeat(3, minmax(0, 1.1fr));
  align-items: stretch;
  gap: .65rem;
}
.vh-member-rights-identity {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .6rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.vh-member-rights-identity .vh-member-admin-badge {
  background: var(--theme-action-fill, var(--vh-accent));
  color: var(--theme-action-ink, var(--vh-accent-ink));
  font-size: .8125rem;
  font-weight: 700;
}
.vh-member-rights-row > .btn { min-width: 0; margin: 0; white-space: normal; overflow-wrap: anywhere; }
.vh-invite-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .65rem; }
.vh-invite-actions > .btn { flex: 0 1 19rem; margin: 0; white-space: normal; }
.vh-family-profile-actions { display: grid; gap: .5rem; }
.vh-family-profile-actions > .btn { width: 100%; margin: 0; }
.vh-searchable-checklist { max-height: 16rem; overflow-y: auto; margin-top: .5rem; }
.vh-searchable-checklist label[hidden] { display: none; }
@media (max-width: 800px) {
  .row.vh-member-rights-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vh-member-rights-identity { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .row.vh-member-rights-row { grid-template-columns: minmax(0, 1fr); }
  .vh-invite-actions > .btn { flex-basis: 100%; }
}

.vh-match-calendar { touch-action: pan-y pinch-zoom; }

/* Permission templates and member rights */
.vh-permission-editor .vh-permission-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 12px 0 16px;
}
.vh-permission-editor .vh-permission-toolbar h2 { margin: 0; }
.vh-permission-editor .vh-permission-toolbar label {
  display: grid;
  gap: 4px;
  width: min(100%, 18rem);
  font-size: .875rem;
  font-weight: 600;
}
.vh-permission-editor fieldset[data-form-group] {
  min-width: 0;
  margin: 0 0 14px;
  padding: 8px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.vh-permission-editor fieldset[data-form-group][hidden] { display: none; }
.vh-permission-editor legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 700;
}
.vh-permission-editor .vh-permission-count {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--elevated);
  font-size: .75rem;
  font-weight: 600;
}
.vh-permission-editor .vh-permission-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .875rem;
}
.vh-permission-editor .vh-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 6px 12px;
}
.vh-permission-editor .vh-permission-grid > .field {
  min-width: 0;
  margin: 0;
}
.vh-permission-editor .vh-permission-grid .vh-switch {
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--elevated);
  overflow-wrap: anywhere;
}
