/* ── interdream ──────────────────────────────────────────
   flat colors only, no gradients, one typeface: monospace.
   ─────────────────────────────────────────────────────── */

:root {
  /* night — desaturated slate + sage */
  --bg:        #10161a;
  --pane:      #141c20;
  --head:      #121a1e;
  --sunken:    #0d1316;
  --line:      #212c31;
  --line-soft: #1a2327;
  --ink:       #c3ced1;
  --dim:       #7c8d91;
  --faint:     #55646a;
  --accent:    #7fb3a3;
  --accent-ink:#0f1518;
  --warn:      #c6a37c;
  --err:       #c98f8f;
  --sel:       #24373a;
  --mark:      #2c4a44;

  --t-tag:     #86b3a4;
  --t-attr:    #a8a684;
  --t-str:     #93a9bd;
  --t-cm:      #536166;
  --t-kw:      #a396b0;
  --t-num:     #bd9c88;
  --t-fn:      #8fa8c0;
  --t-prop:    #8fb6ae;
  --t-val:     #a2adb2;
  --t-pun:     #6c7c81;

  --font: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "DejaVu Sans Mono", "Liberation Mono", monospace;
  --fs: 13px;
  --lh: 21px;
  --pad: 14px;

  --w-files: 208px;
  --w-preview: 42%;
}

:root[data-theme="paper"] {
  /* paper — warm neutral, ink on stock */
  --bg:        #e8e4dc;
  --pane:      #f3f0e9;
  --head:      #eceadf;
  --sunken:    #f7f5ef;
  --line:      #d5cfc1;
  --line-soft: #e0dbcf;
  --ink:       #2c3336;
  --dim:       #6b7478;
  --faint:     #8d9599;
  --accent:    #3d7666;
  --accent-ink:#f7f5ef;
  --warn:      #8a6a3c;
  --err:       #9c5555;
  --sel:       #dbe3de;
  --mark:      #cfe0d8;

  --t-tag:     #3d7666;
  --t-attr:    #7a6a34;
  --t-str:     #4a6480;
  --t-cm:      #9aa0a2;
  --t-kw:      #6b5b83;
  --t-num:     #8a5d3f;
  --t-fn:      #3f5f80;
  --t-prop:    #35706a;
  --t-val:     #4c5559;
  --t-pun:     #8d9599;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: var(--sel); }

/* ── top bar ─────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  height: 46px;
  flex: none;
  background: var(--head);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.brand-mark { color: var(--accent); }
.brand-name {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-sub {
  color: var(--faint);
  font-size: 11px;
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-right { margin-left: auto; }

.field {
  display: flex;
  align-items: center;
  gap: 7px;
}
.field-label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.select, .input {
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 2px;
  outline: none;
  max-width: 190px;
}
.select:focus, .input:focus { border-color: var(--accent); }

/* ── buttons ─────────────────────────────────────────── */

.btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color .12s, border-color .12s, background-color .12s;
}
.btn:hover { color: var(--ink); border-color: var(--dim); }
.btn:active { background: var(--sunken); }
.btn-mini { padding: 2px 8px; font-size: 12px; }
.btn-quiet { border-color: transparent; }
.btn-quiet:hover { color: var(--err); border-color: var(--line); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { color: var(--accent-ink); opacity: .88; }

.check {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  cursor: pointer;
  font-size: 12px;
}
.check input { accent-color: var(--accent); margin: 0; }
.check:hover { color: var(--dim); }

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

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--w-files) 5px minmax(0, 1fr) 5px var(--w-preview);
}

.pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--pane);
  overflow: hidden;
}
.pane-files { border-right: 1px solid var(--line); }
.pane-preview { border-left: 1px solid var(--line); }

.pane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 12px;
  flex: none;
  background: var(--head);
  border-bottom: 1px solid var(--line);
}
.pane-title {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.spacer { flex: 1; }

.pane-foot {
  flex: none;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--head);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.pane-foot > span { flex: none; }
.pane-foot > .spacer { flex: 1; }
.dot-sep { color: var(--line); }

.resizer {
  background: var(--bg);
  cursor: col-resize;
  position: relative;
}
.resizer::after {
  content: "";
  position: absolute;
  inset: 0;
}
.resizer:hover { background: var(--line); }
body.dragging { cursor: col-resize; user-select: none; }
body.dragging iframe { pointer-events: none; }

/* ── info affordances ────────────────────────────────── */

.info-dot {
  width: 14px;
  height: 14px;
  line-height: 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  cursor: pointer;
  flex: none;
  transition: color .12s, border-color .12s;
}
.info-dot:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.token-info {
  position: fixed;
  z-index: 40;
  width: 15px;
  height: 15px;
  line-height: 13px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--pane);
  color: var(--accent);
  font-size: 9px;
  cursor: pointer;
}
.token-info:hover { background: var(--accent); color: var(--accent-ink); }

/* ── files ───────────────────────────────────────────── */

.file-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 12px;
  cursor: pointer;
  color: var(--dim);
  border-left: 2px solid transparent;
}
.file-item:hover { background: var(--sunken); color: var(--ink); }
.file-item.active {
  background: var(--sunken);
  color: var(--ink);
  border-left-color: var(--accent);
}
.file-ext {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
  width: 26px;
  flex: none;
  text-transform: uppercase;
}
.file-item.active .file-ext { color: var(--accent); }
.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item .info-dot,
.file-item .file-x { opacity: 0; }
.file-item:hover .info-dot,
.file-item:hover .file-x { opacity: 1; }
.file-x {
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.file-x:hover { color: var(--err); }

.hint {
  color: var(--faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.head-file {
  color: var(--ink);
  font-size: 12px;
  padding: 0 4px 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--accent);
  line-height: 30px;
  align-self: stretch;
}

/* ── editor ──────────────────────────────────────────── */

.editor-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--pane);
  position: relative;
}

.gutter {
  flex: none;
  width: 46px;
  overflow: hidden;
  padding: var(--pad) 0;
  background: var(--pane);
  border-right: 1px solid var(--line-soft);
  color: var(--faint);
  text-align: right;
  user-select: none;
}
.gutter-inner { will-change: transform; }
.gutter span {
  display: block;
  height: var(--lh);
  line-height: var(--lh);
  padding-right: 10px;
  font-size: 12px;
}
.gutter span.cur { color: var(--accent); }

.editor-scroll {
  flex: 1;
  min-width: 0;
  overflow: auto;
  position: relative;
}
.editor-content {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  width: max-content;
}

.highlight,
.code-input {
  margin: 0;
  padding: var(--pad) 18px var(--pad) 12px;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: pre;
  tab-size: 2;
  border: 0;
  letter-spacing: 0;
}

.highlight {
  position: relative;
  z-index: 2;
  pointer-events: none;
  color: var(--ink);
  min-height: 100%;
}
.highlight code { font: inherit; }

.code-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  resize: none;
  outline: none;
  overflow: hidden;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
}
.code-input::selection { background: var(--sel); }

/* token colors */
.t-tag  { color: var(--t-tag); }
.t-attr { color: var(--t-attr); }
.t-str  { color: var(--t-str); }
.t-cm   { color: var(--t-cm); font-style: italic; }
.t-kw   { color: var(--t-kw); }
.t-num  { color: var(--t-num); }
.t-fn   { color: var(--t-fn); }
.t-prop { color: var(--t-prop); }
.t-val  { color: var(--t-val); }
.t-pun  { color: var(--t-pun); }
.t-sel  { color: var(--t-tag); }
.t-txt  { color: var(--ink); }

.tok-hover {
  border-bottom: 1px dotted var(--accent);
}

.statusbar { color: var(--faint); }

/* ── preview ─────────────────────────────────────────── */

.preview-body {
  flex: 1;
  min-height: 0;
  background: #ffffff;
}
#preview {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

/* ── edit mode ───────────────────────────────────────── */

.btn.on {
  color: var(--accent);
  border-color: var(--accent);
}

.inspector {
  flex: none;
  display: flex;
  flex-direction: column;
  max-height: 52%;
  border-top: 1px solid var(--line);
  background: var(--pane);
}
.inspector[hidden] { display: none; }

.sel-tag {
  color: var(--accent);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-body {
  overflow-y: auto;
  padding: 8px 0;
}
.inspector-empty {
  margin: 0;
  padding: 2px 12px 6px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  min-height: 26px;
}
.row-label {
  width: 34px;
  flex: none;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.row-value {
  color: var(--dim);
  font-size: 12px;
  width: 62px;
}
.row-note {
  color: var(--faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.num {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px;
}
.num input {
  width: 52px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  padding: 2px 4px;
  font-size: 12px;
  outline: none;
}
.num input:focus { border-color: var(--accent); }
.num input:disabled { color: var(--faint); background: transparent; }

.select-mini {
  padding: 2px 4px;
  font-size: 12px;
  max-width: 96px;
}

.swatch {
  width: 26px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  flex: none;
}
.swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch::-webkit-color-swatch { border: none; border-radius: 1px; }

.inspector-foot[hidden] { display: none; }
.inspector-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-top: 1px solid var(--line);
  background: var(--head);
}
.pending-note {
  color: var(--warn);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the stretch of code an unsaved change would rewrite */
.pending-mark {
  background: var(--mark);
  color: inherit;
  border-radius: 1px;
  box-shadow: 0 0 0 1px var(--mark);
}
.editor-wrap.is-pending .code-input { caret-color: transparent; }
.editor-wrap.is-pending .gutter { opacity: .6; }

.console {
  flex: none;
  height: 168px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--pane);
}
.console.collapsed { height: 32px; }
.console.collapsed .console-log { display: none; }
.console-head { border-bottom: 1px solid var(--line-soft); }

.badge {
  color: var(--faint);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 5px;
}

.console-log {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
  font-size: 12px;
}
.console-log li {
  padding: 2px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--dim);
  border-left: 2px solid transparent;
}
.console-log li.error { color: var(--err); border-left-color: var(--err); }
.console-log li.warn  { color: var(--warn); border-left-color: var(--warn); }
.console-log li .src { color: var(--faint); }
.console-empty { color: var(--faint); padding: 4px 12px; font-size: 12px; }

/* ── drawer ──────────────────────────────────────────── */

.drawer {
  position: fixed;
  top: 46px;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  z-index: 30;
  background: var(--pane);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .16s ease-out;
}
.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 16px;
  flex: none;
  background: var(--head);
  border-bottom: 1px solid var(--line);
}
.drawer-kind {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.drawer-body {
  overflow-y: auto;
  padding: 18px 16px 40px;
}
.drawer-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.drawer-body .lede {
  margin: 0 0 16px;
  color: var(--dim);
}
.drawer-body p {
  margin: 0 0 12px;
  color: var(--dim);
  line-height: 1.65;
}
.drawer-body h4 {
  margin: 20px 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}
.drawer-body pre {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--sunken);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  overflow-x: auto;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}
.drawer-body code { color: var(--accent); }
.drawer-body pre code { color: inherit; }
.drawer-body .tip {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 12px;
  color: var(--dim);
}
.drawer-body ul { margin: 0 0 12px; padding-left: 18px; color: var(--dim); }
.drawer-body li { margin-bottom: 5px; line-height: 1.6; }
.drawer-body .related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.link-chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
}
.link-chip:hover { color: var(--accent); border-color: var(--accent); }

/* ── modal ───────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 12, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal[hidden] { display: none; }
:root[data-theme="paper"] .modal { background: rgba(60, 58, 52, 0.35); }

.modal-card {
  width: 380px;
  max-width: 92vw;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 18px;
}
.modal-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal-note { margin: 0 0 12px; color: var(--faint); font-size: 12px; }
.modal .input { width: 100%; max-width: none; padding: 7px 9px; }
.modal-types { display: flex; gap: 6px; margin-top: 10px; }
.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 3px 10px;
  border-radius: 2px;
  cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.active { border-color: var(--accent); color: var(--accent); }
.modal-error { margin: 10px 0 0; color: var(--err); font-size: 12px; min-height: 15px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ── images in the sidebar ───────────────────────────── */

.pane-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px 0 12px;
  flex: none;
  background: var(--head);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pane-subtitle {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.asset-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 0 1 auto;
  max-height: 42%;
}
.asset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 12px;
  cursor: pointer;
  color: var(--dim);
}
.asset-item:hover { background: var(--sunken); color: var(--ink); }
.asset-thumb {
  width: 22px;
  height: 22px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--line);
}
.asset-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-size { flex: none; color: var(--faint); font-size: 10px; }
.asset-item .file-x { opacity: 0; }
.asset-item:hover .file-x { opacity: 1; }
.asset-empty { padding: 3px 12px; color: var(--faint); font-size: 11px; }

/* ── the block composer ──────────────────────────────── */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 24px;
  background: rgba(8, 12, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet[hidden] { display: none; }
:root[data-theme="paper"] .sheet { background: rgba(60, 58, 52, 0.35); }

.sheet-card {
  width: 560px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 12px;
  flex: none;
  background: var(--head);
  border-bottom: 1px solid var(--line);
}
.sheet-title {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.sheet-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--head);
  border-top: 1px solid var(--line);
}
.sheet-foot[hidden] { display: none; }
.sheet-note { color: var(--warn); font-size: 11px; }

.block-choices { display: grid; gap: 8px; }
.block-choice {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  cursor: pointer;
}
.block-choice:hover { border-color: var(--accent); }
.block-choice-name {
  display: block;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.block-choice-blurb {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

/* ── composer fields ─────────────────────────────────── */

.ask { margin-bottom: 18px; }
.ask:last-child { margin-bottom: 0; }
.ask-name {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.ask-help {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}
.ask .input,
.ask .select {
  width: 100%;
  max-width: none;
}
.ask-date .input,
.ask-select .select { width: auto; min-width: 150px; }
.ask-pair { display: flex; align-items: center; gap: 8px; }
.ask-pair .input { width: 90px; }
.ask-unit { color: var(--faint); font-size: 11px; }
.ask-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  cursor: pointer;
}
.input-area {
  line-height: 1.6;
  resize: vertical;
}

.shelf-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.shelf-bar .ask-help { margin: 0; text-align: right; }
.shelf-count { color: var(--faint); font-size: 11px; }
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.shelf-cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}
.shelf-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shelf-cell:hover { border-color: var(--dim); }
.shelf-cell.on { border-color: var(--accent); }
.shelf-cell.on img { opacity: 0.7; }
.shelf-order {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  text-align: center;
}
.shelf-said {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.shelf-said img {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--line);
}
.shelf-said .input { flex: 1; }

.pairs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.pairs-row .input { flex: 1; }
.pairs-row .input-number { flex: 0 0 90px; }
.pairs-x {
  padding: 0 4px;
  background: none;
  border: none;
  color: var(--faint);
  line-height: 1;
  cursor: pointer;
}
.pairs-x:hover { color: var(--err); }

/* ── publishing ──────────────────────────────────────── */

.btn-go { color: var(--accent); border-color: var(--line); }
.btn-go:hover { border-color: var(--accent); color: var(--accent); }

.ask-live {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--faint);
  word-break: break-all;
}
.ask-live.is-good { color: var(--accent); }
.ask-live.is-bad { color: var(--err); }

/* the five places a page can live */
.homes {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.home:hover { background: var(--sunken); color: var(--ink); }
.home.is-picked {
  border-color: var(--accent);
  background: var(--sel);
  color: var(--ink);
}
.home-host { flex: none; }
.home-why {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.4;
}
.home.is-picked .home-why { color: var(--dim); }

.ask-aside {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}
.link-quiet {
  padding: 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}
.link-quiet:hover { color: var(--accent); border-color: var(--accent); }
.link-quiet.is-bad,
.link-quiet.is-bad:hover { color: var(--err); border-color: var(--err); }

/* ── what the check found ────────────────────────────── */

.read-top { margin-bottom: 18px; }
.read-verdict {
  margin: 0 0 4px;
  letter-spacing: 0.04em;
}
.read-verdict.is-good { color: var(--accent); }
.read-verdict.is-bad { color: var(--err); }
.read-scale { margin: 0; color: var(--faint); font-size: 11px; }
.read-top .ask-help { margin-top: 10px; }

.read-item {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-radius: 2px;
}
.read-item.is-stop { border-left-color: var(--err); }
.read-item.is-warn { border-left-color: var(--warn); }

.read-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.read-mark {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.is-stop .read-mark { color: var(--err); }
.is-warn .read-mark { color: var(--warn); }
.read-title { flex: 1; color: var(--ink); }
.read-more { flex: none; color: var(--faint); font-size: 11px; }
.read-why {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}
.read-where {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 4px 6px;
  text-align: left;
  background: var(--pane);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.read-where:hover { color: var(--ink); border-color: var(--dim); }

.read-passed {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
}
.read-passed-name {
  color: var(--accent);
  letter-spacing: 0.08em;
}
.read-passed-list { color: var(--faint); line-height: 1.6; }

/* ── the key ─────────────────────────────────────────── */

.live-url {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  word-break: break-all;
}

.keybox {
  margin: 18px 0;
  padding: 14px;
  background: var(--sunken);
  border: 1px solid var(--accent);
  border-radius: 2px;
}
.keybox-code {
  display: block;
  margin: 4px 0 12px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.08em;
  word-break: break-all;
  user-select: all;
}
.keybox-actions { display: flex; gap: 8px; }
.keybox-why {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

/* ── scrollbars ──────────────────────────────────────── */

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 3px solid var(--pane);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* narrow windows: shift the defaults, but never override a
   width the reader has dragged for themselves (inline wins) */
@media (max-width: 900px) {
  .brand-sub, .field-label { display: none; }
  .workspace {
    --w-files: 150px;
    --w-preview: 46%;
  }
  .drawer { width: 340px; }
}
