:root {
  color-scheme: dark;
  --bg: #111115;
  --ink: #f3f0ea;
  --muted: #aaa8b3;
  --line: #373740;
  --panel: #1b1b21;
  --panel-soft: #25252d;
  --panel-deep: #15151a;
  --accent: #66b8ff;
  --accent-strong: #a9d7ff;
  --gold: #e0a04a;
  --red: #ef7568;
  --blue: #8fb9f3;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #23232a;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #5e5f6c;
  background: #292933;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid #8ccaff;
  outline-offset: 3px;
}

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

button.primary {
  color: #06111c;
  border-color: #8ccaff;
  background: var(--accent);
}

button.primary:hover:not(:disabled) {
  color: #03101b;
  border-color: #b8ddff;
  background: #87caff;
}

button.accent {
  color: #1a1005;
  border-color: #efb160;
  background: var(--gold);
}

button.accent:hover:not(:disabled) {
  color: #170d03;
  border-color: #f3c780;
  background: #ecb45f;
}

code {
  border-radius: 5px;
  padding: 1px 5px;
  color: #dbeeff;
  background: #292a33;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.trust-panel {
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.trust-panel span {
  display: block;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.notice {
  margin-bottom: 18px;
  border: 1px solid #8d4038;
  border-radius: 8px;
  padding: 14px 16px;
  color: #ffd7d1;
  background: #351713;
}

.hidden {
  display: none !important;
}

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

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

.controls {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.control-group {
  display: grid;
  gap: 10px;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.94rem;
}

.options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.option-text {
  min-width: 0;
}

.status-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.status-box p {
  margin: 10px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: #dedde7;
  background: var(--panel-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge.ready {
  color: #06111c;
  background: var(--accent);
}

.badge.warn {
  color: #241604;
  background: #f0bf69;
}

.badge.error {
  color: #210806;
  background: var(--red);
}

.results {
  min-height: 420px;
  padding: 18px;
}

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

.summary.empty {
  display: block;
  border: 1px dashed #5b5b67;
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: var(--panel-deep);
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-deep);
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.05;
}

.metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.plan-list {
  display: grid;
  gap: 14px;
}

.section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.section h2 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 1rem;
  letter-spacing: 0;
}

.rows {
  display: grid;
}

.row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-top: 1px solid #2b2b33;
}

.row:first-child {
  border-top: 0;
}

.path {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
}

.pill {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 9px;
  color: #dedde7;
  background: #2b2b33;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.pill.create,
.pill.update {
  color: #06111c;
  background: var(--accent);
}

.pill.skip {
  color: #241604;
  background: #f0bf69;
}

.pill.error {
  color: #210806;
  background: var(--red);
}

.pill.info {
  color: #07111a;
  background: var(--blue);
}

.compact-list {
  max-height: 260px;
  overflow: auto;
}

.log-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.log-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.log-panel summary:hover {
  color: var(--ink);
}

.log {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
}

.log p {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 22px 0;
  }

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

  .trust-panel {
    min-width: 0;
  }

  .controls {
    position: static;
  }

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

  .row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .pill {
    justify-self: start;
  }
}
