/* ─── register: a private inventory of concerns ──────────────────────── */

:root {
  /* paper — default theme: warm cream + terracotta */
  --paper:        #f1ece1;
  --paper-warm:   #f8f3e7;
  --paper-deep:   #ebe4d3;
  --ink:          #1a1612;
  --ink-soft:     #4b443a;
  --ink-mid:      #6f6657;
  --ink-faint:    #8e8674;
  --rule:         #d6cdb8;
  --rule-soft:    #e3dac6;
  --accent:       #8c3a2e;     /* deep terracotta */
  --accent-warm:  #b85440;
  --accent-soft:  #c89a8b;
  --gold:         #b48a3a;     /* aged gold for highlights */
  --shadow-1:     0 1px 0 rgba(26, 22, 18, 0.04);
  --shadow-2:     0 8px 24px -16px rgba(26, 22, 18, 0.18);
  --shadow-3:     0 24px 64px -32px rgba(26, 22, 18, 0.32);

  --fresh-bg:     rgba(180, 138, 58, 0.18);
  --fresh-bg-mid: rgba(180, 138, 58, 0.10);
  --touched-bg:   rgba(140, 58, 46, 0.10);
  --selection-bg: rgba(180, 138, 58, 0.35);
  --ok-bg:        rgba(180, 138, 58, 0.12);
  --ok-color:     #5e4514;
  --ok-border:    rgba(180, 138, 58, 0.4);
  --fail-bg:      rgba(140, 58, 46, 0.10);
  --fail-border:  rgba(140, 58, 46, 0.3);

  --serif-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --serif-body:    'Newsreader', 'Iowan Old Style', Georgia, serif;
  --mono:          'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ─── alternate themes ─────────────────────────────────────────────── */

/* archive — cool ivory + prussian blue + oxblood */
[data-theme="archive"] {
  --paper:        #ecebe3;
  --paper-warm:   #f4f1e3;
  --paper-deep:   #dedccb;
  --ink:          #131a26;
  --ink-soft:     #2c3a4d;
  --ink-mid:      #4f5c6f;
  --ink-faint:    #7a8294;
  --rule:         #c4c2af;
  --rule-soft:    #d4d2bf;
  --accent:       #6e3232;
  --accent-warm:  #8c4040;
  --accent-soft:  #b4938d;
  --gold:         #46627e;
  --fresh-bg:     rgba(70, 98, 126, 0.16);
  --fresh-bg-mid: rgba(70, 98, 126, 0.08);
  --touched-bg:   rgba(110, 50, 50, 0.10);
  --selection-bg: rgba(70, 98, 126, 0.30);
  --ok-bg:        rgba(70, 98, 126, 0.12);
  --ok-color:     #2c3a4d;
  --ok-border:    rgba(70, 98, 126, 0.36);
  --fail-bg:      rgba(110, 50, 50, 0.10);
  --fail-border:  rgba(110, 50, 50, 0.32);
}

/* moleskine — notebook cream + forest green + burnt sienna */
[data-theme="moleskine"] {
  --paper:        #e6dcc1;
  --paper-warm:   #ede4cb;
  --paper-deep:   #d4c9a9;
  --ink:          #1c1a14;
  --ink-soft:     #3c3a30;
  --ink-mid:      #66614f;
  --ink-faint:    #8a8470;
  --rule:         #c2b89a;
  --rule-soft:    #d2c7a7;
  --accent:       #2f5d3d;
  --accent-warm:  #3f7a4e;
  --accent-soft:  #9bb29e;
  --gold:         #8e5a2e;
  --fresh-bg:     rgba(142, 90, 46, 0.18);
  --fresh-bg-mid: rgba(142, 90, 46, 0.10);
  --touched-bg:   rgba(47, 93, 61, 0.12);
  --selection-bg: rgba(142, 90, 46, 0.30);
  --ok-bg:        rgba(47, 93, 61, 0.12);
  --ok-color:     #244a31;
  --ok-border:    rgba(47, 93, 61, 0.40);
  --fail-bg:      rgba(142, 60, 46, 0.10);
  --fail-border:  rgba(142, 60, 46, 0.32);
}

/* midnight — warm dark walnut + parchment + amber */
[data-theme="midnight"] {
  --paper:        #1b1813;
  --paper-warm:   #221d16;
  --paper-deep:   #15110d;
  --ink:          #ece0c4;
  --ink-soft:     #c9bca0;
  --ink-mid:      #9b9079;
  --ink-faint:    #6f6855;
  --rule:         #3a3225;
  --rule-soft:    #2b2519;
  --accent:       #d6884e;
  --accent-warm:  #e8a06b;
  --accent-soft:  #8c5e3a;
  --gold:         #d2b27a;
  --shadow-1:     0 1px 0 rgba(0, 0, 0, 0.20);
  --shadow-2:     0 8px 24px -16px rgba(0, 0, 0, 0.55);
  --shadow-3:     0 24px 64px -32px rgba(0, 0, 0, 0.80);
  --fresh-bg:     rgba(214, 136, 78, 0.22);
  --fresh-bg-mid: rgba(214, 136, 78, 0.12);
  --touched-bg:   rgba(214, 136, 78, 0.10);
  --selection-bg: rgba(214, 136, 78, 0.32);
  --ok-bg:        rgba(210, 178, 122, 0.14);
  --ok-color:     #d2b27a;
  --ok-border:    rgba(210, 178, 122, 0.36);
  --fail-bg:      rgba(214, 136, 78, 0.10);
  --fail-border:  rgba(214, 136, 78, 0.32);
}

/* draft — crisp pure white, charcoal ink, cobalt accent. no grain. */
[data-theme="draft"] {
  --paper:        #ffffff;
  --paper-warm:   #f7f8fa;
  --paper-deep:   #eef0f4;
  --ink:          #0b0d10;
  --ink-soft:     #2a2f37;
  --ink-mid:      #5a6068;
  --ink-faint:    #9aa0a8;
  --rule:         #e2e6ec;
  --rule-soft:    #eef0f4;
  --accent:       #1f4ed8;
  --accent-warm:  #2563eb;
  --accent-soft:  #a8baef;
  --gold:         #6b7280;
  --shadow-1:     0 1px 0 rgba(11, 13, 16, 0.04);
  --shadow-2:     0 8px 24px -16px rgba(11, 13, 16, 0.16);
  --shadow-3:     0 24px 64px -32px rgba(11, 13, 16, 0.20);
  --fresh-bg:     rgba(31, 78, 216, 0.10);
  --fresh-bg-mid: rgba(31, 78, 216, 0.05);
  --touched-bg:   rgba(31, 78, 216, 0.06);
  --selection-bg: rgba(31, 78, 216, 0.20);
  --ok-bg:        rgba(31, 78, 216, 0.08);
  --ok-color:     #1f4ed8;
  --ok-border:    rgba(31, 78, 216, 0.30);
  --fail-bg:      rgba(220, 38, 38, 0.08);
  --fail-border:  rgba(220, 38, 38, 0.30);
}

/* typewriter — bright white + jet black + ribbon red */
[data-theme="typewriter"] {
  --paper:        #fbfaf6;
  --paper-warm:   #ffffff;
  --paper-deep:   #efece4;
  --ink:          #100e0b;
  --ink-soft:     #2a2723;
  --ink-mid:      #58544e;
  --ink-faint:    #8e8a82;
  --rule:         #d6d2c8;
  --rule-soft:    #e6e2d8;
  --accent:       #a91f1a;
  --accent-warm:  #c93630;
  --accent-soft:  #d99c98;
  --gold:         #5a5650;
  --fresh-bg:     rgba(169, 31, 26, 0.10);
  --fresh-bg-mid: rgba(169, 31, 26, 0.05);
  --touched-bg:   rgba(169, 31, 26, 0.08);
  --selection-bg: rgba(169, 31, 26, 0.22);
  --ok-bg:        rgba(90, 86, 80, 0.10);
  --ok-color:     #2a2723;
  --ok-border:    rgba(90, 86, 80, 0.34);
  --fail-bg:      rgba(169, 31, 26, 0.08);
  --fail-border:  rgba(169, 31, 26, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* paper grain — very subtle noise + warm radial wash */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(180, 138, 58, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(140, 58, 46, 0.06), transparent 65%),
    radial-gradient(600px 400px at 50% 50%, rgba(255, 250, 240, 0.4), transparent 70%);
  mix-blend-mode: multiply;
}
.paper-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* per-theme grain adjustments */
[data-theme="archive"] .paper-grain {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(70, 98, 126, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(110, 50, 50, 0.05), transparent 65%),
    radial-gradient(600px 400px at 50% 50%, rgba(255, 252, 240, 0.32), transparent 70%);
}
[data-theme="moleskine"] .paper-grain {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(142, 90, 46, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(47, 93, 61, 0.07), transparent 65%),
    radial-gradient(600px 400px at 50% 50%, rgba(255, 248, 224, 0.40), transparent 70%);
}
[data-theme="midnight"] .paper-grain {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(214, 136, 78, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(210, 178, 122, 0.06), transparent 65%);
  mix-blend-mode: screen;
}
[data-theme="midnight"] .paper-grain::after {
  opacity: 0.18;
  mix-blend-mode: screen;
}
[data-theme="typewriter"] .paper-grain {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(169, 31, 26, 0.04), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(255, 255, 255, 0.5), transparent 70%);
}
[data-theme="typewriter"] .paper-grain::after {
  opacity: 0.22;
}
[data-theme="draft"] .paper-grain { background: none; }
[data-theme="draft"] .paper-grain::after { display: none; }

/* ─── layout ──────────────────────────────────────────────────────────── */

.register {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

@media (max-width: 640px) {
  .register { padding: 28px 20px 64px; }
}

.register__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.brand__mark {
  font-family: var(--serif-display);
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "wght" 400, "SOFT" 100;
  font-style: italic;
  margin-right: 2px;
  transform: translateY(2px);
}
.brand__name {
  font-family: var(--serif-display);
  font-size: 28px;
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 50;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__sub {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
}
@media (max-width: 520px) { .brand__sub { display: none; } }

.head__actions {
  display: flex;
  gap: 8px;
}
.iconbtn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent-soft); background: var(--paper-warm); }
.iconbtn--active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--paper-warm);
}
.iconbtn--active svg { fill: var(--accent); }
#open-settings:hover { transform: rotate(20deg); }
#open-log:hover      { transform: rotate(-12deg); }

/* ─── capture surface ─────────────────────────────────────────────────── */

.capture {
  position: relative;
  margin-bottom: 56px;
}
.capture__rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 12%, var(--rule) 88%, transparent);
}
.capture__rule--top    { background: linear-gradient(90deg, transparent, var(--rule-soft) 18%, var(--rule-soft) 82%, transparent); }
.capture__rule--bottom { background: linear-gradient(90deg, transparent, var(--ink-faint) 8%, var(--ink-faint) 92%, transparent); opacity: 0.35; transition: opacity .4s; }

.capture:focus-within .capture__rule--bottom { opacity: 0.9; }
.capture:focus-within .capture__rule--top    { opacity: 0.7; }

.capture__input {
  width: 100%;
  display: block;
  background: transparent;
  border: 0;
  padding: 22px 0 18px;
  margin: 0;
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 60, "wght" 360, "SOFT" 80;
  font-size: 30px;
  line-height: 1.36;
  color: var(--ink);
  resize: none;
  outline: none;
  caret-color: var(--accent);
}
.capture__input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
  font-variation-settings: "opsz" 60, "wght" 320, "SOFT" 100;
}
@media (max-width: 520px) {
  .capture__input { font-size: 24px; padding: 16px 0 14px; }
}

.capture__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  min-height: 18px;
}
.capture__hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.capture__hint .kbd {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  margin: 0 2px;
  background: var(--paper-warm);
  font-size: 10px;
  color: var(--ink-soft);
}
.capture__hint .dot { margin: 0 6px; color: var(--rule); }

.capture__status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mid);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  opacity: 0;
  transition: opacity .3s;
}
.capture__status.show { opacity: 1; }
.capture__status.error { color: var(--accent); }

/* ─── inventory ───────────────────────────────────────────────────────── */

.inventory__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.inventory__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 30;
  font-size: 22px;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--ink);
}
.inventory__count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.inventory__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 2px;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 4px;
}
.filter {
  background: transparent;
  border: 0;
  padding: 4px 7px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.filter:hover { color: var(--ink-soft); }
.filter.active {
  color: var(--paper-warm);
  background: var(--ink);
}
.filter--empty {
  opacity: 0.32;
}
.filter--empty.active {
  opacity: 1;
}

.inventory__body { padding-top: 8px; }

/* group */
.group { margin-top: 28px; }
.group:first-child { margin-top: 8px; }
.group__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 6px;
}
.group__name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.group__rule {
  flex: 1;
  height: 1px;
  background: var(--rule-soft);
}

/* entry */
.entry {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 14px 8px 14px 4px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background .2s, transform .2s;
  position: relative;
}
.entry:hover {
  background: var(--paper-warm);
}
.entry:hover .entry__title { color: var(--ink); }
.entry:active { transform: translateX(1px); }

.entry__glyph {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--accent);
  text-align: center;
  user-select: none;
  width: 24px;
}
.entry--worry      .entry__glyph { color: var(--accent); }
.entry--task       .entry__glyph { color: var(--ink-soft); }
.entry--idea       .entry__glyph { color: var(--gold); }
.entry--commitment .entry__glyph { color: var(--accent-warm); }
.entry--project    .entry__glyph { color: var(--ink); }
.entry--routine    .entry__glyph { color: var(--gold); transform: rotate(0deg); }
.entry--reflection .entry__glyph { color: var(--ink-mid); }
.entry--question   .entry__glyph { color: var(--ink-soft); }

.entry__main { min-width: 0; }
.entry__title {
  font-family: var(--serif-body);
  font-size: 17.5px;
  font-weight: 420;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.entry__title em { font-style: italic; color: var(--accent); }
.entry__tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.entry__tag::before { content: "#"; color: var(--rule); margin-right: 1px; }
.entry__cadence {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.entry__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  align-self: center;
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.entry__type {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* status indicators */
.entry--processing .entry__glyph {
  animation: glyphPulse 1.6s ease-in-out infinite;
}
.entry--processing .entry__title { color: var(--ink-mid); font-style: italic; }
.entry--processing::after {
  content: "filing…";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  background: var(--paper-warm);
  padding: 2px 6px;
}
.entry--error::after {
  content: "needs retry";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.entry--error .entry__glyph { color: var(--accent); }

@keyframes glyphPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* fresh entry — soft glow on insertion */
.entry--fresh {
  animation: freshIn .9s cubic-bezier(.2,.7,.2,1);
}
@keyframes freshIn {
  0%   { background: var(--fresh-bg); transform: translateY(-6px); opacity: 0; }
  60%  { background: var(--fresh-bg-mid); }
  100% { background: transparent; transform: translateY(0); opacity: 1; }
}

/* augment indicator (when an existing entry receives new context) */
.entry--touched {
  animation: touched 1.4s ease;
}
@keyframes touched {
  0%   { background: var(--touched-bg); }
  100% { background: transparent; }
}

/* focus: bookmark ribbon — earmarks an entry as something to work on now.
   draped from the top edge, hangs down past the row, forked tail at the bottom. */
.entry--focused {
  padding-right: 22px;
}
.entry--focused::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 10px;
  width: 5px;
  height: calc(100% + 7px);
  background: linear-gradient(
    100deg,
    var(--accent) 0%,
    var(--accent-warm) 55%,
    var(--accent) 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 4px), 0 100%);
  filter: drop-shadow(-1px 1px 1.5px rgba(26, 22, 18, 0.20));
  pointer-events: none;
  z-index: 2;
  animation: ribbonDrop 420ms cubic-bezier(.2, .8, .25, 1.05);
  transform-origin: top center;
}
@keyframes ribbonDrop {
  0%   { transform: translateY(-12px) scaleY(0.85); opacity: 0; }
  60%  { transform: translateY(2px)   scaleY(1.04); opacity: 1; }
  100% { transform: translateY(0)     scaleY(1);    opacity: 1; }
}

/* focus mode: strip the room down to only what you said matters now.
   non-focused entries, filters and footer chrome go away. group headers
   stay only for groups that contain a focused item, so you keep your
   bearings across today / yesterday / this week. */
body[data-focus-mode="on"] .entry,
body[data-focus-mode="on"] .inventory__count,
body[data-focus-mode="on"] .register__foot {
  display: none;
}
body[data-focus-mode="on"] .group:not(:has(.entry--focused)) {
  display: none;
}
body[data-focus-mode="on"] .group__head .group__name:last-child {
  display: none;
}

/* focus-mode empty state — only visible when focus mode is on AND no
   entry has been earmarked. mirrors the inventory-empty restraint. */
.focus__empty { display: none; }
body[data-focus-mode="on"]:not(:has(.entry--focused)) #focus-empty {
  display: block;
  text-align: center;
  padding: 80px 24px 48px;
  color: var(--ink-mid);
}
.focus__empty-mark {
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 380;
  font-size: 56px;
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: 12px;
}
.focus__empty-title {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 22px;
  margin-bottom: 10px;
}
.focus__empty-sub {
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-faint);
  line-height: 1.55;
}
body[data-focus-mode="on"] .entry--focused {
  display: grid;
  padding-right: 8px;
}
body[data-focus-mode="on"] .entry--focused::before {
  display: none;
}
html:has(body[data-focus-mode="on"]),
body[data-focus-mode="on"] {
  background: var(--paper-deep);
  transition: background-color 600ms ease;
}
body[data-focus-mode="on"] .register {
  background: var(--paper-warm);
  box-shadow:
    0 1px 0 rgba(26, 22, 18, 0.04),
    0 24px 64px -28px rgba(26, 22, 18, 0.28),
    0 4px 16px -8px rgba(26, 22, 18, 0.12);
  border-radius: 2px;
  min-height: 100vh;
  transition: background-color 600ms ease, box-shadow 600ms ease;
}
body[data-focus-mode="on"] .capture__console {
  display: none;
}
body[data-focus-mode="on"] .inventory__title {
  display: none;
}
body[data-focus-mode="on"] .group {
  margin-top: 0;
}

/* focus mode: a thread of accent across the top, like a silk marker
   tied across the page. ambient reminder you're in the mode. */
body[data-focus-mode="on"]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 16%,
    var(--accent-warm) 50%,
    var(--accent) 84%,
    transparent 100%
  );
  z-index: 1000;
  pointer-events: none;
  animation: threadDraw 700ms ease-out;
  transform-origin: center;
}
@keyframes threadDraw {
  0%   { transform: scaleX(0);   opacity: 0; }
  100% { transform: scaleX(1);   opacity: 1; }
}


/* empty state */
.inventory__empty {
  text-align: center;
  padding: 56px 24px 24px;
  color: var(--ink-mid);
}
.empty__mark {
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 380;
  font-size: 56px;
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: 12px;
}
.empty__title {
  font-family: var(--serif-display);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 8px;
}
.empty__sub {
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* footer */
.register__foot {
  margin-top: 64px;
}
.foot__rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 25%, var(--rule) 75%, transparent);
  margin-bottom: 14px;
}
.foot__text {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-align: center;
}
.foot__text .dot { margin: 0 8px; color: var(--rule); }
.linkbtn {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink-mid);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: color .2s;
}
.linkbtn:hover { color: var(--accent); text-decoration-color: var(--accent-soft); }

/* ─── panel (slide-in for detail + settings) ─────────────────────────── */

.panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
/* the detail panel is the "leaf" view — it can be opened from the
   inventory or from another panel (e.g. the archive). Bump its stacking
   so it always overlays the others, and closing it returns to whatever
   was open beneath. */
.panel--detail { z-index: 60; }
.panel[hidden] { display: none; }
.panel__scrim {
  position: absolute; inset: 0;
  background: rgba(26, 22, 18, 0.32);
  backdrop-filter: blur(2px) saturate(110%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: auto;
}
.panel__sheet {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  background: var(--paper-warm);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform .42s cubic-bezier(.2,.7,.2,1);
  pointer-events: auto;
  overflow-y: auto;
  border-left: 1px solid var(--rule);
}
.panel.open .panel__scrim { opacity: 1; }
.panel.open .panel__sheet { transform: translateX(0); }

.panel__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .2s;
}
.panel__close:hover { color: var(--accent); border-color: var(--accent-soft); transform: rotate(90deg); }

.panel__inner {
  padding: 56px 40px 56px;
}
@media (max-width: 520px) {
  .panel__inner { padding: 56px 24px 48px; }
}

/* ─── detail view ─────────────────────────────────────────────────────── */

.detail__type {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.detail__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 60, "wght" 380, "SOFT" 30;
  font-size: 26px;
  line-height: 1.28;
  color: var(--ink);
  margin: 0 0 14px;
}
.detail__summary {
  font-family: var(--serif-body);
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 18px;
}
.detail__tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.detail__tag::before { content: "#"; color: var(--rule); margin-right: 1px; }

.detail__divider {
  height: 1px;
  background: var(--rule-soft);
  margin: 20px 0;
}
.detail__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}

.detail__label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.detail__progress {
  margin-left: 8px;
  padding: 1px 6px;
  background: rgba(180, 138, 58, 0.14);
  color: var(--gold);
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.10em;
  text-transform: lowercase;
}
.detail__raw-text {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--ink-mid);
  font-size: 15px;
  line-height: 1.65;
  border-left: 2px solid var(--accent-soft);
  padding-left: 14px;
  white-space: pre-wrap;
}

.detail__history {
  margin-top: 24px;
}
.history__entry {
  border-left: 1px solid var(--rule);
  padding: 6px 0 6px 14px;
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 6px;
}
.history__entry .when {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 2px;
}

.detail__error {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(140, 58, 46, 0.08);
  border: 1px solid rgba(140, 58, 46, 0.24);
  padding: 10px 12px;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail__actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* unified curator input */
.detail__edit {
  margin: 22px 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
}
.detail__edit:focus-within {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(140, 58, 46, 0.07);
}
.detail__edit--thinking { opacity: 0.6; }
.detail__edit-input {
  width: 100%;
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 0 6px;
  font-family: var(--serif-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  resize: none;
  outline: none;
  caret-color: var(--accent);
}
.detail__edit-input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.detail__edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.detail__edit-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.detail__edit-hint .kbd {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  margin: 0 2px;
  background: var(--paper-warm);
  font-size: 9px;
  color: var(--ink-soft);
}
.detail__edit-hint .dot { margin: 0 5px; color: var(--rule); }
.detail__edit-go { min-width: 70px; justify-content: center; }

/* destructive preview */
.detail__preview-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.detail__preview-list {
  list-style: decimal inside;
  padding: 0;
  margin: 0 0 12px;
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
}
.detail__preview-item {
  padding: 4px 0;
  border-bottom: 1px dashed var(--rule-soft);
}
.detail__preview-item:last-child { border-bottom: 0; }
.detail__preview-item--destructive::marker {
  color: var(--accent);
}
.detail__preview-item--destructive {
  color: var(--accent);
}

/* parent link (when this concern is a child) */
.detail__parent {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
  text-transform: lowercase;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: var(--paper-deep);
  border-radius: 3px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.detail__parent:hover { color: var(--accent); background: rgba(140, 58, 46, 0.06); }
.parent__glyph {
  font-family: var(--serif-display);
  color: var(--accent);
  font-size: 14px;
}
.parent__title {
  font-family: var(--serif-body);
  font-style: italic;
  color: var(--ink);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

/* children list */
.detail__children {
  margin-top: 22px;
  padding: 16px 16px 12px;
  background: var(--paper-deep);
  border-radius: 4px;
  border-left: 2px solid var(--accent-soft);
}
.detail__children .detail__label { margin-bottom: 10px; }
.child-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  border-bottom: 1px dashed var(--rule-soft);
  transition: background .15s;
}
.child-row:last-child { border-bottom: 0; }
.child-row:hover { background: rgba(255, 255, 255, 0.4); }
.child-row__glyph {
  font-family: var(--serif-display);
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}
.child-row__glyph--task       { color: var(--ink-soft); }
.child-row__glyph--project    { color: var(--ink); }
.child-row__glyph--question   { color: var(--accent); }
.child-row__title {
  font-family: var(--serif-body);
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.35;
}
.child-row__type {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.child-row__glyph--toggle { cursor: pointer; }
.child-row__glyph--toggle:hover {
  color: var(--accent);
  transform: scale(1.08);
  transition: color .15s, transform .15s;
}
.child-row__glyph--check {
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 600;
}

.child-row--done .child-row__title {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
}
.child-row--done .child-row__type { color: var(--gold); }

/* ─── settings ───────────────────────────────────────────────────────── */

.settings__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.settings__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 30;
  font-size: 30px;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 14px;
}
.settings__lede {
  font-family: var(--serif-body);
  font-size: 15px;
  color: var(--ink-mid);
  line-height: 1.6;
  margin: 0 0 28px;
}
.settings__lede.small { margin-bottom: 12px; font-size: 14px; }

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 6px;
}
.field__input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--serif-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s;
}
.field__input.mono { font-family: var(--mono); font-size: 13px; }
.field__input:focus { border-color: var(--accent-soft); background: #fff; }
.field__textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.field__hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 6px;
  display: block;
  letter-spacing: 0.02em;
}

.settings__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
}
.btn {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 3px;
  transition: all .18s;
}
.btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn--primary {
  background: var(--ink);
  color: var(--paper-warm);
  border-color: var(--ink);
}
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper-warm); }
.btn--danger { color: var(--accent); }
.btn--danger:hover { background: var(--accent); color: var(--paper-warm); border-color: var(--accent); }
.btn--armed {
  background: var(--accent);
  color: var(--paper-warm);
  border-color: var(--accent);
  animation: armedPulse 1.6s ease-in-out infinite;
}
@keyframes armedPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(140, 58, 46, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(140, 58, 46, 0.18); }
}

.settings__test {
  margin-top: 14px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  border-radius: 3px;
  word-break: break-word;
}
.settings__test.ok    { background: var(--ok-bg); color: var(--ok-color); border: 1px solid var(--ok-border); }
.settings__test.fail  { background: var(--fail-bg); color: var(--accent); border: 1px solid var(--fail-border); }

.settings__divider {
  height: 1px;
  background: var(--rule-soft);
  margin: 36px 0 28px;
}

/* selection */
::selection { background: var(--selection-bg); color: var(--ink); }

/* scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* tiny helpers */
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif-display); }

/* ─── log / timeline panel ────────────────────────────────────────── */

.log__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.log__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 30;
  font-size: 30px;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 14px;
}
.log__lede {
  font-family: var(--serif-body);
  font-size: 15px;
  color: var(--ink-mid);
  line-height: 1.6;
  margin: 0 0 28px;
}

.log__group { margin-bottom: 24px; }
.log__group-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 8px;
}
.log__group-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.log__group-rule {
  flex: 1; height: 1px; background: var(--rule-soft);
}

.log-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}
.log-row:last-child { border-bottom: 0; }

.log-row__glyph {
  font-family: var(--serif-display);
  font-size: 18px;
  line-height: 1;
  color: var(--ink-mid);
  text-align: center;
  padding-top: 4px;
}
.log-row__glyph--create        { color: var(--ink); }
.log-row__glyph--create_child  { color: var(--gold); }
.log-row__glyph--merge         { color: var(--accent-warm); }
.log-row__glyph--augment       { color: var(--accent); }
.log-row__glyph--reprocess     { color: var(--gold); }
.log-row__glyph--decompose     { color: var(--ink); }
.log-row__glyph--remove        { color: var(--accent); }
.log-row__glyph--wipe          { color: var(--accent); }
.log-row__glyph--import        { color: var(--ink-soft); }
.log-row__glyph--rollback      { color: var(--gold); }

.log-row__main { min-width: 0; }
.log-row__summary {
  font-family: var(--serif-body);
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink);
}
.log-row__meta {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: lowercase;
}
.log-row__meta .dot { margin: 0 6px; color: var(--rule); }
.log-row__kind {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 9.5px;
}

.log-row__rewind {
  align-self: center;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .log-row { grid-template-columns: 22px 1fr; }
  .log-row__rewind { grid-column: 2 / 3; margin-top: 8px; justify-self: start; }
}

/* ─── rolling action console ──────────────────────────────────────────── */

.capture__console {
  margin-top: 12px;
  padding: 8px 0 0;
  border-top: 1px solid var(--rule-soft);
}
.console-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}
.console-entry__glyph {
  font-size: 12px;
  color: var(--ink-faint);
  min-width: 12px;
  text-align: center;
  flex-shrink: 0;
}
.console-entry__glyph--create       { color: var(--ink-soft); }
.console-entry__glyph--create_child { color: var(--gold); }
.console-entry__glyph--merge        { color: var(--accent-warm); }
.console-entry__glyph--augment      { color: var(--accent); }
.console-entry__glyph--reprocess    { color: var(--gold); }
.console-entry__glyph--decompose    { color: var(--ink-soft); }
.console-entry__glyph--remove       { color: var(--accent); }
.console-entry__glyph--rollback     { color: var(--gold); }
.console-entry__text {
  flex: 1;
  color: var(--ink-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.console-entry__time {
  color: var(--ink-faint);
  flex-shrink: 0;
  opacity: 0.7;
}

/* ─── inline children in "all" view ──────────────────────────────────── */

.entry-children {
  margin-left: 22px;
  border-left: 2px solid var(--rule-soft);
}
.entry--child {
  padding: 8px 8px 8px 4px;
  gap: 12px;
  border-bottom-color: rgba(214, 205, 184, 0.45);
}
.entry--child.entry--focused {
  padding-right: 22px;
}
.entry--child:last-child {
  border-bottom: 0;
}
.entry--child .entry__glyph {
  font-size: 15px;
  opacity: 0.85;
}
.entry--child .entry__title {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
}
.entry--child .entry__type { display: none; }
.entry--child .entry__meta { font-size: 9.5px; opacity: 0.7; }
.entry--child .entry__tags    { margin-top: 3px; gap: 6px; font-size: 10px; }
.entry--child .entry__cadence { margin-top: 3px; font-size: 10px; }

/* ─── reprocess inline form ──────────────────────────────────────────── */

.reprocess-form {
  display: flex;
  gap: 6px;
  flex: 1 1 100%;
  min-width: 0;
  align-items: stretch;
}
.reprocess-form__input {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--accent-soft);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s;
}
.reprocess-form__input:focus { border-color: var(--accent); background: #fff; }
.reprocess-form__input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

/* ─── theme picker ──────────────────────────────────────────────────── */

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.theme-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-1px);
}
.theme-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-card__swatch {
  position: relative;
  height: 64px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.theme-card__sample {
  font-family: var(--serif-display);
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 60;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.theme-card__swatch::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.theme-card__swatch::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 18px;
  height: 1px;
}
.theme-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-card__name {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.theme-card--active .theme-card__name { color: var(--accent); }
.theme-card__sub {
  font-family: var(--serif-body);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* swatch previews — independent of current theme so the picker is honest */
.theme-card__swatch--paper      { background: linear-gradient(135deg, #f1ece1 0 60%, #ebe4d3 60% 100%); color: #1a1612; }
.theme-card__swatch--paper::before { background: #d6cdb8; }
.theme-card__swatch--paper::after  { background: #8c3a2e; }

.theme-card__swatch--archive    { background: linear-gradient(135deg, #ecebe3 0 60%, #dedccb 60% 100%); color: #131a26; }
.theme-card__swatch--archive::before { background: #c4c2af; }
.theme-card__swatch--archive::after  { background: #46627e; }

.theme-card__swatch--moleskine  { background: linear-gradient(135deg, #e6dcc1 0 60%, #d4c9a9 60% 100%); color: #1c1a14; }
.theme-card__swatch--moleskine::before { background: #c2b89a; }
.theme-card__swatch--moleskine::after  { background: #2f5d3d; }

.theme-card__swatch--midnight   { background: linear-gradient(135deg, #1b1813 0 60%, #15110d 60% 100%); color: #ece0c4; }
.theme-card__swatch--midnight::before { background: #3a3225; }
.theme-card__swatch--midnight::after  { background: #d6884e; }

.theme-card__swatch--typewriter { background: linear-gradient(135deg, #fbfaf6 0 60%, #efece4 60% 100%); color: #100e0b; }
.theme-card__swatch--typewriter::before { background: #d6d2c8; }
.theme-card__swatch--typewriter::after  { background: #a91f1a; }

.theme-card__swatch--draft      { background: linear-gradient(135deg, #ffffff 0 60%, #eef0f4 60% 100%); color: #0b0d10; }
.theme-card__swatch--draft::before { background: #e2e6ec; }
.theme-card__swatch--draft::after  { background: #1f4ed8; }

/* ─── archive panel ────────────────────────────────────────────────── */

.archive__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.archive__title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 30;
  font-size: 30px;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 14px;
}
.archive__lede {
  font-family: var(--serif-body);
  font-size: 15px;
  color: var(--ink-mid);
  line-height: 1.6;
  margin: 0 0 24px;
}

.archive__tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 18px;
}
.archive__tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.archive__tab:hover { color: var(--ink-soft); }
.archive__tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.archive__tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  background: var(--paper-deep);
  border-radius: 999px;
  font-size: 10px;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
}
.archive__tab--active .archive__tab-count {
  background: rgba(140, 58, 46, 0.10);
  color: var(--accent);
}

.archive__group { margin-bottom: 22px; }
.archive__group-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 6px;
}
.archive__group-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.archive__group-rule { flex: 1; height: 1px; background: var(--rule-soft); }

.archive-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule-soft);
}
.archive-row:last-child { border-bottom: 0; }

.archive-row__glyph {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "wght" 360;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}
.archive-row__main { min-width: 0; }
.archive-row__title {
  font-family: var(--serif-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: line-through;
  text-decoration-color: var(--rule);
}
.archive-row--shelved .archive-row__title { text-decoration: none; }
.archive-row__parent {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.archive-row__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-self: center;
}
.archive-row__type {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.archive-row__actions {
  grid-column: 2 / 4;
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
}
.btn--ghost:hover { border-color: var(--rule); }

.archive__empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-mid);
}
.archive__empty-mark {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 48px;
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: 10px;
}
.archive__empty-title {
  font-family: var(--serif-display);
  font-size: 18px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 6px;
}
.archive__empty-sub {
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.6;
}


/* ─── drag & drop ──────────────────────────────────────────────────── */

/* during drag: prevent text selection and disable the touch scroll
   gesture on the inventory so the row drag isn't fighting the page */
body.is-dragging { user-select: none; -webkit-user-select: none; }
body.is-dragging .inventory__body,
body.is-dragging #toplevel-zone { touch-action: none; }
body.is-dragging .entry { cursor: grabbing; }

/* the "press" state on touch — between pointerdown and long-press fire */
.entry--press {
  background: var(--paper-warm);
  transition: background .12s;
}

/* the source row while it's being dragged */
.entry--dragging,
.child-row--dragging {
  opacity: 0.32;
  background: var(--paper-warm);
}

/* a row that will receive the dragged entry as a child */
.entry--drop-target {
  background: var(--touched-bg) !important;
  box-shadow: inset 3px 0 0 0 var(--accent);
}
.entry--drop-target .entry__title {
  color: var(--accent);
}

/* the floating ghost following the cursor */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow-3);
  padding: 0 4px;
  opacity: 0.95;
  transform: translate(-9999px, -9999px);
}
.drag-ghost .entry {
  background: transparent;
  border-bottom: 0;
  pointer-events: none;
}

/* horizontal line indicator for "drop in this gap" */
.drop-line {
  position: fixed;
  z-index: 199;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 0 1px var(--paper);
}
.drop-line::before,
.drop-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}
.drop-line::before { left: -3px; }
.drop-line::after  { right: -3px; }

/* ─── done state ───────────────────────────────────────────────────── */

.entry__glyph--toggle { cursor: pointer; }
.entry__glyph--toggle:hover {
  color: var(--accent);
  transform: scale(1.05);
  transition: color .15s, transform .15s;
}

.entry__glyph-check {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0;
}

.entry--done .entry__title {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
}
.entry--done .entry__tags,
.entry--done .entry__cadence {
  opacity: 0.55;
}
.entry--done .entry__type { color: var(--gold); }

/* state chips in the detail header */
.detail__state-chip {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 2px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.detail__state-chip--done {
  background: rgba(180, 138, 58, 0.18);
  color: var(--gold);
}
.detail__state-chip--shelved {
  background: var(--paper-deep);
  color: var(--ink-mid);
}

/* the "release here to detach" zone — pinned to the top of the viewport
   so it doesn't push page content while dragging. */
.toplevel-zone {
  display: none;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(560px, 92vw);
  padding: 12px 16px;
  border: 1px dashed var(--rule);
  border-radius: 4px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink-faint);
  background: var(--paper-warm);
  box-shadow: var(--shadow-2);
  transition: color .15s, border-color .15s, background .15s, opacity .15s;
}
.toplevel-zone--visible { display: block; }
.toplevel-zone--armed {
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
  background: var(--touched-bg);
}
