/* Parla — dashboard styles */
@font-face { font-family: "Manrope"; src: url(fonts/manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url(fonts/manrope-ext.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #14213D;          /* navy: navigation, headings */
  --lagoon: #2563EB;       /* primary blue: actions, agent messages */
  --lagoon-600: #1D4ED8;
  --lagoon-50: #EAF1FF;
  --marigold: #F59E0B;     /* attention: unread, waiting */
  --marigold-50: #FEF3C7;
  --amber-ink: #8A4B05;
  --ember: #DC4B3E;        /* urgent: long waits, errors */
  --ember-50: #FDECEA;
  --leaf: #16A34A;         /* online */
  --plane: #F4F7FB;
  --paper: #FFFFFF;
  --text: #14213D;
  --text-2: #5A6782;
  --text-3: #8792A8;
  --line: #E2E8F2;
  --line-2: #EEF2F8;
  --note: #FFF8E1;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --shadow-pop: 0 12px 32px rgba(20, 33, 61, .16), 0 2px 6px rgba(20, 33, 61, .08);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Manrope", system-ui, sans-serif;
  --rail: 50px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/1.45 var(--font); color: var(--text); background: var(--plane); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lagoon); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.015em; margin: 0; color: var(--ink); }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 19px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.3; font-family: var(--font); font-weight: 650; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--paper); color: var(--text); font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--line-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--lagoon); border-color: var(--lagoon); color: #fff; }
.btn-primary:hover { background: var(--lagoon-600); }
.btn-danger { color: var(--ember); }
.btn-danger:hover { background: var(--ember-50); border-color: #F0C2B9; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.icon-btn { width: 36px; padding: 0; }
.btn svg, .icon-btn svg { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field > span { font-weight: 550; font-size: 13px; color: var(--text); }
.field small { color: var(--text-2); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea, .input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-50); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23586866' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--lagoon); flex: none; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #CBD5E1; border-radius: 20px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--lagoon); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--lagoon); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-weight: 550; color: var(--text-2); font-size: 13px; }
.seg button[aria-pressed=true] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,44,43,.12); }

.badge { display: inline-flex; align-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--lagoon); color: #fff; font-size: 11.5px; font-weight: 700; justify-content: center; font-variant-numeric: tabular-nums; }
.pill svg { width: 12px; height: 12px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill.on { background: #DCFCE7; color: #166534; }
.pill.bot { background: var(--lagoon-50); color: var(--lagoon-600); }
.pill.solved { background: var(--lagoon-50); color: var(--lagoon-600); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #B8C4C1; display: inline-block; flex: none; }
.dot.on { background: var(--leaf); }
.dot.away { background: var(--marigold); }

/* ---------- Avatars & the waiting ring ---------- */
.avatar { --size: 36px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: calc(var(--size) * .38); color: #fff; flex: none; position: relative; text-transform: uppercase; }
.avatar svg { width: 52%; height: 52%; }
.avatar .presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--paper); background: #B8C4C1; }
.avatar .presence.on { background: var(--leaf); }
/* The ring fills as the visitor waits for a reply: marigold up to 3 min, ember after. */
.wait-ring { position: relative; padding: 3px; border-radius: 50%; background: conic-gradient(var(--ring-color, var(--marigold)) calc(var(--wait, 0) * 1turn), var(--line-2) 0); flex: none; }
.wait-ring.urgent { --ring-color: var(--ember); }
.wait-ring .avatar { box-shadow: 0 0 0 2px var(--paper); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; height: 100vh; height: 100dvh; }
.rail { background: var(--ink); color: #B6C2DA; display: flex; flex-direction: column; align-items: center; padding: 10px 0 10px; gap: 6px; position: relative; z-index: 30; }
.rail .logo { width: 32px; height: 32px; margin-bottom: 10px; display: block; }
.rail a, .rail button.rail-btn { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; color: #B6C2DA; text-decoration: none; position: relative; border: 0; background: transparent; cursor: pointer; }
.rail a svg, .rail button.rail-btn svg { width: 19px; height: 19px; }
.rail a:hover, .rail button.rail-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.rail a[aria-current=page] { color: #fff; background: var(--lagoon); }
.rail .badge { position: absolute; top: -5px; right: -6px; height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--ink); background: var(--marigold); color: var(--ink); font-weight: 800; }
.rail .tip { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 18px rgba(20,33,61,.25); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 40; }
.rail .tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: var(--ink); transform: translateY(-50%) rotate(45deg); }
.rail a:hover .tip, .rail a:focus-visible .tip, .rail .me:hover .tip, .rail .me:focus-visible .tip { opacity: 1; }
.rail a:focus-visible, .rail .me:focus-visible { outline: 2px solid #93C5FD; outline-offset: 2px; }
.rail .spacer { flex: 1; }
.rail .me { margin-top: 4px; border: 0; background: none; padding: 2px; cursor: pointer; border-radius: 50%; position: relative; }
.rail .me .avatar .presence { border-color: var(--ink); }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar h1 { font-size: 21px; }
.topbar .grow { flex: 1; }
.site-select { width: auto; min-width: 170px; height: 34px; }
.page { flex: 1; overflow: auto; padding: 24px; }
.page-narrow { max-width: 960px; }

/* ---------- Inbox (views nav | list | thread | customer panel) ---------- */
.ibx { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); background: var(--plane); }
.ibx.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.ibx-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 20px 0 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.ibx-top h1 { font-size: 21px; margin-right: 8px; }
.ibx-top .grow { flex: 1; }
.ibx-search { position: relative; width: min(360px, 34vw); }
.ibx-search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--text-3); }
.ibx-search input { padding-left: 34px; height: 34px; background: var(--plane); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

.ibx-nav { grid-column: 1; grid-row: 2; overflow-y: auto; padding: 14px 10px 20px; min-width: 0; }
.ibx.nav-collapsed .ibx-nav { visibility: hidden; padding: 0; }
.ibx-scrim { display: none; }
.nav-head { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 14px 10px 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; border-radius: 6px; }
.nav-head:first-child { padding-top: 2px; }
.nav-head svg { width: 15px; height: 15px; transition: transform .15s; }
.nav-head[aria-expanded=false] svg { transform: rotate(-90deg); }
.nav-group { display: grid; gap: 1px; }
.nav-gap { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--text); font-weight: 550; font-size: 13.5px; cursor: pointer; text-align: left; }
.nav-item > svg { width: 17px; height: 17px; color: var(--text-2); flex: none; }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .cnt { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav-item .cnt.alert { background: var(--marigold); color: var(--ink); border-radius: 9px; padding: 1px 7px; }
.nav-item:hover { background: #E8EEF7; }
.nav-item[aria-pressed=true] { background: var(--paper); color: var(--lagoon-600); box-shadow: 0 1px 2px rgba(20,33,61,.08), inset 0 0 0 1px var(--line); }
.nav-item[aria-pressed=true] > svg { color: var(--lagoon); }
.nav-item .avatar { font-size: 9.5px; }
.nav-item .avatar .presence { width: 8px; height: 8px; border-width: 1.5px; border-color: var(--plane); }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px 0 3px; }

.ibx-box { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 330px minmax(0, 1fr) 320px; min-height: 0; margin: 12px 12px 12px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; box-shadow: 0 1px 2px rgba(20,33,61,.04); }
.ibx.nav-collapsed .ibx-box { margin-left: 12px; }
.ibx.side-collapsed .ibx-box, .ibx.no-conv .ibx-box { grid-template-columns: 330px minmax(0, 1fr); }
.ibx.side-collapsed .ibx-side, .ibx.no-conv .ibx-side { display: none; }

.ibx-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.ibx-list-head { display: flex; align-items: baseline; gap: 8px; padding: 16px 16px 10px; }
.ibx-list-head h2 { font-size: 17px; }
.conv-list { flex: 1; overflow-y: auto; overflow-x: hidden; list-style: none; margin: 0; padding: 0 8px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; align-content: start; }
.conv-list > li { min-width: 0; }
.conv-item { min-width: 0; display: flex; gap: 10px; padding: 10px 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; text-decoration: none; color: inherit; border: 1px solid transparent; }
.conv-item:hover { background: var(--plane); }
.conv-item[aria-current=true] { background: var(--lagoon-50); border-color: #CBDBFB; }
.conv-item .body { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.conv-item .body > * { min-width: 0; }
.conv-item .row1 { display: flex; align-items: baseline; gap: 8px; }
.conv-item .who { min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.conv-item .when { font-size: 12px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.conv-item .badge { height: 18px; min-width: 18px; font-size: 11px; background: var(--marigold); color: var(--ink); font-weight: 800; }
.conv-item .preview { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.conv-item.unread .preview { color: var(--text); font-weight: 600; }
.conv-item .row3 { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.conv-item .chips { flex: 1; min-width: 0; display: flex; gap: 5px; flex-wrap: wrap; }
.conv-item .chips:empty + .avatar.mini { margin-left: auto; }
.avatar.mini { font-size: 9.5px; }
.avatar.av-empty { background: var(--paper); color: var(--text-3); border: 1.5px dashed #C3CDDD; }
.avatar.bot { background: #ECE9FB; color: #5B4BC4; }
.typing-txt { color: var(--lagoon); font-style: italic; }
.list-empty { padding: 26px 12px 40px; text-align: center; color: var(--text-2); }
.list-empty h3 { font-size: 15px; }
.list-empty p { margin: 0 auto; max-width: 260px; font-size: 13.5px; line-height: 1.5; }
.list-empty h3 { margin-bottom: 6px; }

.ibx-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.thread-head { height: 64px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.thread-head .title { flex: 1; min-width: 0; margin-right: 6px; }
.thread-head .title h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .title .sub { font-size: 12.5px; color: var(--text-2); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.thread-head .back { display: none; }
.thread-head .icon-btn[aria-pressed=true] { color: var(--lagoon); background: var(--lagoon-50); }
.assign-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 18px; cursor: pointer; font-weight: 600; font-size: 13px; max-width: 200px; margin-right: 4px; }
.assign-btn:hover { border-color: #C3CDDD; }
.assign-btn > span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-btn > svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.assign-btn .avatar { font-size: 9.5px; }
.notif-banner { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 20px; background: var(--marigold-50); color: var(--amber-ink); font-size: 13.5px; border-bottom: 1px solid #F6DFA0; }
.notif-banner > svg { width: 17px; height: 17px; flex: none; }
.notif-banner > span { flex: 1; }
.linklike { border: 0; background: none; padding: 0; color: var(--lagoon-600); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.notif-banner .linklike { color: inherit; }
.bot-banner { display: flex; align-items: center; gap: 10px; padding: 9px 20px; background: var(--lagoon-50); border-bottom: 1px solid #CFDDFB; font-size: 13.5px; color: var(--lagoon-600); }
.bot-banner > svg { width: 16px; height: 16px; }
.bot-banner .grow { flex: 1; }

.messages { flex: 1; overflow-y: auto; padding: 16px 24px 10px; display: flex; flex-direction: column; }
.day-sep { align-self: center; margin: 16px 0 10px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.mrow { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; margin-top: 14px; max-width: 760px; }
.mrow.cont { margin-top: 4px; }
.mcol { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.mhead { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.mhead b { font-weight: 700; color: var(--ink); }
.mhead time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mtag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.mtag svg { width: 12px; height: 12px; }
.mrow .bubble { padding: 8px 12px; border-radius: 4px 12px 12px 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; background: var(--plane); max-width: 100%; }
.mrow.visitor .bubble { background: #F1F4F9; }
.mrow.agent .bubble { background: #E6EEFD; }
.mrow.bot .bubble { background: #F0EEFB; }
.mrow.note .bubble { background: var(--note); border: 1px solid #F3E2A6; }
.mrow .quick { display: flex; flex-wrap: wrap; gap: 6px; }
.mrow .quick span { border: 1px solid #B9C8E6; border-radius: 14px; padding: 3px 10px; font-size: 12.5px; color: var(--lagoon-600); background: var(--paper); }
.mrow .attach { display: block; max-width: 280px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.mrow .attach img { display: block; max-width: 100%; max-height: 260px; object-fit: cover; }
.mrow .file { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.mrow .file svg { width: 16px; height: 16px; }
.mcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 300px; display: grid; background: var(--paper); }
.mcard img { width: 100%; max-height: 160px; object-fit: cover; display: block; }
.mcard-b { padding: 10px 12px; }
.mcard-b p { margin: 4px 0 0; color: var(--text-2); white-space: pre-wrap; }
.mcard > a, .mcard > span { border-top: 1px solid var(--line); padding: 8px 12px; text-align: center; font-weight: 600; color: var(--lagoon-600); text-decoration: none; font-size: 13px; }
.sys { align-self: center; font-size: 12.5px; font-style: italic; color: var(--text-3); padding: 10px 0 2px; text-align: center; }
.seen-line { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); padding: 4px 0 0 44px; }
.seen-line svg { width: 13px; height: 13px; color: var(--lagoon); }
.typing-line { padding: 2px 24px 6px 68px; font-size: 12.5px; color: var(--text-2); min-height: 24px; }
.typing-line .draft { color: var(--text-3); font-style: italic; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.composer { flex: none; margin: 0 16px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); position: relative; box-shadow: 0 1px 3px rgba(20,33,61,.05); }
.composer:focus-within { border-color: #B7CBF5; }
.composer.note-mode { background: var(--note); border-color: #F3E2A6; }
.composer-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px 0; min-height: 38px; flex-wrap: wrap; }
.mode-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-weight: 650; font-size: 13px; cursor: pointer; }
.mode-btn svg { width: 15px; height: 15px; }
.mode-btn svg:last-child { color: var(--text-3); }
.composer-notice { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); flex: none; }
.email-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.email-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--lagoon); }
.composer textarea { border: 0; box-shadow: none; resize: none; min-height: 64px; max-height: 220px; padding: 8px 14px; background: transparent; display: block; width: 100%; }
.composer textarea:focus { box-shadow: none; outline: none; }
.composer-bar { display: flex; align-items: center; gap: 2px; padding: 2px 8px 8px; }
.composer-bar .grow { flex: 1; }
.composer-bar .hint { font-size: 12px; color: var(--text-3); margin-right: 10px; }
.composer-bar .btn-primary svg { width: 16px; height: 16px; }
.canned-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 260px; overflow-y: auto; padding: 6px; z-index: 5; }
.canned-pop button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.canned-pop button[aria-selected=true], .canned-pop button:hover { background: var(--lagoon-50); }
.canned-pop b { color: var(--lagoon); font-weight: 650; flex: none; }
.canned-pop span:not(.avatar) { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canned-pop .avatar { font-size: 9.5px; }
.emoji-pop { position: fixed; z-index: 60; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; padding: 8px; }
.emoji-pop button { width: 34px; height: 34px; border: 0; background: none; border-radius: 6px; font-size: 19px; cursor: pointer; padding: 0; }
.emoji-pop button:hover { background: var(--line-2); }
.pending-file { display: flex; align-items: center; gap: 8px; margin: 6px 12px 0; padding: 6px 10px; background: var(--plane); border-radius: 8px; font-size: 13px; }
.pending-file svg { width: 16px; height: 16px; }
.dropping .composer { border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-50); }

.empty-thread { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 32px; color: var(--text-2); overflow-y: auto; }
.empty-thread > div { max-width: 460px; }
.empty-thread .art { width: min(320px, 100%); display: block; margin: 0 auto 26px; }
.empty-thread h2 { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 8px; color: var(--ink); }
.empty-thread p { margin: 0 auto 20px; font-size: 15px; line-height: 1.55; max-width: 400px; }
.empty-thread .btn-primary { height: 40px; padding: 0 18px; }
.float-a { animation: floatA 6s ease-in-out infinite; }
.float-b { animation: floatB 7s ease-in-out infinite; }
@keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .float-a, .float-b { animation: none; } }
.tip-card { display: flex; align-items: center; gap: 14px; text-align: left; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plane); }
.tip-card > div { flex: 1; display: grid; gap: 2px; font-size: 13px; }
.tip-card b { color: var(--ink); font-size: 13.5px; }
.tip-card .btn { flex: none; }
.list-empty .skeleton { display: grid; gap: 10px; margin: 0 0 26px; padding: 4px 6px; text-align: left; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); }
.skeleton i { display: block; height: 10px; border-radius: 5px; background: #EDF1F7; }
.sk-row { display: flex; align-items: center; gap: 10px; }
.sk-row > span { flex: 1; display: grid; gap: 7px; }
.sk-row .sk-av { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.sk-row .sk-time { width: 30px; flex: none; align-self: flex-start; margin-top: 2px; }
.sk-lines { display: grid; gap: 8px; margin-bottom: 14px; }

.ibx-side { border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; background: var(--paper); }
.ibx-side .sec { border-bottom: 1px solid var(--line-2); }
.sec-head { display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 8px; }
.sec-toggle { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 8px 8px; font-weight: 700; font-size: 13.5px; color: var(--ink); cursor: pointer; border-radius: 6px; text-align: left; }
.sec-toggle:hover { background: var(--plane); }
.sec-toggle svg { width: 16px; height: 16px; color: var(--text-3); transition: transform .15s; flex: none; }
.side-close { display: none; }
.sec-toggle[aria-expanded=false] svg { transform: rotate(-90deg); }
.sec-head .icon-btn svg { width: 16px; height: 16px; }
.sec-body { padding: 0 18px 16px; }
.ibx-side .who { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ibx-side .who h3 { font-size: 16px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx-side .inline-edit { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.page-trail { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.page-trail li { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.page-trail a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-trail a:hover { color: var(--lagoon); text-decoration: underline; }
.page-trail time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.inline-edit { display: grid; gap: 8px; }
.inline-edit input { height: 34px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list .tagpill button { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; opacity: .6; }
.tag-list .tagpill button:hover { opacity: 1; }
.add-chip { border: 1px dashed #C3CDDD; background: var(--paper); cursor: pointer; color: var(--text-2); }
.add-chip svg { width: 13px; height: 13px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes li { background: var(--note); border: 1px solid #F3E2A6; border-radius: 10px; padding: 9px 11px; }
.notes p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.notes .linklike { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
[data-noteform] { margin-bottom: 10px; }
[data-noteform] textarea { width: 100%; }

/* ---------- Cards, tables, lists ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 16px; flex: 1; font-family: var(--font); font-weight: 650; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--plane); }
.tbl .url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty h3 { margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }

/* ---------- Flows list ---------- */
.flow-cards { display: grid; gap: 12px; }
.flow-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 18px; align-items: center; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); }
.flow-row .name { font-weight: 650; font-size: 15px; color: var(--ink); text-decoration: none; }
.flow-row .name:hover { text-decoration: underline; }
.flow-row .trig { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.flow-row .stat { text-align: right; min-width: 74px; }
.flow-row .stat b { display: block; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.flow-row .stat span { font-size: 12px; color: var(--text-2); }
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.template { text-align: left; padding: 16px; border-radius: var(--radius-l); border: 1px dashed #C3CEE0; background: transparent; cursor: pointer; display: grid; gap: 4px; }
.template:hover { border-style: solid; border-color: var(--lagoon); background: var(--paper); }
.template b { color: var(--ink); font-size: 14.5px; }
.template span { color: var(--text-2); font-size: 13px; }

/* ---------- Flow builder ---------- */
.builder { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr) 320px; }
.builder.no-inspector { grid-template-columns: 220px minmax(0, 1fr); }
.palette { background: var(--paper); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
.palette h3 { font-size: 13px; color: var(--text-2); margin: 4px 6px 10px; font-weight: 600; }
.palette button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--paper); padding: 9px 10px; border-radius: var(--radius); margin-bottom: 6px; cursor: grab; }
.palette button:hover { border-color: var(--node-c); background: var(--plane); }
.palette button i { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--node-c); color: #fff; flex: none; font-style: normal; }
.palette button i svg { width: 15px; height: 15px; }
.palette button b { display: block; font-weight: 600; font-size: 13.5px; }
.palette button small { display: block; color: var(--text-2); font-size: 12px; line-height: 1.3; }
.palette .tip { font-size: 12.5px; color: var(--text-2); padding: 10px 6px; line-height: 1.5; }
.canvas { position: relative; overflow: hidden; background-color: var(--plane); background-image: radial-gradient(circle, #CBD5E4 1px, transparent 1.2px); background-size: 22px 22px; cursor: grab; touch-action: none; }
.canvas.panning { cursor: grabbing; }
.canvas-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.canvas svg.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: #8EA3C7; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
.edges path:hover, .edges path.sel { stroke: var(--ember); stroke-width: 3; }
.edges path.ghost { stroke: var(--lagoon); stroke-dasharray: 6 5; pointer-events: none; }
.node { position: absolute; width: 240px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(15,44,43,.08); user-select: none; cursor: default; }
.node.sel { border-color: var(--node-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--node-c) 22%, transparent), 0 6px 18px rgba(15,44,43,.12); }
.node-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: move; border-radius: 12px 12px 0 0; }
.node-head i { width: 22px; height: 22px; border-radius: 6px; background: var(--node-c); color: #fff; display: grid; place-items: center; flex: none; font-style: normal; }
.node-head i svg { width: 13px; height: 13px; }
.node-head b { font-size: 13px; font-weight: 650; flex: 1; }
.node-body { padding: 10px 12px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 110px; overflow: hidden; }
.node-body .ph { color: var(--text-3); font-style: italic; }
.node-ports { padding: 0 0 8px; }
.node-port { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 4px 24px 4px 12px; font-size: 12.5px; color: var(--text); min-height: 26px; }
.node-port span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--plane); border-radius: 12px; padding: 2px 9px; max-width: 190px; }
.port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--node-c); cursor: crosshair; }
.port:hover, .port.hot { background: var(--node-c); transform: scale(1.2); }
.port.out { right: -8px; top: 50%; margin-top: -7px; }
.port.in { left: -8px; top: 18px; }
.node[data-type=trigger] { --node-c: #0F2C2B; }
.node[data-type=message], .palette [data-type=message] { --node-c: #2563EB; }
.node[data-type=buttons], .palette [data-type=buttons] { --node-c: #0E7490; }
.node[data-type=question], .palette [data-type=question] { --node-c: #7A4FB8; }
.node[data-type=condition], .palette [data-type=condition] { --node-c: #B07A06; }
.node[data-type=delay], .palette [data-type=delay] { --node-c: #6B7B78; }
.node[data-type=handoff], .palette [data-type=handoff] { --node-c: #2E8B4F; }
.node[data-type=end], .palette [data-type=end] { --node-c: #C8452F; }
.node[data-type=card], .palette [data-type=card], .insp-ic[data-type=card] { --node-c: #1F8A8A; }
.node[data-type=split], .palette [data-type=split], .insp-ic[data-type=split] { --node-c: #9A6B00; }
.node[data-type=goto_flow], .palette [data-type=goto_flow] { --node-c: #475A57; }
.node[data-type=set_field], .node[data-type=tag], .node[data-type=assign], .node[data-type=note], .node[data-type=notify], .node[data-type=email_visitor], .node[data-type=webhook],
.palette [data-type=set_field], .palette [data-type=tag], .palette [data-type=assign], .palette [data-type=note], .palette [data-type=notify], .palette [data-type=email_visitor], .palette [data-type=webhook] { --node-c: #3B5BA9; }
.node[data-type=open_chat], .node[data-type=redirect], .node[data-type=track],
.palette [data-type=open_chat], .palette [data-type=redirect], .palette [data-type=track] { --node-c: #8A4F7D; }
.insp-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--node-c, var(--ink)); color: #fff; flex: none; font-style: normal; }
.insp-ic svg { width: 15px; height: 15px; }
.insp-ic[data-type=message] { --node-c: #2563EB; } .insp-ic[data-type=buttons] { --node-c: #0E7490; } .insp-ic[data-type=question] { --node-c: #7A4FB8; }
.insp-ic[data-type=condition] { --node-c: #B07A06; } .insp-ic[data-type=delay] { --node-c: #6B7B78; } .insp-ic[data-type=handoff] { --node-c: #2E8B4F; } .insp-ic[data-type=end] { --node-c: #C8452F; }
.insp-ic[data-type=goto_flow] { --node-c: #475A57; }
.insp-ic[data-type=set_field], .insp-ic[data-type=tag], .insp-ic[data-type=assign], .insp-ic[data-type=note], .insp-ic[data-type=notify], .insp-ic[data-type=email_visitor], .insp-ic[data-type=webhook] { --node-c: #3B5BA9; }
.insp-ic[data-type=open_chat], .insp-ic[data-type=redirect], .insp-ic[data-type=track] { --node-c: #8A4F7D; }
.insp-sub { margin: 20px 0 4px; font-size: 14px; }
.insp-hr { border: 0; border-top: 1px solid var(--line-2); margin: 18px 0; }
.pal-search { margin: 0 0 10px; height: 34px; }
.pal-group h3 { margin-top: 14px; }
.rules { display: grid; gap: 8px; margin-bottom: 12px; }
.rule { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--plane); display: grid; gap: 6px; }
.rule-top, .rule-rest { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rule select, .rule input { height: 32px; font-size: 13px; }
.rule-top select { flex: 1; }
.rule-rest > * { flex: 1 1 110px; min-width: 0; }
.rule-join { font-size: 12px; font-weight: 650; color: var(--text-2); text-align: center; }
.time-pair { display: flex; gap: 4px; align-items: center; }
.days { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100% !important; }
.days label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; cursor: pointer; }
.days input { width: 14px; height: 14px; margin: 0; accent-color: var(--lagoon); }
.variant { width: 26px; height: 32px; display: grid; place-items: center; font-weight: 700; color: var(--text-2); flex: none; }
code.snippet { display: block; margin-top: 6px; background: var(--ink); color: #DCE6F7; padding: 8px 10px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.vars code[data-ins] { cursor: pointer; }
.vars code[data-ins]:hover { background: var(--lagoon-50); color: var(--lagoon-600); }
.pill.tagpill { background: #E8EEFA; color: #2C4A8A; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list button { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; }
.node[data-type=trigger] .node-head { background: var(--ink); color: #fff; border-bottom-color: transparent; }
.node[data-type=trigger] .node-head i { background: var(--lagoon); color: #fff; }
.canvas-tools { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; box-shadow: 0 2px 8px rgba(15,44,43,.08); z-index: 2; }
.canvas-tools .zoom { min-width: 48px; text-align: center; font-size: 12.5px; color: var(--text-2); align-self: center; font-variant-numeric: tabular-nums; }
.canvas-hint { position: absolute; left: 16px; bottom: 16px; font-size: 12.5px; color: var(--text-2); background: rgba(255,255,255,.85); padding: 6px 10px; border-radius: 8px; z-index: 2; }
.inspector { background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; padding: 18px 18px 30px; }
.inspector h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.inspector .opt-row { display: flex; gap: 6px; margin-bottom: 6px; }
.inspector .vars { font-size: 12.5px; color: var(--text-2); margin-top: -8px; margin-bottom: 14px; }
.inspector .vars code { background: var(--plane); padding: 1px 5px; border-radius: 4px; cursor: pointer; }
.flow-name { font-family: var(--display); font-weight: 650; font-size: 19px; border: 1px solid transparent; background: transparent; height: 36px; padding: 0 8px; border-radius: 6px; width: min(360px, 40vw); color: var(--ink); }
.flow-name:hover { border-color: var(--line); }
.flow-name:focus { border-color: var(--lagoon); outline: none; background: var(--paper); }
.save-state { font-size: 12.5px; color: var(--text-2); }

/* ---------- Analytics ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; margin-bottom: 20px; }
.kpi { background: var(--paper); padding: 18px 20px; display: grid; gap: 4px; }
.kpi .label { color: var(--text-2); font-size: 13px; font-weight: 550; }
.kpi .value { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; }
.kpi .delta { font-size: 12.5px; color: var(--text-2); display: flex; gap: 4px; align-items: center; }
.kpi .delta.good { color: #1F6B3B; }
.kpi .delta.bad { color: var(--ember); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-2e { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.chart-box { padding: 12px 20px 16px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: #E9EEF6; }
.chart .axis text { fill: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: #C5CFDF; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 3; box-shadow: var(--shadow-pop); }
.chart .tip b { font-weight: 650; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); padding: 0 20px 4px; flex-wrap: wrap; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; }
.heat { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--text-2); padding: 12px 20px 16px; }
.heat .c { height: 22px; border-radius: 3px; background: #EEF2F8; position: relative; }
.heat .c:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
.heat .hl { text-align: center; font-variant-numeric: tabular-nums; }
.heat .dl { align-self: center; }
.bars-list { list-style: none; margin: 0; padding: 12px 20px 18px; display: grid; gap: 10px; }
.bars-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.bars-list .bar { grid-column: 1 / -1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bars-list .bar i { display: block; height: 100%; background: var(--lagoon); border-radius: 3px; }
.bars-list .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Settings ---------- */
.settings { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.settings-nav { border-right: 1px solid var(--line); background: var(--paper); padding: 16px 10px; }
.settings-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 550; margin-bottom: 2px; }
.settings-nav a:hover { background: var(--plane); }
.settings-nav a[aria-current=page] { background: var(--lagoon-50); color: var(--lagoon-600); }
.settings-body { overflow-y: auto; padding: 28px 32px 60px; }
.settings-body > h1 { margin-bottom: 6px; }
.settings-body > .lead { color: var(--text-2); margin: 0 0 24px; max-width: 640px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.site-editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.code-box { position: relative; background: var(--ink); color: #DCE6F7; border-radius: var(--radius); padding: 14px 16px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; padding-right: 84px; }
.code-box button { position: absolute; top: 8px; right: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.preview-phone { position: sticky; top: 0; height: 560px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(#fff, #F4F7FB); overflow: hidden; }
.preview-phone .fake { padding: 22px; display: grid; gap: 10px; }
.preview-phone .fake i { display: block; height: 10px; border-radius: 5px; background: #E6ECF5; }
.section-title { margin: 28px 0 12px; font-size: 16px; font-family: var(--font); font-weight: 650; }
.team-row { display: flex; align-items: center; gap: 12px; }

/* ---------- Visitors ---------- */
.v-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); }
.login-art { background: var(--ink); color: #B6C2DA; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login-art .tagline { font-family: var(--display); font-size: clamp(34px, 4vw, 56px); line-height: 1.02; color: #fff; font-weight: 600; letter-spacing: -.03em; max-width: 520px; }
.login-art .stack { display: grid; gap: 10px; max-width: 380px; }
.login-art .b { padding: 11px 15px; border-radius: 16px; font-size: 15px; width: fit-content; max-width: 100%; }
.login-art .b.v { background: rgba(255,255,255,.1); color: #fff; border-bottom-left-radius: 4px; }
.login-art .b.a { background: var(--lagoon); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form form { width: min(380px, 100%); }
.login-form h1 { margin-bottom: 6px; }
.login-form p.lead { color: var(--text-2); margin: 0 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--display); font-weight: 650; font-size: 20px; }
.brand img { width: 34px; height: 34px; }
.err { color: var(--ember); background: var(--ember-50); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }

/* ---------- Toasts & modal ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 13.5px; animation: toastIn .18s ease-out; }
.toast.error { background: var(--ember); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }
.modal-back { position: fixed; inset: 0; background: rgba(15,44,43,.4); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--paper); border-radius: var(--radius-l); width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-pop); }
.modal-head { padding: 18px 22px 0; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 0 22px 20px; display: flex; gap: 8px; justify-content: flex-end; }
.menu { position: fixed; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; z-index: 60; min-width: 200px; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--plane); }
.menu button > svg, .menu .mi-gap { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.menu .mi-gap { display: inline-block; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }
.menu .lbl { padding: 6px 10px 2px; font-size: 12px; color: var(--text-2); }

/* ---------- Installer ---------- */
body.install { background: var(--plane); padding: 40px 16px; }
.install-card { max-width: 640px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.install-head h1 { flex: 1; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: url(icon.svg?v=1.3.1) center/cover; }
.install-lang a { margin-left: 10px; font-size: 13px; color: var(--text-2); }
.install-lang a[aria-current] { color: var(--ink); font-weight: 650; text-decoration: none; }
.lead { font-size: 15px; color: var(--text-2); }
.install-checks { background: var(--plane); border-radius: 12px; padding: 14px 18px; margin: 20px 0; }
.install-checks h2 { font-size: 14px; font-family: var(--font); margin-bottom: 8px; }
.install-checks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.install-checks li { display: flex; gap: 8px; align-items: center; }
.install-checks li.ok .dot { background: var(--leaf); }
.install-checks li.bad { color: var(--ember); font-weight: 600; }
.install-checks li.bad .dot { background: var(--ember); }
.install-form fieldset { border: 0; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.install-form legend { font-family: var(--display); font-weight: 650; font-size: 17px; color: var(--ink); margin-bottom: 12px; }
.install-form label { display: grid; gap: 6px; font-weight: 550; font-size: 13px; }
.install-form small { font-weight: 400; color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  .assign-btn > span:not(.avatar) { display: none; }
  .composer-bar .hint { display: none; }
}
@media (max-width: 1400px) {
  .ibx-box { grid-template-columns: 280px minmax(0, 1fr) 280px; }
  .ibx.side-collapsed .ibx-box, .ibx.no-conv .ibx-box { grid-template-columns: 280px minmax(0, 1fr); }
  .ibx-nav { padding-left: 8px; padding-right: 8px; }
  .ibx { grid-template-columns: 216px minmax(0, 1fr); }
  .thread-head .title { min-width: 110px; }
}
@media (max-width: 1180px) {
  .ibx, .ibx.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .ibx .ibx-box { margin-left: 12px; }
  .ibx-nav { position: fixed; z-index: 25; top: 60px; bottom: 0; left: var(--rail); width: 260px; background: var(--plane); box-shadow: var(--shadow-pop); visibility: visible; padding: 14px 10px 20px; }
  .ibx.nav-collapsed .ibx-nav { display: none; }
  .ibx:not(.nav-collapsed) .ibx-scrim { display: block; position: fixed; inset: 60px 0 0 var(--rail); z-index: 24; background: rgba(20,33,61,.25); }
  .ibx-side { position: fixed; z-index: 22; top: 72px; right: 12px; bottom: 12px; width: 320px; border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-pop); }
  .ibx-box, .ibx.side-collapsed .ibx-box, .ibx.no-conv .ibx-box { grid-template-columns: 300px minmax(0, 1fr); }
  .ibx.has-conv:not(.side-collapsed) .ibx-side { display: block; }
  .side-close { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); font-weight: 700; position: sticky; top: 0; background: var(--paper); z-index: 1; }
}
@media (max-width: 1200px) {
  .builder { grid-template-columns: 190px minmax(0, 1fr) 300px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-editor { grid-template-columns: 1fr; }
  .preview-phone { position: relative; }
}
@media (max-width: 860px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .rail .logo, .rail .spacer, .rail .tip { display: none; }
  .rail a, .rail button.rail-btn { flex: 1; width: auto; max-width: 64px; height: 44px; }
  .rail .me { margin: 0; flex: 1; display: grid; justify-items: center; max-width: 64px; }
  .topbar { padding: 0 14px; height: 54px; }
  .topbar h1 { font-size: 18px; }
  .page { padding: 16px; }
  .ibx { grid-template-rows: 54px minmax(0, 1fr); }
  .ibx-top { padding: 0 10px 0 4px; gap: 6px; }
  .ibx-top h1 { font-size: 18px; margin-right: 0; }
  .ibx-search { width: auto; flex: 1; }
  .ibx-top .grow { display: none; }
  .ibx-top .site-select { min-width: 0; width: 110px; }
  .ibx-nav { top: 54px; left: 0; bottom: 0; width: min(280px, 84vw); }
  .ibx:not(.nav-collapsed) .ibx-scrim { inset: 54px 0 0 0; }
  .ibx .ibx-box, .ibx.side-collapsed .ibx-box, .ibx.no-conv .ibx-box { margin: 0; border: 0; border-radius: 0; grid-template-columns: 1fr; }
  .ibx-list { border-right: 0; }
  .ibx .ibx-thread { display: none; }
  .ibx.has-conv .ibx-list { display: none; }
  .ibx.has-conv .ibx-thread { display: flex; }
  .ibx-side { top: 54px; left: 0; right: 0; bottom: 0; width: auto; border-radius: 0; border: 0; }
  .ibx.has-conv:not(.side-collapsed) .ibx-side { display: block; }
  .thread-head { padding: 0 6px; gap: 2px; }
  .thread-head .back { display: inline-flex; }
  .thread-head .hide-sm { display: none; }
  .assign-btn { padding: 0 4px; gap: 2px; }
  .messages { padding: 10px 12px 8px; }
  .typing-line { padding-left: 56px; }
  .composer { margin: 0 8px 8px; }
  .composer-bar .hint { display: none; }
  .builder, .builder.no-inspector { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .palette { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .palette h3, .palette .tip { display: none; }
  .palette button { width: auto; flex: none; margin: 0; padding: 6px 10px; }
  .palette button small { display: none; }
  .inspector { position: fixed; left: 0; right: 0; bottom: 0; max-height: 70vh; z-index: 20; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 24px; }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
  .flow-row { grid-template-columns: auto 1fr auto; }
  .flow-row .stat { display: none; }
  .settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .settings-nav a { white-space: nowrap; margin: 0; }
  .settings-body { padding: 20px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .tbl .hide-sm { display: none; }
  .heat { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); padding: 10px 12px; gap: 1px; }
  .flow-name { width: 46vw; font-size: 16px; }
  .topbar .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Customers (contacts) ---------- */
.cx { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--plane); }
.cx-nav { overflow-y: auto; padding: 14px 10px 20px; display: grid; gap: 1px; align-content: start; }
.cx-nav .nav-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 14px 10px 6px; }
.cx-nav .nav-label:first-child { padding-top: 2px; }
.cx-nav a.nav-item { text-decoration: none; position: relative; }
.cx-nav a.nav-item[aria-current=page] { background: var(--paper); color: var(--lagoon-600); box-shadow: 0 1px 2px rgba(20,33,61,.08), inset 0 0 0 1px var(--line); }
.cx-nav .seg-x { display: none; border: 0; background: none; padding: 2px; margin-left: 2px; color: var(--text-3); cursor: pointer; border-radius: 4px; }
.cx-nav .seg-x svg { width: 14px; height: 14px; display: block; }
.cx-nav .nav-item:hover .seg-x, .cx-nav .seg-x:focus-visible { display: block; }
.cx-nav .nav-item:hover .seg-x ~ .cnt, .cx-nav .seg-x:hover { color: var(--ember); }
.cx-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 16px 4px; }
.cx-h { font-size: 24px; letter-spacing: -0.01em; padding-left: 2px; }
.filterbar { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 10px 12px; flex-wrap: wrap; }
.fb-match { display: flex; align-items: center; gap: 6px; padding-right: 12px; border-right: 1px solid var(--line); }
.fb-match svg { width: 17px; height: 17px; color: var(--text-3); }
.fb-match select { border: 0; background-color: transparent; font-weight: 650; height: 32px; padding-left: 2px; box-shadow: none; width: auto; }
.fb-chips { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; background: var(--lagoon-50); color: var(--lagoon-600); border-radius: 16px; height: 30px; font-size: 13px; font-weight: 600; }
.fchip-b { border: 0; background: none; color: inherit; font: inherit; padding: 0 4px 0 12px; cursor: pointer; height: 100%; }
.fchip-b:disabled { cursor: default; padding-right: 12px; }
.fchip-x { border: 0; background: none; color: inherit; padding: 0 8px 0 2px; height: 100%; cursor: pointer; opacity: .7; }
.fchip-x:hover { opacity: 1; }
.fchip-x svg { width: 13px; height: 13px; display: block; }
.fb-add { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; height: 30px; padding: 0 6px; }
.fb-add svg { width: 15px; height: 15px; }
.fpop { position: fixed; z-index: 60; min-width: 240px; max-height: 70vh; overflow-y: auto; }
.fform { display: grid; gap: 10px; padding: 4px 6px 6px; width: 260px; }
.fform-h { display: flex; align-items: center; gap: 4px; margin: -2px 0 0 -6px; }
.fform select, .fform input { height: 36px; }
.fform .days { display: flex; align-items: center; gap: 8px; }
.fform .days input { width: 90px; }
.fform .field { margin: 0; }
.cols-pop { padding: 8px 12px 10px; min-width: 210px; }
.cols-pop .check { margin: 6px 0; }
.cx-results { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cx-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 60px; }
.cx-bar-l { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.cx-bar-l b { font-size: 15px; white-space: nowrap; }
.cx-bar-r { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-bar-r .btn svg { width: 15px; height: 15px; }
.cx-search { position: relative; display: block; width: min(280px, 100%); }
.cx-search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.cx-search input { height: 34px; padding-left: 34px; background: var(--plane); width: 100%; }
.cx-table { flex: 1; min-height: 0; overflow: auto; }
.cx-tbl { width: 100%; }
.cx-tbl thead th { position: sticky; top: 0; background: var(--paper); z-index: 1; }
.cx-tbl .ck { width: 44px; padding-right: 0; }
.cx-tbl .ck input { width: 17px; height: 17px; margin: 0; accent-color: var(--lagoon); vertical-align: middle; cursor: pointer; }
.cx-tbl tr.sel td { background: var(--lagoon-50); }
.cx-tbl .v-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.cx-tbl td { white-space: nowrap; }
.cx-tbl .c-email { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ch-icons { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); }
.ch-icons svg { width: 17px; height: 17px; }
.consent-sel { height: 28px; width: auto; min-width: 70px; font-size: 12.5px; font-weight: 650; border-radius: 14px; padding: 0 26px 0 10px; background-position: right 8px center; border: 1px solid var(--line); }
.consent-sel.subscribed { color: #15803D; background-color: #EAF7EE; border-color: #C6E9D1; }
.consent-sel.unsubscribed { color: #B45309; background-color: #FEF3E2; border-color: #F6DDB4; }
.consent-sel.none { color: var(--text-3); }
.cx-more { padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; }
@media (max-width: 860px) {
  .cx { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .cx-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
  .cx-nav .nav-label { display: none; }
  .cx-nav a.nav-item { flex: none; width: auto; height: 32px; border: 1px solid var(--line); border-radius: 16px; }
  .cx-main { padding: 12px 10px; }
  .cx-h { display: none; }
  .fb-match { border-right: 0; padding-right: 0; }
  .cx-bar { padding: 10px 12px; }
  .cx-bar-r .btn span, .cx-bar-r .btn { font-size: 12.5px; }
}
.fpop .fform button { width: auto; }
.fpop .fform-h button { padding: 0; width: 30px; height: 30px; justify-content: center; }
.fpop .fform .btn-primary { width: 100%; justify-content: center; background: var(--lagoon); color: #fff; height: 36px; border-radius: 8px; font-weight: 650; }
.fpop .fform .btn-primary:hover { background: var(--lagoon-600); }
.cx-tbl .nm-wrap { display: grid; min-width: 0; }
.cx-tbl .nm-sub { display: none; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .cx-tbl [class^="c-"] { display: none; }
  .cx-tbl .nm-sub { display: block; }
  .cx-tbl td, .cx-tbl th { padding-top: 10px; padding-bottom: 10px; }
  .cx-tbl .v-name .nm { max-width: 62vw; }
  .cx-tbl .nm-sub { max-width: 62vw; }
}

/* ---------- Email sending settings ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }
.note > svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.note.ok { background: #EAF7EE; color: #166534; }
.note.warn { background: var(--marigold-50); color: var(--amber-ink); }
.note.err { background: var(--ember-50); color: #9B2C1F; }
.note code { font-size: 12.5px; word-break: break-word; }
.prov { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.prov label { cursor: pointer; }
.prov input { position: absolute; opacity: 0; pointer-events: none; }
.prov span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 17px; font-weight: 600; font-size: 13.5px; background: var(--paper); }
.prov input:checked + span { border-color: var(--lagoon); background: var(--lagoon-50); color: var(--lagoon-600); }
.prov input:focus-visible + span { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.mail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.mail-actions .grow { flex: 1; }
.dns-tip { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
.dns-tip summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.dns-tip p { margin: 8px 0 0; line-height: 1.55; }
@media (max-width: 640px) { .mail-form .form-grid { grid-template-columns: 1fr !important; } .mail-actions input { max-width: none !important; flex: 1; } }

/* Sub-menu icons */
.settings-nav a { display: flex; align-items: center; gap: 10px; }
.settings-nav a > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.settings-nav a[aria-current=page] > svg { color: var(--lagoon); }
.cx-nav a.nav-item[aria-current=page] > svg { color: var(--lagoon); }

/* ---------- Flows (My flows + template library) ---------- */
.fl-main { overflow-y: auto; }
.fl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fl-head .grow { flex: 1; }
.fl-head .btn svg { width: 16px; height: 16px; }
.fl-perf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px 18px; }
.fl-perf-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fl-perf-h h3 { font-size: 15px; }
.fl-perf-h select { width: auto; height: 32px; font-size: 13px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi-tile { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper); }
.kpi-tile .kpi-l { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi-tile b { display: block; font-size: 30px; letter-spacing: -0.02em; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-row.small .kpi-tile b { font-size: 22px; }
.qhelp { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--text-3); cursor: help; }
.qhelp:hover::after, .qhelp:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: 240px; background: var(--ink); color: #fff; font-weight: 500; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; z-index: 20; box-shadow: var(--shadow-pop); white-space: normal; }
.fl-results { min-height: 320px; }
.fl-bar { gap: 8px; }
.fl-bar b { font-size: 16px; white-space: nowrap; }
.fl-bar .grow { flex: 1; }
.fl-bar select { width: auto; height: 34px; font-size: 13px; max-width: 170px; }
.fl-search { width: 200px; }
.fl-tbl td { vertical-align: middle; }
.fl-tbl .r { text-align: right; }
.fl-tbl .c { text-align: center; }
.fl-tbl .nowrap { white-space: nowrap; }
.fl-tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.fl-tbl tr.off .fl-name { color: var(--text-2); }
.fl-name { font-weight: 650; color: var(--ink); text-decoration: none; }
.fl-name:hover { color: var(--lagoon-600); text-decoration: underline; }
.fl-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.fl-sub svg { width: 12px; height: 12px; }
.pill.draft { background: var(--line-2); color: var(--text-2); font-size: 11.5px; height: 20px; vertical-align: 2px; }
.fl-idle { color: var(--text-2); font-size: 13.5px; }
.fl-idle a { color: var(--lagoon-600); font-weight: 650; }
.fl-tbl .icon-btn svg { width: 17px; height: 17px; }
.fl-lib { padding: 22px 24px 26px; }
.fl-lib-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fl-lib-head .grow { flex: 1; }
.fl-lib-head .cx-search { width: min(340px, 100%); }
.fl-tabs { display: flex; justify-content: center; gap: 8px; margin: 22px 0 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fl-tabs button { display: grid; justify-items: center; gap: 6px; border: 0; background: none; padding: 6px 16px 12px; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.fl-tabs button svg { width: 22px; height: 22px; }
.fl-tabs button:hover { color: var(--ink); }
.fl-tabs button[aria-selected=true] { color: var(--lagoon-600); border-bottom-color: var(--lagoon); }
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tpl-card { display: flex; gap: 18px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 20px 22px; cursor: pointer; min-height: 210px; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: #B7CBF5; box-shadow: 0 4px 16px rgba(20,33,61,.07); }
.tpl-card:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.tpl-txt { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tpl-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.tpl-cat svg { width: 17px; height: 17px; }
.tpl-card b { font-size: 18px; letter-spacing: -0.01em; color: var(--ink); line-height: 1.3; }
.tpl-d { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.tpl-meta { margin-top: auto; display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); padding-top: 8px; }
.tpl-meta svg { width: 13px; height: 13px; }
.tpl-card.feat { grid-column: span 2; background: linear-gradient(135deg, #EAF1FF, #E9E7FB); border-color: #D5DFF5; }
.tpl-card.feat b { font-size: 22px; }
.tpl-pv { width: 46%; display: grid; gap: 8px; align-content: center; }
.pv-b { background: var(--paper); border-radius: 14px 14px 14px 4px; padding: 10px 13px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 2px 8px rgba(20,33,61,.08); color: var(--ink); }
.pv-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pv-opts span { border: 1.5px solid var(--lagoon); color: var(--lagoon-600); background: var(--paper); border-radius: 16px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.pv-opts span:first-child { background: var(--lagoon); color: #fff; }
.pv-in { justify-self: end; background: var(--lagoon); color: #fff; border-radius: 14px 14px 4px 14px; padding: 8px 12px; font-size: 13px; }
.pv-card { background: var(--paper); border-radius: 14px; overflow: hidden; display: grid; box-shadow: 0 2px 8px rgba(20,33,61,.08); font-size: 13px; }
.pv-card b { padding: 10px 13px 0; font-size: 14px !important; }
.pv-card span { padding: 2px 13px 10px; color: var(--text-2); }
.pv-card i { font-style: normal; border-top: 1px solid var(--line); padding: 8px; text-align: center; color: var(--lagoon-600); font-weight: 650; }
.tpl-prev { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.tpl-phone { background: linear-gradient(160deg, #EAF1FF, #ECEAFB); border-radius: 18px; padding: 18px 16px; display: grid; gap: 10px; }
@media (max-width: 1280px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fl-bar select { max-width: 140px; } }
@media (max-width: 860px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-card.feat { grid-column: auto; flex-direction: column; }
  .tpl-pv { width: 100%; }
  .tpl-prev { grid-template-columns: 1fr; }
  .fl-lib { padding: 16px 14px; }
  .fl-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .fl-tbl th:nth-child(3), .fl-tbl td:nth-child(3), .fl-tbl th:nth-child(4), .fl-tbl td:nth-child(4) { display: none; }
  .fl-tbl td.fl-idle { display: table-cell; }
  .fl-search { width: 100%; }
  .fl-bar select { flex: 1; max-width: none; }
}
.fl-tbl .switch { display: inline-block; vertical-align: middle; }
.fl-results { flex: none; overflow: visible; min-height: 0; }
.fl-results .cx-table { overflow: visible; flex: none; }
.fl-main .fl-lib { flex: none; }
.kpi-row.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fl-tabs button span { white-space: nowrap; }
@media (max-width: 640px) { .kpi-row.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Video call window (agent) ---------- */
.icon-btn.dim { opacity: .45; }
.callwin { position: fixed; right: 24px; bottom: 24px; z-index: 80; width: 380px; height: 330px; min-width: 260px; min-height: 220px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); resize: both; overflow: hidden; background: #0E1729; color: #fff; border-radius: 16px; box-shadow: 0 18px 48px rgba(10,20,40,.38); display: flex; flex-direction: column; }
.callwin .cw-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; cursor: grab; user-select: none; font-size: 13.5px; background: rgba(255,255,255,.04); touch-action: none; }
.callwin .cw-head .grow { flex: 1; }
.callwin .cw-head b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.callwin .cw-time { color: #9FB0CC; font-variant-numeric: tabular-nums; }
.cw-live { width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; flex: none; animation: cwPulse 1.2s infinite; }
.callwin.live .cw-live { background: #22C55E; animation: none; }
@keyframes cwPulse { 50% { opacity: .35; } }
.cw-stage { position: relative; flex: 1; min-height: 0; background: #0B1220; }
.cw-remote { width: 100%; height: 100%; object-fit: cover; display: block; background: #0B1220; }
.cw-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; background: radial-gradient(circle at 50% 40%, #1E2B47, #0B1220 70%); padding: 16px; }
.cw-ph[hidden] { display: none; }
.cw-ph b { font-size: 16px; }
.cw-ph span:last-child { color: #9FB0CC; font-size: 13px; }
.cw-local { position: absolute; right: 10px; bottom: 10px; width: 28%; max-width: 140px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.7); background: #1E2B47; transform: scaleX(-1); }
.cw-local.off { opacity: .25; }
.cw-local[hidden] { display: none; }
.cw-note { position: absolute; left: 10px; top: 10px; background: rgba(11,18,32,.75); padding: 5px 10px; border-radius: 8px; font-size: 12.5px; }
.cw-bar { display: flex; justify-content: center; gap: 12px; padding: 10px; }
.cw-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cw-btn:hover { background: rgba(255,255,255,.24); }
.cw-btn svg { width: 20px; height: 20px; }
.cw-btn.off { background: #fff; color: #0E1729; }
.cw-btn.end { background: #DC4B3E; width: 56px; border-radius: 22px; }
.cw-btn.end:hover { background: #C23B2F; }
.cw-btn.sm { width: 30px; height: 30px; background: transparent; color: #C9D4E8; }
.cw-btn.sm:hover { background: rgba(255,255,255,.12); }
.cw-btn.sm svg { width: 16px; height: 16px; }
.cw-btn:focus-visible { outline: 2px solid #8FB2FF; outline-offset: 2px; }
.callwin.min { height: auto !important; width: 260px !important; resize: none; }
.callwin.min .cw-stage, .callwin.min .cw-bar { display: none; }
@media (max-width: 860px) { .callwin { left: 8px; right: 8px; top: 8px; bottom: 76px; width: auto; height: auto; resize: none; } .callwin.min { top: auto; bottom: 76px; } }

/* ---- 1.8.0: list item menu, select mode, views, transcript, translate, ban, integrations */
.ibx-list-head { align-items: center; }
.ibx-list-head .grow { flex: 1; }
.icon-btn.sm { width: 30px; height: 30px; padding: 0; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.ibx-list-head.sel-on [data-act=select] { background: var(--lagoon-50); color: var(--lagoon-600); }
.conv-list > li.ci { position: relative; }
.ci-more { position: absolute; right: 8px; top: 30px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); border-radius: 7px; color: var(--text-2); cursor: pointer; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 2px rgba(20,33,61,.08); }
.ci-more svg { width: 16px; height: 16px; }
.conv-list > li.ci:hover .ci-more, .ci-more:focus-visible { opacity: 1; }
@media (hover: none) and (pointer: coarse) { .conv-item[aria-current=true] + .ci-more { opacity: 1; } }
.ci-more:hover { color: var(--text); background: var(--line-2); }
.ci-check { width: 20px; height: 20px; margin: 10px 8px 0 4px; flex: none; border: 1.5px solid #B8C3D6; border-radius: 5px; display: grid; place-items: center; background: var(--paper); }
.ci-check.on { background: var(--lagoon); border-color: var(--lagoon); color: #fff; }
.ci-check svg { width: 13px; height: 13px; stroke-width: 3; }
li.ci.picked .conv-item { background: var(--lagoon-50); border-color: #CBDBFB; }
.bulk-bar { padding: 0 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.bulk-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bulk-top .grow { flex: 1; }
.bulk-acts { display: flex; gap: 4px; }
.bulk-acts .btn { height: 30px; padding: 0 8px; flex: none; font-size: 13px; gap: 6px; }
.bulk-acts .btn svg { width: 15px; height: 15px; }
.bulk-acts .icon-btn { width: 30px; padding: 0; }

.nav-head-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.nav-head-row .nav-head { flex: 1; }
.nav-add { width: 26px; height: 26px; margin-top: 8px; border: 0; border-radius: 6px; background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.nav-add:hover { background: #E8EEF7; color: var(--text); }
.nav-add svg { width: 16px; height: 16px; }
.nav-view { position: relative; display: flex; align-items: center; border-radius: 8px; }
.nav-view .grip { position: absolute; left: -10px; width: 12px; display: grid; place-items: center; color: var(--text-3); cursor: grab; opacity: 0; }
.nav-view .grip svg { width: 14px; height: 14px; }
.nav-view:hover .grip { opacity: 1; }
.nav-view .vic { display: grid; place-items: center; flex: none; }
.nav-view .vic svg { width: 17px; height: 17px; }
.nav-view .vedit { position: absolute; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: var(--paper); color: var(--text-2); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.nav-view .vedit svg { width: 15px; height: 15px; }
.nav-view:hover .vedit, .nav-view .vedit:focus-visible { opacity: 1; }
.nav-view:hover .nav-item .cnt { visibility: hidden; }
.nav-view.dragging { opacity: .45; }
.nav-view.drop-before { box-shadow: 0 -2px 0 var(--lagoon); }
.nav-view.drop-after { box-shadow: 0 2px 0 var(--lagoon); }
.nav-hint { border: 1px dashed #C9D3E3; background: none; border-radius: 8px; padding: 8px 10px; text-align: left; color: var(--text-2); font-size: 12.5px; cursor: pointer; line-height: 1.4; }
.nav-hint:hover { border-color: var(--lagoon); color: var(--lagoon-600); }

.view-form .field { margin-bottom: 14px; }
.vw-icons, .vw-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.vw-icons button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--text-2); cursor: pointer; }
.vw-icons button svg { width: 18px; height: 18px; }
.vw-icons button[aria-checked=true] { border-color: var(--lagoon); color: var(--lagoon-600); background: var(--lagoon-50); }
.vw-colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--paper); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.vw-colors button[aria-checked=true] { box-shadow: 0 0 0 2px var(--c); }
.vw-sub { margin: 6px 0 10px; font-size: 13px; color: var(--text-2); }
.vw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.vw-checks { display: grid; gap: 8px; margin-top: 4px; }
@media (max-width: 560px) { .vw-grid { grid-template-columns: 1fr; } }

pre.transcript { margin: 0; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--plane); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tr-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; max-width: 100%; font-size: 13px; color: var(--text-2); font-style: italic; }
.tr-line svg { width: 13px; height: 13px; flex: none; margin-top: 3px; }
.mrow.agent .tr-line { justify-content: flex-end; }
.ban-banner { display: flex; align-items: center; gap: 10px; padding: 9px 20px; background: var(--ember-50); border-bottom: 1px solid #F6CFC6; font-size: 13.5px; color: var(--ember); }
.ban-banner > svg { width: 16px; height: 16px; }
.ban-banner .grow { flex: 1; }

.int-card .int-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.int-card .int-head h2 { font-size: 16px; margin: 0; }
.int-card .int-head p { margin: 2px 0 0; }
.int-card .grow { flex: 1; }
.int-logo { width: 42px; height: 42px; border-radius: 10px; background: #FFE01B; color: #241C15; display: grid; place-items: center; flex: none; }
.int-logo svg { width: 22px; height: 22px; }
.pill.ok { background: #DCF5E8; color: #0B7A4B; }
.int-card .row-actions { display: flex; gap: 8px; margin-top: 18px; }
.int-card .err { color: var(--ember); }

/* ---- 1.9.0: email composer, templates, patient intake */
.modal.modal-ee { height: min(900px, calc(100vh - 40px)); max-height: none; display: flex; flex-direction: column; }
.modal.modal-ee .modal-body { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.ee-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); height: 100%; }
.ee-form { overflow-y: auto; padding: 18px 22px 24px; border-right: 1px solid var(--line); }
.ee-form .field { margin-bottom: 12px; }
.ee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ee-grid3 { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 0 12px; }
.ee-vars { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: -4px 0 14px; }
.ee-vars .muted { margin-right: 2px; }
.ee-vars button { border: 1px solid var(--line); background: var(--plane); border-radius: 6px; padding: 2px 7px; font: 500 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); cursor: pointer; }
.ee-vars button:hover { border-color: var(--lagoon); color: var(--lagoon-600); }
.ee-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 6px; margin: 0 0 14px; min-width: 0; }
.ee-sec legend { padding: 0 6px; font-weight: 650; font-size: 13.5px; }
.ee-sec > .check { margin-bottom: 10px; }
.ee-items-head { display: grid; grid-template-columns: 1fr 96px 30px; gap: 8px; padding: 0 0 4px; font-size: 12px; color: var(--text-2); }
.ee-item { display: grid; grid-template-columns: 1fr 96px 30px; gap: 6px 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.ee-item .grip { color: var(--text-3); padding-top: 10px; }
.ee-item .grip svg { width: 14px; height: 14px; }
.ee-item-main { display: grid; gap: 6px; min-width: 0; }
.ee-item input[data-k=label] { font-weight: 600; }
.ee-item textarea { resize: none; min-height: 34px; font-size: 13.5px; line-height: 1.45; }
.ee-item input[data-k=price] { text-align: right; font-variant-numeric: tabular-nums; }
.ee-item .btn { margin-top: 2px; }
.ee-items-foot { display: flex; align-items: center; gap: 14px; padding: 10px 0 8px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.ee-items-foot .check { margin: 0; }
.ee-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.ee-preview { display: flex; flex-direction: column; background: #F0F2F7; min-width: 0; }
.ee-ptop { display: flex; gap: 8px; align-items: baseline; padding: 12px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.ee-ptop b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ee-warn { margin: 0; padding: 8px 18px; background: #FFF6E5; color: #8A5300; font-size: 13px; border-bottom: 1px solid #F5DDB0; }
.ee-preview iframe { flex: 1; width: 100%; border: 0; background: #F0F2F7; }
.ee-view { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 10px; background: #F0F2F7; margin-top: 12px; }
.ee-meta { margin: 0; }
@media (max-width: 900px) {
  .ee-wrap { grid-template-columns: 1fr; height: auto; max-height: 76vh; overflow-y: auto; }
  .ee-form { overflow: visible; border-right: 0; }
  .ee-preview iframe { height: 520px; flex: none; }
  .ee-grid, .ee-grid3 { grid-template-columns: 1fr; }
}
.sys-link { border: 0; background: none; padding: 2px 4px; font: inherit; color: var(--lagoon-600); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; }
.sys-link:hover { background: var(--lagoon-50); text-decoration: underline; }
.sys-link svg { width: 14px; height: 14px; }
.intake-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: var(--lagoon-50); color: var(--lagoon-600); font-size: 12.5px; font-weight: 600; }
.intake-chip svg { width: 14px; height: 14px; }
.intake-kv dd.long { grid-column: 1 / -1; white-space: pre-wrap; background: var(--plane); border-radius: 8px; padding: 8px 10px; margin-top: 2px; }
.intake-files { display: grid; gap: 6px; margin-top: 10px; }
.intake-files .file { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--text); font-size: 13px; min-width: 0; }
.intake-files .file span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-files .file svg { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.intake-files .file:hover { border-color: var(--lagoon); }
.intake-top { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.intake-top > div { flex: 1; }
.intake-body[hidden] { display: none; }
.intake-tbl th.c, .intake-tbl td.c { text-align: center; width: 90px; }
.intake-tbl td { padding-top: 7px; padding-bottom: 7px; }
.acc-form .prov { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.acc-form .prov label { display: inline-flex; }
.acc-form .prov input { position: absolute; opacity: 0; }
.acc-form .prov span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.acc-form .prov input:checked + span { border-color: var(--lagoon); background: var(--lagoon-50); color: var(--lagoon-600); font-weight: 600; }
.acc-form .prov input:focus-visible + span { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.smtp-fields[hidden] { display: none; }
.panel-head .muted.small { margin: 2px 0 0; font-weight: 400; }

.field input[type=date] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; color: var(--text); background: var(--paper); width: 100%; box-sizing: border-box; }
.field input[type=date]:focus { outline: none; border-color: var(--lagoon); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
@media (max-width: 900px) { .modal.modal-ee { height: auto; max-height: calc(100vh - 32px); } .ee-wrap { height: auto; } }
.panel-head > div:first-child { flex: 1; min-width: 0; }
.modal.modal-ee .modal-foot { padding: 12px 22px; border-top: 1px solid var(--line); flex: none; } .modal.modal-ee .modal-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); flex: none; }
