/* ═══════════════════════════════════════════════════════
   NARRATOR PORTAL v3 — STYLES
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #09090B;
  --bg2: #0F0F12;
  --bg3: #16161A;
  --bg4: #1E1E24;
  --bg5: #2A2A33;
  --line: rgba(255,255,255,.06);
  --line2: rgba(255,255,255,.1);
  --line3: rgba(255,255,255,.16);
  --text: #F0F0F4;
  --text2: #C0C0CE;
  --text3: #8A8A9E;
  --acc: #C8B8FF;
  --acc2: #9B8BE8;
  --acc3: #7B6BD4;
  --teal: #5EEFC8;
  --coral: #FF8B7B;
  --amber: #FFD166;
  --green: #6EE7B7;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Outfit', sans-serif;
  --mono: 'DM Mono', monospace;
  --r: 8px;
  --r2: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 52px 1fr;
}

/* ═══ TOPBAR ═══ */
.topbar {
  display: grid;
  grid-template-columns: 280px 1fr auto;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  gap: 12px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.wdot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }

.tabs { display: flex; gap: 2px; justify-content: center; }
.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  transition: all .18s;
  white-space: nowrap;
}
.tab:hover { color: var(--text2); background: var(--bg3); }
.tab.active { color: var(--text); background: var(--bg4); font-weight: 500; }

.pro-badge {
  font-size: 8px;
  font-family: var(--mono);
  background: var(--amber);
  color: #1a1000;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
  letter-spacing: .06em;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }
.model-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text2);
}
.mpill-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.ui-lang {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 3px;
}
.uilb {
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  transition: all .15s;
}
.uilb:hover { color: var(--text2); }
.uilb.active { background: var(--bg4); color: var(--text); }

/* ═══ MAIN LAYOUT ═══ */
.main { display: grid; grid-template-columns: 292px 1fr; overflow: hidden; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg4); }

/* LAYERS */
.layer { border-bottom: 1px solid var(--line); }
.layer-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 17px;
  cursor: pointer;
  transition: background .15s;
}
.layer-hd:hover { background: var(--bg3); }
.layer-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  width: 15px;
}
.layer-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .03em;
  flex: 1;
  color: var(--text2);
  transition: color .15s;
}
.layer.open .layer-title { color: var(--text); }
.layer-tag {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg4);
  color: var(--text3);
}
.layer-tag.ok { background: rgba(110,231,183,.1); color: var(--green); }
.layer-chev {
  color: var(--text3);
  font-size: 9px;
  transition: transform .2s;
}
.layer.open .layer-chev { transform: rotate(180deg); }
.layer-body { display: none; padding: 0 17px 15px; }
.layer.open .layer-body { display: block; }

.layer-add {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--bg4);
  border: 1px solid var(--line2);
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .15s;
}
.layer-add:hover { color: var(--acc); border-color: var(--acc3); }

/* FORM ELEMENTS */
.field { margin-top: 10px; }
.field:first-child { margin-top: 0; }

label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 4px;
}

input[type=text],
input[type=number],
input[type=email],
textarea,
select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s, background .15s;
  resize: none;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--acc3);
  background: var(--bg4);
}
input[type=color] {
  width: 32px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: var(--bg3);
  cursor: pointer;
}
select option { background: var(--bg3); }
textarea { font-family: var(--sans); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }

/* LABEL WITH INFO */
.label-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
}
.label-with-info > span:first-child {
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: 10px;
}
.info-icon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--line2);
  color: var(--text3);
  font-family: var(--serif);
  font-style: italic;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all .15s;
  text-transform: none;
  letter-spacing: 0;
}
.info-icon:hover { color: var(--acc); border-color: var(--acc3); }

.tooltip {
  position: fixed;
  background: var(--bg4);
  border: 1px solid var(--line3);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 11px;
  color: var(--text);
  max-width: 240px;
  line-height: 1.5;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.tooltip.visible { opacity: 1; }

/* TAGS */
.tag-wrap {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 5px 8px;
  cursor: text;
  min-height: 33px;
  transition: border-color .15s;
}
.tag-wrap:focus-within { border-color: var(--acc3); }
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.tag {
  background: rgba(155,139,232,.15);
  color: var(--acc);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
}
.tag-x { cursor: pointer; opacity: .5; font-size: 12px; line-height: 1; }
.tag-x:hover { opacity: 1; }
.tag-field {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  min-width: 60px;
  flex: 1;
  font-family: var(--sans);
  font-weight: 300;
}

/* NARRATOR BOX */
.nbox {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--acc3);
  border-radius: var(--r);
  padding: 8px 10px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  line-height: 1.8;
  margin-top: 9px;
}
.nbox .k { color: var(--acc); }
.nbox .v { color: var(--text2); }

/* LANG CHECKBOX GRID */
.lang-check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding-top: 4px;
}
.lang-check-grid label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text2);
  margin: 0;
  font-weight: 400;
}
.lang-check-grid input[type=checkbox] {
  width: auto;
  margin: 0;
  accent-color: var(--acc3);
}

/* STORAGE SELECTOR */
.storage-sel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.storage-btn {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  color: var(--text3);
  font-family: var(--sans);
  font-size: 11px;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all .15s;
}
.storage-btn:hover { color: var(--text2); border-color: var(--line3); }
.storage-btn.active {
  border-color: var(--acc3);
  background: rgba(123,107,212,.1);
  color: var(--acc);
}
.sb-ico { font-size: 14px; }

/* SWITCH */
.switch {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--text2);
  font-weight: 400;
}
.switch input { display: none; }
.switch-track {
  width: 28px;
  height: 16px;
  background: var(--bg4);
  border-radius: 8px;
  position: relative;
  transition: background .15s;
}
.switch-knob {
  width: 12px;
  height: 12px;
  background: var(--text3);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all .15s;
}
.switch input:checked + .switch-track { background: rgba(123,107,212,.3); }
.switch input:checked + .switch-track .switch-knob {
  left: 14px;
  background: var(--acc);
}
.switch-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--text2);
  font-weight: 400;
}
.switch-inline input { accent-color: var(--acc3); }

/* PATH TREE */
.path-tree {
  margin-top: 10px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  line-height: 1.9;
}
.pt-item { white-space: nowrap; }
.pt-sub { padding-left: 12px; }
.pt-sub2 { padding-left: 24px; color: var(--text2); }

/* SCHEDULE LIST */
.schedule-list { margin-top: 11px; }
.sch-empty {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  padding: 10px 0;
  text-align: center;
}

/* GENERATE BUTTON */
.gen-wrap {
  padding: 13px 17px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  position: sticky;
  bottom: 0;
}
.btn-gen {
  width: 100%;
  padding: 10px 14px;
  background: var(--acc3);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn-gen:hover { background: var(--acc2); }
.btn-gen:active { transform: scale(.98); }
.btn-gen:disabled { opacity: .4; cursor: not-allowed; }

.btn-sec {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-sec:hover { border-color: var(--line3); color: var(--text); }

.btn-sm {
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all .15s;
}
.btn-sm:hover { color: var(--text); border-color: var(--line3); }

/* ═══ CONTENT ═══ */
.content {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
.content-body {
  overflow-y: auto;
  padding: 26px 34px;
  position: relative;
}
.content-body::-webkit-scrollbar { width: 3px; }
.content-body::-webkit-scrollbar-thumb { background: var(--bg4); }
.panel { display: none; }
.panel.active { display: block; }

/* PANEL HEAD */
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.3px;
}
.panel-sub { font-size: 12px; color: var(--text3); }

/* PATH INLINE (next to title) */
.path-inline {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 8px;
}
.path-inline-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.path-inline-input {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  width: 240px;
}
.path-inline-format {
  background: var(--bg3) !important;
  border: 1px solid var(--line2) !important;
  padding: 2px 6px !important;
  width: auto !important;
  font-size: 10px !important;
  font-family: var(--mono) !important;
  border-radius: 4px !important;
}

/* SUB-TABS */
.sub-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.sub-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text3);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: -1px;
}
.sub-tab:hover { color: var(--text2); }
.sub-tab.active { color: var(--acc); border-bottom-color: var(--acc3); }
.sub-panel { display: none; }
.sub-panel.active { display: block; }

/* ═══ CONTEXTO PANEL ═══ */
.ctx-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ctx-mode-btn {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
}
.ctx-mode-btn:hover { border-color: var(--line3); }
.ctx-mode-btn.active {
  border-color: var(--acc3);
  background: rgba(123,107,212,.08);
}
.cmb-icon { font-size: 20px; margin-bottom: 6px; }
.cmb-label { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.cmb-sub { font-size: 11px; color: var(--text3); }

.ctx-source { margin-bottom: 18px; }
.ctx-source-panel { display: none; }
.ctx-source-panel.active { display: block; }

.ctx-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.ctx-adherence {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 14px 16px;
}
.ctx-adh-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ctx-adh-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
}
.ctx-adh-val {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--acc);
}
.ctx-adh-hint { font-size: 10px; color: var(--text3); margin-top: 8px; }

.ctx-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 18px;
}
.ctx-slider::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--bg4);
  border-radius: 2px;
}
.ctx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: var(--acc);
  margin-top: -5px;
  cursor: pointer;
  transition: transform .15s;
}
.ctx-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.ctx-slider::-moz-range-track { height: 3px; background: var(--bg4); border-radius: 2px; }
.ctx-slider::-moz-range-thumb {
  height: 14px; width: 14px; border-radius: 50%;
  background: var(--acc); border: none; cursor: pointer;
}

.ctx-factors {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ctx-factor {
  display: grid;
  grid-template-columns: 90px 1fr 32px;
  align-items: center;
  gap: 8px;
}
.cf-label { font-size: 11px; color: var(--text2); }
.cf-val {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--acc);
  text-align: right;
}

/* CTX VIZ */
.ctx-viz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.ctx-radar-wrap {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ctx-radar-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: 8px;
  align-self: flex-start;
}
#ctx-radar { max-width: 100%; }

.ctx-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ctx-score-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 13px 15px;
}
.csc-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 8px;
}
.csc-bar {
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.csc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acc3), var(--acc));
  border-radius: 3px;
  transition: width .4s;
}
.csc-val {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--text);
}
.csc-of {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  font-style: normal;
}

.ctx-medium-type {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 13px 15px;
}
.cmt-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 6px;
}
.cmt-hint { font-size: 10px; color: var(--text3); margin-top: 6px; }

.ctx-actions {
  display: flex;
  gap: 10px;
}

/* ═══ BRAINSTORM ═══ */
.bs-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 14px;
}
.bs-input-row .btn-gen { width: auto; padding: 8px 16px; margin-top: 18px; }

.bs-action-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
}
.bs-action-bar.visible { display: flex; }
.bs-count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  flex: 1;
}

.bs-results { display: grid; gap: 7px; }
.bs-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 15px 17px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
.bs-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--acc3);
  opacity: 0;
  transition: opacity .18s;
}
.bs-card:hover { border-color: var(--line3); background: var(--bg3); }
.bs-card:hover::before { opacity: 1; }
.bs-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  padding-top: 3px;
  flex-shrink: 0;
}
.bs-t {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}
.bs-meta {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
  font-family: var(--mono);
}
.bs-use {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
  align-self: center;
}
.bs-card:hover .bs-use { border-color: var(--acc3); color: var(--acc); }

.bs-empty, .toc-empty, .arch-empty, .published-empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text3);
}
.bs-empty .ei { font-size: 26px; margin-bottom: 9px; opacity: .3; }
.bs-empty p { font-size: 13px; }

/* ═══ WRITE PANEL ═══ */
.lang-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  margin-bottom: 12px;
}
.lang-bar-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}
#lang-pills { display: flex; gap: 5px; }

.lang-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--bg3);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.lang-pill:hover { border-color: var(--acc3); color: var(--acc); }
.lang-pill.active {
  border-color: var(--acc3);
  background: rgba(123,107,212,.15);
  color: var(--acc);
}
.lang-pill.generated { color: var(--green); border-color: rgba(110,231,183,.3); }

/* STYLE BAR (configuration of preview/edit appearance) */
.style-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sb-group { display: flex; align-items: center; gap: 6px; }
.sb-group label {
  margin: 0;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text3);
}
.sb-group select {
  width: auto;
  padding: 4px 8px;
  font-size: 11px;
}

/* WRITE OUTPUT CONTAINER */
.write-out {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* STICKY TOOLBAR */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--bg3);
  border-top-left-radius: var(--r2);
  border-top-right-radius: var(--r2);
}
.editor-toolbar.sticky {
  position: sticky;
  top: -26px;
  z-index: 50;
  background: var(--bg3);
  margin: -26px -34px 0;
  padding-left: 34px;
  padding-right: 34px;
  border-radius: 0;
}
.tb-btn {
  width: 28px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text3);
  cursor: pointer;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.tb-btn:hover { background: var(--bg4); color: var(--text); }
.tb-btn.active { background: rgba(155,139,232,.2); color: var(--acc); }
.tb-sep { width: 1px; height: 18px; background: var(--line2); margin: 0 4px; flex-shrink: 0; }
.tb-select {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 11px;
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.tb-select:hover { background: var(--bg4); color: var(--text); }
.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.unsaved-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  display: none;
}
.unsaved-dot.visible { display: inline-block; }
.char-count {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
}

/* WRITE BAR (view toggle) */
.write-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.write-bar-label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.out-lang-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--acc);
  padding: 2px 7px;
  background: rgba(155,139,232,.1);
  border-radius: 4px;
}
.vt {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: 6px;
  padding: 2px;
}
.vtb {
  padding: 3px 11px;
  border-radius: 4px;
  font-size: 11px;
  border: none;
  background: none;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.vtb.active { background: var(--bg4); color: var(--text); }

/* EDITOR AREA */
.editor-area {
  position: relative;
  min-height: 420px;
}

.editor-pane {
  padding: 24px 28px;
  outline: none;
  caret-color: var(--acc);
}
#output-raw {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* SITE RENDER (Edit + Preview look identical) */
.site-render {
  background: var(--site-bg, #FAFAFA);
  color: var(--site-text, #1A1A2E);
  font-family: var(--site-body, 'DM Sans'), sans-serif;
  min-height: 400px;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 40px 60px;
  line-height: 1.75;
  font-size: 15px;
}
.site-render h1 {
  font-family: var(--site-head, 'Fraunces'), serif;
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.2;
  color: var(--site-text, #1A1A2E);
}
.site-byline {
  font-size: 13px;
  color: rgba(0,0,0,.45);
  margin-bottom: 24px;
  font-family: var(--site-body, 'DM Sans'), sans-serif;
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding-bottom: 14px;
}
.site-render h2 {
  font-family: var(--site-head, 'Fraunces'), serif;
  font-size: 22px;
  font-weight: 500;
  margin: 32px 0 12px;
}
.site-render h3 {
  font-family: var(--site-head, 'Fraunces'), serif;
  font-size: 17px;
  font-weight: 500;
  margin: 24px 0 8px;
  color: var(--site-accent, #5B4FE8);
}
.site-render p {
  margin-bottom: 14px;
}
.site-render strong { font-weight: 600; }
.site-render em { font-style: italic; }
.site-render a {
  color: var(--site-accent, #5B4FE8);
  text-decoration: underline;
}
.site-render ul, .site-render ol {
  padding-left: 22px;
  margin-bottom: 14px;
}
.site-render li { margin-bottom: 6px; }
.site-render blockquote {
  border-left: 3px solid var(--site-accent, #5B4FE8);
  padding-left: 16px;
  margin: 16px 0;
  font-style: italic;
  color: rgba(0,0,0,.6);
}
.site-render code {
  background: rgba(0,0,0,.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .85em;
}
.site-render hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,.1);
  margin: 28px 0;
}

/* IMAGE PLACEHOLDERS IN RENDERED VIEW */
.site-img-placeholder {
  display: block;
  width: 100%;
  background: rgba(0,0,0,.04);
  border: 2px dashed rgba(0,0,0,.15);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  color: rgba(0,0,0,.4);
  font-family: var(--mono);
  font-size: 11px;
  margin: 16px 0;
  position: relative;
}
.site-img-placeholder.cover { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.site-img-placeholder.inline { min-height: 200px; }
.site-img-placeholder::before {
  content: '🖼';
  display: block;
  font-size: 24px;
  margin-bottom: 6px;
}

/* AD SLOT */
.site-ad-slot {
  display: block;
  width: 100%;
  background: rgba(255,209,102,.08);
  border: 2px dashed rgba(255,209,102,.4);
  border-radius: 6px;
  padding: 18px;
  text-align: center;
  color: rgba(0,0,0,.4);
  font-family: var(--mono);
  font-size: 10px;
  margin: 20px 0;
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* COMMENT IN TEXT */
.site-render .comment-marker {
  background: rgba(255,209,102,.3);
  border-radius: 3px;
  padding: 0 3px;
  position: relative;
  cursor: pointer;
}
.site-render .comment-marker:hover { background: rgba(255,209,102,.5); }
.site-render .comment-marker::after {
  content: '💬';
  font-size: 11px;
  margin-left: 3px;
  vertical-align: super;
}

/* SIDE PANELS (TOC + IMAGES) */
.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
}
.toc-panel { top: 0; }
.img-panel { top: 240px; }

.side-panel-tab {
  position: absolute;
  right: 100%;
  top: 10px;
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text3);
  font-size: 10px;
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all .15s;
  z-index: 31;
}
.side-panel-tab:hover { color: var(--text); }
.spt-icon { font-size: 14px; }
.spt-label { writing-mode: vertical-lr; transform: rotate(180deg); letter-spacing: .05em; }

.side-panel-body {
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: var(--r2) 0 0 var(--r2);
  padding: 14px;
  display: none;
  max-height: 460px;
  overflow-y: auto;
}
.side-panel.open .side-panel-body { display: block; }
.side-panel.open .side-panel-tab {
  background: var(--acc3);
  color: #fff;
  border-color: var(--acc3);
}

.side-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
}

.toc-list { display: flex; flex-direction: column; gap: 4px; }
.toc-item {
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  border-radius: 4px;
  transition: all .15s;
}
.toc-item:hover { background: var(--bg3); color: var(--text); }
.toc-h1 { font-weight: 500; color: var(--text); }
.toc-h2 { padding-left: 14px; }
.toc-h3 { padding-left: 26px; font-size: 11px; color: var(--text3); }

.img-section { margin-bottom: 14px; }
.img-section-title {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.img-add-btn {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg4);
  border: 1px solid var(--line2);
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
}
.img-add-btn:hover { color: var(--acc); border-color: var(--acc3); }

.img-slot {
  background: var(--bg3);
  border: 1px dashed var(--line3);
  border-radius: var(--r);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all .15s;
}
.img-slot:hover { border-color: var(--acc3); background: var(--bg4); }
.img-slot-placeholder {
  color: var(--text3);
  font-size: 11px;
}
.img-slot.has-image {
  background: var(--bg);
  padding: 4px;
}
.img-slot.has-image img,
.img-slot.has-image video {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.img-preview-size {
  width: auto !important;
  padding: 3px 6px !important;
  font-size: 10px !important;
  font-family: var(--mono) !important;
}

/* METADATA SECTIONS (separate cards) */
.meta-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.meta-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  overflow: hidden;
}
.meta-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--line);
}
.mc-icon { font-size: 13px; }
.mc-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.meta-card-toggle {
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-radius: 4px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all .15s;
}
.meta-card-toggle:hover { color: var(--text); }
.meta-card-body { padding: 12px 14px; }
.meta-card-body.meta-collapsed { display: none; }
.meta-empty {
  color: var(--text3);
  font-size: 12px;
  font-style: italic;
}

.jsonld-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 280px;
  overflow-y: auto;
}

/* Social variants in meta */
.meta-social-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.meta-social-item:last-child { border-bottom: none; padding-bottom: 0; }
.meta-social-item:first-child { padding-top: 0; }
.msi-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.msi-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

/* FAQ items in meta */
.meta-faq-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.meta-faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.meta-faq-item:first-child { padding-top: 0; }
.mfq-q {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  gap: 7px;
}
.mfq-q-mark { color: var(--acc); font-family: var(--mono); }
.mfq-a {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  padding-left: 17px;
}

/* Image suggestions in meta */
.meta-img-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.meta-img-item:last-child { border-bottom: none; padding-bottom: 0; }
.meta-img-item:first-child { padding-top: 0; }
.mii-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  padding-top: 2px;
}
.mii-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

/* SAVE MENU */
.save-menu { position: relative; }
.save-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 4px;
  min-width: 200px;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.save-menu.open .save-dropdown { display: block; }
.save-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.save-item:hover { background: var(--bg4); color: var(--text); }
.si-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }

/* WRITE EMPTY */
.write-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text3);
  padding: 60px;
}
.wsig {
  font-family: var(--serif);
  font-size: 52px;
  font-style: italic;
  font-weight: 300;
  opacity: .07;
  letter-spacing: -2px;
}
.write-empty p { font-size: 12px; }

/* ═══ PUBLISH ═══ */
.pub-mode-sel {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.pub-mode-btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .18s;
  text-align: center;
}
.pub-mode-btn:hover { border-color: var(--line3); }
.pub-mode-btn.active {
  border-color: var(--acc3);
  background: rgba(123,107,212,.1);
}
.pmb-icon { font-size: 16px; margin-bottom: 4px; }
.pmb-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
}
.pub-mode-btn.active .pmb-label { color: var(--acc); }
.pmb-sub { font-size: 10px; color: var(--text3); font-family: var(--mono); }

.pub-panel { display: none; }
.pub-panel.active { display: block; }

.seq-lang-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.seq-lt {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--bg3);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.seq-lt:hover { color: var(--text2); }
.seq-lt.active {
  background: rgba(123,107,212,.15);
  border-color: var(--acc3);
  color: var(--acc);
}

.pub-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pub-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 16px;
}
.pub-card-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.pub-card-sub {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 13px;
  line-height: 1.5;
}
.srow {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  background: var(--bg3);
  border-radius: var(--r);
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
}
.sdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}
.sdot.ok { background: var(--green); }
.sdot.pend { background: var(--amber); }

.batch-grid { display: grid; gap: 8px; }
.batch-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
}
.batch-flag { font-size: 16px; }
.batch-lang {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  width: 24px;
}
.batch-title { font-size: 12px; color: var(--text3); flex: 1; font-style: italic; }
.batch-status { font-size: 10px; font-family: var(--mono); }
.batch-status.ok { color: var(--green); }
.batch-status.pend { color: var(--amber); }

.ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ind-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  overflow: hidden;
}
.ind-head {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ind-flag { font-size: 14px; }
.ind-lang-name { font-size: 12px; font-weight: 500; }
.ind-status { margin-left: auto; font-size: 10px; font-family: var(--mono); }
.ind-status.ok { color: var(--green); }
.ind-body { padding: 12px 13px; }
.ind-btn {
  width: 100%;
  padding: 7px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  margin-top: 7px;
}
.ind-btn:hover { border-color: var(--acc3); color: var(--acc); }

.div-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 9px;
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
}
.div-label::before, .div-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* PUBLISHED LIST */
.published-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--text3);
}
.published-list { display: flex; flex-direction: column; gap: 10px; }
.pub-item {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 16px;
}
.pub-item-url {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--acc);
  margin-bottom: 4px;
}
.pub-item-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}
.pub-item-snippet {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
}
.pub-item-snippet.extended { font-size: 13px; line-height: 1.7; }

/* ═══ SOCIAL PANEL ═══ */
.social-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.social-lang-pills { display: flex; gap: 5px; }
.social-lang-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.social-platforms-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
}
.spb-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}
.spb-chips { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.spb-chip {
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--bg3);
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.spb-chip.active {
  background: rgba(155,139,232,.15);
  color: var(--acc);
  border-color: var(--acc3);
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.social-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sc-head {
  padding: 11px 14px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sico {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 500;
  color: #fff;
}
.sico-instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.sico-twitter { background: #000; border: 1px solid var(--line2); font-size: 11px; }
.sico-linkedin { background: #0A66C2; }
.sico-facebook { background: #1877F2; }
.sico-pinterest { background: #E60023; }
.sico-behance { background: #1769FF; }
.sico-spatial { background: #5E1AB6; }
.sico-reddit { background: #FF4500; }
.sico-tumblr { background: #36465D; }
.sico-medium { background: #000; }
.sico-custom { background: var(--bg4); border: 1px solid var(--line2); color: var(--text2); }
.sc-name { font-size: 12px; font-weight: 500; }
.sc-fmt { font-size: 10px; color: var(--text3); font-family: var(--mono); }

.sc-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sc-text-wrap textarea {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
  min-height: 84px;
  padding: 8px 10px;
}
.sc-ph { font-size: 12px; color: var(--text3); font-style: italic; }

.sc-tags-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-tags-label {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sc-img-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-img-slot {
  background: var(--bg3);
  border: 1px dashed var(--line3);
  border-radius: 6px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 10px;
  color: var(--text3);
}

.sc-schedule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  align-items: end;
}
.sc-schedule input { font-size: 11px; padding: 5px 8px; }

.sc-style-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sc-style-row select {
  font-size: 10px;
  padding: 4px 8px;
  width: auto;
  flex: 1;
}

.sc-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 5px;
}
.sc-remove {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.sc-remove:hover { color: var(--coral); background: rgba(255,139,123,.08); }

/* ═══ VISUALS PRO ═══ */
.vis-pro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 11px;
}
.vis-big {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 300;
  font-style: italic;
  opacity: .09;
  letter-spacing: -2px;
}
.flux-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,209,102,.1);
  border: 1px solid rgba(255,209,102,.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--amber);
}
.vis-pro h3 { font-size: 14px; font-weight: 500; color: var(--text2); }
.vis-pro p {
  font-size: 12px;
  color: var(--text3);
  max-width: 340px;
  line-height: 1.7;
}
.img-params {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 18px;
  width: 100%;
  max-width: 480px;
}
.ip {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  text-align: left;
}
.ip-l {
  font-size: 9px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 3px;
}
.ip-v { font-size: 12px; color: var(--text2); }

/* ═══ ARCHIVO ═══ */
.archive-filters {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 16px;
}
.archive-list { display: flex; flex-direction: column; gap: 8px; }
.arch-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  transition: border-color .15s;
}
.arch-row:hover { border-color: var(--line3); }
.arch-row.archived {
  opacity: .5;
}
.arch-row.archived .arch-title { text-decoration: line-through; }

.arch-title {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text);
}
.arch-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  margin-top: 3px;
}
.arch-state {
  font-size: 10px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.arch-state.draft { background: var(--bg4); color: var(--text3); }
.arch-state.published { background: rgba(110,231,183,.12); color: var(--green); }
.arch-state.archived { background: rgba(255,139,123,.12); color: var(--coral); }

.arch-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 200px;
}
.arch-tag {
  font-size: 9px;
  font-family: var(--mono);
  padding: 2px 6px;
  background: rgba(155,139,232,.1);
  color: var(--acc);
  border-radius: 3px;
}

/* ═══ STATUS BAR ═══ */
.statusbar {
  border-top: 1px solid var(--line);
  padding: 7px 34px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 11px;
  color: var(--text3);
  background: var(--bg2);
  font-family: var(--mono);
  position: relative;
}
.sb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text3);
}
.sb-dot.gen { background: var(--amber); animation: blink 1s infinite; }
.sb-dot.done { background: var(--green); }
.sb-dot.err { background: var(--coral); }
.sb-dot.paused { background: var(--amber); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* PAUSE BANNER */
.pause-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(255,209,102,.12);
  border: 1px solid rgba(255,209,102,.35);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 11px;
  color: var(--amber);
  white-space: nowrap;
  z-index: 10;
}
.pause-banner.visible { display: flex; }
.pause-banner-warn { opacity: .7; }
.pause-banner-btn {
  background: rgba(255,209,102,.2);
  border: 1px solid rgba(255,209,102,.4);
  border-radius: 10px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all .15s;
}
.pause-banner-btn:hover { background: rgba(255,209,102,.35); }
.pause-banner-btn.discard {
  background: none;
  border-color: rgba(255,139,123,.4);
  color: var(--coral);
}
.pause-banner-btn.discard:hover { background: rgba(255,139,123,.1); }

/* IMAGE SLOT DELETE BUTTON */
.img-slot-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,139,123,.8);
  border: none;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.img-slot:hover .img-slot-del,
.img-slot.has-image .img-slot-del { display: flex; }

/* FONT PANEL */
.font-panel {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  padding: 14px;
  margin-bottom: 12px;
  display: none;
}
.font-panel.visible { display: block; }
.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.font-preview {
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.font-preview:hover { border-color: var(--acc3); }
.font-preview.active { border-color: var(--acc3); background: rgba(123,107,212,.1); }
.font-preview-name { font-size: 10px; color: var(--text3); font-family: var(--mono); margin-bottom: 4px; }
.font-preview-sample { font-size: 15px; color: var(--text); }

/* TOOLBAR EXPANDABLE */
.tb-extra {
  display: none;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.tb-extra.visible { display: flex; }
.tb-expand-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--line2);
  background: var(--bg4);
  color: var(--text3);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.tb-expand-btn:hover { color: var(--text); border-color: var(--line3); }

/* THINKING */
.thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
}
.tdots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--acc3);
  animation: td 1.2s infinite;
  margin-right: 3px;
}
.tdots span:nth-child(2) { animation-delay: .2s; }
.tdots span:nth-child(3) { animation-delay: .4s; }
@keyframes td {
  0%,80%,100% { opacity: .2; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ═══ MODAL ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.modal-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}
.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 16px 18px;
}
.modal-context {
  font-size: 11px;
  color: var(--acc);
  font-family: var(--mono);
  background: rgba(155,139,232,.08);
  border-left: 2px solid var(--acc3);
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 0 4px 4px 0;
}
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
