/* Rirofeed design tokens. Warm off-white / near-black, crisp 1px zinc lines, one accent (amber) used only
   for primary actions and the active state. Flat offset shadows instead of blur. Status colours (pos/neg/warn)
   and the Riro Temperature scale are data colours, not accents. */
:root {
  --bg: #faf9f6; --panel: #ffffff; --panel-2: #f3f2ee; --text: #18181b; --muted: #63636b; --border: #e4e4e7; --border-strong: #18181b;
  --accent: #f59e0b; --accent-hover: #d98a06; --accent-ink: #1c1203; --accent-soft: #fdf3dc; --accent-text: #8a4b06;
  --cta: var(--accent); --cta-hover: var(--accent-hover); --cta-ink: var(--accent-ink); --cta-soft: var(--accent-soft); --cta-text: var(--accent-text);
  --pos: #15803d; --pos-text: #166534; --pos-soft: #ecf6ee; --pos-chart: #15803d;
  --neu: #71717a; --neu-text: #3f3f46; --neu-soft: #f3f2ee; --neu-chart: #d4d4d8;
  --neg: #dc2626; --neg-text: #b91c1c; --neg-soft: #fcefee; --neg-chart: #dc2626;
  --warn: #b45309; --warn-text: #92400e; --warn-soft: #fdf3dc;
  --star: #f59e0b; --star-empty: #e4e4e7;
  --radius: 4px; --radius-sm: 3px;
  --shadow: none;
  --shadow-hover: 2px 2px 0 var(--border-strong);
  --shadow-pop: 4px 4px 0 var(--border-strong);
  --font-head: "Plus Jakarta Sans", "DM Sans", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  font-family: var(--font-body); color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f11; --panel: #151518; --panel-2: #1c1c20; --text: #f4f4f5; --muted: #a1a1aa; --border: #27272a; --border-strong: #52525b;
    --accent: #fbbf24; --accent-hover: #fcd34d; --accent-ink: #1c1203; --accent-soft: #2a2110; --accent-text: #fbbf24;
    --pos: #4ade80; --pos-text: #4ade80; --pos-soft: #10241a; --pos-chart: #22c55e;
    --neu-text: #d4d4d8; --neu-soft: #1c1c20; --neu-chart: #52525b;
    --neg: #f87171; --neg-text: #fca5a5; --neg-soft: #2a1415; --neg-chart: #ef4444;
    --warn: #fbbf24; --warn-text: #fcd34d; --warn-soft: #2a2110; --star-empty: #3f3f46;
    --shadow-hover: 2px 2px 0 #000; --shadow-pop: 4px 4px 0 #000; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-head); }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; }
code, pre { font-family: var(--font-mono); font-size: 12.5px; }
pre { background: var(--panel-2); border: 1px solid var(--border); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.caps { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; } .ic.flip { transform: rotate(180deg); }

/* layout */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-logo { height: 34px; width: auto; display: block; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.nav .badge { margin-left: auto; }
.nav a.active .badge { background: var(--accent); color: var(--accent-ink); }
.nav-sec { padding: 18px 12px 6px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar .search { position: relative; flex: 1; max-width: 460px; }
.topbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .search input { padding-left: 36px; background: var(--panel); }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: var(--radius-sm); background: var(--pos-soft); color: var(--pos-text); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sync-pill.off { background: var(--panel-2); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
#view { padding: 28px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 640px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.split.even { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } .split, .split.even { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-direction: row; overflow-x: auto; gap: 4px; padding: 10px; }
  .side .brand, .nav-sec, .account { display: none !important; }
  .nav { display: flex; gap: 4px; } .nav a { white-space: nowrap; }
  .topbar { padding: 10px 16px; } .topbar .sync-pill, .topbar .spacer { display: none; } .topbar .search { min-width: 0; }
  #view { padding: 20px 16px 48px; }
  h1 { font-size: 26px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}

/* components */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card.tight { padding: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.card-foot { margin: 20px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; align-items: center; gap: 10px; }
/* Icons sit bare beside their label: no badge behind them. */
.icon-tile { display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.kpi { display: flex; flex-direction: column; min-height: 168px; }
.kpi .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kpi .value { font-family: var(--font-head); font-size: 36px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi .foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 600 14px/1.25 var(--font-head); cursor: pointer; white-space: nowrap; letter-spacing: .005em; }
.btn:hover { background: var(--panel-2); border-color: var(--border-strong); text-decoration: none; }
.btn:focus-visible, .nav a:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--border-strong); box-shadow: 2px 2px 0 var(--border-strong); }
.btn.primary:active, .btn.cta:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.cta { background: var(--cta); color: var(--cta-ink); border-color: var(--border-strong); box-shadow: 2px 2px 0 var(--border-strong); }
.btn.cta:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn.soft { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.btn.soft:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent) 20%); }
.btn.good { background: var(--pos-soft); color: var(--pos-text); border-color: transparent; }
.btn.danger { color: var(--neg-text); }
.btn.danger.solid { background: var(--neg-text); color: #fff; border-color: var(--neg-text); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--radius-sm); font: 600 12px/1.6 var(--font-head); letter-spacing: .01em; background: var(--neu-soft); color: var(--neu-text); white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; }
.pill.positive, .pill.success, .pill.approved, .pill.live { background: var(--pos-soft); color: var(--pos-text); }
.pill.positive .dot, .pill.live .dot { background: var(--pos); }
.pill.negative, .pill.failed, .pill.rejected, .pill.closed { background: var(--neg-soft); color: var(--neg-text); }
.pill.negative .dot { background: var(--neg); }
.pill.neutral .dot { background: var(--neu); }
.pill.new, .pill.draft, .pill.skipped, .pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.caps-pill { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.badge { background: var(--cta); color: #fff; border-radius: var(--radius-sm); font-size: 11px; padding: 1px 7px; font-weight: 700; }
.count { display: inline-block; min-width: 20px; padding: 0 7px; margin-left: 6px; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-strong); box-shadow: inset 0 0 0 1px var(--border-strong); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
input[type=color] { -webkit-appearance: none; appearance: none; padding: 0; height: 30px; width: 30px; min-height: 0; border: 2px solid var(--panel); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); cursor: pointer; background: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
input[type=color].on { box-shadow: 0 0 0 2px var(--text); }
textarea { min-height: 84px; resize: vertical; }
/* Dropdowns: our own button + listbox (app.js enhanceSelect); the native select is kept only as the value. */
.dd { position: relative; display: block; width: 100%; min-width: 0; }
.dd > select { display: none; }
.dd-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 9px 14px; font: inherit; color: var(--text); text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.dd-btn:hover { border-color: var(--border-strong); }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--border-strong); box-shadow: inset 0 0 0 1px var(--border-strong); }
.dd-btn:disabled { cursor: not-allowed; opacity: .55; border-color: var(--border); }
.dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { margin-right: 2px; color: var(--muted); transform: rotate(90deg); transition: transform .12s; }
.dd.open .dd-chev { transform: rotate(-90deg); color: var(--text); }
.dd-menu { position: fixed; z-index: 100; max-width: min(420px, calc(100vw - 16px)); overflow-y: auto; padding: 4px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.dd-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.dd-opt span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dd-opt.active { background: var(--panel-2); }
.dd-opt[aria-selected="true"] { font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.dd-opt[aria-selected="true"] .ic { color: var(--accent-text); }
.dd-opt[aria-disabled="true"] { color: var(--muted); opacity: .6; cursor: default; }
.dd-group { padding: 10px 10px 4px; font-size: 10.5px; }
.dd-group:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: flex; justify-content: space-between; font: 600 13px var(--font-head); margin-bottom: 6px; color: var(--text); }
label.field > span em { font: 400 12px var(--font-body); font-style: normal; color: var(--muted); }
.prefix-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); padding-left: 12px; }
.prefix-input:focus-within { border-color: var(--border-strong); box-shadow: inset 0 0 0 1px var(--border-strong); }
.prefix-input span { color: var(--muted); white-space: nowrap; }
.prefix-input input { border: 0; padding-left: 2px; box-shadow: none !important; }
.prefix-input.suffix { padding: 0 12px 0 0; }
.prefix-input.suffix input { min-width: 0; padding: 9px 2px 9px 12px; text-align: right; }
.check { display: flex; align-items: center; gap: 9px; margin: 6px 0; cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2); white-space: nowrap; font: 700 11px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel-2); }
tr.hot td { background: color-mix(in srgb, var(--neg-soft) 70%, var(--panel)); }
.table-wrap { overflow-x: auto; margin: -24px; border-radius: var(--radius); }
.table-wrap table { min-width: 720px; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 24px; }
.table-wrap th:last-child, .table-wrap td:last-child { padding-right: 24px; }
.clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.who-cell { display: flex; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 4px; margin-right: 18px; color: var(--muted); font: 600 15px var(--font-head); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-sm); background: var(--panel-2); flex-wrap: wrap; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--font-head); cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; }
.seg .active { background: var(--panel); color: var(--accent-text); box-shadow: var(--shadow); }
.seg .active .count { background: var(--accent); color: var(--accent-ink); }
.qf { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qf button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 500 13px Inter, sans-serif; cursor: pointer; }
.qf button:hover { border-color: var(--border-strong); }
.qf button.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon-tile { margin: 0 auto 12px; width: 48px; height: 48px; }
.empty b { display: block; color: var(--text); font: 600 16px var(--font-head); margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.stack > * + * { margin-top: 20px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; }
.banner.warn { background: var(--warn-soft); color: var(--warn-text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.banner.bad { background: var(--neg-soft); color: var(--neg-text); }
.pager { display: flex; align-items: center; gap: 6px; }
.pager button { min-width: 34px; height: 34px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text); font: 600 13.5px var(--font-head); cursor: pointer; }
.pager button:hover:not(:disabled) { background: var(--panel-2); }
.pager button.on { background: var(--accent); color: var(--accent-ink); }
.pager button:disabled { color: var(--muted); cursor: default; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 220px; }
.bars .b { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; min-height: 3px; }
.bars .b span { display: block; border-radius: 3px; }
/* 7-day bars: each day is a faint full-height track with its count filled from the bottom, so empty days still read as a chart. */
.mini-bars { display: flex; align-items: stretch; gap: 4px; height: 30px; flex-shrink: 0; }
.mini-bars i { width: 9px; display: flex; align-items: flex-end; border-radius: 2px; background: color-mix(in srgb, var(--text) 9%, transparent); overflow: hidden; }
.mini-bars b { display: block; width: 100%; background: color-mix(in srgb, var(--text) 40%, transparent); }
.mini-bars i:last-child b { background: var(--text); }
.kpi .foot:has(.mini-bars) { align-items: flex-end; }
.hbar { margin: 0 0 16px; }
.hbar .lbl { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.hbar .lbl b { font-variant-numeric: tabular-nums; }
.hbar .track { height: 8px; background: var(--panel-2); border-radius: var(--radius-sm); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--text); border-radius: var(--radius-sm); }
.hbar.inline { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 44px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.npsbar { display: flex; height: 8px; border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); gap: 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 4px 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13px; font-weight: 500; }
.chip.small { padding: 2px 10px; font-size: 12px; }
.chip.positive { background: var(--pos-soft); color: var(--pos-text); } .chip.negative { background: var(--neg-soft); color: var(--neg-text); }

/* feed */
.feed-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-item:hover .quote { color: var(--accent-text); }
.feed-item .meta { font-size: 13px; color: var(--muted); }
.feed-item .meta b { color: var(--text); font-weight: 600; }
.feed-item .quote { margin-top: 4px; font-size: 14.5px; }
.feed-item .right { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); margin-bottom: 10px; color: inherit; }
.list-row:hover { text-decoration: none; background: color-mix(in srgb, var(--panel-2) 70%, var(--accent-soft)); }
.list-row .ic { color: var(--muted); }
.crm-card { background: var(--accent-soft); border: 0; }

/* builder */
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.section-head h2 { font-size: 20px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.q-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); margin-bottom: 10px; transition: border-color .15s; }
.q-item:hover { border-color: var(--border-strong); }
.q-item.open { border-color: var(--border-strong); background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }
.q-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 56px; }
.q-top .clip { -webkit-line-clamp: 1; max-width: none; font-weight: 500; }
.q-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.q-type { font-size: 12px; color: var(--muted); white-space: nowrap; }
.q-body { padding: 16px 14px 14px; border-top: 1px solid var(--border); }
.add-q { width: 100%; justify-content: center; border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); padding: 13px; }
.add-q:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-grid button { text-align: left; padding: 10px 12px; border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: var(--text); }
.type-grid button:hover { border-color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 2px var(--text); }
.option-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel-2); }
.preview-shell { background: var(--panel-2); border-radius: var(--radius); padding: 16px; }
.preview-frame { display: block; width: 100%; height: 660px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin: 0 auto; transition: width .2s; box-shadow: var(--shadow-hover); }
.preview-frame.mobile { width: 375px; max-width: 100%; }
.sticky { position: sticky; top: 84px; }
.save-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }

/* testimonials */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.t-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.t-card.pending { border-top: 3px solid var(--warn); }
.t-card.featured { border-top: 3px solid var(--accent); }
.t-card .body { padding: 20px 22px 18px; flex: 1; }
.t-card .quote { margin: 14px 0 18px; font-size: 15.5px; line-height: 1.6; }
.t-card .who { display: flex; align-items: center; gap: 12px; }
.t-card .who b { font: 600 15px var(--font-head); }
.t-card .actions { display: flex; align-items: center; gap: 4px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--border); background: var(--panel-2); flex-wrap: wrap; }
.consent { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--pos-text); }
.consent.no { color: var(--warn-text); }
.wall-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 22px 24px; border-radius: var(--radius); background: var(--accent-soft); }
.wall-bar .icon-tile { color: var(--accent-text); }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font: 700 13.5px var(--font-head); flex-shrink: 0; }
.avatar.neg { background: var(--neg-soft); color: var(--neg-text); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.stars { color: var(--star); letter-spacing: 2px; font-size: 15px; white-space: nowrap; }
.stars .off { color: var(--star-empty); }

/* modal / toast */
.overlay { position: fixed; inset: 0; background: rgba(15,15,17,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: var(--radius); width: min(620px, 100%); max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-pop); border: 1px solid var(--border-strong); }
.modal h2 { margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#toast div { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 550; box-shadow: var(--shadow-pop); }
#toast div.err { background: var(--neg-text); color: #fff; }
.conn-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; flex-shrink: 0; }
.funnel { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.copy-row { display: flex; gap: 8px; } .copy-row input { font-family: var(--font-mono); font-size: 12.5px; }

/* workspace label under the brand (RiroCRM workspaces) */
.ws-label { margin: -14px 8px 14px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.ws-label .dd-btn { min-height: 0; padding: 4px 8px; font-size: 13px; font-weight: 600; background: transparent; border-color: transparent; }
.ws-label .dd-btn:hover { border-color: var(--border); }
.account { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.plan-card.current { border-color: var(--border-strong); box-shadow: 3px 3px 0 var(--accent); }
.plan-card ul { margin: 12px 0 16px; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.meter { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--text); }
.meter i.full { background: var(--neg-text); }
.ws-label img { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.ws-label b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* on/off switch */
.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--radius-sm); background: var(--border-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 2px; background: #fff; box-shadow: none; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; } .switch input:disabled + span { opacity: .5; }

/* automations */
.auto-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.auto-row:first-child { border-top: 0; padding-top: 0; }
.auto-row .grow { flex: 1; min-width: 0; }
.auto-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.auto-flow .ic { width: 14px; height: 14px; }
.auto-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-num { width: 76px; display: inline-block; }
.delay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) {
  .auto-row { flex-wrap: wrap; }
  .auto-row .grow { flex-basis: calc(100% - 60px); }
  .auto-stats { justify-content: flex-start; width: 100%; padding-left: 52px; }
}
.ev-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.ev-row:first-of-type { border-top: 0; }
.ev-row .grow { flex: 1; min-width: 120px; }
@media (max-width: 760px) { .ws-label { display: none !important; } }

/* Riro Temperature */
.temp-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.temp-deg { font: 800 44px/1.1 var(--font-head); letter-spacing: -.02em; margin: 4px 0; }
.temp-bars { display: flex; gap: 10px; align-items: flex-end; height: 86px; }
.temp-bars .tb { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 34px; height: 100%; justify-content: flex-end; }
.temp-bars .tb i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; min-height: 4px; }
.temp-bars .tb span { font-size: 18px; line-height: 1; }
.temp-bars .t1 { background: #2563eb; } .temp-bars .t2 { background: #0ea5e9; } .temp-bars .t3 { background: #a3a3a3; } .temp-bars .t4 { background: #f59e0b; } .temp-bars .t5 { background: #ef4444; }
.temp-preview { background: #fff; border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; overflow-x: auto; }

/* A band of figures: one bordered strip, cells split by rules, the first one wider. */
.band { display: grid; grid-template-columns: minmax(0, 1.4fr); grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; border: 1px solid var(--border-strong); background: var(--panel); border-radius: var(--radius); }
.band > .card { border: 0; border-radius: 0; background: transparent; box-shadow: none; border-left: 1px solid var(--border); min-height: 0; }
.band > .card:first-child { border-left: 0; }
.band .kpi { min-height: 150px; }
@media (max-width: 1180px) { .band { grid-template-columns: 1fr 1fr; grid-auto-flow: row; } .band > .card:nth-child(odd) { border-left: 0; } .band > .card:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; grid-auto-flow: row; } .band > .card { border-left: 0; } .band > .card + .card { border-top: 1px solid var(--border); } }
/* Figures: the heading face with even-width digits, so columns of numbers line up. Mono is only for code. */
.kpi .value, .stat .value, .temp-deg { font-family: var(--font-head); font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.temp-card { border-color: var(--border-strong); }

/* Dashboard charts: a 12-column grid with uneven spans. */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.bento > .b-5 { grid-column: span 5; } .bento > .b-7 { grid-column: span 7; }
@media (max-width: 1180px) { .bento > .b-5, .bento > .b-7 { grid-column: span 12; } }
.bento .big { font: 800 34px/1.1 var(--font-head); letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin: 8px 0 2px; display: flex; align-items: baseline; gap: 10px; }
.bento .big-unit { font: 600 14px var(--font-body); color: var(--muted); letter-spacing: 0; }
.bento .chart { margin-top: 14px; position: relative; }
.delta { font: 700 13px var(--font-body); letter-spacing: 0; color: var(--muted); }
.delta.up { color: var(--pos-text); } .delta.down { color: var(--neg-text); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend i.faint { background: var(--muted); opacity: .4; }
.periods { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--radius); margin: 14px 0; }
.periods button { text-align: left; background: none; border: 0; border-left: 1px solid var(--border); padding: 10px 14px; cursor: pointer; color: var(--text); font: inherit; display: grid; gap: 2px; }
.periods button:first-child { border-left: 0; }
.periods button[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--accent); background: var(--panel-2); }
.periods .pl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.periods .pv { font: 800 22px/1.1 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tm-tile { position: absolute; border-radius: 2px; padding: 9px 10px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: opacity .5s, transform .5s; }
.tm-tile:hover { filter: brightness(1.08); }
.tm-name { font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.tm-v { font: 800 24px/1 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tm-share { font: 700 11px var(--font-body); background: #18181b; color: #fff; padding: 2px 5px; border-radius: 2px; }
.c-empty { display: grid; place-items: center; height: 100%; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.season-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.season-stats .mid { font: 800 26px/1.1 var(--font-head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kv-rows { margin-top: 12px; } .kv-rows div { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding: 10px 0; font-size: 13.5px; }
.kv-rows span { color: var(--muted); } .kv-rows b { font-variant-numeric: tabular-nums; }
/* SVG parts */
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-axisline { stroke: var(--border-strong); stroke-width: 1; }
.c-axis { fill: var(--muted); font: 500 10.5px var(--font-body); font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; }
.c-area { fill: color-mix(in srgb, var(--text) 7%, transparent); }
.c-dot { fill: var(--text); stroke: var(--panel); stroke-width: 2; }
.c-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.c-radar { stroke-width: 2; stroke-linejoin: round; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); box-shadow: 3px 3px 0 var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
.chart-tip .tt { color: var(--muted); margin-bottom: 4px; }
.chart-tip .tr { display: flex; justify-content: space-between; gap: 16px; }
.chart-tip .tr span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.chart-tip .tr i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip .tr b { font-variant-numeric: tabular-nums; }

/* Settings: one page with tabs for workspace, team, billing, connections, API and profile. */
.settings-head { margin-bottom: 8px; }
.settings-head .caps { margin-bottom: 6px; }
.settings-head .tabs { margin-bottom: 20px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.kv-row:first-of-type { border-top: 0; }
.account a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.account a:hover { color: var(--text); }

/* Settings → Brand: the logo on a checkerboard (so transparent edges show), and a small respondent-side preview
   drawn in the customer's colour and font rather than ours. */
.logo-drop { display: grid; place-items: center; min-height: 112px; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--panel-2) 0% 25%, var(--panel) 0% 50%) 0 0 / 16px 16px; }
.logo-drop img { max-height: 72px; max-width: 100%; object-fit: contain; }
.brand-preview { --p-bg: #faf9f6; --p-panel: #fff; --p-text: #18181b; --p-muted: #63636b; --p-border: #d4d4d8; --p-line: #18181b; --p-soft: #f3f2ee;
  background: var(--p-bg); color: var(--p-text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px 18px 14px;
  font-family: var(--b-font, var(--font-body)); }
.brand-preview.dark { --p-bg: #0f0f11; --p-panel: #151518; --p-text: #f4f4f5; --p-muted: #a1a1aa; --p-border: #3f3f46; --p-line: #71717a; --p-soft: #1c1c20; }
.bp-card { background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 4px; padding: 0 20px 20px; overflow: hidden; }
.bp-bar { height: 4px; background: var(--b); margin: 0 -20px 20px; }
.bp-logo { display: block; max-height: 34px; max-width: 160px; object-fit: contain; margin-bottom: 14px; }
.bp-title { font: 800 21px/1.2 var(--b-font, var(--font-head)); letter-spacing: -.025em; }
.bp-desc { color: var(--p-muted); font-size: 13px; margin: 4px 0 18px; }
.bp-q { font: 600 14px var(--b-font, var(--font-head)); margin-bottom: 8px; }
.bp-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; margin-bottom: 14px; }
.bp-scale span { display: grid; place-items: center; height: 30px; border: 1px solid var(--p-border); border-radius: 3px; font: 700 12px var(--b-font, var(--font-head)); font-variant-numeric: tabular-nums; }
.bp-scale .sel { background: var(--b); color: var(--b-ink); border-color: var(--p-line); }
.bp-opt { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--p-line); border-radius: 3px; background: var(--p-soft); box-shadow: inset 3px 0 0 var(--b); font-size: 13px; margin-bottom: 16px; }
.bp-opt span { width: 12px; height: 12px; border-radius: 50%; border: 4px solid var(--b); }
.bp-btn { display: inline-block; background: var(--b); color: var(--b-ink); border: 1px solid var(--p-line); box-shadow: 2px 2px 0 var(--p-line); border-radius: 3px; padding: 9px 18px; font: 700 13.5px var(--b-font, var(--font-head)); }
.bp-powered { text-align: center; color: var(--p-muted); font-size: 11.5px; margin-top: 12px; }
.swatches .brand-swatch { display: grid; place-items: center; }
.swatches .brand-swatch span { font: 800 11px var(--font-head); color: #fff; mix-blend-mode: difference; }
.field-label { display: block; font: 600 13px var(--font-head); margin-bottom: 6px; }
