:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px;

  /* Warm domestic palette: linen surfaces, ink text, clay accent */
  --bg: oklch(0.975 0.008 80);
  --surface: oklch(0.995 0.004 80);
  --surface-2: oklch(0.955 0.01 80);
  --ink: oklch(0.24 0.02 60);
  --ink-2: oklch(0.45 0.02 60);
  --ink-3: oklch(0.6 0.015 60);
  --line: oklch(0.3 0.02 60 / 0.12);
  --line-strong: oklch(0.3 0.02 60 / 0.24);
  --accent: oklch(0.56 0.13 45);        /* clay */
  --accent-ink: oklch(0.99 0 0);
  --accent-soft: oklch(0.93 0.04 45);

  /* Partner colours: Claire = moss, Marc = slate blue */
  --p1: oklch(0.52 0.09 150);
  --p1-soft: oklch(0.93 0.035 150);
  --p2: oklch(0.5 0.08 245);
  --p2-soft: oklch(0.93 0.03 245);
  --none: oklch(0.6 0.015 60);
  --none-soft: oklch(0.94 0.008 60);

  --ok: oklch(0.55 0.12 150);
  --warn: oklch(0.65 0.14 70);
  --alert: oklch(0.55 0.16 25);

  --font-body: 'General Sans', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Erode', Georgia, serif;
  --shadow: 0 1px 2px oklch(0.3 0.03 60 / 0.06), 0 6px 20px oklch(0.3 0.03 60 / 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: var(--space-2) var(--space-3); }
.skip:focus { left: var(--space-3); top: var(--space-3); z-index: 100; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap;
  padding: var(--space-4) clamp(var(--space-4), 4vw, var(--space-12));
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em; }
.brand-sub { font-size: var(--text-xs); color: var(--ink-3); }
.tabs { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.tab {
  background: none; border: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); min-height: 44px;
}
.tab:hover { background: var(--surface-2); }
.tab.is-active { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.viewer { display: flex; align-items: center; gap: var(--space-1); background: var(--surface-2); padding: var(--space-1); border-radius: 999px; }
.viewer-label { font-size: var(--text-xs); color: var(--ink-3); padding: 0 var(--space-2) 0 var(--space-3); }
.viewer-btn {
  border: 0; background: none; border-radius: 999px; padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); min-height: 36px;
}
.viewer-btn.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.viewer-btn[data-viewer="p1"].is-active { color: var(--p1); }
.viewer-btn[data-viewer="p2"].is-active { color: var(--p2); }

/* ---------- Layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: var(--space-8) clamp(var(--space-4), 4vw, var(--space-12)) var(--space-16); }
.view { display: none; flex-direction: column; gap: var(--space-6); }
.view.is-active { display: flex; }
.page-head { max-width: 60ch; margin-bottom: var(--space-2); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.015em; line-height: 1.15; }
.lede { color: var(--ink-2); margin-top: var(--space-3); }
h2 { font-size: var(--text-lg); font-weight: 600; line-height: 1.25; }
h3 { font-size: var(--text-base); font-weight: 600; }
.muted { color: var(--ink-2); font-size: var(--text-sm); }
.hint { color: var(--ink-3); font-size: var(--text-sm); margin-top: var(--space-3); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-6); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.card-quiet { background: var(--surface-2); border-color: transparent; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--text-sm); font-weight: 500;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: oklch(0.5 0.13 45); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link { background: none; border: 0; color: var(--accent); font-size: var(--text-sm); font-weight: 500; padding: var(--space-2); min-height: 44px; }
.link:hover { text-decoration: underline; }
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; margin-top: var(--space-2); }

/* ---------- Chips & badges ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: var(--space-2) var(--space-4); font-size: var(--text-sm); min-height: 40px; color: var(--ink-2);
}
.chip.is-active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.owner {
  display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600;
  padding: var(--space-1) var(--space-3); border-radius: 999px; white-space: nowrap;
}
.owner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.owner[data-owner="p1"] { color: var(--p1); background: var(--p1-soft); }
.owner[data-owner="p2"] { color: var(--p2); background: var(--p2-soft); }
.owner[data-owner=""], .owner[data-owner="none"] { color: var(--none); background: var(--none-soft); }
.weight { font-size: var(--text-xs); color: var(--ink-3); letter-spacing: 0.08em; }
.tag { font-size: var(--text-xs); color: var(--ink-2); background: var(--surface-2); padding: 2px var(--space-2); border-radius: var(--radius-sm); }

/* ---------- Balance ---------- */
.balance-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.balance-bar span { display: block; height: 100%; transition: width 0.4s ease; }
.balance-bar .b-p1 { background: var(--p1); }
.balance-bar .b-p2 { background: var(--p2); }
.balance-bar .b-none { background: var(--none); opacity: 0.5; }
.balance-legend { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-3); flex-wrap: wrap; }
.balance-legend strong { font-size: var(--text-lg); font-weight: 600; display: block; line-height: 1.1; }
.balance-legend small { font-size: var(--text-xs); color: var(--ink-3); }
.balance-legend [data-owner="p1"] strong { color: var(--p1); }
.balance-legend [data-owner="p2"] strong { color: var(--p2); }
.balance-note { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--ink-2); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-radius: var(--radius-md); }

/* ---------- Items (échéances) ---------- */
.items { display: flex; flex-direction: column; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center;
  padding: var(--space-3) 0; border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item.is-done .item-title { text-decoration: line-through; color: var(--ink-3); }
.item-date { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--ink-3); min-width: 6.5ch; }
.item-date.is-late { color: var(--alert); font-weight: 600; }
.item-date.is-today { color: var(--accent); font-weight: 600; }
.item-title { font-size: var(--text-sm); }
.item-domain { font-size: var(--text-xs); color: var(--ink-3); display: block; }
.item-edit { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; border-bottom: 1px dashed transparent; }
.item-edit:hover, .item-edit:focus-visible { border-bottom-color: var(--ink-3); outline: none; }
.item.is-done .item-edit { text-decoration: line-through; color: var(--ink-3); }
.actions-split { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.actions-right { display: inline-flex; gap: var(--space-2); }
.btn-danger-text { color: var(--alert); }
.check {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; padding: 0;
}
.check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 14px; height: 14px; }
.check-wrap { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.empty { color: var(--ink-3); font-size: var(--text-sm); padding: var(--space-6) 0; text-align: left; }
.is-hidden { display: none !important; }

/* ---------- Domain cards ---------- */
.domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.domain {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3);
}
.domain.is-transferred { outline: 2px dashed var(--accent-soft); outline-offset: -2px; }
.domain-head { display: flex; justify-content: space-between; gap: var(--space-3); align-items: flex-start; }
.domain-head h3 { font-size: var(--text-base); }
.domain-scope { font-size: var(--text-sm); color: var(--ink-2); }
.domain-standard { font-size: var(--text-sm); padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-md); }
.domain-standard b { display: block; font-size: var(--text-xs); color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-1); }
.domain-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.domain-items { border-top: 1px solid var(--line); padding-top: var(--space-2); }
.domain-items .item { padding: var(--space-2) 0; }
.domain-foot { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-2); }
.until { font-size: var(--text-xs); color: var(--accent); font-weight: 500; }

/* ---------- Steps ---------- */
.steps { display: flex; flex-direction: column; gap: var(--space-3); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step-head {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); cursor: pointer;
}
.step-head h2 { font-size: var(--text-base); }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-2); font-size: var(--text-sm); font-weight: 600;
}
.step.is-open .step-num { background: var(--ink); color: var(--surface); }
.step-body { display: none; padding: 0 var(--space-6) var(--space-6); flex-direction: column; gap: var(--space-4); }
.step.is-open .step-body { display: flex; }

.load-picker { display: flex; flex-direction: column; gap: var(--space-2); }
.load-picker .who { font-weight: 600; font-size: var(--text-sm); }
.load-picker .who[data-owner="p1"] { color: var(--p1); }
.load-picker .who[data-owner="p2"] { color: var(--p2); }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--surface); padding: var(--space-2); min-height: 44px; font-size: var(--text-sm); color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-active { background: var(--ink); color: var(--surface); font-weight: 600; }

.review-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: center;
  padding: var(--space-3) 0; border-top: 1px solid var(--line);
}
.review-row:first-child { border-top: 0; }
.review-row .name { font-size: var(--text-sm); font-weight: 500; }
.review-row .seg button { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.review-row .seg { min-width: 340px; }
.review-row .seg button.is-active[data-v="ok"] { background: var(--ok); }
.review-row .seg button.is-active[data-v="adjust"] { background: var(--warn); color: var(--ink); }
.review-row .seg button.is-active[data-v="help"] { background: var(--alert); }
.review-group { margin-bottom: var(--space-4); }
.review-group h3 { font-size: var(--text-sm); margin-bottom: var(--space-2); }

.suggestion { padding: var(--space-3) var(--space-4); background: var(--accent-soft); border-radius: var(--radius-md); font-size: var(--text-sm); }
.suggestion + .suggestion { margin-top: var(--space-2); }

.history li { padding: var(--space-3) 0; border-top: 1px solid var(--line); font-size: var(--text-sm); display: grid; gap: var(--space-1); }
.history li:first-child { border-top: 0; }
.history time { font-size: var(--text-xs); color: var(--ink-3); }

/* ---------- Rules ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.rule { padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.rule h2 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.rule p { font-size: var(--text-sm); color: var(--ink-2); }

/* ---------- Forms & dialog ---------- */
[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: var(--space-1); border: 0; padding: 0; margin: 0; }
.field > span, .field > legend { font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  background: var(--surface); font-size: var(--text-sm); min-height: 44px; width: 100%;
}
.field textarea { min-height: 0; resize: vertical; }
.checks { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.checks label { display: inline-flex; gap: var(--space-2); align-items: center; font-size: var(--text-sm); min-height: 44px; }
.dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: min(92vw, 520px); width: 100%; box-shadow: var(--shadow); }
.dialog::backdrop { background: oklch(0.2 0.02 60 / 0.4); }
.dialog form { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }

.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--surface); padding: var(--space-3) var(--space-5); border-radius: 999px;
  font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 50; max-width: 90vw;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .topbar { gap: var(--space-3); }
  .brand { width: 100%; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tab { padding: var(--space-2); }
  .viewer { margin-left: auto; }
  .card, .step-head, .step-body { padding-inline: var(--space-4); }
  .review-row { grid-template-columns: 1fr; }
  .review-row .seg { min-width: 0; }
}

/* Domain cards: date under the title to keep titles readable */
.domain-items .item { grid-template-columns: auto 1fr; row-gap: 0; }
.domain-items .item-date { grid-column: 2; justify-self: start; min-width: 0; }

@media (max-width: 640px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .tab { flex: 1 0 auto; white-space: nowrap; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
  .item { grid-template-columns: auto 1fr; }
  .item-date { grid-column: 2; justify-self: start; min-width: 0; }
  .item .check-wrap { grid-row: span 2; }
  .balance-legend > div { flex: 1 1 30%; }
}
.review-row .seg button { flex: 1 1 auto; white-space: nowrap; }
#week-status .item { grid-template-columns: 10ch 1fr; }
#week-status .item > span:last-child { display: none; }
#week-status .item-date { grid-column: 1; min-width: 0; }

/* Inventaire */
.inv-form { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.inv-form .field { min-width: 180px; }
.inv-form .btn { min-height: 44px; }
.inv-domain { display: block; font-size: var(--text-xs); color: var(--ink-3); }
.inv-del { background: none; border: 0; color: var(--ink-3); font-size: var(--text-xs); min-height: 44px; padding: var(--space-2); }
.inv-del:hover { color: var(--alert); }
.inv-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.inv-compare .box { padding: var(--space-4); background: var(--surface-2); border-radius: var(--radius-md); }
.inv-compare strong { font-size: var(--text-lg); display: block; line-height: 1.1; }
.inv-compare small { font-size: var(--text-xs); color: var(--ink-3); }
.inv-compare .by-domain { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--ink-2); }

/* Bibliothèque */
.dialog-wide { max-width: min(92vw, 720px); }
.dialog-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); max-height: 85vh; overflow: auto; }
.library li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.library li:first-child { border-top: 0; }
.library .lib-name { font-weight: 600; font-size: var(--text-sm); }
.library .lib-scope { font-size: var(--text-xs); color: var(--ink-2); }
.library .is-added { color: var(--ink-3); font-size: var(--text-xs); }

/* Famille */
#family-summary ul { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

/* ---------- Version serveur : accueil, synchronisation, données ---------- */
body.is-loading .start, body.is-loading .topbar, body.is-loading main { display: none; }
body:not(.is-joined):not(.is-loading) .topbar, body:not(.is-joined):not(.is-loading) main { display: none; }
body.is-joined .start { display: none; }

.start { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: clamp(var(--space-6), 6vw, var(--space-16)) clamp(var(--space-4), 4vw, var(--space-12)); }
.start-inner { width: 100%; max-width: 980px; display: flex; flex-direction: column; gap: var(--space-6); }
.start-kicker { font-family: var(--font-display); color: var(--accent); font-weight: 600; font-size: var(--text-base); }
.start h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.015em; line-height: 1.15; max-width: 22ch; }
.start .lede { max-width: 62ch; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-6); align-items: start; }
.start-card { display: flex; flex-direction: column; gap: var(--space-4); }
.start-card h2 { font-size: var(--text-lg); font-weight: 600; }
.start-note { max-width: 70ch; }
.radio { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); font-weight: 400; color: var(--ink); padding: var(--space-1) 0; }
.radio input { margin: 0; flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; accent-color: var(--accent); align-self: center; }
.radio { align-items: center; }
.code-input { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: lowercase; }
.form-error { color: var(--alert); font-size: var(--text-sm); }

.sync { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.sync[data-state="saved"] .sync-dot { background: var(--ok); }
.sync[data-state="saving"] .sync-dot { background: var(--warn); }
.sync[data-state="offline"] .sync-dot, .sync[data-state="error"] .sync-dot { background: var(--alert); }
.sync[data-state="offline"], .sync[data-state="error"] { color: var(--alert); }

.code-chip { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: var(--text-sm); letter-spacing: 0.06em; background: var(--surface-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); color: var(--ink); }
.danger-zone { border-top: 1px solid var(--line); padding-top: var(--space-4); margin-top: var(--space-4); justify-content: flex-start; }
.btn-danger { color: var(--alert); }
.btn-danger:hover { background: oklch(0.95 0.03 25); }
.btn-primary.btn-danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn-primary.btn-danger:hover { background: oklch(0.5 0.16 25); }
.dialog-sm { max-width: min(92vw, 440px); }
.snapshots li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--line); font-size: var(--text-sm); }
.snapshots li:first-child { border-top: 0; }
.snapshots small { display: block; color: var(--ink-3); font-size: var(--text-xs); }
.snapshots .is-current { color: var(--ink-3); font-size: var(--text-xs); }
a.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 640px) {
  .sync { order: 2; margin-left: auto; }
  .brand { width: auto; }
  .viewer { order: 4; width: 100%; justify-content: center; margin-left: 0; }
  .danger-zone { flex-direction: column; align-items: stretch; }
}
