/* Zolensa app styles. Brand tokens from brand/BRAND.md. */
:root {
  /* Design system 2 (Oct 2026). Brand violet for actions, coral only for live and recording. */
  --violet: #6D4AFF;
  --violet-dark: #5233E6;
  --violet-ink: #4128B8;
  --coral: #EC4C55;
  --navy: #17152E;
  --ink: #17152E;
  --ink-2: #4C4964;
  --ink-3: #77748E;
  --lilac: #F0EDFF;
  --line: #E2E0EB;
  --line-2: #EDEBF3;
  --bg: #F4F3F8;
  --white: #FFFFFF;
  --sidebar: #17152E;
  --ok: #0E7A4C;
  --ok-bg: #E5F4EC;
  --warn: #9A5600;
  --warn-bg: #FFF3DC;
  --error: #BE2F36;
  --error-bg: #FCEBEC;
  --info-bg: #EFEDFF;
  --grad: linear-gradient(135deg, #6D4AFF 0%, #FF5E62 100%);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: none;
  --shadow-pop: 0 2px 4px rgba(23, 21, 46, .06), 0 16px 40px -12px rgba(23, 21, 46, .22);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Sora, "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font);
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--violet); color: var(--white); }
.btn-primary:hover { background: var(--violet-dark); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, .linklike:focus-visible, a:focus-visible { outline: 3px solid rgba(109, 74, 255, .35); outline-offset: 2px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--violet); cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input { font: 400 15px var(--font); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.field input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); }
.code-input { font: 600 22px/1 var(--font-head) !important; letter-spacing: .3em; text-align: center; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-top: 16px; }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: var(--info-bg); color: var(--violet-dark); }

/* Sign-in screens */
.auth-body { background: var(--white); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-brand { position: relative; overflow: hidden; background: var(--grad); color: var(--white); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: rgba(255, 255, 255, .10); }
.auth-logo { width: 168px; height: auto; position: relative; z-index: 1; }
.auth-pitch { position: relative; z-index: 1; max-width: 440px; }
.auth-pitch h1 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.08; }
.auth-pitch p { margin-top: 16px; font-size: 17px; opacity: .92; }
.auth-pitch ul { list-style: none; margin-top: 28px; display: grid; gap: 12px; }
.auth-pitch li { padding-left: 30px; position: relative; font-size: 15px; }
.auth-pitch li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .25); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .9); }
.auth-by { position: relative; z-index: 1; font-size: 13px; opacity: .85; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-logo-small { display: none; width: 150px; height: auto; margin-bottom: 28px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 28px; }
.auth-card > .muted { margin-top: 8px; }
.auth-card > .small { margin-top: 20px; }
.auth-foot { margin-top: 40px; font-size: 12px; color: var(--ink-3); }

.steps { margin: 20px 0 0 20px; display: grid; gap: 14px; color: var(--ink-2); font-size: 14px; }
.steps strong { color: var(--ink); }
.qr-wrap { display: flex; gap: 16px; align-items: center; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.qr { width: 132px; height: 132px; flex: none; background: var(--white); padding: 8px; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-manual { display: grid; gap: 6px; min-width: 0; }
.secret { font: 600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); word-break: break-all; }

/* App shell */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 32px; }
.topbar-logo img { width: 122px; height: auto; }
.topnav { display: flex; gap: 6px; flex: 1; }
.topnav a, .topnav span { padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.topnav a:hover { background: var(--lilac); text-decoration: none; color: var(--ink); }
.topnav .is-active { background: var(--lilac); color: var(--violet-dark); }
.topnav .is-soon { color: var(--ink-3); cursor: default; }
.usermenu { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.usermenu form { display: inline; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: var(--white); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.usermenu-name { font-weight: 600; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; display: grid; gap: 20px; }
.page > .alert { margin-top: 0; }
.page-head h1 { font-size: 28px; }
.page-head p { margin-top: 6px; }
.appfoot { max-width: 1200px; margin: 0 auto; padding: 0 24px 32px; font-size: 12px; color: var(--ink-3); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card.narrow { max-width: 480px; }
.card-title { font-size: 17px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.org-list { list-style: none; display: grid; gap: 10px; }
.org-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.org-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--lilac); color: var(--violet-dark); display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); }
.org-name { font-weight: 600; flex: 1; min-width: 120px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--lilac); color: var(--violet-dark); }
.pill-quiet { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }

.facts { display: grid; gap: 10px; margin-bottom: 18px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.facts dt { color: var(--ink-2); }
.facts dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.roadmap { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.roadmap li { counter-increment: step; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.roadmap li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.roadmap li strong { color: var(--ink); font-size: 14px; }
.roadmap li.done { border-color: rgba(109, 74, 255, .35); background: var(--lilac); }
.roadmap li.done::before { content: "\2713"; background: var(--violet); color: var(--white); border-color: var(--violet); }

/* Error pages */
.plain-body { background: var(--bg); }
.plain { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 24px; padding: 24px; }
.plain-logo { width: 140px; height: auto; }
.plain-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 440px; text-align: center; display: grid; gap: 12px; justify-items: center; box-shadow: var(--shadow); }

@media (max-width: 960px) {
  .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-logo-small { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .topbar-logo img { width: 92px; }
  .topnav { gap: 2px; }
  .topnav a { padding: 6px 8px; }
  .usermenu { margin-left: auto; gap: 10px; }
  .usermenu-name { display: none; }
  .page { padding: 24px 16px 40px; }
  .appfoot { padding: 0 16px 24px; }
  .card { padding: 18px; }
  .roadmap { grid-template-columns: 1fr; }
  .qr-wrap { flex-direction: column; align-items: flex-start; }
}

/* ---------- Milestone 2.1: studies ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.nowrap { white-space: nowrap; }
.opt { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.btn-small { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: var(--white); color: var(--error); border-color: #F3C3CA; }
.btn-danger:hover { background: var(--error-bg); }

.orgswitch select, .field select { font: 500 14px var(--font); padding: 8px 32px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A4868' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; color: var(--ink); max-width: 240px; }
.field select { font-size: 15px; padding: 11px 36px 11px 14px; max-width: 100%; }
.orgname { font-size: 14px; color: var(--ink-2); font-weight: 500; padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }

.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 .status { vertical-align: middle; margin-left: 8px; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-2); }

.card-flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 4px; }

.empty { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 48px 24px; }
.empty h2 { font-size: 22px; }
.empty p { max-width: 460px; }
.empty-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); box-shadow: inset 0 0 0 14px rgba(255, 255, 255, .55); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFAFF; }
.row-link { font-weight: 600; color: var(--ink); }

.status { display: inline-block; font: 600 12px/1 var(--font); padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.status-draft { background: #FFF6E5; color: #92400E; border-color: #F8E1B4; }
.status-live { background: var(--ok-bg); color: var(--ok); border-color: #BFE6D3; }
.status-paused { background: #EEF0FF; color: var(--violet-dark); border-color: #D8D2FF; }
.status-closed, .status-archived { background: var(--bg); color: var(--ink-2); }

.form-wide { display: grid; gap: 8px; }
.form-section { border: 0; padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.form-section:first-of-type { padding-top: 0; }
.form-section legend { font: 600 16px var(--font-head); color: var(--ink); padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-inline { max-width: 420px; }
.field input[type=number] { max-width: 160px; }
.field.has-error input, .field.has-error select { border-color: var(--error); }
.field-error { color: var(--error); font-size: 13px; }
.form-section.has-error .chips-check { outline: 1px solid var(--error); outline-offset: 6px; border-radius: 10px; }
.form-actions { display: flex; gap: 12px; padding-top: 12px; flex-wrap: wrap; }

.chips-check { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip-check span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--white); transition: background .12s, border-color .12s; }
.chip-check em { font-style: normal; color: var(--ink-3); margin-left: 4px; }
.chip-check input:checked + span { background: var(--lilac); border-color: var(--violet); color: var(--violet-dark); }
.chip-check input:checked + span::before { content: "\2713  "; }
.chip-check input:focus-visible + span { outline: 3px solid rgba(109, 74, 255, .35); outline-offset: 2px; }

.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.radio-card { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; align-items: flex-start; }
.radio-card input { margin-top: 3px; accent-color: var(--violet); }
.radio-card span { display: grid; gap: 4px; font-size: 14px; }
.radio-card em { font-style: normal; color: var(--ink-2); font-size: 13px; }
.radio-card:has(input:checked) { border-color: var(--violet); background: #FBFAFF; }

.study-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.checklist { list-style: none; display: grid; gap: 8px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.checklist li strong { color: var(--ink); font-size: 14px; grid-column: 2; }
.checklist li span { grid-column: 2; }
.checklist li::before { content: ""; grid-row: 1 / span 2; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); align-self: center; }
.checklist li.done { background: var(--lilac); border-color: rgba(109, 74, 255, .3); }
.checklist li.done::before { content: "\2713"; background: var(--violet); border-color: var(--violet); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.checklist li.optional::before { border-style: dashed; }
.checklist li.soon { opacity: .6; }

.group-list { list-style: none; display: grid; gap: 10px; margin-bottom: 16px; }
.group-list li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.group-main { display: grid; gap: 2px; }
.group-edit summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--violet); list-style: none; }
.group-edit summary::-webkit-details-marker { display: none; }
.group-edit[open] { flex-basis: 100%; display: grid; gap: 10px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input[type=text] { font: 400 14px var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 200px; flex: 1; }
.inline-form input[type=text]:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); }
.add-group { padding-top: 14px; border-top: 1px dashed var(--line); }

.roadmap li.current { border-color: var(--coral); background: #FFF5F5; }
.roadmap li.current::before { background: var(--coral); color: #fff; border-color: var(--coral); }

@media (max-width: 860px) {
  .study-layout, .form-grid, .form-grid-3, .radio-cards { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .orgswitch { order: 3; flex-basis: 100%; }
  .orgswitch select { max-width: 100%; width: 100%; }
  .orgname { display: none; }
  .usermenu a[href="/account/password"] { display: none; }
  .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) th:nth-child(3), .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) td:nth-child(3), .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) th:nth-child(5), .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) td:nth-child(5), .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) th:nth-child(6), .table:not(.pt-table):not(.ag-table):not(.pl-table):not(.tm-table):not(.dl-table):not(.rq-table):not(.us-table) td:nth-child(6) { display: none; }
}

/* ---------- Milestone 2.2: consent ---------- */
.field textarea { font: 400 15px/1.5 var(--font); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); resize: vertical; width: 100%; }
.field textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); }
.hint { font-style: normal; font-size: 12px; color: var(--ink-3); }
.req { font-style: normal; font-weight: 600; color: var(--coral); margin-left: 4px; font-size: 12px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.check input, .table input[type=checkbox] { accent-color: var(--violet); width: 16px; height: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.notice-bar { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--ok-bg); border: 1px solid #BFE6D3; }
.notice-bar > div { display: grid; gap: 2px; font-size: 14px; }
.table-compact th, .table-compact td { padding: 10px 12px; }
.table-compact td:not(:first-child), .table-compact th:not(:first-child) { width: 90px; text-align: center; }
.card .table-compact { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }

.lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); font-size: 14px; font-weight: 500; }
.lang-tabs a:hover { text-decoration: none; border-color: var(--violet); }
.lang-tabs a.is-active { background: var(--lilac); border-color: var(--violet); color: var(--violet-dark); }
.lang-tabs .tick { color: var(--ok); font-weight: 700; }
.lang-tabs .miss { font-size: 11px; font-weight: 600; color: #92400E; background: #FFF6E5; padding: 2px 6px; border-radius: 999px; }

.consent-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.consent-main { display: grid; gap: 20px; min-width: 0; }
.consent-main .form { margin-top: 12px; }
.custom-list { display: grid; gap: 8px; margin-top: 14px; }
.custom-list .inline-form { justify-content: space-between; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.add-custom { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.missing-list { margin: 8px 0 16px 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }

.consent-preview { position: sticky; top: 84px; }
.preview-label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.phone-frame { background: var(--navy); border-radius: 36px; padding: 10px; box-shadow: 0 24px 48px -20px rgba(20, 18, 58, .35); }
.phone-screen { background: #FAF9FF; border-radius: 28px; padding: 22px 18px; max-height: 760px; overflow-y: auto; font-size: 13px; color: var(--ink); display: grid; gap: 10px; align-content: start; }
.phone-screen h3 { font-size: 18px; }
.phone-screen p { color: var(--ink-2); }
.phone-screen .placeholder { color: var(--ink-3); font-style: italic; }
.pv-items { display: grid; gap: 8px; margin-top: 6px; }
.pv-item { display: grid; grid-template-columns: 20px 1fr; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.pv-box { width: 18px; height: 18px; border: 2px solid var(--violet); border-radius: 5px; margin-top: 1px; }
.pv-opt { font-style: normal; color: var(--ink-3); }
.pv-sign { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink-3); background: var(--white); }
.pv-btn { background: var(--violet); color: #fff; text-align: center; padding: 12px; border-radius: 12px; font-weight: 600; }

.checklist li a { color: inherit; }
.checklist li.todo::before { border-color: var(--violet); }
.checklist li.started { border-color: #F8E1B4; background: #FFFBF2; }
.checklist li.started::before { border-color: #E0A93B; border-style: solid; background: conic-gradient(#E0A93B 0 50%, transparent 50% 100%); }

@media (max-width: 1080px) {
  .consent-layout { grid-template-columns: minmax(0, 1fr); }
  .consent-preview { position: static; max-width: 380px; }
}

/* ---------- Milestone 2.3: tasks ---------- */
.warn-text { color: var(--warn); font-weight: 500; }
.placeholder { color: var(--ink-3); font-style: italic; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover:not([disabled]) { border-color: var(--violet); color: var(--violet); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.alert-error-flash { background: var(--error-bg); color: var(--error); }

.day-block { display: grid; gap: 10px; }
.day-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); display: flex; align-items: center; gap: 12px; }
.day-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-title span { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--violet-dark); }
.task-cards { display: grid; gap: 10px; }
.task-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; box-shadow: var(--shadow); flex-wrap: wrap; }
.task-card-main { display: grid; gap: 6px; min-width: 0; flex: 1; }
.task-title { font: 600 16px var(--font-head); color: var(--ink); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.task-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.confirm { position: relative; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] .confirm-box { display: flex; }
.confirm-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); gap: 10px; align-items: center; white-space: nowrap; }
.q-card .confirm-box { position: static; margin-top: 10px; display: flex; }
.repeat-row { display: grid; gap: 12px; }

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.builder-main { display: grid; gap: 14px; min-width: 0; }
.empty-small { padding: 28px 20px; }
.instructions-card p { color: var(--ink-2); }
.q-card { padding: 18px 20px; }
.q-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; }
.q-num { width: 28px; height: 28px; border-radius: 50%; background: var(--lilac); color: var(--violet-dark); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.q-tags { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.q-prompt { font-weight: 600; margin-top: 6px; }
.q-actions { display: flex; gap: 6px; }
.cond-note { font-size: 12px; color: var(--violet-dark); background: var(--lilac); display: inline-block; padding: 3px 8px; border-radius: 6px; margin-top: 6px; }
.q-edit { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.q-edit > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--violet); list-style: none; }
.q-edit > summary::-webkit-details-marker { display: none; }
.q-edit[open] > summary { margin-bottom: 4px; }
.gallery-check { align-self: end; padding-bottom: 12px; }
.options-edit { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.field-label { font-size: 13px; font-weight: 600; }
.option-row { display: flex; gap: 10px; align-items: center; }
.option-row input[type=text] { flex: 1; font: 400 14px var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.field input[type=text] { font: 400 15px var(--font); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }

.type-pill { display: inline-block; font: 600 12px/1 var(--font); padding: 5px 9px; border-radius: 6px; background: var(--lilac); color: var(--violet-dark); }
.type-video { background: #FFE9EA; color: #B42332; }
.type-photo { background: #FFF1E0; color: #A3550A; }
.type-audio { background: #E8F7F0; color: #0F7650; }
.type-text { background: #EEF0FF; color: #4130C9; }
.type-single, .type-multi { background: #F3EAFF; color: #7A2FC7; }
.type-rating { background: #E6F4FF; color: #0B5FA5; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.type-btn { display: grid; gap: 6px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; font: inherit; }
.type-btn:hover { border-color: var(--violet); background: #FBFAFF; }

.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.preview-head .preview-label { margin: 0; }
.mini-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-tabs a { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); background: var(--white); }
.mini-tabs a.is-active { background: var(--violet); color: #fff; border-color: var(--violet); }
.pv-task { gap: 12px; }
.pv-day { font-size: 11px; font-weight: 700; color: var(--violet-dark); text-transform: uppercase; letter-spacing: .06em; }
.pv-q { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.pv-prompt { font-weight: 600; color: var(--ink) !important; }
.pv-help, .pv-alt { font-size: 12px; color: var(--ink-3) !important; }
.pv-cond { font-size: 11px; color: var(--violet-dark) !important; }
.pv-missing { font-size: 10px; font-weight: 700; color: #92400E; background: #FFF6E5; padding: 1px 5px; border-radius: 4px; font-style: normal; }
.pv-capture { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #F3F0FF; font-weight: 600; font-size: 12px; color: var(--violet-dark); }
.pv-rec { width: 26px; height: 26px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--coral); flex: none; }
.pv-mic { width: 26px; height: 26px; border-radius: 50%; background: var(--violet); flex: none; position: relative; }
.pv-mic::after { content: ""; position: absolute; left: 9px; top: 5px; width: 8px; height: 12px; border-radius: 4px; background: #fff; }
.pv-photos { display: flex; gap: 8px; }
.pv-ph { width: 54px; height: 54px; border: 2px dashed #CBC3FF; border-radius: 10px; display: grid; place-items: center; color: var(--violet); font-size: 20px; }
.pv-text { border: 1px solid var(--line); border-radius: 10px; padding: 10px; height: 64px; color: var(--ink-3); }
.pv-opts { display: grid; gap: 6px; }
.pv-opt-row { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pv-radio, .pv-check { width: 16px; height: 16px; border: 2px solid var(--violet); flex: none; }
.pv-radio { border-radius: 50%; }
.pv-check { border-radius: 4px; }
.pv-scale { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; }
.pv-scale span { text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 6px 0; font-size: 11px; font-weight: 600; }
.pv-scale-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); }

@media (max-width: 1080px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder-preview { position: static; max-width: 380px; }
}
@media (max-width: 600px) {
  .q-head { grid-template-columns: 28px 1fr; }
  .q-actions { grid-column: 2; }
  .confirm-box { position: static; margin-top: 8px; white-space: normal; flex-wrap: wrap; }
  .task-actions { width: 100%; }
}

.field select { width: 100%; }
.field-inline select, .orgswitch select { width: auto; }
.page, .builder-main, .consent-main { grid-template-columns: minmax(0, 1fr); }
.field select, .field input, .field textarea { min-width: 0; max-width: 100%; }
.field, .form, .options-edit, .add-custom { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) {
  .study-layout, .form-grid, .form-grid-3, .radio-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Milestone 2.4: translations ---------- */
.tr-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; }
.tr-tools .card-title { margin-bottom: 8px; }
.tr-tools p { margin-bottom: 12px; }
.tr-tools input[type=file] { font-size: 13px; max-width: 240px; }
.tr-form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.tr-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tr-bar-bottom { justify-content: flex-end; }
.tr-task { font: 600 15px var(--font-head); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.tr-table { table-layout: fixed; }
.tr-table th.tr-what, .tr-table td.tr-what { width: 150px; }
.tr-table td { vertical-align: top; }
.tr-src { color: var(--ink-2); font-size: 14px; }
.tr-dst input, .tr-dst textarea { width: 100%; font: 400 14px/1.45 var(--font); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); resize: vertical; }
.tr-dst input:focus, .tr-dst textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(109, 74, 255, .12); }
.tr-table tr.is-missing td.tr-dst input, .tr-table tr.is-missing td.tr-dst textarea { border-color: #F2C879; background: #FFFCF5; }
@media (max-width: 860px) {
  .tr-tools { grid-template-columns: minmax(0, 1fr); }
  .tr-table, .tr-table tbody, .tr-table tr, .tr-table td { display: block; width: 100%; }
  .tr-table thead { display: none; }
  .tr-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tr-table td { border: 0; padding: 4px 16px; }
  .tr-table th.tr-what, .tr-table td.tr-what { width: auto; }
}

/* ---------- Milestone 3.1: participants, email settings, participant pages ---------- */
.strong { font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
label.check input { accent-color: var(--violet); width: 16px; height: 16px; }
.pt-tabs { margin-bottom: 14px; }
.pt-tabs .count { font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--bg); padding: 2px 7px; border-radius: 999px; }
.pt-tabs a.is-active .count { background: #fff; color: var(--violet-dark); }
.pt-filter { margin-bottom: 16px; }
.pt-filter select { font: 400 14px var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); max-width: 100%; }
.pt-inviteall { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; background: var(--lilac); border-color: #D8D2FF; }
.pt-inviteall div { display: grid; gap: 2px; }
.pt-table td { vertical-align: middle; }
.pt-check { width: 44px; }
.pt-check input { width: 16px; height: 16px; accent-color: var(--violet); }
.pt-code { font: 600 14px var(--font-head); }
.pt-contact { word-break: break-all; }
.pt-status-added { background: var(--bg); color: var(--ink-2); }
.pt-status-invited { background: #EEF0FF; color: var(--violet-dark); border-color: #D8D2FF; }
.pt-status-consented, .pt-status-active { background: var(--ok-bg); color: var(--ok); border-color: #BFE6D3; }
.pt-status-completed { background: #E8F3FF; color: #1D4F91; border-color: #C7DDF7; }
.pt-status-withdrawn { background: var(--error-bg); color: var(--error); border-color: #F3C3CA; }
.pt-mail-sent { background: var(--ok-bg); color: var(--ok); border-color: #BFE6D3; }
.pt-mail-failed { background: var(--error-bg); color: var(--error); border-color: #F3C3CA; }
.pt-mail-queued, .pt-mail-sending { background: #FFF6E5; color: #92400E; border-color: #F8E1B4; }
.pt-bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pt-bulkbar select { font: 400 14px var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); max-width: 100%; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 16px 0; }
.pt-add { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-top: 24px; align-items: start; }
.pt-add .card-title { margin-bottom: 8px; }
.pt-add .form { margin-top: 8px; }
.pt-cols { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.pt-cols code { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.pt-add input[type=file] { font-size: 13px; max-width: 100%; }
.pt-sub { font: 600 14px var(--font-head); margin: 20px 0 8px; }
.pt-mails { list-style: none; display: grid; gap: 8px; }
.pt-mails li { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.set-now p { margin-bottom: 6px; }
.set-now form { margin-top: 10px; }
.set-driver[hidden], [data-show-when][hidden] { display: none; }
.set-note { margin-top: 4px; }
.set-loghead { padding: 20px 20px 8px; }
.set-empty { padding: 0 20px 20px; }
@media (max-width: 860px) {
  .pt-add { grid-template-columns: minmax(0, 1fr); }
  .pt-table, .pt-table tbody, .pt-table tr, .pt-table td { display: block; width: 100%; }
  .pt-table thead { display: none; }
  .pt-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; position: relative; }
  .pt-table td { border: 0; padding: 3px 16px; }
  .pt-table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 84px; font-size: 12px; color: var(--ink-3); }
  .pt-table td.pt-check { position: absolute; right: 4px; top: 10px; width: auto; }
}

/* Participant-facing pages (phone first) */
.pp-body { background: var(--lilac); min-height: 100vh; }
.pp { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.pp-app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.pp-logo { width: 140px; height: auto; justify-self: center; margin: 8px 0; }
.pp-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pp-top-mark { width: 28px; height: 28px; }
.pp-top-study { font: 600 15px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.pp-nav a { display: grid; justify-items: center; gap: 2px; padding: 10px 0 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pp-nav a:hover { text-decoration: none; }
.pp-nav a.is-active { color: var(--violet); }
.pp-ico { width: 22px; height: 22px; border-radius: 6px; border: 2px solid currentColor; }
.pp-ico-help { border-radius: 50%; }
.pp-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 22px 20px; display: grid; gap: 12px; }
.pp-card h1 { font-size: 22px; }
.pp-card h2 { font-size: 17px; }
.pp-card p { color: var(--ink-2); }
.pp-center { text-align: center; justify-items: center; padding: 32px 22px; }
.pp-quiet { box-shadow: none; border: 1px dashed #D8D2FF; background: rgba(255, 255, 255, .6); }
.pp-sub { font-size: 13px; color: var(--ink-3) !important; }
.pp-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--grad); box-shadow: inset 0 0 0 12px rgba(255, 255, 255, .55); }
.pp-hello { display: grid; gap: 6px; padding: 4px 4px 0; }
.pp-hello h1 { font-size: 26px; }
.pp-hello p { color: var(--ink-2); }
.pp-day { font: 700 12px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--violet) !important; }
.pp-h2 { font-size: 15px; color: var(--ink-2); margin: 8px 4px 0; }
.pp-prose { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.pp-alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.pp-alert-ok { background: var(--ok-bg); color: var(--ok); }
.pp-alert-error { background: var(--error-bg); color: var(--error); }
.pp-tip { font-size: 13px; color: var(--ink-3); text-align: center; }
.pp-back { justify-self: start; font-size: 14px; font-weight: 600; }
.pp-back::before { content: "\2039  "; }

.pp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 600 16px/1 var(--font); padding: 15px 20px; border-radius: 14px; border: 1px solid transparent; background: var(--violet); color: #fff; cursor: pointer; min-height: 52px; text-decoration: none; }
.pp-btn:hover { text-decoration: none; background: var(--violet-dark); }
.pp-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.pp-btn-ghost:hover { background: #fff; border-color: var(--violet); color: var(--violet); }
.pp-btn-danger { background: #fff; color: var(--error); border-color: #F3C3CA; }
.pp-btn-danger:hover { background: var(--error-bg); }
.pp-btn-small { min-height: 0; padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.pp-btn-send { width: 100%; margin-top: 4px; }
.pp-btn[disabled] { opacity: .6; }
.pp-link { background: none; border: 0; color: var(--violet); font: 600 14px var(--font); cursor: pointer; padding: 6px 0; }
.pp-decline { text-align: center; }
.pp-decline .pp-link { color: var(--ink-3); font-weight: 500; }

.pp-form { display: grid; gap: 14px; }
.pp-tick { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 15px; }
.pp-tick input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--violet); }
.pp-tick:has(input:checked) { border-color: var(--violet); background: #FBFAFF; }
.pp-tag { display: inline-block; font: 600 11px var(--font); font-style: normal; padding: 2px 7px; border-radius: 999px; background: var(--lilac); color: var(--violet-dark); margin-left: 4px; vertical-align: 1px; }
.pp-tag-quiet { background: var(--bg); color: var(--ink-3); }
.pp-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.pp-field input, .pp-q textarea, .pp-other, .pp-row select, .pp-lang select { font: 400 16px var(--font); padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
.pp-field input:focus, .pp-q textarea:focus, .pp-other:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(109, 74, 255, .12); }
.pp-lang { justify-self: end; }
.pp-lang select { width: auto; padding: 8px 12px; font-size: 14px; }
.pp-row { display: flex; gap: 10px; align-items: center; }
.pp-signed { list-style: none; display: grid; gap: 8px; }
.pp-signed li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14px; color: var(--ink-2); }
.pp-signed li.is-yes span { color: var(--ok); font-weight: 700; }

.pp-tasks { list-style: none; display: grid; gap: 10px; }
.pp-task-link { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); }
.pp-task-link:hover { text-decoration: none; }
a.pp-task-link:active { transform: scale(.99); }
.pp-task-state { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CBC3FF; flex: none; }
.pp-task.is-todo .pp-task-state { border-color: var(--violet); box-shadow: inset 0 0 0 5px #fff; background: var(--violet); }
.pp-task.is-done .pp-task-state { border-color: var(--ok); background: var(--ok); position: relative; }
.pp-task.is-done .pp-task-state::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pp-task.is-missed .pp-task-link, .pp-tasks-quiet .pp-task-link { box-shadow: none; background: rgba(255, 255, 255, .6); color: var(--ink-2); }
.pp-task.is-missed .pp-task-state { border-style: dashed; border-color: var(--ink-3); }
.pp-task-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pp-task-main strong { font-size: 16px; }
.pp-task-meta { font-size: 13px; color: var(--ink-3); }
.pp-chev { width: 10px; height: 10px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(-45deg); flex: none; }

.pp-task-form { display: grid; gap: 14px; }
.pp-q { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 20px; display: grid; gap: 10px; scroll-margin-top: 80px; }
.pp-q[hidden] { display: none; }
.pp-q.has-error { box-shadow: 0 0 0 2px var(--error); }
.pp-q h2 { font-size: 17px; line-height: 1.35; }
.pp-help, .pp-hint { font-size: 14px; color: var(--ink-3); }
.pp-qerr { font-size: 14px; font-weight: 600; color: var(--error); }
.pp-count { font-size: 12px; color: var(--ink-3); text-align: right; }
.pp-options { display: grid; gap: 8px; }
.pp-option { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 15px; }
.pp-option input { width: 22px; height: 22px; accent-color: var(--violet); }
.pp-option:has(input:checked) { border-color: var(--violet); background: #FBFAFF; }
.pp-scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.pp-scale label { position: relative; }
.pp-scale input { position: absolute; opacity: 0; inset: 0; }
.pp-scale span { display: block; text-align: center; padding: 12px 0; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.pp-scale input:checked + span { background: var(--violet); color: #fff; border-color: var(--violet); }
.pp-scale input:focus-visible + span { box-shadow: 0 0 0 3px rgba(109, 74, 255, .3); }
.pp-scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-3); }
.pp-cap { display: grid; gap: 10px; }
.pp-cap-buttons { display: grid; gap: 8px; }
.pp-cap-buttons[hidden] { display: none; }
.pp-btn-rec { background: var(--navy); }
.pp-btn-rec:hover { background: #24215a; }
.pp-rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px rgba(255, 94, 98, .3); }
.pp-rec-dot.is-live { animation: pp-pulse 1s infinite; }
@keyframes pp-pulse { 50% { opacity: .35; } }
.pp-cam, .pp-mic { width: 16px; height: 14px; border: 2px solid #fff; border-radius: 4px; }
.pp-mic { width: 10px; height: 16px; border-radius: 6px; }
.pp-recording { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #FFF0F0; font: 600 16px var(--font); }
.pp-recording[hidden] { display: none; }
.pp-recording .pp-btn { margin-left: auto; background: var(--coral); }
.pp-files { list-style: none; display: grid; gap: 8px; }
.pp-file { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.pp-file:not(:has(.pp-file-preview)) { grid-template-columns: 1fr auto; }
.pp-file-preview img, .pp-file-preview video { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--bg); display: block; }
.pp-file-preview audio { width: 72px; }
.pp-file-body { display: grid; gap: 6px; min-width: 0; }
.pp-file-name { font-size: 14px; font-weight: 600; }
.pp-file.is-done .pp-file-name { color: var(--ok); }
.pp-file.is-paused .pp-file-name { color: var(--warn); font-weight: 500; }
.pp-progress { height: 6px; border-radius: 999px; background: var(--lilac); overflow: hidden; }
.pp-progress span { display: block; height: 100%; width: 0; background: var(--violet); transition: width .3s; }
.pp-file.is-done .pp-progress span { background: var(--ok); }

/* ---------- Admin, Integrations: settings console ---------- */
.ic { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
.ic-rail { position: sticky; top: 24px; display: grid; gap: 6px; }
.ic-rail h1 { font-size: 24px; }
.ic-rail-note { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.ic-services { display: grid; gap: 2px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.ic-svc { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--ink); }
.ic-svc:hover { background: var(--bg); text-decoration: none; }
.ic-svc.is-current { background: var(--lilac); box-shadow: inset 3px 0 0 var(--violet); }
.ic-svc-text { display: grid; min-width: 0; }
.ic-svc-text strong { font-size: 14px; font-weight: 600; }
.ic-svc-text small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-dot { width: 10px; height: 10px; border-radius: 50%; background: #CFCBE0; }
.ic-svc.is-on .ic-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.ic-svc.is-failed .ic-dot { background: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }
.ic-svc.is-untested .ic-dot, .ic-svc.is-env .ic-dot { background: #D99A1E; box-shadow: 0 0 0 3px #FFF3DC; }

.ic-main { display: grid; gap: 20px; min-width: 0; }
.ic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ic-head h2 { font-size: 26px; margin-bottom: 6px; }
.ic-head p { color: var(--ink-2); max-width: 62ch; }
.ic-pill { flex: none; font: 600 13px/1 var(--font); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); white-space: nowrap; }
.ic-pill::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }
.ic-pill.is-on { color: var(--ok); border-color: #BFE6D3; background: var(--ok-bg); }
.ic-pill.is-failed { color: var(--error); border-color: #F3C3CA; background: var(--error-bg); }
.ic-pill.is-untested, .ic-pill.is-env { color: #92400E; border-color: #F8E1B4; background: #FFF6E5; }
.ic-pill.is-off { color: var(--ink-3); }

.ic-current { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 20px; align-items: center; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.ic-current.is-off { display: block; background: var(--bg); border-style: dashed; color: var(--ink-2); font-size: 14px; }
.ic-current-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.ic-current-name { font: 600 17px var(--font-head); }
.ic-current-detail { font-size: 13px; color: var(--ink-3); word-break: break-word; }
.ic-current-test { font-size: 13px; color: var(--ink-2); min-width: 0; border-left: 1px solid var(--line); padding-left: 20px; }
.ic-test-head { font-weight: 600; }
.ic-test-msg { color: var(--ink-3); word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ic-current-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ic-sms-test { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.ic-sms-test input { font: 400 14px var(--font); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; flex: 1; max-width: 340px; }

.ic-mono { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 700 14px var(--font-head); color: var(--navy); background: var(--lilac); border: 1px solid #DDD6FF; }

.ic-form { display: grid; gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.ic-block { border: 0; padding: 22px 22px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 14px; min-width: 0; }
.ic-block[hidden] { display: none; }
.ic-block legend { float: left; width: 100%; font: 600 15px var(--font-head); margin-bottom: 4px; }
.ic-providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ic-provider { position: relative; display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--white); }
.ic-provider:hover { border-color: #C9BEFF; }
.ic-provider input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ic-provider .ic-mono { width: 34px; height: 34px; font-size: 12px; border-radius: 9px; }
.ic-provider-text { display: grid; min-width: 0; }
.ic-provider-text strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
.ic-provider-text small { font-size: 12px; color: var(--ink-3); }
.ic-provider:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); background: #FBFAFF; }
.ic-provider:has(input:checked) .ic-mono { background: var(--violet); color: var(--white); border-color: var(--violet); }
.ic-provider:has(input:focus-visible) { outline: 3px solid rgba(109, 74, 255, .35); outline-offset: 2px; }
.ic-saved { position: absolute; top: 8px; right: 8px; font: 600 10px var(--font); color: var(--ok); background: var(--ok-bg); padding: 2px 6px; border-radius: 999px; }
.ic-hint { font-size: 13px; color: var(--ink-3); }
.ic-save { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; background: var(--bg); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.ic-save .ic-hint { max-width: 60ch; }

@media (max-width: 960px) {
  .ic { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ic-rail { position: static; }
  .ic-services { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: thin; }
  .ic-svc { flex: none; min-width: 150px; }
  .ic-svc.is-current { box-shadow: inset 0 -3px 0 var(--violet); }
  .ic-current { grid-template-columns: minmax(0, 1fr); }
  .ic-current-test { border-left: 0; padding-left: 0; }
  .ic-current-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .ic-head { flex-direction: column; }
  .ic-providers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ic-block { padding: 18px 16px; }
}

/* ---------- AI translation ---------- */
.set-tabs { margin-bottom: 16px; }
.tr-ai { margin-bottom: 4px; }
.tr-ai-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tr-ai-head .card-title { margin-bottom: 4px; }
.tr-ai-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tr-ai-status { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--info-bg); }
.tr-ai-status.is-ok { background: var(--ok-bg); color: var(--ok); }
.tr-ai-status.is-error { background: var(--error-bg); color: var(--error); }
.tr-dst .is-ai { border-color: #B7A6FF !important; background: #F7F4FF !important; }
.ic > * { min-width: 0; }
.ic-block .field { align-content: start; }
.secret-hint { font-size: 12px; font-style: normal; color: var(--ink-3); }
.ic-rail > * { min-width: 0; }
.ic-rail { grid-template-columns: minmax(0, 1fr); }
.ic-svc { position: relative; } /* keeps its hidden status text inside the scrolling list */
.field .is-ai, .field textarea.is-ai, .field input.is-ai { border-color: #B7A6FF; background: #F7F4FF; }

/* ---------- Milestone 4: review feed ---------- */
.fd-waiting { color: #92400E; }
.fd-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.fd-filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.fd-filters select, .fd-filters input { font: 400 14px var(--font); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); max-width: 260px; }
.fd-filter-actions { display: flex; gap: 12px; align-items: center; }
.fd-count { font-size: 13px; color: var(--ink-3); }
.fd-list { display: grid; gap: 16px; }
.fd-entry { background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.fd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #FCFBFF; }
.fd-who { font: 700 15px var(--font-head); color: var(--ink); }
.fd-task { font-weight: 600; font-size: 15px; }
.fd-when { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.fd-left { background: var(--error-bg); color: var(--error); }
.fd-answers { display: grid; gap: 0; }
.fd-ans { padding: 16px 20px; display: grid; gap: 8px; border-top: 1px solid #F1EEFA; min-width: 0; }
.fd-ans:first-child { border-top: 0; }
.fd-q { font: 500 13px var(--font); color: var(--ink-3); }
.fd-media { display: flex; flex-wrap: wrap; gap: 10px; }
.fd-video { display: grid; gap: 6px; max-width: 520px; width: 100%; }
.fd-video video { width: 100%; border-radius: 12px; background: #0E0C24; aspect-ratio: 16 / 9; object-fit: contain; display: block; }
.fd-video.is-portrait { max-width: 300px; }
.fd-video.is-portrait video { aspect-ratio: 9 / 16; }
.fd-video figcaption { font-size: 12px; color: var(--ink-3); display: flex; gap: 12px; }
.fd-photo { display: block; width: 160px; height: 160px; border-radius: 12px; overflow: hidden; background: var(--bg); }
.fd-photo img { width: 100%; height: 100%; object-fit: cover; }
.fd-photo:hover img { opacity: .9; }
.fd-audio { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.fd-audio audio { max-width: 100%; }
.fd-audio span { font-size: 12px; color: var(--ink-3); }
.fd-pending { padding: 14px 16px; border-radius: 12px; background: #FFF6E5; color: #92400E; font-size: 13px; }
.fd-pending.is-failed { background: var(--error-bg); color: var(--error); }
.fd-text { margin: 0; padding: 10px 14px; border-left: 3px solid var(--violet); background: #FBFAFF; border-radius: 0 10px 10px 0; font-size: 15px; line-height: 1.6; max-width: 75ch; }
.fd-choices { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.fd-choices li { padding: 6px 12px; border-radius: 999px; background: var(--lilac); color: var(--violet-dark); font-size: 14px; font-weight: 500; }
.fd-rating { display: flex; align-items: center; gap: 10px; }
.fd-rating strong { font: 700 22px var(--font-head); }
.fd-rating span { font-size: 13px; color: var(--ink-3); }
.fd-bar { width: 140px; height: 6px; border-radius: 999px; background: var(--lilac); overflow: hidden; }
.fd-bar span { display: block; height: 100%; background: var(--violet); }
.fd-viewer { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.fd-viewer::backdrop { background: rgba(14, 12, 36, .86); }
.fd-viewer img { display: block; max-width: 94vw; max-height: 90vh; border-radius: 10px; }
.fd-viewer-close { position: fixed; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 24px; cursor: pointer; }
@media (max-width: 600px) {
  .fd-head, .fd-ans { padding-left: 14px; padding-right: 14px; }
  .fd-when { margin-left: 0; width: 100%; }
  .fd-photo { width: calc(50% - 5px); height: auto; aspect-ratio: 1; }
  .fd-filters label { flex: 1 1 140px; }
  .fd-filters select, .fd-filters input { max-width: 100%; width: 100%; }
}

/* ---------- study status (draft, live, paused, closed) ---------- */
.status-card { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; border-left: 4px solid var(--line); }
.status-card-draft { border-left-color: #F0B65A; }
.status-card-live { border-left-color: var(--ok); }
.status-card-paused { border-left-color: var(--violet); }
.status-card-main { flex: 1; min-width: 0; }
.status-card-main > p { margin: 6px 0 0; color: var(--ink-2); }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: flex-end; }
.status-actions form { margin: 0; }
.status-close { position: relative; }
.status-close > summary { list-style: none; cursor: pointer; }
.status-close > summary::-webkit-details-marker { display: none; }
.status-close-box { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 12px 32px rgba(20, 16, 60, .14); z-index: 5; }
.status-close-box p { margin: 0 0 10px; }
.btn-danger-solid { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger-solid:hover { background: #A51F32; color: #fff; }
.readiness { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.readiness li { display: flex; gap: 12px; align-items: baseline; font-size: 14px; padding: 9px 12px; border-radius: 10px; }
.readiness li span { flex: 1; min-width: 0; }
.readiness .is-blocker { background: var(--error-bg); color: var(--error); }
.readiness .is-warning { background: #FFF6E5; color: #92400E; }
.readiness a { font-weight: 600; white-space: nowrap; color: inherit; text-decoration: underline; }
.pill-test { background: #FFF6E5; color: #92400E; }
.pt-testcheck { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.pt-testcheck input { margin-top: 3px; flex: none; }
.pt-testcheck .muted { display: block; margin-top: 2px; }
@media (max-width: 760px) {
  .status-card { flex-direction: column; }
  .status-actions { justify-content: flex-start; }
  .status-close-box { left: 0; right: auto; width: min(290px, calc(100vw - 64px)); }
}
.gallery-note { margin: -4px 0 4px; }
.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }

/* ---------- participant task page: question numbers, in-page recorder, review ---------- */
.pp-qnum { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--violet); margin-bottom: -6px; }
.pp-qnum[hidden], .pp-qnum:empty { display: none; }
.pp-cap-note { font-size: 14px; padding: 10px 12px; border-radius: 12px; background: #FFF6E5; color: #92400E; }
.pp-cap-note[hidden] { display: none; }
.pp-live { display: grid; gap: 10px; }
.pp-live[hidden] { display: none; }
.pp-live-view { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0F0D2A; border-radius: 14px; display: block; }
.pp-live[data-kind=photo] .pp-live-view { aspect-ratio: 4 / 3; }
.pp-live-view.is-mirror { transform: scaleX(-1); }
.pp-live-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #FFF0F0; font: 600 16px var(--font); }
.pp-live[data-kind=photo] .pp-live-bar { background: var(--bg); }
.pp-live-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.pp-btn-go { margin-left: auto; background: var(--coral); }
.pp-btn-go:hover { background: #E94D52; }
.pp-live[data-kind=photo] .pp-btn-go { background: var(--violet); }
.pp-btn-go.is-stop, .pp-btn-go.is-stop:hover { background: var(--navy); }
.pp-file { grid-template-columns: 72px minmax(0, 1fr) auto; }
.pp-file-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pp-file-video, .pp-file-audio { grid-template-columns: minmax(0, 1fr) auto; }
.pp-file-video .pp-file-preview, .pp-file-audio .pp-file-preview { grid-column: 1 / -1; }
.pp-file-video .pp-file-preview video { width: 100%; height: auto; max-height: 360px; object-fit: contain; background: #000; }
.pp-file-audio .pp-file-preview audio { width: 100%; }
.pp-send-note { font-size: 13px; color: var(--ink-3); text-align: center; }
.pp-send-note[hidden] { display: none; }
.pp-alert-test { background: #FFF6E5; color: #92400E; margin-bottom: 14px; }
.pp-btn[hidden], .pp-cap-buttons [hidden] { display: none; }

/* ---------- review: tags and highlights ---------- */
.rv-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rv-tag { display: inline-flex; align-items: center; gap: 2px; font: 600 12px/1 var(--font); padding: 5px 4px 5px 10px; border-radius: 999px; background: var(--lilac); color: var(--violet-dark); }
.rv-tag a { color: inherit; text-decoration: none; }
.rv-tag a:hover { text-decoration: underline; }
.rv-tag form { margin: 0; display: inline; }
.rv-tag-small { padding: 4px 9px; font-size: 11px; }
a.rv-tag { text-decoration: none; }
.rv-tag-x { border: 0; background: none; color: inherit; opacity: .55; cursor: pointer; font: 600 15px/1 var(--font); padding: 0 5px; }
.rv-tag-x:hover { opacity: 1; }
.rv-c-violet { background: #EEEAFF; color: #4B32C3; }
.rv-c-coral { background: #FFE9E9; color: #B4232A; }
.rv-c-teal { background: #DDF5F1; color: #0F6B5E; }
.rv-c-amber { background: #FFF1D6; color: #8A4B05; }
.rv-c-blue { background: #E2EEFF; color: #1D4FB3; }
.rv-c-green { background: #E3F6E5; color: #23702D; }
.rv-c-pink { background: #FDE6F3; color: #9D1C67; }
.rv-c-slate { background: #ECEEF3; color: #3D4559; }
.rv-tag-add { display: inline-flex; gap: 6px; margin: 0; }
.rv-tag-add input { font: 400 13px var(--font); padding: 6px 10px; border: 1px dashed var(--line); border-radius: 999px; width: 140px; background: #fff; }
.rv-tag-add input:focus { border-style: solid; border-color: var(--violet); outline: none; }
.fd-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #FCFBFF; }
.rv-hls { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-hls:empty { display: none; }
.rv-hl { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #FFF8EC; border: 1px solid #F8E1B4; font-size: 14px; }
.rv-hl form { margin: 0 0 0 auto; }
.rv-hl-time { flex: none; font: 600 13px var(--font); color: #8A4B05; background: none; border: 0; padding: 2px 0; cursor: pointer; white-space: nowrap; }
.rv-hl-time.is-whole { cursor: default; }
button.rv-hl-time:hover { text-decoration: underline; }
.rv-hl-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rv-hl-note { color: var(--ink); }
.rv-hl-by { font-size: 12px; color: var(--ink-3); }
.rv-hl-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font: 600 16px/1 var(--font); padding: 0 4px; }
.rv-hl-x:hover { color: var(--error); }
.rv-new > summary { list-style: none; cursor: pointer; display: inline-block; font: 600 13px var(--font); color: var(--violet); }
.rv-new > summary::-webkit-details-marker { display: none; }
.rv-new > summary::before { content: '+ '; }
.rv-new[open] > summary { margin-bottom: 8px; }
.rv-new-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #FCFBFF; max-width: 560px; }
.rv-new-form textarea, .rv-new-form input[type=text], .rv-new-form select { font: 400 14px var(--font); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; }
.rv-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-times label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.rv-times input[type=text] { width: 80px; }
.rv-new-actions { display: flex; align-items: center; gap: 12px; }
.rv-err { color: var(--error); font-size: 13px; margin: 0; }
.rv-err[hidden] { display: none; }
.hl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.hl-list { display: grid; gap: 14px; }
.hl-card { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.hl-media video { width: 100%; border-radius: 10px; background: #000; max-height: 260px; }
.hl-media video.is-portrait { max-height: 360px; }
.hl-media audio { width: 100%; }
.hl-media img { width: 100%; border-radius: 10px; display: block; }
.hl-info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.hl-info p { margin: 0; }
.hl-meta { font-size: 14px; }
.hl-q { font-size: 13px; color: var(--ink-3); }
.hl-time { font: 600 13px var(--font); color: #8A4B05; }
.hl-note { font-size: 15px; }
.hl-remove { margin: 4px 0 0; }
.hl-tagsbox { position: sticky; top: 84px; }
.hl-taglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hl-taglist li { display: grid; gap: 4px; }
.hl-tagedit summary { cursor: pointer; font-size: 12px; color: var(--violet); }
.hl-tagedit form { margin-top: 6px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .hl-layout { grid-template-columns: 1fr; }
  .hl-tagsbox { position: static; }
  .hl-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .fd-foot { padding: 12px 14px; } }
.hl-taglist li { justify-items: start; }
.hl-main .fd-count { margin: 14px 0 10px; }
.hl-main .fd-filters { margin-bottom: 4px; }

/* ---------- messages: research team ---------- */
.fd-follow { font-size: 13px; font-weight: 600; }
.msg-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.msg-tabs { display: flex; gap: 4px; }
.msg-tabs a { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); }
.msg-tabs a.is-active { background: var(--lilac); color: var(--violet-dark); }
.msg-tabs a:hover { text-decoration: none; }
.msg-find { margin: 4px 0 14px; }
.msg-find input { max-width: 240px; }
.msg-empty { margin: 8px 0 0; }
.msg-threads { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.msg-threads li { border-bottom: 1px solid var(--line); }
.msg-threads a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 6px; color: var(--ink); }
.msg-threads a:hover { text-decoration: none; background: #FBFAFF; }
.msg-who { font-weight: 600; }
.msg-when { font-size: 12px; color: var(--ink-3); }
.msg-last { grid-column: 1; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-last em { font-style: normal; color: var(--ink-3); }
.msg-badge { grid-column: 2; justify-self: end; font: 600 11px/1 var(--font); padding: 4px 8px; border-radius: 999px; background: var(--coral); color: #fff; }
.msg-threads li.is-unread .msg-last { color: var(--ink); font-weight: 500; }
.msg-thread { max-width: 820px; }
.msg-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 14px; }
.msg { display: grid; gap: 4px; max-width: 78%; }
.msg-team { justify-self: end; justify-items: end; }
.msg-them { justify-self: start; }
.msg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; }
.msg-bubble p { margin: 0; }
.msg-team .msg-bubble { background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.msg-team .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-them .msg-bubble { background: #F1EEFA; color: var(--ink); border-bottom-left-radius: 4px; }
.msg-about { font-size: 12px; opacity: .85; margin: 0 0 4px !important; }
.msg-meta { font-size: 12px; color: var(--ink-3); margin: 0; }
.msg-compose { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.msg-compose textarea { font: 400 15px var(--font); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; width: 100%; }
.msg-compose .msg-about { color: var(--ink-2); font-size: 13px; opacity: 1; }
.msg-compose .form-actions { align-items: center; gap: 12px; }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } .msg { max-width: 92%; } }

/* ---------- messages: participant app ---------- */
.pp-nav { grid-template-columns: 1fr 1fr 1fr; }
.pp-nav a { position: relative; }
.pp-ico-msg { border-radius: 8px 8px 8px 2px; }
.pp-nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.pp-quiet-text { color: var(--ink-3); font-size: 15px; }
.pp-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pp-msg { display: grid; gap: 4px; max-width: 86%; }
.pp-msg.is-team { justify-self: start; }
.pp-msg.is-me { justify-self: end; justify-items: end; }
.pp-msg-bubble { padding: 11px 14px; border-radius: 18px; font-size: 16px; line-height: 1.45; }
.pp-msg-bubble p { margin: 0; }
.pp-msg.is-team .pp-msg-bubble { background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.pp-msg.is-me .pp-msg-bubble { background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.pp-msg-about { font-size: 12px; color: var(--violet); font-weight: 600; margin-bottom: 4px !important; }
.pp-msg-meta { font-size: 12px; color: var(--ink-3); margin: 0; }
.pp-msg-form { display: grid; gap: 10px; margin-top: 18px; }
.pp-msg-form textarea { font: 400 16px var(--font); padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; width: 100%; }

/* ---------- plan notice, sign-up ---------- */
.plan-bar { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.plan-bar-info { background: var(--info-bg); color: var(--violet-dark); }
.plan-bar-warn { background: #FFF6E5; color: #92400E; }
.plan-bar-error { background: var(--error-bg); color: var(--error); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-card .check { align-items: flex-start; }
.auth-card .check input { margin-top: 3px; flex: none; }
.admin-tabs { margin-bottom: 18px; }
.ag-table td { vertical-align: top; }
.ag-actions { position: relative; }
.ag-actions > summary { list-style: none; cursor: pointer; }
.ag-actions > summary::-webkit-details-marker { display: none; }
.ag-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; min-width: 260px; }
.ag-box form { margin: 0; }
.ag-wrap { overflow: visible; margin-top: 16px; }
@media (max-width: 760px) { .ag-wrap { overflow-x: auto; } .ag-box { right: auto; left: 0; } }

/* ---------- billing ---------- */
.bl-now { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 24px; align-items: start; margin-bottom: 24px; }
.bl-plan { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 4px 0; }
.bl-usage p { margin: 0 0 6px; }
.bl-bar { height: 8px; border-radius: 999px; background: var(--lilac); overflow: hidden; margin-bottom: 6px; }
.bl-bar span { display: block; height: 100%; background: var(--violet); }
.bl-portal { display: grid; gap: 4px; justify-items: end; margin: 0; }
.bl-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.bl-head h2 { font-size: 20px; }
.bl-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 12px; }
.bl-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 10px; align-content: start; }
.bl-card.is-current { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 74, 255, .15); }
.bl-card h3 { font-size: 17px; }
.bl-price { font: 700 30px var(--font-head); margin: 0; }
.bl-price span { font: 500 14px var(--font); color: var(--ink-3); margin-left: 4px; }
.bl-seats { margin: 0; font-size: 14px; }
.bl-incl { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.bl-cur { margin: 0; font-weight: 600; color: var(--violet); text-align: center; padding: 10px; }
.bl-card form { margin: 0; }
.bl-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bl-events li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.plan-bar a { font-weight: 600; margin-left: 6px; }
.pl-table input[type=text], .pl-table input[type=number] { font: 400 14px var(--font); padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; width: 100%; max-width: 160px; }
.pl-table .pl-order { max-width: 70px; }
.pl-new td { background: #FCFBFF; }
.pl-foot { display: flex; align-items: center; gap: 14px; padding: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 900px) { .bl-now { grid-template-columns: 1fr; } .bl-portal { justify-items: start; } }
.pl-online { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.pl-online .card-title { margin-bottom: 4px; }
.ag-request { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: #92400E; background: #FFF6E5; padding: 3px 8px; border-radius: 8px; }
.ag-delete > summary { list-style: none; cursor: pointer; }
.ag-delete > summary::-webkit-details-marker { display: none; }
.ag-delete-box { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #F3C3CA; border-radius: 10px; background: #FFF8F8; white-space: normal; }
.ag-delete-box p { margin: 0; }
.ag-box { max-width: 320px; }
.del-card { max-width: 760px; border-left: 4px solid var(--error); }
.del-list { margin: 12px 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.del-form { margin-top: 16px; max-width: 460px; }

/* ---------- team ---------- */
.tm-table td { vertical-align: top; }
.tm-edit { position: relative; }
.tm-edit > summary { list-style: none; cursor: pointer; }
.tm-edit > summary::-webkit-details-marker { display: none; }
.tm-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); width: 320px; display: grid; gap: 10px; }
.tm-box form { margin: 0; }
.tm-studies { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding: 4px 0; }
.tm-studies .check { align-items: flex-start; }
.tm-pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tm-pending li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm-pending form { margin: 0; }
.tm-roles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.js-studies[hidden] { display: none; }
.card-flush.tm-wrap, .card-flush:has(.tm-table) { overflow: visible; }
@media (max-width: 760px) { .tm-box { right: auto; left: 0; width: min(320px, calc(100vw - 48px)); } }

/* Admin, Requests */
.tab-count { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px; border-radius: 10px; background: var(--violet); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.rq-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 16px 0; }
.rq-search { display: flex; gap: 8px; }
.rq-search input { min-width: 220px; }
.rq-wrap { overflow-x: auto; }
.rq-table td { vertical-align: top; }
.rq-risk { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rq-low { background: var(--ok-bg); color: var(--ok); }
.rq-medium { background: #FFF6E5; color: #92400E; }
.rq-high { background: #FDECEC; color: #B42318; }
.rq-lang { display: inline-block; font-size: 11px; font-weight: 700; color: var(--violet-dark); background: #EEF0FF; padding: 1px 6px; border-radius: 6px; }
.rq-blocked { margin-top: 20px; }
.rq-blocked > summary { cursor: pointer; }
.rq-blocked table { margin-top: 12px; }
.rq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rq-grid .card { margin: 0; }
.rq-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.rq-dl dt { color: var(--ink-2); font-size: 14px; }
.rq-dl dd { margin: 0; overflow-wrap: anywhere; }
.rq-h3 { font-size: 15px; margin: 18px 0 8px; }
.rq-msg { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 0; white-space: normal; }
.rq-reasons { margin: 0 0 14px; padding-left: 20px; }
.rq-reasons li { color: #92400E; margin-bottom: 4px; }
.rq-others { margin: 0 0 12px; padding-left: 20px; }
.rq-actions { margin-top: 20px; }
.rq-act { display: grid; grid-template-columns: 1fr minmax(200px, 280px) auto; gap: 14px; align-items: end; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.rq-act p { margin: 4px 0 0; }
.rq-act .field { margin: 0; }
.rq-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.rq-row form { margin: 0; }
.rq-note { margin-top: 14px; }
.ok-text { color: var(--ok); }
@media (max-width: 860px) { .rq-grid { grid-template-columns: 1fr; } .rq-act { grid-template-columns: 1fr; } .rq-dl { grid-template-columns: 1fr; } .rq-dl dt { margin-top: 6px; } }
.rq-search input { font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.rq-search input:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
/* Admin, agency page and users */
.ad-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.ad-kpi { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ad-kpi span { font-size: 13px; color: var(--ink-2); }
.ad-kpi strong { font-size: 20px; line-height: 1.25; }
.ad-kpi em { font-style: normal; font-size: 12px; color: var(--ink-2); }
.ad-pad { padding: 18px 20px 0; margin: 0; }
p.ad-pad { padding-bottom: 16px; }
.ad-activity { list-style: none; margin: 0; padding: 0; }
.ad-activity li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ad-activity li:last-child { border-bottom: 0; }
.us-table td { vertical-align: top; }
.us-off td { background: #FFF8F8; }
.us-del { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
@media (max-width: 1000px) { .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ad-kpis { grid-template-columns: 1fr; } }
/* Admin, Server */
.sv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.sv-card { margin: 0; border-top: 4px solid var(--line); }
.sv-card h2 { font-size: 15px; margin: 0 0 6px; color: var(--ink-2); font-weight: 600; }
.sv-big { font-size: 30px; font-weight: 700; margin: 0 0 8px; line-height: 1.1; }
.sv-bar { height: 8px; border-radius: 6px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.sv-bar span { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.sv-ok { border-top-color: var(--ok); }
.sv-mid { border-top-color: #F0B65A; } .sv-mid .sv-bar span { background: #F0B65A; }
.sv-high { border-top-color: #D92D20; } .sv-high .sv-bar span { background: #D92D20; } .sv-high .sv-big { color: #B42318; }
.sv-spark { width: 100%; height: 56px; display: block; margin-top: 10px; background: var(--bg); border-radius: 8px; }
.sv-line { fill: none; stroke: var(--violet); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sv-limit { stroke: #D92D20; stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.sv-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin: 4px 0 0; }
.sv-lower { margin-bottom: 20px; }
.sv-form { display: grid; grid-template-columns: 150px 170px minmax(0, 300px) auto; gap: 14px; align-items: end; margin-bottom: 10px; }
.sv-form .field { margin: 0; }
.sv-pct { display: flex; align-items: center; gap: 6px; }
.sv-pct input { width: 90px; }
@media (max-width: 700px) { .sv-form { grid-template-columns: 1fr; } }
.sv-tab-alert { background: #D92D20; }
.sv-bucket { margin-bottom: 20px; }
.sv-bucket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sv-of { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.sv-table { margin-top: 12px; }
.sv-table .num { text-align: right; white-space: nowrap; }
.sv-share { width: 28%; }
.sv-mini { display: block; height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.sv-mini span { display: block; height: 100%; background: var(--violet); }
@media (max-width: 700px) { .sv-share { display: none; } }
.sv-form .btn { justify-self: start; }


/* =====================================================================
   Design system 2: app shell with sidebar, study header, calmer surfaces.
   Panels are flat with hairline borders; only menus and popovers float.
   ===================================================================== */
body { font-size: 15px; line-height: 1.55; font-feature-settings: "tnum" 0; }
.table td, .facts dd, .sbar-tabs b, .kpi-num, .sv-big { font-variant-numeric: tabular-nums; }
h1, h2, h3 { letter-spacing: -.005em; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--white); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* shell */
.app-body { background: var(--bg); }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #CFCDE3; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; overflow-y: auto; }
.sb-logo img { width: 128px; height: auto; margin: 4px 8px 6px; }
.sb-top { display: grid; gap: 14px; }
.sb-org { position: relative; }
.sb-org summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); cursor: pointer; }
.sb-org summary::-webkit-details-marker { display: none; }
.sb-org summary:hover { background: rgba(255, 255, 255, .1); }
.sb-org-mark { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; font: 600 14px var(--font-head); }
.sb-org-text { display: grid; min-width: 0; line-height: 1.25; flex: 1; }
.sb-org-text strong { color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-org-text em { font-style: normal; font-size: 12px; color: #A9A6C4; }
.sb-caret { width: 18px; height: 18px; fill: none; stroke: #A9A6C4; stroke-width: 2; }
.sb-org-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--white); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 8px; display: grid; gap: 2px; }
.sb-org-menu p { font-size: 12px; color: var(--ink-3); padding: 4px 8px 6px; }
.sb-org-menu form { margin: 0; }
.sb-org-menu button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px; border-radius: 8px; font: 500 14px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.sb-org-menu button:hover { background: var(--bg); }
.sb-nav { display: grid; gap: 2px; align-content: start; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #CFCDE3; font-weight: 500; font-size: 14.5px; }
.sb-link svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sb-link.is-active { background: rgba(109, 74, 255, .28); color: #fff; }
.sb-link.is-active svg { opacity: 1; }
.sb-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--violet); color: #fff; font-size: 12px; text-align: center; }
.sb-live { display: grid; gap: 1px; margin: 2px 0 8px 20px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .12); }
.sb-live a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; color: #B9B6D2; min-width: 0; }
.sb-live a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-live a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sb-live a.is-active { color: #fff; background: rgba(255, 255, 255, .1); }
.sb-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sb-user { position: relative; }
.sb-user summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.sb-user summary::-webkit-details-marker { display: none; }
.sb-user summary:hover { background: rgba(255, 255, 255, .07); }
.sb-user-text { display: grid; min-width: 0; line-height: 1.25; }
.sb-user-text strong { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-text em { font-style: normal; font-size: 12px; color: #A9A6C4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 30; background: var(--white); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: grid; }
.sb-user-menu a, .sb-user-menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink); font: 500 14px var(--font); background: none; border: 0; cursor: pointer; }
.sb-user-menu a:hover, .sb-user-menu button:hover { background: var(--bg); text-decoration: none; }
.sb-user-menu form { margin: 0; }
.avatar { width: 32px; height: 32px; flex: none; }
.mobilebar { display: none; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.page { max-width: 1240px; width: 100%; margin: 0; padding: 28px 40px 48px; gap: 22px; }
.appfoot { max-width: 1240px; margin: 0; padding: 0 40px 28px; margin-top: auto; }

/* live and recording marker: the one coral element */
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: none; display: inline-block; box-shadow: 0 0 0 3px rgba(236, 76, 85, .22); }
@media (prefers-reduced-motion: no-preference) {
  .rec-dot { animation: rec 2.4s ease-in-out infinite; }
  @keyframes rec { 0%, 100% { box-shadow: 0 0 0 2px rgba(236, 76, 85, .28); } 50% { box-shadow: 0 0 0 5px rgba(236, 76, 85, 0); } }
}

/* study header */
.studybar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 0; }
.sbar-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sbar-title { min-width: 0; }
.sbar-crumb { font-size: 13px; color: var(--ink-3); }
.sbar-name { font-size: 24px; line-height: 1.2; margin-top: 2px; }
.sbar-name a { color: var(--ink); }
.sbar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; padding: 3px 10px 3px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.state-live { background: #FDEEEF; color: #A6252D; }
.state-draft { background: var(--warn-bg); color: var(--warn); }
.state-paused { background: var(--info-bg); color: var(--violet-ink); }
.sbar-tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.sbar-tabs::-webkit-scrollbar { display: none; }
.sbar-tabs a { position: relative; white-space: nowrap; padding: 10px 12px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.sbar-tabs a:hover { color: var(--ink); text-decoration: none; }
.sbar-tabs a.is-active { color: var(--violet-ink); }
.sbar-tabs a.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2.5px; border-radius: 2px; background: var(--violet); }
.sbar-tabs b { font-weight: 600; font-size: 12px; color: var(--ink-3); margin-left: 3px; }
.sbar-tabs b.is-new { color: #fff; background: var(--coral); border-radius: 9px; padding: 1px 6px; }
.sbar-sep { width: 1px; background: var(--line); margin: 9px 8px 14px; flex: none; }
.in-study .page-head .crumbs, .in-study .ov-head { display: none; }
.in-study .page-head h1 { font-size: 20px; }

/* page heads */
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--ink-2); }
.crumbs { font-size: 13px; }

/* surfaces */
.card { box-shadow: none; border-color: var(--line); border-radius: var(--radius); padding: 22px; }
.card-title { font-size: 16px; margin-bottom: 14px; }
.plan-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }

/* buttons */
.btn { font: 600 14.5px/1 var(--font); padding: 11px 16px; border-radius: 9px; transition: background .12s, border-color .12s, color .12s; }
.btn-small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-primary { background: var(--violet); }
.btn-primary:hover { background: var(--violet-dark); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: #C9C3EE; color: var(--violet-ink); background: #FBFAFF; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .linklike:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* forms */
.field span { font-size: 13.5px; font-weight: 500; }
.field input, .field textarea, .field select, .inline-form input[type=text] { border-color: #D9D6E4; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #C3BFD4; }

/* tables: sentence-case headers, quieter rules */
.table th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--ink-3); background: #FAFAFC; padding: 11px 16px; }
.table td { padding: 13px 16px; border-bottom-color: var(--line-2); }
.table tbody tr:hover { background: #FBFAFE; }

/* status pills */
.status { font: 600 12px/1 var(--font); padding: 4px 9px; border: 0; }
.status-live { background: var(--ok-bg); color: var(--ok); }
.status-draft { background: var(--warn-bg); color: var(--warn); }
.status-paused { background: var(--info-bg); color: var(--violet-ink); }

/* alerts */
.alert { border: 1px solid transparent; }
.alert-success { border-color: #C7E8D6; }
.alert-error { border-color: #F3CDD0; }

/* small screens: the sidebar becomes a panel under a top bar */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; background: var(--white); border-bottom: 1px solid var(--line); }
  .mb-logo img { width: 112px; height: auto; }
  .mb-toggle { font: 600 14px var(--font); padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); cursor: pointer; }
  .sidebar { display: none; position: fixed; inset: 58px 0 0 0; height: auto; z-index: 39; }
  .sidebar.is-open { display: flex; }
  .sb-logo { display: none; }
  .page { padding: 20px 16px 40px; }
  .appfoot { padding: 0 16px 24px; }
}
@media (max-width: 600px) {
  .studybar { padding: 14px 14px 0; }
  .sbar-name { font-size: 20px; }
}

/* design system 2: page-level refinements */
.card:has(> .table:only-child), .card:has(> .table-wrap:only-child) { padding: 0; overflow: hidden; }
.card > .table:only-child th:first-child, .card > .table:only-child td:first-child { padding-left: 22px; }
.card-flush > .table th:first-child, .card-flush > .table td:first-child { padding-left: 22px; }
.day-title { text-transform: none; letter-spacing: 0; font-size: 14px; }
.day-title span { border: 0; background: none; padding: 0; color: var(--ink); font: 600 15px var(--font-head); }
.checklist { gap: 0; }
.checklist li { border: 0; border-radius: 0; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.checklist li.done { background: none; }
.checklist li.done::before { background: var(--ok); border-color: var(--ok); }
.checklist li.started { background: none; }
.status-card { border-left-width: 3px; margin-bottom: 0; }
.status-card-live { border-left-color: var(--coral); }
.set-tabs, .admin-tabs { gap: 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.set-tabs a, .admin-tabs a { border: 0; background: none; border-radius: 0; padding: 10px 14px 12px; position: relative; white-space: nowrap; color: var(--ink-2); }
.set-tabs a:hover, .admin-tabs a:hover { color: var(--ink); }
.set-tabs a.is-active, .admin-tabs a.is-active { background: none; color: var(--violet-ink); }
.set-tabs a.is-active::after, .admin-tabs a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--violet); }
.fd-filters { border-radius: var(--radius); padding: 14px 16px; gap: 12px; }
.fd-filters label { flex: 1 1 130px; font-weight: 500; font-size: 12.5px; }
.fd-filters select, .fd-filters input { width: 100%; max-width: none; border-color: #D9D6E4; }
.fd-filter-actions { flex: 0 0 auto; }
.pill { font-weight: 500; }

/* home */
.home-head p { margin-top: 4px; }
.home-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.home-sum > div { padding: 16px 22px; display: grid; gap: 2px; border-left: 1px solid var(--line-2); }
.home-sum > div:first-child { border-left: 0; }
.kpi-num { font: 600 26px/1.1 var(--font-head); color: var(--ink); }
.kpi-num.is-new { color: var(--coral); }
.home-sum span { font-size: 13.5px; color: var(--ink-2); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-sec-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 22px 12px; border-bottom: 1px solid var(--line-2); }
.home-sec-head h2 { font-size: 16px; }
.home-pad { padding: 16px 22px; }
.home-list { list-style: none; }
.home-list li { border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.home-list li:last-child { border-bottom: 0; }
.home-study, .home-resp { flex: 1; min-width: 0; display: grid; gap: 6px; padding: 14px 22px; color: var(--ink); }
.home-study:hover, .home-resp:hover { background: #FBFAFE; text-decoration: none; }
.home-study-name { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.home-study-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.home-unread { flex: none; margin-right: 22px; font-size: 12.5px; font-weight: 600; color: #A6252D; background: #FDEEEF; padding: 4px 10px; border-radius: 999px; }
.home-resp { gap: 2px; }
.home-resp-top { display: flex; gap: 8px; align-items: center; }
.home-resp-top .muted { margin-left: auto; }
.home-resp-task { font-size: 14px; }
.home-start { display: grid; gap: 14px; padding: 28px; }
.home-start h2 { font-size: 22px; }
.home-steps { list-style: none; counter-reset: hs; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 6px 0 4px; }
.home-steps li { counter-increment: hs; display: grid; gap: 4px; padding-top: 40px; position: relative; font-size: 14px; color: var(--ink-2); }
.home-steps li::before { content: counter(hs); position: absolute; top: 0; left: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--lilac); color: var(--violet-ink); display: grid; place-items: center; font-weight: 600; }
.home-steps strong { color: var(--ink); }
.home-start .btn { justify-self: start; }
.home-account { display: grid; gap: 6px; padding: 16px 22px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .home-sum { grid-template-columns: 1fr 1fr; } .home-sum > div:nth-child(3) { border-left: 0; } .home-sum > div:nth-child(n+3) { border-top: 1px solid var(--line-2); } .home-steps { grid-template-columns: 1fr 1fr; } }
.card.card-flush { padding: 0; }
.checklist li, .checklist li.done, .checklist li.started { border-color: var(--line-2); }

.preview-label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }

/* =====================================================================
   Participant app, design system 2: calm white cards on a soft canvas,
   coral only for recording, real icons in the bottom bar.
   ===================================================================== */
.pp-body { background: #F6F5FB; }
.pp { gap: 14px; }
.pp-top { background: rgba(255, 255, 255, .94); border-bottom-color: var(--line-2); }
.pp-top-study { font: 600 15px var(--font); color: var(--ink); }
.pp-card, .pp-q, .pp-task-link { box-shadow: none; border: 1px solid var(--line-2); }
.pp-card { border-radius: 18px; }
.pp-q { border-radius: 18px; padding: 18px; }
.pp-hello h1 { font-size: 28px; }
.pp-day { justify-self: start; text-transform: none; letter-spacing: 0; font: 600 13px var(--font); color: var(--violet-ink) !important; background: var(--lilac); padding: 4px 11px; border-radius: 999px; }
.pp-h2 { font: 600 14px var(--font); color: var(--ink-2); margin: 10px 4px 0; }
.pp-qnum { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--violet-ink); margin-bottom: -4px; }
.pp-task-link { border-radius: 16px; padding: 16px; }
.pp-task.is-todo .pp-task-link { border-color: #D9D2FF; }
.pp-task.is-missed .pp-task-link, .pp-tasks-quiet .pp-task-link { background: transparent; border-style: dashed; }
.pp-task-main strong { font-weight: 600; }
.pp-btn { border-radius: 14px; font-weight: 600; }
.pp-option, .pp-tick { border-radius: 14px; }
.pp-scale span { border-radius: 12px; }
.pp-back { font-weight: 500; }

/* recording: the coral button, with drawn icons */
.pp-btn-rec { background: var(--coral); color: #fff; min-height: 56px; font-size: 17px; }
.pp-btn-rec:hover { background: #D63E47; }
.pp-btn-rec.pp-btn-ghost, .pp-btn-ghost.pp-btn-rec { background: #fff; color: var(--ink); }
.pp-cam, .pp-mic { border: 0; border-radius: 0; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.pp-cam { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 10.5 21 7v10l-5.5-3.5'/%3E%3Crect x='2.5' y='6' width='13' height='12' rx='2.5'/%3E%3C/svg%3E"); }
.pp-mic { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/%3E%3C/svg%3E"); }
.pp-recording { background: #FFF1F2; border: 1px solid #F8CED1; }

/* bottom bar icons */
.pp-nav { border-top-color: var(--line-2); background: #fff; }
.pp-nav a { font-weight: 500; }
.pp-nav a.is-active { color: var(--violet-ink); font-weight: 600; }
.pp-ico { border: 0; border-radius: 0; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.pp-ico-today { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3Ccircle cx='12' cy='15' r='1.6' fill='black'/%3E%3C/svg%3E"); }
.pp-ico-msg { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 14.5a2.5 2.5 0 0 1-2.5 2.5H8.5l-5 4V6a2.5 2.5 0 0 1 2.5-2.5h12A2.5 2.5 0 0 1 20.5 6z'/%3E%3C/svg%3E"); }
.pp-ico-help { border-radius: 0; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.6 9.3a2.5 2.5 0 0 1 4.8.9c0 1.7-2.4 2.2-2.4 3.8M12 17h.01'/%3E%3C/svg%3E"); }
.pp-nav-badge { background: var(--coral); }
.danger-zone { border-color: #F3CDD0; }
.danger-zone .card-title { color: var(--error); }
.danger-form { margin-top: 12px; gap: 12px; }
.home-2fa { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0; }
/* AI transcripts in the feed */
.tr { flex-basis: 100%; width: 100%; max-width: 640px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tr-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tr-switch button { border: 0; background: #fff; font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.tr-switch button[aria-pressed=true] { background: var(--violet); color: #fff; }
.tr-lines { list-style: none; margin: 0; padding: 6px 4px; max-height: 240px; overflow-y: auto; font-size: 14px; line-height: 1.45; }
.tr-lines li { display: grid; grid-template-columns: 52px 1fr; gap: 6px; padding: 3px 8px; border-radius: 6px; }
.tr-lines li:hover { background: var(--bg); }
.tr-time { border: 0; background: none; padding: 0; font: 600 12px/1.9 "IBM Plex Sans", sans-serif; color: var(--violet); cursor: pointer; text-align: left; font-variant-numeric: tabular-nums; }
.tr-time:hover { text-decoration: underline; }
.tr-note { margin: 0; padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.tr-retry { display: inline; }
.tr-again { border: 0; background: none; padding: 0; font: inherit; color: var(--violet); text-decoration: underline; cursor: pointer; }
