:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --ink: #202124;
  --muted: #667085;
  --line: #d9dee7;
  --line-strong: #bbc4d2;
  --accent: #087f8c;
  --accent-dark: #055f69;
  --accent-soft: #e8f5f7;
  --gold: #a65f00;
  --danger: #b42318;
  --pass: #0f7a45;
  --shadow: 0 20px 45px rgba(35, 43, 55, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 260px, var(--bg) 260px);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.subhead {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tool-button,
.primary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.tool-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.tool-button:focus-visible,
.primary-button:focus-visible,
input:focus,
select:focus {
  outline: 3px solid rgba(8, 127, 140, 0.22);
  outline-offset: 2px;
}

.primary-button {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.tool-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.input-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.results-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

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

.panel-title span,
.section-head span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

form {
  display: grid;
  gap: 14px;
}

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

.field-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label,
.check-row span {
  color: #3d4653;
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.check-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--panel-soft);
}

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

.metric-card {
  display: grid;
  min-height: 126px;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
}

.test-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
}

.test-panel strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.test-panel.pass {
  border-color: rgba(15, 122, 69, 0.35);
  background: #f3fbf7;
}

.test-panel.fail {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff7f6;
}

.test-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.test-list:empty {
  display: none;
}

.test-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.status-pill.pass {
  background: var(--pass);
}

.status-pill.fail {
  background: var(--danger);
}

.schedule-section {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #485466;
  background: #f3f6f8;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-variant-numeric: tabular-nums;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.capped td {
  background: #fff9ef;
}

.muted-cell {
  color: var(--muted);
}

@media (max-width: 1040px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

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

  .input-panel {
    position: static;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 18px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .toolbar,
  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .tool-button,
  .primary-button {
    width: 100%;
  }

  .field-grid {
    display: grid;
  }

  .metric-card {
    min-height: 112px;
  }
}

@media print {
  :root {
    --shadow: none;
  }

  body {
    background: #ffffff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .toolbar,
  .input-panel,
  .test-panel {
    display: none;
  }

  .app-header {
    padding: 0 0 16px;
  }

  .workspace {
    display: block;
  }

  .results-panel,
  .metric-card,
  .table-wrap {
    border-color: #b8b8b8;
    box-shadow: none;
  }

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

  table {
    min-width: 0;
    font-size: 10px;
  }

  th,
  td {
    padding: 6px 7px;
  }
}
