/* Cadence Live Playback — sizing + look matched to cadence-playback.html */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
          "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --bg1: #ffffff;
  --bg2: #f5f5f4;
  --soft: #f6f7f9;
  --t1: #1a1a1a;
  --t2: #6b6b6b;
  --t3: #a3a3a3;
  --b3: rgba(0, 0, 0, 0.12);
  --line-strong: #b9c3d4;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --green-deep: #047857;
  --amber: #f59e0b;
  --rad: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg2);
  color: var(--t1);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  overflow: hidden;
}

/* ─── outer app shell (matches cadence-playback dimensions) ─────── */
.app {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  background: var(--bg1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── topbar ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--b3);
  background: #fbfcfe;
  flex-shrink: 0;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand h1 { margin: 0; font-size: 15px; font-weight: 700; color: var(--t1); }
.brand span { color: var(--t2); font-size: 11.5px; }
.controls { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.ctl { display: inline-flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--t2); }
.ctl-label { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.ctl select {
  padding: 4px 8px; border: 1px solid var(--b3); border-radius: 6px;
  background: var(--bg1); font-size: 12px; min-width: 220px;
}

.lang-toggle {
  display: inline-flex; gap: 0; border: 1px solid var(--b3); border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  padding: 4px 10px; border: 0; background: var(--bg1); cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--t2);
}
.lang-btn.active { background: var(--t1); color: #fff; }

.btn {
  padding: 7px 12px; border: 1px solid var(--b3); border-radius: 999px;
  background: var(--bg1); cursor: pointer; font-size: 12px; color: var(--t1);
  font-family: var(--font);
}
.btn:hover { background: var(--bg2); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.btn.primary:hover { background: #1d4ed8; }
.btn.small { padding: 2px 8px; font-size: 11px; }

/* ─── workspace (1fr / 520px) ─────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 520px;
  flex: 1;
  min-height: 0;
}
.pane {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  border-right: 1px solid var(--b3);
  overflow: hidden;
}
.pane:last-child { border-right: 0; background: var(--soft); }
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; border-bottom: 1px solid var(--b3); background: var(--soft);
  flex-shrink: 0;
}
.pane-head h2 { margin: 0; font-size: 13px; font-weight: 700; color: var(--t1); }

/* ─── conversation pane ────────────────────────────────────────── */
.status {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: #fef2f2; color: #991b1b; font-weight: 600;
}
.status.connected { background: #ecfdf5; color: var(--green-deep); }

.conv-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.order-card {
  display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px;
  border: 1px solid var(--b3); border-radius: 9px; background: var(--soft);
  padding: 10px 12px; font-size: 12px;
}
.order-card .k { color: var(--t2); }
.order-card .v { color: var(--t1); font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.empty-chat {
  color: var(--t3); font-size: 12px; text-align: center; padding: 20px 12px;
  font-style: italic;
}

#messages { display: flex; flex-direction: column; gap: 8px; }
.turn { display: flex; flex-direction: column; gap: 3px; max-width: 88%; }
.turn.user { align-self: flex-start; }
.turn.agent { align-self: flex-end; align-items: flex-end; }
.who { color: var(--t2); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.bubble {
  border-radius: 12px; padding: 8px 12px; font-size: 12.5px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.turn.user .bubble { background: var(--bg2); color: var(--t1); border: 1px solid var(--b3); }
.turn.agent .bubble { background: var(--t1); color: #fff; }
.turn.agent.processing .bubble { background: var(--bg2); color: var(--t2); font-style: italic; }
.turn .meta { font-size: 10px; color: var(--t3); }

/* ─── suggested-message chips ──────────────────────────────────── */
.suggestions {
  flex-shrink: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--b3);
  background: var(--soft);
}
.suggestions-label {
  font-size: 10px; font-weight: 700; color: var(--t2);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.suggestions-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion-chip {
  display: inline-block; padding: 5px 10px; font-size: 12px;
  background: var(--bg1); border: 1px solid var(--b3); border-radius: 14px;
  cursor: pointer; color: var(--t1);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggestion-chip:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.suggestion-chip.used { opacity: 0.5; cursor: default; }
.suggestion-chip.used:hover { background: var(--bg1); border-color: var(--b3); color: var(--t1); }

/* ─── chat input ───────────────────────────────────────────────── */
.chat-input {
  display: flex; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--b3);
  background: var(--bg1); flex-shrink: 0;
}
.chat-input input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--b3); border-radius: 6px;
  font-size: 13px; font-family: var(--font); color: var(--t1);
}
.chat-input input:focus { outline: 2px solid var(--blue-soft); outline-offset: -1px; border-color: var(--blue); }

/* ─── widget pane (right, 520px): mirrors cadence-playback.html ─── */
.widget-pane { background: #fbfcfe; }
.pane-widget { display: flex; flex-direction: column; min-height: 0; }
.tier-pill {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: #ecfdf5; color: var(--green-deep); font-weight: 700;
}
.mode-pills {
  display: flex; gap: 8px; padding: 10px 16px;
  border-bottom: 0.5px solid var(--b3); background: var(--bg2); flex-shrink: 0;
}
.mode-pill {
  flex: 1; display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 8px; border: 1px solid var(--b3);
  background: var(--bg1); color: var(--t3); transition: all 0.2s;
}
.mode-pill.lit {
  border-color: #3b82f6; background: var(--blue-soft); color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.mode-pill.lit.action {
  border-color: #f59e0b; background: #fff7ed; color: #9a3412;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.mode-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: inherit; font-size: 15px; font-weight: 700;
}
.mode-pill.lit.action .mode-icon { color: #b45309; }
.mode-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.1; }
.mode-label { font-size: 12px; font-weight: 700; }
.mode-state { font-size: 10px; color: inherit; opacity: 0.65; font-family: var(--mono); }

.upper-section { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg1); }
.ctx-banner {
  display: flex; gap: 6px; flex-wrap: wrap; min-height: 35px;
  padding: 8px 16px; border-bottom: 0.5px solid var(--b3); background: var(--bg2);
}
.ctx-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg1); border: 0.5px solid var(--b3); border-radius: 4px;
  padding: 3px 8px; font-size: 11px; color: var(--t2);
}
.ctx-pill b { color: var(--t1); font-weight: 600; }
.nba-zone { border-bottom: 0.5px solid var(--b3); padding: 8px 16px; background: var(--bg1); }
.nba-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.nba-label { display: flex; align-items: center; gap: 5px; }
.nba-bolt { color: #ef9f27; font-size: 11px; font-weight: 800; line-height: 1; }
.nba-text { font-size: 11px; font-weight: 600; color: var(--t2); }
.nba-status-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; background: var(--bg2); color: var(--t2);
}
.nba-status-chip.active { background: #fff7ed; color: #9a3412; }
#nba {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0.5px solid #3b82f6; border-radius: 6px;
  padding: 6px 10px; background: var(--blue-soft); overflow: hidden;
}
.nba-tag {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.nba-tag.neutral { background: #f4f4f5; color: #52525b; }
.nba-tag.response { background: #eeedfe; color: #534ab7; }
.nba-tag.action { background: #fee2e2; color: #b91c1c; }
.nba-title {
  font-size: 12px; font-weight: 600; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.nba-sub { font-size: 11px; color: var(--t2); white-space: nowrap; flex-shrink: 0; }
.nba-why { margin-top: 6px; font-size: 11.5px; color: var(--t2); line-height: 1.45; }

.guide-section { flex: 1; min-height: 0; padding: 16px; background: var(--bg1); }
.guide-id { font-size: 12px; color: var(--t2); margin: 0 0 6px; }
.guide-title { font-size: 14px; font-weight: 700; color: var(--t1); margin: 0 0 4px; }
.guide-sub { font-size: 12px; color: var(--t2); margin: 0 0 12px; line-height: 1.5; }
.checklist {
  background: var(--bg1);
  padding: 0; display: flex; flex-direction: column; gap: 6px;
}
.empty-widget {
  color: var(--t2); border: 1px dashed var(--b3); border-radius: 9px;
  padding: 18px; text-align: center; font-size: 13px;
}
.checklist-item {
  display: flex; gap: 8px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 8px; background: var(--soft);
}
.checklist-item.active { background: var(--blue-soft); border-color: var(--blue); }
.checklist-item.done { background: #f0fdf4; border-color: #86efac; }
.checklist-item.skipped { opacity: 0.4; background: var(--bg2); }
.checklist-item .step-num {
  font-weight: 700; color: var(--t2); min-width: 18px; font-size: 11px;
}
.checklist-item .step-body { flex: 1; min-width: 0; }
.checklist-item .step-type {
  font-size: 9px; color: var(--t2); text-transform: uppercase; letter-spacing: 0.05em;
  font-family: var(--mono); font-weight: 700;
}
.checklist-item .step-text {
  font-size: 11.5px; color: var(--t1); margin-top: 2px; line-height: 1.4;
  overflow-wrap: anywhere;
}
#checklist {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.7;
}
.step-block { margin-bottom: 12px; }
.step-title { margin: 0 0 2px; font-weight: 500; }
.step-sub {
  margin: 0 0 4px;
  color: var(--t2);
  padding-left: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.step-active {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 6px 8px;
  margin: -6px -8px 12px;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, .05);
}
.step-active > .step-title { color: #9a3412; }
.step-done > .step-title {
  color: var(--t2);
  text-decoration: line-through;
  text-decoration-color: var(--t3);
  text-decoration-thickness: 1px;
}
.step-done > .step-sub {
  color: var(--t3);
  text-decoration: line-through;
  text-decoration-color: var(--t3);
  text-decoration-thickness: 1px;
}
.step-done > .step-title::before {
  content: "\00D7  ";
  color: var(--t2);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}
.step-done > .step-title .cm,
.step-done > .step-title .act-btn,
.step-done > .step-title .risk-chip {
  text-decoration: none;
}
.step-skipped > .step-title,
.step-skipped > .step-sub {
  opacity: .45;
  text-decoration: line-through;
  text-decoration-color: var(--t3);
}
.step-skipped .cm,
.step-skipped .act-btn { display: none; }
.step-skipped::after {
  content: "SKIPPED";
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--t3);
  background: #f4f4f5;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -21px;
}
.step-revised > .step-title,
.step-revised > .step-sub {
  opacity: .4;
  text-decoration: line-through;
  text-decoration-color: #ea580c;
  color: #b45309;
}
.step-revised .cm,
.step-revised .act-btn { display: none; }
.step-revised::after {
  content: "REVISED";
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -21px;
}
.branch-block {
  margin-top: 6px;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
}
.branch-block .br-row { display: flex; align-items: center; gap: 6px; }
.branch-block .br-tag {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.branch-block .br-tag.chosen { background: #dcfce7; color: var(--green-deep); }
.branch-block .br-tag.skipped { background: #f4f4f5; color: var(--t2); }
.branch-block .br-tag.revised { background: #fef3c7; color: #b45309; }
.branch-block .br-label { color: var(--t1); }
.branch-block .br-row.br-skipped .br-label {
  text-decoration: line-through;
  color: var(--t3);
}
.branch-block .br-row.br-revised .br-label {
  text-decoration: line-through;
  text-decoration-color: #ea580c;
  color: #b45309;
}
.step-result {
  margin: 6px 0 3px 14px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--green-deep);
  font-size: 11.5px;
  font-weight: 600;
}
.step-result.write {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0 14px;
}
.fact-pill {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  background: #ecfdf5;
  color: var(--green-deep);
  border: 1px solid #bbf7d0;
}
.fact-pill.write {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}
.template-fragments {
  margin: 0 0 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 8px 10px;
}
.template-line {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px;
  align-items: start;
  font-size: 11.5px;
  color: var(--t2);
  padding: 4px 0;
}
.template-line + .template-line { border-top: 1px solid #bfdbfe; }
.template-name { font-family: var(--mono); font-size: 10px; color: #1d4ed8; }
.template-text { color: var(--t1); line-height: 1.45; overflow-wrap: anywhere; }
.cm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px; border: 0;
  background: #eeedfe; color: #534ab7; font-size: 10px; font-weight: 700;
  cursor: pointer; margin-left: 5px; vertical-align: middle; position: relative; top: -1px;
  transition: background .12s, transform .12s; user-select: none; line-height: 1;
}
.cm:hover { background: #534ab7; color: #fff; transform: scale(1.12); }
.cm.ok { background: var(--green-deep) !important; color: #fff !important; }
.act-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px; background: #fef3c7; color: #b45309;
  border: 1px solid #fbbf24; font-size: 10px; cursor: pointer; margin-left: 5px;
  vertical-align: middle; position: relative; top: -1px; transition: all .15s; user-select: none;
}
.act-btn:hover { background: var(--amber); color: #fff; border-color: var(--amber); transform: scale(1.12); }
.act-btn.done {
  background: #d1fae5;
  color: var(--green-deep);
  border-color: #6ee7b7;
  cursor: default;
}
.act-btn.done:hover { transform: none; }
.risk-money {
  display: inline-block; padding: 1px 6px; background: #fef2f2; color: #991b1b;
  border-radius: 8px; font-size: 9px; margin-left: 4px; font-weight: 600;
}
.risk-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.risk-chip.money { background: #fee2e2; color: #b91c1c; }
.interim-banner {
  padding: 8px 12px; background: var(--blue-soft); border-bottom: 1px solid #93c5fd;
  color: var(--blue); font-size: 11.5px; font-style: italic;
}
.session-banner {
  padding: 10px 14px;
  background: #ecfdf5;
  border-bottom: 1px solid #6ee7b7;
  color: #065f46;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.session-banner.is-error {
  background: #fef2f2;
  border-bottom-color: #fca5a5;
  color: #991b1b;
}
.session-banner .session-banner-path {
  font-family: var(--mono);
  font-size: 11px;
  color: #047857;
  display: block;
  margin-top: 2px;
  word-break: break-all;
}
.session-banner.is-error .session-banner-path { color: #b91c1c; }
.action-chip {
  margin-top: 12px; padding: 10px 12px; background: #fffbeb;
  border: 1px solid var(--amber); border-radius: 8px;
}
.action-chip .label { font-weight: 600; color: #92400e; font-size: 12.5px; }
.action-chip .desc { color: #78350f; font-size: 11px; margin-top: 4px; }
.action-chip button {
  margin-top: 6px; padding: 5px 12px; background: var(--amber); color: #fff;
  border: 0; border-radius: 6px; cursor: pointer; font-size: 11.5px; font-weight: 600;
}
.exec-panel {
  border-bottom: 1px solid var(--b3);
  background: #fafaf9;
  padding: 14px 16px;
}
.exec-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--t1); margin-bottom: 10px;
}
.exec-head .bolt { color: var(--amber); font-size: 14px; line-height: 1; }
.exec-head .exec-label { min-width: 0; overflow-wrap: anywhere; }
.hold-box {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
  padding: 9px 11px; margin-bottom: 10px;
}
.hold-label, .steps-label, .result-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.hold-label { color: #0369a1; margin-bottom: 4px; }
.hold-text { font-size: 12px; color: #0c4a6e; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.hold-copy {
  margin-top: 6px; border: 0; background: transparent; padding: 0;
  font-size: 10.5px; color: #0284c7; cursor: pointer; font-weight: 700; font-family: var(--font);
}
.steps-section { margin-bottom: 12px; }
.steps-label { color: var(--t2); margin-bottom: 6px; }
.stage-list { margin: 0; }
.stage-item {
  display: flex; align-items: center; gap: 9px; padding: 4px 0;
  font-size: 12px; color: var(--t3); line-height: 1.4;
}
.stage-item.active { color: var(--t1); font-weight: 600; }
.stage-item.done { color: var(--green); }
.stage-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--b3);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px;
}
.stage-item.active .stage-dot { border-color: var(--blue); background: var(--blue-soft); }
.stage-item.done .stage-dot { border-color: var(--green); background: #d1fae5; color: var(--green); }
.result-box {
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px;
  padding: 9px 11px; margin-bottom: 10px; display: none;
}
.result-box.write { background: #fffbeb; border-color: #fcd34d; }
.result-label { color: var(--green-deep); margin-bottom: 4px; }
.result-box.write .result-label { color: var(--amber); }
.result-text {
  font-family: var(--font); font-size: 12px; color: var(--green-deep);
  font-weight: 600;
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.result-box.write .result-text { color: var(--amber); }
.result-updates {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  font-size: 11.5px;
}
.result-update-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--t2);
}
.result-update-item > span:first-child {
  color: var(--green);
  font-weight: 800;
}
.result-box.write .result-update-item > span:first-child { color: var(--amber); }
.spinner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #bfdbfe;
  border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.exec-btn {
  width: 100%; padding: 9px; border-radius: 8px; border: 0;
  background: var(--blue); color: #fff; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
.exec-btn:hover { background: #1d4ed8; }
.exec-btn.success { background: var(--green); }
.exec-btn.success:hover { background: var(--green-deep); }
.exec-btn:disabled { background: var(--t3); cursor: default; }
.workspace-bottom {
  flex-shrink: 0; border-top: 1px solid var(--b3);
  background: #fafaf9; max-height: 48%; overflow-y: auto;
}
.response-panel { background: var(--bg1); padding: 12px 16px; }
.response-panel.empty { background: #fafaf9; }
.resp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.resp-label {
  font-size: 10.5px; font-weight: 700; color: var(--t2);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.resp-hint { font-size: 10px; color: var(--t3); margin-left: auto; font-weight: 500; }
.response-panel textarea {
  width: 100%; min-height: 72px; max-height: 170px;
  border: 1.5px solid var(--blue); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.5;
  color: var(--t1); font-family: var(--font); resize: vertical;
  background: #fff; outline: none;
}
.response-panel textarea:placeholder-shown { border-color: var(--b3); }
.resp-actions { display: flex; gap: 6px; margin-top: 7px; align-items: center; }
.resp-actions .grow { flex: 1; }
.resp-btn {
  border: 1px solid var(--b3); background: #fff; color: var(--t1);
  border-radius: 7px; padding: 6px 10px; font-size: 11.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
}
.resp-btn.primary { background: #111827; color: #fff; border-color: #111827; }
.resp-btn:disabled { opacity: .5; cursor: default; }

/* ─── inspector (slides over from the right) ───────────────────── */
.inspector-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 90vw;
  background: var(--bg1); border-left: 1px solid var(--line-strong);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
  display: flex; flex-direction: column;
  z-index: 100;
}
.inspector-tabs {
  display: flex; gap: 4px; padding: 8px 12px;
  border-bottom: 1px solid var(--b3); background: var(--soft);
}
.inspector-tabs .tab {
  padding: 4px 10px; border: 1px solid var(--b3); background: var(--bg1);
  border-radius: 6px; font-size: 11px; cursor: pointer; color: var(--t1);
  font-family: var(--font);
}
.inspector-tabs .tab.active { background: var(--t1); color: #fff; border-color: var(--t1); }
.inspector-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.inspector-body pre {
  margin: 0; font-family: var(--mono); font-size: 11px;
  white-space: pre-wrap; word-break: break-word; color: var(--t1);
}

.tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
}
.tip-card {
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}
.tip-script {
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.tip-data {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.tip-chip {
  display: inline-flex;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  color: #d1d5db;
  font-size: 10px;
}
.tip-chip b { color: #fff; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .pane:not(:last-child) { border-right: 0; border-bottom: 1px solid var(--b3); }
  .widget-pane { min-height: 520px; }
}
