:root {
  color-scheme: light;
  --ink: #173134;
  --muted: #607171;
  --paper: #f5f2e9;
  --white: #fff;
  --sage: #d7efb4;
  --sage-dark: #426522;
  --line: #d8ddd5;
  --danger: #923c31;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
main { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0; }
.starter-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.starter-header a { color: var(--muted); font-size: .78rem; font-weight: 800; }
.starter-header p, .catalogue-heading p, .safety-copy > p { margin: 30px 0 8px; color: var(--sage-dark); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.starter-header h1 { max-width: 680px; margin: 0; font-size: clamp(2.5rem, 7vw, 5.3rem); letter-spacing: -.06em; line-height: .98; }
.starter-header div > span { max-width: 650px; margin-top: 18px; display: block; color: var(--muted); }
.connection { padding: 8px 12px; border-radius: 999px; color: #81590b; background: #fff5d9; font-size: .74rem; font-weight: 900; }
.connection[data-status="connected"] { color: #35620a; background: #eaf8d4; }
.catalogue { margin-top: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 24px 70px rgba(23, 49, 52, .09); }
.catalogue-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 26px; border-bottom: 1px solid var(--line); }
.catalogue-heading p { margin-top: 0; }
.catalogue-heading h2, .data-safety h2 { margin: 0; font-size: 1.7rem; letter-spacing: -.035em; }
.catalogue-heading div > span, .safety-copy > span { color: var(--muted); font-size: .84rem; }
.catalogue-heading dl { margin: 0; display: flex; gap: 8px; }
.catalogue-heading dl div, .restore-review dl div { padding: 10px 12px; border-radius: 10px; background: var(--paper); }
dt { color: var(--muted); font-size: .62rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
dd { margin: 2px 0 0; font-weight: 900; }
.items { display: grid; gap: 10px; padding: 18px; }
.items article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border-radius: 14px; background: var(--paper); }
.items h3 { margin: 0; font-size: .95rem; }
.items p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 36px; height: 36px; border: 0; border-radius: 10px; color: var(--white); background: var(--ink); cursor: pointer; font-weight: 900; }
.stepper button:hover { color: var(--ink); background: var(--sage); }
.stepper output { min-width: 24px; text-align: center; font-weight: 900; }
.phase, .backup-status { min-height: 48px; margin: 0; padding: 14px 24px; color: var(--muted); font-size: .78rem; }
.phase { border-top: 1px solid var(--line); }
.phase[data-tone="success"], .backup-status[data-tone="success"] { color: var(--sage-dark); }
.phase[data-tone="error"], .backup-status[data-tone="error"] { color: var(--danger); }
.data-safety { margin-top: 20px; overflow: hidden; border: 1px solid #385154; border-radius: 24px; color: var(--white); background: var(--ink); }
.safety-copy { padding: 26px 26px 0; }
.safety-copy > p { margin-top: 0; color: var(--sage); }
.safety-copy > span { display: block; max-width: 700px; margin-top: 8px; color: #b9ccca; }
.safety-actions { padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.safety-actions button, .file-button, .restore-actions button { min-height: 44px; padding: 0 15px; display: inline-flex; align-items: center; border-radius: 10px; cursor: pointer; font-size: .78rem; font-weight: 900; }
.safety-actions .primary { border: 0; color: var(--ink); background: var(--sage); }
.file-button { border: 1px solid #587174; color: var(--white); background: transparent; }
#backup-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.restore-review { margin: 0 26px 8px; padding: 18px; border: 1px solid #587174; border-radius: 16px; background: #203d40; }
.restore-review > div:first-child > strong { display: block; margin-bottom: 12px; }
.restore-review dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.restore-review dl div { min-width: 0; color: var(--ink); }
.restore-review dd { overflow-wrap: anywhere; }
.confirm-row { margin-top: 15px; display: flex; align-items: flex-start; gap: 8px; color: #dce8e6; font-size: .8rem; cursor: pointer; }
.confirm-row input { margin-top: 3px; accent-color: var(--sage); }
.restore-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.restore-actions .danger { border: 0; color: var(--white); background: var(--danger); }
.restore-actions .danger:disabled { cursor: not-allowed; opacity: .45; }
.restore-actions .quiet { border: 1px solid #587174; color: #dce8e6; background: transparent; }
.backup-status { color: #b9ccca; }
aside { margin-top: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
aside p { max-width: 760px; margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
code { padding: 2px 5px; border-radius: 5px; color: var(--sage-dark); background: #eaf3dd; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #78a730; outline-offset: 3px; }

@media (max-width: 680px) {
  main { padding-top: 28px; }
  .starter-header, .catalogue-heading, .items article { align-items: stretch; flex-direction: column; }
  .connection { align-self: flex-start; }
  .catalogue-heading dl, .safety-actions, .restore-actions { align-items: stretch; flex-direction: column; }
  .stepper { justify-content: flex-end; }
  .safety-actions button, .file-button, .restore-actions button { justify-content: center; width: 100%; }
  .restore-review dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
