/* GAMUVO sports tools. Reuse the dashboard palette around the native playing surfaces. */
body:is(.td-pilot,.td-standalone) {
  --sport-warning: #93370d;
  --sport-warning-bg: #fffaeb;
  --sport-action: #465fff;
}
html[data-theme=dark] body:is(.td-pilot,.td-standalone) {
  --sport-warning: #fec84b;
  --sport-warning-bg: #382f20;
}

/* Scouting, saved clips and assigned studies are routes of the same native player. */
body.td-pilot :is(#video-view,.vs-dialog) {
  --vs-bg: var(--td-bg);
  --vs-card: var(--td-panel);
  --vs-line: var(--td-line);
  --vs-border: var(--td-field);
  --vs-text: var(--td-ink);
  --vs-muted: var(--td-mute);
  --vs-accent: var(--td-accent);
  font-family: var(--td-font);
  color: var(--td-ink);
}
body.td-pilot #video-view {
  min-width: 0;
  width: 100%;
  min-height: 0;
  background: var(--td-bg);
  margin: 0 auto;
  border-radius: 16px;
}
body.td-pilot #video-view .vs-studio { background: var(--td-bg); color: var(--td-ink); }
body.td-pilot #video-view :is(.vs-heading,.vs-study-heading h1,.vs-personal-intro h1,.vs-studio-title h2,.vs-study-player-context h1) {
  color: var(--td-ink);
  font: 600 clamp(20px,2.1vw,29px)/1.22 var(--td-font);
  letter-spacing: -.035em;
  text-transform: none;
  overflow-wrap: anywhere;
}
body.td-pilot #video-view :is(.vs-shelf-head h2,.vs-personal-library h2,.vs-study-page h2,.vs-editor-panel h3,.vs-edit-head h3,.vs-section-head h3) {
  color: var(--td-ink);
  font: 600 18px/1.4 var(--td-font);
  letter-spacing: -.025em;
}
body.td-pilot #video-view :is(.vs-top,.vs-studio-head,.vs-study-player-bar,.vs-shelf-head,.vs-library,.vs-personal-library,.vs-study-page) {
  color: var(--td-ink);
}
body.td-pilot #video-view .vs-catalog-head {
  background: #182230;
  border-radius: 16px;
}
body.td-pilot #video-view .vs-catalog-head .vs-top {
  background: var(--td-panel);
  border-bottom: 1px solid var(--td-line);
}
body.td-pilot #video-view .vs-tabs button { color: var(--td-mute); }
body.td-pilot #video-view .vs-tabs button:is(.active,[aria-selected=true],[aria-pressed=true]) { color: var(--td-accent); border-color: var(--td-brand); }
body.td-pilot #video-view .vs-catalog-head .vs-hero:after {
  background: linear-gradient(90deg,rgb(12 22 38 / 92%),rgb(12 22 38 / 70%) 43%,rgb(12 22 38 / 18%)),
              linear-gradient(0deg,rgb(12 22 38 / 69%),transparent 48%);
}
body.td-pilot #video-view .vs-catalog-head .vs-hero h1 {
  color: white;
  font: 650 clamp(30px,3.6vw,56px)/1.05 var(--td-font);
  letter-spacing: -.045em;
  text-transform: none;
}
body.td-pilot #video-view .vs-hero-content :is(.vs-eyebrow,.vs-hero-meta,p) { color: #e4e7ec; }
body.td-pilot #video-view .vs-library { margin-top: 0; padding-top: 22px; }
body.td-pilot #video-view :is(.vs-card,.vs-favorite-card,.vs-playlist,.vs-study-card,.vs-study-page,.vs-study-instructions,
  .vs-inline-playbook,.vs-metric,.vs-insight-card,.vs-formation-card,.vs-edit-dock,.vs-editor,.vs-editor-panel,.vs-side,
  .vs-studio-head,.vs-study-player-bar,.vs-view-options,.vs-source-picker,.vs-quick,.vs-breakdown,.vs-quick-group,
  .vd-panel,.vd-inspector,.vd-rail,.vd-review-note) {
  background: var(--td-panel);
  color: var(--td-ink);
  border-color: var(--td-line);
}
body.td-pilot #video-view :is(.vs-card,.vs-favorite-card,.vs-study-page,.vs-side,.vs-edit-dock,.vs-inline-playbook,.vs-breakdown) {
  border: 1px solid var(--td-line);
  border-radius: 16px;
  box-shadow: var(--td-shadow);
}
body.td-pilot #video-view :is(.vs-card-copy,.vs-card-copy strong,.vs-study-card strong,.vs-play-main,.vs-person-cell,.vs-schema-clip) { color: var(--td-ink); }
body.td-pilot #video-view :is(.vs-personal-intro p,.vs-study-instructions p,.vs-card-copy small,.vs-studio-title small,
  .vs-study-card small,.vs-study-card span,.vs-list-summary,.vs-quick-hint,.vs-source-help,.vs-frame-change-options label,.vs-recapture-bounds,
  .vd-stage-caption,.vd-hint,.vs-no-data,.vs-empty) { color: var(--td-mute); }
body.td-pilot #video-view :is(.vs-note-options,.vs-column-picker,.vs-volume-popover,.vs-settings-popover) {
  background: var(--td-panel); border: 1px solid var(--td-field); color: var(--td-ink);
  border-radius: 12px; box-shadow: var(--td-menu-shadow);
}
body.td-pilot #video-view :is(.vs-view-switch,.vs-side-tabs,.vs-filter-row,.vs-dock-head,.vs-dock-section-head,
  .vs-quick-head,.vs-frame-change-options,.vs-insight-tabs,.vs-play-strip,.vs-list-summary,.vs-study-ordered>li,
  .vd-note-bar,.vd-panel-head,.vd-rail-head,.vs-inline-playbook-head,.vs-inline-playbook-controls) {
  background: var(--td-subtle); color: var(--td-copy); border-color: var(--td-line);
}
body.td-pilot #video-view :is(.vs-play-row,.vs-note,.vs-field-workbench,.vs-quick-more,.vd-form-pair,.vs-dock-notes,.vs-dock-classification) {
  color: var(--td-copy); border-color: var(--td-line);
}
body.td-pilot #video-view :is(.vs-play-row,.vs-note,.vs-dock-notes,.vs-dock-classification) { background: var(--td-panel); }
body.td-pilot :is(#video-view,.vs-dialog) :is(.vs-btn,.vs-study-back,.vs-study-actions button,.vs-study-dialog-action,
  .vs-dict-filters button,.vs-dock-head button,.vs-source-actions button,.vs-filter-row button,.vs-quick-footer button) {
  background: var(--td-panel); color: var(--td-copy); border: 1px solid var(--td-field);
  border-radius: 8px; box-shadow: var(--td-shadow); font-family: inherit; font-weight: 500;
}
body.td-pilot :is(#video-view,.vs-dialog) :is(.vs-btn.primary,.vs-btn[data-primary],.vs-study-dialog-action.primary,.vd-note-bar .vd-save) {
  background: var(--sport-action); border-color: var(--sport-action); color: white; font-weight: 600;
}
body.td-pilot :is(#video-view,.vs-dialog) :is(.vs-btn.danger,.vd-note-bar .vd-delete,.vs-note-delete,.vs-dict-archive) {
  background: var(--td-panel); color: var(--td-error); border-color: var(--td-field);
}
body.td-pilot #video-view :is(.vs-view-switch,.vs-side-tabs,.vs-insight-tabs) button { background: transparent; color: var(--td-copy); }
body.td-pilot #video-view :is(.vs-view-switch,.vs-side-tabs,.vs-insight-tabs) button:is(.active,[aria-pressed=true],[aria-selected=true]) {
  background: var(--td-tint); color: var(--td-accent); box-shadow: inset 0 0 0 1px var(--td-brand);
}
body.td-pilot #video-view .vs-note-badge { background: var(--sport-warning-bg); color: var(--sport-warning); border-color: currentColor; }
body.td-pilot #video-view .vs-breakdown-table :is(th,td) { border-color: var(--td-line); color: var(--td-copy); }
body.td-pilot #video-view .vs-breakdown-table th { background: var(--td-subtle); color: var(--td-mute); }
body.td-pilot #video-view .vs-breakdown-table { --vs-check-column: 36px; }
body.td-pilot #video-view .vs-breakdown-table .vs-check-cell {
  box-sizing: border-box;
  width: var(--vs-check-column);
  min-width: var(--vs-check-column);
  max-width: var(--vs-check-column);
  padding-inline: 4px;
}
body.td-pilot #video-view .vs-breakdown-table :is(th, td):nth-child(2) { left: var(--vs-check-column); }
body.td-pilot #video-view :is(.vs-study-card,.vs-favorite-card,.vs-card):where(:hover,:focus-within) { border-color: var(--td-brand); }
body.td-pilot #video-view .vs-clip-timeline.is-docked {
  --cut-panel: var(--td-panel); --cut-track: var(--td-bg); --cut-raised: var(--td-subtle); --cut-border: var(--td-field);
  --cut-ink: var(--td-ink); --cut-muted: var(--td-mute);
}
body.td-pilot #video-view .is-staff-editor .vs-timeline-workbench .vs-clip-timeline.is-docked {
  background: var(--td-panel); color: var(--td-ink); border-color: var(--td-field);
}
body.td-pilot .vs-dialog {
  --dict-bg: var(--td-bg); --dict-panel: var(--td-panel); --dict-input: var(--td-panel); --dict-line: var(--td-field);
  --dict-text: var(--td-ink); --dict-muted: var(--td-mute); --dict-accent: var(--td-accent);
  background: var(--td-panel); border: 1px solid var(--td-line); border-radius: 16px;
  box-shadow: var(--td-menu-shadow);
}
body.td-pilot .vs-dialog :is(h2,h3,legend,label,strong) { color: var(--td-ink); font-family: inherit; }
body.td-pilot .vs-dialog :is(p,small,.vs-field>span,.vs-study-form label) { color: var(--td-copy); }
body.td-pilot .vs-dialog :is(.vs-study-person,.vs-study-roster,.vs-study-share,.vs-ai-confirm,.vs-ai-candidate,.vs-playlist) {
  border-color: var(--td-line); background: var(--td-subtle); color: var(--td-copy);
}
body.td-pilot .vs-dialog :is(input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=color]),select,textarea) {
  padding: 9px 12px; min-height: 40px; max-width: 100%; border: 1px solid var(--td-field);
  border-radius: 8px; background: var(--td-panel); color: var(--td-ink); font: inherit;
}
body.td-pilot #video-view :is(.vs-cut-surface,.vs-media,.vd-onvideo-tools,.vs-player-controls) {
  /* Drawing marks, the video crop and transport icons keep the contrast of the original player. */
  color-scheme: dark;
}
body.td-pilot #main-content #video-view .vs-player-controls :is(.vs-btn,button) {
  color: #f2f4f7; background: #1d2939; border-color: #475467;
}
body.td-pilot #main-content #video-view .vs-player-controls [data-vs=toggle-play] {
  color: white; background: var(--sport-action); border-color: var(--sport-action);
}
body.td-pilot #main-content #video-view .vs-player-controls #vs-speed {
  max-width: 62px; height: 34px!important; min-height: 34px; padding: 3px 5px!important; text-align: center;
}
body.td-pilot #video-view :is(.vs-form-error,.vd-error,.vs-ai-error,.vs-cut-error) { color: var(--td-error); }

/* Playbook document chrome. The tactical board, role signs and wristband colour codes own their colours. */
body.td-pilot :is(#playbook-view,.pb-page,.pb-source-dialog,.pb-help-dialog,.pb-board-dialog,.pb-edit-confirm) {
  --pb-blue: var(--td-brand); --pb-blue-solid: var(--sport-action); --pb-surface: var(--td-panel);
  --pb-line: var(--td-line); --pb-text: var(--td-ink); --pb-muted: var(--td-mute);
  font-family: var(--td-font); color: var(--td-ink);
}
body.td-pilot :is(.pb-page,.pb-source-dialog) :is(.pb-assignment-panel,.pb-board-card,.pb-rules,.pb-signal-panel,.pb-source-note,
  .pb-annotations,.pb-contact-note,.pb-edit-header,.pb-edit-footer) {
  border-color: var(--td-line); background: var(--td-panel); color: var(--td-ink); border-radius: 14px;
}
body.td-pilot :is(.pb-board-toolbar,.pb-playback-top,.pb-edit-actions,.pb-detail-top,.pb-role-heading,.pb-role-title) {
  border-color: var(--td-line); color: var(--td-copy);
}
body.td-pilot .pb-page :is(.pb-title-row h1,.pb-title-row h2) {
  font: 600 clamp(23px,2.6vw,34px)/1.18 var(--td-font); letter-spacing: -.03em; color: var(--td-ink);
}
body.td-pilot #pb-library .pb-filterbar {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(11rem,32%); align-items: end;
}
body.td-pilot #pb-library :is(.pb-search-field,.pb-system-label) {
  display: grid; grid-template-columns: minmax(0,1fr); align-content: end; gap: 6px;
  min-inline-size: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
}
body.td-pilot #pb-library .pb-filter-caption {
  margin: 0; color: var(--td-copy); font: 500 13px/18px var(--td-font);
}
body.td-pilot #pb-library .pb-search {
  display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 8px;
  min-inline-size: 0; min-height: 44px; padding-inline: 12px; border: 1px solid var(--td-field);
  border-radius: 10px; background: var(--td-panel); box-shadow: var(--td-shadow);
}
body.td-pilot #pb-library .pb-search > svg { position: static; width: 18px; height: 18px; pointer-events: none; }
body.td-pilot #pb-library .pb-search:focus-within { border-color: var(--td-accent); box-shadow: var(--td-ring); }
body.td-pilot #main-content #pb-library #pb-search {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 0!important; height: 42px!important;
  padding: 0!important; border: 0!important; border-radius: 0!important;
  outline: 0!important; background: transparent!important; box-shadow: none!important;
}
body.td-pilot #pb-library .pb-system-label > :is(select,.td-select-host) { min-width: 0; width: 100%; }
@media (max-width: 768px) {
  body.td-pilot #playbook-view .pb-heading:has(#drawing-new) {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 8px 12px;
  }
  body.td-pilot #playbook-view .pb-heading:has(#drawing-new) > div:first-child { grid-area: 1 / 1; min-width: 0; }
  body.td-pilot #playbook-view .pb-header-tools:has(> #drawing-new) { display: contents; }
  body.td-pilot #playbook-view .pb-header-tools:has(> #drawing-new) > .starter-guide-tools { grid-area: 1 / 2; }
  body.td-pilot #playbook-view #drawing-new { grid-area: 2 / 1 / 3 / -1; justify-self: start; min-height: 44px; margin: 0; }
  body.td-pilot #pb-library .pb-filterbar {
    grid-template-columns: minmax(0,1fr); gap: 14px!important; padding: 0!important;
    border: 0!important; background: transparent!important;
  }
  body.td-pilot #main-content #pb-library :is(#pb-search,.td-select-trigger) { font-size: 16px!important; }
}
body.td-pilot .pb-page :is(.pb-camera-controls,.pb-mode,.pb-transport,.pb-phases) button:not(.pb-play-button):not([aria-pressed=true]) {
  border-color: var(--td-field); color: var(--td-copy); background: var(--td-panel); border-radius: 8px;
}
body.td-pilot .pb-page :is(.pb-back,.pb-icon-button,.pb-help-button,.pb-more>button) {
  color: var(--td-copy); border-color: var(--td-field); background: var(--td-panel);
}
body.td-pilot :is(.pb-source-dialog,.pb-help-dialog,.pb-edit-confirm) {
  border: 1px solid var(--td-line); border-radius: 16px; background: var(--td-panel); box-shadow: var(--td-menu-shadow);
}

/* Football and the other sport editors share this frame; pitch geometry and embedded drawings remain native. */
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app {
  --fb-bg: var(--td-bg); --fb-panel: var(--td-panel); --fb-surface: var(--td-subtle); --fb-line: var(--td-line);
  --fb-ink: var(--td-ink); --fb-muted: var(--td-mute);
  color-scheme: inherit; color: var(--td-ink); font-family: var(--td-font);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-header,.fb-documentbar,.fb-blockbar,.fb-sequence,.fb-phases,
  .fb-sequence-list,.fb-setup-group,.fb-playbook-category) {
  background: transparent;
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-tools,.fb-stage,.fb-stage>.fb-fieldbar,
  .fb-inspector,.fb-inspector-tabs,.fb-mobile-header,.fb-mobile-tools,.fb-focusbar,
  .fb-player-menu,.fb-player-picker,.fb-playbar,.fb-dialog-heading,.fb-dialog-body,.fb-dialog-actions,.fb-more-tools) {
  background: var(--td-panel); color: var(--td-ink); border-color: var(--td-line);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-segments,.fb-block-card,
  .fb-menu-list button,.fb-library-card,.fb-menu-navigation,.fb-visibilitybar) {
  background: var(--td-subtle); color: var(--td-copy); border-color: var(--td-line);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-dialog,.fb-player-menu,.fb-more-tools,.fb-player-picker) {
  background: var(--td-panel); border: 1px solid var(--td-line); border-radius: 14px; color: var(--td-ink); box-shadow: var(--td-menu-shadow);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-title-input,.fb-label,.fb-help,.fb-kicker,.fb-save-status,.fb-tool-hint,.fb-mobile-hint) {
  color: var(--td-copy); font-family: inherit;
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-tools,.fb-header-actions,.fb-inspector-tabs,.fb-segments,.fb-more-grid,.fb-menu-list,.fb-playbar,.fb-mobile-tools) button {
  border-color: var(--td-line); color: var(--td-copy); border-radius: 8px;
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-tools,.fb-header-actions,.fb-inspector-tabs,.fb-segments,.fb-menu-list,.fb-mobile-tools) button:hover:not(:disabled) {
  background: var(--td-tint); border-color: var(--td-brand); color: var(--td-accent);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-tools,.fb-inspector-tabs,.fb-segments,.fb-menu-list,.fb-mobile-tools)
  button:is([aria-pressed=true],[aria-selected=true],.is-active) {
  border-color: var(--td-brand); background: var(--td-tint); color: var(--td-accent);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-primary,.fb-save-button,.fb-play) {
  border-color: var(--sport-action); color: white; background: var(--sport-action);
}
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-danger,.fb-alert.is-error,.fb-save-status.is-error) { color: var(--td-error); }
body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-label input,.fb-label select,.fb-label textarea,.fb-library-toolbar input) {
  background: var(--td-panel); color: var(--td-ink); border-color: var(--td-field); border-radius: 8px;
}
/* Keep the sticky controls opaque over scrolling models and leave the pitch artwork intact. */
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-setup-footer,.fb-resume,.fb-canvas-caption,
  .fb-event-row,.fb-phase,.fb-formation-options > button,.fb-template-grid > button,.fb-route-grid > button:not(.fb-free-route)) {
  background-color: var(--td-bg);
}
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app input.fb-title-input:not([type=checkbox]):not([type=range]) {
  background: var(--td-panel); color: var(--td-ink); border-color: var(--td-field); padding-inline: 12px;
}
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app :is(.fb-resume,.fb-formation-options > button,.fb-template-grid > button):hover {
  background-color: var(--td-subtle);
}
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app [data-team] .fb-formation-options > button[aria-pressed=true] {
  background-color: color-mix(in srgb,var(--fb-team) 12%,var(--td-bg));
}
html[data-theme] body:is(.td-pilot,.td-standalone) .fb-app .fb-phase[aria-pressed=true] {
  background-color: var(--td-tint);
}

/* The staff programme has its own document and stylesheets. */
body.td-standalone:has(#workspace) {
  --bg: var(--td-bg); --panel: var(--td-panel); --soft: var(--td-subtle); --ink: var(--td-ink);
  --muted: var(--td-mute); --line: var(--td-line); --body: var(--td-font);
  background: var(--td-bg); color: var(--td-ink); font: 400 14px/1.5 var(--body);
}

/* Both Staff entry points show their own access result inside the same panel. */
.td-standalone #login-panel {
  width: min(100%, 440px);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--td-line);
  border-radius: 16px;
  background: var(--td-panel);
  color: var(--td-ink);
  box-shadow: var(--td-shadow);
}
.td-standalone #login-panel .login-card {
  margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
}
.td-standalone #login-panel:has(#login-form[hidden]) :is(.login-emblem, #login-title, .login-motto, .login-assurance),
.td-standalone #login-panel:has(#login-form:not([hidden])) .td-staff-gate-title { display: none; }
.td-standalone #login-panel h1 {
  margin: 0; color: var(--td-ink); font: 600 24px/1.3 var(--td-font); letter-spacing: -.025em;
}
.td-standalone #login-panel #login-status {
  margin: 12px 0; color: var(--td-copy); font: 400 15px/1.5 var(--td-font); overflow-wrap: anywhere;
}
.td-standalone #login-panel :is(.login-motto, .login-assurance, .login-card label) { color: var(--td-mute); }
.td-standalone #login-panel #login-status.is-error { color: var(--td-error); }
.td-standalone #login-panel .login-return {
  min-height: 44px; margin: 0; padding: 8px 14px; border: 1px solid var(--td-field); border-radius: 8px;
  color: var(--td-accent); font: 500 14px/1.4 var(--td-font);
}
.td-standalone #login-panel .login-return:hover { background: var(--td-tint); }
.td-standalone #login-panel .login-password { background: var(--td-panel); border-color: var(--td-field); }
.td-standalone #login-panel .login-password:focus-within { border-color: var(--td-brand); box-shadow: var(--td-ring); }
.td-standalone #login-panel .login-password input { color: var(--td-ink); }
.td-standalone #login-panel :is(.login-lock, #toggle-password),
.td-standalone #login-panel .login-password input::placeholder { color: var(--td-mute); }
.td-standalone #login-panel .login-submit {
  border-color: var(--sport-action); border-radius: 8px; background: var(--sport-action); color: white; box-shadow: none;
}
.td-standalone #login-panel :is(a, button):focus-visible { outline: 2px solid var(--td-brand); outline-offset: 2px; }

.td-standalone #staff-topbar { background: var(--td-panel); border-color: var(--td-line); color: var(--td-copy); }
.td-standalone #staff-topbar .icon-action { background: var(--td-panel); color: var(--td-copy); border-color: var(--td-field); }
.td-standalone #staff-topbar .icon-action:hover { background: var(--td-tint); color: var(--td-accent); border-color: var(--td-brand); }
.td-standalone #staff-topbar :is(.staff-mobile-profile,.em-bell) { display: none; }
@media (max-width: 1023px) {
  .td-standalone #staff-topbar .brand { min-width: 0; }
  .td-standalone #staff-topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .td-standalone #staff-topbar .top-actions { flex: none; }
  .td-standalone #staff-topbar :is(.staff-mobile-profile,.em-bell) {
    display: inline-grid; place-items: center; position: relative; border-radius: 50%;
  }
  .td-standalone #staff-topbar .staff-mobile-profile + a[aria-label="Apri il gestionale"] { display: none; }
  .td-standalone #staff-topbar .em-bell .em-count:not([hidden]) {
    position: absolute; top: -2px; right: -2px; min-width: 17px; padding: 0 3px; line-height: 16px;
    background: var(--td-error); color: white; border: 1px solid var(--td-panel); border-radius: 16px; font-size: 10px;
  }
}
body.td-standalone .em-notifications {
  --em-surface: var(--td-panel); --em-ink: var(--td-ink); --em-line: var(--td-line); --em-muted: var(--td-mute);
  --em-accent: var(--td-accent); --em-input: var(--td-subtle);
  color: var(--td-ink); background: var(--td-panel); border-color: var(--td-line); font-family: var(--td-font);
}
html:not([data-theme=dark]) .td-standalone #staff-topbar img[src$="/gamuvo-still.png"] { filter: brightness(0); }
.td-standalone #workspace :is(h1,h2,h3,.eyebrow,label) { font-family: var(--td-font); }
.td-standalone #workspace h1 { color: var(--td-ink); font-size: clamp(24px,2.7vw,34px); line-height: 1.17; letter-spacing: -.035em; }
.td-standalone #workspace h2 { color: var(--td-ink); font-size: clamp(19px,1.8vw,24px); line-height: 1.26; letter-spacing: -.025em; }
.td-standalone #workspace :is(.panel,.manual-panel,.text-import,.session-form,.day-sidebar,.review-day,.block-card,.wizard-panel,
  .review-block,.publish-panel,.import-feedback,.saved-block-row,.guided-exercise) {
  background: var(--td-panel); color: var(--td-ink); border-color: var(--td-line); border-radius: 16px; box-shadow: var(--td-shadow);
}
.td-standalone #workspace :is(.steps button,.day-pick,.quiet,.icon-action,.archive-row,.time-chip,.editor-toolbar,
  .saved-block-actions button,.phase-sidebar,.wizard-footer,.wizard-top-actions,.review-day-heading,.review-block-heading) {
  border-color: var(--td-line); color: var(--td-copy);
}
.td-standalone #workspace :is(.day-pick,.steps button):is([aria-current=step],[aria-current=true]) {
  background: var(--td-tint); color: var(--td-accent); border-color: var(--td-brand);
}
.td-standalone #workspace .steps [aria-current=step] b { border-color: var(--td-brand); color: var(--td-accent); }
.td-standalone #workspace :is(.drop-zone,.wizard-progress,.time-chip,.upload-source,.text-import-body,.wizard-date-fields .select-shell,
  .guided-exercise,.resume-local,.review-notes,.review-block-preview,.review-block-form) {
  background: var(--td-subtle); color: var(--td-copy); border-color: var(--td-field);
}
.td-standalone #workspace .drop-zone:is(:hover,:focus-within,.has-file) { background: var(--td-tint); border-color: var(--td-brand); }
.td-standalone #workspace :is(.manual-mark,.upload-mark,.month-calendar,.drop-zone.has-file .upload-mark,.status:not(.is-error)) { color: var(--td-accent); }
.td-standalone #workspace :is(.review-notes ul,.review-day ul,.caption,.eyebrow,.wizard-block-caption,.month-field,.review-note,.drop-zone small) { color: var(--td-mute); }
.td-standalone #workspace :is(.time-picker legend,.upload-heading label,.saved-block-info,.wizard-done-mark) { color: var(--td-copy); }
.td-standalone :is(#workspace,.archive,.drill-editor) :is(input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=color],[type=hidden]),select,textarea) {
  background: var(--td-panel); color: var(--td-ink); border: 1px solid var(--td-field); border-radius: 8px; font-family: inherit;
}
.td-standalone #workspace .month-select #plan-month {
  background: var(--td-panel)!important; color: var(--td-ink); border-color: var(--td-field); box-shadow: var(--td-shadow);
}
.td-standalone #workspace :is(.month-chevron,.month-calendar) { color: var(--td-copy); }
.td-standalone #workspace :is(.month-select,.wizard-date-fields) option { color: var(--td-ink); background: var(--td-panel); }
.td-standalone #workspace .month-select:focus-within #plan-month { outline-color: var(--td-brand); }
.td-standalone :is(#workspace,.archive,.drill-editor) :is(input,textarea)::placeholder { color: var(--td-mute); opacity: 1; }
.td-standalone :is(#workspace,.drill-editor,.archive) :is(input[type=checkbox],input[type=radio]) { accent-color: var(--sport-action); }
.td-standalone :is(#workspace,#staff-topbar,.archive,.drill-editor) button:not([aria-current],.primary,.danger,.remove,[aria-pressed=true]) {
  background: var(--td-panel); color: var(--td-copy); border-color: var(--td-field); border-radius: 8px; font-family: inherit;
}
.td-standalone :is(#workspace,.archive,.drill-editor) button:is(.primary,[aria-pressed=true]) {
  background: var(--sport-action); border-color: var(--sport-action); color: white; border-radius: 8px;
}
.td-standalone #workspace :is(.remove,.danger,.is-error,.wizard-error,.transfer-error) { color: var(--td-error); }
.td-standalone :is(dialog.archive,dialog.drill-editor,dialog.staff-transfer-dialog,.fb-staff-dialog,.fb-dialog) {
  background: var(--td-panel); color: var(--td-ink); border: 1px solid var(--td-line); border-radius: 16px; box-shadow: var(--td-menu-shadow);
}
.td-standalone :is(.dialog-heading,.dialog-footer,.archive-row,.phase-sidebar,.fb-staff-host,.board-toolbar,.board-fields,.review-notes) {
  color: var(--td-copy); background: var(--td-panel); border-color: var(--td-line);
}
.td-standalone :is(.phase-sidebar,.board-tools) .active { border-color: var(--td-brand); color: var(--td-accent); background: var(--td-tint); }
.td-standalone[data-capture-state] { font-family: var(--td-font); }
.td-standalone[data-capture-state] #capture-status { background: var(--td-bg); color: var(--td-ink); }
.td-standalone[data-capture-state=error] #capture-status { color: var(--td-error); }

/* Formation position cards sit above the original sport's court or pitch. */
.td-pilot[data-view=formazione] .gamuvo-native-module :is(.postazione,.panchina) {
  background: var(--td-panel); color: var(--td-ink); border: 1px solid var(--td-line); border-radius: 10px; box-shadow: var(--td-shadow);
}
.td-pilot[data-view=formazione] .gamuvo-native-module :is(.postazione-nome,.postazione-vuota,.gf-eta) { color: var(--td-mute); }
.td-pilot[data-view=formazione] .gamuvo-native-module .postazione-sigla { background: var(--td-subtle); color: var(--td-copy); }
.td-pilot[data-view=formazione] .gamuvo-native-module .attacco .postazione-sigla { background: var(--td-tint); color: var(--td-accent); }
.td-pilot[data-view=formazione] .gamuvo-native-module :is(.postazione,.panchina) .count {
  color: var(--td-copy); background: var(--td-subtle); border-color: var(--td-line); font-variant-numeric: tabular-nums;
}
.td-pilot[data-view=drill] .drill-plus {
  color: var(--td-accent); background: var(--td-panel); border: 1px solid var(--td-field); border-radius: 8px;
}
.td-pilot[data-view=drill] .drill-plus[aria-expanded=true] { color: var(--td-accent); background: var(--td-tint); border-color: var(--td-brand); }
.td-pilot[data-view=drill] .drill-table .drill-desc-row td { color: var(--td-copy); background: var(--td-subtle); }

body:is(.td-pilot,.td-standalone) :is(#video-view,.vs-dialog,#playbook-view,.pb-page,.fb-app,#workspace,.archive,.drill-editor)
  :is(button,a,input,select,textarea,summary):focus-visible { outline: 2px solid var(--td-brand); outline-offset: 2px; }
body:is(.td-pilot,.td-standalone) :is(.vs-dialog,.fb-dialog,.fb-staff-dialog,.pb-source-dialog,.pb-help-dialog,.archive,.drill-editor)::backdrop {
  background: rgb(16 24 40 / 54%); backdrop-filter: blur(3px);
}
@media (max-width:760px) {
  body.td-pilot #video-view { border-radius: 10px; }
  body.td-pilot #video-view :is(.vs-catalog-head,.vs-study-page,.vs-side,.vs-edit-dock) { border-radius: 12px; }
  body.td-pilot #video-view .vs-study-card { min-width: 0; column-gap: 8px; }
  body.td-pilot #video-view :is(.vs-study-heading,.vs-personal-intro,.vs-shelf-head,.vs-studio-title,.vs-study-actions,.vs-source-actions) { min-width: 0; }
  body.td-pilot #video-view :is(.vs-tabs,.vs-view-switch,.vs-side-tabs) button { min-height: 40px; }
  body.td-pilot .vs-dialog { padding: 16px; max-width: calc(100vw - 20px); }
  body.td-pilot :is(.vs-dialog,#video-view) :is(input[type=text],input[type=search],textarea,select):focus,
  .td-standalone #workspace :is(input[type=text],textarea,select):focus { font-size: 16px!important; }
  body.td-pilot .pb-page :is(.pb-detail-top,.pb-title-row,.pb-header-tools) { flex-wrap: wrap; min-width: 0; }
  .td-standalone #workspace .steps { max-width: 100%; }
  .td-standalone #workspace :is(.panel,.manual-panel,.review-day,.wizard-panel) { border-radius: 12px; }
  .td-standalone #workspace :is(.upload-heading,.workspace-heading,.review-heading) h2 { overflow-wrap: anywhere; }
}
/* Standalone screens also leave their controls clear of the TEST marker. */
body.td-standalone > .elephants-test-badge {
  position: static;
  inset: auto;
  transform: none;
  width: fit-content;
  margin: 8px auto;
}
