/* Canonical family tokens + components for the demo design system.
   Each demo vendors a copy of this file into its public/ dir and sets
   its own --signal / --signal-ink in style.css (see demos/DESIGN.md).
   Lantern and Beacon predate this file and migrate at their next touch. */
:root {
  --bg: #131410;
  --panel: #191b15;
  --ink: #e8e9e3;
  --ink-dim: #9a9d92;
  --ink-faint: #5c5f55;
  --line: #272921;
  --error: #ff6b5e;
  --warn: #ffd166;
  --info: #6fbf8f;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { margin: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

.frame { display: flex; min-height: 100vh; }

/* --- rail --------------------------------------------------------------- */
.rail {
  width: 320px;
  flex: 0 0 320px;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 72px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 72px 100%,
    var(--bg);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-mark {
  display: inline-block;
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  margin-bottom: 16px;
}

.brand-title { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.brand-title em { font-style: normal; color: var(--signal); }
.brand-sub { margin-top: 12px; color: var(--ink-dim); font-size: 12px; }

.micro-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.facets { display: flex; flex-direction: column; gap: 2px; }
.facet {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.facet:hover { border-color: var(--line); color: var(--ink); }
.facet.on { border-color: var(--signal); color: var(--signal); }
.facet .n { color: var(--ink-faint); }
.facet.on .n { color: var(--signal); }

.dashed-btn {
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px dashed var(--ink-faint);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.dashed-btn:hover:not(:disabled) { border-color: var(--signal); color: var(--signal); }
.dashed-btn:disabled { opacity: 0.45; cursor: default; }

.rail-foot { margin-top: auto; font-size: 11px; color: var(--ink-faint); }
.rail-foot a { color: var(--ink-dim); text-decoration: none; }
.rail-foot a:hover { color: var(--signal); }

/* --- stage ---------------------------------------------------------------- */
.stage {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
}

.search-bar { display: flex; gap: 8px; }
.search-bar input[type="text"] {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  padding: 9px 12px;
}
.search-bar input:focus { outline: none; border-color: var(--signal); }
.search-bar select,
.search-bar input[type="number"] {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  padding: 0 8px;
}
.search-bar button[type="submit"] {
  background: var(--signal);
  border: none;
  color: var(--signal-ink);
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.meter {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-faint);
}
.meter b { color: var(--signal); font-weight: 500; }

/* --- key/value receipts ----------------------------------------------------- */
.kv { display: flex; justify-content: space-between; padding: 2px 0; }
.kv b { color: var(--ink); font-weight: 500; }
.kv-list .kv { font-size: 11px; color: var(--ink-dim); }
.kv-list .kv b { color: var(--signal); font-weight: 500; }
.kv-list .note { font-size: 10px; color: var(--ink-faint); margin-top: 4px; line-height: 1.5; }

/* --- drawer ----------------------------------------------------------------- */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head .micro-label { margin: 0; }
.drawer-head button { background: none; border: none; color: var(--ink-dim); font: inherit; cursor: pointer; }
.drawer-head button:hover { color: var(--signal); }
.drawer-body { padding: 18px 20px; overflow-y: auto; font-size: 12px; color: var(--ink-dim); }
.drawer-body h3 { color: var(--ink); font-size: 12px; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.1em; }
.drawer-body h3:first-child { margin-top: 0; }
.drawer-body code { color: var(--signal); }

@media (max-width: 900px) {
  .frame { flex-direction: column; }
  .rail { width: auto; flex: none; border-right: none; border-bottom: 1px solid var(--line); }
  .stage { height: auto; }
}
