/* perch settings window (M8) — composes theme.css tokens only (DEC-0016).
   Layout page follows the owner's Figma shots (Session 6): mode cards, live
   page preview with drop slots, Widgets panel, Priority Stack. */

@import url("widgets.css"); /* the REAL widget styles — preview renders actual widgets (owner, Session 9) */

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
html, body { width: 100%; height: 100%; }
body {
  font-family: var(--font);
  background: var(--app-bg);
  color: var(--text-primary);
  overflow: hidden;
}

/* ---- CSD window controls (owner, Session 17 round 2): no separate title
   bar — the cluster floats top-right on the SAME band as the rail's logo
   (rail pad 18 + wordmark 30 → center y 33). Drag zone = the SDL hit test
   C++-side; settings.cpp's frame_controls MUST match this cluster's
   geometry (two 32px chips + 8px gap + 14px right inset = 92px incl. slack,
   strip 56). --- */
#tb-controls { position: fixed; top: 16px; right: 14px; height: 32px;
  display: flex; gap: 8px; z-index: 50; }
/* Round recessed chips in the widget language (rim + well; owner: the flat
   icons read bland). Hover lifts: minimize warms, close goes danger with a
   soft glow; icons sharpen from half to full. */
.tb-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--well); box-shadow: var(--rim);
  color: var(--text-half); cursor: default;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease; }
.tb-btn svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.tb-btn:hover { color: var(--text-primary); transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10); box-shadow: var(--rim-strong); }
.tb-btn:active { transform: translateY(0); }
.tb-btn.tb-close:hover { background: var(--danger); color: #fff;
  box-shadow: var(--rim-strong), 0 3px 14px rgba(224, 82, 82, 0.45); }

#app { display: flex; width: 100%; height: 100%; }

/* ---- left rail (Figma: 175px) ------------------------------------------- */
#rail {
  width: 175px; flex: none; height: 100%;
  background: var(--app-rail);
  box-shadow: var(--rim);
  padding: 18px 10px;
  display: flex; flex-direction: column; gap: 18px;
}
#brand { padding: 0 10px; display: flex; align-items: center; }
/* The wordmark (S29): white-on-transparent PNG, 2x for HiDPI. */
#brand img { height: 30px; width: auto; display: block; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
/* Feature entries scroll on their own (owner: the feature list will grow —
   never scroll the whole rail) */
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 6px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
/* social links (Session 7): a quiet row pinned to the rail's foot */
#rail-foot {
  display: flex; gap: 6px; justify-content: center;
  padding: 10px 4px 2px; border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.social-btn {
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.social-btn .ph { font-size: 16px; }
.social-btn:hover { background: rgba(217, 217, 217, 0.1); color: var(--text-primary); }
.social-btn:active { transform: scale(0.88); }
/* rail categories (M8b owner directive): caption + hairline per group */
.nav-cap {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); padding: 0 10px; margin: 14px 0 4px;
}
.nav-cap:first-child { margin-top: 2px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 12px 6px 0; }
.nav-item {
  padding: 9px 10px; border-radius: var(--r-chip);
  font-size: var(--body-size); font-weight: var(--body-weight);
  color: var(--text-half); cursor: pointer;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.nav-item:hover { background: rgba(217, 217, 217, 0.08); color: var(--text-primary); }
.nav-item.active { background: rgba(217, 217, 217, 0.14); color: var(--text-primary); }

/* ---- content ------------------------------------------------------------ */
#content { flex: 1; height: 100%; overflow-y: auto; padding: 28px 20px 40px 26px; scrollbar-gutter: stable; }
#content::-webkit-scrollbar { width: 8px; }
#content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }
/* keep content honest on wide windows: centered, capped */
.page-inner { max-width: 1160px; margin: 0 auto; }

/* ---- motion (M8b: fluid like the notch — fade + rise + de-blur, staggered) */
@keyframes s-enter {
  from { opacity: 0; transform: translateY(9px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.anim { animation: s-enter 0.42s var(--ease-spring) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

h1 { font-size: 26px; font-weight: 700; }
.subtitle { font-size: 13px; font-weight: 600; color: var(--text-half); margin: 4px 0 22px; }

.columns { display: flex; gap: 18px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 250px; flex: none; display: flex; flex-direction: column; gap: 14px; }

.panel {
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  padding: 16px; background: rgba(255, 255, 255, 0.015);
}
.panel .p-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.panel .p-desc { font-size: 13px; font-weight: 600; color: var(--text-half); line-height: 1.5; }
.panel .p-hint {
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--text-tertiary); margin-top: 14px;
}

/* ---- mode cards ----------------------------------------------------------- */
.modes { display: flex; gap: 14px; margin-bottom: 6px; } /* uniform row rhythm below */
.mode-card {
  flex: 1; padding: 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1); background: transparent;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.mode-card:hover { background: rgba(255, 255, 255, 0.03); }
.mode-card.active { border: 2px solid var(--accent); padding: 15px; }
.mode-card .head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.mode-card .head svg { flex: none; }
.mode-card .desc { font-size: 13px; font-weight: 600; color: var(--text-half); line-height: 1.5; }

.hr { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 20px 0 26px; }

/* zone-time preview beside the world-clock fields */
.tz-now { flex: none; font-size: 13px; font-weight: 700; color: var(--text-half);
  font-variant-numeric: tabular-nums; margin-right: 4px; }

/* ---- games page (S3): live row + per-game rules --------------------------- */
.game-live { align-items: center; }
.game-live .gl-text { flex: 1; min-width: 0; }
.game-live .gl-name { font-size: 14px; font-weight: 700; }
.game-live .gl-id { font-size: 13px; font-weight: 600; color: var(--text-tertiary); margin-top: 3px; }
.rules { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.rule-row { display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); }
.rule-row .rr-match { width: 120px; flex: none; }
.rule-row .rr-actions { display: flex; gap: 6px; }
/* Resolved game identity (Session 12): 18px Steam icon + name next to the id */
.rule-row .rr-game { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }
.rule-row .rr-gicon { flex: none; width: 18px; height: 18px; border-radius: 4px; display: none;
  background-size: cover; background-position: center; box-shadow: var(--rim); }
.rule-row .rr-gicon.has-img { display: block; }
.rule-row .rr-gname { min-width: 0; font-size: 13px; font-weight: 650; color: var(--text-half);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-row .rr-off { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rule-row .rr-off input[type=range] { width: 260px; } /* owner: double — finer offset control */
.rule-row .rr-cap { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); }
.rule-row .rr-val { font-size: 13px; font-weight: 700; color: var(--text-half); min-width: 44px; text-align: right;
  font-variant-numeric: tabular-nums; }
.rule-del { flex: none; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--text-tertiary); font-size: 13px;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out); }
.rule-del:hover { background: rgba(240, 71, 71, 0.18); color: var(--danger); }

/* ---- shortcut-tiles editor (S16, manifest kind `tiles`) -------------------- */
.row.tiles-row { flex-direction: column; align-items: stretch; }
.tiles-editor { display: flex; flex-direction: column; gap: 8px; }
.tile-line { display: flex; align-items: center; gap: 8px; position: relative; }
/* icon PICKER button (owner: no text input); duotone glyph = what the tile shows */
.tl-icon-btn { flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--surface-recessed); box-shadow: var(--rim); color: var(--text-primary);
  transition: background 0.15s var(--ease-out); }
.tl-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
/* DEC-0148: per-tile look (color swatch / imported image) */
.tl-look-btn { flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--well); box-shadow: var(--rim);
  transition: transform 0.1s var(--ease-out); }
.tl-look-btn:hover { transform: scale(1.08); }
.look-pop { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.swatch-row { display: flex; gap: 7px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; box-shadow: var(--rim-strong);
  transition: transform 0.1s var(--ease-out); }
.swatch:hover { transform: scale(1.15); }
.swatch.current { outline: 2px solid #fff; outline-offset: 2px; }
.look-actions { display: flex; gap: 7px; }
.tile-pop { left: 0; top: 36px; }
.tile-line .tl-label { width: 110px; flex: none; }
.tile-line .tl-actions { display: flex; gap: 5px; flex: none; }
.tile-line .tl-arg { flex: 1; min-width: 0; max-width: none; }
.tiles-editor .btn { align-self: flex-start; }

/* ---- theme cards (S5 — the mode-card family, plus a palette strip) -------- */
.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 640px; }
.theme-card {
  padding: 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1); background: transparent;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.theme-card:hover { background: rgba(255, 255, 255, 0.03); }
.theme-card.active { border: 2px solid var(--accent); padding: 15px; }
.tc-dots { display: flex; gap: 6px; margin-bottom: 10px; }
.tc-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.tc-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.theme-card .desc { font-size: 13px; font-weight: 600; color: var(--text-half); line-height: 1.5; }

/* ---- page preview (the notch panel, design px 800×160, scaled) ------------ */
#preview-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
/* Chromium `zoom` (not transform): it REFLOWS, so the 800-design-px panel
   fits the column without overflow (this app is Chromium-only). The value is
   set from JS: fill the column, whatever the window/display size (M8b; S0
   widened the design px to 800×160). */
#preview-scale { zoom: 1; }
#preview-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
#preview {
  position: relative;
  /* True notch silhouette (M13 polish): square top (it attaches to the
     screen edge), rounded bottom, flare ears — matches the fused shell. */
  width: 800px; height: 160px; background: var(--island); border-radius: 0 0 30px 30px;
  box-shadow: var(--shadow-island);
  /* The ears live in this margin (owner fix: they painted past the 14px row
     gap into the neighboring strip/page) — reserve their 34px on each side. */
  margin: 0 34px;
  display: flex; flex-direction: column; padding: 0 23px 14px;
  /* mirrors the real envelope spring when the secondary comes and goes */
  transition: width 0.38s var(--ease-spring);
}
/* Flare ears: concave fillets outside the top corners (the shell's f=35 arc,
   drawn as an inverted-corner radial cut). */
#preview::before, #preview::after {
  content: ""; position: absolute; top: 0; width: 34px; height: 34px; pointer-events: none;
}
#preview::before { left: -34px; background: radial-gradient(circle 34px at 0 100%, transparent 33.5px, var(--island) 34px); }
#preview::after { right: -34px; background: radial-gradient(circle 34px at 100% 100%, transparent 33.5px, var(--island) 34px); }

/* ghost drop-zone beside a collapsed (primary-only) panel: drop a secondary
   here and the panel springs wide (DEC-0045 — "auto" is retired) */
.add-strip {
  width: 64px; height: 118px; flex: none; border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-tertiary); font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  transition: border-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.add-strip.droppable { border-color: var(--accent); color: var(--text-half); }
.add-strip.drop-hot { border-color: var(--accent); background: rgba(88, 101, 242, 0.14); color: var(--text-primary); }

/* icon picker (owner: active-tab click opens this, never cycles) — Phosphor
   set with a search bar (DEC-0049) */
.icon-pop {
  position: absolute; top: 40px; z-index: 5; width: 306px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 10px;
  background: rgba(30, 31, 30, 0.98); box-shadow: var(--shadow-float), var(--rim-strong);
  animation: s-enter 0.22s var(--ease-spring) backwards;
}
.icon-pop .pop-search { max-width: none; }
.icon-grid {
  display: grid; grid-template-columns: repeat(8, 30px); gap: 5px;
  max-height: 180px; overflow-y: auto; padding-right: 7px;
}
.icon-grid::-webkit-scrollbar { width: 6px; }
.icon-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.icon-grid .ph { font-size: 16px; }
.pop-empty { grid-column: 1 / -1; padding: 12px 0; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text-tertiary); }
#preview .tab .ph { font-size: 14px; }
#preview .tab-name { font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; }
.icon-chip {
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-half); background: rgba(217, 217, 217, 0.08);
  transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out), transform 0.08s var(--ease-out);
}
.icon-chip:hover { background: rgba(217, 217, 217, 0.22); color: var(--text-primary); }
.icon-chip:active { transform: scale(0.88); }
.icon-chip.current { background: #fff; color: #000; }
#preview .tabs { flex: none; height: 43px; display: flex; align-items: center; gap: 8px;
  /* WIDTH-BOUNDED (owner, 2026-07-17): without this the strip grows with
     its content, scrollWidth never exceeds clientWidth, the collapse guard
     never fires, and tabs poke out of the preview shell. Clip = the last
     resort past the icons-only floor. */
  max-width: 100%; min-width: 0; overflow: hidden; }
/* Icon + name pill — mirrors the overlay tab (S0, DEC-0057). */
#preview .tab {
  border-radius: 12px; flex: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  color: rgba(217, 217, 217, 0.55); background: transparent;
  transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out), transform 0.08s var(--ease-out);
}
#preview .tab:hover { background: rgba(217, 217, 217, 0.1); color: var(--text-primary); }
#preview .tab:active { transform: scale(0.96); }
#preview .tab.active { background: rgba(217, 217, 217, 0.16); color: var(--text-primary); }
#preview .tab.droppable { box-shadow: 0 0 0 1.5px rgba(88, 101, 242, 0.55); }
#preview .tab.drop-hot { background: var(--accent); color: #fff; }
#preview .tab.add { background: transparent; color: var(--text-tertiary); padding: 5px; }
#preview .tab.add:hover { color: var(--text-primary); }
#preview .slots { flex: 1; display: flex; gap: 12px; min-height: 0; }
#preview .divider { width: 1px; background: var(--hairline); flex: none; }

/* The preview renders the REAL widget renderers (owner ruling), but the
   preview is a picture, never a control: the rendered node is inert (a no-op
   bridge send + this) so media/discord/launcher clicks and text selection do
   nothing. The slot-box itself stays interactive (drop target + ✕ clear). */
.preview-widget { pointer-events: none; user-select: none; }
/* Solo panel: the shell may widen to fit the tab strip, but the single slot
   keeps the overlay's 370 width, centered — the widget must not stretch. */
#preview.solo .slot-box.left { max-width: 370px; margin: 0 auto; }
/* Overflowing strip: the overlay's collapsed-tab rule, mirrored (overlay.css
   .page-bar.collapsed) — icons only, the active tab keeps its label. */
#preview .tabs.collapsed .tab:not(.active) .tab-name { display: none; }
#preview .tabs.collapsed .tab:not(.active) { padding: 5px 7px; }

.slot-box { border-radius: 14px; min-width: 0; position: relative; }
/* S0 (DEC-0057): EQUAL-width slots — mirrors the real panel (the old 1.7/1
   split squeezed the right-slot preview and read as "centered" content). */
.slot-box.left { flex: 1 1 0; }
.slot-box.right { flex: 1 1 0; }
.slot-box.empty {
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary); font-size: 26px; font-weight: 700;
}
.slot-box.empty .auto-badge {
  position: absolute; top: 6px; right: 8px;
  font-size: 8px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-tertiary);
}
.slot-box.droppable { border: 1.5px dashed var(--accent); }
.slot-box.drop-hot { background: rgba(88, 101, 242, 0.14); border: 1.5px dashed var(--accent); }
.slot-box .clear {
  position: absolute; top: 4px; right: 6px; width: 16px; height: 16px;
  display: none; align-items: center; justify-content: center;
  border-radius: 5px; font-size: 10px; color: var(--text-half);
  background: rgba(217, 217, 217, 0.12); cursor: pointer;
}
.slot-box:hover .clear { display: flex; }

.preview-actions { margin-top: 14px; display: flex; gap: 8px; }

/* long lists collapse into their own scroll frame (owner: many widgets /
   priority rows must not stretch the page) */
.scroll-list { max-height: 196px; overflow-y: auto; padding-right: 7px; } /* 218 overflowed the min-height window once the split stack added its divider + copy (owner report) */
.scroll-list::-webkit-scrollbar { width: 6px; }
.scroll-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }

/* ---- widgets panel (drag sources) ------------------------------------------ */
.widget-card {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; margin-top: 10px;
  background: rgba(217, 217, 217, 0.07); box-shadow: var(--rim);
  cursor: grab; font-size: 13px; font-weight: 700;
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-spring), box-shadow 0.15s var(--ease-out);
}
.widget-card:hover { background: rgba(217, 217, 217, 0.13); transform: translateY(-1px); box-shadow: var(--rim-strong), var(--shadow-float); }
.widget-card .grow { flex: 1; }

/* ---- priority stack --------------------------------------------------------- */
.prio-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; margin-top: 10px;
  background: rgba(217, 217, 217, 0.07); box-shadow: var(--rim);
  font-size: 13px; font-weight: 700;
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-spring);
}
.prio-row:hover { transform: translateY(-1px); }
.prio-row .grow { flex: 1; }
.prio-row .handle { cursor: grab; color: var(--text-tertiary); letter-spacing: 1.5px; font-size: 13px; }
.prio-row.drop-hot { background: rgba(88, 101, 242, 0.18); }

/* ---- generic rows / controls (feature pages) -------------------------------- */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-chip);
  background: var(--surface-recessed); box-shadow: var(--rim);
  margin-bottom: 6px; font-size: var(--body-size); font-weight: var(--body-weight);
}
.row .grow { flex: 1; }
/* every main-col block shares the .row rhythm (owner: consistent padding) */
.btn {
  border-radius: 8px; padding: 8px 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(217, 217, 217, 0.1); color: var(--text-half);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out), transform 0.08s var(--ease-out);
}
.btn:hover { background: rgba(217, 217, 217, 0.22); color: var(--text-primary); }
.btn:active { transform: scale(0.94); }
.btn.disabled { opacity: 0.25; pointer-events: none; }
.chip {
  padding: 5px 10px; border-radius: 6px; flex: none;
  background: rgba(217, 217, 217, 0.1); color: var(--text-primary);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: rgba(217, 217, 217, 0.22); }
.toggle {
  width: 40px; height: 24px; flex: none; border-radius: 12px;
  background: var(--track); position: relative; cursor: pointer;
  transition: background 0.18s var(--ease-out);
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--fill);
  transition: transform 0.18s var(--ease-spring);
}
.toggle.on { background: var(--live); }
.toggle.on::after { transform: translateX(16px); }
input[type='range'] { flex: 1; accent-color: var(--fill); height: 22px; cursor: pointer; }
.text-input {
  flex: 1; max-width: 260px; padding: 7px 10px; border: none; outline: none;
  border-radius: var(--r-chip); background: rgba(0, 0, 0, 0.35); box-shadow: var(--rim);
  color: var(--text-primary); font-family: var(--font); font-size: 13px; font-weight: 600;
  user-select: text; transition: box-shadow 0.15s var(--ease-out);
}
.text-input:focus { box-shadow: var(--rim-strong), 0 0 0 1.5px rgba(88, 101, 242, 0.55); }
.slider-value { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-half); font-size: 13px; }

/* ---- markdown pages (Help / Credits — DEC-0049) -----------------------------
   The markdown owns the page: its `#` is the title (styled like every page
   h1), full width, generous rhythm. */
.md-body { width: 100%; }
.md-body h2 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.md-body h2 + p > i { display: block; font-style: normal; font-size: 13px; font-weight: 600;
  color: var(--text-half); margin-bottom: 8px; } /* the title's subtitle line */
.md-body h3 { font-size: 15px; font-weight: 700; margin: 28px 0 10px; }
.md-body h4 { font-size: 12.5px; font-weight: 700; margin: 20px 0 8px; color: var(--text-secondary); }
.md-body p { font-size: 13px; font-weight: 600; color: var(--text-half); line-height: 1.8; margin: 10px 0; }
.md-body b { color: var(--text-primary); }
.md-body ul { margin: 10px 0 10px 20px; }
.md-body li { font-size: 13px; font-weight: 600; color: var(--text-half); line-height: 1.9; margin: 3px 0; }
.md-body code { font-family: ui-monospace, monospace; font-size: 12.5px; padding: 2px 6px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.md-body .md-hr { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 24px 0; }

/* ---- drag ghost ------------------------------------------------------------- */
#ghost {
  position: fixed; z-index: 10; pointer-events: none;
  padding: 9px 14px; border-radius: 10px;
  background: rgba(40, 42, 46, 0.95); box-shadow: var(--shadow-float), var(--rim-strong);
  font-size: 13px; font-weight: 700; transform: translate(-50%, -120%);
}

/* DEC-0160 split Priority Stack */
.prio-row.off { opacity: 0.45; }
.prio-divider { display: flex; align-items: center; gap: 10px; padding: 4px 2px; color: var(--text-tertiary);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.prio-divider::before, .prio-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.1); }
.prio-divider.drop-hot { color: var(--text-primary); }

/* M-mod.1 mods page */
/* mods page (owner redesign 2026-07-16): title + description + scope chips on
   the left; the source tag right-aligned with the widget count under it. */
.mod-card { align-items: flex-start; gap: 12px; }
.mc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-title { font-weight: 700; font-size: 14px; }
.mc-desc { font-size: 12px; color: var(--text-half); line-height: 1.4; }
.mc-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mc-meta { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.mc-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; background: var(--well); color: var(--text-secondary);
  box-shadow: var(--rim); }
.mc-tag.t-builtin { color: #7ec8ff; }
.mc-tag.t-dev { color: #f2c14e; }
.mc-tag.t-workshop { color: #8ee6a1; }
.mc-tag.t-error { color: var(--danger); }
.mc-scopes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.mc-scope { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  font-family: ui-monospace, monospace; }
/* color-coded scope categories (owner): risk visible at a glance */
.mc-scope.sc-basic { background: rgba(255,255,255,0.06); color: var(--text-tertiary); }
.mc-scope.sc-sys   { background: rgba(126,200,255,0.16); color: #9ed3ff; }   /* system / device */
.mc-scope.sc-net   { background: rgba(242,193,78,0.16); color: #f2c14e; }    /* network / launch */
.mc-scope.sc-fs    { background: rgba(255,120,110,0.16); color: #ff9a92; }   /* files / storage */
.mod-failed .mc-desc { color: var(--danger); }

/* DEC-0170: the static-pair card (Layout page, static mode only) — one
   frame, two dropdowns (custom: native <select> is invisible under OSR) */
.static-pair { background: var(--surface-recessed); box-shadow: var(--rim); border-radius: var(--r-chip);
  padding: 12px; margin-bottom: 6px; /* SAME rhythm as every .row (owner: consistent padding) */
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.07); }
.static-pair .sp-head { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.static-pair .sp-body { display: flex; gap: 12px; }
.sp-field { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sp-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); }
.dropdown { position: relative; }
.dd-value { padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07);
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1); transition: background 0.15s; }
.dd-value::after { content: "▾"; float: right; opacity: 0.5; }
.dd-value:hover { background: rgba(255, 255, 255, 0.12); }
.dd-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10;
  background: #232423; border-radius: 8px; padding: 4px; max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1); }
.dropdown.open .dd-menu { display: block; }
.dd-item { padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.dd-item:hover { background: rgba(255, 255, 255, 0.1); }
