:root {
  --ink: #172033;
  --muted: #697386;
  --navy: #142136;
  --blue: #3267d6;
  --blue-soft: #eaf1ff;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --line: #dce3ed;
  --line-soft: #edf1f6;
  --green: #198a59;
  --red: #d94452;
  --amber: #d38a17;
  --shadow: 0 8px 24px rgb(31 49 78 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.logout-form { display: flex; align-items: center; gap: 6px; }
.logout-form span { color: #a9b6c9; font-size: 9px; font-weight: 800; }
.logout-form button { min-height: 30px; padding: 0 9px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 7px; background: transparent; color: #fff; font-size: 9px; font-weight: 800; }
.login-page { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #294a7b, transparent 35%), #111d30; }
.login-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-card { width: min(390px, 100%); padding: 28px; display: grid; gap: 22px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 18px; background: #f8faff; box-shadow: 0 26px 70px rgb(0 0 0 / 28%); }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand > div { display: flex; flex-direction: column; }
.login-brand strong { font-size: 16px; }
.login-brand small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.login-card h1 { margin-top: 2px; }
.login-form { display: grid; gap: 12px; }
.login-form label { display: grid; gap: 5px; }
.login-form label span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.login-form input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.login-form button { min-height: 44px; border: 0; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 850; }
.login-note { margin: 0; color: var(--muted); font-size: 9px; text-align: center; }

.topbar {
  min-height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 850; letter-spacing: -.02em; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, #ff665f, #cf2f4f);
  box-shadow: 0 4px 12px rgb(0 0 0 / 18%);
  font-weight: 950;
}
.season-tabs { display: flex; align-self: stretch; }
.season-tab {
  min-width: 88px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid transparent;
  color: #9fadc1;
  font-size: 13px;
  font-weight: 750;
}
.season-tab:hover { color: #fff; }
.season-tab.active { color: #fff; border-color: #72a7ff; }
.team-switcher { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.team-switcher span {
  color: #9fadc1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.team-switcher select {
  min-width: 150px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 8px;
  background: #ffffff12;
  color: #fff;
}
.team-switcher option { color: var(--ink); }

.timeline-shell {
  height: 50px;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.timeline-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.matchday-tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; }
.matchday-tab {
  flex: 0 0 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.matchday-tab:hover { background: #eef2f8; }
.matchday-tab.current { box-shadow: inset 0 0 0 1px #8aa7d9; }
.matchday-tab.active { background: var(--blue); color: #fff; box-shadow: none; }

.app-shell { min-height: calc(100vh - 108px); display: grid; grid-template-columns: 158px minmax(0, 1fr); }
.function-tabs { padding: 15px 10px; border-right: 1px solid var(--line); background: #fff; }
.function-tab {
  height: 40px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}
.function-tab:hover:not(.disabled) { background: #f3f6fb; color: var(--ink); }
.function-tab.active { background: var(--blue-soft); color: var(--blue); }
.function-tab.group-active { color: var(--ink); }
.function-tab.disabled { opacity: .38; }
.function-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e9eef6;
  font-size: 10px;
  font-weight: 900;
}
.function-tab.active .function-icon { background: var(--blue); color: #fff; }
.nav-group { margin: 1px 0; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-chevron { margin-left: auto; color: #97a2b3; font-size: 14px; transition: transform .16s ease; }
.nav-group[open] .nav-chevron { transform: rotate(180deg); }
.function-subtabs { margin: 1px 0 5px 36px; display: grid; gap: 1px; }
.function-subtab {
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}
.function-subtab:hover { background: #f3f6fb; color: var(--ink); }
.function-subtab.active { background: var(--blue-soft); color: var(--blue); }

main { min-width: 0; padding: 21px clamp(16px, 2.2vw, 34px) 46px; }
.page-head { margin-bottom: 15px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.eyebrow {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(25px, 2.3vw, 32px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 16px; }
.subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.compact-stat {
  min-width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.compact-stat span, .compact-stat strong { display: block; }
.compact-stat span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.compact-stat strong { margin-top: 1px; font-size: 21px; }

input, select {
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
}
input:focus, select:focus { border-color: #7da2eb; box-shadow: 0 0 0 3px rgb(50 103 214 / 10%); }
button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 780;
}
.quiet-button { border-color: var(--line); background: #fff; color: var(--ink); }
.quiet-button:hover { border-color: #aebbd0; background: #f8faff; }
.square { width: 36px; padding: 0; }
.alert {
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #efb2b8;
  border-radius: 9px;
  background: #fff1f3;
  color: #a82c3a;
  font-size: 12px;
}
.success-alert {
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #a8d7c0;
  border-radius: 9px;
  background: #eefaf4;
  color: #146d48;
  font-size: 12px;
}

/* Quotazioni */
.filters {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.filters.compact { grid-template-columns: minmax(160px, 2fr) repeat(7, minmax(72px, 1fr)) auto; }
.filters label { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.filters.compact .metric-filter { min-width: 118px; }
.filters label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.data-table { margin-top: 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.table-row {
  min-height: 39px;
  padding: 5px 12px;
  display: grid;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
}
.table-row:first-child { border-top: 0; }
.table-head { min-height: 31px; background: #f7f9fc; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.quotations-table { overflow-x: auto; }
.quotations-table .table-row { min-width: 970px; grid-template-columns: 45px minmax(170px, 1fr) 48px 48px 58px 42px 48px 48px 40px 42px 84px; }
.sort-hint { margin: 8px 2px 5px; color: var(--muted); font-size: 9px; }
.sort-hint kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font-family: inherit; }
.mobile-sort-help { display: none; }
.sort-reset { min-height: 24px; margin-left: 7px; padding: 2px 7px; font-size: 9px; }
.quotations-table .sort-column {
  min-width: 0;
  min-height: 31px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  box-shadow: none;
}
.quotations-table .sort-column.numeric { justify-content: flex-end; }
.quotations-table .sort-column::after { content: attr(data-sort-state); min-width: 13px; color: var(--blue); font-size: 8px; letter-spacing: 0; }
.quotations-table .sort-column:hover { color: var(--blue); transform: none; }
.quote-check { padding: 3px 5px; border-radius: 5px; background: #eefaf4; color: var(--green); font-size: 8px; font-weight: 800; text-align: center; }
.quote-check.mismatch { background: #fff0f2; color: var(--red); }
.segmented-nav {
  width: fit-content;
  padding: 3px;
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.segmented-nav a { padding: 8px 12px; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 780; }
.segmented-nav a.active { background: var(--blue-soft); color: var(--blue); }
.crosscheck-head form { display: flex; align-items: center; gap: 8px; }
.crosscheck-head form > span { color: var(--muted); font-size: 9px; }
.crosscheck-head form button { white-space: nowrap; }
.crosscheck-history, .crosscheck-detail { margin-top: 13px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-heading > div > span { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.section-heading p { max-width: 580px; margin: 0; color: var(--muted); font-size: 9px; text-align: right; }
.compact-crosscheck-table { max-height: 275px; overflow-y: auto; }
.compact-crosscheck-table .table-row { min-width: 620px; grid-template-columns: 32px repeat(6, minmax(62px, 1fr)); }
.compact-crosscheck-table .table-row.selected { background: var(--blue-soft); color: var(--blue); }
.quotation-check-table, .result-check-table { overflow-x: auto; }
.quotation-check-table .table-row { min-width: 620px; grid-template-columns: 42px minmax(170px, 1fr) 55px 60px 90px 85px; }
.result-check-table .table-row { min-width: 650px; grid-template-columns: minmax(170px, 1fr) 55px repeat(4, 82px); }
.text-danger { color: var(--red); }
.metric-strip { margin-top: 9px; display: grid; gap: 6px; }
.metric-strip.four { grid-template-columns: repeat(4, 1fr); }
.metric-strip.five { grid-template-columns: repeat(5, 1fr); }
.metric-strip > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.metric-strip span, .metric-strip strong { display: block; }
.metric-strip span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.metric-strip strong { margin-top: 2px; font-size: 17px; font-variant-numeric: tabular-nums; }
.metric-strip .danger { border-color: #efb2b8; background: #fff1f3; color: var(--red); }
.success-panel { margin-top: 9px; padding: 14px; display: flex; flex-direction: column; border: 1px solid #a8d7c0; border-radius: 10px; background: #eefaf4; color: var(--green); }
.success-panel span { margin-top: 2px; font-size: 10px; }
.score-equation { margin-top: 9px; padding: 11px; display: flex; align-items: center; gap: 9px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; white-space: nowrap; }
.score-equation span { display: flex; flex-direction: column; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.score-equation b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.score-equation i { color: #9aa5b5; font-style: normal; font-weight: 850; }
.role {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #667389;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}
.role-p { background: #d18c19; }
.role-d { background: #3477c8; }
.role-c { background: #229767; }
.role-a { background: #dd4651; }
.role-t { background: #7658b7; }
.muted, small { color: var(--muted); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative, .danger { color: var(--red) !important; }

/* Costruttore rosa */
.roster-page-head { margin-bottom: 11px; }
.workbench-toolbar {
  min-height: 58px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.scenario-jump { display: flex; align-items: end; gap: 6px; }
.scenario-jump label, .new-scenario label { display: flex; flex-direction: column; gap: 3px; }
.scenario-jump label > span, .new-scenario label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.scenario-jump select { min-width: 190px; }
.toolbar-message { display: flex; flex-direction: column; font-size: 12px; }
.toolbar-message span { color: var(--muted); }
.new-scenario { margin-left: auto; position: relative; }
.new-scenario summary {
  min-height: 36px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.new-scenario summary::-webkit-details-marker { display: none; }
.new-scenario[open] form {
  width: min(530px, calc(100vw - 36px));
  padding: 10px;
  position: absolute;
  top: 43px;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(24 38 64 / 18%);
}
.new-scenario[open] summary { background: #244f9f; }
.board-hint { padding: 9px 3px 5px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.roster-board {
  width: 100%;
  padding: 2px 2px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: #b6c1d2 transparent;
}
.scenario-column {
  flex: 0 0 350px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 15px rgb(31 49 78 / 5%);
}
.scenario-column.active { border-color: #7ca1e9; box-shadow: 0 0 0 2px rgb(50 103 214 / 9%), var(--shadow); }
.scenario-header {
  min-height: 116px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f9fbfe);
}
.scenario-title { display: flex; align-items: baseline; gap: 7px; }
.scenario-title > span {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}
.scenario-title h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.scenario-source { height: 15px; margin: 3px 0 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.scenario-kpis { display: grid; grid-template-columns: .65fr .65fr 1.45fr 1fr; gap: 4px; }
.scenario-kpis div { min-width: 0; padding: 6px 7px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.scenario-kpis span, .scenario-kpis strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scenario-kpis span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.scenario-kpis strong { margin-top: 1px; font-size: 12px; font-variant-numeric: tabular-nums; }
.slot-head, .scenario-slot { display: grid; grid-template-columns: 34px minmax(120px, 1fr) 48px 48px 46px; align-items: center; gap: 4px; }
.slot-head {
  height: 27px;
  padding: 0 7px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.scenario-slot {
  min-height: 42px;
  padding: 3px 7px;
  border-top: 1px solid var(--line-soft);
  transition: background .15s ease;
}
.scenario-slot:first-child { border-top: 0; }
.scenario-slot.role-start:not(:first-child) { border-top: 2px solid #d5ddea; }
.scenario-slot:focus-within, .scenario-slot.dirty { background: #f6f9ff; }
.slot-code { display: flex; align-items: center; gap: 2px; }
.slot-code .role { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; }
.slot-code small { width: 9px; font-size: 8px; text-align: center; }
.player-cell { min-width: 0; display: block; }
.player-cell input {
  width: 100%;
  height: 21px;
  padding: 0 3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
}
.player-cell input:focus { box-shadow: 0 0 0 2px rgb(50 103 214 / 13%); }
.player-cell small { padding-left: 3px; display: block; overflow: hidden; font-size: 8px; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
.money-input {
  width: 48px;
  height: 29px;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.slot-actions { display: flex; justify-content: flex-end; gap: 2px; }
.save-slot, .delete-slot {
  width: 22px;
  min-height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #edf2f8;
  color: #8792a4;
  font-size: 11px;
}
.scenario-slot.dirty .save-slot { background: var(--blue); color: #fff; }
.delete-slot:hover { background: #ffe9ec; color: var(--red); }
.empty-state { margin-top: 12px; padding: 34px; border: 1px dashed #c5cfdd; border-radius: 11px; background: #fff; text-align: center; }
.empty-state p { margin: 5px 0; color: var(--muted); }

/* Formazioni e risultati */
.similarity-panel { margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.similarity-panel header { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.similarity-panel header span, .similarity-panel header small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.similarity-panel h2 { font-size: 14px; }
.similarity-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(11, minmax(42px, 1fr)); gap: 4px; }
.similarity-grid div { padding: 5px; border-radius: 6px; background: var(--blue-soft); text-align: center; }
.similarity-grid span, .similarity-grid strong { display: block; font-size: 9px; }
.formation-teams-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); align-items: start; gap: 8px; }
.formation-team-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.formation-team-card.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgb(50 103 214 / 9%); }
.formation-team-card summary { min-height: 38px; padding: 7px 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.formation-team-card summary span { color: var(--muted); font-size: 8px; }
.formation-compact-scroll { overflow-x: auto; }
.formation-compact-head, .formation-compact-row { min-width: 590px; display: grid; grid-template-columns: 30px minmax(130px, 1fr) 42px 44px 38px 42px 42px 28px 28px; align-items: center; gap: 4px; }
.formation-compact-head { height: 24px; padding: 0 7px; background: #f4f7fb; color: var(--muted); font-size: 7px; text-transform: uppercase; }
.formation-compact-row { min-height: 31px; padding: 2px 7px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.formation-compact-row.bench { background: #fafbfc; color: #697386; }
.formation-compact-row strong small { display: block; color: var(--muted); font-size: 7px; }
.formation-compact-row b { text-align: right; }
.lineup-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 12px; }
.lineup-card, .standings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.lineup-card > header, .standings-card > header {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.lineup-card > header strong, .standings-card > header span { color: var(--blue); }
.lineup-row {
  min-height: 38px;
  padding: 5px 10px;
  display: grid;
  grid-template-columns: 24px 34px minmax(130px, 1fr) 42px 44px;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
}
.lineup-row:first-of-type { border-top: 0; }
.slot-number { color: #9aa5b5; font-size: 9px; text-align: center; }
.club-code {
  padding: 3px 4px;
  border-radius: 5px;
  background: #edf2f8;
  color: #526076;
  font-size: 8px;
  font-weight: 850;
  text-align: center;
}
.score-pill {
  padding: 4px 5px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
}
.bench-card .score-pill { background: #f1f3f6; color: #667389; }
.source-note { margin: 9px 2px 0; color: var(--muted); font-size: 10px; }
.result-kpis { margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.result-kpis div { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.result-kpis span, .result-kpis strong { display: block; }
.result-kpis span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.result-kpis strong { margin-top: 2px; overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.standings-card { max-width: 760px; }
.range-toolbar { max-width: 760px; margin-bottom: 8px; }
.range-toolbar input { width: 70px; }
.standing-head button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-transform: inherit; }
.h2h-chart { max-width: 760px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.h2h-chart header, .h2h-last { display: flex; justify-content: space-between; gap: 10px; }
.h2h-chart svg { width: 100%; height: 210px; margin-block: 8px; background: linear-gradient(#fff, #f7f9fc); }
.result-team-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.result-team-card { border-top: 1px solid var(--line); background: #fff; }
.result-team-card.selected { border: 2px solid var(--blue); background: #eaf1ff; box-shadow: inset 4px 0 var(--blue), 0 3px 12px rgba(42, 96, 190, .16); }
.reference-badge { width: fit-content; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 7px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.result-team-summary { min-height: 38px; padding: 5px 10px; display: grid; grid-template-columns: 35px minmax(170px, 1fr) 90px 130px 18px; align-items: center; gap: 7px; }
.result-team-summary.head { min-height: 29px; background: #f3f6fa; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.result-team-summary.head button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-transform: inherit; }
.result-team-summary span small { display: block; color: var(--muted); font-size: 7px; }
.result-team-summary i { color: var(--muted); font-style: normal; }
.result-team-card[open] > summary i { transform: rotate(180deg); }
.result-team-detail { padding: 8px 10px 12px; border-top: 1px solid var(--line-soft); background: #fbfcfe; }
.result-detail-loader { padding: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; text-align: center; }
.result-components { margin-bottom: 7px; display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 5px; }
.result-components div { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.result-components span, .result-components strong { display: block; }
.result-components span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.result-components .total { border-color: #8eaee8; background: var(--blue-soft); }
.result-player-row { min-height: 32px; padding: 3px 6px; display: grid; grid-template-columns: 75px 35px minmax(160px, 1fr) 65px 75px minmax(130px, 1fr) 90px; align-items: center; gap: 5px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.result-player-row.head { min-height: 25px; border: 0; background: #edf2f8; color: var(--muted); font-size: 7px; text-transform: uppercase; }
.result-player-row.unused { opacity: .58; }
.result-player-row strong small { display: block; color: var(--muted); font-size: 7px; }
.result-player-row input { width: 60px; height: 27px; text-align: right; }
.h2h-result-grid { display: grid; grid-template-columns: repeat(2, minmax(420px, 1fr)); align-items: start; gap: 8px; }
.hypotheses-panel > header { margin-bottom: 8px; display: flex; align-items: end; justify-content: space-between; }
.global-hypothesis-toolbar { margin-bottom: 6px; display: grid; grid-template-columns: minmax(190px, 1fr) 130px auto; align-items: center; gap: 7px; }
.global-hypothesis-toolbar input, .global-hypothesis-toolbar select { height: 34px; }
.global-hypothesis-toolbar span { color: var(--muted); font-size: 9px; font-weight: 800; }
.global-hypothesis-table { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.global-hypothesis-row { min-height: 34px; padding: 3px 8px; display: grid; grid-template-columns: 38px minmax(180px, 1fr) 60px 70px 78px 100px; align-items: center; gap: 6px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.global-hypothesis-row.head { min-height: 27px; border: 0; background: #edf2f8; color: var(--muted); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.global-hypothesis-row input { width: 64px; height: 27px; text-align: right; }
.standings-card > header h2 { font-size: 14px; text-transform: none; }
.standing-row {
  min-height: 36px;
  padding: 5px 12px;
  display: grid;
  grid-template-columns: 38px minmax(180px, 1fr) 80px 80px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
}
.standing-head { min-height: 29px; border-top: 0; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.standing-row.selected { position: sticky; top: 0; z-index: 2; background: var(--blue-soft); color: #214d9f; }
.segment-tabs { width: fit-content; margin: -3px 0 12px; padding: 3px; display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.segment-tabs a { min-width: 80px; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }
.segment-tabs a.active { background: var(--blue); color: #fff; }
.comparison-toolbar { padding: 9px; display: flex; align-items: end; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.comparison-toolbar label { display: flex; flex-direction: column; gap: 3px; }
.comparison-toolbar label > span, .comparison-toolbar > div > span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.comparison-toolbar > div { min-width: 110px; padding: 7px 9px; display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 8px; }
.comparison-toolbar > div strong { font-size: 14px; }
.comparison-table .table-row { grid-template-columns: minmax(150px, 1fr) repeat(5, 90px); }
.similarity-pill { color: var(--blue); font-weight: 850; }
.live-score-table .table-row { grid-template-columns: minmax(180px, 1fr) 60px 70px 80px 80px; }
.live-state { padding: 3px 6px; border-radius: 6px; background: #e8f7ef; color: var(--green); font-size: 8px; font-weight: 850; text-align: center; text-transform: uppercase; }
.live-state.assumed { background: #fff2d9; color: #94620e; }
.shock-table .table-row { grid-template-columns: minmax(180px, 1fr) repeat(4, 72px); }
.shock-table input { width: 65px; height: 29px; text-align: right; }
.shock-row > strong:first-child { display: flex; flex-direction: column; }
.shock-row > strong small { font-size: 8px; font-weight: 500; }
.compact-result { max-width: 410px; margin-top: 10px; grid-template-columns: repeat(2, 1fr); }
.formation-workspace { margin-top: 11px; }
.formation-summary { margin-bottom: 8px; display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 7px; }
.formation-summary > div { padding: 8px 10px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.formation-summary span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.formation-summary strong { font-size: 13px; }
.formation-builder .table-row { min-width: 700px; grid-template-columns: 45px minmax(180px, 1fr) 55px 135px 65px 70px; }
.formation-builder select, .formation-builder input { height: 29px; }
.formation-builder button { min-height: 29px; padding-inline: 8px; font-size: 10px; }
.lineup-builder { margin-top: 10px; }
.lineup-builder-toolbar { padding: 8px; display: flex; align-items: end; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lineup-builder-toolbar label, .lineup-builder-toolbar > div { min-width: 120px; display: flex; flex-direction: column; gap: 2px; }
.lineup-builder-toolbar span, .lineup-specials label > span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.lineup-builder-toolbar button { margin-left: auto; }
.lineup-builder-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); align-items: start; gap: 8px; }
.lineup-side { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lineup-side > header { min-height: 40px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; background: #f5f8fc; }
.lineup-side > header h2 { font-size: 13px; }
.lineup-side > header span { color: var(--blue); font-size: 9px; font-weight: 850; }
.lineup-slot { min-height: 37px; padding: 3px 7px; display: grid; grid-template-columns: 34px minmax(180px, 1fr); align-items: center; gap: 5px; border-top: 1px solid var(--line-soft); }
.lineup-slot > span { display: flex; align-items: center; gap: 3px; font-size: 8px; }
.lineup-player-select { width: 100%; height: 29px; }
.lineup-specials { padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-top: 2px solid var(--line); background: #fafcff; }
.lineup-specials label { display: flex; flex-direction: column; gap: 3px; }

/* Timeline rosa actual e what-if */
.primary-link {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.data-warning {
  margin-bottom: 11px;
  padding: 9px 12px;
  border: 1px solid #e6cf91;
  border-radius: 9px;
  background: #fff9e9;
  color: #71581a;
  font-size: 12px;
}
.current-roster-layout {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(330px, 360px);
  align-items: start;
  gap: 11px;
}
.current-label {
  padding: 13px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.current-label span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.current-label strong { margin-top: 2px; font-size: 26px; }
.current-label small { margin-top: 5px; line-height: 1.45; }
.past-section { margin-top: 13px; }
.past-section > summary {
  min-height: 42px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.past-section > summary strong { margin-left: auto; color: var(--blue); }
.compact-past { margin: 10px 0; }
.scenario-manager {
  min-height: 58px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.scenario-picker { display: flex; align-items: end; gap: 7px; }
.scenario-picker label { display: flex; flex-direction: column; gap: 3px; }
.scenario-picker label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.scenario-picker select { min-width: 260px; }
.danger-button { border-color: #efc6ca; background: #fff; color: var(--red); }
.danger-button:hover { background: #fff0f2; }
.scenario-actions { position: relative; }
.scenario-actions > summary {
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
  list-style: none;
}
.scenario-actions > summary::-webkit-details-marker { display: none; }
.scenario-actions > div {
  width: min(480px, calc(100vw - 36px));
  padding: 10px;
  position: absolute;
  top: 42px;
  left: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(24 38 64 / 18%);
}
.scenario-actions form { display: flex; flex-direction: column; justify-content: end; gap: 6px; }
.scenario-actions label { display: flex; flex-direction: column; gap: 3px; }
.scenario-actions label span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.scenario-actions p { margin: 0; color: var(--muted); font-size: 10px; }
.path-toolbar {
  min-height: 60px;
  margin-top: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.path-toolbar > div:first-child { min-width: 160px; display: flex; flex-direction: column; }
.path-toolbar span, .path-toolbar small { color: var(--muted); font-size: 9px; }
.path-toolbar > div:first-child span { font-weight: 850; text-transform: uppercase; }
.path-toolbar > div:first-child strong { font-size: 13px; }
.path-toolbar p { margin: 0 0 0 auto; max-width: 430px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.day-jump { display: flex; align-items: end; gap: 5px; }
.day-jump label { display: flex; flex-direction: column; gap: 3px; }
.day-jump select { min-width: 130px; }
.timeline-board {
  min-width: 0;
  padding: 4px 2px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: #aebbd0 transparent;
}
.timeline-workspace { margin-top: 10px; }
.timeline-controls {
  min-height: 48px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: #fff;
}
.timeline-controls > div { display: flex; flex-direction: column; }
.timeline-controls > div strong { font-size: 12px; }
.timeline-controls > div span { color: var(--muted); font-size: 8px; }
.timeline-controls button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.timeline-controls button:disabled { opacity: .35; cursor: not-allowed; }
.timeline-scenario-title { margin-left: auto; text-align: right; }
.scenario-draft-actions {
  margin-left: 4px;
  display: flex !important;
  align-items: center;
  flex-direction: row !important;
  gap: 5px;
}
.scenario-draft-actions > span { min-width: 105px; text-align: right; }
.scenario-draft-actions button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.scenario-draft-actions button:disabled { opacity: .45; cursor: not-allowed; }
.draft-alert { margin: 0 0 7px; }
.day-picker { display: flex; align-items: center; gap: 6px; }
.day-picker > span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.day-picker select { min-width: 130px; }
.timeline-legend { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.timeline-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.timeline-scroll-top { height: 15px; overflow-x: auto; overflow-y: hidden; border-inline: 1px solid var(--line); background: #fff; scrollbar-color: #aebbd0 transparent; }
.timeline-scroll-top > div { height: 1px; }
.timeline-workspace:not(.past-expanded) .timeline-day.is-past { display: none; }
.timeline-workspace:not(.future-expanded) .timeline-day.is-future { display: none; }
.timeline-workspace .timeline-board { min-height: 180px; margin: 0; padding: 8px 2px 14px; border-top: 1px solid var(--line-soft); }
.timeline-board.single { padding-top: 0; overflow: visible; }
.timeline-day {
  flex: 0 0 252px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 15px rgb(31 49 78 / 5%);
}
.timeline-day.status-actual { border-color: #7eb99d; }
.timeline-day.status-editable { border-color: #7fa4ea; }
.timeline-day.status-closed { border-color: #c7ced9; background: #f2f4f7; }
.timeline-day.status-carried { border-style: dashed; }
.timeline-day.status-missing { border-style: dashed; opacity: .78; }
.timeline-day.invalid { border-color: var(--red); box-shadow: 0 0 0 2px rgb(217 68 82 / 10%); }
.timeline-day-head {
  min-height: 96px;
  padding: 10px;
  position: relative;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fafd);
}
.timeline-day-head.compact-day-head { min-height: 113px; padding: 5px 6px; }
.day-heading-row { min-height: 28px; display: grid; grid-template-columns: 30px minmax(102px, 1fr) auto; align-items: center; gap: 4px; }
.day-heading-row .day-number { font-size: 20px; font-weight: 880; text-align: center; font-variant-numeric: tabular-nums; }
.day-heading-row > span:nth-child(2) { display: flex; flex-direction: column; }
.day-heading-row small { color: var(--muted); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.day-heading-row strong { font-size: 11px; }
.day-heading-row .day-status { position: static; justify-self: end; }
.status-closed .timeline-day-head { background: #e9edf2; }
.day-title { display: flex; align-items: center; gap: 6px; }
.day-title span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.day-title strong { font-size: 19px; }
.day-status {
  padding: 3px 6px;
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.status-actual .day-status { background: #e8f7ef; color: var(--green); }
.status-carried .day-status, .status-missing .day-status, .status-closed .day-status { background: #e3e7ed; color: #697386; }
.timeline-day-head > p { height: 12px; margin: 3px 2px 0 34px; overflow: hidden; color: var(--muted); font-size: 7px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.day-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.day-kpis.four { grid-template-columns: .8fr .65fr 1.2fr .8fr; }
.day-kpis div { min-width: 0; padding: 5px 6px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fff; }
.day-kpis span, .day-kpis strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-kpis span { color: var(--muted); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.day-kpis strong { margin-top: 1px; font-size: 11px; font-variant-numeric: tabular-nums; }
.flow-kpis { margin-top: 3px; }
.flow-kpis .kpi-flow { margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.flow-kpis .kpi-flow small { color: var(--muted); font-size: 10px; }
.flow-kpis .kpi-flow b { color: #a5afbd; font-size: 9px; }
.flow-kpis .kpi-flow strong { margin: 0; }
.day-meta-row, .timeline-slot-head, .timeline-slot { display: grid; align-items: center; gap: 4px; }
.day-meta-row.actual, .timeline-slot-head.actual, .timeline-slot.actual { grid-template-columns: 28px minmax(104px, 1fr) 38px; }
.day-meta-row.editable { grid-template-columns: 28px minmax(96px, 1fr) 38px 38px; }
.timeline-slot-head.editable, .timeline-slot.editable { grid-template-columns: 28px minmax(128px, 1fr) 48px; }
.day-meta-row { min-height: 17px; padding: 0 2px; color: var(--muted); font-size: 8px; }
.day-meta-row > span:nth-child(2) { font-weight: 850; text-transform: uppercase; }
.day-meta-row .kpi-flow { grid-column: 3 / -1; display: flex; justify-content: flex-end; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.day-meta-row .kpi-flow small { color: var(--muted); font-size: 9px; }
.day-meta-row .kpi-flow b { color: #a5afbd; font-size: 8px; }
.day-meta-row .kpi-flow strong { min-width: 22px; color: var(--ink); font-size: 10px; text-align: right; }
.day-meta-row.danger .kpi-flow strong { color: var(--red); }
.timeline-slot-head {
  height: 27px;
  padding: 0 7px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.timeline-slot {
  min-height: 35px;
  padding: 2px 6px;
  border-top: 1px solid var(--line-soft);
  transition: background .15s ease;
}
.timeline-slot:first-child { border-top: 0; }
.timeline-slot.role-start:not(:first-child) { border-top: 2px solid #d5ddea; }
.timeline-slot:focus-within, .timeline-slot.dirty { background: #f4f8ff; }
.timeline-slot.overridden { box-shadow: inset 3px 0 0 #7da2eb; }
.status-closed .timeline-slot { background: #f4f5f7; }
.status-closed .player-input, .status-closed .purchase-input { color: #8a94a3; cursor: not-allowed; }
.assumption-input[readonly] { border-color: transparent; background: #f0f3f7; color: #657188; cursor: not-allowed; font-weight: 800; }
.player-readonly, .player-cell { min-width: 0; position: relative; }
.player-readonly strong, .player-readonly small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-readonly strong { font-size: 10px; }
.player-readonly small { font-size: 8px; }
.status-text-lista_out strong, .status-text-lista_out { color: #276fbf; }
.status-text-fuori_lista strong, .status-text-fuori_lista { color: var(--red); }
.status-text-new_entry strong, .status-text-new_entry { color: var(--red); }
.quotations-table strong small { margin-top: 1px; display: block; font-size: 7px; font-weight: 750; }
.cell-number { text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.reset-slot {
  width: 17px;
  min-height: 17px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #e7ecf3;
  color: #657188;
  font-size: 10px;
}
.player-cell-actions { position: absolute; right: 0; bottom: -1px; display: flex; gap: 2px; }
.open-player-picker { width: 18px; min-height: 17px; padding: 0; border: 0; border-radius: 6px; background: #e8f0ff; color: var(--blue); font-size: 12px; font-weight: 900; }
.open-player-picker:hover { background: #dbe7ff; transform: none; }
.open-player-picker:disabled { display: none; }
.reset-slot:hover { background: #dce4ef; }
.timeline-slot.reset-pending { background: #fff5df; box-shadow: inset 3px 0 0 #e4a62c; }
.timeline-slot.reset-pending::after { content: "ripristino"; position: absolute; right: 4px; top: 2px; color: #9a6500; font-size: 7px; font-weight: 850; text-transform: uppercase; }
.timeline-slot.editable { position: relative; }

.player-picker {
  width: min(980px, calc(100vw - 28px));
  max-width: none;
  height: min(760px, calc(100dvh - 28px));
  max-height: none;
  margin: auto 14px auto auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #f7f9fc;
  box-shadow: 0 24px 70px rgb(18 38 72 / 28%);
}
.player-picker::backdrop { background: rgb(18 31 53 / 48%); backdrop-filter: blur(2px); }
.player-picker > section { height: 100%; display: flex; flex-direction: column; }
.player-picker header { padding: 18px 20px 13px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #fff; }
.player-picker header h2 { margin: 2px 0 3px; font-size: 24px; }
.player-picker header span { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.player-picker header p { margin: 0; color: var(--muted); font-size: 12px; }
.player-picker-filters { padding: 12px 20px; display: grid; grid-template-columns: minmax(220px, 1.6fr) 1fr 1fr; gap: 10px; background: #fff; }
.player-picker-filters label span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.player-picker-filters input, .player-picker-filters select { width: 100%; min-height: 38px; }
.player-picker-hint { margin: 0; padding: 7px 20px; color: var(--muted); font-size: 10px; }
.player-picker-table { min-height: 0; margin: 0 12px 12px; flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.player-picker-row { min-width: 790px; display: grid; grid-template-columns: minmax(205px, 1fr) 52px 58px 66px repeat(5, 51px); align-items: center; }
.player-picker-row.head { position: sticky; top: 0; z-index: 2; min-height: 37px; border-bottom: 1px solid var(--line); background: #f1f5fa; }
.player-picker-row.head button { min-width: 0; min-height: 37px; padding: 0 7px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 900; text-align: right; text-transform: uppercase; }
.player-picker-row.head button:first-child { text-align: left; }
.player-picker-row.head button:hover, .player-picker-row.head button[data-sort-state] { background: #e6eefb; color: var(--blue); transform: none; }
.player-picker-row.result { width: 100%; min-height: 45px; padding: 0; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: linear-gradient(90deg, hsl(calc(var(--appeal-score, 50) * 1.2) 64% 84% / 72%), #fff 55%); color: var(--ink); text-align: left; }
.player-picker-row.result:last-child { border-bottom: 0; }
.player-picker-row.result:hover:not(:disabled) { z-index: 1; background: linear-gradient(90deg, hsl(calc(var(--appeal-score, 50) * 1.2) 70% 78% / 82%), #f5f9ff 62%); box-shadow: inset 3px 0 0 var(--blue); transform: none; }
.player-picker-row.result > span { min-width: 0; padding: 5px 7px; overflow: hidden; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.player-picker-row.result > span:first-child { text-align: left; }
.player-picker-row.result strong, .player-picker-row.result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-picker-row.result strong { font-size: 12px; }
.player-picker-row.result small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 700; }
.player-picker-row.result:disabled { cursor: not-allowed; opacity: .54; }
.player-picker-empty { padding: 32px 18px; color: var(--muted); text-align: center; }
.metric-detail-trigger { cursor: help; }
.metric-detail-dialog { width: min(430px, calc(100vw - 24px)); max-width: none; padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 22px 65px rgb(18 38 72 / 30%); }
.metric-detail-dialog::backdrop { background: rgb(18 31 53 / 42%); backdrop-filter: blur(2px); }
.metric-detail-dialog header { padding: 14px 16px 11px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.metric-detail-dialog header span { color: var(--blue); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.metric-detail-dialog header h2 { margin: 2px 0 0; font-size: 19px; }
.metric-detail-dialog pre { max-height: min(55vh, 430px); margin: 0; padding: 15px 17px; overflow: auto; color: var(--ink); font: 700 12px/1.75 inherit; white-space: pre-wrap; }
.metric-detail-dialog > p { margin: 0; padding: 8px 17px 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }

@media (max-width: 1050px) {
  .filters.compact { grid-template-columns: repeat(4, 1fr); }
  .search-field { grid-column: span 2; }
}

@media (max-width: 720px) {
  .metric-detail-dialog { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .player-picker { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
  .player-picker header { padding: 13px 14px 10px; }
  .player-picker header h2 { font-size: 21px; }
  .player-picker-filters { padding: 10px 14px; grid-template-columns: 1fr 1fr; }
  .player-picker-filters label:first-child { grid-column: 1 / -1; }
  .player-picker-hint { padding-inline: 14px; }
  .player-picker-table { margin: 0 7px 7px; }
  .topbar { min-height: 56px; padding: 8px 11px; flex-wrap: wrap; gap: 7px; }
  .brand { font-size: 14px; }
  .brand-mark { width: 29px; height: 29px; }
  .season-tabs { order: 3; width: 100%; height: 32px; }
  .season-tab { flex: 1; min-width: 0; padding: 0 7px; }
  .team-switcher span { display: none; }
  .team-switcher select { min-width: 115px; height: 32px; }
  .logout-form span { display: none; }
  .logout-form button { min-height: 32px; }
  .login-shell { padding: 14px; }
  .login-card { padding: 22px 18px; }
  .timeline-shell { height: 45px; padding-inline: 11px; }
  .timeline-label { display: none; }
  .matchday-tab { flex-basis: 29px; height: 29px; }
  .app-shell { display: block; }
  .function-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px 9px;
    display: flex;
    gap: 3px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .function-tab { flex: 0 0 auto; height: 35px; padding-inline: 8px; }
  .function-tab.disabled { display: none; }
  .nav-group { position: relative; flex: 0 0 auto; }
  .nav-group[open] { display: flex; align-items: center; }
  .nav-group > summary { min-width: 104px; }
  .nav-group[open] > summary { min-width: auto; }
  .nav-group[open] .nav-chevron { display: none; }
  .function-subtabs {
    min-width: 0;
    margin: 0 0 0 2px;
    padding: 0;
    position: static;
    display: flex;
    gap: 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .function-subtab { min-height: 35px; padding: 10px 8px; white-space: nowrap; }
  main { padding: 16px 10px 38px; }
  .page-head { align-items: start; }
  .compact-stat { display: none; }
  h1 { font-size: 25px; }
  .subtitle { max-width: 40ch; font-size: 12px; }
  .crosscheck-head { flex-direction: column; }
  .crosscheck-head form { width: 100%; align-items: stretch; flex-direction: column; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading p { text-align: left; }
  .metric-strip.four, .metric-strip.five { grid-template-columns: repeat(2, 1fr); }
  .filters.compact { grid-template-columns: repeat(2, 1fr); }
  .search-field { grid-column: 1 / -1; }
  .workbench-toolbar { align-items: stretch; flex-direction: column; }
  .scenario-jump { width: 100%; }
  .scenario-jump label { flex: 1; }
  .scenario-jump select { width: 100%; min-width: 0; }
  .new-scenario { margin-left: 0; }
  .new-scenario summary { justify-content: center; }
  .new-scenario[open] form {
    width: 100%;
    margin-top: 7px;
    position: static;
    grid-template-columns: 1fr;
    box-shadow: none;
  }
  .board-hint span:first-child { display: none; }
  .roster-board { gap: 8px; }
  .scenario-column { flex-basis: min(350px, calc(100vw - 26px)); }
  .quotations-table { overflow-x: auto; }
  .quotations-table .table-row { min-width: 850px; padding-inline: 8px; }
  .current-roster-layout { grid-template-columns: 1fr; }
  .current-label { display: none; }
  .scenario-manager { align-items: stretch; flex-direction: column; }
  .scenario-picker { width: 100%; }
  .scenario-picker label { flex: 1; min-width: 0; }
  .scenario-picker select { width: 100%; min-width: 0; }
  .scenario-actions > div { position: static; width: 100%; margin-top: 7px; grid-template-columns: 1fr; box-shadow: none; }
  .path-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .path-toolbar > div:first-child { min-width: 0; }
  .path-toolbar p { margin-left: 0; }
  .day-jump { width: 100%; }
  .day-jump label { flex: 1; }
  .day-jump select { width: 100%; }
  .timeline-day { flex-basis: min(286px, calc(100vw - 24px)); }
  .timeline-controls { flex-wrap: wrap; }
  .timeline-scenario-title { margin-left: 0; }
  .scenario-draft-actions { width: 100%; margin-left: 0; }
  .scenario-draft-actions > span { margin-right: auto; text-align: left; }
  .timeline-scenario-title { margin-left: 0; }
  .timeline-board.single .timeline-day { flex-basis: 100%; }
  .lineup-grid { grid-template-columns: 1fr; }
  .result-kpis { grid-template-columns: repeat(2, 1fr); }
  .standings-card { overflow-x: auto; }
  .standing-row { min-width: 450px; }
  .comparison-toolbar { align-items: stretch; flex-direction: column; }
  .comparison-table, .live-score-table, .shock-table { overflow-x: auto; }
  .comparison-table .table-row { min-width: 680px; }
  .live-score-table .table-row, .shock-table .table-row { min-width: 540px; }
  .segment-tabs { width: 100%; overflow-x: auto; }
  .segment-tabs a { flex: 1 0 auto; min-width: 92px; min-height: 38px; display: grid; place-items: center; }
  .result-team-list { overflow-x: auto; }
  .result-team-summary { min-width: 520px; grid-template-columns: 30px minmax(165px, 1fr) 74px 120px 16px; }
  .result-team-detail { min-width: 700px; }
  .result-components { position: sticky; left: 0; grid-template-columns: repeat(5, minmax(112px, 1fr)); }
  .result-lineup-table { overflow-x: auto; }
  .result-player-row { min-width: 660px; }
  .h2h-result-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .h2h-result-grid > .result-team-card { min-width: calc(100vw - 28px); scroll-snap-align: start; }
  .hypotheses-panel > header { align-items: start; flex-direction: column; gap: 4px; }
  .global-hypothesis-toolbar { grid-template-columns: 1fr 90px; }
  .global-hypothesis-toolbar span { grid-column: 1 / -1; }
  .global-hypothesis-table { overflow-x: auto; }
  .global-hypothesis-row { min-width: 570px; }
  input, select, button { min-height: 40px; }
  .lineup-builder-toolbar { align-items: stretch; flex-direction: column; }
  .lineup-builder-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .lineup-side { min-width: calc(100vw - 28px); scroll-snap-align: start; }
  .lineup-player-select { min-height: 42px; font-size: 12px; }
}

@media (pointer: coarse) {
  .desktop-sort-help { display: none; }
  .mobile-sort-help { display: inline; }
  .metric-detail-trigger { cursor: pointer; }
}

/* Serie A e metrica prospettica condivisa */
.outlook-row {
  background-image: linear-gradient(90deg, hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78% / 82%), transparent 58%);
  box-shadow: inset 3px 0 hsl(calc(var(--appeal-score, 50) * 1.2) 68% 43%);
}
.appeal-very-hard { --appeal-bg: #efb2b0; --appeal-accent: #c53d3d; --appeal-ink: #681f22; }
.appeal-hard { --appeal-bg: #f5cfaa; --appeal-accent: #db7c2f; --appeal-ink: #713c12; }
.appeal-balanced { --appeal-bg: #f2e6a6; --appeal-accent: #b99b24; --appeal-ink: #58490c; }
.appeal-easy { --appeal-bg: #c8e8bd; --appeal-accent: #56a34e; --appeal-ink: #245f28; }
.appeal-very-easy { --appeal-bg: #92dab3; --appeal-accent: #16845a; --appeal-ink: #075438; }
.outlook-score { color: var(--appeal-ink); }
.outlook-badge {
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 5px;
  background: hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78%);
  color: var(--appeal-ink);
  font-size: 7px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.source-freshness { margin: 0; color: var(--muted); font-size: 9px; text-align: right; }
.source-freshness strong { color: var(--ink); }
.outlook-controls { display: flex; align-items: end; gap: 7px; }
.outlook-controls label { display: grid; gap: 3px; }
.outlook-controls label > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.outlook-controls select { min-width: 135px; }
.serie-a-tabs { margin-bottom: 14px; }
.serie-a-section-heading { margin: 13px 0 9px; }
.horizon-picker label { display: flex; align-items: center; gap: 7px; }
.horizon-picker label > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.horizon-picker select { min-width: 130px; }
.serie-a-fixtures { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 7px; }
.calendar-day-tabs { margin: 0 0 10px; padding: 5px; display: flex; gap: 3px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; scrollbar-width: thin; }
.calendar-day-tabs a { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 850; text-decoration: none; }
.calendar-day-tabs a:hover { background: #eef3fb; color: var(--ink); }
.calendar-day-tabs a.context-day { box-shadow: inset 0 0 0 1px #9db3da; }
.calendar-day-tabs a.active { background: var(--blue); color: #fff; box-shadow: none; }
.serie-a-fixture { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.serie-a-fixture header { height: 29px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: #f5f7fb; font-size: 9px; }
.serie-a-fixture > div { min-height: 32px; padding: 4px 8px; display: grid; grid-template-columns: minmax(0, 1fr) 30px 29px; align-items: center; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.serie-a-fixture > div strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.serie-a-fixture > div span { color: var(--muted); font-size: 8px; }
.serie-a-fixture > div b { text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
.serie-a-fixture footer { height: 24px; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 850; }
.serie-a-fixture footer.finished { color: var(--ink); }
.outlook-ranking { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.outlook-ranking > header { display: flex; justify-content: space-between; gap: 16px; }
.outlook-ranking > header span, .outlook-ranking > header h2 { display: block; margin: 0; }
.outlook-ranking > header span { color: var(--blue); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.outlook-ranking > header h2 { font-size: 15px; }
.outlook-ranking > header p { max-width: 480px; margin: 0; color: var(--muted); font-size: 9px; text-align: right; }
.outlook-ranking > div { margin-top: 9px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.outlook-ranking article { min-width: 0; padding: 7px 5px; border-radius: 8px; background: hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78%); color: var(--appeal-ink); text-align: center; }
.outlook-ranking article span, .outlook-ranking article strong, .outlook-ranking article small { display: block; }
.outlook-ranking article span { color: var(--muted); font-size: 8px; font-weight: 850; }
.outlook-ranking article strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.outlook-ranking article small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; }
.strength-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.strength-row { min-height: 49px; padding: 5px 10px; display: grid; grid-template-columns: 32px minmax(170px, 1fr) 75px 75px minmax(250px, 1fr); align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); background-image: linear-gradient(90deg, hsl(calc(var(--strength, 50) * 1.2) 65% 52% / 9%), transparent 42%); }
.strength-row:first-child { border-top: 0; }
.strength-row > b:first-child, .strength-row > span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.strength-row > strong small { margin-top: 1px; display: block; color: var(--muted); font-size: 8px; }
.strength-row.overridden { box-shadow: inset 3px 0 0 var(--blue); }
.strength-head { min-height: 31px; background: #f4f7fb; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.strength-pill { width: 44px; padding: 4px; border-radius: 7px; background: hsl(calc(var(--strength) * 1.2) 65% 52% / 15%); text-align: center; font-size: 11px; }
.strength-actions, .strength-actions form { display: flex; align-items: center; gap: 5px; }
.strength-actions input { width: 74px; min-height: 32px; }
.strength-actions button { min-height: 32px; padding: 6px 10px; }
.strength-actions .ghost-button:disabled { opacity: .35; }
.matrix-legend { margin-bottom: 7px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.matrix-legend i { width: 24px; height: 10px; border-radius: 5px; background: var(--appeal-bg); }
.matrix-legend small { margin-left: auto; }
.schedule-matrix-wrap { max-height: calc(100vh - 270px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.schedule-matrix { border-collapse: separate; border-spacing: 0; font-size: 8px; }
.schedule-matrix th, .schedule-matrix td { min-width: 47px; height: 39px; padding: 3px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); text-align: center; }
.schedule-matrix thead th { height: 27px; position: sticky; top: 0; z-index: 2; background: #f3f6fa; color: var(--muted); }
.schedule-matrix th:first-child { min-width: 104px; position: sticky; left: 0; z-index: 3; background: #fff; text-align: left; }
.schedule-matrix th:first-child strong, .schedule-matrix th:first-child small { display: block; }
.schedule-matrix thead th:first-child { z-index: 4; background: #f3f6fa; }
.schedule-matrix td[class*="appeal-"] { background: hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78%); color: var(--appeal-ink); }
.schedule-matrix .matrix-team-cell { background: hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78%); color: var(--appeal-ink); box-shadow: inset 4px 0 hsl(calc(var(--appeal-score, 50) * 1.2) 68% 43%); }
.schedule-matrix .matrix-team-cell { padding-left: 8px; }
.schedule-matrix td strong, .schedule-matrix td span, .schedule-matrix td small { display: block; }
.schedule-matrix td strong { font-size: 9px; }
.schedule-matrix td span { color: var(--muted); font-size: 7px; }
.schedule-matrix td small { min-height: 8px; color: var(--ink); font-size: 7px; }
.schedule-matrix .selected { box-shadow: inset 0 0 0 2px var(--blue); }
.matrix-team-cell.selected { box-shadow: inset 4px 0 var(--appeal-accent), inset 0 0 0 2px var(--blue); }
.matrix-controls { display: flex; align-items: end; gap: 7px; }
.matrix-controls label { display: grid; gap: 3px; }
.matrix-controls label > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.matrix-controls select { min-width: 132px; }
.roster-outlook-flow small, .roster-outlook-flow strong { padding: 1px 4px; border-radius: 5px; background: hsl(calc(var(--appeal-score, 50) * 1.2) 72% 78%); color: var(--appeal-ink) !important; }

@media (max-width: 900px) {
  .serie-a-fixtures { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .outlook-ranking > div { display: flex; overflow-x: auto; }
  .outlook-ranking article { flex: 0 0 78px; }
  .strength-row { min-width: 650px; }
  .strength-table { overflow-x: auto; }
}

@media (max-width: 720px) {
  .roster-page-head { flex-direction: column; }
  .outlook-controls { width: 100%; }
  .outlook-controls label { flex: 1; }
  .outlook-controls select { width: 100%; min-width: 0; }
  .serie-a-head { display: block; }
  .serie-a-head form { margin-top: 10px; justify-content: space-between; }
  .serie-a-fixtures { grid-template-columns: 1fr; }
  .serie-a-section-heading { align-items: stretch; }
  .horizon-picker label { justify-content: space-between; }
  .schedule-matrix-wrap { max-height: calc(100vh - 300px); }
}
