:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65736f;
  --line: #d7dfdc;
  --paper: #f7faf8;
  --panel: #ffffff;
  --green: #177245;
  --green-strong: #0c5c35;
  --blue: #235a97;
  --amber: #b96919;
  --red: #b83931;
  --violet: #6d4ab3;
  --shadow: 0 18px 55px rgba(34, 48, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(23, 114, 69, 0.08), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(35, 90, 151, 0.1), transparent 32%),
    var(--paper);
}

body.dark-mode {
  --ink: #edf5f1;
  --muted: #aab8b2;
  --line: #31443d;
  --paper: #101714;
  --panel: #17211f;
  background:
    linear-gradient(115deg, rgba(23, 114, 69, 0.18), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(35, 90, 151, 0.2), transparent 32%),
    var(--paper);
}

body.dark-mode .sidebar,
body.dark-mode .settings-panel,
body.dark-mode .view-panel,
body.dark-mode .outcome-panel,
body.dark-mode .shared-clean-card,
body.dark-mode .changelog-card,
body.dark-mode .news-card,
body.dark-mode .news-article,
body.dark-mode .empty-state {
  background: rgba(23, 33, 31, 0.92);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .league-card,
body.dark-mode .tier-card,
body.dark-mode .legend-chip,
body.dark-mode .clean-table td,
body.dark-mode .file-button {
  background: #17211f;
  color: var(--ink);
}

body.dark-mode .fixture-row,
body.dark-mode .playoff-match,
body.dark-mode .shared-fixture-row,
body.dark-mode .outcome-item,
body.dark-mode .movement-item,
body.dark-mode .manual-fixture-panel,
body.dark-mode .projection-card,
body.dark-mode .deduction-row,
body.dark-mode .team-fixture-row,
body.dark-mode .dashboard-card,
body.dark-mode .history-card,
body.dark-mode .pyramid-tier,
body.dark-mode .team-stat,
body.dark-mode .bracket-card {
  background: #1d2a26;
}

body.dark-mode .secondary-button,
body.dark-mode .league-pill,
body.dark-mode .status-chip {
  background: #20382f;
  color: #9be0ba;
}

body.dark-mode .ghost-button,
body.dark-mode .tab-button {
  background: #17211f;
  color: var(--ink);
}

body.dark-mode th,
body.dark-mode .empty-note,
body.dark-mode .fixture-state,
body.dark-mode .team-stat span,
body.dark-mode .news-card span,
body.dark-mode .news-article ul {
  color: var(--muted);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
}

.mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid rgba(215, 223, 220, 0.9);
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(23, 33, 31, 0.12);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.15;
}

.brand-block p,
.empty-state p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.file-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: white;
  box-shadow: 0 10px 25px rgba(23, 114, 69, 0.22);
}

.secondary-button {
  background: #eaf3ee;
  color: var(--green-strong);
}

.file-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.file-button input {
  display: none;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: #f8e9e7;
  color: var(--red);
}

.icon-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  background: #edf2f0;
  color: var(--ink);
  font-size: 11px;
}

button:hover {
  transform: translateY(-1px);
}

[hidden],
.page-view[hidden] {
  display: none !important;
}

.home-page,
.changelog-page,
.news-page,
.share-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.home-inner,
.changelog-inner {
  width: min(860px, 100%);
}

.home-inner {
  display: grid;
  gap: 20px;
}

.home-inner h1 {
  max-width: 720px;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.home-inner > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.changelog-inner {
  display: grid;
  gap: 18px;
}

.changelog-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(34, 48, 43, 0.08);
}

.changelog-card h3 {
  font-size: 34px;
}

.changelog-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.release-date {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: #edf2f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.changelog-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.news-card {
  display: grid;
  gap: 12px;
  padding: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(34, 48, 43, 0.08);
  text-align: left;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 114, 69, 0.35);
  box-shadow: 0 18px 42px rgba(34, 48, 43, 0.12);
}

.news-card img,
.news-article img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-card span,
.news-card strong {
  margin: 0 18px;
}

.news-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.news-card strong {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.15;
}

.news-article {
  display: grid;
  gap: 16px;
  max-width: 920px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px rgba(34, 48, 43, 0.1);
}

.news-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.news-share-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.news-article img {
  border-radius: 8px;
}

.news-article h3 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.news-article h4 {
  margin: 8px 0 0;
  font-size: 20px;
}

.news-article ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.news-article p {
  margin: 0;
  line-height: 1.6;
}

.share-page {
  align-items: start;
}

.shared-clean-card {
  width: min(1180px, 100%);
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(34, 48, 43, 0.08);
  overflow: hidden;
}

.shared-tabs {
  padding: 0 18px 16px;
}

.shared-fixtures-list {
  padding-top: 0;
}

.sidebar-section {
  min-height: 0;
}

.section-heading,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2,
.section-title-row h3 {
  font-size: 15px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.league-list,
.tier-list,
.side-actions,
.group-actions {
  display: grid;
  gap: 8px;
}

.group-actions {
  grid-template-columns: 1fr 1fr;
}

.league-card,
.tier-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
}

.league-card.active {
  border-color: rgba(23, 114, 69, 0.5);
  box-shadow: inset 4px 0 0 var(--green);
}

.league-card strong,
.tier-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-card span,
.tier-card span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

.topbar-actions,
.action-group,
.dialog-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 16px;
  max-width: 560px;
  margin: 12vh auto 0;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.empty-state[hidden] {
  display: none;
}

.empty-art {
  display: grid;
  grid-template-columns: repeat(4, 32px);
  align-items: end;
  gap: 8px;
  height: 88px;
}

.empty-art div {
  border-radius: 7px 7px 0 0;
  background: var(--green);
}

.empty-art div:nth-child(1) {
  height: 62px;
}

.empty-art div:nth-child(2) {
  height: 84px;
  background: var(--blue);
}

.empty-art div:nth-child(3) {
  height: 48px;
  background: var(--amber);
}

.empty-art div:nth-child(4) {
  height: 28px;
  background: var(--red);
}

.league-editor {
  display: grid;
  gap: 18px;
}

.settings-panel,
.table-section,
.outcome-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(34, 48, 43, 0.08);
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-grid,
.graphics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.dashboard-card,
.history-card,
.pyramid-tier {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.dashboard-card span,
.history-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-card strong {
  font-size: 22px;
}

.pyramid-ladder,
.history-panel {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.pyramid-tier div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.league-pill {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #eaf3ee;
  color: var(--green-strong);
  font-weight: 900;
}

.playoff-format-toggle {
  margin: 0 16px;
}

.playoff-format-toggle input {
  width: auto;
  min-height: auto;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(130px, 0.6fr) minmax(160px, 0.8fr);
  gap: 14px;
}

.field-row:nth-child(2) {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.field-row.four,
.field-row.four:nth-child(2) {
  grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 0.85fr) minmax(110px, 0.55fr) minmax(150px, 0.8fr);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus {
  outline: 3px solid rgba(23, 114, 69, 0.17);
  border-color: rgba(23, 114, 69, 0.65);
}

.view-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 35px rgba(34, 48, 43, 0.08);
}

.section-title-row {
  padding: 18px 18px 0;
}

.section-title-row.compact {
  padding: 16px 16px 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}

.rank-col {
  width: 52px;
}

.small-col {
  width: 72px;
}

.move-col {
  width: 94px;
}

td input,
td select {
  min-height: 36px;
}

.custom-tag {
  margin-top: 6px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
}

.rank-pill {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: #6b7773;
  font-weight: 800;
}

tr.zone-auto .rank-pill {
  background: var(--green);
}

tr.zone-playoff .rank-pill {
  background: var(--blue);
}

tr.zone-relplayoff .rank-pill {
  background: var(--amber);
}

tr.zone-relegation .rank-pill {
  background: var(--red);
}

tr.zone-custom .rank-pill {
  background: var(--custom-zone, var(--violet));
}

.team-actions {
  display: flex;
  gap: 6px;
}

.team-edit-cell {
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr);
  gap: 8px;
  align-items: center;
}

.team-color-input {
  width: 42px;
  padding: 3px;
}

.team-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: -1px;
}

.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.outcome-panel {
  min-height: 210px;
}

.bracket-stage {
  display: grid;
  gap: 18px;
  padding: 0 18px 18px;
}

.bracket-panel {
  display: grid;
  gap: 14px;
}

.bracket-panel h4 {
  margin: 0;
  font-size: 15px;
}

.bracket-rounds {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bracket-round {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 230px;
}

.bracket-round > strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.bracket-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.bracket-team {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  font-weight: 800;
}

.bracket-team.winner {
  box-shadow: inset 4px 0 0 var(--green);
}

.bracket-meta {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}

.bracket-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.outcome-list,
.movement-list {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
}

.outcome-item,
.movement-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f6f4;
  color: var(--ink);
  font-size: 13px;
}

.outcome-item span,
.movement-item span {
  color: var(--muted);
  font-weight: 700;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.race-tabs {
  padding: 0 18px 16px;
}

.tab-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  border-color: rgba(23, 114, 69, 0.45);
  background: var(--green);
  color: white;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.inline-actions select {
  width: auto;
  min-width: 160px;
}

.inline-actions select,
.inline-actions button,
.inline-actions input {
  min-width: 150px;
}

.rewind-box {
  display: grid;
  gap: 12px;
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.rewind-table-box {
  display: grid;
  gap: 6px;
}

.rewind-row {
  display: grid;
  grid-template-columns: 42px minmax(160px, 1fr) 70px 80px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
}

.graphics-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.manual-fixture-panel {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.fixtures-list {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.fixtures-list.calendar-mode {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  align-items: start;
}

.fixtures-list.calendar-mode .gameweek {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f7faf8;
  min-width: 0;
}

.fixtures-list.calendar-mode .fixture-row {
  grid-template-columns: 1fr;
}

.fixtures-list.calendar-mode .fixture-row > span:first-child {
  text-align: left;
}

.gameweek {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.gameweek h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.fixture-row,
.playoff-match,
.shared-fixture-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 72px 24px 72px minmax(120px, 1fr) 140px auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f1f6f4;
}

.fixture-actions {
  display: flex;
  gap: 8px;
}

.playoff-match {
  grid-template-columns: 92px minmax(120px, 1fr) 72px 24px 72px minmax(120px, 1fr);
}

.fixture-row > span:first-child,
.shared-fixture-row > span:first-child {
  text-align: right;
}

.fixture-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.fixture-separator,
.round-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.form-dots {
  display: flex;
  gap: 5px;
}

.form-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 900;
}

.form-dot.w {
  background: var(--green);
}

.form-dot.d {
  background: #87918e;
}

.form-dot.l {
  background: var(--red);
}

.status-chip,
.winner-strip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eaf3ee;
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 900;
}

.winner-strip {
  border-radius: 8px;
  justify-content: center;
  background: #edf2fb;
  color: var(--blue);
}

.clean-table td {
  background: rgba(255, 255, 255, 0.52);
}

.team-link {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.team-link:hover {
  color: var(--green-strong);
  transform: none;
}

.movement-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.badge-promoted {
  background: var(--green);
}

.badge-relegated {
  background: var(--red);
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: white;
  color: var(--muted);
  font-size: 12px;
}

.legend-chip span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.rollover-summary {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.deduction-notes {
  display: grid;
  gap: 4px;
  padding: 0 18px 18px;
}

.deduction-notes p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.deductions-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.deduction-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f1f6f4;
}

.projections-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.projection-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.projection-card h4 {
  margin: 0;
  font-size: 15px;
}

.projection-line {
  display: grid;
  gap: 6px;
}

.projection-line strong {
  color: var(--green-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.projection-line span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.team-fixture-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.team-profile-card {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.team-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.team-profile-header h3 {
  font-size: 28px;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.team-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: #f1f6f4;
}

.team-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-stat strong {
  font-size: 22px;
}

.team-profile-fixtures {
  display: grid;
  gap: 8px;
}

.team-fixture-row {
  display: grid;
  grid-template-columns: 64px minmax(110px, 1fr) 58px minmax(110px, 1fr) 82px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f1f6f4;
  font-size: 13px;
}

.team-fixture-row span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.score-box {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  border: 2px solid #87918e;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.score-box.win {
  border-color: var(--green);
  color: var(--green-strong);
}

.score-box.loss {
  border-color: var(--red);
  color: var(--red);
}

.score-box.draw,
.score-box.future {
  border-color: #87918e;
  color: var(--muted);
}

.fixture-note {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fixture-note span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eaf3ee;
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 900;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: white;
  resize: vertical;
  font: inherit;
}

.share-dialog-body {
  justify-items: stretch;
}

.share-qr {
  width: 220px;
  height: 220px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}

.toast.success {
  border-color: rgba(23, 114, 69, 0.35);
}

.toast.warn {
  border-color: rgba(185, 105, 25, 0.45);
}

dialog::backdrop {
  background: rgba(23, 33, 31, 0.35);
}

.dialog-body {
  display: grid;
  gap: 18px;
}

.dialog-body h2 {
  font-size: 20px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .outcomes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .field-row,
  .field-row:nth-child(2),
  .field-row.four,
  .field-row.four:nth-child(2),
  .group-actions,
  .manual-fixture-panel,
  .deduction-row,
  .fixture-row,
  .shared-fixture-row,
  .playoff-match,
  .team-fixture-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-actions,
  .action-group,
  .home-actions {
    align-items: stretch;
  }

  .topbar-actions button,
  .action-group button,
  .home-actions button {
    width: 100%;
  }

  .fixture-actions {
    display: grid;
  }
}
