:root {
  --bg: #F5F7FA;
  --paper: #FFFFFF;
  --ink: #15202E;
  --ink-2: #475467;
  --ink-3: #6B7686;
  --line: #E3E8EF;
  --line-2: #EEF1F5;
  --act: #4338CA;
  --act-2: #3730A3;
  --act-soft: #EEF0FF;
  --pos: #12857A;
  --teal: #12857A;
  --teal-2: #0E6B62;
  --teal-soft: #E3F4F1;
  --neg: #C0365E;
  --mid: #A3ADBA;
  --r: 12px;
  --r-s: 8px;
  --shadow: 0 1px 2px rgba(21, 32, 46, .05), 0 0 0 1px rgba(21, 32, 46, .04);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a, a:hover { color: var(--act); text-decoration: none; }
a:hover { color: var(--act-2); }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0; }
small, .muted { color: var(--ink-3); }
td.n, td.num, .hb-v, .legend b { font-variant-numeric: tabular-nums; }

/* shell */
#app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
#nav { background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
#nav .brand { display: flex; gap: 10px; align-items: center; font-weight: 750; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); padding: 4px 8px 22px; }
#nav .sect { font-size: 12px; color: var(--ink-3); padding: 14px 10px 6px; }
#nav a.nl { color: var(--ink-2); padding: 8px 10px; border-radius: var(--r-s); font-size: 14.5px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
#nav a.nl svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
#nav a.nl:hover { background: var(--bg); color: var(--ink); }
#nav a.nl.on { background: var(--act-soft); color: var(--act); font-weight: 650; }
#nav .navfoot { margin-top: auto; font-size: 12.5px; color: var(--ink-3); padding: 10px; border-top: 1px solid var(--line-2); }
#nav .navfoot b { color: var(--ink); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

#view { padding: 30px 36px 80px; max-width: 1360px; width: 100%; min-width: 0; box-sizing: border-box; outline: none; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.head p { color: var(--ink-2); max-width: 78ch; margin-top: 6px; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.g2, .g3, .g4, .g21, .g12 { display: grid; gap: 18px; align-items: stretch; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
.mt { margin-top: 18px; }
.stack > * + * { margin-top: 12px; }

.panel { background: var(--paper); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.panel > h2 { margin-bottom: 4px; }
.panel > .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

.kpi { background: var(--paper); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.kpi small { font-size: 13px; }
.kpi b { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.kpi .delta { font-size: 12.5px; color: var(--ink-3); }

.btn { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--act); background: var(--act); color: #fff; padding: 9px 16px; border-radius: var(--r-s); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.btn { transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--act-2); border-color: var(--act-2); color: #fff; box-shadow: 0 6px 18px rgba(67, 56, 202, .28); transform: translateY(-1px); }
.btn:active { transform: none; box-shadow: none; }
.btn.ghost { background: var(--paper); color: var(--act); border-color: #C9CDF4; }
.btn.ghost:hover { background: var(--act-soft); color: var(--act-2); border-color: #B9BEF2; box-shadow: 0 4px 14px rgba(67, 56, 202, .12); }
.btn.quiet { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn.quiet:hover { background: var(--bg); color: var(--ink); border-color: #CBD3DE; box-shadow: 0 3px 10px rgba(21, 32, 46, .07); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--act); outline: none; box-shadow: 0 0 0 3px var(--act-soft); }
textarea { min-height: 90px; resize: vertical; }
select.inline { width: auto; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 14px; background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--act); border-color: var(--act); font-weight: 650; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #FAFBFC; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F8F9FD; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.run { background: var(--act-soft); color: var(--act); }
.pill.ok { background: #E3F4F1; color: var(--pos); }
.pill.err { background: #FBE7EE; color: var(--neg); }

.big { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.ci { color: var(--ink-3); font-size: 13px; }
.sc { display: inline-flex; min-width: 36px; justify-content: center; padding: 3px 7px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #fff; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 500 12px "Schibsted Grotesk", sans-serif; fill: var(--ink-3); }
.chart text.lb { fill: var(--ink-2); font-weight: 650; }
.chart .vl { fill: var(--ink); font-weight: 700; }
.chart .grid line, .chart .grid polygon { stroke: var(--line); fill: none; }
.chart.radar { max-width: 360px; margin: 0 auto; }
.radar text { font-size: 11.5px; fill: var(--ink-2); }
.hb { display: grid; grid-template-columns: minmax(150px, 1.5fr) 2fr 56px; gap: 9px 14px; align-items: center; font-size: 13.5px; }
.hb-l { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { position: relative; height: 12px; background: var(--line-2); border-radius: 6px; }
.hb-t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.hb-t.dv::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1.5px; background: var(--ink-3); opacity: .5; }
.hb-v { text-align: right; font-weight: 650; color: var(--ink); font-size: 13px; }
.hb-v small { display: block; font-weight: 400; font-size: 11.5px; }
.stack100 { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.stack100 i { display: block; height: 100%; }
.heat { font-size: 13px; }
.heat th { text-align: center; background: none; }
.heat td { text-align: center; font-weight: 650; border: 2px solid #fff; border-radius: 6px; padding: 8px 6px; }
.heat td.hl { text-align: left; font-weight: 500; background: none; color: var(--ink-2); }
.heat td.hl small { display: block; color: var(--ink-3); font-weight: 400; font-size: 11.5px; }

.field-wrap { position: relative; }
canvas.crowd { width: 100%; display: block; border-radius: var(--r-s); border: 1px solid var(--line-2); cursor: crosshair; }
.crowd-tip { position: absolute; pointer-events: none; background: var(--paper); border-radius: var(--r-s); padding: 9px 11px; font-size: 13px; box-shadow: 0 8px 28px rgba(21, 32, 46, .16), 0 0 0 1px var(--line); max-width: 260px; display: none; z-index: 5; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.scale { display: inline-block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--neg), var(--mid), var(--pos)); width: 160px; vertical-align: middle; }

/* persona */
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 19px; color: #fff; flex: none; }
.avatar.s { width: 36px; height: 36px; font-size: 13px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 7px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.cols { columns: 2 360px; column-gap: 18px; }
.cols > * { break-inside: avoid; margin-bottom: 18px; }
.quote { font-size: 16px; color: var(--ink); border-left: 3px solid var(--act); padding-left: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; padding: 3px 9px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }

/* verbatims and chat */
.voice { padding: 16px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.voice .who { font-size: 13px; color: var(--ink-3); }
.voice .mono { color: var(--ink-2); font-style: italic; margin-top: 4px; }
.voice .why { font-size: 13px; color: var(--ink-2); margin-top: 8px; background: #F7F8FB; border-radius: var(--r-s); padding: 8px 11px; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 600px; overflow: auto; padding: 4px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; background: var(--bg); }
.msg.me { align-self: flex-end; background: var(--act); color: #fff; }
.msg.mod { background: var(--ink); color: #fff; }
.msg.res { background: var(--act-soft); color: var(--act); }
.msg .n { font-weight: 700; font-size: 13px; display: block; margin-bottom: 2px; }
.msg .s { font-size: 12px; opacity: .8; margin-left: 6px; font-weight: 600; }

.feed { max-width: 480px; }
.post { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.post .body { padding: 14px 16px; }
.post img { width: 100%; display: block; }
.cm { padding: 9px 16px; border-top: 1px solid var(--line-2); font-size: 14px; }
.cm b { margin-right: 6px; }

.sl { display: grid; grid-template-columns: 170px 1fr 36px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
input[type=range] { accent-color: var(--act); padding: 0; border: 0; }
.variant { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: #FAFBFC; }
.drop { border: 1.5px dashed #C3CAD5; border-radius: var(--r); padding: 22px; text-align: center; color: var(--ink-3); cursor: pointer; background: #FAFBFC; }
.drop.has { border-style: solid; }
.drop img { max-width: 100%; max-height: 220px; border-radius: var(--r-s); }

.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--act); transition: width .4s; }
#toast { position: fixed; bottom: 22px; right: 22px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r-s); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; max-width: 420px; font-size: 14px; }
#toast.on { opacity: 1; transform: none; }
#toast.err { background: var(--neg); }
.empty { padding: 34px; text-align: center; color: var(--ink-3); }
.note { background: #FFF7E0; border: 1px solid #F3E2AE; border-radius: var(--r-s); padding: 10px 13px; font-size: 13.5px; color: #5E4800; }

@media (max-width: 1100px) { .g4 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  #nav .brand { width: 100%; padding-bottom: 8px; }
  #nav .sect, #nav .navfoot { display: none; }
  #view { padding: 20px 14px 60px; }
  .g2, .g3, .g4, .g21, .g12 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .hb { grid-template-columns: 100px 1fr 50px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.donut { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.legend.col { flex-direction: column; gap: 6px; margin-top: 0; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gauge { text-align: center; font-size: 12.5px; color: var(--ink-2); }
.gauge svg { max-width: 130px; margin: 0 auto; }

/* new study */
.form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.steps-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px 24px; display: grid; grid-template-columns: 36px 1fr; gap: 16px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--act-soft); color: var(--act); font-weight: 750; display: grid; place-items: center; font-size: 14px; }
.step-b { min-width: 0; }
.step-b > h2 { margin: 4px 0 2px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid select[multiple] { min-height: 104px; }
.sliders .sl { grid-template-columns: 200px 1fr 40px; }
.summary { position: sticky; top: 20px; }
.sumkv { grid-template-columns: 110px 1fr; font-size: 14px; }
.sumkv dd { font-weight: 600; }
.aud { margin-top: 16px; padding: 14px; border-radius: var(--r-s); background: var(--act-soft); display: flex; flex-direction: column; gap: 2px; }
.aud b { font-size: 28px; color: var(--act); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.btn.wide { width: 100%; justify-content: center; }
.rule { display: grid !important; grid-template-columns: 150px 1fr 90px 210px auto; gap: 8px; }
.rvwrap { display: flex; gap: 8px; align-items: center; }
.rvwrap input[type=range] { flex: 1; }
label .rv-out { float: right; color: var(--act); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } .summary { position: static; } }
@media (max-width: 700px) { .fgrid { grid-template-columns: 1fr; } .fgrid .span2 { grid-column: auto; } .step { grid-template-columns: 1fr; } .rule { grid-template-columns: 1fr 1fr; } .sliders .sl { grid-template-columns: 1fr 1fr 36px; } }

/* equal control heights; one select style across browsers */
input:not([type=range]):not([type=checkbox]):not([type=file]), select:not([multiple]) { height: 40px; line-height: 1.2; }
select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%236B7686' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
.btn.small { height: 32px; }
.row > input, .row > select { margin: 0; }

/* market picker in the study form */
.mkts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 40px; padding: 4px 4px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.mkts select.inline { border: 0; background-color: transparent; min-width: 170px; height: 32px; }
.chips-in { display: contents; }
.mchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--act-soft); color: var(--act); font-size: 13px; font-weight: 600; }
.mchip button { border: 0; background: transparent; color: inherit; font-size: 16px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; transition: background-color .15s; }
.mchip button:hover { background: rgba(67, 56, 202, .14); }

/* methodology document */
.meth .panel p { color: var(--ink-2); line-height: 1.65; max-width: 72ch; }
.meth .panel p + p { margin-top: 10px; }
.mlist { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); line-height: 1.6; max-width: 72ch; }
.mlist b { color: var(--ink); }
pre.json { max-height: 320px; overflow: auto; background: #F7F8FB; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
tr.dprop > td { background: #FBFCFE; }
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
body.is-admin .grp.admin-only, body.is-admin div.panel.admin-only { display: block !important; }
body.is-admin .navfoot .signin { display: none; }
.navfoot .signin { display: inline-block; margin-top: 10px; color: var(--ink-3); }
.navfoot .signin:hover { color: var(--act); }
.mkbar { gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }

/* loading: top progress bar and skeleton panels */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: linear-gradient(90deg, transparent, var(--act) 30%, var(--pos) 60%, transparent) 0 0 / 40% 100% no-repeat; }
body.loading::before { opacity: 1; animation: scbar 1.1s ease-in-out infinite; }
@keyframes scbar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.sk { border-radius: var(--r); background: linear-gradient(100deg, #EEF0F5 30%, #F7F8FB 50%, #EEF0F5 70%) 0 0 / 300% 100%; animation: scshine 1.4s ease-in-out infinite; }
.sk-h { height: 34px; width: 280px; margin-bottom: 12px; }
.sk-p { height: 16px; width: min(560px, 80%); margin-bottom: 24px; }
.sk-kpi { height: 92px; }
.sk-panel { height: 340px; }
.sk-block { height: 180px; }
@keyframes scshine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk, body.loading::before { animation: none; } }
#nav a.nl.sub { padding: 6px 10px 6px 42px; font-size: 13.5px; color: var(--ink-3); }
#nav a.nl.sub:hover { color: var(--ink); }
#nav a.nl.sub.on { color: var(--act); background: transparent; font-weight: 600; }

/* share-positive tables (findings) */
table.shares { width: 100%; }
table.shares th.n, table.shares td.n { width: 64px; color: var(--ink-3); text-align: right; padding-right: 14px; font-variant-numeric: tabular-nums; }
table.shares td.sh { position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 120px; }
table.shares .shb { display: inline-block; vertical-align: middle; width: 56px; height: 8px; border-radius: 4px; margin-right: 8px; background: linear-gradient(90deg, var(--c) var(--w), #EEF0F5 var(--w)); }
table.shares td.sh small { color: var(--ink-3); margin-left: 4px; font-size: 11.5px; }
table.shares tr.tot td { font-weight: 650; border-bottom: 1.5px solid var(--line); }
table.shares tr.lowb td { color: var(--ink-3); }
table.shares tr.lowb td:first-child::after { content: " low base"; font-size: 11px; color: var(--ink-3); }
.sg { font-style: normal; font-size: 10px; margin-left: 5px; }
.sg.up { color: var(--pos); } .sg.dn { color: var(--neg); }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.findings li { padding: 10px 14px; border-left: 3px solid var(--act); background: #F8F9FE; border-radius: 0 8px 8px 0; line-height: 1.5; }
.kpis { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 4px 0 16px; }
.kpis div b { display: block; font-size: 30px; font-weight: 760; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpis div span { color: var(--ink-3); font-size: 13px; }
.setup dt { color: var(--ink-3); font-size: 13px; margin-top: 12px; }
.setup dd { margin: 3px 0 0; }
.name1, .who b, .voice b, td b { white-space: nowrap; }
td .row { flex-wrap: nowrap; }
.voice .row b, .voice .row a b { white-space: nowrap; }

/* navigation: Research, Population and Administrator are main items that open their pages; the group of the current page stays open */
#nav .grp .sect { all: unset; box-sizing: border-box; width: 100%; color: var(--ink-2); padding: 8px 10px; border-radius: var(--r-s); font-size: 14.5px; font-weight: 500; display: flex; gap: 10px; align-items: center; cursor: pointer; }
#nav .grp .sect:hover { background: var(--bg); color: var(--ink); }
#nav .grp .sect:focus-visible { outline: 2px solid var(--act); }
#nav .grp .sect svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
#nav .grp .sect .chev { width: 13px; height: 13px; margin-left: auto; stroke-width: 2.2; transition: transform .15s; opacity: .6; }
#nav .grp.open .sect { color: var(--ink); font-weight: 650; }
#nav .grp.open .chev { transform: rotate(90deg); }
#nav .grp .items { display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px; }
#nav .grp.open .items { display: flex; }
#nav .grp a.nl.sub { padding: 6px 10px 6px 37px; font-size: 13.5px; color: var(--ink-3); }
#nav .grp a.nl.sub:hover { color: var(--ink); background: var(--bg); }
#nav .grp a.nl.sub.on { color: var(--act); background: var(--act-soft); font-weight: 600; }
@media (max-width: 900px) { #nav .grp .items { display: flex; flex-direction: row; flex-wrap: wrap; } #nav .grp a.nl.sub { padding-left: 10px; } }

/* one navigation block: an open group sits on a shared panel with a guide line to its pages */
#nav .grp { border-radius: 10px; transition: background-color .15s; }
#nav .grp.open { background: #F5F6FB; box-shadow: inset 0 0 0 1px #ECEEF5; margin: 2px 0; }
#nav .grp.open .sect:hover { background: transparent; }
#nav .grp .items { position: relative; margin: 0 0 6px; padding-bottom: 2px; }
#nav .grp .items::before { content: ""; position: absolute; left: 18px; top: 2px; bottom: 6px; border-left: 1.5px solid #DCDFEA; }
#nav .grp a.nl.sub { margin: 0 6px 0 0; padding-left: 34px; }
#nav .grp a.nl.sub.on { background: #fff; box-shadow: 0 1px 2px rgba(21, 32, 46, .06); }
.hb-l .hb-n { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

dialog.modal { border: 0; border-radius: 14px; padding: 22px 24px; max-width: 440px; box-shadow: 0 24px 60px rgba(21, 32, 46, .25); }
dialog.modal::backdrop { background: rgba(21, 24, 52, .35); backdrop-filter: blur(2px); }
dialog.modal h2 { font-size: 18px; margin-bottom: 8px; }
dialog.modal p { color: var(--ink-2); }
.btn.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.chipsel { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chipsel button { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.chipsel button:hover { border-color: #C9CDF4; color: var(--ink); }
.chipsel button.on { background: var(--act); border-color: var(--act); color: #fff; }

/* new study: variant cards */
.variant { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; transition: box-shadow .15s, opacity .15s; }
.variant.dragging { opacity: .45; box-shadow: 0 10px 30px rgba(37, 41, 110, .18); }
.variant .vhead { margin-bottom: 10px; flex-wrap: nowrap; }
.variant .grip { cursor: grab; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 2px; user-select: none; }
.variant .vbody { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: stretch; }
.variant .drop { min-height: 132px; display: grid; place-items: center; text-align: center; font-size: 13px; position: relative; overflow: hidden; padding: 6px; }
.variant .drop.has { padding: 0; }
.variant .drop img { width: 100%; height: 100%; max-height: 180px; object-fit: cover; display: block; }
.variant .drop .vxi { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, .92); }
.variant textarea { min-height: 132px; margin: 0; }
@media (max-width: 700px) { .variant .vbody { grid-template-columns: 1fr; } }
.vthumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; border: 1px solid var(--line-2); }
.kpis .vkpi { display: block; width: 120px; height: 80px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line-2); }
.vsetup { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-bottom: 16px; align-items: start; }
.vsetup .vbig { width: 200px; max-height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }

/* study setup */
.setupp .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.setupp .fact { background: #fff; padding: 12px 14px; min-width: 0; }
.setupp .fact span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.setupp .fact b { font-weight: 650; overflow-wrap: anywhere; }
.setupp .sblock { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.setupp .sblock h3 { font-size: 14px; margin-bottom: 8px; }
.setupp .sblock ul, .setupp .sblock ol { margin: 0; padding-left: 18px; }
.setupp .sblock li { margin-bottom: 4px; }
.sline { display: grid; grid-template-columns: 150px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.sline small { color: var(--ink-3); }
.strk { position: relative; height: 6px; background: linear-gradient(90deg, #DDE0F5, #4338CA); border-radius: 3px; }
.strk i { position: absolute; top: -4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--act); }
@media (max-width: 900px) { .setupp .facts { grid-template-columns: 1fr 1fr; } }
/* grids never overflow their column: wide tables scroll inside */
.g2 > *, .g3 > *, .g4 > *, .g21 > *, .g12 > * { min-width: 0; }
.panel { min-width: 0; }
.panel { overflow-x: auto; }
#allseg > div, #sdt { overflow-x: auto; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ink); }
th.sortable.asc::after { content: " ▲"; font-size: 9px; } th.sortable.desc::after { content: " ▼"; font-size: 9px; }
td.nowrap { white-space: nowrap; }
/* stronger hover inside an open navigation group */
#nav .grp .sect:hover { background: #E8EAF4; color: var(--ink); }
#nav .grp.open .sect:hover { background: #E8EAF4; }
#nav .grp a.nl.sub:hover { background: #E8EAF4; color: var(--ink); }
#nav .grp a.nl.sub.on:hover { background: #fff; }

/* SynthCrowd AI assistant */
.asst { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.asst .chats { padding: 12px; height: min(72vh, 760px); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; }
.citem { position: relative; padding: 9px 28px 9px 10px; border-radius: 8px; cursor: pointer; margin-top: 4px; }
.citem:hover { background: var(--bg); } .citem.on { background: var(--act-soft); }
.citem span { display: block; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem small { color: var(--ink-3); font-size: 11.5px; }
.citem .cdel { position: absolute; right: 6px; top: 8px; border: 0; background: none; color: var(--ink-3); font-size: 16px; cursor: pointer; opacity: 0; }
.citem:hover .cdel { opacity: 1; }
.assistant { display: flex; flex-direction: column; height: min(72vh, 760px); padding: 0; overflow: hidden; }
.assistant.small { height: 460px; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: none; }
.chatlog { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #FBFBFE, #fff 40%); }
.chat-empty { margin: auto; max-width: 620px; text-align: center; }
.chat-empty .ai-badge { display: inline-block; font-weight: 750; font-size: 12px; color: #fff; background: linear-gradient(135deg, #4338CA, #12857A); border-radius: 999px; padding: 5px 12px; margin-bottom: 12px; }
.chat-empty h3 { font-size: 20px; letter-spacing: -0.01em; }
.chat-empty p { color: var(--ink-2); margin: 8px auto 18px; max-width: 54ch; }
.chips-ex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.chips-ex button { font: inherit; font-size: 13.5px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.chips-ex button:hover { border-color: #C9CDF4; color: var(--ink); }
.cmsg { display: flex; flex-direction: column; max-width: 80%; }
.cmsg .who { font-size: 11.5px; font-weight: 700; color: var(--act); margin: 0 0 4px 4px; }
.cmsg.user { align-self: flex-end; align-items: flex-end; }
.cmsg .bubble { padding: 11px 15px; border-radius: 16px; line-height: 1.55; background: #F1F2F8; }
.cmsg.user .bubble { background: var(--act); color: #fff; border-bottom-right-radius: 5px; }
.cmsg.assistant .bubble { border-bottom-left-radius: 5px; }
.proposal { margin-top: 8px; border: 1px solid #DCDDF7; background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 6px 20px rgba(67, 56, 202, .08); }
.proposal .ptag { font-size: 11.5px; font-weight: 700; color: var(--pos); margin-bottom: 4px; }
.proposal p { margin-top: 6px; }
.chatin { display: flex; gap: 10px; align-items: flex-end; margin: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 2px 10px rgba(21, 32, 46, .05); }
.chatin:focus-within { border-color: #B9BDF0; box-shadow: 0 0 0 3px rgba(67, 56, 202, .1); }
.chatin textarea { flex: 1; border: 0; outline: none; box-shadow: none; resize: none; min-height: 24px; max-height: 160px; padding: 6px 0; margin: 0; background: transparent; }
.chatin .send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--act); display: grid; place-items: center; cursor: pointer; flex: none; }
.chatin .send svg { width: 18px; height: 18px; fill: #fff; }
.chatin .send:disabled { opacity: .5; }
.thinking .chatlog::after { content: "SynthCrowd AI is thinking…"; align-self: flex-start; color: var(--ink-3); font-size: 13px; animation: scpulse 1.2s ease-in-out infinite; }
@keyframes scpulse { 50% { opacity: .4; } }
@media (max-width: 900px) { .asst { grid-template-columns: 1fr; } .chips-ex { grid-template-columns: 1fr; } }

/* labels wrap to two lines instead of being cut; the pyramid reads at a glance */
.hb-l { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.chart.pyr text { font-size: 15px; }
.chart.pyr text.lb { font-size: 15px; }
.head { flex-wrap: wrap; gap: 14px; }
/* settings page */
.settings .field { max-width: 360px; }
#nav .navfoot .btn.signout { width: 100%; justify-content: center; margin-top: 12px; }

/* accordion: one group open at a time, opening and closing with a short animation; the side menu scrolls if long */
#nav { overflow-y: auto; scrollbar-width: thin; }
#nav .grp .items { display: flex !important; overflow: hidden; max-height: 0; opacity: 0; margin: 0; transition: max-height .2s ease, opacity .15s ease, margin .2s ease; }
#nav .grp.open .items { max-height: 320px; opacity: 1; margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { #nav .grp .items { transition: none; } }
@media (max-width: 900px) { #nav .grp .items { max-height: none; opacity: 1; } }
input.bad { border-color: var(--neg) !important; box-shadow: 0 0 0 3px rgba(192, 54, 94, .12) !important; }
.chatmeta { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 10px; font-size: 12.5px; color: var(--ink-3); }
.chatmeta .ctok { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--act-soft); color: var(--act); }
.chatmeta .ctok svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.chatmeta .cnt.low { color: var(--neg); font-weight: 600; }
#nav .navfoot .btn.signout svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; margin-right: 6px; }
/* studies table: one line per study, long values cut with the full text on hover */
table.stbl td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
table.stbl td:first-child { max-width: 380px; }
table.stbl td .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.stbl td.when { white-space: nowrap; line-height: 1.25; }
table.stbl td.when small { display: block; color: var(--ink-3); font-size: 12px; }

/* scrollbars in the brand colours, always visible where something scrolls; inner lists keep the scroll to themselves */
* { scrollbar-width: thin; scrollbar-color: #8B86E8 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4338CA, #12857A); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #3730A3, #0F6E65); background-clip: padding-box; border: 3px solid transparent; }
.chatlog, #nav, .asst .chats, select[multiple], .panel, #sdt, #allseg > div { overscroll-behavior: contain; }
.chipsel.multi { margin: 4px 0 0; }
.chipsel.multi button.on { background: var(--act); border-color: var(--act); color: #fff; }
.conf { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-top: 6px; text-transform: capitalize; }
.conf.high { background: #E3F4F1; color: var(--pos); } .conf.medium { background: #FFF4DE; color: #9A6200; } .conf.low { background: #FBE7ED; color: var(--neg); }
.kpis .conf { display: inline-block; }
.bar { height: 10px; background: #EEF0F5; border-radius: 999px; overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 999px; }
.chips-ex { max-height: 260px; overflow-y: auto; }
/* findings: the three factor columns separated by rules */
.cols3 > div + div { border-left: 1px solid var(--line-2); padding-left: 20px; }
/* share tables: counts right-aligned, shares centred */
table.shares th:not(:first-child):not(.n), table.shares td.sh { text-align: center; }
table.shares td.sh .shb { margin-right: 8px; }
/* a single-variant summary uses the full width in two columns */
.one > .panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; align-items: start; grid-auto-flow: dense; }
.one > .panel > .panel-head, .one > .panel > .row { grid-column: 1; }
.one > .panel > h3, .one > .panel > div:not(.panel-head):not(.row):not(.hb), .one > .panel > svg, .one > .panel > p { grid-column: 2; }
.one > .panel > .hb { grid-column: 1; }
@media (max-width: 1000px) { .one > .panel { grid-template-columns: 1fr; } .one > .panel > * { grid-column: 1 !important; } .cols3 > div + div { border-left: 0; padding-left: 0; } }
.prose h3 { font-size: 15px; margin: 14px 0 4px; } .prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; line-height: 1.6; } .prose ul { margin: 0 0 10px; padding-left: 18px; }
.fgsum .sblock { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; }
.fgsum .sblock ul { margin: 0; padding-left: 18px; } .fgsum .sblock li { margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.pager .pg { font: inherit; font-size: 13px; min-width: 34px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.pager .pg:hover:not(:disabled) { border-color: #C9CDF4; color: var(--ink); }
.pager .pg.on { background: var(--act); border-color: var(--act); color: #fff; font-weight: 650; }
.pager .pg:disabled { opacity: .4; cursor: default; }
.pager .gap { color: var(--ink-3); padding: 0 2px; }
.pview details { border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.pview summary { cursor: pointer; padding: 10px 14px; font-weight: 650; font-size: 14px; list-style: none; }
.pview summary::-webkit-details-marker { display: none; }
.pview summary::before { content: "›"; display: inline-block; margin-right: 8px; color: var(--ink-3); transition: transform .15s; }
.pview details[open] summary::before { transform: rotate(90deg); }
.pview .kv { padding: 0 14px 12px; font-size: 13px; }
.pview .kv dd.full { grid-column: 1 / -1; color: var(--ink-2); }

/* KPI cards: a quiet motif in the corner (the logo's dot grid), a different tint per card */
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -10px; bottom: -14px; width: 150px; height: 110px; pointer-events: none; opacity: .2;
  background: radial-gradient(circle, var(--kc, #4338CA) 2.2px, transparent 2.8px) 0 0 / 16px 16px;
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 15%, transparent 70%); mask-image: radial-gradient(circle at 100% 100%, #000 15%, transparent 70%); }
.kpi::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px 140px at 105% 115%, var(--kt, rgba(67, 56, 202, .07)), transparent 70%); }
.g4 > .kpi:nth-child(4n+2), .g3 > .kpi:nth-child(3n+2) { --kc: #12857A; --kt: rgba(18, 133, 122, .08); }
.g4 > .kpi:nth-child(4n+3), .g3 > .kpi:nth-child(3n) { --kc: #7C8FE0; --kt: rgba(124, 143, 224, .1); }
.g4 > .kpi:nth-child(4n) { --kc: #1C8FB5; --kt: rgba(28, 143, 181, .08); }
.kpi > * { position: relative; z-index: 1; }

/* administration tables */
.scrollx { overflow-x: auto; }
table th.r, table td.r { text-align: right; }
table th.c, table td.c { text-align: center; }
tr.det td { background: #FAFBFD; }
pre.logpre { margin-top: 10px; max-height: 360px; overflow: auto; font-size: 12px; line-height: 1.45; background: #F4F5FA; border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; }

/* the logo green: second brand colour, used for population and people (research stays indigo) */
.btn.alt { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.alt:hover { background: var(--teal-2); border-color: var(--teal-2); color: #fff; box-shadow: 0 6px 18px rgba(18, 133, 122, .28); }
.btn.ghost.alt { background: var(--paper); color: var(--teal-2); border-color: #B5E0D9; }
.btn.ghost.alt:hover { background: var(--teal-soft); color: var(--teal-2); border-color: #8FD0C6; box-shadow: 0 4px 14px rgba(18, 133, 122, .14); }
#nav .grp[data-g="population"] a.nl.sub.on { color: var(--teal-2); background: var(--teal-soft); }
#nav .grp[data-g="population"].open .sect svg { color: var(--teal); }
#nav .grp[data-g="research"].open .sect svg { color: var(--act); }

/* study types */
.fico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 7px; flex: none; }
.fico.f-compare { color: var(--act); } .fico.f-concept { color: #B7791F; } .fico.f-survey { color: var(--teal); } .fico.f-video { color: var(--neg); }
.fico.h1i { width: 26px; height: 26px; vertical-align: -4px; margin-right: 10px; }
.ftypes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.ftype { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); backdrop-filter: blur(8px); cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; color: var(--ink); }
.ftype:hover:not(:disabled) { border-color: #C9CDF4; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(67, 56, 202, .1); }
.ftype.on { border-color: var(--act); box-shadow: 0 0 0 3px rgba(67, 56, 202, .12); background: linear-gradient(160deg, #F3F4FF, #fff 70%); }
.ftype b { font-size: 15px; } .ftype span { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.ftype em { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--line-2); padding: 2px 8px; border-radius: 999px; }
.ftype:disabled { opacity: .65; cursor: default; }
.fbig { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.fbig.f-compare { color: var(--act); } .fbig.f-concept { color: #B7791F; } .fbig.f-survey { color: var(--teal); } .fbig.f-video { color: var(--neg); }
@media (max-width: 1100px) { .ftypes { grid-template-columns: 1fr 1fr; } }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.qcard .qk { color: var(--teal-2); }
/* survey results */
table.sv td, table.sv th { vertical-align: middle; }
table.sv .svbar { width: 46%; }
.svb { position: relative; height: 24px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.svb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--act), var(--teal)); border-radius: 6px; }
.svb b { position: absolute; right: 8px; top: 3px; font-size: 12.5px; color: var(--ink); }
.svseg { margin-top: 14px; gap: 8px; }
.svx { margin-top: 10px; }
table.svh td:first-child { text-align: left; font-weight: 500; border: 0; }

/* ---------- workspace look: the logo's indigo and green as light behind glass panels ---------- */
#app { background: radial-gradient(900px 600px at 100% -10%, rgba(67, 56, 202, .10), transparent 62%), radial-gradient(800px 560px at 15% 110%, rgba(18, 133, 122, .10), transparent 60%),
    radial-gradient(600px 420px at 55% 40%, rgba(124, 143, 224, .06), transparent 70%), #F3F5FA; background-attachment: fixed; }
#nav { background: rgba(255, 255, 255, .72); backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px); border-right: 1px solid rgba(21, 32, 46, .07); }
#nav a.nl.on { background: linear-gradient(90deg, rgba(67, 56, 202, .12), rgba(67, 56, 202, .04)); }
#app .panel, #app .kpi { background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 2px rgba(21, 32, 46, .04), 0 10px 30px -12px rgba(37, 41, 110, .14), inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 1px rgba(21, 32, 46, .05); border-radius: 14px; }
#app .kpi::before { background: linear-gradient(90deg, var(--kc, #4338CA), transparent 70%) top left / 100% 2px no-repeat; opacity: .55; }
#app .kpi b { background: linear-gradient(120deg, var(--ink) 30%, var(--kc, #4338CA)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#app .head h1 { font-size: 32px; }
#app .tabs { border-bottom: 0; gap: 4px; background: rgba(255, 255, 255, .6); backdrop-filter: blur(10px); padding: 4px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(21, 32, 46, .06); width: fit-content; max-width: 100%; }
#app .tabs button { border: 0; margin: 0; border-radius: 9px; padding: 8px 14px; }
#app .tabs button:hover { background: rgba(67, 56, 202, .06); }
#app .tabs button.on { background: #fff; color: var(--act); box-shadow: 0 1px 3px rgba(21, 32, 46, .1), 0 0 0 1px rgba(67, 56, 202, .12); }
#app .btn:not(.quiet):not(.ghost):not(.alt) { background: linear-gradient(135deg, #4F46E5, var(--act) 55%, #3B35B8); border-color: transparent; }
#app .btn:not(.quiet):not(.ghost):not(.alt):hover { background: linear-gradient(135deg, #4338CA, #3730A3 55%, #2E2A8F); }
.landscape { position: relative; overflow: hidden; }
.landscape::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(500px 260px at 100% 0%, rgba(18, 133, 122, .07), transparent 70%), radial-gradient(500px 260px at 0% 100%, rgba(67, 56, 202, .06), transparent 70%); }
.landscape > * { position: relative; }
#app table tr:hover td { background: rgba(67, 56, 202, .025); }
@supports not (backdrop-filter: blur(1px)) { #nav { background: #fff; } }
/* the leading variant: a round letter in the variant's colour */
.vdot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 750; color: #fff; margin-right: 6px; vertical-align: -1px; background: var(--act); }
.vdot.v-B { background: var(--teal); } .vdot.v-C { background: #B7791F; } .vdot.v-D { background: #C0365E; }
.ftstats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ftstat { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(21, 32, 46, .07); color: var(--ink-2); font-size: 13.5px; }
.ftstat b { color: var(--ink); margin-right: 2px; }
.ftstat:hover { box-shadow: inset 0 0 0 1px rgba(67, 56, 202, .3); color: var(--ink); }
.rstats .kpi { box-shadow: none !important; background: rgba(246, 247, 252, .8) !important; }
/* video review */
.vidhead { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 20px; align-items: start; }
.vidhead img { width: 100%; border-radius: 10px; box-shadow: 0 6px 20px rgba(21, 32, 46, .12); }
.vidrev .sblock.pos h3 { color: var(--teal-2); } .vidrev .sblock.neg h3 { color: var(--neg); }
.vidrev .sblock ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 900px) { .vidhead { grid-template-columns: 1fr; } }
.vidrev .sblock { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; min-width: 0; background: rgba(255, 255, 255, .6); }
.aud.few b { color: var(--neg); }
.audw { display: block; color: var(--neg); font-size: 12.5px; margin-top: 4px; }
/* sliders: a thin track filled up to the handle in the brand gradient, a round handle that stays inside the track */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--act), var(--teal)) 0 0 / var(--fill, 0%) 100% no-repeat, #E3E6F0; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: #E3E6F0; }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--act), var(--teal)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--act); box-shadow: 0 2px 6px rgba(37, 41, 110, .25); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--act); box-shadow: 0 2px 6px rgba(37, 41, 110, .25); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(67, 56, 202, .2); }
input[type=range]:disabled { opacity: .5; cursor: default; }
/* new study wizard */
.wz { list-style: none; margin: 0 0 4px; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; background: rgba(255, 255, 255, .7); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(21, 32, 46, .06); }
.wz button { font: inherit; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink-3); padding: 7px 12px 7px 8px; border-radius: 10px; cursor: pointer; }
.wz button span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--line-2); color: var(--ink-3); }
.wz button:hover { color: var(--ink); background: rgba(67, 56, 202, .05); }
.wz button.on { background: #fff; color: var(--act); box-shadow: 0 1px 3px rgba(21, 32, 46, .1), 0 0 0 1px rgba(67, 56, 202, .14); }
.wz button.on span { background: linear-gradient(135deg, var(--act), var(--teal)); color: #fff; }
.wz button.done span { background: var(--teal-soft); color: var(--teal-2); }
.wznav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-b > .sub { margin-bottom: 18px; }
.step .fgrid { row-gap: 18px; }
/* loading: the skeleton with a short message and three dots in the logo colours */
.skel { position: relative; }
.loadmsg { position: absolute; left: 50%; top: 220px; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); box-shadow: 0 8px 26px rgba(37, 41, 110, .12), 0 0 0 1px rgba(21, 32, 46, .05); font-size: 14px; font-weight: 600; color: var(--ink-2); opacity: 0; animation: ldin .3s .25s forwards; }
.ldots { display: inline-flex; gap: 4px; }
.ldots i { width: 7px; height: 7px; border-radius: 50%; background: var(--act); animation: ldb 1s ease-in-out infinite; }
.ldots i:nth-child(2) { background: #7C8FE0; animation-delay: .15s; } .ldots i:nth-child(3) { background: var(--teal); animation-delay: .3s; }
@keyframes ldb { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes ldin { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ldots i, .loadmsg { animation: none; opacity: 1; } }
/* study header: title with its type and status, the description, and the actions as an icon grid on the right */
.shead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; margin-bottom: 22px; }
.stitle { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.stitle h1 { margin: 0; }
.stitle .pill { font-size: 12.5px; padding: 4px 11px; }
.shead-main p { color: var(--ink-2); max-width: 78ch; margin-top: 8px; }
.sacts { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.igrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ibtn { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 8px; border-radius: 12px; border: 0; cursor: pointer; color: var(--ink-2);
  background: rgba(255, 255, 255, .8); box-shadow: 0 1px 2px rgba(21, 32, 46, .05), 0 0 0 1px rgba(21, 32, 46, .07); font-size: 12px; font-weight: 600; text-align: center; transition: color .15s, box-shadow .15s, transform .15s; }
.ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ibtn:hover { color: var(--act); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(67, 56, 202, .12), 0 0 0 1px rgba(67, 56, 202, .25); }
.ibtn#del:hover { color: var(--neg); box-shadow: 0 6px 16px rgba(192, 54, 94, .12), 0 0 0 1px rgba(192, 54, 94, .3); }
@media (max-width: 900px) { .shead { grid-template-columns: 1fr; } .sacts { min-width: 0; } }
a.stlink { color: inherit; }
a.stlink:hover b { color: var(--act); text-decoration: underline; text-underline-offset: 3px; }
.vsrc .drop { padding: 26px; }
details.techlog summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
details.techlog summary::-webkit-details-marker { display: none; }
details.techlog summary::before { content: "▸"; color: var(--ink-3); transition: transform .15s; }
details.techlog[open] summary::before { transform: rotate(90deg); }
/* the loading line runs over the content only, never over the side menu, and only for loads longer than a moment */
body::before { left: 236px; height: 2px; }
body.loading::before { transition-delay: .35s; }
@media (max-width: 900px) { body::before { left: 0; } }
/* hidden steps and panes stay hidden whatever display their class sets */
.steps-col [hidden], .ftypes[hidden] { display: none !important; }
/* side menu: a soft wash from indigo at the top to the logo green at the bottom, icons in the section colours */
#nav { background: linear-gradient(180deg, rgba(238, 240, 255, .92) 0%, rgba(255, 255, 255, .82) 38%, rgba(255, 255, 255, .82) 62%, rgba(227, 244, 241, .9) 100%); }
#nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, rgba(18, 133, 122, .35) 1.2px, transparent 1.7px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(120% 90% at 0% 100%, #000, transparent 70%); mask-image: radial-gradient(120% 90% at 0% 100%, #000, transparent 70%); }
#nav > * { position: relative; z-index: 1; }
#nav a.nl svg, #nav .grp .sect svg:not(.chev) { color: var(--act); opacity: .85; }
#nav .grp[data-g="population"] .sect svg:not(.chev) { color: var(--teal); }
#nav .grp[data-g="admin"] .sect svg:not(.chev) { color: #B7791F; }
#nav a.nl[href="#/settings"] svg { color: #64748B; }
#nav a.nl.on { background: linear-gradient(90deg, rgba(67, 56, 202, .16), rgba(18, 133, 122, .06)); box-shadow: inset 3px 0 0 var(--act); }
#nav .grp a.nl.sub.on { box-shadow: inset 3px 0 0 var(--act); }
#nav .grp[data-g="population"] a.nl.sub.on { box-shadow: inset 3px 0 0 var(--teal); }
#nav .grp.open { background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(21, 32, 46, .04); }
/* the step bar carries the numbering; the panes do not repeat it */
.steps-col .step { grid-template-columns: 1fr; }
.steps-col .step-n { display: none; }
/* the assistant fills the window down to its bottom edge */
.asst .chats, .asst .assistant { height: calc(100vh - 200px); min-height: 460px; }
a.arcstudy { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(67, 56, 202, .06); color: var(--ink-2); font-size: 13px; font-weight: 600; }
a.arcstudy span { margin-left: 8px; color: var(--act); font-weight: 600; }
a.arcstudy:hover { background: rgba(67, 56, 202, .12); color: var(--ink); }
.voice.hl { background: linear-gradient(90deg, rgba(67, 56, 202, .08), transparent); border-radius: 10px; box-shadow: inset 3px 0 0 var(--act); animation: hlfade 3s ease-out 1s forwards; }
@keyframes hlfade { to { background: transparent; } }
svg.pchart { width: 100%; height: auto; display: block; }
.mb { margin-bottom: 18px; }
.bwbar { position: relative; height: 22px; background: linear-gradient(90deg, transparent calc(50% - .5px), #D5DAE6 calc(50% - .5px), #D5DAE6 calc(50% + .5px), transparent calc(50% + .5px)); }
.bwbar i { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.bwbar i.p { left: 50%; background: linear-gradient(90deg, var(--act), var(--teal)); }
.bwbar i.n { right: 50%; background: #E6A3B6; }
.bwbar b { position: absolute; right: 4px; top: 2px; font-size: 12.5px; }
.whogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.whoc { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .6); }
.whoc p { margin-top: 6px; font-size: 13.5px; line-height: 1.6; }
.whoc .pill { font-size: 11.5px; padding: 1px 7px; }
/* tutorial: a veil with a lit window on the element being explained, and a bubble with the step */
#tour { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
#tour .thole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(18, 20, 48, .55); transition: left .25s, top .25s, width .25s, height .25s; outline: 2px solid rgba(255, 255, 255, .85); }
#tour .tveil { position: fixed; inset: 0; pointer-events: auto; }
#tour .tbub { position: fixed; width: 360px; pointer-events: auto; background: #fff; border-radius: 14px; padding: 16px 18px 12px; box-shadow: 0 20px 50px rgba(18, 20, 48, .3); transition: left .25s, top .25s; }
#tour .tstep { font-size: 12px; font-weight: 700; color: var(--teal-2); margin-bottom: 4px; }
#tour .tbub h3 { font-size: 16px; margin-bottom: 6px; }
#tour .tbub p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
#tour .tnav { margin-top: 12px; gap: 6px; }
#tour.wait .thole { opacity: .4; }
.tourb, .signout { width: 100%; justify-content: flex-start; margin-top: 6px; }
@media (max-width: 999px) { .tourb { display: none !important; } }
@media (prefers-reduced-motion: reduce) { #tour .thole, #tour .tbub { transition: none; } }
