/* ════════════════════════════════════════════════════════════════
   LENBIRD · styles v5.1 — "Soft Premium SaaS"
   Ett designsystem för hela produkten. Konsumerar tokens.css.
   Komponenter: Button, IconButton, Card, StatCard, Panel, Table,
   StatusChip, Toolbar, Search, Select/Input, Tabs, Segmented,
   Drawer, Modal, Popover, EmptyState, PageHeader, EntityHeader,
   InspectorSection, FormSection. Alla legacy-klassnamn behålls.
   ════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.55; color: var(--text-primary); background: var(--app-bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text-primary); line-height: 1.25; letter-spacing: -.015em; }
h2 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.025em; }
h3 { font-size: var(--fs-section); font-weight: 700; }
p { margin: 0 0 var(--s-3); }
code { background: var(--surface-soft); border-radius: 6px; padding: 2px 7px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: var(--s-4) 0; }
.hidden { display: none !important; }
.muted { color: var(--text-secondary); }
.small { font-size: var(--fs-meta); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.grow { flex: 1; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft-2); }
svg { flex: none; }

/* ── APP SHELL ─────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); flex: none; background: var(--surface); display: flex; flex-direction: column; padding: 22px 18px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; box-shadow: 1px 0 0 rgba(46, 58, 110, .06); }
.logo { display: inline-flex; align-items: center; height: 48px; padding: 0 10px; margin-bottom: 22px; }
.logo-img { height: 30px; width: auto; display: block; }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.side-nav .nav-sec { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 24px 16px 8px; }
.side-nav .nav-sec:first-child { padding-top: 4px; }
.side-nav a { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; border-radius: 14px; color: var(--text-secondary); font-size: var(--fs-nav); font-weight: 500; transition: background var(--fast), color var(--fast); }
.side-nav a:hover { background: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }
.side-nav a svg { width: 20px; height: 20px; opacity: .85; }
.side-nav a.active { background: var(--brand-grad); color: var(--text-on-brand); font-weight: 600; box-shadow: var(--brand-glow); }
.side-nav a.active svg { opacity: 1; color: #fff; }
.side-nav .nav-flag { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); border-radius: var(--radius-chip); padding: 3px 9px; }
.side-nav a.active .nav-flag { background: rgba(255, 255, 255, .22); color: #fff; }
.side-card { margin-top: 20px; background: var(--surface-soft); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.side-card .sc-top { display: flex; align-items: center; gap: 12px; }
.side-card .sc-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); display: inline-flex; align-items: center; justify-content: center; }
.side-card .sc-ico svg { width: 20px; height: 20px; }
.side-card .sc-t { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.side-card .sc-s { font-size: 12.5px; color: var(--text-secondary); }
.side-card .btn { width: 100%; }
.side-foot { border-top: 1px solid var(--border-soft); margin-top: 12px; padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-height); background: var(--surface); display: flex; align-items: center; gap: 16px; padding: 0 var(--content-pad); position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 rgba(46, 58, 110, .06); }
.ws-select { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ws-co { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.ws-select select { appearance: none; -webkit-appearance: none; border: 1px solid transparent; background: transparent; font: inherit; font-weight: 700; font-size: 15.5px; color: var(--text-primary); border-radius: 12px; height: 42px; padding: 0 30px 0 12px; cursor: pointer; max-width: 240px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b93a6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: background-color var(--fast); }
.ws-select select:hover { background-color: var(--surface-soft); }
.tb-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.search-btn { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 18px; width: 100%; max-width: 520px; border: 0; border-radius: 14px; background: var(--surface-soft); color: var(--text-muted); font: inherit; font-size: 15px; cursor: pointer; transition: background var(--fast), box-shadow var(--fast); }
.search-btn:hover { background: var(--brand-soft); color: var(--text-secondary); }
.search-btn svg { width: 18px; height: 18px; }
.search-btn kbd { margin-left: auto; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border-soft); border-radius: 7px; padding: 2px 8px; background: var(--surface); }
.icon-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 12px; color: var(--text-secondary); cursor: pointer; padding: 0; transition: background var(--fast), color var(--fast); }
.icon-btn:hover { background: var(--surface-soft); color: var(--text-primary); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[disabled] { opacity: .4; cursor: default; }
.icon-btn[disabled]:hover { background: transparent; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; border: 0; cursor: pointer; box-shadow: 0 4px 12px rgba(84, 104, 240, .28); }
.tb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.user-btn { display: inline-flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 5px 8px 5px 5px; border-radius: 14px; cursor: pointer; font: inherit; }
.user-btn:hover { background: var(--surface-soft); }
.user-btn .avatar { width: 38px; height: 38px; }
.user-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-nm { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.user-role { font-size: 12.5px; color: var(--text-muted); }
#menu-btn { display: none; }
.scrim { display: none; }

/* ── LAYOUT: main, PageHeader, EntityHeader, Tabs, Toolbar ─────── */
.main { padding: 0 var(--content-pad) 56px; width: 100%; }
.main > * + * { margin-top: var(--content-gap); }
.main > .page-head + * { margin-top: 8px; }
.main > .entity-head + *, .main > .tabs + *, .main > .wiz + * { margin-top: var(--content-gap); }
.page-head, .ptb { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 0 18px; flex-wrap: wrap; }
.page-head h2, .ptb h2 { display: flex; align-items: center; gap: 12px; }
.page-head h2 a.muted { display: inline-flex; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head > div:first-child > p, .page-head .muted { margin: 0; font-size: 15px; color: var(--text-secondary); }
.head-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.ptb-count { font-size: 14px; font-weight: 700; color: var(--brand-strong); background: var(--brand-soft); border-radius: var(--radius-chip); padding: 4px 12px; letter-spacing: 0; }
.sub-head, .sec-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: var(--s-5) 0 var(--s-3); display: flex; align-items: center; gap: 10px; }
.sec-title .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.ws { padding: 0; }

.entity-head { padding: 30px 0 0; }
.entity-head .eh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.entity-head .eh-back { font-size: 13.5px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.entity-head .eh-back svg { width: 15px; height: 15px; }
.entity-head .eh-back:hover { color: var(--brand-strong); text-decoration: none; }
.entity-head h2 { font-size: var(--fs-entity); }
.entity-head .eh-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 14.5px; color: var(--text-secondary); }
.entity-head .eh-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.entity-head .eh-stats { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.eh-stat { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border-radius: 16px; padding: 14px 20px; min-width: 150px; box-shadow: var(--shadow-card); }
.eh-stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.eh-stat .k { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.entity-head .tabs { margin-top: 22px; }

.tabs { display: flex; gap: 6px; padding: 0; margin: 0; }
.tabs a, .tabs .tab, .tabs button { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: background var(--fast), color var(--fast); }
.tabs a:hover, .tabs .tab:hover { background: var(--surface-soft); color: var(--text-primary); text-decoration: none; }
.tabs a.active, .tabs .tab.active, .tabs button.active { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow-card); }
.tabs .t-n { font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-strong); border-radius: var(--radius-chip); padding: 2px 8px; }
.pane { display: none; }
.pane.active { display: block; }

.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.filter-bar .field { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; }
.filter-bar .field input { width: auto; height: var(--control-height-sm); }
.filter-bar .btn { height: var(--control-height-sm); }
.filter-search, input.filter-search { height: var(--control-height-sm); max-width: 300px; }
.status-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.spill { height: 34px; padding: 0 14px; border-radius: var(--radius-chip); border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: background var(--fast), color var(--fast); }
.spill:hover { background: var(--surface-soft); color: var(--text-primary); }
.spill.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 14px rgba(84, 104, 240, .25); }
.chip-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-chip); font-size: 13.5px; font-weight: 600; color: var(--text-secondary); background: var(--surface); cursor: pointer; }
.chip-check:has(input:checked) { border-color: transparent; color: var(--brand-deep); background: var(--brand-soft); }
.chip-check input { display: none; }
.bulkbar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); font-size: 14.5px; margin-bottom: 14px; border-left: 4px solid var(--brand); }
.bulkbar .btn { height: var(--control-height-sm); }
.bb-count { font-weight: 700; color: var(--brand-deep); }
.bb-group { display: flex; gap: 8px; align-items: center; }
.bb-x { margin-left: auto; }

/* ── BUTTON / ICONBUTTON ───────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 20px; border-radius: var(--radius-control); border: 1px solid transparent; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-card); transition: background var(--fast), box-shadow var(--fast), color var(--fast), transform 80ms ease; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow-card-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand-grad); color: #fff; box-shadow: var(--brand-glow); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.soft { background: var(--surface); color: var(--text-primary); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--surface-soft); color: var(--text-primary); box-shadow: none; }
.btn.danger { background: var(--surface); color: var(--danger); }
.btn.danger:hover { background: var(--danger-weak); }
.btn.tiny, .btn.tiny2 { height: var(--control-height-sm); padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn.tiny svg, .btn.tiny2 svg { width: 16px; height: 16px; }
.btn.xl, .btn.big { height: var(--control-height-lg); padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.copy { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.btn.copied { color: var(--ok); }

/* ── INPUT / SELECT / FORMSECTION ──────────────────────────────── */
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form-row { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) 20px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.field.grow { flex: 1; }
.field.full { grid-column: 1 / -1; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea { width: 100%; height: var(--control-height); padding: 0 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-control); font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text-primary); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input::placeholder, textarea::placeholder { color: var(--text-muted); font-weight: 400; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b93a6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input[type="color"] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; padding: 4px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 17px; height: 17px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.hint { font-size: 14px; color: var(--text-secondary); background: var(--surface-soft); border-radius: 14px; padding: 14px 18px; margin: 0 0 var(--s-4); }
.hint.warn { background: var(--amber-soft); color: var(--amber); }
.hint.ok { background: var(--green-soft); color: var(--ok); }
.hint a { font-weight: 600; }
.code-area { width: 100%; min-height: 480px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; background: var(--surface-soft); border-color: transparent; }
.lockbox { background: var(--surface-soft); border-radius: 14px; padding: 14px 16px; font-size: 14px; }
.fresh-key { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; word-break: break-all; background: var(--brand-soft); border-radius: 14px; padding: 14px 16px; }
.reveal { font-family: ui-monospace, Menlo, monospace; }
.seg { display: inline-flex; background: var(--surface-soft); border-radius: 12px; padding: 4px; gap: 3px; }
.seg button { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background var(--fast), color var(--fast), box-shadow var(--fast); }
.seg button svg { width: 16px; height: 16px; }
.seg button:hover { color: var(--text-primary); }
.seg button.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-card); }

/* ── STATUSCHIP / BADGE ────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: var(--radius-chip); font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--surface-soft); color: var(--text-secondary); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill-draft { background: #eef0f6; color: #5c6478; }
.pill-scheduled { background: var(--cyan-soft); color: #0b7fa0; }
.pill-sending { background: var(--brand-soft); color: var(--brand-deep); }
.pill-paused { background: var(--amber-soft); color: var(--amber); }
.pill-sent { background: var(--green-soft); color: var(--ok); }
.pill-failed { background: var(--danger-weak); color: var(--danger); }
.pill-paid { background: var(--green-soft); color: var(--ok); }
.pill-pending { background: var(--amber-soft); color: var(--amber); }
.pill-refund { background: var(--danger-weak); color: var(--danger); }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-chip); background: var(--surface-soft); color: var(--text-secondary); font-size: 13px; font-weight: 700; white-space: nowrap; }
.st-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: var(--radius-chip); font-size: 13.5px; font-weight: 700; background: var(--surface-soft); color: var(--text-secondary); }
.st-chip::before, .dot { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.st-sub { background: var(--green-soft); color: var(--ok); } .st-sub::before, .dot.st-sub { background: var(--ok); }
.st-not::before { background: var(--text-muted); }
.st-uns { background: var(--danger-weak); color: var(--danger); } .st-uns::before { background: var(--danger); }
.chip-mail { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-secondary); }
.nav-flag { font-size: 11.5px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); border-radius: var(--radius-chip); padding: 2px 8px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; border-radius: var(--radius-chip); padding: 4px 10px; }
.delta svg { width: 12px; height: 12px; }
.delta.up { color: var(--ok); background: var(--green-soft); }
.delta.down { color: var(--danger); background: var(--danger-weak); }
.delta.flat { color: var(--text-muted); background: var(--surface-soft); }

/* ── CARD / PANEL / STATCARD / lists ───────────────────────────── */
.card, .panel { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card { padding: 26px 28px; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: var(--fs-section); }
.card-head .btn, .card-head .seg { margin-left: auto; }
.card > h3:first-child { margin-bottom: 16px; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px 12px; }
.panel-head h3 { font-size: var(--fs-section); }
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 4px 28px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--content-gap); align-items: start; }
.dl { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 12px 20px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--text-muted); font-weight: 500; }
.dl dd { margin: 0; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.dl svg, .table td svg, .list-row svg, .eh-meta svg, .kv-row svg { width: 16px; height: 16px; vertical-align: -3px; }
.kv { display: flex; flex-direction: column; }
.kv-row, .list-row, .lt-row, .dlq-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; }
.kv-row:last-child, .list-row:last-child, .lt-row:last-child, .dlq-row:last-child { border-bottom: 0; }
.kv-key { color: var(--text-muted); min-width: 150px; font-weight: 500; }
.kv-actions { margin-left: auto; display: flex; gap: 8px; }
.lt-name { flex: 1; font-weight: 600; }
.lt-row form { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--content-gap); }
.stat-grid.five { grid-template-columns: repeat(5, 1fr); }
.stat-grid .card.stat, .stat-grid .stat { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px 22px; }
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.stat-num.accent, .stat.kpi.accent .stat-num { color: var(--brand-strong); }
.stat-sub { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.stat-label { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }
.stat-duo { display: flex; gap: 20px; }
.sd-num { font-size: 20px; font-weight: 700; }

/* ── TABLE ─────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card .table-scroll, .panel .table-scroll { box-shadow: none; border-radius: 0; margin: 0 -28px -26px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 16px 22px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; height: 58px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-soft); }
.table.small { font-size: 14px; }
.table.small td { height: 50px; padding: 10px 22px; }
.table .num, .table td.num, .table th.num { text-align: right; }
.table th.num .sort { justify-content: flex-end; }
.row-title { font-weight: 700; color: var(--text-primary); font-size: 15px; }
.row-title:hover { color: var(--brand-strong); text-decoration: none; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; opacity: .6; transition: opacity var(--fast); }
tr:hover .row-actions { opacity: 1; }
.table .muted.small { color: var(--text-muted); }
.link-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.sort:hover { color: var(--text-primary); text-decoration: none; }
.sort.asc::after, .sort.desc::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort.asc::after { border-bottom: 5px solid var(--text-secondary); }
.sort.desc::after { border-top: 5px solid var(--text-secondary); }
.col-hidden { display: none !important; }
.pager { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pg { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-secondary); background: var(--surface); box-shadow: var(--shadow-card); }
.pg:hover { text-decoration: none; color: var(--text-primary); }
.pg.active { background: var(--brand-grad); color: #fff; box-shadow: var(--brand-glow); }
.empty { padding: 36px 16px; text-align: center; color: var(--text-muted); font-size: 14.5px; }

/* ── EMPTYSTATE ────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.empty-state .es-ico { width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 8px; }
.empty-state .es-ico svg { width: 26px; height: 26px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { font-size: 14.5px; color: var(--text-secondary); margin: 0 0 10px; max-width: 420px; }
.card .empty-state, .panel .empty-state { box-shadow: none; }

/* ── POPOVER / MODAL / DRAWER / ⌘K / TOAST ─────────────────────── */
.ui-menu-wrap { position: relative; display: inline-flex; }
.ui-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 230px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-floating); padding: 8px; z-index: 60; display: none; }
.ui-menu.open { display: block; animation: menu-in 120ms ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-menu a, .ui-menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border: 0; background: transparent; border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text-primary); text-align: left; cursor: pointer; }
.ui-menu a:hover, .ui-menu button:hover { background: var(--surface-soft); text-decoration: none; }
.ui-menu a svg, .ui-menu button svg { width: 18px; height: 18px; color: var(--text-muted); }
.ui-menu .danger { color: var(--danger); }
.ui-menu hr { margin: 6px 0; }
.ui-menu .m-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 12px 6px; text-transform: uppercase; letter-spacing: .06em; }
.ui-menu form { margin: 0; }
.ui-menu label.check { height: 42px; padding: 0 12px !important; }
.ui-overlay { position: fixed; inset: 0; background: rgba(26, 29, 41, .40); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.ui-overlay.open { display: flex; animation: fade-in 140ms ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.ui-dialog { background: var(--surface); border-radius: var(--radius-large); width: 100%; max-width: 540px; padding: 28px; box-shadow: var(--shadow-floating); animation: dialog-in 160ms ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.ui-dialog h3 { font-size: 21px; margin-bottom: 6px; }
.ui-dialog > p { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 18px; }
.d-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ui-cmdk { max-width: 620px; padding: 0; overflow: hidden; }
.ui-cmdk input { width: 100%; height: 60px; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 0 22px; border-bottom: 1px solid var(--border-soft); border-radius: 0; box-shadow: none; }
.ui-cmdk input:focus { box-shadow: none; border-color: var(--border-soft); }
.ck-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.ck-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 12px 14px 6px; }
.ck-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 15px; color: var(--text-primary); cursor: pointer; }
.ck-item:hover, .ck-item.active, .ck-item.sel { background: var(--brand-soft); text-decoration: none; }
.ck-item .ck-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-item .ck-sub, .ck-item .muted { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.ck-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14.5px; }
.ui-drawer-scrim { position: fixed; inset: 0; background: rgba(26, 29, 41, .30); z-index: 90; display: none; }
.ui-drawer-scrim.open, .ui-drawer-scrim.show { display: block; }
.ui-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: var(--surface); box-shadow: var(--shadow-floating); z-index: 95; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 200ms cubic-bezier(.2, .7, .2, 1); border-radius: 24px 0 0 24px; }
.ui-drawer.open { transform: none; }
.ui-drawer-head { display: flex; align-items: center; gap: 12px; padding: 22px 26px; min-height: 68px; }
.ui-drawer-head h3 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-drawer-body { flex: 1; overflow: auto; padding: 6px 26px 26px; }
.ui-drawer-body .sec-title { margin-top: 22px; }
.ui-drawer-body .sec-title:first-child { margin-top: 0; }
.qv-foot { display: flex; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.qv-foot .btn.primary { margin-left: auto; }
.qv-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.qv-head .row-title { font-size: 17px; }
.qv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.qv-stat { padding: 14px 16px; border-radius: 14px; background: var(--surface-soft); display: flex; flex-direction: column; gap: 2px; }
.qv-stat b { font-size: 18px; font-weight: 700; }
.qv-stat span { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.qv-kv .kvr { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; }
.qv-kv .kvr:last-child { border-bottom: 0; }
.qv-kv .kvr span:first-child { color: var(--text-muted); font-weight: 500; }
.qv-kv .kvr span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.ui-toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 120; }
.ui-toast { display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 460px; padding: 14px 18px; border-radius: 14px; background: var(--text-primary); color: #fff; font-size: 14.5px; box-shadow: var(--shadow-floating); opacity: 0; transform: translateY(8px); transition: opacity 160ms ease, transform 160ms ease; }
.ui-toast.show { opacity: 1; transform: none; }
.ui-toast.ok .t-ic { color: #6ee7a0; } .ui-toast.err .t-ic { color: #fda4a4; }
.t-ic { display: inline-flex; align-items: center; }
.flash { padding: 14px 18px; border-radius: 14px; font-size: 14.5px; margin: 16px 0; }
.flash-ok { background: var(--green-soft); color: var(--ok); }
.flash-err { background: var(--danger-weak); color: var(--danger); }
.imp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.imp-bar form { margin: 0; }

/* ── ÖVERSIKT – Marketing Control Center (designankare) ────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--content-gap); }
.kpi-card { background: var(--surface); border-radius: var(--radius-card); padding: 24px 26px 0; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 14px; color: inherit; text-decoration: none; position: relative; overflow: hidden; }
a.kpi-card:hover { text-decoration: none; box-shadow: var(--shadow-card-hover); }
.kpi-top { display: flex; align-items: center; gap: 16px; }
.kpi-ico { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-strong); flex: none; }
.kpi-ico svg { width: 24px; height: 24px; }
.kpi-ico.violet { background: var(--brand-2-weak); color: var(--brand-secondary); }
.kpi-ico.green { background: var(--green-soft); color: var(--green); }
.kpi-ico.amber, .kpi-ico.orange { background: var(--orange-soft); color: var(--orange); }
.kpi-ico.cyan { background: var(--cyan-soft); color: var(--cyan); }
.kpi-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-lbl { font-size: 14.5px; color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-size: var(--fs-kpi); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; display: flex; align-items: baseline; gap: 8px; }
.kpi-value small { font-size: 15px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.kpi-top .delta, .kpi-top .badge { margin-left: auto; align-self: flex-start; }
.kpi-foot { font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-foot b { color: var(--text-primary); font-weight: 700; }
.kpi-spark { height: 52px; margin: 2px -26px 0; }
.kpi-spark svg { width: 100%; height: 100%; display: block; }
.cc-grid, .dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: var(--content-gap); align-items: start; }
.cc-col, .dash-side { display: flex; flex-direction: column; gap: var(--content-gap); }
.cc-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: var(--content-gap); align-items: start; }
.chart-card { padding: 0; }
.chart-card .card-head { padding: 24px 28px 8px; margin: 0; }
.card-head .ch-sub { font-size: 13.5px; color: var(--text-muted); font-weight: 500; }
#chart-wrap { padding: 8px 16px 0; }
#mail-chart { width: 100%; height: 300px; display: block; }
.ch-grid { stroke: var(--line-2); stroke-width: 1; }
.ch-lbl { font-size: 12px; fill: var(--text-muted); font-family: var(--font); }
.ch-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ch-sent { stroke: var(--brand); } .ch-open { stroke: var(--brand-secondary); } .ch-click { stroke: var(--green); }
.chart-legend { display: flex; gap: 20px; padding: 10px 28px 22px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.lg { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.lg-sent { background: var(--brand); } .lg-open { background: var(--brand-secondary); } .lg-click { background: var(--green); }
.att-row, .up-row, .feed-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; min-width: 0; }
.att-row:last-child, .up-row:last-child, .feed-row:last-child { border-bottom: 0; }
.att-ic, .feed-ico { width: 40px; height: 40px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.att-ic svg, .feed-ico svg { width: 18px; height: 18px; }
.att-ic.warn { background: var(--orange-soft); color: var(--orange); } .att-ic.bad { background: var(--danger-weak); color: var(--danger); } .att-ic.ok { background: var(--green-soft); color: var(--green); }
.att-row .btn { margin-left: auto; }
.feed-ico { background: var(--brand-soft); color: var(--brand-strong); }
.feed { display: flex; flex-direction: column; }
.feed-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-row .muted.small, .up-row .muted { color: var(--text-muted); }
.up-when { min-width: 120px; font-weight: 600; color: var(--text-secondary); font-size: 13.5px; }
.up-row .pill { margin-left: auto; }
.aud-big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; display: flex; align-items: baseline; gap: 10px; }
.aud-big small { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.aud-bar { height: 10px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; display: flex; margin: 18px 0 14px; }
.aud-bar span { height: 100%; }
.aud-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.aud-mini > div { background: var(--surface-soft); border-radius: 14px; padding: 14px 16px; }
.aud-mini .k { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.aud-mini .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.aud-mini .s { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.aud-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-secondary); }
.aud-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--content-gap); }
.kpi { display: flex; flex-direction: column; gap: 4px; color: inherit; }
.kpi-label { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.kpi-num { font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
.kpi-cur { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.kpi-sub { font-size: 13.5px; color: var(--text-secondary); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ── CAMPAIGN WORKFLOW ─────────────────────────────────────────── */
.wiz { display: flex; align-items: center; gap: 6px; padding: 0; height: 64px; }
.wiz-step { display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px 0 8px; border-radius: 14px; color: var(--text-muted); font-size: 15px; font-weight: 600; transition: background var(--fast), color var(--fast); }
.wiz-step:hover { background: var(--surface-soft); text-decoration: none; color: var(--text-primary); }
.wiz-step .wiz-n { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--surface-soft); color: var(--text-muted); }
.wiz-step .wiz-n svg { width: 14px; height: 14px; }
.wiz-step.done { color: var(--text-secondary); }
.wiz-step.done .wiz-n { background: var(--green-soft); color: var(--green); }
.wiz-step.active { color: var(--brand-deep); background: var(--surface); box-shadow: var(--shadow-card); }
.wiz-step.active .wiz-n { background: var(--brand-grad); color: #fff; }
.wiz-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--border-soft); }
.wiz-body { padding: 0; margin: 0 !important; }
.wiz-actions { display: flex; align-items: center; gap: 12px; padding: 0; margin-top: var(--content-gap); }
.wiz-actions .btn.primary { margin-left: auto; }
.wf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--content-gap); align-items: start; }
.wf-side { position: sticky; top: calc(var(--topbar-height) + 24px); display: flex; flex-direction: column; gap: var(--content-gap); }
.send-modes { display: flex; flex-direction: column; gap: 10px; }
.mode-row, .pick-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface-soft); border: 2px solid transparent; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.mode-row:hover, .pick-row:hover { background: var(--brand-soft); }
.mode-row:has(input:checked), .pick-row:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mode-row input, .pick-row input { margin-top: 4px; }
.mode-main, .pick-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.mode-name, .pick-name { font-size: 15.5px; font-weight: 700; }
.mode-main .muted.small { font-size: 13.5px; }
.pick-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow: auto; }
.pick-row { align-items: center; }
.pick-row .badge { flex: none; }
.aud-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.aud-ico svg { width: 18px; height: 18px; }
.rev-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--content-gap); }
.rev-summary > div { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 22px 24px; min-width: 0; }
.rev-summary .k { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.rev-summary .v { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.rev-summary .s { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.pf-checks { display: grid; gap: 4px; }
.pf-row { display: flex; align-items: center; gap: 14px; font-size: 14.5px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.pf-row:last-child { border-bottom: 0; }
.pf-row .pf-ic { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pf-row .pf-ic svg { width: 15px; height: 15px; }
.pf-ok .pf-ic { background: var(--green-soft); color: var(--green); } .pf-warn .pf-ic { background: var(--amber-soft); color: var(--amber); } .pf-bad .pf-ic { background: var(--danger-weak); color: var(--danger); }
.pf-row .btn { margin-left: auto; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-4); }
.dev-wrap { display: flex; justify-content: center; background: var(--surface-stage); border-radius: var(--radius-card); padding: 28px; }
.dev-frame { width: 100%; max-width: 720px; height: 600px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-canvas); overflow: hidden; transition: max-width 220ms ease; }
.dev-wrap.mobile .dev-frame { max-width: 390px; }
.preview-frame { width: 100%; height: 100%; border: 0; display: block; }
.pv-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pv-bar .btn { margin-left: auto; }
.bpane { margin-top: 0; }
#bpane-code, #bpane-preview { padding: 24px 0 0; }
.editor-card { padding: 0; }
.test-row { padding: 14px 18px; }

/* ── EMAIL BUILDER – creative-tool-varianten ───────────────────── */
.shell-builder .sidebar { width: 88px; padding: 22px 14px; }
.shell-builder .logo { justify-content: center; padding: 0; }
.shell-builder .logo-img { height: 32px; width: 32px; border-radius: 9px; }
.shell-builder .side-nav .nav-sec, .shell-builder .side-nav a span, .shell-builder .side-nav a .nav-flag, .shell-builder .side-card { display: none; }
.shell-builder .side-nav a { justify-content: center; padding: 0; gap: 0; }
.shell-builder .side-nav a svg { width: 22px; height: 22px; }
.editor-head { display: grid; grid-template-columns: minmax(160px, 1fr) auto auto; align-items: center; gap: 16px; padding: 18px 0 12px; }
.editor-head > div:first-child { flex-direction: row; align-items: center; gap: 8px; }
.editor-head h2 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-head .wiz { height: auto; justify-content: center; }
.editor-head .head-actions { justify-content: flex-end; flex-wrap: nowrap; }
.wiz-body.builder-page { padding: 0; }
.bt-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); padding: 14px 24px; border-radius: var(--radius-card) var(--radius-card) 0 0; box-shadow: 0 1px 0 var(--border-soft); }
.bt-toolbar .field { min-width: 160px; flex: 1; max-width: 320px; font-size: 12.5px; gap: 4px; }
.bt-toolbar .field input { height: 40px; }
.save-status { font-size: 14px; color: var(--ok); font-weight: 700; min-width: 76px; }
.save-status.err { color: var(--danger); }
.bt-sep { width: 1px; height: 30px; background: var(--border-soft); }
.builder { display: grid; grid-template-columns: 284px minmax(0, 1fr) 328px; gap: 0; min-height: calc(100vh - 220px); align-items: stretch; background: var(--surface); border-radius: 0 0 var(--radius-card) var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.b-palette { padding: 24px 22px; background: var(--surface); box-shadow: 1px 0 0 var(--border-soft); overflow-y: auto; align-self: stretch; }
.b-pal-title { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin: 26px 2px 12px; }
.b-pal-title:first-child { margin-top: 0; }
.b-pal { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.b-pal button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 96px; padding: 8px 6px; border: 0; border-radius: 18px; background: var(--surface-soft); font: inherit; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: background var(--fast), box-shadow var(--fast), transform 90ms ease, color var(--fast); }
.b-pal button svg { width: 26px; height: 26px; color: var(--brand-strong); }
.b-pal button:hover:not([disabled]) { background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 10px 24px rgba(84, 104, 240, .16); transform: translateY(-2px); }
.b-pal button[disabled] { opacity: .5; cursor: default; }
.b-pal button .nav-flag { font-size: 10.5px; padding: 1px 7px; }
.b-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-top: 12px; }
.b-stage { background: var(--surface-stage); overflow: auto; padding: 40px 32px 80px; min-width: 0; }
.b-canvas { margin: 0 auto; box-shadow: var(--shadow-canvas); border-radius: 14px; min-height: 240px; }
.blk { position: relative; }
.blk:hover { outline: 1.5px solid rgba(84, 104, 240, .45); outline-offset: -1.5px; }
.blk.sel { outline: 2px solid var(--brand); outline-offset: -2px; }
.blk-tools { position: absolute; top: -16px; right: 10px; display: none; gap: 2px; background: var(--text-primary); border-radius: 12px; padding: 3px 4px; box-shadow: var(--shadow-floating); z-index: 5; }
.blk:hover .blk-tools, .blk.sel .blk-tools { display: flex; }
.blk-tools button { border: 0; background: transparent; width: 30px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; padding: 0; cursor: pointer; }
.blk-tools button:hover { background: rgba(255, 255, 255, .18); }
.blk-tools button svg { width: 14px; height: 14px; }
.blk-tools .drag { cursor: grab; }
.blk-drop, .drop-ind { height: 3px; border-radius: 2px; background: var(--brand); margin: 0 10px; }
.blk-body { min-height: 8px; }
.b-edit { outline: none; min-height: 1em; }
.b-edit:empty:before { content: "Skriv här…"; color: #b6bfce; }
.empty-canvas { padding: 80px 24px; text-align: center; color: var(--text-muted); font-size: 15px; }
.empty-canvas.v2 .ec-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.empty-canvas.v2 .ec-actions { display: flex; gap: 10px; justify-content: center; }
.b-sec { position: relative; border: 1.5px dashed transparent; border-radius: 6px; transition: border-color var(--fast); }
.b-sec:hover { border-color: rgba(84, 104, 240, .35); }
.b-sec.sel { border-color: var(--brand); border-style: solid; }
.b-sec .sec-tools { position: absolute; top: -16px; left: 10px; display: none; gap: 2px; align-items: center; background: var(--text-primary); border-radius: 12px; padding: 3px 6px; z-index: 6; box-shadow: var(--shadow-floating); }
.b-sec:hover .sec-tools, .b-sec.sel .sec-tools { display: inline-flex; }
.sec-tools .sec-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #cdd6ea; text-transform: uppercase; padding: 0 6px; }
.sec-tools button { border: 0; background: transparent; color: #fff; width: 30px; height: 28px; border-radius: 8px; cursor: pointer; }
.sec-tools button:hover { background: rgba(255, 255, 255, .18); }
.b-cols { display: flex; align-items: flex-start; }
.b-col { min-height: 48px; border: 1.5px dashed transparent; border-radius: 6px; transition: border-color var(--fast), background var(--fast); }
.b-sec:hover .b-col { border-color: rgba(139, 147, 166, .35); }
.b-col.sel { border-color: var(--brand-secondary); border-style: solid; background: rgba(139, 92, 246, .05); }
.col-hint { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 20px 8px; }
.b-inspector { background: var(--surface); box-shadow: -1px 0 0 var(--border-soft); padding: 24px 24px 40px; overflow-y: auto; align-self: stretch; font-size: 14px; }
.b-inspector h4 { margin: 0 0 18px; font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.b-inspector .field { gap: 6px; font-size: 13px; }
.b-inspector .field input, .b-inspector .field select { height: 40px; min-height: 40px; font-size: 14px; }
.b-inspector .field textarea { min-height: 140px; height: auto; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.b-inspector input[type="range"] { width: 100%; padding: 0; height: 28px; min-height: 28px; border: 0; box-shadow: none; background: transparent; accent-color: var(--brand); }
.insp-grid { display: grid; gap: 14px; }
.insp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range-val { font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
.rt-bar { display: flex; gap: 3px; margin-bottom: 14px; flex-wrap: wrap; background: var(--surface-soft); border-radius: 12px; padding: 4px; }
.rt-bar button { border: 0; background: transparent; border-radius: 8px; min-width: 36px; height: 36px; font-size: 14px; color: var(--text-secondary); padding: 0 8px; cursor: pointer; }
.rt-bar button:hover { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-card); }
.insp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; }
.insp-head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.insp-sec-title { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.insp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-secondary); padding: 5px 0; }
.insp-row input[type="number"] { width: 86px; height: 38px; padding: 0 10px; font-size: 14px; }
.insp-row select { height: 38px; font-size: 14px; width: auto; }
.color-wrap { display: inline-flex; gap: 8px; align-items: center; }
.color-wrap input[type="color"] { width: 44px; }
.color-wrap .btn { height: 32px; }
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { display: flex; gap: 3px; height: 40px; padding: 6px; border: 2px solid transparent; border-radius: 12px; background: var(--surface-soft); cursor: pointer; }
.preset span { background: var(--border-strong); border-radius: 3px; height: 100%; display: block; }
.preset.active { border-color: var(--brand); background: var(--brand-soft); }
.preset.active span { background: var(--brand); opacity: .6; }
.media-modal { position: fixed; inset: 0; background: rgba(26, 29, 41, .40); z-index: 110; display: flex; align-items: center; justify-content: center; padding: 24px; }
.media-modal-card { background: var(--surface); border-radius: var(--radius-large); width: min(960px, 100%); max-height: 86vh; display: flex; flex-direction: column; padding: 24px 26px; box-shadow: var(--shadow-floating); }
.media-modal-head { display: flex; align-items: center; gap: 10px; }
.media-modal-head h3 { margin-right: auto; font-size: 19px; }
.media-modal-body { overflow: auto; flex: 1; }
.mm-search { width: 100%; height: 42px; margin: 14px 0; }
.mm-status { margin: 10px 0 0; }

/* ── MEDIA – asset library ─────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--content-gap); }
.media-grid.picker { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-item { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-card); transition: box-shadow var(--fast), transform var(--fast); }
.media-item:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.media-item img, .media-pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-stage); }
.media-name { font-size: 14.5px; font-weight: 700; padding: 14px 16px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { font-size: 12.5px; color: var(--text-muted); padding: 3px 16px 10px; }
.media-actions { display: flex; gap: 6px; padding: 0 12px 12px; margin-top: auto; align-items: center; }
.media-actions form { margin: 0; }
.media-pick { border: 2px solid transparent; border-radius: 16px; padding: 0; background: var(--surface-soft); cursor: pointer; overflow: hidden; text-align: left; font: inherit; transition: border-color var(--fast), box-shadow var(--fast); }
.media-pick:hover { border-color: var(--brand); box-shadow: var(--shadow-card-hover); }
.media-pick span { display: block; font-size: 13px; padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-weight: 600; }
.mdir { font-size: 12.5px; color: var(--text-muted); }

/* ── MALLAR – galleri ──────────────────────────────────────────── */
.tpl2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--content-gap); }
.tpl2-card { padding: 0; display: flex; flex-direction: column; overflow: hidden; transition: box-shadow var(--fast), transform var(--fast); position: relative; }
.tpl2-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.tpl2-thumb { height: 260px; overflow: hidden; background: var(--surface-stage); position: relative; }
.tpl2-thumb iframe { width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; }
.tpl2-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); font-size: 14px; }
.tpl2-meta { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px 0; }
.tpl2-meta .row-title { font-size: 16px; }
.tpl2-actions { display: flex; gap: 8px; align-items: center; padding: 12px 20px 16px; }
.tpl2-actions .ui-menu-wrap { margin-left: auto; }
.tpl2-actions form { margin: 0; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--content-gap); }
.tpl-card { display: flex; gap: 16px; align-items: flex-start; color: inherit; padding: 22px 24px; }
.tpl-card:hover { text-decoration: none; box-shadow: var(--shadow-card-hover); transform: translateY(-2px); transition: box-shadow var(--fast), transform var(--fast); }
.tpl-card .hub-ico { width: 48px; height: 48px; border-radius: 15px; }
.tpl-card .hub-ico svg { width: 22px; height: 22px; }
.tpl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tpl-body strong { font-size: 17px; font-weight: 700; }
.tpl-body .muted.small { font-size: 14px; }
.tpl-emoji { display: none; }

/* ── KONTAKTER & CUSTOMER 360 ──────────────────────────────────── */
.filter-list { display: flex; gap: 8px; flex-wrap: wrap; }
.c-row td { height: 62px; }
.c-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: none; }
.c-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.c-id > div { min-width: 0; }
.profile-hero { display: flex; align-items: center; gap: 18px; }
.p-ava { width: 60px; height: 60px; border-radius: 20px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex: none; box-shadow: var(--brand-glow); }
.p-id { flex: 1; min-width: 0; }
.p-id h2 { font-size: var(--fs-entity); }
.p-actions { display: flex; gap: 10px; align-items: center; }
.c360-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.c360-stat { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border-radius: 16px; padding: 14px 20px; box-shadow: var(--shadow-card); min-width: 140px; }
.c360-stat b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.c360-stat span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.list-toggles { display: flex; flex-direction: column; }
.tl-group { margin-bottom: 24px; }
.tl-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; padding-left: 54px; }
.tl-item { display: flex; align-items: flex-start; gap: 16px; padding: 10px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 19px; top: 46px; bottom: -10px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl-item:last-child::before { display: none; }
.tl-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; z-index: 1; }
.tl-ico svg { width: 17px; height: 17px; }
.tl-main { flex: 1; min-width: 0; padding-top: 2px; }
.tl-tit { font-size: 15px; font-weight: 700; }
.tl-sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.tl-time { font-size: 13px; color: var(--text-muted); flex: none; padding-top: 6px; }

/* ── SEGMENT & QUERY BUILDER ───────────────────────────────────── */
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--content-gap); }
.seg-card { display: flex; flex-direction: column; gap: 10px; }
.seg-count { font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
.seg-info { font-size: 14px; color: var(--text-secondary); }
.seg-actions { display: flex; gap: 8px; margin-top: auto; }
.seg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--content-gap); align-items: start; }
.seg-side { display: flex; flex-direction: column; gap: var(--content-gap); position: sticky; top: calc(var(--topbar-height) + 24px); }
.preview-card .preview-count { font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.preview-sample { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 14px; }
.preview-status { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.seg-meta-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qb-group { border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); padding: 18px 20px; position: relative; }
.qb-group .qb-group { margin-left: 28px; background: var(--surface-soft); box-shadow: none; }
.qb-group .qb-group .qb-group { background: var(--surface); }
.qb-group .qb-group::before { content: ""; position: absolute; left: -18px; top: 28px; width: 18px; height: 2px; border-radius: 2px; background: var(--brand-soft-2); }
.qb-ghead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.qb-ops { display: inline-flex; background: var(--surface-soft); border-radius: 12px; padding: 4px; gap: 3px; }
.qb-group .qb-group .qb-ops { background: var(--surface); }
.qb-ops button { border: 0; background: transparent; border-radius: 9px; height: 34px; padding: 0 14px; font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; color: var(--text-muted); cursor: pointer; }
.qb-ops button.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 14px rgba(84, 104, 240, .22); }
.qb-ops button.active.qb-not { background: var(--danger); }
.qb-ghint { font-size: 13.5px; color: var(--text-muted); }
.qb-kids { display: flex; flex-direction: column; gap: 10px; position: relative; }
.qb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-soft); }
.qb-group .qb-group .qb-row { background: var(--surface); }
.qb-row.incomplete { background: var(--amber-soft); }
.qb-row select, .qb-row input { width: auto; height: 40px; font-size: 14px; min-width: 120px; }
.qb-row input[type="number"] { width: 96px; min-width: 0; }
.qb-suffix { font-size: 13.5px; color: var(--text-muted); }
.qb-row .qb-menu-slot { margin-left: auto; }
.qb-add { display: flex; gap: 10px; margin-top: 14px; }
.qb-badge { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.qb-empty { font-size: 14px; color: var(--text-muted); padding: 10px 0; }
.segdef { font-size: 14.5px; }
.segdef ul { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--brand-soft-2); }
.segdef > ul { padding-left: 0; border: 0; }
.segdef li { padding: 4px 0; }
.segdef .sd-op { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--brand-grad); color: #fff; margin-right: 8px; }
.segdef .sd-op.sd-not { background: var(--danger); }
.segdef .sd-cond b { font-weight: 700; }
.rule-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.match-toggle { display: inline-flex; gap: 3px; background: var(--surface-soft); border-radius: 12px; padding: 4px; }
.match-toggle label { cursor: pointer; }
.match-toggle input { display: none; }
.match-toggle span { display: inline-flex; height: 34px; padding: 0 14px; border-radius: 9px; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--text-secondary); }
.match-toggle input:checked + span { background: var(--brand-grad); color: #fff; }

/* ── INSTÄLLNINGAR ─────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--content-gap); align-items: start; margin-top: 30px !important; }
.settings-nav { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px 14px; position: sticky; top: calc(var(--topbar-height) + 24px); }
.settings-nav .sn-title { font-size: 18px; font-weight: 700; padding: 4px 12px 14px; }
.settings-nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 13px; font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.settings-nav a:hover { background: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }
.settings-nav a.active { background: var(--brand-grad); color: #fff; font-weight: 600; box-shadow: var(--brand-glow); }
.settings-nav a svg { width: 19px; height: 19px; opacity: .85; }
.settings-nav a.active svg { opacity: 1; }
.settings-body { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 32px 36px 40px; min-width: 0; }
.settings-body > .page-head { padding: 0 0 20px; border-bottom: 1px solid var(--border-soft); margin-bottom: 24px; }
.settings-body > .page-head h2 { font-size: 24px; }
.settings-body > * + * { margin-top: var(--content-gap); }
.settings-body .card { box-shadow: none; background: var(--surface-soft); }
.settings-body .card .card { background: var(--surface); }
.settings-body .table-scroll { box-shadow: none; background: var(--surface-soft); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--content-gap); }
.hub-card { display: flex; gap: 16px; align-items: flex-start; color: inherit; }
.hub-card:hover { text-decoration: none; box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.hub-card h3 { font-size: 16px; margin-bottom: 4px; }
.hub-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hub-ico svg { width: 20px; height: 20px; }
.hub-sec { margin-top: var(--content-gap); }

/* ── ADMIN & SMÅYTOR ──────────────────────────────────────────── */
.adm-dom { border-top: 1px solid var(--line-2); padding: 14px 0; }
.adm-dom-head { display: flex; align-items: center; gap: 12px; }
.prov-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; }
.prov-log { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-soft); border-radius: 14px; padding: 14px 16px; max-height: 280px; overflow: auto; }
.step-list { display: flex; flex-direction: column; gap: 12px; counter-reset: st; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.step::before { counter-increment: st; content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-grad); color: #fff; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chk-list { display: flex; flex-direction: column; gap: 6px; }
.chk-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 5px 0; }
.chk-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--surface-soft); color: var(--text-muted); flex: none; }
.chk-ic svg { width: 12px; height: 12px; }
.chk-ic.ok { background: var(--green-soft); color: var(--green); } .chk-ic.warn { background: var(--amber-soft); color: var(--amber); } .chk-ic.fail { background: var(--danger-weak); color: var(--danger); }
.err-text { color: var(--danger); font-size: 13.5px; }
.pend { color: var(--text-muted); }
.val { font-weight: 600; }
.t-check { width: 17px; height: 17px; }
.divider { border-top: 1px solid var(--border-soft); margin: var(--s-5) 0; }
.wiz-n svg { width: 14px; height: 14px; }

/* ── AUTH ──────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--app-bg); padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-large); padding: 40px; box-shadow: var(--shadow-floating); }
.auth-logo, .center-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo img, .center-logo img { height: 32px; }
.auth-body h2 { font-size: 24px; margin-bottom: 6px; }
.auth-body .muted { font-size: 14.5px; margin-bottom: 22px; }

/* ── RESPONSIVT ────────────────────────────────────────────────── */
@media (max-width: 1360px) { .builder { grid-template-columns: 250px minmax(0, 1fr) 300px; } }
@media (max-width: 1240px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1040px) {
  .builder { grid-template-columns: 1fr; }
  .b-palette, .b-inspector { box-shadow: none; }
  .b-palette .b-pal { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .cc-grid, .cc-bottom, .dash-grid, .seg-layout, .wf-grid, .settings-layout, .rev-summary { grid-template-columns: 1fr; }
  .settings-nav, .seg-side, .wf-side { position: static; }
  .settings-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .settings-nav .sn-title { display: none; }
}
@media (max-width: 860px) {
  :root { --content-pad: 16px; --sidebar-width: 280px; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform 200ms ease; box-shadow: var(--shadow-floating); }
  .sidebar.open { transform: none; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(26, 29, 41, .35); z-index: 55; }
  .scrim.show { display: block; }
  #menu-btn { display: inline-flex; }
  .tb-center { display: none; }
  .user-txt { display: none; }
  .grid-2, .form-grid, .stat-grid, .stat-grid.five, .kpi-row, .kpi-grid { grid-template-columns: 1fr; }
  .ui-drawer { width: 100vw; border-radius: 0; }
  .wiz-step .wiz-l { display: none; }
  .wiz-step.active .wiz-l { display: inline; }
  .page-head { padding-top: 20px; }
}
.kpi-top { gap: 14px; }
.kpi-lbl { font-size: 15px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.kpi-value .delta, .kpi-value .badge { margin-left: 4px; align-self: center; }
.kpi-card { gap: 10px; }
.kpi-foot { margin-top: 2px; }
.tpl-card { flex-direction: column; gap: 14px; padding: 24px; }
.tpl-head { display: flex; align-items: center; gap: 14px; }
.tpl-head strong { font-size: 18px; font-weight: 700; line-height: 1.25; }
.tpl-desc { font-size: 14.5px; color: var(--text-secondary); line-height: 1.5; }
.tpl-foot { margin-top: auto; display: flex; }
/* Kontaktrad: avatar + namn/e-post i kolumn */
.c-row td:first-of-type a, .c-link { display: inline-flex; align-items: center; gap: 14px; color: inherit; min-width: 0; }
.c-row td a:hover { text-decoration: none; }
.c-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.c-id .row-title { font-size: 15px; }
.c-id .muted.small { font-size: 13px; }
.filter-bar select { width: auto; min-width: 200px; height: var(--control-height-sm); }
.filter-bar .field, .filter-bar .ui-menu-wrap { flex: none; }
a.c-row { display: inline-flex; align-items: center; gap: 14px; color: inherit; min-width: 0; }
a.c-row:hover { text-decoration: none; }
a.c-row:hover .row-title { color: var(--brand-strong); }
.bt-toolbar { flex-wrap: nowrap; }
.bt-toolbar .field { min-width: 120px; max-width: 250px; }
@media (max-width: 1240px) { .bt-toolbar { flex-wrap: wrap; } }

/* ── SELECT / COMBOBOX / WORKSPACE SWITCHER (v5.1.1) ─────────────── */
.lb-select { position: relative; display: block; width: 100%; min-width: 0; }
.lb-select select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; top: 0; }
.lb-select-trigger { display: flex; align-items: center; gap: 10px; width: 100%; height: var(--control-height); padding: 0 12px 0 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-control); background: var(--surface); font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text-primary); text-align: left; cursor: pointer; transition: border-color var(--fast), box-shadow var(--fast), background var(--fast); }
.lb-select-trigger:hover { border-color: var(--border-strong); }
.lb-select-trigger:focus-visible, .lb-select-trigger.open { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.lb-select-trigger > svg:last-child { margin-left: auto; color: var(--text-muted); transition: transform var(--fast); }
.lb-select-trigger.open > svg:last-child { transform: rotate(180deg); }
.lb-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-select-label.placeholder { color: var(--text-muted); }
.lb-select.lb-sm .lb-select-trigger { height: var(--control-height-sm); font-size: 13.5px; }
.lb-menu { position: fixed; z-index: 130; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-floating); padding: 8px; display: flex; flex-direction: column; animation: menu-in 120ms ease-out; }
.lb-menu .lb-list { overflow-y: auto; min-height: 0; }
.lb-option { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.lb-option.active { background: var(--surface-soft); }
.lb-option.selected { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.lb-option.selected.active { background: var(--brand-soft-2); }
.lb-option.disabled { opacity: .45; cursor: default; }
.lb-option-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-check { color: var(--brand-strong); display: inline-flex; }
.lb-group-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 12px 12px 6px; }
.lb-group-title:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.lb-empty { padding: 16px 12px; color: var(--text-muted); font-size: 14px; text-align: center; }
.lb-search { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); color: var(--text-muted); }
.lb-search input { height: 38px; border: 0; background: var(--surface-soft); border-radius: 10px; padding: 0 12px; font-size: 14.5px; }
.lb-search input:focus { box-shadow: none; border: 0; background: var(--brand-soft); }
/* Workspace switcher (topbar) */
.lb-ws .lb-select-trigger { border-color: transparent; background: transparent; height: 44px; font-weight: 700; font-size: 15.5px; padding-left: 6px; border-radius: 12px; width: auto; }
.lb-ws .lb-select-trigger:hover, .lb-ws .lb-select-trigger.open { background: var(--surface-soft); box-shadow: none; }
.lb-ws-ava { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lb-ws-ava.sm { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12.5px; }
.lb-option.selected .lb-ws-ava.sm { background: var(--brand-grad); color: #fff; }
.lb-ws-menu .lb-option { min-height: 46px; }
.ws-select { gap: 4px; }
.ws-select .ss-form { margin: 0; }
.filter-bar .lb-select { width: auto; min-width: 220px; }
.filter-bar .lb-select-trigger, .bulkbar .lb-select-trigger { height: var(--control-height-sm); font-size: 13.5px; }
.b-inspector .lb-select-trigger { height: 40px; font-size: 14px; }
.insp-row .lb-select { width: auto; min-width: 140px; }
.insp-row .lb-select-trigger { height: 38px; }
.qb-row .lb-select { width: auto; min-width: 150px; }
.qb-row .lb-select-trigger { height: 40px; font-size: 14px; }
/* Chart tooltip & cursor */
.ch-empty { font-size: 14px; fill: var(--text-muted); font-family: var(--font); }
.ch-cursor { stroke: var(--brand-soft-2); stroke-width: 2; stroke-dasharray: 4 4; pointer-events: none; }
.ch-dot { pointer-events: none; }
.ch-tip { position: absolute; display: none; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-floating); padding: 12px 14px; min-width: 190px; pointer-events: none; z-index: 5; }
.ch-tip-h { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.ch-tip-r { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-secondary); padding: 3px 0; }
.ch-tip-r i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ch-tip-r b { margin-left: auto; color: var(--text-primary); font-weight: 700; }
/* ── Customer Journey – sessioner (v5.2) ─────────────────────────── */
.jn-session { border-radius: 16px; background: var(--surface-soft); margin-bottom: 10px; }
.jn-session summary { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.jn-session summary::-webkit-details-marker { display: none; }
.jn-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.jn-ico svg { width: 18px; height: 18px; }
.jn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.jn-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.jn-sub { font-size: 13.5px; color: var(--text-secondary); }
.jn-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.jn-time { font-size: 13px; color: var(--text-muted); flex: none; padding-top: 2px; }
.jn-events { padding: 0 16px 14px 70px; display: flex; flex-direction: column; gap: 6px; }
.jn-ev { display: flex; align-items: baseline; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.jn-ev.quiet { color: var(--text-secondary); }
.jn-ev.strong .jn-ev-n { font-weight: 700; color: var(--text-primary); }
.jn-ev-t { font-size: 12.5px; color: var(--text-muted); min-width: 44px; }
.jn-ev-p { font-size: 12px; color: var(--text-muted); }
.settings-body .kpi-row { grid-template-columns: repeat(2, 1fr); }
.settings-body .kpi-lbl { white-space: normal; }
@media (min-width: 1500px) { .settings-body .kpi-row { grid-template-columns: repeat(4, 1fr); } .settings-body .kpi-lbl { white-space: nowrap; } }
/* ── Smart Audience (v5.3) ───────────────────────────────────────── */
.opt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.opt-mode { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-radius: 18px; background: var(--surface-soft); border: 2px solid transparent; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.opt-mode:hover { background: var(--brand-soft); }
.opt-mode:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt-mode input { margin-top: 6px; }
.opt-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--surface); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-card); }
.opt-ico.brand { background: var(--brand-grad); color: #fff; box-shadow: var(--brand-glow); }
.opt-ico svg { width: 20px; height: 20px; }
.opt-main { display: flex; flex-direction: column; gap: 4px; }
.opt-name { font-size: 16px; font-weight: 700; }
.opt-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.opt-panel { margin-top: 18px; padding: 20px 22px; border-radius: 18px; background: var(--surface-soft); }
.opt-sim-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.opt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.opt-stats > div { background: var(--surface); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-card); }
.opt-stats .hl { background: var(--brand-grad); color: #fff; box-shadow: var(--brand-glow); }
.opt-stats .k { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.opt-stats .hl .k { color: rgba(255,255,255,.8); }
.opt-stats .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.opt-bar { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; display: flex; margin: 18px 0 12px; }
.opt-bar span { height: 100%; transition: width 300ms ease; }
.opt-bar .core, .opt-legend i.core { background: var(--brand); }
.opt-bar .expl, .opt-legend i.expl { background: var(--brand-secondary); }
.opt-bar .excl, .opt-legend i.excl { background: var(--border-strong); }
.opt-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); }
.opt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.opt-legend b { color: var(--text-primary); margin-left: 4px; }
@media (max-width: 1040px) { .opt-modes, .opt-stats { grid-template-columns: 1fr; } }
/* ── Automation Builder – workflow canvas (v5.4) ─────────────────── */
.wf-head { grid-template-columns: minmax(200px, 1fr) auto auto; }
.wf-name { font-size: 20px; font-weight: 700; border: 0; background: transparent; height: 40px; min-width: 240px; padding: 0 8px; border-radius: 10px; }
.wf-name:focus { background: var(--surface-soft); box-shadow: none; }
.wf-head-mid { display: flex; align-items: center; gap: 12px; justify-content: center; }
.wf-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; min-height: calc(100vh - 150px); background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.wf-library { padding: 22px 18px; box-shadow: 1px 0 0 var(--border-soft); overflow-y: auto; }
.wf-pal button { height: 84px; font-size: 13px; }
.wf-canvas { position: relative; overflow: hidden; background: var(--surface-stage); background-image: radial-gradient(rgba(84, 104, 240, .14) 1px, transparent 1px); background-size: 24px 24px; cursor: grab; }
.wf-canvas.panning { cursor: grabbing; }
.wf-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wf-edges { position: absolute; left: 0; top: 0; width: 4000px; height: 4000px; overflow: visible; pointer-events: none; }
.wf-edges path.wf-edge { fill: none; stroke: var(--brand-soft-2); stroke-width: 3; stroke-linecap: round; marker-end: url(#wf-arrow); color: var(--brand-soft-2); }
.wf-edges path.wf-edge.yes { stroke: #16a34a; color: #16a34a; }
.wf-edges path.wf-edge.no { stroke: #f0741f; color: #f0741f; }
.wf-edges path.wf-edge.sel { stroke: var(--brand); color: var(--brand); stroke-width: 4; }
.wf-edges path.wf-edge.tmp { stroke: var(--brand); stroke-dasharray: 6 6; marker-end: none; }
.wf-edges path.wf-edge-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.wf-nodes { position: absolute; left: 0; top: 0; }
.wf-node { position: absolute; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-card); padding: 14px 16px 16px; cursor: move; user-select: none; border: 2px solid transparent; transition: box-shadow var(--fast), border-color var(--fast); }
.wf-node:hover { box-shadow: var(--shadow-card-hover); }
.wf-node.sel { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow-card-hover); }
.wf-node-head { display: flex; align-items: center; gap: 10px; }
.wf-node-ico { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wf-node-ico svg { width: 17px; height: 17px; }
.wf-trigger .wf-node-ico { background: var(--brand-grad); color: #fff; }
.wf-action .wf-node-ico { background: var(--brand-soft); color: var(--brand-strong); }
.wf-logic .wf-node-ico { background: var(--orange-soft); color: var(--orange); }
.wf-node-title { font-size: 14.5px; font-weight: 700; flex: 1; }
.wf-del { border: 0; background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer; width: 26px; height: 26px; border-radius: 7px; }
.wf-del:hover { background: var(--danger-weak); color: var(--danger); }
.wf-node-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-missing { color: var(--amber); font-weight: 600; }
.wf-metrics { font-size: 12px; color: var(--brand-deep); background: var(--brand-soft); border-radius: 8px; padding: 4px 8px; margin-top: 8px; font-weight: 600; }
.wf-port { position: absolute; bottom: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); cursor: crosshair; z-index: 2; }
.wf-port:hover { transform: scale(1.25); }
.wf-port.yes { left: 30%; border-color: #16a34a; } .wf-port.no { left: 70%; border-color: #f0741f; }
.wf-port-lbl { position: absolute; bottom: -26px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.wf-port-lbl.yes { left: 30%; margin-left: -8px; color: #16a34a; } .wf-port-lbl.no { left: 70%; margin-left: -12px; color: #f0741f; }
.wf-zoom { position: absolute; right: 16px; top: 16px; z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-card); padding: 4px 8px; font-size: 13px; font-weight: 600; }
.wf-inspector { padding: 22px; box-shadow: -1px 0 0 var(--border-soft); overflow-y: auto; }
.wf-inspector .field { margin-bottom: 12px; }
.wf-filter { gap: 6px; }
.wf-mailcard { background: var(--surface-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.au-flow { display: flex; flex-direction: column; gap: 8px; }
.au-flow-node { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.au-flow-ico { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.au-flow-ico svg { width: 15px; height: 15px; }
.au-flow-ico.au-trigger { background: var(--brand-grad); color: #fff; } .au-flow-ico.au-action { background: var(--brand-soft); color: var(--brand-strong); } .au-flow-ico.au-logic { background: var(--orange-soft); color: var(--orange); }
.au-log { display: flex; flex-direction: column; gap: 2px; }
.au-log-row { display: grid; grid-template-columns: 70px 90px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; align-items: baseline; }
.au-log-t { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); }
.au-log-k { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.au-log-row.au-email .au-log-k, .au-log-row.au-goal .au-log-k { color: var(--brand-strong); } .au-log-row.au-error .au-log-k, .au-log-row.au-exited .au-log-k { color: var(--danger); } .au-log-row.au-completed .au-log-k { color: var(--ok); }
.au-sim .pf-row { padding: 8px 0; }
.au-journey { display: flex; flex-direction: column; gap: 8px; }
.au-j-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-soft); font-size: 14px; }
.au-j-row .pill { margin-left: auto; }
@media (max-width: 1240px) { .wf-shell { grid-template-columns: 220px minmax(0,1fr) 300px; } }
/* ── Journey v2 & funnels (v5.5.1) ─────────────────────────────── */
.jr { display: flex; flex-direction: column; }
.jr-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; position: relative; }
.jr-item::before { content: ""; position: absolute; left: 19px; top: 48px; bottom: -10px; width: 2px; background: var(--line-2); }
.jr-item:last-child::before { display: none; }
.jr-ico { width: 40px; height: 40px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; z-index: 1; }
.jr-ico svg { width: 17px; height: 17px; }
.jr-c-brand { background: var(--brand-soft); color: var(--brand-strong); } .jr-c-violet { background: var(--brand-2-weak); color: var(--brand-secondary); } .jr-c-green { background: var(--green-soft); color: var(--green); } .jr-c-orange { background: var(--orange-soft); color: var(--orange); } .jr-c-soft { background: var(--surface-soft); color: var(--text-secondary); }
.jr-main { flex: 1; min-width: 0; padding-top: 2px; }
.jr-title { font-size: 15px; font-weight: 700; } .jr-title a { color: inherit; }
.jr-sub { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }
.jr-time { font-size: 13px; color: var(--text-muted); flex: none; padding-top: 6px; }
.jr-conversion .jr-title { color: var(--orange); }
.fn { display: flex; flex-direction: column; gap: 14px; }
.fn-step { background: var(--surface-soft); border-radius: 16px; padding: 14px 18px; }
.fn-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.fn-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-grad); color: #fff; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fn-bar { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; margin: 10px 0 8px; }
.fn-bar span { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width 300ms ease; }
.fn-meta { display: flex; gap: 18px; font-size: 13.5px; color: var(--text-secondary); }
/* ── Lenbird AI (v5.6) ─────────────────────────────────────────── */
.ai-top { color: var(--brand-strong); background: var(--brand-soft); }
.ai-top:hover { background: var(--brand-soft-2); }
.ai-spark { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--brand-glow); flex: none; }
.ai-spark svg { width: 20px; height: 20px; } .ai-spark.sm { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; vertical-align: -7px; margin-right: 6px; } .ai-spark.sm svg { width: 14px; height: 14px; }
.ai-ws { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; min-height: calc(100vh - var(--topbar-height) - 56px); background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; margin-top: 24px !important; }
.ai-side { padding: 24px 20px; box-shadow: 1px 0 0 var(--border-soft); display: flex; flex-direction: column; }
.ai-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; } .ai-title { font-size: 18px; font-weight: 700; }
.ai-convs { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.ai-conv { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text-secondary); font-size: 14px; }
.ai-conv:hover { background: var(--surface-soft); text-decoration: none; color: var(--text-primary); }
.ai-main { display: flex; flex-direction: column; min-width: 0; }
.ai-thread { flex: 1; overflow-y: auto; padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; background: var(--app-bg); }
.ai-hero { text-align: center; max-width: 720px; margin: 40px auto; }
.ai-hero-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--brand-glow); margin-bottom: 16px; } .ai-hero-ico svg { width: 28px; height: 28px; }
.ai-hero h2 { font-size: 26px; margin-bottom: 8px; }
.ai-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.ai-q { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); font: inherit; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer; transition: box-shadow var(--fast), transform var(--fast); }
.ai-q:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); } .ai-q svg { width: 22px; height: 22px; color: var(--brand-strong); }
.ai-msg { display: flex; gap: 12px; max-width: 860px; } .ai-user { align-self: flex-end; } .ai-user .ai-bubble { background: var(--brand-grad); color: #fff; box-shadow: var(--brand-glow); }
.ai-avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 4px; }
.ai-bubble { background: var(--surface); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow-card); font-size: 15px; line-height: 1.55; min-width: 0; }
.ai-bubble p { margin: 0 0 8px; } .ai-bubble p:last-child { margin-bottom: 0; } .ai-bubble ul { margin: 6px 0 8px; padding-left: 20px; } .ai-bubble li { margin: 3px 0; }
.ai-src { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; background: var(--brand-soft); color: var(--brand-deep); border-radius: 999px; padding: 2px 9px; margin-left: 4px; }
.ai-src:hover { text-decoration: none; background: var(--brand-soft-2); }
.ai-meta { margin-top: 8px; }
.ai-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ai-card { background: var(--surface-soft); border-radius: 16px; padding: 14px 16px; }
.ai-card-draft { background: var(--brand-soft); } .ai-card-head { display: flex; align-items: center; gap: 12px; }
.ai-card-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ai-card-title { font-size: 15px; font-weight: 700; } .ai-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .ai-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ai-def { background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 11.5px; max-height: 220px; overflow: auto; margin: 10px 0 0; }
.ai-composer { display: flex; gap: 10px; align-items: flex-end; padding: 16px 24px; box-shadow: 0 -1px 0 var(--border-soft); background: var(--surface); }
.ai-composer textarea { flex: 1; min-height: 46px; max-height: 160px; resize: none; border-radius: 14px; }
.ai-panel { margin-top: 16px; } .ai-panel-body { font-size: 14.5px; line-height: 1.55; } .ai-panel-body ul { padding-left: 20px; }
.ai-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-choice { border: 0; background: var(--surface-soft); border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-primary); cursor: pointer; text-align: left; }
.ai-choice:hover { background: var(--brand-soft); color: var(--brand-deep); } .ai-choice.picked { background: var(--brand-grad); color: #fff; } .ai-choice.sm { padding: 7px 11px; font-size: 13px; }
.ai-copybar { margin-top: 8px; } .ai-copy-out { margin-top: 8px; }
.ai-insights .att-row { gap: 10px; } .ai-nl { display: flex; flex-direction: column; gap: 10px; } .ai-nl textarea { min-height: 70px; }
@media (max-width: 1040px) { .ai-ws { grid-template-columns: 1fr; } .ai-side { display: none; } .ai-quick { grid-template-columns: 1fr 1fr; } }

/* ── NOTIFIKATIONER (v5.9) ─────────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 380px; max-width: calc(100vw - 32px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop, var(--shadow-card)); z-index: 60; overflow: hidden; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 1px 0 var(--border-soft); }
.np-list { max-height: 400px; overflow-y: auto; }
.np-empty { padding: 26px 16px; text-align: center; font-size: 14px; }
.np-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; box-shadow: 0 1px 0 var(--border-soft); color: inherit; text-decoration: none; cursor: pointer; }
.np-item:hover { background: var(--surface-soft); text-decoration: none; }
.np-unread { background: var(--brand-soft); }
.np-unread:hover { background: var(--brand-soft-2, var(--brand-soft)); }
.np-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.np-msg { font-size: 12.5px; }
.np-time { font-size: 11.5px; }
.np-foot { display: block; padding: 11px 16px; font-size: 13px; font-weight: 600; text-align: center; color: var(--brand-deep); background: var(--surface-soft); }
.np-foot:hover { text-decoration: none; background: var(--brand-soft); }
@media (max-width: 640px) { .notif-panel { position: fixed; right: 12px; left: 12px; width: auto; } }
