:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-strong: #f0f2f5;
  --border: #dde1e7;
  --text: #15171a;
  --muted: #68707d;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green-bg: #e8f7ee;
  --green-text: #137044;
  --red-bg: #fff0f0;
  --red-text: #b42318;
  --amber-bg: #fff7e6;
  --amber-text: #92400e;
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06), 0 8px 24px rgba(20, 24, 33, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  background: rgba(247, 248, 250, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 700;
}

.header-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-right: auto;
  color: var(--muted);
  font-weight: 650;
}

.header-nav a {
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--accent);
}

.top-actions,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-form {
  margin: 0;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.13), transparent 34rem),
    radial-gradient(circle at 85% 90%, rgba(19, 112, 68, 0.09), transparent 30rem),
    var(--bg);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  width: min(100%, 420px);
  padding: 32px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(20, 24, 33, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.login-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  place-items: center;
}

.login-heading {
  margin: 36px 0 24px;
}

.login-heading .eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
}

.login-heading h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.login-heading p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  margin-bottom: 18px;
  padding: 11px 12px;
  color: var(--red-text);
  background: var(--red-bg);
  border: 1px solid #ffd1d1;
  border-radius: 8px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.add-panel,
.bulk-panel,
.edit-panel,
.stats-row,
.toolbar,
.table-shell,
.meta-grid,
.record-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.add-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.add-panel .button {
  grid-column: 1 / -1;
}

.edit-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.8fr) minmax(170px, 0.7fr) minmax(170px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

label,
.eyebrow,
dt {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}

select[multiple] {
  min-height: 88px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button {
  padding: 0 14px;
  white-space: nowrap;
}

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

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

.button.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.button.secondary:hover,
.icon-button:hover {
  background: var(--surface-strong);
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
  font-size: 18px;
  line-height: 1;
}

.icon-button.danger:hover {
  color: var(--red-text);
  background: var(--red-bg);
  border-color: #ffd1d1;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(130px, 0.7fr) 140px 140px 140px auto;
  gap: 10px;
  flex: 1 1 760px;
  width: auto;
}

.reset-filter-button {
  min-width: 96px;
}

.table-region {
  margin-top: 18px;
}

.notice {
  margin-bottom: 12px;
  padding: 11px 13px;
  color: #17406d;
  background: #edf6ff;
  border: 1px solid #cde6ff;
  border-radius: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.url-cell {
  max-width: 390px;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.actions-cell {
  width: 96px;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.indexed {
  color: var(--green-text);
  background: var(--green-bg);
}

.status.ready,
.status.imported {
  color: var(--green-text);
  background: var(--green-bg);
}

.status.not_indexed {
  color: var(--red-text);
  background: var(--red-bg);
}

.status.duplicate {
  color: #17406d;
  background: #edf6ff;
}

.status.problem_index {
  color: #7f1d1d;
  background: #fee2e2;
}

.status.pending,
.status.error {
  color: var(--amber-text);
  background: var(--amber-bg);
}

.status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.detail-status {
  align-items: flex-end;
}

.hand-check-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.hand-check-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 120px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #26415f;
  background: #eef4ff;
  border: 1px solid #d7e4ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-badge:hover {
  color: var(--accent);
  border-color: #bcd0ff;
}

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

.empty {
  padding: 32px 14px;
  color: var(--muted);
  text-align: center;
}

.detail-layout {
  display: grid;
  gap: 18px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--muted);
  font-weight: 650;
}

.record-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.record-summary-main {
  min-width: 0;
}

.detail-tags {
  margin-top: 12px;
}

h1 {
  margin: 0;
  max-width: 900px;
  overflow-wrap: anywhere;
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
}

.meta-grid div {
  padding: 16px;
  border-right: 1px solid var(--border);
}

.meta-grid div:last-child {
  border-right: 0;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.history {
  min-width: 0;
}

.dashboard-history {
  margin-top: 22px;
}

.bulk-layout {
  display: grid;
  gap: 18px;
}

.schedule-layout {
  display: grid;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}

.schedule-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.schedule-form {
  display: grid;
  gap: 16px;
}

.schedule-panel {
  display: grid;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.schedule-head,
.schedule-rule {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(240px, 0.85fr) minmax(130px, 0.42fr);
  gap: 16px;
  align-items: center;
}

.schedule-head {
  min-height: 42px;
  padding: 0 18px;
  color: var(--muted);
  background: #fbfcfd;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.schedule-rule {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.schedule-rule:last-child {
  border-bottom: 0;
}

.schedule-rule-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.schedule-segment {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(86px, 1fr);
  gap: 3px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 3px;
  background: #f3f5f8;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.schedule-segment label {
  position: relative;
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-transform: none;
}

.schedule-segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}

.schedule-segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.schedule-segment input:checked + span {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 33, 0.08);
}

.schedule-segment input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.number-with-unit {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto;
  align-items: center;
  overflow: hidden;
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.number-with-unit input {
  min-height: 38px;
  padding-right: 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.number-with-unit input:focus {
  box-shadow: none;
}

.number-with-unit span {
  padding: 0 11px 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.number-with-unit.is-readonly {
  background: #f8fafc;
}

.number-with-unit.is-readonly input,
.number-with-unit.is-readonly span {
  color: #9aa3af;
}

.schedule-actions {
  display: flex;
  justify-content: flex-end;
}

.bulk-state {
  display: grid;
  gap: 18px;
}

.bulk-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.bulk-form {
  display: grid;
  gap: 12px;
}

.bulk-inputs {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 0.34fr);
  gap: 12px;
  align-items: start;
}

.url-index-inputs {
  display: grid;
  grid-template-columns: minmax(220px, 0.4fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}

.bulk-actions,
.bulk-import-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.report-files {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
}

.report-files h2 {
  margin-bottom: 4px;
}

.report-files p,
.preview-note {
  margin: 0;
}

.url-index-progress {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

.url-index-progress strong {
  font-size: 13px;
}

.url-index-progress p {
  margin: 0;
}

.url-index-progress-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 8px;
  background: #e6eaf0;
  border-radius: 999px;
}

.url-index-progress-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.bulk-summary {
  margin-top: 0;
}

.bulk-preview {
  min-width: 0;
}

.bulk-row-message {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.raw-row td {
  background: #fbfcfd;
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
}

pre {
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  color: #101828;
  background: #f3f5f8;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.error-text {
  color: var(--red-text);
}

.home-test-shell {
  --home-accent: #0f766e;
  --home-accent-dark: #115e59;
  --home-blue: #2563eb;
  --home-ink: #15171a;
  --home-soft: #f2f6f6;
  --home-line: #d6dee2;
  display: grid;
  gap: 18px;
}

.home-test-command {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.home-test-title {
  min-width: 0;
}

.home-test-title .back-link {
  display: inline-flex;
  margin-bottom: 8px;
}

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

.home-test-command-actions .button,
.home-test-submit {
  gap: 8px;
}

.home-test-notice {
  margin-bottom: 0;
}

.home-test-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.home-test-metric {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--home-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-test-metric:hover,
.home-test-metric.is-active {
  color: var(--home-ink);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1), var(--shadow);
}

.home-test-metric span,
.home-test-count,
.home-test-health span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.home-test-metric strong {
  font-size: 28px;
  line-height: 1;
}

.home-test-metric.is-problem {
  border-color: #f7c9bd;
}

.home-test-focus-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.home-test-panel,
.home-test-workbench,
.home-test-records,
.home-test-activity {
  background: var(--surface);
  border: 1px solid var(--home-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-test-panel,
.home-test-workbench {
  padding: 16px;
}

.home-test-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-test-section-head h2 {
  margin: 0;
}

.home-test-add {
  display: grid;
  gap: 14px;
}

.home-test-add-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(220px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.home-test-field.is-wide {
  grid-column: 1 / -1;
}

.home-test-submit {
  width: fit-content;
}

.home-test-attention {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.home-test-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.home-test-health strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1;
}

.home-test-progress {
  overflow: hidden;
  height: 8px;
  margin: 14px 0;
  background: #eef2f7;
  border-radius: 999px;
}

.home-test-progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  background: linear-gradient(90deg, var(--home-accent), var(--home-blue));
  border-radius: inherit;
}

.home-test-priority-list {
  display: grid;
  gap: 8px;
}

.home-test-priority-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-test-priority-row strong,
.home-test-priority-row span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-test-priority-row span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.home-test-priority-row:hover {
  color: var(--home-ink);
  border-color: rgba(37, 99, 235, 0.36);
}

.home-test-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.home-test-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(280px, 1.2fr) minmax(140px, 0.7fr) minmax(130px, 0.45fr) minmax(130px, 0.45fr) minmax(96px, auto);
  gap: 10px;
  align-items: center;
}

.home-test-status-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  background: #f3f5f8;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-test-status-filter label {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.home-test-status-filter input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.home-test-status-filter span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.home-test-status-filter input:checked + span {
  color: var(--home-ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 33, 0.08);
}

.home-test-status-filter input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.home-test-records,
.home-test-activity {
  overflow: hidden;
}

.home-test-records > .home-test-section-head,
.home-test-activity > .home-test-section-head {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.home-test-table-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.home-test-table th {
  background: #f8fafb;
}

.home-test-date {
  display: block;
  white-space: nowrap;
}

[aria-busy="true"] {
  opacity: 0.68;
}

@media (max-width: 1120px) {
  .home-test-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-test-focus-grid,
  .home-test-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dashboard-grid,
  .add-panel,
  .bulk-inputs,
  .url-index-inputs,
  .report-files,
  .edit-panel,
  .toolbar,
  .filters,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .home-test-command {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-test-command-actions,
  .home-test-command-actions form,
  .home-test-command-actions .button,
  .home-test-submit {
    width: 100%;
  }

  .toolbar {
    display: grid;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .meta-grid div,
  .meta-grid div:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .meta-grid div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 24px;
  }

  .topbar {
    height: auto;
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav,
  .top-actions {
    width: 100%;
  }

  .page {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .home-test-metrics,
  .home-test-add-grid,
  .home-test-health {
    grid-template-columns: 1fr;
  }

  .home-test-field.is-wide {
    grid-column: auto;
  }

  .home-test-metric {
    min-height: 82px;
  }

  .home-test-priority-row {
    grid-template-columns: 1fr;
  }

  .home-test-priority-row span:last-child {
    grid-column: auto;
  }

  .stat,
  .stat:nth-child(2),
  .stat:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .record-summary,
  .detail-header,
  .schedule-header,
  .schedule-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-head {
    display: none;
  }

  .schedule-rule {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
    padding: 18px;
  }

  .schedule-segment {
    grid-auto-columns: minmax(0, 1fr);
  }

  .schedule-actions .button {
    width: 100%;
  }

  .detail-status {
    align-items: flex-start;
  }
}

.home-test-variant-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-test-variant-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-test-variant-nav a:hover,
.home-test-variant-nav a.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 24, 33, 0.08);
}

body:has(.home-test-v1) {
  --bg: #090d11;
  --surface: #101820;
  --surface-strong: #162330;
  --border: #253344;
  --text: #eef3f7;
  --muted: #9aa8b7;
  --accent: #29b6a3;
  --accent-dark: #0f8d82;
  --shadow: none;
  background:
    linear-gradient(90deg, rgba(41, 182, 163, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(#090d11, #0d1217);
  background-size: 48px 100%, auto;
}

body:has(.home-test-v1) .topbar {
  background: rgba(9, 13, 17, 0.9);
  border-bottom-color: #233142;
}

.page:has(.home-test-v1) {
  width: min(1500px, calc(100% - 28px));
}

.home-test-v1 {
  --home-accent: #29b6a3;
  --home-accent-dark: #0f8d82;
  --home-blue: #7dd3fc;
  --home-ink: #f8fbfd;
  --home-soft: #0f1720;
  --home-line: #263648;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.home-test-v1 > * {
  min-width: 0;
}

.home-test-v1 .home-test-command,
.home-test-v1 .home-test-notice {
  grid-column: 1 / -1;
}

.home-test-v1 .home-test-command {
  align-items: center;
  padding: 18px;
  background: #0f1720;
  border: 1px solid #263648;
  border-left: 5px solid #29b6a3;
  border-radius: 8px;
}

.home-test-v1 .home-test-title h1 {
  margin: 0;
  color: #f8fbfd;
  font-size: 26px;
}

.home-test-v1 .home-test-variant-nav,
.home-test-v1 .home-test-status-filter {
  background: #0b1118;
  border-color: #263648;
}

.home-test-v1 .home-test-variant-nav a.is-active,
.home-test-v1 .home-test-status-filter input:checked + span {
  color: #eafffb;
  background: #17332f;
  box-shadow: inset 0 0 0 1px rgba(41, 182, 163, 0.42);
}

.home-test-v1 .home-test-command-actions .button.secondary,
.home-test-v1 .reset-filter-button,
.home-test-v1 .icon-button {
  color: #dce6ee;
  background: #111d28;
  border-color: #314356;
}

.home-test-v1 .home-test-command-actions .button.primary,
.home-test-v1 .home-test-submit {
  background: #0f8d82;
}

.home-test-v1 .home-test-metrics {
  position: sticky;
  top: 82px;
  grid-column: 1;
  grid-row: 2 / span 4;
  grid-template-columns: 1fr;
  gap: 8px;
}

.home-test-v1 .home-test-metric {
  min-height: 76px;
  padding: 14px 16px;
  color: #eef3f7;
  background: #101820;
  border-color: #263648;
  box-shadow: none;
}

.home-test-v1 .home-test-metric:hover,
.home-test-v1 .home-test-metric.is-active {
  border-color: rgba(41, 182, 163, 0.62);
  box-shadow: inset 4px 0 0 #29b6a3;
}

.home-test-v1 .home-test-metric strong {
  font-size: 34px;
}

.home-test-v1 .home-test-focus-grid,
.home-test-v1 .home-test-workbench,
.home-test-v1 .home-test-records,
.home-test-v1 .home-test-activity {
  grid-column: 2;
  min-width: 0;
}

.home-test-v1 .home-test-focus-grid {
  grid-row: 2;
}

.home-test-v1 .home-test-workbench {
  grid-row: 3;
}

.home-test-v1 .home-test-records {
  grid-row: 4;
}

.home-test-v1 .home-test-activity {
  grid-row: 5;
}

.home-test-v1 .home-test-focus-grid {
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 14px;
}

.home-test-v1 .home-test-panel,
.home-test-v1 .home-test-workbench,
.home-test-v1 .home-test-records,
.home-test-v1 .home-test-activity {
  background: #101820;
  border-color: #263648;
  box-shadow: none;
}

.home-test-v1 input,
.home-test-v1 select,
.home-test-v1 textarea {
  color: #eef3f7;
  background: #0b1118;
  border-color: #314356;
}

.home-test-v1 .home-test-table th,
.home-test-v1 table th {
  color: #9aa8b7;
  background: #0b1118;
}

.home-test-v1 .table-shell {
  max-width: 100%;
  overflow-x: auto;
}

.home-test-v1 table td,
.home-test-v1 table th {
  border-bottom-color: #243346;
}

.home-test-v1 .home-test-priority-row,
.home-test-v1 .home-test-empty {
  color: #eef3f7;
  background: #0b1118;
  border-color: #263648;
}

.home-test-v1 .tag-badge {
  color: #b6f4e8;
  background: #12302c;
  border-color: rgba(41, 182, 163, 0.35);
}

body:has(.home-test-v2) {
  --bg: #f4f5f1;
  --surface: #fffefa;
  --surface-strong: #ecebe4;
  --border: #d7d4c8;
  --text: #22211d;
  --muted: #69675e;
  --accent: #315c97;
  --accent-dark: #254a7d;
  --shadow: none;
}

.page:has(.home-test-v2) {
  width: min(1580px, calc(100% - 24px));
  margin-top: 18px;
}

.home-test-v2 {
  --home-accent: #315c97;
  --home-accent-dark: #254a7d;
  --home-blue: #417f6b;
  --home-ink: #22211d;
  --home-line: #d7d4c8;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
  align-items: start;
}

.home-test-v2 .home-test-command {
  grid-column: 1 / -1;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  background: #fffefa;
  border: 1px solid #d7d4c8;
  border-radius: 0;
}

.home-test-v2 .home-test-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.home-test-v2 .home-test-title .back-link {
  margin: 0;
}

.home-test-v2 .home-test-title h1 {
  margin: 0;
  font-size: 20px;
}

.home-test-v2 .home-test-variant-nav {
  margin-left: auto;
  border-radius: 0;
}

.home-test-v2 .home-test-command-actions {
  gap: 6px;
}

.home-test-v2 .button,
.home-test-v2 .icon-button,
.home-test-v2 input,
.home-test-v2 select,
.home-test-v2 textarea,
.home-test-v2 .home-test-status-filter,
.home-test-v2 .home-test-status-filter span {
  border-radius: 0;
}

.home-test-v2 .home-test-workbench {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 10px;
  border-radius: 0;
}

.home-test-v2 .home-test-workbench .home-test-section-head {
  display: none;
}

.home-test-v2 .home-test-filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(360px, 1.4fr) minmax(160px, 0.6fr) 150px 150px 100px;
  gap: 8px;
}

.home-test-v2 .home-test-metrics {
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #d7d4c8;
  border-right: 0;
  background: #fffefa;
}

.home-test-v2 .home-test-metric {
  min-height: 72px;
  padding: 12px;
  border: 0;
  border-right: 1px solid #d7d4c8;
  border-radius: 0;
  box-shadow: none;
}

.home-test-v2 .home-test-metric:hover,
.home-test-v2 .home-test-metric.is-active {
  background: #eef3f7;
  box-shadow: inset 0 -4px 0 #315c97;
}

.home-test-v2 .home-test-metric strong {
  font-variant-numeric: tabular-nums;
}

.home-test-v2 .home-test-records {
  grid-column: 1;
  grid-row: 4;
}

.home-test-v2 .home-test-focus-grid {
  grid-column: 2;
  grid-row: 4;
  grid-template-columns: 1fr;
  gap: 10px;
  position: sticky;
  top: 82px;
}

.home-test-v2 .home-test-activity {
  grid-column: 1 / -1;
  grid-row: 5;
}

.home-test-v2 .home-test-panel,
.home-test-v2 .home-test-records,
.home-test-v2 .home-test-activity {
  border-radius: 0;
  box-shadow: none;
}

.home-test-v2 .home-test-panel,
.home-test-v2 .home-test-workbench {
  padding: 12px;
}

.home-test-v2 .home-test-add-grid {
  grid-template-columns: 1fr;
}

.home-test-v2 .home-test-field.is-wide {
  grid-column: auto;
}

.home-test-v2 .home-test-table th,
.home-test-v2 table th {
  background: #ecebe4;
}

.home-test-v2 table td,
.home-test-v2 table th {
  padding: 9px 10px;
  border-right: 1px solid #e5e2d7;
}

.home-test-v2 table td:last-child,
.home-test-v2 table th:last-child {
  border-right: 0;
}

.home-test-v2 .tag-badge,
.home-test-v2 .status {
  border-radius: 2px;
}

body:has(.home-test-v3) {
  --bg: #f8f7fb;
  --surface: #ffffff;
  --surface-strong: #f0eef5;
  --border: #dfdbe8;
  --text: #19171f;
  --muted: #706a7d;
  --accent: #c2415d;
  --accent-dark: #9f3048;
  --shadow: 0 14px 38px rgba(45, 40, 64, 0.08);
}

body:has(.home-test-v3) .topbar {
  background: rgba(248, 247, 251, 0.9);
}

.page:has(.home-test-v3) {
  width: min(1340px, calc(100% - 34px));
}

.home-test-v3 {
  --home-accent: #c2415d;
  --home-accent-dark: #9f3048;
  --home-blue: #2f7f7a;
  --home-ink: #19171f;
  --home-soft: #f8f7fb;
  --home-line: #dfdbe8;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

.home-test-v3 .home-test-command {
  grid-column: 1 / -1;
  align-items: center;
  min-height: 128px;
  padding: 24px;
  color: #fff;
  background: #27223a;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(39, 34, 58, 0.18);
}

.home-test-v3 .home-test-title h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: 38px;
  line-height: 1;
}

.home-test-v3 .home-test-title .back-link,
.home-test-v3 .home-test-command a:hover {
  color: #f7ced8;
}

.home-test-v3 .home-test-variant-nav {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.home-test-v3 .home-test-variant-nav a {
  color: #ded8ed;
}

.home-test-v3 .home-test-variant-nav a.is-active {
  color: #27223a;
  background: #fff;
}

.home-test-v3 .home-test-command-actions .button.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.home-test-v3 .home-test-command-actions .button.primary {
  color: #27223a;
  background: #f7ced8;
}

.home-test-v3 .home-test-metrics {
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-test-v3 .home-test-metric {
  min-height: 132px;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(45, 40, 64, 0.08);
}

.home-test-v3 .home-test-metric:first-child {
  background: #fff0d8;
}

.home-test-v3 .home-test-metric:nth-child(2) {
  background: #e9f4f1;
}

.home-test-v3 .home-test-metric:nth-child(3) {
  background: #edf1ff;
}

.home-test-v3 .home-test-metric:nth-child(4) {
  background: #f7eefa;
}

.home-test-v3 .home-test-metric.is-problem {
  background: #ffe8ec;
}

.home-test-v3 .home-test-metric:hover,
.home-test-v3 .home-test-metric.is-active {
  box-shadow: inset 0 0 0 2px #27223a, 0 14px 38px rgba(45, 40, 64, 0.1);
}

.home-test-v3 .home-test-metric strong {
  margin-top: auto;
  font-size: 42px;
}

.home-test-v3 .home-test-records {
  grid-column: 1;
  grid-row: 3;
}

.home-test-v3 .home-test-focus-grid,
.home-test-v3 .home-test-workbench {
  grid-column: 2;
}

.home-test-v3 .home-test-focus-grid {
  grid-row: 3;
  grid-template-columns: 1fr;
  gap: 20px;
}

.home-test-v3 .home-test-workbench {
  grid-row: 4;
}

.home-test-v3 .home-test-activity {
  grid-column: 1 / -1;
  grid-row: 5;
}

.home-test-v3 .home-test-panel,
.home-test-v3 .home-test-workbench,
.home-test-v3 .home-test-records,
.home-test-v3 .home-test-activity {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(45, 40, 64, 0.08);
}

.home-test-v3 .home-test-panel,
.home-test-v3 .home-test-workbench {
  padding: 20px;
}

.home-test-v3 .home-test-add-grid,
.home-test-v3 .home-test-filters {
  grid-template-columns: 1fr;
}

.home-test-v3 .home-test-field.is-wide {
  grid-column: auto;
}

.home-test-v3 .home-test-table-shell,
.home-test-v3 .home-test-activity .table-shell {
  padding: 10px 14px 18px;
  background: transparent;
}

.home-test-v3 .home-test-table,
.home-test-v3 .home-test-activity table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.home-test-v3 .home-test-table th,
.home-test-v3 .home-test-activity th {
  background: transparent;
  border: 0;
}

.home-test-v3 .home-test-table td,
.home-test-v3 .home-test-activity td {
  background: #fff;
  border-top: 1px solid #e9e4f0;
  border-bottom: 1px solid #e9e4f0;
}

.home-test-v3 .home-test-table td:first-child,
.home-test-v3 .home-test-activity td:first-child {
  border-left: 1px solid #e9e4f0;
  border-radius: 8px 0 0 8px;
}

.home-test-v3 .home-test-table td:last-child,
.home-test-v3 .home-test-activity td:last-child {
  border-right: 1px solid #e9e4f0;
  border-radius: 0 8px 8px 0;
}

.home-test-v3 .home-test-priority-row {
  min-height: 68px;
  background: #f8f7fb;
  border-color: #e4dfea;
}

.home-test-v3 .tag-badge {
  color: #6f3140;
  background: #ffe8ec;
  border-color: #f2bfca;
}

@media (max-width: 1180px) {
  .home-test-v1,
  .home-test-v2,
  .home-test-v3 {
    grid-template-columns: 1fr;
  }

  .home-test-v1 .home-test-metrics,
  .home-test-v1 .home-test-focus-grid,
  .home-test-v1 .home-test-workbench,
  .home-test-v1 .home-test-records,
  .home-test-v1 .home-test-activity,
  .home-test-v2 .home-test-metrics,
  .home-test-v2 .home-test-focus-grid,
  .home-test-v2 .home-test-workbench,
  .home-test-v2 .home-test-records,
  .home-test-v2 .home-test-activity,
  .home-test-v3 .home-test-metrics,
  .home-test-v3 .home-test-focus-grid,
  .home-test-v3 .home-test-workbench,
  .home-test-v3 .home-test-records,
  .home-test-v3 .home-test-activity {
    grid-column: 1;
    grid-row: auto;
  }

  .home-test-v1 .home-test-metrics,
  .home-test-v2 .home-test-focus-grid {
    position: static;
  }

  .home-test-v1 .home-test-metrics,
  .home-test-v2 .home-test-metrics,
  .home-test-v3 .home-test-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-test-v1 .home-test-focus-grid,
  .home-test-v2 .home-test-focus-grid,
  .home-test-v3 .home-test-focus-grid,
  .home-test-v2 .home-test-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .home-test-variant-nav {
    width: 100%;
  }

  .home-test-variant-nav a {
    flex: 1;
    min-width: 0;
  }

  .home-test-v1 .home-test-command,
  .home-test-v2 .home-test-command,
  .home-test-v3 .home-test-command {
    align-items: stretch;
    flex-direction: column;
  }

  .home-test-v1 .home-test-metrics,
  .home-test-v2 .home-test-metrics,
  .home-test-v3 .home-test-metrics {
    grid-template-columns: 1fr;
  }

  .home-test-v3 .home-test-title h1 {
    font-size: 30px;
  }
}
