/* VP Studio — Simple mode. Shared tokens: /static/common/tokens.css.
   Measurements follow the design spec (Simple mode §4–§9). */

:root {
  --vp-gen-card-bg: #faf8fd;   --vp-gen-card-bdr: #b9a6d2;
  --vp-int-card-bg: #f4faf7;   --vp-int-card-bdr: #a9d6c6;
  --vp-side-bg: #f3f7fb;       --vp-side-bdr: rgba(26,58,90,0.35);  --vp-side-input-bdr: rgba(26,58,90,0.25);
  --vp-tooltip-bg: #1a1610;    --vp-tooltip-fg: #fffef9;
  --vp-disabled-bg: #f0ece4;   --vp-disabled-fg: #b0a490;
  --vp-field-hover: #e8d8b4;
  --vp-unmet: rgba(60,50,30,0.15);
  --vp-switch-off: rgba(60,50,30,0.25);
  --vp-rail: rgba(60,50,30,0.3);
  --vp-dashed: rgba(60,50,30,0.35);
  --vp-handle-hover: rgba(122,62,26,0.22);
  --vp-shadow-seg: 0 0.5px 2px rgba(0,0,0,0.10);
  --vp-shadow-tip: 0 4px 14px rgba(0,0,0,0.18);
  --vp-ready-done: #3a4a1a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --vp-gen-card-bg: #221d2a;   --vp-gen-card-bdr: #5a4a72;
    --vp-int-card-bg: #18241f;   --vp-int-card-bdr: #2f5a4c;
    --vp-side-bg: #1a2129;       --vp-side-bdr: rgba(152,192,232,0.30);  --vp-side-input-bdr: rgba(152,192,232,0.25);
    --vp-tooltip-bg: #ede8dc;    --vp-tooltip-fg: #1a1810;
    --vp-disabled-bg: #2a271e;   --vp-disabled-fg: #6a604e;
    --vp-field-hover: #40361f;
    --vp-unmet: rgba(200,180,140,0.15);
    --vp-switch-off: rgba(200,180,140,0.25);
    --vp-rail: rgba(200,180,140,0.3);
    --vp-dashed: rgba(200,180,140,0.35);
    --vp-handle-hover: rgba(208,128,80,0.30);
    --vp-ready-done: #b8d090;
  }
}

html, body { margin: 0; height: 100%; }
body { font-family: var(--font-ui); background: var(--c-bg); color: var(--c-text); overflow: hidden; }
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[v-cloak] { display: none; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-rows: 52px minmax(0, 1fr); height: 100vh; overflow: hidden; }
.main { overflow-y: auto; min-width: 0; background: var(--c-bg); }

.topbar {
  background: var(--c-surface); border-bottom: 0.5px solid var(--c-border-strong);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; min-width: 0;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--c-accent);
        letter-spacing: 0.03em; white-space: nowrap; margin-right: 6px; text-decoration: none; }
.logo-tile { width: 26px; height: 26px; border-radius: 7px; background: var(--c-accent); color: var(--c-on-accent);
             display: grid; place-items: center; font: 500 11px var(--font-mono); letter-spacing: 0; }
.file-name { font: 12.5px var(--font-mono); color: var(--c-muted); white-space: nowrap; overflow: hidden;
             text-overflow: ellipsis; min-width: 0; }
.version-tag { font: 10px var(--font-mono); padding: 1px 7px; border-radius: 4px; background: var(--c-tag-state-bg);
               color: var(--c-tag-state); white-space: nowrap; }
.unsaved { font-size: 11px; color: var(--c-muted); white-space: nowrap; }
.btn-new { display: flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 11.5px;
           border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-accent);
           border-radius: 6px; white-space: nowrap; margin-left: 4px; }
.btn-new:hover { border-color: var(--c-accent); }
.editor-mode { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.editor-mode > span { font-size: 11px; color: var(--c-muted); white-space: nowrap; }
.seg { display: flex; }
.seg button { padding: 3px 10px; font-size: 11.5px; border: 0.5px solid var(--c-border-strong); background: transparent;
              color: var(--c-muted); white-space: nowrap; }
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button.on { background: var(--c-surface); color: var(--c-accent); border-color: var(--c-accent); }
.spacer { flex: 1; }
.tabs { display: flex; gap: 2px; background: var(--c-bg); border-radius: 7px; padding: 3px; }
.tabs button { padding: 4px 12px; border: none; background: transparent; color: var(--c-muted); font-size: 12px;
               font-weight: 500; border-radius: 5px; display: flex; align-items: center; gap: 5px; }
.tabs button i { font-size: 14px; }
.tabs button.on { background: var(--c-surface); color: var(--c-accent); box-shadow: var(--vp-shadow-seg); }
.btn-ghost, .btn-primary { display: flex; align-items: center; gap: 5px; padding: 5px 13px; font-size: 13px;
                           font-weight: 500; border-radius: 6px; white-space: nowrap; }
.btn-ghost { background: none; color: var(--c-muted); border: 0.5px solid var(--c-border-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--c-text); }
.btn-primary { background: var(--c-accent); color: var(--c-on-accent); border: none; }
.btn-primary:hover:not(:disabled) { opacity: 0.82; }
.btn-ghost:disabled, .btn-primary:disabled { opacity: 0.5; }
.user-btn { width: 30px; height: 30px; border-radius: 50%; border: 0.5px solid var(--c-border-strong); background: var(--c-surface);
            display: grid; place-items: center; padding: 0; overflow: hidden; color: var(--c-muted); }
.user-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-wrap { position: relative; }

@media (max-width: 900px) {
  .editor-mode, .file-name, .version-tag, .unsaved { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
}
@media (max-width: 620px) {
  .btn-ghost span, .btn-primary span, .btn-new span, .tabs span, .logo-text { display: none; }
  .btn-ghost, .btn-primary { padding: 5px 9px; }
  .tabs button { padding: 4px 9px; }
  .step-chev { display: none; }
  .step-head-main { gap: 10px; }
  .el-head { flex-wrap: wrap; }
  .el-tools { margin-left: auto; }
}

/* ── shared bits ───────────────────────────────────────────────────────── */
.eyebrow { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--c-muted); }
.tile { display: grid; place-items: center; flex-shrink: 0; }
.c-accent { color: var(--c-accent); background: var(--c-accent-light); }
.c-char   { color: var(--c-tag-char);  background: var(--c-tag-char-bg); }
.c-place  { color: var(--c-tag-place); background: var(--c-tag-place-bg); }
.c-trans  { color: var(--c-tag-trans); background: var(--c-tag-trans-bg); }
.c-text   { color: var(--c-tag-text);  background: var(--c-tag-text-bg); }
.c-state  { color: var(--c-tag-state); background: var(--c-tag-state-bg); }
.c-err    { color: var(--c-tag-err);   background: var(--c-tag-err-bg); }
.c-muted  { color: var(--c-muted);     background: var(--c-bg); }
.c-disabled { color: var(--vp-disabled-fg); background: var(--vp-disabled-bg); }
.icon-btn { width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--c-muted);
            display: grid; place-items: center; flex-shrink: 0; padding: 0; }
.icon-btn:hover { background: var(--c-accent-light); }
.icon-btn i { font-size: 15px; }

.popover { position: absolute; z-index: 8; background: var(--c-surface); border: 0.5px solid var(--c-border-strong);
           border-radius: 8px; box-shadow: var(--shadow-popover); padding: 6px; display: grid; gap: 1px; }
.pop-head { font-size: 10px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted);
            padding: 6px 10px 2px; }
.pop-item { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 6px 10px; border: none;
            background: transparent; border-radius: 5px; color: var(--c-text); font-size: 12.5px; width: 100%; }
.pop-item:hover:not(:disabled) { background: var(--c-accent-light); }
.pop-item.checked { background: var(--c-bg); }
.pop-item:disabled { color: var(--c-muted); }
.pop-item:disabled > i:first-child { color: var(--vp-disabled-fg) !important; }
.pop-item > i:first-child { font-size: 14px; margin-top: 1px; color: var(--c-muted); }
.pop-item .pi-body { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pop-item .pi-desc { font-size: 11px; color: var(--c-muted); line-height: 1.35; }
.pop-item .pi-check { color: var(--c-accent); }

/* ── gallery (§4.2) ────────────────────────────────────────────────────── */
.gallery { max-width: 980px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 60px; display: flex; flex-direction: column; gap: 20px; }
.gallery-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.gallery-head > div { flex: 1 1 300px; display: flex; flex-direction: column; gap: 6px; }
.gallery h1 { font: 500 28px var(--font-doc); margin: 0; }
.gallery-sub { font-size: 13px; color: var(--c-muted); }
.btn-back { display: flex; align-items: center; gap: 5px; padding: 5px 12px; font-size: 12.5px; border: 0.5px solid var(--c-border-strong);
            background: var(--c-surface); color: var(--c-muted); border-radius: 6px; white-space: nowrap; }
.btn-back:hover:not(:disabled) { color: var(--c-text); }
.btn-back:disabled { opacity: 0.5; }
.scratch { text-align: left; display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 12px;
           border: 1px dashed var(--vp-dashed); background: var(--c-surface); color: var(--c-text); }
.scratch:hover, .tpl-card:hover, .case-row:hover { border-color: var(--c-accent); }
.scratch .tile { width: 40px; height: 40px; border-radius: 10px; }
.scratch .tile i { font-size: 20px; }
.scratch-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.scratch-body b { font-size: 15px; font-weight: 500; }
.scratch-body span { font-size: 12.5px; color: var(--c-muted); }
.scratch > i { color: var(--c-accent); }
.start-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.tpl-card { text-align: left; display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px;
            border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); align-content: start; }
.tpl-icons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tpl-icons .tile { width: 24px; height: 24px; border-radius: 6px; }
.tpl-icons .tile i { font-size: 13px; }
.tpl-n { font: 10.5px var(--font-mono); color: var(--c-muted); margin-left: 4px; }
.tpl-name { font-size: 14px; font-weight: 500; }
.tpl-desc { font-size: 12px; color: var(--c-muted); line-height: 1.45; }
.placeholder-note { font-size: 12px; color: var(--c-muted); display: flex; gap: 6px; align-items: flex-start; line-height: 1.5; }
.placeholder-note code { font-family: var(--font-mono); font-size: 11px; }
.case-list { display: grid; gap: 6px; }
.case-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 10px;
            border: 0.5px solid var(--c-border-strong); background: var(--c-surface); }
.case-row > button.case-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: none;
                               background: none; padding: 0; text-align: left; }
.case-title { font: 500 15px var(--font-doc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.case-title.untitled { color: var(--c-muted); }
.case-meta { font: 10.5px var(--font-mono); color: var(--c-muted); white-space: nowrap; }
.case-row.current { border-color: var(--c-accent); }

/* ── editor page (§4.3) ────────────────────────────────────────────────── */
.editor { margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; display: flex; flex-direction: column; gap: 16px; }
.row-title { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.case-title-input { flex: 1 1 320px; min-width: 0; font: 500 28px var(--font-doc); background: transparent;
                    border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; outline: none; }
.case-title-input:hover { border-color: var(--c-border-strong); }
.case-title-input:focus { border-color: var(--c-accent); background: var(--c-surface); }
.case-title-input::placeholder { color: var(--c-muted); opacity: 0.7; }
.title-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.readiness { width: 200px; display: flex; flex-direction: column; gap: 5px; }
.readiness-head { display: flex; justify-content: space-between; font-size: 12px; }
.readiness-head span:first-child { color: var(--c-muted); }
.readiness-head span:last-child { font-weight: 500; color: var(--c-tag-state); }
.readiness-head span.done { color: var(--vp-ready-done); }
.readiness-bar { display: flex; gap: 2px; }
.readiness-bar span { flex: 1; height: 5px; border-radius: 3px; background: var(--vp-unmet); }
.readiness-bar span.met { background: var(--c-success); }
.btn-toggle { display: flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 12.5px;
              border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-accent);
              border-radius: 6px; white-space: nowrap; }
.btn-toggle:hover { border-color: var(--c-accent); }
.btn-toggle.on { background: var(--c-accent-light); }

.row-toggles { display: grid; gap: 8px; }
.toggle-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-toggle { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--c-surface);
                border: 0.5px solid var(--c-border-strong); border-radius: 8px; color: var(--c-text); }
.panel-toggle:hover { border-color: var(--c-accent); }
.panel-toggle.on { background: var(--c-accent-light); }
.panel-toggle i { color: var(--c-muted); }
.panel-toggle span { font-size: 13px; font-weight: 500; white-space: nowrap; }
.panel { background: var(--c-surface); border: 0.5px solid var(--c-border-strong); border-radius: 10px; }
.settings-panel { padding: 12px 14px 14px; display: grid; gap: 12px; }
.settings-row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 12.5px; color: var(--c-muted); }
.settings-row > * { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.levels { display: flex; gap: 3px; background: var(--c-track); padding: 2px; border-radius: 6px; }
.levels button { padding: 3px 10px; border: none; border-radius: 4px; background: transparent; color: var(--c-muted);
                 font-size: 12px; font-weight: 500; white-space: nowrap; }
.levels button.on { background: var(--c-surface); color: var(--c-accent); box-shadow: var(--vp-shadow-seg); }
.switch-btn { background: none; border: none; font-size: 12.5px; color: var(--c-muted); padding: 0; gap: 7px; }
.switch { width: 28px; height: 16px; border-radius: 8px; background: var(--vp-switch-off); position: relative; flex-shrink: 0; }
.switch.on { background: var(--c-accent); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
                 background: #fffef9; box-shadow: 0 0.5px 2px rgba(0,0,0,0.2); transition: left .12s; }
.switch.on::after { left: 14px; }
.script-btn { padding: 3px 10px; border: 0.5px solid var(--c-border-strong); background: var(--c-surface);
              color: var(--c-text); border-radius: 6px; font-size: 12px; gap: 5px; }
.script-btn:hover { border-color: var(--c-accent); }
.script-btn.on { background: var(--c-accent-light); }
.script-btn i:first-child { color: var(--c-accent); }
.script-btn i:last-child { color: var(--c-muted); }
.tpl-switch { display: grid; gap: 10px; }
.tpl-switch > span { font-size: 12px; color: var(--c-muted); }
.tpl-switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.tpl-switch-grid button { text-align: left; display: grid; gap: 6px; padding: 10px 12px; border-radius: 9px;
                          border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); align-content: start; }
.tpl-switch-grid button:hover { border-color: var(--c-accent); }
.tpl-switch-grid button.on { border: 1px solid var(--c-accent); background: var(--c-accent-light); }
.tpl-switch-grid b { font-size: 13px; font-weight: 500; }
.tpl-switch-grid span { font-size: 11.5px; color: var(--c-muted); line-height: 1.4; }
.legend { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--c-muted); }
.legend > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .tile { width: 20px; height: 20px; border-radius: 5px; }
.legend .tile i { font-size: 12px; }

.main-grid { display: grid; gap: 24px; align-items: start; }
.steps { display: flex; flex-direction: column; min-width: 0; }

/* ── step timeline (§4.4) ──────────────────────────────────────────────── */
.step-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
.rail { display: flex; flex-direction: column; align-items: center; }
.rail-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--c-surface); color: var(--c-accent);
            border: 0.5px solid var(--c-accent); display: grid; place-items: center; font: 11px var(--font-mono); flex-shrink: 0; }
.rail-dot.on { background: var(--c-accent); color: var(--c-on-accent); }
.rail-line { flex: 1; width: 1px; background: var(--vp-rail); }
.step-col { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.step-card { background: var(--c-surface); border: 0.5px solid var(--c-border-card); border-radius: 10px;
             position: relative; min-width: 0; }
.step-card.open { border: 1px solid var(--c-accent); box-shadow: var(--shadow-card); }
.step-head { display: flex; align-items: center; border-radius: 9px; }
.step-card.open .step-head { background: var(--c-accent-light); border-radius: 9px 9px 0 0; }
.step-head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px;
                  cursor: pointer; color: var(--c-text); }
.step-head-main > .tile { width: 34px; height: 34px; border-radius: 9px; }
.step-head-main > .tile i { font-size: 18px; }
.step-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.step-title { font: 500 16px var(--font-doc); cursor: text; border-radius: 4px; padding: 0 6px; margin-left: -6px;
              max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-title:hover { background: var(--c-hover); }
.step-title.untitled { color: var(--c-muted); }
.step-title-input { width: 100%; min-width: 0; font: 500 16px var(--font-doc); border: 1px solid var(--c-accent);
                    background: var(--c-surface); border-radius: 5px; padding: 1px 6px; margin-left: -7px; outline: none; }
.step-sub-input { width: 100%; min-width: 0; font: 12px var(--font-ui); border: 1px solid var(--c-accent);
                  background: var(--c-surface); border-radius: 5px; padding: 2px 6px; margin-left: -7px; outline: none; }
.step-summary { font-size: 12px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.status-pill { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.step-chev { color: var(--c-muted); }
.step-menu-btn { width: 32px; height: 32px; margin-right: 6px; border: none; background: transparent; color: var(--c-muted);
                 border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; padding: 0; }
.step-menu-btn:hover, .step-menu-btn.on { background: var(--c-hover); color: var(--c-accent); }
.tooltip { position: absolute; left: 58px; top: 40px; z-index: 9; max-width: min(360px, calc(100% - 70px)); padding: 7px 10px;
           background: var(--vp-tooltip-bg); color: var(--vp-tooltip-fg); font-size: 12px; line-height: 1.45; border-radius: 6px;
           box-shadow: var(--vp-shadow-tip); pointer-events: none; }
.step-menu { right: 6px; top: 44px; min-width: 230px; gap: 2px; }
.step-menu .pop-item .pi-desc { line-height: 1.3; }

.step-body { padding: 12px 12px 14px; display: grid; gap: 10px; min-width: 0; }
.empty-step { padding: 14px; border: 0.5px dashed var(--vp-rail); border-radius: 9px; font-size: 12.5px; color: var(--c-muted); text-align: center; }
.answer-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11.5px; color: var(--c-muted); }
.answer-line i { color: var(--c-tag-state); }
.chip-field { font: 10.5px var(--font-mono); color: var(--c-tag-state); background: var(--c-tag-state-bg); padding: 1px 6px;
              border-radius: 4px; white-space: nowrap; }
.add-element { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 2px; }
.add-element > span { font-size: 11.5px; color: var(--c-muted); margin-right: 2px; }
.add-element button { display: flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 12px;
                      border: 0.5px dashed var(--vp-rail); background: transparent; border-radius: 6px; white-space: nowrap; }
.add-element button:hover { background: var(--c-surface); border-color: var(--c-accent); }
.k-literal { color: var(--c-accent); }
.k-generated { color: var(--c-tag-char); }
.k-interaction { color: var(--c-tag-trans); }

.add-step { display: grid; gap: 6px; padding: 4px 0 8px; }
.add-step-btn { justify-self: start; display: flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 12px;
                border: 0.5px dashed var(--vp-rail); background: transparent; color: var(--c-accent); border-radius: 6px; white-space: nowrap; }
.add-step-btn:hover, .add-step-btn.on { border-color: var(--c-accent); background: var(--c-surface); }
.add-step-panel { padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 4px; }
.add-step-panel button { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 8px 10px; border: none;
                         background: transparent; border-radius: 6px; color: var(--c-text); }
.add-step-panel button:hover:not(:disabled) { background: var(--c-accent-light); }
.add-step-panel button:disabled { color: var(--c-muted); }
.add-step-panel .tile { width: 28px; height: 28px; border-radius: 7px; }
.add-step-panel .tile i { font-size: 15px; }
.add-step-panel b { font-size: 12.5px; font-weight: 500; display: block; }
.add-step-panel small { font-size: 11px; color: var(--c-muted); line-height: 1.35; display: block; margin-top: 2px; }
.step-gap { height: 12px; }
.defaults-note { margin-left: 42px; padding: 12px 14px; border: 0.5px dashed var(--vp-rail); border-radius: 10px; display: flex;
                 gap: 8px 14px; align-items: center; font-size: 12px; color: var(--c-muted); line-height: 1.5; }
.defaults-note i { font-size: 16px; }

/* ── element card (§4.6) ───────────────────────────────────────────────── */
.el-card { border-radius: 9px; min-width: 0; position: relative; }
.el-card.literal { background: var(--c-surface); border: 0.5px solid var(--c-border-card); }
.el-card.generated { background: var(--vp-gen-card-bg); border: 1px dashed var(--vp-gen-card-bdr); }
.el-card.interaction { background: var(--vp-int-card-bg); border: 1px solid var(--vp-int-card-bdr); }
.el-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; min-width: 0; }
.kind-badge { display: flex; align-items: center; gap: 5px; padding: 3px 7px; border: none; border-radius: 5px; font-size: 10px;
              font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.kind-badge i:first-child { font-size: 13px; }
.kind-badge i:last-child { font-size: 11px; opacity: 0.7; }
.el-label { flex: 1; min-width: 60px; font-size: 13px; font-weight: 500; border: 1px solid transparent; background: transparent;
            border-radius: 5px; padding: 2px 5px; outline: none; }
.el-label:hover { border-color: var(--c-border-strong); }
.el-label:focus { border-color: var(--c-accent); background: var(--c-surface); }
.el-tools { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.el-tools .assist { color: var(--c-accent); }
.el-tools .assist.on { background: var(--c-accent-light); }
.el-tools .divider { width: 1px; height: 16px; background: var(--c-border-strong); margin: 0 4px; }
.count-btn { height: 28px; min-width: 28px; padding: 0 6px; border: none; border-radius: 6px; background: transparent;
             display: flex; align-items: center; justify-content: center; gap: 2px; font: 11px var(--font-mono); }
.count-btn i { font-size: 15px; }
.count-btn.attach { color: var(--c-tag-place); }
.count-btn.attach:hover, .count-btn.attach.on { background: var(--c-tag-place-bg); }
.count-btn.strat { color: var(--c-tag-state); }
.count-btn.strat:hover, .count-btn.strat.on { background: var(--c-tag-state-bg); }
.el-tools .menu.on { background: var(--c-hover); }
.el-pop { top: 38px; width: 270px; max-width: calc(100% - 12px); }
.el-pop.left { left: 8px; }
.el-pop.right { right: 6px; }

.assist-bar { margin: 0 10px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 7px;
              background: var(--c-accent-light); }
.assist-bar > i { color: var(--c-accent); }
.assist-bar > b { font-size: 12px; font-weight: 500; white-space: nowrap; }
.assist-bar input { flex: 1 1 200px; min-width: 0; border: 0.5px solid var(--c-border-strong); background: var(--c-surface);
                    border-radius: 6px; padding: 5px 9px; font-size: 12.5px; outline: none; }
.assist-bar input:focus { border-color: var(--c-accent); }
.assist-run { padding: 5px 11px; font-size: 12px; border: none; background: var(--c-accent); color: var(--c-on-accent);
              border-radius: 6px; white-space: nowrap; }
.assist-run:disabled { opacity: 0.6; }
.assist-close { width: 24px; height: 24px; border: none; background: none; color: var(--c-muted); display: grid; place-items: center; padding: 0; }
.assist-error { flex-basis: 100%; font-size: 11.5px; color: var(--c-tag-err); }

.el-body { padding: 0 10px 10px; display: grid; gap: 6px; min-width: 0; }
.literal-text { resize: vertical; border: 0.5px solid var(--c-border-strong); background: var(--c-surface); border-radius: 7px;
                padding: 9px 11px; font: 14px/1.65 var(--font-doc); outline: none; min-width: 0; width: 100%; }
.literal-text:focus { border-color: var(--c-accent); }
.literal-text.empty, .prompt-box.empty, .side-text.empty { border-color: var(--c-warn-border); }

.prompt-box { display: grid; min-width: 0; border: 0.5px solid var(--c-border-strong); background: var(--c-surface); border-radius: 7px; }
.prompt-box:focus-within { border-color: var(--c-accent); }
.prompt-mirror, .prompt-input { grid-area: 1 / 1; padding: 9px 11px; font: 12.5px/1.7 var(--font-mono); white-space: pre-wrap;
                                overflow-wrap: anywhere; min-height: 70px; margin: 0; }
.prompt-mirror { pointer-events: none; color: var(--c-text); }
.prompt-input { resize: none; overflow: hidden; border: none; background: transparent; color: transparent; caret-color: var(--c-text);
                outline: none; width: 100%; height: 100%; min-width: 0; }
.prompt-input::placeholder { color: var(--c-muted); opacity: 0.8; }
.prompt-input::selection { background: rgba(122,62,26,0.25); color: transparent; }
.f-known   { background: var(--c-tag-state-bg); color: var(--c-tag-state); box-shadow: 0 0 0 2px var(--c-tag-state-bg); border-radius: 3px; }
.f-unknown, .f-forward { background: var(--c-tag-err-bg); color: var(--c-tag-err); box-shadow: 0 0 0 2px var(--c-tag-err-bg); border-radius: 3px; }
.prompt-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.insert-field { display: flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 11.5px; border: 0.5px solid var(--c-border-strong);
                background: var(--c-surface); color: var(--c-tag-state); border-radius: 6px; white-space: nowrap; }
.insert-field:hover { border-color: var(--c-tag-state); }
.insert-field.on { background: var(--c-tag-state-bg); }
.prompt-hint { font-size: 11.5px; color: var(--c-muted); }
.field-tray { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-radius: 7px; background: var(--c-mark-line-bg);
              border: 0.5px solid var(--c-mark-line-bdr); }
.field-tray button { font: 11px var(--font-mono); padding: 2px 7px; border-radius: 4px; border: none; background: var(--c-tag-state-bg);
                     color: var(--c-tag-state); white-space: nowrap; }
.field-tray button:hover { background: var(--vp-field-hover); }
.field-issues { display: grid; gap: 2px; font-size: 11.5px; color: var(--c-tag-err); }
.field-issues div { display: flex; gap: 6px; align-items: flex-start; }
.field-issues code { font-family: var(--font-mono); font-size: 11px; }
.info-line { font-size: 11.5px; color: var(--c-muted); line-height: 1.5; display: flex; gap: 6px; align-items: flex-start; }
.info-line i { margin-top: 2px; }
.info-line .link-ic { color: var(--c-tag-state); }
.info-line q { font-family: var(--font-doc); font-style: italic; color: var(--c-text); }

.strat-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.strat-chip { display: flex; align-items: center; gap: 5px; padding: 2px 3px 2px 8px; border-radius: 5px; background: var(--c-tag-state-bg);
              color: var(--c-tag-state); font-size: 11.5px; }
.strat-chip b { font-weight: 500; }
.strat-chip .moment { border: none; background: var(--c-surface); color: var(--c-tag-state); font: 10px var(--font-mono);
                      padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.strat-chip .x { border: none; background: none; color: var(--c-tag-state); padding: 0 3px; display: grid; place-items: center; }
.strat-chip .x i { font-size: 11px; }

.side-block { border-top: 0.5px dashed var(--vp-side-bdr); background: var(--vp-side-bg); border-radius: 0 0 9px 9px;
              padding: 8px 10px 10px; display: grid; gap: 8px; }
.side-head { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
             text-transform: uppercase; color: var(--c-tag-place); }
.side-head i { font-size: 13px; }
.side-item { display: grid; gap: 4px; min-width: 0; }
.side-item-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.side-item-head > i { color: var(--c-tag-place); }
.side-label { flex: 1 1 140px; min-width: 0; font-size: 12.5px; font-weight: 500; border: 1px solid transparent;
              background: transparent; border-radius: 5px; padding: 1px 4px; outline: none; }
.side-label:hover { border-color: var(--vp-side-input-bdr); }
.side-label:focus { border-color: var(--c-tag-place); background: var(--c-surface); }
.side-ref { font: 10.5px var(--font-mono); color: var(--c-tag-place); background: var(--c-tag-place-bg); padding: 1px 6px;
            border-radius: 4px; white-space: nowrap; }
.side-gen { display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11.5px; border: 0.5px solid var(--vp-side-input-bdr);
            background: var(--c-surface); color: var(--c-accent); border-radius: 5px; white-space: nowrap; }
.side-gen:hover:not(:disabled) { border-color: var(--c-accent); }
.side-x { width: 24px; height: 24px; border: none; background: none; color: var(--c-muted); display: grid; place-items: center; padding: 0; }
.side-x i { font-size: 13px; }
.side-text { resize: vertical; border: 0.5px solid var(--vp-side-input-bdr); background: var(--c-surface); border-radius: 7px;
             padding: 8px 10px; font: 13px/1.55 var(--font-ui); outline: none; min-width: 0; width: 100%; }
.side-text:focus { border-color: var(--c-tag-place); }

/* ── preview (§4.7) ────────────────────────────────────────────────────── */
.preview { position: sticky; top: 0; background: var(--c-surface); border: 0.5px solid var(--c-border-strong); border-radius: 12px;
           overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 120px); }
.preview.stacked { position: static; max-height: none; }
.pv-handle { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 3; }
.pv-handle:hover { background: var(--vp-handle-hover); }
.pv-head { padding: 10px 14px; border-bottom: 0.5px solid var(--c-border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pv-head > i { color: var(--c-muted); }
.pv-head > span { font-size: 13px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-try { display: flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 12px; border: none; background: var(--c-accent);
          color: var(--c-on-accent); border-radius: 6px; white-space: nowrap; }
.pv-body { overflow-y: auto; padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--c-bg); }
.pv-phase { background: var(--c-accent-light); border-left: 3px solid var(--c-accent); border-radius: 0 6px 6px 0; padding: 6px 14px;
            display: flex; flex-direction: column; gap: 1px; }
.pv-phase span { font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-accent); opacity: 0.75; }
.pv-phase b { font: 500 16px var(--font-doc); }
.pv-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-muted); flex-wrap: wrap; }
.pv-progress .segs { display: flex; gap: 3px; }
.pv-progress .segs span { width: 18px; height: 5px; border-radius: 3px; background: var(--vp-unmet); }
.pv-progress .segs span.on { background: var(--c-accent); }
.pv-progress .pct { font: 10.5px var(--font-mono); color: var(--c-accent); }
.pv-msg { display: flex; flex-direction: column; gap: 3px; }
.pv-who { display: flex; align-items: center; gap: 6px; }
.pv-who > span:first-child { font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-accent); }
.pv-who.patient > span:first-child { color: var(--c-tag-place); }
.pv-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 0 6px; border-radius: 4px; }
.pv-text { font: 14.5px/1.7 var(--font-doc); white-space: pre-wrap; text-wrap: pretty; margin: 0; }
.pv-text.pending { color: var(--c-muted); font-style: italic; }
.pv-case { background: var(--c-surface); border: 0.5px solid var(--c-border-strong); border-radius: 10px; overflow: hidden; }
.pv-case-head { padding: 6px 14px; border-bottom: 0.5px solid var(--c-border); display: flex; align-items: center; gap: 6px; }
.pv-case-head i { color: var(--c-tag-place); }
.pv-case-head span { font-size: 11.5px; font-weight: 500; color: var(--c-tag-place); }
.pv-case p { padding: 10px 14px 12px; font: 14px/1.7 var(--font-doc); white-space: pre-wrap; margin: 0; }
.pv-student { align-self: flex-end; max-width: 85%; background: var(--c-surface); border: 0.5px solid var(--c-border-strong);
              border-radius: 12px 12px 3px 12px; padding: 8px 12px; font-size: 13.5px; line-height: 1.55; }
.pv-loop { align-self: flex-start; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--c-tag-trans);
           padding: 3px 10px; border-radius: 6px; background: var(--c-tag-trans-bg); }
.pv-feedback { background: var(--c-tag-text-bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.pv-feedback > span { font-size: 9.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-tag-text); }
.pv-feedback p { font: 14px/1.7 var(--font-doc); white-space: pre-wrap; margin: 0; }
.pv-sample-btn { align-self: flex-start; display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11.5px;
                 border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-accent); border-radius: 5px; }
.pv-sample-btn:hover:not(:disabled) { border-color: var(--c-accent); }
.pv-sample-btn:disabled { opacity: 0.6; }
.pv-error { font-size: 11.5px; color: var(--c-tag-err); }

/* ── player stub, dialogs, toast ───────────────────────────────────────── */
.stub { max-width: 640px; margin: 80px auto; padding: 0 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.stub .tile { width: 52px; height: 52px; border-radius: 14px; }
.stub .tile i { font-size: 26px; }
.stub h2 { font: 500 24px var(--font-doc); margin: 0; }
.stub p { font-size: 13.5px; color: var(--c-muted); line-height: 1.6; margin: 0; }

.backdrop { position: fixed; inset: 0; background: rgba(26,22,16,0.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--c-surface); border-radius: 12px; box-shadow: var(--shadow-popover); width: min(520px, 100%);
          max-height: 80vh; display: flex; flex-direction: column; }
.dialog-head { padding: 14px 16px; border-bottom: 0.5px solid var(--c-border); display: flex; align-items: center; gap: 8px; }
.dialog-head b { flex: 1; font-size: 14px; font-weight: 500; }
.dialog-body { padding: 14px 16px; overflow-y: auto; font-size: 13px; line-height: 1.55; display: grid; gap: 8px; }
.dialog-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.dialog-foot { padding: 12px 16px; border-top: 0.5px solid var(--c-border); display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--vp-tooltip-bg);
         color: var(--vp-tooltip-fg); border-radius: 8px; padding: 8px 10px 8px 14px; font-size: 12.5px; display: flex; align-items: center;
         gap: 12px; box-shadow: var(--vp-shadow-tip); max-width: calc(100vw - 32px); }
.toast.error { background: var(--c-tag-err-bg); color: var(--c-tag-err); }
.toast button { border: none; background: none; color: inherit; font-weight: 600; font-size: 12.5px; padding: 2px 6px; text-decoration: underline; }

.signin { max-width: 420px; margin: 80px auto; padding: 28px; background: var(--c-surface); border: 0.5px solid var(--c-border-strong);
          border-radius: 12px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.signin h1 { font: 500 24px var(--font-doc); margin: 0; }
.signin p { margin: 0; font-size: 13px; color: var(--c-muted); }
.signin .error { font: 11.5px var(--font-mono); color: var(--c-tag-err); }
.loading { padding: 80px 16px; text-align: center; color: var(--c-muted); font-size: 13px; }

/* ── interaction exit settings ─────────────────────────────────────────── */
.ends-block { display: grid; gap: 6px; padding: 8px 10px 10px; border-radius: 7px; background: var(--c-surface);
              border: 0.5px dashed var(--vp-int-card-bdr); }
.ends-head { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
             text-transform: uppercase; color: var(--c-tag-trans); }
.ends-head i { font-size: 13px; }
.prompt-box.compact .prompt-mirror, .prompt-box.compact .prompt-input { min-height: 44px; }
.ends-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12.5px; color: var(--c-muted); }
.turns { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.turns input { width: 64px; padding: 3px 6px; border: 0.5px solid var(--c-border-strong); border-radius: 6px;
               background: var(--c-surface); font: 12.5px var(--font-mono); outline: none; }
.turns input:focus { border-color: var(--c-accent); }
.switch-btn { display: flex; align-items: center; }

/* ── strategies panel ──────────────────────────────────────────────────── */
.strat-panel { padding: 12px 14px 14px; display: grid; gap: 12px; }
.strat-intro { font-size: 12px; color: var(--c-muted); }
.strat-groups { display: grid; gap: 10px; }
.strat-group { display: grid; gap: 6px; }
.strat-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.strat-buttons button { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; font-size: 12.5px;
                        border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text);
                        border-radius: 8px; white-space: nowrap; }
.strat-buttons button:hover { border-color: var(--c-accent); }
.strat-buttons button.on { border: 1px solid var(--c-accent); background: var(--c-accent-light); }
.strat-buttons .tile { width: 22px; height: 22px; border-radius: 6px; }
.strat-buttons .tile i { font-size: 13px; }
.custom-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-accent); }
.strat-editor { display: grid; gap: 6px; padding-top: 10px; border-top: 0.5px solid var(--c-border); }
.strat-editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.strat-editor-head .tile { width: 30px; height: 30px; border-radius: 8px; }
.strat-editor-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 1px; }
.strat-editor-title b { font-size: 13.5px; font-weight: 500; }
.strat-editor-title span { font-size: 11.5px; color: var(--c-muted); }
.strat-text { resize: vertical; border: 0.5px solid var(--c-border-strong); background: var(--c-surface); border-radius: 7px;
              padding: 9px 11px; font: 12.5px/1.7 var(--font-mono); outline: none; width: 100%; min-width: 0; }
.strat-text:focus { border-color: var(--c-accent); }
.strat-usage { font-size: 11.5px; color: var(--c-muted); line-height: 1.5; }
.btn-link { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; color: var(--c-accent);
            font-size: 12px; padding: 2px 4px; text-decoration: underline; }

/* ── player ────────────────────────────────────────────────────────────── */
.player { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.chat-inner { max-width: 760px; margin: 0 auto; padding: 28px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.chat-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.chat-title h1 { font: 500 26px var(--font-doc); margin: 0; }
.chat-title span { font-size: 12px; color: var(--c-muted); }
.stale-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; padding: 8px 12px;
              border-radius: 8px; background: var(--c-tag-state-bg); color: var(--c-tag-state); }
.pv-student.sending { opacity: 0.6; }
.pv-review { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--c-surface);
             border: 0.5px solid var(--c-border-strong); }
.pv-review details { border-top: 0.5px solid var(--c-border); padding-top: 6px; }
.pv-review summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--c-tag-place); }
.pv-review p { font: 14px/1.7 var(--font-doc); white-space: pre-wrap; margin: 6px 0 2px; }
.trace-note { display: flex; gap: 6px; align-items: center; font: 10.5px var(--font-mono); color: var(--c-muted); }
.typing { display: flex; gap: 4px; padding: 6px 2px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--c-muted); opacity: 0.4;
               animation: vp-typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vp-typing { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }
.pv-error { display: flex; gap: 6px; align-items: center; }

.composer { border-top: 0.5px solid var(--c-border-strong); background: var(--c-surface); flex-shrink: 0; }
.composer-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px 12px; display: grid; gap: 8px; }
.composer textarea { resize: none; border: 0.5px solid var(--c-border-strong); background: var(--c-bg); border-radius: 8px;
                     padding: 9px 11px; font: 14px/1.55 var(--font-ui); outline: none; width: 100%; min-width: 0; }
.composer textarea:focus { border-color: var(--c-accent); background: var(--c-surface); }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.composer-inner.finished { display: flex; align-items: center; justify-content: space-between; gap: 10px;
                           font-size: 13px; color: var(--c-tag-text); }
.composer-inner.finished > span { display: flex; align-items: center; gap: 6px; }

.player-side { width: 240px; border-left: 0.5px solid var(--c-border-strong); background: var(--c-surface);
               padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.phase-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.phase-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; }
.phase-list li i { margin-top: 1px; }
.phase-list li.done { color: var(--c-tag-text); }
.phase-list li.now { color: var(--c-accent); font-weight: 500; }
.phase-list li.next { color: var(--c-muted); }
.side-btn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; text-align: left;
            border: 0.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); border-radius: 7px; }
.side-btn:hover:not(:disabled) { border-color: var(--c-accent); }
.side-btn:disabled { opacity: 0.5; }
.side-btn i { color: var(--c-accent); }
.side-note { font-size: 11.5px; color: var(--c-muted); line-height: 1.5; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── authoring assistant ───────────────────────────────────────────────── */
.as-card { display: grid; gap: 14px; padding: 18px 20px; border-radius: 12px; min-width: 0;
           border: 0.5px solid var(--c-border-strong); background: var(--c-surface); }
.as-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-card-head b { font-size: 15px; font-weight: 500; }
.as-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 500 11px var(--font-mono);
          color: var(--c-accent); background: var(--c-accent-light); }
.as-field { display: grid; gap: 6px; min-width: 0; }
.as-label { font-size: 12.5px; font-weight: 500; }
.as-opt { font-weight: 400; color: var(--c-muted); margin-left: 4px; }
.as-label-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.as-input { border: 0.5px solid var(--c-border-strong); background: var(--c-surface); border-radius: 7px; padding: 8px 11px;
            font: 14px var(--font-doc); outline: none; min-width: 0; }
.as-input:focus { border-color: var(--c-accent); }
.as-card .literal-text:disabled { opacity: 0.55; }
.as-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border-radius: 9px;
           border: 1px dashed var(--vp-dashed); color: var(--c-muted); font-size: 12.5px; text-align: center; flex-wrap: wrap; }
.as-drop.over { border-color: var(--c-accent); background: var(--c-accent-light); }
.as-drop > i { font-size: 18px; }
.as-link { border: none; background: none; padding: 0; color: var(--c-accent); font-size: inherit; text-decoration: underline; }
.as-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.as-files li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 7px; background: var(--c-bg); min-width: 0; }
.as-files li > i { color: var(--c-muted); font-size: 15px; }
.as-fname { font: 12px var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.as-fmeta { font-size: 11.5px; color: var(--c-muted); white-space: nowrap; }
.as-fmeta.err { color: var(--c-tag-err); white-space: normal; text-align: right; }
.as-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.as-progress, .as-hint { font-size: 12px; color: var(--c-muted); display: flex; align-items: center; gap: 6px; }
.as-note { margin: 0; font-size: 12px; color: var(--c-muted); display: flex; gap: 6px; align-items: flex-start; line-height: 1.5; }
.as-note i { color: var(--c-warn-border); margin-top: 2px; }
.as-count { font: 10.5px var(--font-mono); color: var(--c-muted); justify-self: end; }
.as-count.over { color: var(--c-tag-err); }
.as-error { margin: 0; font-size: 12.5px; color: var(--c-tag-err); display: flex; gap: 6px; align-items: flex-start; }
.as-create { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-color: var(--c-accent); }
.as-create-body { flex: 1 1 320px; display: grid; gap: 4px; }
.as-create-body b { font-size: 15px; font-weight: 500; }
.as-create-body span { font-size: 12.5px; color: var(--c-muted); line-height: 1.5; }
.as-spin { animation: vp-spin 0.9s linear infinite; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* authoring assistant settings (staff) */
.as-gear { opacity: 0.55; }
.as-gear:hover { opacity: 1; }
.as-settings { width: min(760px, 100%); max-height: 88vh; }
.as-set-body { gap: 16px; }
.as-set-scope { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-set-prompt { font: 12px/1.55 var(--font-mono); }
.as-set-words input { width: 110px; }
.as-set-meta { margin-right: auto; }
