/* ============================================================
   Leylines — plugin surface (Hub / playlist mixer)
   Flat · quiet · playlist-first · resizable. No glow, no gradient.
   Cybermoon nocturne identity: DM Mono led, amber accent.
   ============================================================ */

:root {
  /* surfaces — deep tide, flat */
  --bg:      #0b0e12;
  --bg-2:    #0d1116;
  --panel:   #12171d;
  --panel-2: #161c23;
  --panel-3: #1b232b;
  --lane-a:  #0e1319;
  --lane-b:  #0c1015;
  --line:    #20272e;
  --line-2:  #2c353d;
  --line-3:  #46525e;

  /* ink */
  --fg:      #e6ebf0;
  --fg-dim:  #9aa6b2;
  --fg-mute: #6b7682;
  --fg-faint:#48525c;

  /* signal / role palette — the shipped Leylines peer palette (Themes.cpp
     makeLeylines): amber lead, sky secondary, then rose/green/violet/deep-teal.
     Muted + colourblind-aware; never hue-alone (avatars carry initials). */
  --amber:     #f0d77a;   /* acc / peer[0] */
  --amber-d:   #d8bd5a;   /* accHi */
  --sky:       #8fb2c9;   /* acc2 / peer[1] */
  --rose:      #cf8b93;   /* red / peer[2] */
  --green:     #86b89b;   /* green / peer[3] */
  --violet:    #a596c8;   /* peer[4] */
  --deep-teal: #6fa3ab;   /* peer[5] */

  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --r-ctl: 7px;
  --r-chip: 5px;

  --bar-w: 34px;          /* one bar in px — driven by zoom */
  --rail-w: 296px;
  --ruler-h: 34px;
  --track-h: 96px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
::selection { background: var(--amber); color: #1a1408; }

/* scrollbars — thin, quiet */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }
::-webkit-scrollbar-corner { background: var(--bg-2); }

/* ============================================================
   shell — grid: header / workspace / tabs / footer
   ============================================================ */
.stage {
  display: grid;
  grid-template-rows: 52px 1fr 44px 28px;
  height: 100vh;
  min-width: 380px;
}

/* ---------------- header ---------------- */
.hdr {
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo { width: 26px; height: 26px; flex: none; }
.wordmark {
  font-family: var(--mono); font-size: 16px; font-weight: 500;
  letter-spacing: .02em; color: var(--fg);
}
.session-pill {
  font-family: var(--mono); font-size: 11px; color: var(--sky); white-space: nowrap;
  border: 1px solid var(--line-2); border-radius: var(--r-chip);
  padding: 5px 11px; background: var(--panel);
  display: flex; align-items: center; gap: 7px;
}
.session-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sky);
}
.hdr-spacer { flex: 1; }
.hdr-group { display: flex; align-items: center; gap: 6px; }

/* signal toggles: Send / Receive / Freeze */
.sig {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--fg-mute);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 6px 12px;
  transition: color .14s, border-color .14s, background .14s;
}
.sig .led { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); transition: background .14s, box-shadow .14s; }
.sig:hover { border-color: var(--line-2); color: var(--fg-dim); }
.sig[aria-pressed="true"] { color: var(--fg); border-color: var(--line-2); }
.sig.send[aria-pressed="true"] .led   { background: var(--amber); }
.sig.recv[aria-pressed="true"] .led   { background: var(--sky); }
.sig.freeze[aria-pressed="true"] .led { background: var(--rose); }
.sig.freeze[aria-pressed="true"] { color: var(--rose); }

.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--fg-dim); transition: border-color .14s, color .14s;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

.btn-primary {
  font-family: var(--mono); font-size: 12px; color: #14100a; font-weight: 500;
  background: var(--amber); border: 1px solid var(--amber); border-radius: var(--r-ctl);
  padding: 7px 15px; transition: background .14s;
}
.btn-primary:hover { background: var(--amber-d); }

/* account plan pill (D88): a PMPill (Success tone) — filled tinted chip, NOT a
   bordered panel. bg = green @14%, text + dot in the green signal, 6px radius,
   12px body font (PMPill::pillFont is sans). "Licensed" for a paid plan;
   the same pill carries the amber trial countdown / danger states in-app. */
.license {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--body); font-size: 12px; color: var(--green);
  border: 0; border-radius: 6px;
  padding: 5px 11px; background: color-mix(in srgb, var(--green) 14%, transparent);
}
.license::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ============================================================
   workspace — playlist (rail + timeline) in one scroll box
   ============================================================ */
.workspace { position: relative; overflow: auto; background: var(--bg); }
.grid {
  display: grid;
  grid-template-columns: var(--rail-w) calc(var(--bar-w) * 48);
  grid-template-rows: var(--ruler-h);
  grid-auto-rows: var(--track-h);
}

/* corner (session/zoom) — sticky both */
.corner {
  position: sticky; top: 0; left: 0; z-index: 30;
  height: var(--ruler-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.corner .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--fg-mute); text-transform: uppercase; }
.corner .spacer { flex: 1; }
.zoom-btn {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px;
  color: var(--fg-dim); font-size: 14px; line-height: 1;
}
.zoom-btn:hover { color: var(--fg); border-color: var(--line-3); }
.zoom-val { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); min-width: 38px; text-align: center; }

/* ruler — sticky top */
.ruler {
  position: sticky; top: 0; z-index: 20;
  height: var(--ruler-h);
  background: var(--panel); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ruler .tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid var(--line);
}
.ruler .tick.major { border-left-color: var(--line-2); }
.ruler .tick .num {
  font-family: var(--mono); font-size: 10px; color: var(--fg-mute);
  padding: 4px 0 0 5px; display: block;
}

/* track header — sticky left */
.thead {
  position: sticky; left: 0; z-index: 15;
  background: var(--panel);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 10px 12px 10px 14px;
  display: grid; grid-template-rows: auto auto 1fr; gap: 7px;
  overflow: hidden;
}
.thead::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--role, var(--fg-mute));
}
.thead.sel { background: var(--panel-2); }
.thead.sel::before { width: 4px; }
.trow-top { display: flex; align-items: center; gap: 8px; }
/* avatar — a flat CIRCLE (PlaylistLane::paintHeader fillEllipse), role colour at
   13% as the disc + full-colour initials. No border, no glow. Initials are the
   first two letters of the lane NAME (line1), not the person. */
.badge {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--body); font-size: 10px; font-weight: 700; letter-spacing: .02em;
  color: var(--role, var(--fg)); background: color-mix(in srgb, var(--role, #888) 13%, transparent);
}
/* lane NAME row: sans (Inter) bold 13 — the shipped name row uses the default
   sans face; only the dB readout beside it is mono (getDefaultMonospacedFontName). */
.tname { font-family: var(--body); font-size: 13px; color: var(--fg); font-weight: 700; letter-spacing: .005em; }
.tdb {
  margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  min-width: 52px; text-align: right;
}
/* capture chip (FT4-CAPTURE-REDESIGN): an 18px record-dot square pinned to the
   name row's right edge, only on lanes THIS instance captures. capturing =
   amber-tinted fill + solid amber centre dot; paused = line outline + hollow
   dot with a slash. When present it takes the dB slot. */
.tcap {
  width: 18px; height: 18px; flex: none; border-radius: 4px; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.tcap svg { width: 18px; height: 18px; display: block; overflow: visible; }
.tcap.capturing { background: color-mix(in srgb, var(--amber) 18%, transparent); }
.tcap.capturing .rdot { fill: var(--amber); stroke: none; }
.tcap.capturing .rbox,
.tcap.capturing .rslash { display: none; }
.tcap.paused .rbox { fill: none; stroke: var(--line-2); }
.tcap.paused .rdot { fill: none; stroke: var(--fg-mute); }
.tcap.paused .rslash { stroke: var(--fg-mute); }
/* row 2: the lane sub-label = the participant/owner name (sans 13, text-2). */
.tcontrib { font-family: var(--body); font-size: 13px; color: var(--fg-dim); line-height: 1.1; }
.tcontrib b { color: var(--fg-dim); font-weight: 500; }

.trow-ctl { display: flex; align-items: center; gap: 8px; align-self: end; }
.fader { position: relative; flex: 1; height: 20px; display: flex; align-items: center; }
.fader-track { position: absolute; left: 0; right: 0; height: 3px; background: var(--line-2); border-radius: 2px; }
.fader-fill  { position: absolute; left: 0; height: 3px; background: var(--role, var(--amber)); border-radius: 2px; }
input[type=range].fader-input {
  -webkit-appearance: none; appearance: none;
  position: relative; width: 100%; height: 20px; background: transparent; margin: 0; cursor: pointer;
}
input[type=range].fader-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--fg); border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--line-3);
}
input[type=range].fader-input::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-2);
  background: var(--fg); box-shadow: 0 0 0 1px var(--line-3);
}
/* M / S squares (PlaylistLane paintChip): 18px rounded-rect (4px), never pills.
   off = line outline + text3 glyph; on = filled signal colour + bg-ink glyph. */
.mini {
  width: 18px; height: 18px; flex: none; border-radius: 4px;
  background: transparent; border: 1px solid var(--line); color: var(--fg-mute);
  font-family: var(--body); font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s, border-color .12s;
}
.mini:hover { color: var(--fg-dim); border-color: var(--line-2); }
.mini.m[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--bg); }
.mini.s[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--bg); }

/* lanes */
.lane {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--lane-a);
  overflow: hidden;
}
.lane:nth-child(4n) { background: var(--lane-b); }
.lane .barline {
  position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line);
  opacity: .5;
}
.lane .barline.major { opacity: 1; background: color-mix(in srgb, var(--line-2) 70%, transparent); }

/* clip region */
.clip {
  position: absolute; top: 10px; bottom: 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--role, #888) 15%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--role, #888) 45%, transparent);
  overflow: hidden;
  transition: border-color .12s;
}
.clip:hover { border-color: color-mix(in srgb, var(--role, #888) 75%, transparent); }
.clip.sel { border-color: var(--role, var(--amber)); box-shadow: inset 0 0 0 1px var(--role, var(--amber)); }
.clip-head {
  position: absolute; top: 0; left: 0; right: 0; height: 16px;
  display: flex; align-items: center; gap: 6px; padding: 0 7px;
  background: color-mix(in srgb, var(--role, #888) 22%, transparent);
  font-family: var(--mono); font-size: 9.5px; color: var(--fg-dim); letter-spacing: .02em;
  white-space: nowrap;
}
.clip-wave { position: absolute; left: 0; right: 0; bottom: 0; top: 16px; }
.clip-wave svg { width: 100%; height: 100%; display: block; }
.clip-wave rect { fill: color-mix(in srgb, var(--role, #aaa) 70%, transparent); }

/* MIDI note-density clip */
.clip.midi .note {
  position: absolute; height: 2px; border-radius: 1px;
  background: color-mix(in srgb, var(--role, #aaa) 78%, transparent);
}

/* playhead */
.playhead {
  position: absolute; top: 0; bottom: 0; width: 1px; z-index: 25;
  background: var(--amber); pointer-events: none;
}
.playhead::before {
  content: ""; position: absolute; top: 0; left: -4px; width: 9px; height: 7px;
  background: var(--amber); clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ============================================================
   tabs
   ============================================================ */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 6px 12px; background: var(--bg-2); border-top: 1px solid var(--line);
}
.tab {
  font-family: var(--mono); font-size: 12px; color: var(--fg-mute);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-ctl);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: color .14s, border-color .14s, background .14s;
}
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-faint); }
.tab:hover { color: var(--fg-dim); border-color: var(--line-2); }
.tab[aria-selected="true"] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.tab[aria-selected="true"] .dot { background: var(--amber); }

/* ============================================================
   footer
   ============================================================ */
.footer {
  display: flex; align-items: center; gap: 0;
  padding: 0 14px; background: var(--bg-2); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--fg-mute);
}
.footer .seg { padding: 0 12px; border-right: 1px solid var(--line); height: 14px; display: flex; align-items: center; white-space: nowrap; }
.footer .seg:first-child { padding-left: 0; }
.footer .seg.sync { color: var(--sky); }
.footer .spacer { flex: 1; }
.footer .chat, .footer .mix {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
  border: 1px solid var(--line); border-radius: var(--r-chip); color: var(--fg-dim);
  margin-left: 8px; background: var(--panel); white-space: nowrap;
}
.footer .chat:hover { color: var(--fg); border-color: var(--line-2); }
.footer .mix { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.footer .mix .led { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* ============================================================
   modal — settings + invite
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,7,10,.62);
  display: none; align-items: center; justify-content: center;
}
.scrim.open { display: flex; }
.modal {
  width: min(860px, 92vw); height: min(620px, 88vh);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  display: grid; grid-template-columns: 210px 1fr; overflow: hidden;
}
.modal-nav { background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 12px; }
.modal-nav .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--fg-mute); text-transform: uppercase; padding: 0 10px 12px; }
.modal-nav .navi {
  display: block; width: 100%; text-align: left; font-family: var(--mono); font-size: 13px;
  color: var(--fg-dim); background: transparent; border: 0; border-radius: var(--r-ctl);
  padding: 9px 10px; margin-bottom: 2px;
}
.modal-nav .navi:hover { color: var(--fg); background: var(--panel); }
.modal-nav .navi.sel { color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.modal-body { padding: 26px 30px; overflow-y: auto; position: relative; }
.modal-body h2 { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.modal-body .sub { color: var(--fg-dim); font-size: 13px; margin: 6px 0 26px; }
.modal-close {
  position: absolute; top: 20px; right: 22px; width: 30px; height: 30px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--panel-2);
  color: var(--fg-dim); display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--fg); }

.field { display: grid; grid-template-columns: 1fr 320px; gap: 18px 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field .fl { font-family: var(--mono); font-size: 13px; color: var(--fg); margin-bottom: 4px; }
.field .fd { font-size: 12.5px; color: var(--fg-mute); line-height: 1.5; }
.select, .input {
  width: 100%; font-family: var(--mono); font-size: 13px; color: var(--fg);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 9px 12px;
}
.seg-ctl { display: flex; gap: 3px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 3px; }
.seg-ctl button { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--fg-mute); background: transparent; border: 0; border-radius: 5px; padding: 6px 4px; }
.seg-ctl button.sel { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.toggle {
  width: 40px; height: 22px; border-radius: 12px; background: var(--line-2); border: 0; position: relative; transition: background .16s;
}
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); transition: transform .16s; }
.toggle[aria-pressed="true"] { background: var(--amber); }
.toggle[aria-pressed="true"]::after { transform: translateX(18px); background: #14100a; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--amber); }
.slider-row .val { font-family: var(--mono); font-size: 13px; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 7px 12px; min-width: 82px; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============================================================
   rail collapse toggle + compact (minimal) track rail
   ============================================================ */
.rail-toggle {
  width: 24px; height: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px;
  color: var(--fg-mute); transition: color .12s, border-color .12s;
}
.rail-toggle:hover { color: var(--fg); border-color: var(--line-3); }
.rail-toggle svg { width: 14px; height: 14px; transition: transform .16s; }
.rail-toggle[aria-pressed="true"] svg { transform: scaleX(-1); }

/* --- compact rail: just color, badge, track name, contributor --- */
.stage.rail-min { --rail-w: 156px; }
.rail-min .corner .lbl { display: none; }
.rail-min .thead {
  grid-template-rows: auto auto;
  padding: 12px 10px 12px 14px; gap: 6px;
}
.rail-min .thead .tdb,
.rail-min .thead .trow-ctl { display: none; }
.rail-min .thead .trow-top { gap: 8px; }
.rail-min .thead .tname { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-min .thead .tcontrib { padding-left: 32px; margin-top: -2px; }

/* ============================================================
   responsive — shed chrome as the window narrows
   ============================================================ */
@media (max-width: 940px) {
  .hdr { gap: 12px; padding: 0 12px; }
  .hdr-group { gap: 5px; }
  .sig .txt { display: none; }
  .sig { padding: 8px; }
}
@media (max-width: 780px) {
  .hdr { gap: 10px; }
  .session-pill { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  .annotate-btn { display: none; }
  .license { display: none; }
  .footer .seg.build { display: none; }
  .tabs { gap: 6px; padding: 6px 10px; }
}
@media (max-width: 620px) {
  .session-pill { display: none; }
  .footer .seg.brand { display: none; }
}
@media (max-width: 500px) {
  .footer .seg.ver { display: none; }
  .footer .chat .txt { display: none; }
  .footer .chat { padding: 4px 8px; }
}

/* ============================================================
   invite / pair popover
   ============================================================ */
.popover {
  width: min(560px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 22px 24px 24px;
}
.pop-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pop-icon {
  width: 40px; height: 40px; flex: none; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--amber); background: color-mix(in srgb, var(--amber) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
}
.pop-head h3 { font-family: var(--mono); font-weight: 500; font-size: 16px; color: var(--fg); }
.pop-head p { font-size: 12.5px; color: var(--fg-mute); line-height: 1.5; margin-top: 5px; }
.pop-head .modal-close { position: static; }

.pop-body { padding-top: 18px; }
.pop-note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--fg-dim); line-height: 1.5;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 12px 14px; margin-bottom: 18px;
}
.pop-note svg { flex: none; margin-top: 1px; color: var(--fg-mute); }
.pop-or { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pop-or span {
  font-family: var(--mono); font-size: 11px; color: var(--fg-mute);
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2);
}
.pop-steplabel { font-family: var(--mono); font-size: 14px; color: var(--fg); font-weight: 500; }
.pop-adv {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 11px 14px; margin-bottom: 18px;
}
.pop-adv summary { font-family: var(--mono); font-size: 12.5px; color: var(--fg-dim); cursor: pointer; list-style: none; }
.pop-adv summary::-webkit-details-marker { display: none; }
.pop-adv summary::before { content: "▸ "; color: var(--fg-mute); }
.pop-adv[open] summary::before { content: "▾ "; }
.pop-adv p { font-size: 12.5px; color: var(--fg-mute); line-height: 1.5; margin-top: 10px; }
.pop-fieldlabel { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-mute); margin: 4px 0 8px; }
.pop-fieldlabel span { text-transform: none; letter-spacing: normal; }
.pop-ta {
  width: 100%; min-height: 78px; resize: vertical;
  font-family: var(--mono); font-size: 12px; color: var(--fg); line-height: 1.6;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 11px 13px; margin-bottom: 10px;
}
.pop-ta::placeholder { color: var(--fg-faint); }
.pop-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--fg-dim);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 10px; margin-bottom: 18px; transition: border-color .14s, color .14s, background .14s;
}
.pop-btn:hover { border-color: var(--line-3); color: var(--fg); }
.pop-btn.primary { background: var(--amber); border-color: var(--amber); color: #14100a; font-weight: 500; }
.pop-btn.primary:hover { background: var(--amber-d); }
.pop-foot { font-size: 12px; color: var(--fg-mute); line-height: 1.55; margin: 0; }
