:root {
  /* Shared light-theme tokens. Components read these variables instead of
     repeating colors and shadows in every rule. */
  color-scheme: light;
  --bg: #fcfcfb;
  --panel: #ffffff;
  --text: #102a43;
  --muted: #5f6c7b;
  --line: #d7e3f0;
  --border: #d7e3f0;
  --soft: #f8fbff;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --green: #16a34a;
  --green-soft: #d1fae5;
  --red: #dc2626;
  --input: #eff6ff;
  --score-input: #e0f2fe;
  --field-bg: #f8fbff;
  --table-head: #e7f0ff;
  --table-foot: #eef5ff;
  --focus: rgba(56, 144, 255, 0.18);
  --shadow: 0 24px 60px rgba(37, 78, 119, 0.12);
}

:root[data-theme="night"] {
  /* Night mode only swaps variables, which keeps the component rules simple. */
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #475569;
  --border: #475569;
  --soft: #111827;
  --blue: #60a5fa;
  --blue-strong: #2563eb;
  --green: #34d399;
  --green-soft: #0f172a;
  --red: #f87171;
  --input: #1e293b;
  --score-input: #153e75;
  --field-bg: #111827;
  --table-head: #1e293b;
  --table-foot: #111827;
  --focus: rgba(96, 165, 250, 0.18);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  /* The shell elements do the heavy visual lifting, so the body stays clean
     and neutral. */
  margin: 0;
  min-width: 320px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  /* Wider layout for the calculator, which needs room for the score tables. */
  width: min(1680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.landing-shell {
  /* Narrower layout for the landing and audit pages. */
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  /* Shared header row for navigation and global controls. */
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-actions {
  /* Push language/theme actions to the right edge of the header. */
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
}

.home-link {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  transform: translateY(-1px);
  color: #ffffff;
  background: var(--blue);
}

.home-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.landing-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.language-picker {
  width: 180px;
}

.theme-toggle {
  /* Compact segmented control for day/night appearance. */
  display: flex;
  align-items: stretch;
  height: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.icon-button:first-child {
  border-top-left-radius: 9px;
  border-bottom-left-radius: 9px;
}

.icon-button:last-child {
  border-top-right-radius: 9px;
  border-bottom-right-radius: 9px;
}

.icon-button:hover,
.icon-button.active {
  color: #ffffff;
  background: var(--blue);
}

:root:not([data-theme="night"]) .icon-button:hover,
:root:not([data-theme="night"]) .icon-button.active {
  color: #ffffff;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.eyebrow {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.text-button {
  min-height: auto;
  margin-top: 6px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--blue-strong);
  background: transparent;
}

.landing-panel {
  /* Card-like shell used by the landing and verification views. */
  display: grid;
  gap: 26px;
  padding: 32px 36px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(251,251,249,0.96));
  box-shadow: var(--shadow);
}

.landing-copy {
  max-width: 720px;
}

.verify-shell .landing-copy {
  max-width: none;
}

.landing-copy h2 {
  /* Give the landing headline a stronger visual hierarchy than the body text. */
  margin: 0 0 12px;
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.03em;
}

.landing-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.landing-panel:not(.verify-results) {
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.98));
}

.disclaimer {
  width: min(1680px, calc(100vw - 32px));
  margin: -20px auto 0;
  padding: 0 0 36px;
  color: rgba(95, 108, 123, 0.48);
}

.landing-shell ~ .disclaimer {
  width: min(980px, calc(100vw - 32px));
}

.disclaimer p {
  margin: 0;
  padding-top: 16px;
  font-size: 12px;
  line-height: 1.5;
}

.disclaimer strong {
  color: rgba(16, 42, 67, 0.42);
}

.disclaimer a {
  color: rgba(37, 99, 235, 0.45);
  font-weight: 700;
}

.copyright-line {
  margin: 8px 0 0;
  color: rgba(95, 108, 123, 0.42);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

#auditCopyrightNotice {
  user-select: none;
}

.season-form {
  display: grid;
  gap: 18px;
}

.season-form fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.season-form legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.season-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
}

.season-option input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.season-option strong,
.season-option small {
  display: block;
}

.season-option strong {
  margin-bottom: 4px;
}

.season-option small,
.sov-status-list {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.task-option small {
  max-width: 720px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.97));
  box-shadow: 0 18px 34px rgba(37, 78, 119, 0.08);
}

.task-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -52px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0) 72%);
  pointer-events: none;
}

.task-card--auditor::after {
  background: radial-gradient(circle, rgba(22, 163, 74, 0.12), rgba(22, 163, 74, 0) 72%);
}

.task-card-brand {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 100%;
  margin-bottom: 2px;
}

.task-card-brand-link {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.task-card-brand-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 18px;
}

.task-card-logo {
  width: clamp(115px, 13.75vw, 158px);
  height: auto;
  flex: none;
  filter: drop-shadow(0 14px 20px rgba(37, 78, 119, 0.12));
}

.landing-shell .task-card-logo {
  width: clamp(230px, 27.5vw, 316px);
}

.landing-shell .task-card {
  min-height: 420px;
}

.task-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.task-card-brand + div {
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

.task-card .primary-action {
  position: relative;
  z-index: 1;
  justify-self: stretch;
  width: 100%;
}

.competitive-season-block {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.outside-card-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.competitive-season-card {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.98));
  box-shadow: var(--shadow);
}

.sov-season-card {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}

.season-accordion {
  gap: 0;
  align-items: center;
}

.season-accordion.is-open {
  gap: 12px;
}

.season-accordion.sov-all-current {
  border-color: rgba(22, 163, 74, 0.16);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(247, 255, 251, 0.97));
}

.season-accordion.sov-has-outdated {
  border-color: rgba(220, 38, 38, 0.16);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(255, 247, 247, 0.97));
}

.season-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  grid-column: 1 / -1;
}

.season-accordion-label {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}

.season-accordion-toggle {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #4a4a4a;
  background: #f1f5f9;
  cursor: pointer;
  appearance: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.season-accordion .sov-inline-warning {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.season-accordion-toggle:hover,
.season-accordion-toggle:focus-visible {
  color: var(--text);
  border-color: rgba(37, 78, 119, 0.24);
  background: #e9eff9;
}

.season-accordion-toggle-hide[hidden],
.season-accordion-toggle-show[hidden] {
  display: none;
}

.season-accordion-body {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  pointer-events: none;
  transition: max-height 600ms ease, opacity 600ms ease, transform 600ms ease, visibility 0s linear 600ms;
}

.season-accordion.is-open .season-accordion-body {
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: max-height 600ms ease, opacity 600ms ease, transform 600ms ease, visibility 0s linear 0s;
}

.season-accordion-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
}

.season-accordion-select select {
  width: clamp(120px, 9ch + 2rem, 152px);
  max-width: 100%;
  align-self: center;
}

.section-heading-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:root[data-theme="night"] .season-accordion-select select {
  color-scheme: dark;
  border-color: var(--line);
  color: var(--text);
  background: var(--field-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="night"] .season-accordion-toggle {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(51, 65, 85, 0.96);
  color: #e2e8f0;
}

:root[data-theme="night"] .season-accordion .sov-inline-warning {
  color: #ff8a80;
}

:root[data-theme="night"] .season-accordion-toggle:hover,
:root[data-theme="night"] .season-accordion-toggle:focus-visible {
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 41, 59, 0.96);
}

:root[data-theme="night"] .season-accordion.sov-all-current {
  border-color: rgba(34, 197, 94, 0.22);
  background: linear-gradient(180deg, rgba(15, 81, 50, 0.34), rgba(15, 23, 42, 0.96));
}

:root[data-theme="night"] .season-accordion.sov-has-outdated {
  border-color: rgba(248, 113, 113, 0.22);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.32), rgba(15, 23, 42, 0.96));
}

:root[data-theme="night"] .audit-card,
:root[data-theme="night"] .season-card,
:root[data-theme="night"] .landing-panel,
:root[data-theme="night"] .verify-form .url-picker,
:root[data-theme="night"] .verify-summary-panel,
:root[data-theme="night"] .failure-table {
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.96));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="night"] .input-method-picker label {
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(17, 24, 39, 0.96));
}

:root[data-theme="night"] .input-method-picker label:has(input:checked) {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.12);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

:root[data-theme="night"] .audit-card-title {
  color: var(--text);
}

:root[data-theme="night"] .audit-card-copy {
  color: var(--muted);
}

:root[data-theme="night"] .score-panel,
:root[data-theme="night"] .summary-grid .score-panel {
  background: #274a83;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme="night"] .drop-zone {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

:root[data-theme="night"] .drop-zone.drag-active {
  background: rgba(96, 165, 250, 0.14);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

:root[data-theme="night"] .drop-zone-art::before {
  background: radial-gradient(circle at 38% 36%, rgba(59, 130, 246, 0.22), rgba(30, 41, 59, 0.9) 58%, rgba(15, 23, 42, 0.96));
}

:root[data-theme="night"] .drop-zone-folder,
:root[data-theme="night"] .drop-zone-folder::before {
  background: linear-gradient(180deg, #77b5ff, #5a96ea);
}

:root[data-theme="night"] .drop-zone-badge {
  background: rgba(241, 245, 249, 0.7);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
}

:root[data-theme="night"] .drop-zone-plus {
  color: #60a5fa;
}

:root[data-theme="night"] .sov-status-list {
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme="night"] .sov-status-list li {
  border-bottom-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.96);
}

:root[data-theme="night"] .sov-status-list li:nth-child(even):not(.is-outdated) {
  background: rgba(22, 101, 52, 0.16);
}

:root[data-theme="night"] .sov-status-list li.is-outdated {
  background: rgba(127, 29, 29, 0.28);
}

:root[data-theme="night"] .sov-status-date {
  color: var(--muted);
}

:root[data-theme="night"] .row-clear {
  border-color: rgba(134, 239, 172, 0.35);
  background: rgba(22, 101, 52, 0.24);
  color: #dcfce7;
}

:root[data-theme="night"] .row-insert {
  border-color: rgba(34, 197, 94, 0.35);
  background: #15803d;
}

:root[data-theme="night"] .row-delete {
  border-color: rgba(248, 113, 113, 0.4);
  background: #934454;
}

:root[data-theme="night"] #clearButton {
  background: rgba(22, 101, 52, 0.24);
  color: #dcfce7;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

:root[data-theme="night"] #clearButton:hover {
  background: rgba(22, 101, 52, 0.34);
}

.sov-status-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sov-status-panel.compact {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sov-status-panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.sov-inline-warning {
  color: #b42318;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.sov-status-list {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.sov-status-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(37, 78, 119, 0.08);
  background: #ffffff;
}

.sov-status-list li.is-outdated {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  background: #fee2e2;
}

.sov-status-list li:nth-child(even):not(.is-outdated) {
  background: var(--green-soft);
}

.sov-status-list li:last-child {
  border-bottom: 0;
}

.sov-status-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sov-status-date {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

.calculator-sov-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.calculator-sov-grid li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: 999px;
  background: var(--green-soft);
  box-shadow: 0 4px 10px rgba(37, 78, 119, 0.04);
}

.calculator-sov-grid li:nth-child(even):not(.is-outdated) {
  background: var(--green-soft);
}

.calculator-sov-grid li.is-outdated {
  background: #fee2e2;
}

.calculator-sov-grid .sov-status-label {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.1;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calculator-sov-grid .sov-status-date {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}

:root[data-theme="night"] .calculator-sov-grid {
  border: 0;
}

:root[data-theme="night"] .calculator-sov-grid li {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(22, 101, 52, 0.22);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

:root[data-theme="night"] .calculator-sov-grid li:nth-child(even):not(.is-outdated) {
  background: rgba(22, 101, 52, 0.22);
}

:root[data-theme="night"] .calculator-sov-grid li.is-outdated {
  background: rgba(127, 29, 29, 0.28);
}

.sov-status-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.sov-status-icon.current {
  color: var(--green);
}

.sov-status-icon.outdated {
  color: #b42318;
}

.sheet-status-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.sheet-status-icon.current {
  background: var(--green);
  color: #ffffff;
}

.sheet-status-icon.unmatched {
  background: #fbbf24;
  color: #ffffff;
}

.sheet-status-icon.previous-sov {
  background: #f6c453;
  color: #5f3b00;
}

.sheet-status-icon.unverified {
  background: #f6c453;
  color: #5f3b00;
}

.sheet-status-icon.invalid-page {
  background: #000000;
  color: #ffffff;
}

.sheet-status-icon.outdated {
  background: var(--red);
  color: #ffffff;
}

.sheet-status-icon.skipped {
  background: var(--muted);
  color: #ffffff;
}

.sheet-pdf-link {
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  text-decoration: none;
}

.sheet-pdf-link:hover,
.sheet-pdf-link:focus-visible {
  text-decoration: none;
  background: rgba(220, 38, 38, 0.08);
  border-radius: 10px;
}

.sheet-pdf-icon {
  display: block;
  width: 20px;
  height: auto;
}

.primary-action {
  justify-self: start;
  min-width: 220px;
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  box-shadow: 0 12px 24px rgba(37, 78, 119, 0.18);
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 78, 119, 0.2);
  background: linear-gradient(135deg, var(--blue-strong), var(--blue));
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.64;
  box-shadow: none;
}

.verify-shell {
  width: min(1180px, calc(100vw - 32px));
}

.back-link {
  display: inline-block;
  margin: 0 0 8px;
}

.verify-form {
  display: grid;
  gap: 20px;
}

.audit-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(251,251,249,0.97));
  border: 1px solid rgba(37, 78, 119, 0.08);
  box-shadow: 0 18px 34px rgba(37, 78, 119, 0.07);
}

.audit-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}

.season-card {
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: start;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.97));
  border: 1px solid rgba(37, 78, 119, 0.08);
}

.audit-source-header {
  display: grid;
  gap: 10px;
  align-items: start;
}

.audit-source-card {
  align-content: start;
  width: min(70vw, 100%);
  justify-self: center;
}

.audit-card-title {
  margin: 0;
}

.audit-card-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.input-card-body {
  display: grid;
  gap: 12px;
}

.input-method-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.input-method-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.input-method-picker label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.97));
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.input-method-picker input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.input-method-picker label:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.input-method-picker label:has(input:focus-visible) {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.verify-form .file-picker,
.verify-form .url-picker {
  display: none;
  align-self: stretch;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.verify-form .file-picker.active,
.verify-form .url-picker.active {
  display: grid;
}

.verify-form .file-picker {
  cursor: pointer;
}

.verify-form .file-picker input[type="file"] {
  display: none;
}

.verify-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.verify-form input[type="file"],
.verify-form input[type="url"] {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
}

#baseUrl::placeholder {
  color: #d8e0ea;
  opacity: 1;
}

.file-picker,
.url-picker {
  align-self: stretch;
}

.file-picker,
.url-picker {
  grid-column: 1 / -1;
}

.audit-source-footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  justify-items: center;
  gap: 8px;
  padding: 0 2px 0;
}

.audit-pdf-button[hidden] {
  display: none;
}

.audit-pdf-button {
  justify-self: center;
  min-width: 180px;
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 224px;
  border: 2px dashed rgba(37, 99, 235, 0.24);
  border-radius: 28px;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(239, 245, 255, 0.92));
  box-shadow: inset 0 0 0 1px rgba(37, 78, 119, 0.04);
  color: var(--text);
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.drop-zone:hover {
  transform: translateY(-1px);
}

.drop-zone.drag-active {
  border-color: var(--blue);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.drop-zone-art {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 0;
}

.drop-zone-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 36%, rgba(255, 255, 255, 0.8), rgba(220, 230, 255, 0.92) 56%, rgba(209, 223, 255, 0.88));
}

.drop-zone-folder {
  position: absolute;
  left: 29px;
  top: 34px;
  width: 62px;
  height: 39px;
  border-radius: 7px;
  background: linear-gradient(180deg, #8fc0ff, #74a8ee);
  box-shadow: 0 10px 18px rgba(37, 78, 119, 0.14);
}

.drop-zone-folder::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -7px;
  width: 23px;
  height: 11px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #8fc0ff, #74a8ee);
}

.drop-zone-badge {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(37, 78, 119, 0.16);
}

.drop-zone-plus {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--blue);
}

.drop-zone-plus::before {
  content: "+";
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.drop-zone strong,
.drop-zone small {
  text-transform: none;
}

.drop-zone strong {
  color: #6b7280;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.08;
  max-width: 30ch;
  width: min(100%, 30ch);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.drop-zone small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.1;
}

.pdf-preview-container {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

.pdf-preview-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.pdf-preview-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.1);
  border-radius: 7px;
}

.pdf-preview-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pdf-preview-meta {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pdf-preview-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}

.pdf-preview-size {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}

.audit-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
}

.audit-progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-progress[hidden] {
  display: none;
}

.audit-progress-spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(37, 99, 235, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: audit-spin 820ms linear infinite;
}

.audit-progress-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
}

.audit-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--blue);
  transition: width 180ms ease;
}

.audit-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.audit-progress-copy {
  display: grid;
  gap: 4px;
}

.audit-progress-stage {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes audit-spin {
  to {
    transform: rotate(360deg);
  }
}

:root[data-theme="night"] .audit-progress-stage {
  color: var(--text);
}

.verify-results {
  margin-top: 16px;
}

.verify-summary-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.verify-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.verify-summary-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.verify-summary-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.summary-bar-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  min-width: 0;
  min-height: 280px;
  padding: 16px 14px 14px;
  border: 1px solid rgba(37, 78, 119, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.98));
  box-shadow: 0 12px 24px rgba(37, 78, 119, 0.05);
}

.summary-bar-count {
  display: block;
  color: var(--text);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.summary-bar-label {
  display: block;
  min-height: 2.8em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-bar-track {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  height: 160px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(232, 240, 255, 0.9), rgba(242, 246, 252, 0.98));
  overflow: hidden;
}

.summary-bar-track::before {
  content: "";
  position: absolute;
  inset: 10px 10px auto;
  height: 1px;
  background: rgba(37, 78, 119, 0.08);
  box-shadow:
    0 34px 0 rgba(37, 78, 119, 0.08),
    0 68px 0 rgba(37, 78, 119, 0.08),
    0 102px 0 rgba(37, 78, 119, 0.08),
    0 136px 0 rgba(37, 78, 119, 0.08);
  pointer-events: none;
}

.summary-bar-fill {
  position: relative;
  z-index: 1;
  display: block;
  width: 50%;
  height: 0%;
  min-height: 0;
  margin-inline: auto;
  border-radius: 0;
  background: var(--summary-bar-color, var(--blue));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 18px rgba(37, 78, 119, 0.14);
  transition: height 220ms ease;
}

.summary-bar-card[data-summary-metric="pdfScans"] {
  --summary-bar-color: #2f6fed;
}

.summary-bar-card[data-summary-metric="pages"] {
  --summary-bar-color: #2f6fed;
}

.summary-bar-card[data-summary-metric="sheets"] {
  --summary-bar-color: #17a34a;
}

.summary-bar-card[data-summary-metric="invalidPages"] {
  --summary-bar-color: #000000;
}

.verify-summary-pie-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 280px;
  container-type: inline-size;
  padding: 16px;
  border: 1px solid rgba(37, 78, 119, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.98));
  box-shadow: 0 12px 24px rgba(37, 78, 119, 0.05);
  --summary-color-verified: #17a34a;
  --summary-color-calculation-errors: #d64545;
  --summary-color-missing-marks: #2f6fed;
  --summary-color-uncertain: #d18b00;
}

.summary-pie-title {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.summary-pie-content {
  display: grid;
  grid-template-columns: minmax(140px, 160px) minmax(0, max-content);
  align-items: center;
  justify-content: center;
  column-gap: 28px;
}

@container (max-width: 300px) {
  .summary-pie-content {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .summary-pie {
    justify-self: center;
  }

  .summary-pie-content .summary-pie-legend {
    justify-self: center;
    width: max-content;
    text-align: left;
  }
}

.summary-pie {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 160px);
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--summary-color-verified) 0deg 100deg,
    var(--summary-color-calculation-errors) 100deg 190deg,
    var(--summary-color-missing-marks) 190deg 280deg,
    var(--summary-color-uncertain) 280deg 360deg
  );
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), 0 14px 28px rgba(37, 78, 119, 0.14);
}

.summary-pie::after {
  content: "";
  position: absolute;
  inset: 23%;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(37, 78, 119, 0.06), 0 12px 24px rgba(37, 78, 119, 0.08);
}

.summary-pie-center {
  position: absolute;
  inset: 23%;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  pointer-events: none;
}

.summary-pie-status-icon {
  color: var(--summary-status-color, var(--summary-color-verified));
  display: inline-block;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 900;
  line-height: 1;
  transform-origin: center center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.summary-pie-status-icon.is-entering {
  animation: summaryPieStatusPop 1s cubic-bezier(0.16, 1, 0.3, 1) 1;
}

#summaryPieChart[data-summary-status="calculationErrors"] .summary-pie-status-icon {
  --summary-status-color: var(--summary-color-calculation-errors);
}

#summaryPieChart[data-summary-status="missingMarks"] .summary-pie-status-icon {
  --summary-status-color: var(--summary-color-missing-marks);
}

#summaryPieChart[data-summary-status="uncertain"] .summary-pie-status-icon {
  --summary-status-color: var(--summary-color-uncertain);
}

#summaryPieChart[data-summary-status="verified"] .summary-pie-status-icon {
  --summary-status-color: var(--summary-color-verified);
}

#summaryPieChart[data-summary-status="invalidPages"] .summary-pie-status-icon {
  --summary-status-color: #000000;
}

@keyframes summaryPieStatusPop {
  0% {
    transform: translateX(-25px) scale(0);
  }

  66% {
    transform: translateX(-6px) scale(1.5);
  }

  100% {
    transform: translateX(0) scale(1);
  }
}

.summary-pie-legend {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-self: start;
}

.summary-pie-legend li {
  --summary-swatch-color: var(--blue);
  display: grid;
  grid-template-columns: 14px max-content max-content;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
  padding-left: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.summary-pie-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--summary-swatch-color);
  box-shadow: 0 0 0 3px rgba(37, 78, 119, 0.06);
}

.summary-pie-label {
  min-width: 0;
}

.summary-pie-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.summary-pie-link:hover,
.summary-pie-link:focus-visible {
  color: var(--blue-strong);
}

.summary-pie-count {
  white-space: nowrap;
}

.summary-pie-legend li[data-summary-slice="verified"] {
  --summary-swatch-color: var(--summary-color-verified);
}

.summary-pie-legend li[data-summary-slice="calculationErrors"] {
  --summary-swatch-color: var(--summary-color-calculation-errors);
}

.summary-pie-legend li[data-summary-slice="missingMarks"] {
  --summary-swatch-color: var(--summary-color-missing-marks);
}

.summary-pie-legend li[data-summary-slice="uncertain"] {
  --summary-swatch-color: var(--summary-color-uncertain);
}

.summary-pie-legend li[data-summary-slice="invalidPages"] {
  --summary-swatch-color: #000000;
}

:root[data-theme="night"] .verify-summary-panel,
:root[data-theme="night"] .verify-summary-pie-card,
:root[data-theme="night"] .summary-bar-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.96));
}

:root[data-theme="night"] .summary-bar-card {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

:root[data-theme="night"] .summary-bar-label {
  color: var(--muted);
}

:root[data-theme="night"] .summary-bar-track {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.96));
}

:root[data-theme="night"] .summary-bar-track::before {
  background: rgba(148, 163, 184, 0.12);
  box-shadow:
    0 34px 0 rgba(148, 163, 184, 0.12),
    0 68px 0 rgba(148, 163, 184, 0.12),
    0 102px 0 rgba(148, 163, 184, 0.12),
    0 136px 0 rgba(148, 163, 184, 0.12);
}

:root[data-theme="night"] .summary-pie {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 14px 28px rgba(0, 0, 0, 0.24);
}

:root[data-theme="night"] .summary-pie::after {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.1), 0 12px 24px rgba(0, 0, 0, 0.18);
}

:root[data-theme="night"] .failure-table {
  color: #cbd5e1;
}

:root[data-theme="night"] .failure-table th,
:root[data-theme="night"] .failure-table td {
  color: #cbd5e1;
}

:root[data-theme="night"] .sheet-group-row td {
  background: rgba(37, 99, 235, 0.24);
  color: #cbd5e1;
}

:root[data-theme="night"] .sheet-group-row-pdf,
:root[data-theme="night"] .sheet-group-row-category {
  color: #cbd5e1;
}

:root[data-theme="night"] .sheet-group-row-format {
  border-color: rgba(203, 213, 225, 0.72);
  color: #e2e8f0;
}

:root[data-theme="night"] .sheet-page-link {
  color: #cbd5e1;
}

:root[data-theme="night"] .failure-table tbody tr:not(.sheet-group-row):not(.sheet-summary-sizer) td {
  background: rgba(15, 81, 50, 0.18);
}

.failure-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(251,251,249,0.98));
  box-shadow: 0 12px 24px rgba(37, 78, 119, 0.06);
  color: #4b5563;
  font-size: 12px;
}

.failure-table col.failure-status-col {
  width: 28px;
}

.failure-table col.failure-summary-col {
  width: auto;
}

.failure-table tr.summary-scroll-target {
  animation: summary-row-highlight 1800ms ease;
}

.failure-table tr.sheet-summary-sizer {
  visibility: hidden;
  height: 0;
}

.failure-table tr.sheet-summary-sizer td {
  padding: 0;
  border: 0;
  line-height: 0;
}

@keyframes summary-row-highlight {
  0%,
  100% {
    background: transparent;
  }

  20%,
  70% {
    background: rgba(251, 191, 36, 0.18);
  }
}

.failure-table th,
.failure-table td {
  text-align: left;
  padding: 7px 14px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.3;
}

.failure-table th:first-child,
.failure-table td:first-child {
  width: 28px;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}

.failure-table td:nth-child(2) {
  width: auto;
}

.sheet-group-row td {
  padding-top: 9px;
  padding-bottom: 9px;
  background: #e8f1ff;
  color: #4b5563;
  font-weight: 700;
  text-align: left !important;
}

.sheet-group-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.sheet-group-row-pdf,
.sheet-group-row-category,
.sheet-group-row-format {
  min-width: 0;
  color: #4b5563;
}

.sheet-group-row-pdf {
  flex: 1 1 auto;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-group-row-category {
  flex: 0 1 auto;
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.02em;
  max-width: min(44vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-group-row-format {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid rgba(75, 85, 99, 0.62);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.failure-table tbody tr:not(.sheet-group-row):not(.sheet-summary-sizer) td {
  background: #f6fbf6;
}

.failure-table tbody tr:not(.sheet-group-row):not(.sheet-summary-sizer):nth-child(even) td {
  background: #f0f8f0;
}

.failure-line {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 10px;
  line-height: 1.25;
}

.sheet-summary-missing {
  color: var(--blue);
  font-weight: 700;
}

.sheet-summary-calculation {
  color: var(--red);
  font-weight: 700;
}

.sheet-summary-uncertain {
  color: #d18b00;
  font-weight: 700;
}

.sheet-page-link {
  color: #4b5563;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.sheet-page-link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.sheet-match-action {
  min-height: 26px;
  border: 1px solid rgba(17, 121, 91, 0.42);
  border-radius: 999px;
  padding: 3px 10px;
  color: #11795b;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.sheet-match-action:hover,
.sheet-match-action:focus-visible {
  color: #ffffff;
  background: #11795b;
  outline: none;
}

:root[data-theme="night"] .sheet-match-action {
  border-color: rgba(110, 231, 183, 0.55);
  color: #a7f3d0;
}

:root[data-theme="night"] .sheet-match-action:hover,
:root[data-theme="night"] .sheet-match-action:focus-visible {
  color: #ffffff;
  background: #059669;
}

.parsed-preview {
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  position: relative;
  isolation: isolate;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
}

.parsed-preview-content {
  min-height: 0;
  overflow: auto;
  padding: 24px 24px 20px;
}

.parsed-preview-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--soft);
  position: relative;
}

.parsed-preview-footer[hidden] {
  display: none;
}

.parsed-preview-footer--unmatched {
  border-top-color: rgba(217, 119, 6, 0.55);
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
}

.parsed-preview-footer--unmatched .factor-match-panel {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 10px 24px rgba(180, 83, 9, 0.1);
}

.parsed-preview-footer .factor-match-confirmed {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.08);
}

:root[data-theme="night"] .parsed-preview-footer .factor-match-confirmed {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(180deg, rgba(6, 95, 70, 0.92), rgba(15, 118, 110, 0.9));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.factor-match-guidance {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 4px;
  width: min(320px, calc(100% - 24px));
  padding: 12px 14px 13px;
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: 14px;
  background: #f59e0b;
  color: #1f2937;
  box-shadow: 0 14px 26px rgba(180, 83, 9, 0.22);
  pointer-events: none;
}

.factor-match-guidance::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: #f59e0b transparent transparent;
}

.factor-match-guidance strong {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.factor-match-guidance span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.parsed-preview-close {
  position: absolute;
  z-index: 2000;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  border: 1px solid #b91c1c;
  border-radius: 0;
  background: #dc2626;
  color: #ffffff;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.parsed-preview-close::before {
  content: "✖";
  display: block;
  color: currentColor;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transform: scaleX(1.15);
}

.parsed-preview-close:hover,
.parsed-preview-close:focus-visible {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.parsed-preview h3 {
  margin: 0;
  padding-bottom: 5px;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.parsed-preview h4 {
  margin: 12px 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
}

.parsed-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.parsed-preview-grid div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft);
}

.parsed-preview-value-box {
  min-height: 42px;
  display: flex;
  align-items: center;
}

.halfway-marker {
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.parsed-preview-value,
.parsed-preview-file strong,
.parsed-preview-grid strong {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.parsed-preview-value {
  color: #4b5563;
}

.parsed-preview-stats {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
}

.parsed-preview-stat-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.parsed-preview-stat-line strong {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.parsed-preview-stat-line span {
  font-size: 11px;
  font-weight: 700;
}

.parsed-preview-grid strong > .score-status-value {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.parsed-preview-grid strong > .score-status-value .score-status-mark {
  margin-left: 4px;
}

.parsed-preview .score-status-mark.incorrect {
  background: transparent !important;
  color: var(--red) !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.factor-match-panel {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
}

.parsed-preview-footer .factor-match-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.parsed-preview-footer--unmatched .factor-match-panel {
  border-radius: 12px;
  margin: 0 0 0;
}

.parsed-preview-footer .factor-match-panel.factor-match-confirmed {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.08);
}

.factor-match-panel h4 {
  margin-top: 0;
}

.factor-match-confirmed {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.factor-match-summary {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  justify-self: start;
}

:root[data-theme="night"] .factor-match-summary {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.24);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.factor-match-label {
  text-transform: uppercase;
  white-space: nowrap;
  align-self: center;
}

.factor-match-confirmed strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

:root[data-theme="night"] .factor-match-confirmed {
  color: #d1fae5;
}

:root[data-theme="night"] .factor-match-confirmed strong {
  color: #f8fafc;
}

:root[data-theme="night"] .factor-match-confirmed .factor-match-change {
  border-color: rgba(110, 231, 183, 0.45);
  background: #059669;
  color: #ffffff;
}

:root[data-theme="night"] .factor-match-confirmed .factor-match-change:hover,
:root[data-theme="night"] .factor-match-confirmed .factor-match-change:focus-visible {
  background: #047857;
}

.factor-match-controls {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(220px, 1.4fr) auto minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
}

.factor-match-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.factor-match-controls select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  text-transform: none;
}

.factor-match-save {
  align-self: end;
  justify-self: start;
  min-width: 0;
  width: auto;
  min-height: 36px;
  border: 1px solid #11795b;
  border-radius: 4px;
  padding: 7px 12px;
  color: #ffffff;
  background: #11795b;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.factor-match-save:hover,
.factor-match-save:focus-visible {
  background: #0f6b50;
}

.factor-match-save:disabled {
  cursor: wait;
  opacity: 0.7;
}

.factor-match-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.parsed-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.parsed-score-comparison {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.parsed-score-comparison th,
.parsed-score-comparison td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.parsed-score-comparison thead th {
  background: var(--table-head);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.parsed-score-comparison tbody th {
  font-weight: 700;
  width: 35%;
}

.parsed-score-comparison td {
  min-width: 120px;
}

.parsed-preview th,
.parsed-preview td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.parsed-preview th {
  background: var(--table-head);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.score-status-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.score-status-value.correct {
  color: var(--green);
}

.score-status-value.incorrect {
  color: var(--red);
}

.score-status-value.unverified {
  color: #b7791f;
}

.score-status-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.score-status-mark.correct {
  background: transparent;
  color: var(--green);
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
}

.score-status-mark.incorrect {
  background: var(--red);
}

.score-status-mark.unverified {
  background: #f6c453;
  color: #5f3b00;
}

.mark-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mark-token {
  min-width: 26px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  text-align: center;
  font-weight: 700;
}

:root[data-theme="night"] .mark-token {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.76);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mark-token.missing {
  position: relative;
  border-color: transparent;
  background: transparent;
  color: transparent;
}

.mark-token.missing::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border: 2px solid var(--red);
  border-radius: 4px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

:root[data-theme="night"] .mark-token.missing::before {
  border-color: rgba(248, 113, 113, 0.92);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

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

h2 {
  font-size: 18px;
}

.score-panel {
  min-width: 180px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #2f4f8f;
  color: #ffffff;
  text-align: right;
  box-shadow: 0 12px 24px rgba(30, 64, 175, 0.12);
}

.score-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.86;
}

.score-panel strong {
  display: block;
  margin-top: 2px;
  font-size: 34px;
  line-height: 1;
}

.summary-grid {
  /* Snapshot boxes show the major score totals before the user scrolls into
     the detailed tables. */
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.instructions-panel {
  /* The instructions area is styled like a card so it reads as help content
     rather than part of the scoring grid itself. */
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.instructions-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.instructions-panel section + section {
  margin-top: 14px;
}

.instructions-panel ul {
  margin: 0;
  padding-left: 22px;
}

.instructions-panel li {
  margin: 5px 0;
}

.summary-grid article,
.context-panel,
.work-area,
.adjustments {
  /* Shared card treatment for the calculator's main functional sections. */
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-grid article {
  padding: 14px 16px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-grid .score-panel {
  border: 0;
  background: #2f4f8f;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(30, 64, 175, 0.12);
}

.summary-grid .score-panel span {
  color: #ffffff;
  opacity: 0.86;
}

.summary-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.context-panel {
  /* This block holds the season and category selectors that define the active
     scoring rules. */
  margin-top: 16px;
  padding: 14px 16px;
}

.work-area {
  /* Each work area wraps one table plus its heading and keeps the table edges
     clipped cleanly inside the card. */
  margin-top: 16px;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.factor-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.factor-picker label {
  display: grid;
  gap: 6px;
}

.factor-picker label:first-child {
  width: min(260px, 30vw);
}

.factor-picker label:last-child {
  width: min(520px, 50vw);
}

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

.score-table {
  /* The tables are intentionally rigid: fixed layout, sticky headers, and
     consistent column widths make side-by-side data entry easier. */
  width: 100%;
  min-width: 1360px;
  border-collapse: collapse;
  table-layout: fixed;
}

.element-table {
  width: 1120px;
  min-width: 1120px;
}

.score-table.component-table {
  width: 1014px;
  min-width: 1014px;
  max-width: 1014px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 6px;
  text-align: center;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-head);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tfoot td {
  background: var(--table-foot);
  font-weight: 800;
}

.score-table th:first-child,
.score-table td:first-child {
  width: 44px;
}

.element-table th:nth-child(2),
.element-table td:nth-child(2) {
  width: 190px;
  text-align: left;
}

.element-table th:nth-child(3),
.element-table td:nth-child(3) {
  width: 54px;
}

.element-table th:nth-child(4),
.element-table th:nth-child(5),
.element-table th:nth-child(16),
.element-table td:nth-child(4),
.element-table td:nth-child(5),
.element-table td:nth-child(16) {
  width: 78px;
}

.element-table th:nth-child(n+6):nth-child(-n+15),
.element-table td:nth-child(n+6):nth-child(-n+15) {
  width: 40px;
  padding: 2px;
}

.element-table th:nth-child(17),
.element-table th:nth-child(18),
.element-table th:nth-child(19),
.element-table td:nth-child(17),
.element-table td:nth-child(18),
.element-table td:nth-child(19),
.component-table th:nth-child(14),
.component-table td:nth-child(14) {
  width: 80px;
}

.component-table th:first-child,
.component-table td:first-child {
  width: 170px;
  text-align: left;
}

.component-table th:nth-child(2),
.component-table td:nth-child(2),
.component-table th:nth-child(13),
.component-table td:nth-child(13) {
  width: 82px;
}

.component-table th:nth-child(n+3):nth-child(-n+12),
.component-table td:nth-child(n+3):nth-child(-n+12) {
  width: 60px;
  padding: 2px;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--field-bg);
  font-size: 15px;
  line-height: 1.5;
}

input::placeholder,
select::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.element-code {
  background: var(--input);
}

.judge-input,
.pc-input,
#bonusInput,
#deductionInput {
  text-align: center;
  background: var(--score-input);
}

.goe-input {
  display: block;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  margin: 0 auto;
  padding-left: 2px;
  padding-right: 2px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.goe-input::-webkit-outer-spin-button,
.goe-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.pc-input {
  display: block;
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  margin: 0 auto;
  padding-left: 4px;
  padding-right: 4px;
}

.component-disabled td:first-child {
  color: var(--muted);
}

.pc-input:disabled {
  color: var(--muted);
  background: var(--field-bg);
  cursor: not-allowed;
  opacity: 0.75;
}

.hw-cell {
  text-align: center;
}

.hw-input {
  display: inline-block;
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
  vertical-align: middle;
}

.readonly {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.invalid {
  border-color: #b42318;
  background: #fff1f0;
}

:root[data-theme="night"] .invalid {
  border-color: #ff8a80;
  background: #4a1f23;
}

.adjustments {
  /* Bonuses and deductions are separate from the table rows so they stay easy
     to find during a quick final score check. */
  display: grid;
  grid-template-columns: 125px 125px 1fr 250px;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
}

.adjustments label {
  width: 125px;
}

.adjustments label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

button {
  min-height: 38px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 8px 14px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--blue-strong);
}

.row-action-cell {
  padding-left: 3px;
  padding-right: 3px;
}

.row-action {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 11px;
}

.row-delete {
  border-color: #b42318;
  background: #b14d5c;
}

.row-insert {
  border-color: #15803d;
  background: #16a34a;
}

.row-clear {
  border-color: #86efac;
  background: #dcfce7;
  color: #14532d;
}

.row-delete:hover {
  background: #9d404f;
}

.row-insert:hover {
  background: #15803d;
}

.row-clear:hover {
  background: #bbf7d0;
}

#clearButton {
  grid-column: 4;
  justify-self: end;
  width: 250px;
  border: 0;
  background: #dcfce7;
  color: #14532d;
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.12);
}

#clearButton:hover {
  background: #bbf7d0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.modal p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

.modal ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.modal-actions {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
}

.modal-actions button {
  min-width: 100px;
}

.primary-action.compact {
  min-width: 120px;
  background: var(--green);
}

.primary-action.compact:hover {
  background: #0f6b50;
}

.secondary-action {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  color: #ffffff;
  background: #b42318;
  font-weight: 800;
}

.secondary-action:hover {
  background: #8f1d14;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 0;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  line-height: 1;
}

.back-to-top svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--blue-strong);
}

@media (max-width: 860px) {
  .app-shell,
  .landing-shell {
    width: min(100vw - 20px, 1680px);
    padding-top: 14px;
  }

  .topbar,
  .landing-topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-panel {
    width: 100%;
    text-align: left;
  }

  .top-actions,
  .topbar-left,
  .language-picker {
    width: auto;
  }

  .landing-panel {
    padding: 20px;
  }

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

  .task-card-brand {
    justify-items: center;
  }

  .task-card-logo {
    width: min(32vw, 128px);
  }

  .landing-shell .task-card {
    min-height: 0;
  }

  .landing-shell .task-card-logo {
    width: min(64vw, 240px);
  }

  .top-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .topbar-left {
    flex-direction: row;
    flex: 0 0 auto;
    min-width: 0;
  }

  .top-actions {
    flex: 0 0 auto;
    min-width: 0;
  }

  .language-picker {
    min-width: 140px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competitive-season-card,
  .sov-season-card {
    grid-template-columns: 1fr;
  }

  .calculator-sov-grid {
    grid-template-columns: 1fr;
  }

  .factor-picker {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .factor-picker label,
  .factor-picker label:first-child,
  .factor-picker label:last-child {
    width: 100%;
  }

  .factor-match-controls {
    grid-template-columns: 1fr;
  }

  .adjustments {
    grid-template-columns: 125px 125px;
  }

  .audit-grid,
  .verify-summary-charts {
    grid-template-columns: 1fr;
  }

  .verify-summary-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-source-card {
    width: 100%;
  }

  .audit-source-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .verify-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-pie {
    width: min(100%, 140px);
  }

  .summary-pie-content {
    grid-template-columns: minmax(140px, 160px) minmax(0, max-content);
  }

  .adjustments label {
    grid-column: auto;
    width: 125px;
  }

  #clearButton {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }
}
