
:root {
  --brand-orange: #E8600A;
  --brand-orange-dark: #B84507;
  --brand-orange-soft: #fff3eb;
  --brand-navy: #1a2f5a;
  --brand-navy-deep: #14274d;
  --brand-gold: #f4a44a;
  --brand-heading: #0d2456;
  --ink: #2c3e5a;
  --ink-muted: #6b7a8d;
  --ok: #00805a; --ok-bg: #e6f7ef;
  --warn: #c45008; --warn-bg: #fff3eb;
  --err: #c00; --err-bg: #fce8e8;
  --info: #1B3A8C; --info-bg: #e9eef7;
  --surface: #fff; --surface-2: #f9fafb; --app-bg: #f4f7fb;
  --radius-md: 8px; --radius-lg: 12px; --radius-pill: 999px;
  --font-xs: 0.75rem; --font-sm: 0.85rem; --font-md: 0.95rem; --font-lg: 1.1rem; --font-xl: 1.25rem;
  --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --font: Calibri, Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-width: 320px; font-family: var(--font); line-height: 1.5;
  color: var(--ink); background: var(--app-bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-orange); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: var(--brand-navy); padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius-md) 0; z-index: 20; font-weight: 600; }
.skip-link:focus { left: 0; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.85rem 1.5rem; background: var(--brand-navy); color: #fff;
}
.topbar .brand { display: flex; flex-direction: column; text-decoration: none; }
.eyebrow { margin: 0; color: var(--brand-gold); font-size: var(--font-sm); letter-spacing: 0.08em; text-transform: uppercase; }
.topbar h1 { margin: 0.1rem 0 0; font-size: 1.4rem; color: #fff; }
.nav-user { display: flex; align-items: center; gap: var(--space-3); font-size: var(--font-sm); }
.nav-user-name { color: #cdd7e6; }
.nav-signout { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.28); border-radius: var(--radius-pill); padding: 4px var(--space-3); }
.nav-signout:hover { background: rgba(255,255,255,0.12); }

/* Grouped primary navigation, a distinct bar under the brand topbar. */
.nav-links {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 var(--space-5);
  padding: 0 1.5rem; background: var(--brand-navy-deep);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
}
.nav-group { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-4); position: relative; }
.nav-group + .nav-group { padding-left: var(--space-5); }
.nav-group + .nav-group::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(255,255,255,0.14); }
.nav-group-label { color: var(--brand-gold); font-size: var(--font-xs); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; opacity: 0.85; align-self: center; }
.nav-link {
  color: #c3cfe0; text-decoration: none; font-size: var(--font-md); font-weight: 600;
  padding: 0.7rem 0; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; border-bottom-color: var(--brand-orange); }

.page-container { max-width: 1000px; margin: 0 auto; padding: var(--space-5); }
.page-header { margin-bottom: var(--space-5); }
.page-header h2 { margin: 0; font-size: var(--font-xl); font-weight: 700; color: var(--brand-navy); }
.page-header .page-desc { margin: var(--space-2) 0 0; font-size: var(--font-sm); color: var(--ink-muted); max-width: 72ch; }

.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: 0 4px 16px rgba(26,47,90,0.06); margin-bottom: var(--space-5); }
.card h3 { margin: 0 0 var(--space-4); font-size: var(--font-lg); color: var(--brand-navy); }
.card .card-eyebrow { margin: 0 0 var(--space-2); color: var(--brand-orange); font-size: var(--font-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
/* Optional supporting line directly under a card-eyebrow / card h3. */
.card-desc { margin: 0 0 var(--space-4); margin-top: calc(-1 * var(--space-2)); font-size: var(--font-sm); color: var(--ink-muted); max-width: 74ch; }
/* Header row inside a card: title/eyebrow on the left, actions/status on the right. */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.card-head > :first-child { margin-bottom: 0; }
.card-head .card-eyebrow, .card-head h3 { margin-bottom: 0; }

/* Section heading between cards (e.g. "Menus", "Voicemail boxes"). */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-6) 0 var(--space-4); }
.section-head:first-child { margin-top: 0; }
.section-head h3 { margin: 0; font-size: var(--font-lg); color: var(--brand-navy); }
.section-head .section-eyebrow { display: block; color: var(--brand-orange); font-size: var(--font-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; margin-bottom: 2px; }
.section-head .section-desc { margin: 2px 0 0; font-size: var(--font-sm); color: var(--ink-muted); max-width: 74ch; }

.btn, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border-radius: var(--radius-pill); padding: 0 var(--space-5); height: 38px;
  font-size: var(--font-sm); font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }
.btn:hover { background: var(--brand-orange-dark); border-color: var(--brand-orange-dark); }
.btn-secondary { background: var(--surface); color: var(--brand-navy); border-color: #c8d2e1; }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand-navy); }
.btn-ghost:hover { background: var(--brand-orange-soft); }
.btn:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }

.muted { color: var(--ink-muted); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--space-2); border-radius: var(--radius-pill); font-size: var(--font-xs); font-weight: 600; border: 1px solid transparent; }
.pill.is-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.pill.is-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.pill.is-err { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.pill.is-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.pill.is-quiet { background: transparent; color: var(--ink-muted); border-color: #c8d2e1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); }
.stat { background: var(--surface-2); border: 1px solid #edf1f6; border-radius: var(--radius-lg); padding: var(--space-4); }
.stat .stat-num { font-size: 1.8rem; font-weight: 700; color: var(--brand-navy); }
.stat .stat-label { font-size: var(--font-sm); color: var(--ink-muted); }

label.field { display: block; margin-bottom: var(--space-5); }
label.field .field-label { display: block; font-weight: 600; color: var(--brand-navy); margin-bottom: 4px; }
label.field .field-help { display: block; font-size: var(--font-sm); color: var(--ink-muted); margin-bottom: var(--space-2); max-width: 70ch; }
input[type=text], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 0 var(--space-3); height: 38px; border-radius: var(--radius-md);
  border: 1px solid #c8d2e1; font-size: var(--font-sm); background: var(--surface); color: var(--ink);
}
/* Numeric inputs (hours, seconds, counts) read better constrained rather than full-width. */
input[type=number] { max-width: 9rem; }
input[type=time] { width: auto; padding: 0 var(--space-3); height: 38px; border-radius: var(--radius-md); border: 1px solid #c8d2e1; font-size: var(--font-sm); background: var(--surface); color: var(--ink); }
input[type=time]:focus { outline: 2px solid var(--brand-orange); outline-offset: 0; border-color: var(--brand-orange); }
.block-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.block-to { color: var(--ink-muted); font-size: var(--font-sm); }
.day-card.is-closed .day-hours { display: none; }
.day-card .day-hours { margin-top: var(--space-3); }
.hol-when { color: var(--ink-muted); font-size: var(--font-sm); }
.hol-card .hol-hours { margin-top: var(--space-3); }
.hol-card.is-closed .hol-hours { display: none; }
.editor-legend { font-size: var(--font-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--brand-orange); margin: var(--space-3) 0 var(--space-2); }
textarea { height: auto; padding: var(--space-3); font-family: var(--font); line-height: 1.5; }
textarea.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: var(--font-sm); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-orange); outline-offset: 0; border-color: var(--brand-orange); }
input::placeholder, textarea::placeholder { color: #9aa8ba; }
.field-optional { font-weight: 400; color: var(--ink-muted); font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.04em; margin-left: 6px; }
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); }
.toggle input { width: auto; height: auto; }
/* Toggle rendered as a bordered control row so on/off state is obvious. */
label.field .toggle { padding: 0; }
.switch-field { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid #e1e8f1; border-radius: var(--radius-md); background: var(--surface-2); }
.switch-field input { width: auto; height: auto; }
.switch-field .switch-text { font-size: var(--font-sm); color: var(--ink); }

/* Responsive field grids used by the JS editors and forms. */
.field-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field-grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field-grid label.field, .field-grid-2 label.field { margin-bottom: 0; }

.fieldset { border: none; padding: 0; margin: 0 0 var(--space-6); }
.fieldset > legend { font-size: var(--font-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--brand-orange); margin-bottom: var(--space-2); padding: 0; }
.fieldset > .fieldset-desc { font-size: var(--font-sm); color: var(--ink-muted); margin: 0 0 var(--space-4); max-width: 74ch; }

/* Definition list for read-only detail metadata (call detail, etc.). */
.def-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.def-list dt { color: var(--ink-muted); font-size: var(--font-sm); }
.def-list dd { margin: 0; color: var(--ink); font-weight: 600; }
.def-list dd.mono { font-weight: 400; }

.row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid #edf1f6; align-items: baseline; }
.row:last-child { border-bottom: none; }
.row .row-main { font-weight: 600; color: var(--brand-navy); }
.row .row-sub { font-size: var(--font-sm); color: var(--ink-muted); }
.row .row-right { text-align: right; white-space: nowrap; }
a.row-link { text-decoration: none; color: inherit; display: block; }
a.row-link:hover .row-main { color: var(--brand-orange); }

/* Collapsible settings groups: closed = a scannable index row (title + short
   description); open = the fields. */
.settings-group > summary { cursor: pointer; list-style: none; line-height: 1.45; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group .sg-title { font-weight: 700; display: inline; }
.settings-group .sg-title::before { content: "\25B8"; margin-right: 8px; color: var(--ink-muted); }
.settings-group[open] .sg-title::before { content: "\25BE"; }
.settings-group .sg-desc { color: var(--ink-muted); font-size: var(--font-sm); }
.settings-group[open] > summary { margin-bottom: var(--space-3); }

.transcript { display: grid; gap: var(--space-3); }
/* Compact speaker-separated recording transcript: plain lines, no bubbles —
   just a bold colored name per turn so the two voices are easy to follow. */
.tx-dialog { font-size: var(--font-md); line-height: 1.45; }
/* One blank line between turns so the back-and-forth reads smoothly. */
.tx-dialog .tx-line { margin: 0 0 0.9em; }
.tx-dialog .tx-line:last-child { margin-bottom: 0; }
.tx-dialog .tx-who { font-weight: 700; }
.tx-dialog .tx-line.agent .tx-who { color: #1d4ed8; }
.tx-dialog .tx-line.caller .tx-who { color: #b45309; }
.bubble { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); max-width: 80%; font-size: var(--font-md); }
.bubble.caller { background: var(--surface-2); border: 1px solid #edf1f6; justify-self: start; }
.bubble.agent { background: var(--info-bg); justify-self: end; }
.bubble .who { display: block; font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); margin-bottom: 2px; }

.banner { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--font-sm); margin-bottom: var(--space-5); }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-left: 3px solid var(--ok); }
.banner.err { background: var(--err-bg); color: var(--err); border-left: 3px solid var(--err); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-left: 3px solid var(--warn); }

/* Live save/feedback messages render into #banner. Show them as a fixed toast so
   confirming a change never scrolls or shifts the page — the toast overlays,
   auto-dismisses (see BANNER_SCRIPT), and leaves the layout exactly where it was. */
#banner:empty { display: none; }
#banner > .banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200;
  margin: 0; width: max-content; max-width: min(560px, calc(100vw - 32px));
  box-shadow: 0 8px 28px rgba(16, 32, 64, 0.22);
  animation: banner-in 140ms ease-out;
}
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty-state { padding: var(--space-6); background: var(--surface-2); border: 1px dashed #c8d2e1; border-radius: var(--radius-lg); color: var(--ink-muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* Voicemail transcript block. */
.vm-transcript { background: var(--surface-2); border: 1px solid #edf1f6; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); color: var(--ink); font-size: var(--font-md); line-height: 1.5; }

/* Sticky action toolbar for editor pages (Save / status / secondary action). */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.action-bar { position: sticky; bottom: 0; z-index: 5; background: var(--app-bg); padding: var(--space-3) 0; margin-top: var(--space-4); border-top: 1px solid #e1e8f1; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* Collapsible list items (Sounds, and Call-flow menus/boxes): a compact one-line
   summary that expands on click. Native <details>/<summary> — no JS needed. */
details.collapse-item {
  border: 1px solid #e1e8f1; border-left: 3px solid var(--brand-orange);
  border-radius: var(--radius-md); background: var(--surface); margin-bottom: var(--space-2);
}
details.collapse-item > summary {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none;
  font-size: var(--font-md);
}
details.collapse-item > summary::-webkit-details-marker { display: none; }
details.collapse-item > summary::before {
  content: "▸"; color: var(--ink-muted); font-size: 12px; line-height: 1;
  transition: transform 120ms ease;
}
details.collapse-item[open] > summary::before { transform: rotate(90deg); }
details.collapse-item[open] > summary { border-bottom: 1px solid #eef2f7; }
details.collapse-item > summary:hover { background: var(--surface-2); border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md); }
/* Right-aligned metadata / actions in a collapsed summary. */
.collapse-hint { margin-left: auto; font-size: var(--font-xs); color: var(--ink-muted); }
.collapse-hint + .collapse-del { margin-left: var(--space-2); }
.collapse-del { margin-left: auto; }
.collapse-body { padding: var(--space-3) var(--space-4) var(--space-4); }
.sound-title { font-weight: 600; color: var(--ink); }
.sound-file { margin-left: auto; font-size: var(--font-xs); color: var(--ink-muted); }
.sound-usage { margin: 0 0 var(--space-3); font-size: var(--font-sm); color: var(--navy); }
.sound-usage.muted { color: var(--ink-muted); }

/* Editor "item" cards (a menu, an extension, a voicemail box) with a titled header. */
.editor-card { border-left: 3px solid var(--brand-orange); }
.editor-card > .editor-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.editor-card > .editor-head .editor-title { font-size: var(--font-lg); font-weight: 700; color: var(--brand-navy); }
.editor-card > .editor-head .editor-kind { display: block; font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-orange); font-weight: 700; }

/* IVR keypad option rows: "Press [N] → does [action]". */
.opt-list { display: grid; gap: var(--space-2); }
.opt-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; background: var(--surface-2); border: 1px solid #e6ecf4; border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.opt-row.fallback-row { background: var(--info-bg); border-color: transparent; }
.opt-row .opt-key { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; border-radius: var(--radius-md); background: var(--brand-navy); color: #fff; font-weight: 700; font-size: var(--font-sm); }
.opt-row select, .opt-row input { height: 34px; }
.opt-row input[data-f="opt-digit"] { width: 3.2rem; text-align: center; font-weight: 700; }
.opt-row .opt-lead { font-size: var(--font-sm); color: var(--ink-muted); }
.opt-row .opt-arrow { color: var(--ink-muted); font-weight: 700; }
.editor-legend { font-size: var(--font-xs); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--brand-orange); margin: var(--space-4) 0 var(--space-2); }
.editor-legend-desc { font-size: var(--font-sm); color: var(--ink-muted); margin: 0 0 var(--space-3); }
/* Member checkbox chips for ring groups. */
.member-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px var(--space-3); border: 1px solid #d3dce8; border-radius: var(--radius-pill); background: var(--surface); font-size: var(--font-sm); cursor: pointer; }
.member-chip input { width: auto; height: auto; }

/* Inline "?" info tooltip: a small circular trigger + a popover that appears on
   hover, keyboard focus, or click (click toggle handled by a shared script). */
.infotip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.infotip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem; padding: 0; border-radius: var(--radius-pill);
  border: 1px solid #c8d2e1; background: var(--surface); color: var(--ink-muted);
  font-size: var(--font-xs); font-weight: 700; line-height: 1; cursor: help;
}
.infotip-btn:hover, .infotip-btn:focus-visible { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.infotip-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: min(280px, 78vw);
  background: var(--brand-navy); color: #fff; text-align: left; font-weight: 400;
  font-size: var(--font-xs); line-height: 1.45; text-transform: none; letter-spacing: normal;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(13,36,86,0.28);
  opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
}
.infotip-pop::before {
  content: ""; position: absolute; left: 8px; bottom: 100%;
  border: 5px solid transparent; border-bottom-color: var(--brand-navy);
}
.infotip:hover .infotip-pop, .infotip:focus-within .infotip-pop, .infotip.open .infotip-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
/* Keep the popover on-screen near the right edge on narrow viewports. */
@media (max-width: 520px) {
  .infotip-pop { left: auto; right: 0; }
  .infotip-pop::before { left: auto; right: 8px; }
}

/* Centered login card */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-5); }
.login-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 8px 28px rgba(26,47,90,0.12); padding: var(--space-6); max-width: 24rem; width: 100%; text-align: center; }
.login-card .eyebrow { color: var(--brand-orange); }
.login-card h1 { color: var(--brand-navy); margin: var(--space-2) 0 var(--space-4); font-size: 1.5rem; }
.login-card p { color: var(--ink-muted); font-size: var(--font-sm); margin: 0 0 var(--space-5); }
.login-card .btn, .login-card .btn-secondary { width: 100%; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 0.75rem 1rem; }
  .nav-links { padding: 0 1rem; gap: 0 var(--space-4); }
  .nav-group { width: 100%; padding: var(--space-2) 0; }
  .nav-group + .nav-group { padding-left: 0; border-top: 1px solid rgba(255,255,255,0.1); }
  .nav-group + .nav-group::before { display: none; }
  .nav-group-label { width: 100%; margin-bottom: 2px; }
  .nav-link { padding: 0.4rem 0; }
  .page-container { padding: var(--space-4); }
  .card { padding: var(--space-4); }
  .bubble { max-width: 100%; }
  .def-list { grid-template-columns: 1fr; gap: 0; }
  .def-list dt { margin-top: var(--space-3); }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar .btn, .action-bar .btn-secondary { width: 100%; }
}
@media (max-width: 400px) {
  .topbar h1 { font-size: 1.15rem; }
  .opt-row { gap: var(--space-2) 6px; }
}

/* ── Guided call-flow outline editor ──────────────────────────────────────── */
.flow-outline-wrap { margin-bottom: var(--space-5); }
.flow-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid #d3dbe8; border-radius: var(--radius-pill); padding: 3px; gap: 2px; margin-bottom: var(--space-4); }
.flow-tab { border: 0; background: transparent; color: var(--ink-muted); font-weight: 600; font-size: var(--font-sm); padding: 6px var(--space-4); border-radius: var(--radius-pill); cursor: pointer; }
.flow-tab.on { background: var(--surface); color: var(--brand-navy); box-shadow: 0 1px 3px rgba(26,47,90,0.12); }
.flow-outline { }
.ol-node { background: var(--surface); border: 1px solid #d8e0ec; border-left: 3px solid #c8d2e1; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin: var(--space-2) 0; }
.ol-entry { border-left-color: var(--brand-navy); background: #f4f7ff; }
.ol-branch { border-left-color: var(--brand-orange); }
.ol-menu { border-left-color: #2b7fc4; }
.ol-node-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ol-kind { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--ink-muted); }
.ol-name { font-weight: 700; color: var(--brand-navy); border: 1px solid transparent; background: transparent; height: 28px; padding: 0 4px; border-radius: var(--radius-sm); min-width: 140px; }
.ol-name:hover, .ol-name:focus { border-color: #c8d2e1; background: var(--surface); }
.ol-entry-desc { font-size: var(--font-sm); color: var(--ink-muted); }
.ol-del { margin-left: auto; }
/* indentation guide for nested steps */
.ol-children { margin-left: var(--space-4); padding-left: var(--space-4); border-left: 2px dashed #d3dbe8; }
.ol-children.ol-root { margin-left: 0; padding-left: 0; border-left: 0; }
.ol-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 5px 0; font-size: var(--font-sm); }
.ol-ref { padding: 4px 0 4px var(--space-2); font-size: var(--font-sm); color: var(--brand-navy); }
.ol-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin: var(--space-2) 0; }
.ol-fields .field { margin: 0; }
.ol-vm { border-top: 1px solid #edf1f6; padding: var(--space-2) 0; }
.ol-vm:first-child { border-top: 0; }
.act-widget { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ol-row select, .ol-row input, .ol-fields select, .ol-fields input { height: 30px; font-size: var(--font-sm); width: auto; }
.ol-fields input, .ol-fields select { width: 100%; }
.ol-ac, .ol-digit { text-align: center; }
.ol-add, .ol-mini { height: 28px; padding: 0 var(--space-3); margin: var(--space-2) 0; font-size: var(--font-sm); }
.ol-mini { height: 24px; padding: 0 var(--space-2); }
.flow-outline .opt-lead { color: var(--ink-muted); font-size: var(--font-sm); }
/* funnel-specific */
.ol-when { display: flex; align-items: center; gap: var(--space-2); }
.ol-splitrow { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; font-size: var(--font-sm); color: var(--ink); font-weight: 500; cursor: pointer; }
.ol-lane { margin: var(--space-2) 0; }
.ol-cond-fixed { font-weight: 700; color: var(--brand-navy); }
.ol-response { margin: var(--space-2) 0 var(--space-2) var(--space-4); padding-left: var(--space-4); border-left: 2px dashed #d3dbe8; }
.ol-step { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.ol-step-n { display: inline-block; min-width: 88px; font-size: var(--font-xs); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; color: var(--brand-orange); }
.ol-pri { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: 10px; font-weight: 700; margin-right: 4px; }
.ol-ctrls { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.ol-mv { height: 24px; min-width: 24px; padding: 0 6px; font-size: 13px; line-height: 1; }
.ol-mv:disabled { opacity: 0.3; cursor: default; }
