/* ============================================================
   Almanac · skeuomorphic UI
   ------------------------------------------------------------
   One DOM, five themes. Tokens drive everything.
   ============================================================ */

/* ---------- design tokens (default = Garden Ledger) ---------- */
:root,
[data-theme="garden-ledger"] {
  /* surfaces */
  --c-surface:   #f4ecd8;          /* base paper */
  --c-surface-2: #ebdfc1;          /* nested panel */
  --c-surface-3: #e1d2ad;          /* deeper / map ground */
  --c-surface-rail: #e8dcc0;
  --c-canvas:    #efe7d2;

  /* ink */
  --c-text:      #2c2418;
  --c-text-muted:#6b5d4a;
  --c-rule:      #b8a576;          /* dashes, table rules */

  /* accents (semantic, available to all themes) */
  --c-accent:    #b23a2c;          /* stamp red, brand */
  --c-energy:    #7a8f5c;          /* running / agent */
  --c-caution:   #d9a521;          /* warning */
  --c-info:      #4f6f8a;          /* link / view */
  --c-orange:    #c97f3a;          /* note category */

  /* soft variants for fills */
  --c-accent-soft:  #f3dad4;
  --c-energy-soft:  #d8e2c4;
  --c-caution-soft: #f5e3b1;
  --c-info-soft:    #cedce4;

  /* depth */
  --shadow-paper:
    0 1px 0 rgba(0,0,0,.08),
    0 2px 0 var(--c-surface-2),
    0 4px 0 #d9c8a3,
    0 6px 14px rgba(60,40,10,.12);
  --shadow-card:
    0 1px 0 rgba(0,0,0,.06),
    0 4px 12px rgba(60,40,10,.10);
  --shadow-soft: 0 2px 6px rgba(60,40,10,.10);

  /* typography */
  --ff-display: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --ff-body:    "Noto Serif SC", "EB Garamond", Georgia, serif;
  --ff-mono:    "JetBrains Mono", "SF Mono", Menlo, monospace;
  --ff-marker:  "Caveat", "Noto Serif SC", "Marker Felt", cursive;

  /* radius scale */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;

  /* paper grain (CSS-only, no images) */
  --paper-grain:
    radial-gradient(rgba(80,60,30,.045) 1px, transparent 1.5px) 0 0/3px 3px,
    radial-gradient(rgba(180,150,80,.06) 1px, transparent 1.5px) 1px 1px/5px 5px;
}

/* ---------- theme variants ---------- */
[data-theme="studio-rain"] {
  --c-surface:   #f8f2e2;
  --c-surface-2: #f0e7cf;
  --c-surface-3: #e7dcb8;
  --c-surface-rail: #ece1c5;
  --c-canvas:    #f3ead0;

  --c-text:      #3a3527;
  --c-text-muted:#7a705c;
  --c-rule:      #c8b884;

  --c-accent:    #c5694a;
  --c-energy:    #8fa46a;
  --c-caution:   #e8b860;
  --c-info:      #6b9c7a;
  --c-orange:    #d4884d;

  --c-accent-soft:  #f7d9cd;
  --c-energy-soft:  #dde6c5;
  --c-caution-soft: #f9e6b9;
  --c-info-soft:    #d2e3da;

  --shadow-paper:
    0 1px 0 rgba(0,0,0,.05),
    0 2px 0 var(--c-surface-2),
    0 4px 0 #ddd0a8,
    0 6px 12px rgba(80,60,20,.10);
}

[data-theme="druid-heights"] {
  --c-surface:   #efe6cf;
  --c-surface-2: #e3d6b6;
  --c-surface-3: #d4c397;
  --c-surface-rail: #ddd1b0;
  --c-canvas:    #e8dcbf;

  --c-text:      #4a3a24;
  --c-text-muted:#7d6b4d;
  --c-rule:      #b59a64;

  --c-accent:    #8b5a3c;
  --c-energy:    #6b7a4f;
  --c-caution:   #c49850;
  --c-info:      #506e72;
  --c-orange:    #b27039;

  --c-accent-soft:  #e0cdb8;
  --c-energy-soft:  #d4d8b8;
  --c-caution-soft: #f0dcb0;
  --c-info-soft:    #c4d3d3;

  --ff-display: "Playfair Display", Georgia, serif;
  --ff-body:    "EB Garamond", Georgia, serif;

  --shadow-paper:
    0 1px 0 rgba(0,0,0,.10),
    0 2px 0 var(--c-surface-2),
    0 4px 0 #cdb98c,
    0 6px 14px rgba(60,40,10,.16);
}

[data-theme="girlypop"] {
  --c-surface:   #fceaf0;
  --c-surface-2: #f8d8e2;
  --c-surface-3: #f3c8d8;
  --c-surface-rail: #f6d2de;
  --c-canvas:    #fde4ea;

  --c-text:      #6b3f5c;
  --c-text-muted:#a07692;
  --c-rule:      #e3a8c0;

  --c-accent:    #e89bb8;
  --c-energy:    #b5e0d5;
  --c-caution:   #f5c77e;
  --c-info:      #c2b6e8;
  --c-orange:    #f5b9a2;

  --c-accent-soft:  #fad8e4;
  --c-energy-soft:  #d8efe8;
  --c-caution-soft: #fae6c2;
  --c-info-soft:    #e5dff5;

  --r-1: 8px;
  --r-2: 14px;
  --r-3: 20px;
  --r-4: 28px;

  --ff-display: "Playfair Display", "Caveat", cursive;

  --shadow-paper:
    0 1px 0 rgba(0,0,0,.04),
    0 2px 0 var(--c-surface-2),
    0 5px 0 #f0c1d0,
    0 7px 16px rgba(180,80,140,.12);
}

[data-theme="crystal-grove"] {
  --c-surface:   #f0e8ec;
  --c-surface-2: #e2d6e0;
  --c-surface-3: #d4c5d2;
  --c-surface-rail: #e6dae3;
  --c-canvas:    #ece2e8;

  --c-text:      #4a3d52;
  --c-text-muted:#7d6e88;
  --c-rule:      #c2adc0;

  --c-accent:    #b889a8;
  --c-energy:    #9ca8c2;
  --c-caution:   #d9b47e;
  --c-info:      #92a4b6;
  --c-orange:    #c69aa0;

  --c-accent-soft:  #e4d3df;
  --c-energy-soft:  #d6dde8;
  --c-caution-soft: #efddc0;
  --c-info-soft:    #d4dde5;

  --shadow-paper:
    0 1px 0 rgba(0,0,0,.06),
    0 2px 0 var(--c-surface-2),
    0 4px 0 #ccbac5,
    0 6px 16px rgba(80,60,90,.14);
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--c-text);
  background:
    radial-gradient(ellipse at 0% 0%, color-mix(in oklab, var(--c-surface) 90%, white) 0%, var(--c-surface) 100%),
    var(--c-surface);
  background-attachment: fixed;
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: 56px 1fr auto auto;
  grid-template-areas:
    "rail topbar"
    "rail body"
    "rail bottom"
    "rail credit";
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- left rail ---------- */
.rail {
  grid-area: rail;
  background: var(--c-surface-rail);
  border-right: 1px solid var(--c-rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 6px;
  position: sticky; top: 0; height: 100vh;
  background-image: var(--paper-grain);
}
.rail-logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--c-accent); color: var(--c-surface);
  border-radius: var(--r-2);
  margin-bottom: 8px;
  box-shadow: var(--shadow-soft);
}
.rail-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font-size: 16px;
}
.rail-btn:hover { background: var(--c-surface-2); border-color: var(--c-rule); }
.rail-btn.is-active { background: var(--c-surface); border-color: var(--c-rule); box-shadow: var(--shadow-soft); }
.rail-btn--bottom { margin-top: auto; }

/* ---------- top bar ---------- */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--c-surface);
  background-image: var(--paper-grain);
  border-bottom: 1px solid var(--c-rule);
  font-family: var(--ff-display);
}
.topbar__brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 16px; height: 16px; border-radius: 50%; background: var(--c-accent); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: .01em; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.crumb { color: var(--c-text-muted); }
.crumb--active { color: var(--c-text); font-weight: 600; }
.crumb-sep { color: var(--c-rule); }

.tabs { display: flex; gap: 2px; margin-left: 16px; }
.tab {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r-2) var(--r-2) 0 0;
  font: inherit;
  color: var(--c-text-muted);
  position: relative; top: 1px;
}
.tab.is-active { background: var(--c-surface-2); border-color: var(--c-rule); color: var(--c-text); }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; font-family: var(--ff-body); }
.avatars { display: flex; }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: hsl(calc(40 + var(--ai,1)*60), 35%, 65%);
  color: var(--c-surface); font-size: 12px;
  display: grid; place-items: center;
  border: 2px solid var(--c-surface);
  margin-left: -6px;
  font-family: var(--ff-display); font-weight: 700;
}
.avatar:first-child { margin-left: 0; }
.avatar--more { background: var(--c-surface-3); color: var(--c-text); font-size: 11px; }

.btn {
  padding: 6px 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-2);
  font: inherit;
  box-shadow: var(--shadow-soft);
}
.btn--ghost { background: var(--c-surface); }
.btn--icon { padding: 4px 10px; }

/* ---------- main 3-col ---------- */
.body {
  grid-area: body;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

/* ---------- panels (generic) ---------- */
.panel {
  background: var(--c-surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
}
.panel + .panel { margin-top: 10px; }
.panel__head {
  display: flex; align-items: center; gap: 8px;
  margin: -2px -2px 8px;
  font-family: var(--ff-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-text-muted);
}
.panel__title { font-weight: 600; }
.iconbtn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-1);
  padding: 2px 6px;
  font-size: 12px;
  color: var(--c-text-muted);
}
.iconbtn:hover { background: var(--c-surface); border-color: var(--c-rule); color: var(--c-text); }
.iconbtn--more { margin-left: auto; }

/* ---------- left sidebar ---------- */
.sidebar { overflow-y: auto; }
.tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tree__item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 14px;
  position: relative;
  border-radius: var(--r-1);
  cursor: pointer;
}
.tree__item::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px;
  background: var(--tab-color, var(--c-rule));
  border-radius: 2px;
}
.tree__caret { font-size: 10px; color: var(--c-text-muted); width: 10px; }
.tree__icon { font-size: 13px; opacity: .8; }
.tree__label { font-weight: 500; }
.tree__item.is-leaf { padding-left: 30px; font-size: 13px; color: var(--c-text-muted); }
.tree__item.is-leaf::before { display: none; }
.tree__item.is-current { color: var(--c-text); background: var(--c-surface); font-weight: 600; }
.tree__children { list-style: none; padding: 4px 0 4px 0; margin: 0; }

.stack-card { padding: 4px 0; }
.stack-card__title { font-family: var(--ff-display); font-weight: 700; font-size: 17px; }
.stack-card__sub { color: var(--c-text-muted); font-size: 13px; margin: 2px 0 6px; }
.stack-card__meta { font-size: 12px; color: var(--c-text-muted); font-family: var(--ff-mono); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ck, var(--c-rule)) 30%, var(--c-surface));
  color: color-mix(in oklab, var(--ck, var(--c-text)) 80%, var(--c-text));
  border: 1px solid color-mix(in oklab, var(--ck, var(--c-rule)) 40%, transparent);
}

/* ---------- canvas ---------- */
.canvas {
  background: var(--c-canvas);
  background-image:
    var(--paper-grain),
    linear-gradient(transparent 95%, color-mix(in oklab, var(--c-rule) 40%, transparent) 95%),
    linear-gradient(90deg, transparent 95%, color-mix(in oklab, var(--c-rule) 40%, transparent) 95%);
  background-size: auto, 100% 24px, 24px 100%;
  border: 1px solid var(--c-rule);
  border-radius: var(--r-3);
  padding: 18px 18px 22px;
  overflow-y: auto;
  position: relative;
}

.banner-row {
  display: flex; align-items: flex-start; gap: 18px;
  padding-bottom: 12px;
}
.sticky-title {
  background: var(--c-caution-soft);
  padding: 10px 14px;
  border-radius: var(--r-2);
  transform: rotate(var(--rot, 0deg));
  box-shadow: var(--shadow-soft);
  position: relative;
}
.sticky-title::before {
  content: ""; position: absolute; top: -7px; left: 14px;
  width: 22px; height: 14px; background: var(--c-rule);
  border-radius: 2px; transform: rotate(-12deg);
  opacity: .55;
}
.sticky-title__h { margin: 0; font-family: var(--ff-display); font-size: 22px; font-weight: 700; color: var(--c-text); text-transform: uppercase; letter-spacing: .04em; }
.sticky-title__sub { margin: 2px 0 0; color: var(--c-text-muted); font-size: 13px; font-style: italic; }

.stamp {
  font-family: var(--ff-display);
  font-weight: 700;
  letter-spacing: .12em;
  padding: 6px 14px;
  border: 3px double currentColor;
  border-radius: 4px;
  transform: rotate(-5deg);
  align-self: center;
  font-size: 14px;
  text-transform: uppercase;
  opacity: .92;
}
.stamp--field-test { color: var(--c-accent); }

/* ---------- card-row layout ---------- */
.card-row { display: grid; grid-template-columns: 1.2fr 1.4fr 0.7fr; gap: 14px; margin-bottom: 18px; }
.card-row--tight { grid-template-columns: 1fr; }

/* ---------- card primitive ---------- */
.card {
  background: var(--c-surface);
  background-image: var(--paper-grain);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-3);
  padding: 12px 14px;
  box-shadow: var(--shadow-paper);
  position: relative;
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--c-rule);
  margin-bottom: 10px;
}
.card__title {
  font-family: var(--ff-display);
  font-size: 17px;
  margin: 0;
  font-weight: 700;
}
.card__sub { color: var(--c-text-muted); font-size: 12px; }
.card__ver {
  font-family: var(--ff-mono);
  font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--c-rule);
  border-radius: 999px;
  margin-left: 6px;
  color: var(--c-text-muted);
}
.card__body { font-size: 14px; }

/* ---------- agent card ---------- */
.card--agent .agent-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c-energy-soft);
  border: 1px solid var(--c-energy);
  display: grid; place-items: center;
  color: var(--c-energy);
}
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 5px 0; align-items: start; }
.kv + .kv { border-top: 1px dotted var(--c-rule); }
.kv__k { color: var(--c-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.kv__v { font-size: 14px; }
.kv--meta .kv__v { font-family: var(--ff-mono); font-size: 12px; }

/* ---------- chat record card ---------- */
.chat-body { display: flex; flex-direction: column; gap: 8px; }
.msg {
  background: var(--c-surface-2);
  padding: 8px 10px;
  border-radius: var(--r-2);
  font-size: 13px;
  position: relative;
}
.msg__who { font-family: var(--ff-display); font-weight: 600; font-size: 12px; }
.msg__time { color: var(--c-text-muted); font-size: 11px; margin-left: 6px; font-family: var(--ff-mono); }
.msg p { margin: 4px 0 0; }
.msg--me { background: var(--c-caution-soft); align-self: flex-end; max-width: 80%; }

/* chat input */
.chat-input {
  display: flex; gap: 6px; margin-top: 6px;
  padding: 6px 8px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-2);
}
.chat-input__field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
}

/* ---------- sticky note ---------- */
.sticky-note {
  background: var(--c-caution-soft);
  padding: 12px 14px;
  border-radius: var(--r-1);
  transform: rotate(var(--rot, 2deg));
  box-shadow: var(--shadow-paper);
  font-family: var(--ff-marker);
  font-size: 16px;
  align-self: flex-start;
}
.sticky-note__h { margin: 0 0 4px; font-family: var(--ff-display); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--c-text-muted); }
.sticky-note__lead { margin: 0; font-weight: 600; }
.sticky-note__list { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }

/* ---------- tool trace table ---------- */
.tt {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ff-mono);
  font-size: 12px;
}
.tt td {
  padding: 5px 6px;
  border-bottom: 1px dotted var(--c-rule);
}
.tt tr:last-child td { border-bottom: none; }
.tt__meta { color: var(--c-text-muted); }
.tt__time { color: var(--c-text-muted); white-space: nowrap; }
.tt__ok { color: var(--c-energy); width: 1em; text-align: right; }
.tt--compact td { padding: 4px 6px; }

/* ---------- plan table ---------- */
.plan {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.plan th, .plan td {
  padding: 5px 6px;
  text-align: left;
}
.plan th {
  font-family: var(--ff-display);
  font-weight: 600;
  color: var(--c-text-muted);
  border-bottom: 2px solid var(--c-rule);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.plan tbody tr:nth-child(odd) { background: color-mix(in oklab, var(--c-surface-2) 80%, transparent); }
.plan tbody tr td:first-child { font-family: var(--ff-display); font-style: italic; }
.plan__more { font-family: var(--ff-body); text-align: center; color: var(--c-text-muted); padding-top: 8px !important; }
.plan__more a { color: var(--c-accent); }

/* ---------- map card ---------- */
.garden-map { width: 100%; height: auto; border-radius: var(--r-2); }
.map-label { font-family: var(--ff-marker); font-size: 11px; fill: var(--c-text); }
.map-legend {
  display: flex; gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--ff-mono);
  color: var(--c-text-muted);
}

/* ---------- community card ---------- */
.card--community { padding: 10px 14px; }
.card--community p { margin: 4px 0; font-size: 13px; }

/* ---------- right chat pane ---------- */
.chatpane { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.panel--chat { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }

.key-list, .cmds {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 13px;
}
.key-list li, .cmds li { display: flex; align-items: center; gap: 6px; }
.cmds { grid-template-columns: 1fr; }
.cmds kbd {
  font-family: var(--ff-mono);
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--c-rule);
  border-radius: 4px;
  background: var(--c-surface);
  margin-right: 6px;
}

/* ---------- semantic dots ---------- */
.dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-rule);
  vertical-align: -1px;
}
.dot--energy   { background: var(--c-energy); }
.dot--caution  { background: var(--c-caution); }
.dot--accent   { background: var(--c-accent); }
.dot--info     { background: var(--c-info); }
.dot--orange   { background: var(--c-orange); }
.dot--rule     { background: var(--c-rule); }

/* ---------- chat panel stream ---------- */
.chat-stream {
  flex: 0 1 auto;
  min-height: 140px;
  max-height: 300px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 4px;
}
.msg--app .msg__who small {
  font-family: var(--ff-mono);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--c-rule);
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: 1px;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.msg--card .msg-card {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-2);
  text-decoration: none;
  color: inherit;
  font-size: 12px;
}
.msg--card .msg-card strong { display: block; font-family: var(--ff-display); font-size: 13px; }
.msg--card .msg-card small { color: var(--c-text-muted); }

.badge {
  font-family: var(--ff-mono);
  font-size: 11px;
  padding: 1px 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: 3px;
  color: var(--c-text-muted);
}
.badge--live { color: var(--c-energy); border-color: color-mix(in oklab, var(--c-energy) 60%, var(--c-rule)); background: var(--c-energy-soft); }

/* ---------- bottom strip ---------- */
.bottom {
  grid-area: bottom;
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.8fr;
  gap: 14px;
  padding: 0 14px 14px;
  background: var(--c-canvas);
  border-top: 1px solid var(--c-rule);
}
.bottom .panel { margin-top: 14px; align-self: start; }

/* ---------- theme rail (the heart of the manifesto) ---------- */
.theme-rail {
  display: flex; gap: 10px;
  margin: 6px 0 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.swatch {
  flex: 0 0 auto;
  width: 96px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: var(--r-2);
  padding: 6px 6px 8px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  font: inherit; color: inherit;
  cursor: pointer;
  transition: transform .12s ease;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--c-accent) 30%, transparent), var(--shadow-paper);
}
.swatch__paper {
  display: block;
  height: 56px;
  border-radius: var(--r-1);
  border: 1px solid var(--c-rule);
  margin-bottom: 4px;
  background-image: var(--paper-grain);
}
.swatch__paper[data-paper="garden-ledger"] { background-color: #f4ecd8; box-shadow: inset 0 -10px 0 #b23a2c; }
.swatch__paper[data-paper="studio-rain"]   { background-color: #f8f2e2; box-shadow: inset 0 -10px 0 #8fa46a; }
.swatch__paper[data-paper="druid-heights"] { background-color: #efe6cf; box-shadow: inset 0 -10px 0 #8b5a3c; }
.swatch__paper[data-paper="girlypop"]      { background-color: #fceaf0; box-shadow: inset 0 -10px 0 #e89bb8; }
.swatch__paper[data-paper="crystal-grove"] { background-color: #f0e8ec; box-shadow: inset 0 -10px 0 #b889a8; }

.swatch__label { font-family: var(--ff-display); font-size: 12px; color: var(--c-text); }
.swatch--new {
  width: 56px; display: grid; place-items: center;
  font-size: 22px; color: var(--c-text-muted);
  border-style: dashed;
  background: transparent;
}

.theme-sliders {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  font-family: var(--ff-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-text-muted);
}
.theme-sliders label { display: flex; flex-direction: column; gap: 4px; }
.theme-sliders input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 6px; width: 100%;
  background: var(--c-surface-3);
  border-radius: 999px;
  outline: none;
}
.theme-sliders input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--c-accent);
  border-radius: 50%;
  border: 2px solid var(--c-surface);
  box-shadow: var(--shadow-soft);
}

/* ---------- status meters ---------- */
.status-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 6px;
  font-family: var(--ff-mono);
  font-size: 12px;
}
.status-list li { display: grid; grid-template-columns: 70px 1fr 50px; align-items: center; gap: 8px; }
.meter {
  height: 8px;
  background: var(--c-surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  width: var(--p, 50%);
  background: var(--mc, var(--c-energy));
  border-radius: 999px;
}

/* ---------- helpers ---------- */
.muted { color: var(--c-text-muted); font-size: 12px; }
.muted a { color: var(--c-accent); }

.page-credit {
  grid-area: credit;
  text-align: center;
  font-size: 11px;
  color: var(--c-text-muted);
  padding: 12px;
  font-style: italic;
  border-top: 1px dashed var(--c-rule);
  background: var(--c-surface);
}
.page-credit a { color: var(--c-accent); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--c-rule); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
