@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* ------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------ */
:root {
  --bg: #f4f3ef;
  --paper: #ffffff;
  --ink: #1b1a1f;
  --ink-2: #4a4953;
  --muted: #74737d;
  --faint: #a09fa8;
  --line: #e5e3dd;
  --line-strong: #d3d1ca;
  --accent: #1f5f52;
  --accent-ink: #164a40;
  --accent-soft: #e7efeb;
  --accent-tint: #f3f7f5;
  --danger: #b3261e;
  --danger-soft: #fbecea;
  --warn: #8a5a00;
  --warn-soft: #fbf1d9;
  --success: #1f7a4d;
  --success-soft: #e4f3ea;
  /* Per-assessment colour. Public pages override this inline; the app UI
     only uses it for assessment-specific marks. */
  --brand: var(--accent);
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --control-h: 42px;
  --shadow-pop: 0 12px 32px rgba(27, 26, 31, .12), 0 1px 2px rgba(27, 26, 31, .08);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.65; background: var(--bg); font-feature-settings: "tnum" 1; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.3; letter-spacing: -.02em; font-weight: 700; word-break: keep-all; }
h2 { font-size: 20px; line-height: 1.4; letter-spacing: -.015em; font-weight: 700; word-break: keep-all; }
h3 { font-size: 16px; line-height: 1.45; font-weight: 600; word-break: keep-all; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection { background: var(--accent-soft); }

/* ------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------ */
.topbar { height: 64px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 18px; letter-spacing: -.02em; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.brand-mark { background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav .text-link { color: var(--ink-2); font-weight: 500; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-s); }
.topbar nav .text-link:hover { background: var(--bg); color: var(--ink); }
.topbar nav .button { margin-left: 8px; }
.workspace-name { font-size: 13px; color: var(--ink-2); }
.topbar form, .toolbar-actions form { margin: 0; }

/* ------------------------------------------------------------------
   Buttons & links
   ------------------------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-s);
  font-weight: 600; font-size: 13px; line-height: 1; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: #000; }
.button-secondary { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.button-secondary:hover { border-color: var(--ink); }
.button-ghost { background: transparent; color: var(--ink-2); }
.button-ghost:hover { background: var(--bg); color: var(--ink); }
.button-danger { background: var(--paper); border-color: var(--line-strong); color: var(--danger); }
.button-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.button-small { height: 32px; padding: 0 12px; font-size: 12px; }
.button-large { height: 48px; padding: 0 22px; font-size: 14px; }
.button-block { width: 100%; }
.button[aria-current="page"] { pointer-events: none; }
.text-link { color: var(--accent); font-weight: 600; font-size: 13px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link { display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.back-link:hover { color: var(--ink); }
.text-button { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------
   Text helpers
   ------------------------------------------------------------------ */
.eyebrow, .card-kicker { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.optional { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.field-help { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; margin: 8px 0 0; }
.flash { margin: 16px auto 0; padding: 12px 16px; max-width: 1120px; border-radius: var(--radius-s); font-size: 13px; border: 1px solid transparent; }
.flash-notice { background: var(--accent-soft); color: var(--accent-ink); border-color: #d3e2db; }
.flash-alert { background: var(--danger-soft); color: var(--danger); border-color: #f1d3d0; }
.flash a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------
   App shell & headings
   ------------------------------------------------------------------ */
.app-shell { max-width: 1200px; margin: auto; padding: 40px 32px 80px; }
.narrow { max-width: 960px; }
.page-heading { margin-bottom: 28px; }
.page-heading p { color: var(--muted); margin-top: 10px; max-width: 640px; line-height: 1.75; }
.page-heading.centered { text-align: center; max-width: 620px; margin-left: auto; margin-right: auto; }
.page-heading.centered p { margin-top: 14px; margin-left: auto; margin-right: auto; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.heading-row > .button { flex-shrink: 0; margin-bottom: 4px; }
.centered { text-align: center; }

/* Metrics */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.metric-grid.four { grid-template-columns: repeat(4, 1fr); }
.metric-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; min-width: 0; }
.metric-card > span { font-size: 13px; color: var(--muted); }
.metric-card > strong { font-size: 34px; line-height: 1.3; letter-spacing: -.02em; font-weight: 700; margin: 6px 0 4px; }
.metric-card > small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.metric-card > small a { color: var(--accent); font-weight: 600; }
.metric-card.accent { background: var(--accent-tint); border-color: #cfe0d8; }
.metric-card.accent strong { color: var(--accent); }

/* Panels & lists */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 17px; }
.panel-heading p, .panel-heading > .muted { font-size: 13px; color: var(--muted); margin-top: 4px; }
.list-tabs, .toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.list-tabs { flex-shrink: 0; }
.assessment-row { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.assessment-row + .assessment-row { border-top: 1px solid var(--line); }
.assessment-icon { display: grid; place-items: center; border-radius: var(--radius-s); background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); width: 42px; height: 42px; flex-shrink: 0; font-weight: 700; font-size: 17px; }
.assessment-main { flex: 1; min-width: 0; }
.title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assessment-main h3 { font-size: 15px; }
.assessment-main h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.assessment-main p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; margin-top: 3px; }
.status, .grade { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 2px 7px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.status-draft { background: #eeede8; color: var(--ink-2); }
.status-published, .status-active { background: var(--success-soft); color: var(--success); }
.status-archived, .status-past_due, .status-canceled, .status-expired, .status-member { background: #eeede8; color: var(--muted); }
.status-generating, .status-owner { background: var(--accent-soft); color: var(--accent-ink); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-limited, .status-pending { background: var(--warn-soft); color: var(--warn); }
.status-limited a { text-decoration: underline; }
.grade-hot { color: #a94520; background: #fbebe3; }
.grade-warm { color: #7f6414; background: #faf2d6; }
.grade-cold { color: #4d6c85; background: #e8eff5; }
.row-stat { min-width: 56px; text-align: center; display: flex; flex-direction: column; }
.row-stat strong { font-size: 17px; font-weight: 700; }
.row-stat span { font-size: 11px; color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.empty-state { text-align: center; padding: 64px 30px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--muted); margin: 10px 0 22px; line-height: 1.8; }
.empty-orbit { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--accent); font-size: 20px; background: var(--accent-soft); margin: 0 auto 18px; }
.priority-help { margin: 0 24px 20px; padding: 12px 16px; background: var(--bg); border-radius: var(--radius-s); font-size: 12px; color: var(--ink-2); }
.priority-help summary { cursor: pointer; font-weight: 600; }
.priority-help p { margin-top: 8px; line-height: 1.8; color: var(--muted); }

/* ------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------ */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]):not([type=hidden]),
textarea, select {
  display: block; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--paper); padding: 0 12px; margin: 0; color: var(--ink); font-size: 14px; font-weight: 400;
  height: var(--control-h); line-height: calc(var(--control-h) - 2px);
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 96px; line-height: 1.7; padding: 10px 12px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%234a4953' stroke-width='1.5' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]):hover, textarea:hover, select:hover { border-color: #b9b7af; }
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]):focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=date] { padding-right: 8px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
/* Spacing between a label's text and its control lives only on direct children,
   so bare inputs (question text, choices, table cells) line up without extra offset. */
label > input, label > textarea, label > select, label > .color-field, label > .range-inputs { margin-top: 6px; }
.color-field { display: flex; align-items: center; gap: 10px; height: var(--control-h); border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--paper); padding: 0 12px 0 6px; }
.color-field input[type=color] { width: 44px; height: 30px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: 4px; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .12); border-radius: 4px; }
.color-field span { font-size: 12px; color: var(--muted); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 16px 20px; margin-bottom: 16px; align-items: start; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-section { display: flex; gap: 22px; padding: 30px 32px; border-bottom: 1px solid var(--line); }
.section-number { color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-s); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.section-body { flex: 1; min-width: 0; }
.section-body h2 { font-size: 17px; margin-bottom: 4px; }
.section-body > p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.section-body > label { margin-top: 16px; }
.section-body > label:first-of-type { margin-top: 0; }
.section-body .form-grid + label { margin-top: 0; }
.generator-form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.generator-submit { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; background: var(--bg); gap: 20px; }
.generator-submit strong { font-size: 13px; display: block; }
.generator-submit span { font-size: 12px; color: var(--muted); line-height: 1.7; }
.spark { display: none; }

/* ------------------------------------------------------------------
   Auth
   ------------------------------------------------------------------ */
.auth-shell { max-width: 1040px; margin: 72px auto; display: grid; grid-template-columns: 1fr 400px; gap: 80px; align-items: center; padding: 0 32px; }
.auth-copy h1 { font-size: 38px; line-height: 1.32; }
.auth-copy h1 em { font-style: normal; color: var(--accent); }
.auth-copy > p { margin-top: 20px; line-height: 1.85; color: var(--muted); max-width: 440px; }
.auth-card { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-l); padding: 34px; }
.auth-card h2 { font-size: 22px; margin-bottom: 22px; }
.auth-card > .muted { margin: -14px 0 20px; font-size: 13px; line-height: 1.75; }
.auth-card .button + .button { margin-top: 10px; }
.auth-link { text-align: center; font-size: 12px; margin-top: 22px; color: var(--muted); line-height: 1.8; }
.auth-link a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.demo-hint { text-align: center; font-size: 12px; background: var(--bg); border-radius: var(--radius-s); padding: 10px; margin-top: 16px; color: var(--muted); }
.demo-hint a { color: var(--accent); font-weight: 600; }
.mini-report { display: none; }
.single { display: flex; justify-content: center; margin-top: 40px; }
.wide { width: 480px; }

/* ------------------------------------------------------------------
   Editor
   ------------------------------------------------------------------ */
.editor-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1360px; margin: auto; }
.editor-aside { padding: 28px 24px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.editor-title h1 { font-size: 18px; margin: 12px 0 10px; line-height: 1.4; }
.editor-title p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.editor-nav { display: flex; flex-direction: column; gap: 2px; margin: 26px 0; }
.editor-nav a { padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink-2); font-size: 13px; }
.editor-nav a:hover { background: #ebeae4; color: var(--ink); }
.aside-actions { display: flex; flex-direction: column; gap: 8px; }
.editor-content { min-width: 0; padding: 24px 36px 40px; }
.editor-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ai-panel { margin-bottom: 20px; }
.channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.hub-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none; }
.hub-card:hover { border-color: var(--accent); }
.hub-card.is-linked { border-color: var(--accent); }
.hub-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hub-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; flex: 1; }
.hub-card .hub-link { font-size: 13px; font-weight: 600; color: var(--accent); }
.hub-card-muted { background: transparent; }
.integrations .manual-alt { margin-top: 14px; }
.integrations .manual-alt summary { cursor: pointer; font-size: 13px; }
.integrations .channel-card { margin-top: 18px; }
@media (max-width: 960px) { .hub-grid { grid-template-columns: 1fr; } }
.channel-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.channel-card.is-linked { border-color: var(--accent); }
.channel-card header { display: flex; justify-content: space-between; align-items: center; }
.channel-card .muted, .channel-card .field-help { font-size: 12px; line-height: 1.6; }
.channel-target { word-break: break-all; }
.channel-events { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 6px 0; }
.channel-actions { margin-top: 4px; }
.link-code code { display: inline-block; font-size: 16px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); }
.channel-error { font-size: 12px; margin: 0; }
.discord-commands { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.channel-card details summary { cursor: pointer; font-size: 12px; }
@media (max-width: 960px) { .channel-grid { grid-template-columns: 1fr; } }
.report-mail-card { text-align: center; }
.report-mail-card h2 { font-size: 20px; margin: 6px 0 10px; }
.report-mail-card p { max-width: 560px; margin: 0 auto 6px; }
.status-new { background: var(--accent); color: #fff; letter-spacing: .04em; font-size: 10px; }
.assessment-row.is-highlighted { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.preview-banner { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 10px 16px; text-align: center; }
.preview-banner a { color: inherit; text-decoration: underline; margin-left: 6px; }
.sticky-save .toolbar-actions { flex-wrap: nowrap; }
.editor-subhead { font-size: 14px; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.contact-field-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.contact-field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); margin: 0; font-weight: 600; font-size: 13px; }
.contact-field-row select { width: auto; min-width: 76px; }
.consent-edit-list { display: flex; flex-direction: column; gap: 8px; }
.consent-edit-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.consent-edit-row .consent-note { grid-column: 2 / 4; font-size: 11px; color: var(--muted); margin-top: -4px; }
.consent-fixed { display: inline-flex; justify-content: center; align-items: center; height: 38px; border-radius: var(--radius-s); background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.consent-readonly { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 720px) { .contact-field-list { grid-template-columns: 1fr; } .consent-edit-row { grid-template-columns: 1fr; } .consent-edit-row .consent-note { grid-column: auto; } }
.toggle-row { margin: 18px 0 6px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); }
.toggle-row .checkbox-label { font-weight: 600; font-size: 14px; }
.toggle-row .field-help { margin-top: 6px; }
.followup-row label { margin-top: 10px; }
.followup-row textarea { width: 100%; }
.ai-panel h2 { font-size: 17px; }
.ai-form textarea { width: 100%; }
.ai-form-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
.ai-status { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ai-instruction, .ai-summary { color: var(--muted); font-size: 13px; margin-top: 8px; }
.ai-summary { color: var(--ink); background: var(--accent-soft); border-radius: var(--radius-s); padding: 10px 12px; }
.ai-changes { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ai-changes > li > strong { display: block; font-size: 13px; margin-bottom: 6px; }
.ai-change-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.ai-change-columns > div { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; line-height: 1.6; }
.ai-change-columns > div > span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ai-after { background: var(--accent-soft); border-color: transparent; }
.ai-change-columns div p { margin: 0 0 4px; }
.quota-note { text-align: center; font-size: 13px; margin: -8px 0 20px; }
@media (max-width: 720px) { .ai-change-columns { grid-template-columns: 1fr; } }
.editor-fieldset:disabled { opacity: 0.85; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.editor-card { padding: 28px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 20px; scroll-margin-top: 20px; }
.editor-card h2 { margin-bottom: 6px; }
.editor-card > .muted { margin-bottom: 24px; font-size: 13px; line-height: 1.75; max-width: 720px; }
.editor-card > label { margin-bottom: 16px; }
.editor-card > .stack > .muted { font-size: 13px; line-height: 1.75; }
.editor-card + .editor-card { margin-top: 0; }
.dimension-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dimension-editor { padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.dimension-index { font-size: 12px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.dimension-editor label { margin-top: 12px; }
.dimension-editor-head { display: flex; justify-content: space-between; align-items: center; }
.dimension-editor-head .icon-button { height: 26px; padding: 0 8px; font-size: 11px; }
.dimension-editor summary { font-size: 12px; color: var(--accent); cursor: pointer; margin-top: 14px; font-weight: 600; }

/* Question builder */
.question-edit-list { display: flex; flex-direction: column; gap: 14px; }
.question-editor { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; background: var(--paper); transition: box-shadow .15s, opacity .15s; }
.question-editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.question-number { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 28px; }
.question-editor .drag-handle { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--muted); cursor: grab; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; touch-action: none; padding: 0; }
.question-editor .drag-handle:hover { color: var(--ink); border-color: var(--line-strong); }
.question-editor .drag-handle:active { cursor: grabbing; }
.question-editor.is-dragging { opacity: .45; box-shadow: var(--shadow-pop); }
.question-editor.drop-before { box-shadow: 0 -2px 0 0 var(--accent); }
.question-editor.drop-after { box-shadow: 0 2px 0 0 var(--accent); }
.question-type-select { width: auto; height: 30px; line-height: 28px; padding: 0 30px 0 10px; margin: 0; font-size: 12px; font-weight: 600; background-position: right 10px center; }
.question-editor[data-type=text] .question-type-select { color: var(--warn); border-color: #e6d7b6; background-color: #fdf8ec; }
.question-order-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-button { height: 30px; min-width: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.icon-button:disabled { opacity: .35; cursor: default; }
.icon-button.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.question-editor .question-text-input { font-size: 15px; font-weight: 600; margin-bottom: 14px; height: 46px; line-height: 44px; }
.choice-edit-list { --score-col: 64px; overflow-x: auto; }
.choice-grid-head, .choice-editor {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--score-cols, 3), var(--score-col)) 72px 32px;
  gap: 8px; align-items: center;
  /* With many dimensions the row scrolls sideways instead of squeezing the choice text. */
  min-width: calc(240px + var(--score-cols, 3) * (var(--score-col) + 8px) + 120px);
}
.choice-grid-head { font-size: 11px; color: var(--muted); font-weight: 500; padding: 0 0 6px; }
.choice-grid-head span { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-grid-head span:first-child { text-align: left; padding-left: 2px; }
.choice-grid-head .lead { color: var(--warn); }
.choice-editor + .choice-editor { margin-top: 8px; }
.choice-editor .score-input { text-align: center; padding: 0 6px; -moz-appearance: textfield; }
.choice-editor .score-input::-webkit-inner-spin-button { opacity: 0; }
.choice-editor .score-input:hover::-webkit-inner-spin-button, .choice-editor .score-input:focus::-webkit-inner-spin-button { opacity: 1; }
.choice-editor .score-input.lead { border-color: #e6d7b6; background: #fffcf4; }
.choice-editor .choice-remove { width: 30px; padding: 0; font-size: 16px; line-height: 1; }
.choice-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.choice-actions .muted { font-size: 12px; }
.text-question-note { margin-top: 2px; padding: 12px 14px; border-radius: var(--radius-s); background: #fdf8ec; border: 1px dashed #e6d7b6; color: var(--warn); font-size: 12px; line-height: 1.7; }
.question-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line-strong); }
.question-add-row .muted { margin-left: auto; font-size: 12px; }

/* Result bands */
.band-editor { padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px 16px; align-items: start; }
.band-editor .span-all { grid-column: 1 / -1; }
.band-editor textarea { min-height: 72px; }
.range-inputs { display: flex; align-items: center; gap: 8px; }
.range-inputs span { color: var(--muted); font-size: 13px; }
.sticky-save { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); padding: 12px 12px 12px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 5; }
.sticky-save span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------
   Responses table & filters
   ------------------------------------------------------------------ */
.filter-bar { display: flex; align-items: flex-end; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-bar label { flex: 1; min-width: 130px; }
.filter-bar select { min-width: 120px; }
.filter-bar input[type=submit] { flex-shrink: 0; height: var(--control-h); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { padding: 10px 20px; font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--paper); }
td { padding: 16px 20px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 400; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; vertical-align: top; }
.data-table th { border-bottom: 1px solid var(--line); border-top: 0; }
.data-table td { border-top: 1px solid var(--line); white-space: normal; }
.data-table tbody tr:first-child td { border-top: 0; }

/* ------------------------------------------------------------------
   Public survey
   ------------------------------------------------------------------ */
.public-page { background: #faf9f6; }
.public-page .button-primary { background: var(--brand); color: #fff; }
.public-page .button-primary:hover { filter: brightness(.94); background: var(--brand); }
.survey-shell, .report-shell { max-width: 800px; margin: 0 auto; padding: 28px 32px 48px; }
.survey-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.survey-brand .subtle { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.survey-brand .brand-mark { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; background: var(--brand); }
.survey-intro { padding: 64px 0 24px; text-align: center; }
.pill { display: inline-block; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, white); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; }
.survey-intro h1 { font-size: 36px; max-width: 640px; margin: auto; line-height: 1.38; }
.intro-description { font-size: 15px; color: var(--ink-2); max-width: 540px; line-height: 1.85; margin: 22px auto; word-break: keep-all; }
.survey-benefits { display: grid; grid-template-columns: repeat(3, 1fr); margin: 34px 0; gap: 12px; text-align: left; }
.survey-benefits > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.survey-benefits .dimension-index { color: var(--brand); }
.survey-benefits strong { display: block; margin: 8px 0 6px; font-size: 14px; }
.survey-benefits p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.survey-footnote { font-size: 12px; text-align: center; line-height: 1.85; color: var(--muted); margin: 22px auto; max-width: 620px; }
.powered-by { text-align: center; font-size: 12px; color: var(--faint); margin-top: 40px; }
.powered-by strong { font-size: 12px; color: var(--muted); margin-left: 3px; }
.survey-progress { margin: 36px 0 44px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.survey-progress > div { height: 4px; background: #e9e7e1; border-radius: 6px; margin-top: 10px; overflow: hidden; }
.survey-progress i { display: block; background: var(--brand); height: 100%; transition: width .2s; }
.survey-question { border: 0; padding: 0; margin: 0; min-height: 340px; }
.survey-question legend { font-size: 25px; font-weight: 700; line-height: 1.45; letter-spacing: -.015em; word-break: keep-all; width: 100%; margin-bottom: 24px; float: left; }
.survey-question .eyebrow { clear: both; color: var(--brand); }
.survey-choices { clear: both; display: flex; flex-direction: column; gap: 10px; }
.survey-choice { position: relative; border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--radius); display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; font-weight: 400; font-size: 15px; line-height: 1.5; transition: border-color .12s, background .12s; }
.survey-choice:hover { border-color: var(--ink); }
.survey-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.survey-choice:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, white); box-shadow: inset 0 0 0 1px var(--brand); }
.survey-choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-letter { border: 1px solid var(--line-strong); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.survey-choice:has(input:checked) .choice-letter { background: var(--brand); border-color: var(--brand); color: #fff; }
.choice-check { margin-left: auto; opacity: 0; color: var(--brand); font-weight: 700; }
.survey-choice:has(input:checked) .choice-check { opacity: 1; }
.survey-text-answer { clear: both; }
.survey-text-answer textarea { font-size: 15px; min-height: 150px; padding: 14px 16px; border-radius: var(--radius); }
.survey-text-answer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, white); }
.survey-text-hint { display: block; margin-top: 8px; font-size: 12px; color: var(--faint); text-align: right; }
.survey-navigation { display: flex; justify-content: space-between; margin: 28px 0; }
.validation-message { color: var(--danger); font-size: 13px; margin-top: 16px; min-height: 1em; }
.lead-step h2 { font-size: 26px; margin-bottom: 10px; }
.lead-step > p { color: var(--muted); margin-bottom: 26px; line-height: 1.8; }
.consent-box { border-top: 1px solid var(--line); padding-top: 18px; }
.consent-box > p { font-size: 12px; color: var(--muted); line-height: 1.8; margin-bottom: 14px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.7; margin: 10px 0; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.checkbox-label input { margin-top: 3px; flex-shrink: 0; }

/* ------------------------------------------------------------------
   Report
   ------------------------------------------------------------------ */
.report-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 16px; }
.report-card .eyebrow, .report-card .card-kicker { color: var(--brand); }
.report-card h2 { font-size: 19px; margin-bottom: 18px; }

/* Operator report (reports/show) */
.report-page { background: #f6f8fb; }
.rp { --rp-ink: #0f1f3d; --rp-muted: #5b6477; --rp-line: #e3e8f0; --rp-best: #16a37a; --rp-weak: #e5484d; --rp-teal: #14b8a6;
  max-width: 1040px; margin: 0 auto; padding: 28px 24px 40px; color: var(--rp-ink); word-break: keep-all; }
.rp svg { display: block; }
.rp-top { position: relative; padding: 4px 4px 26px; }
.rp-org span { display: block; font-size: 14px; letter-spacing: 0; color: var(--rp-ink); margin-bottom: 2px; }
.rp-quote cite { display: block; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rp-line); width: fit-content; font-style: normal; font-size: 12px; letter-spacing: .08em; }
.rp-org { font-size: 13px; letter-spacing: .04em; color: var(--rp-muted); padding-left: 10px; border-left: 2px solid var(--rp-ink); }
.rp-deco { position: absolute; right: 8px; top: 0; width: 160px; fill: color-mix(in srgb, var(--brand) 22%, white); stroke: color-mix(in srgb, var(--brand) 45%, white); }
.rp-top h1 { margin: 34px 0 10px; font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.rp-top h1 strong { font-size: 54px; font-weight: 800; }
.rp-top p { color: var(--rp-muted); font-size: 17px; margin: 0; }
.rp-card { background: #fff; border: 1px solid var(--rp-line); border-radius: 14px; padding: 26px 28px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(15,31,61,.04); }
.rp-chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 6px; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, white); }
.rp-chip.is-solid { color: #fff; background: var(--brand); border-radius: 999px; }
.rp-head-icon { display: inline-flex; width: 26px; height: 26px; color: var(--brand); vertical-align: -5px; margin-right: 10px; }
.rp-head-icon svg { width: 100%; height: 100%; }
.rp-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rp-line); margin-bottom: 8px; }
.rp-section-head h2 { font-size: 24px; margin: 0; }
.rp-section-head > p { margin: 6px 0 0; font-size: 13px; color: var(--rp-muted); padding-left: 12px; border-left: 1px solid var(--rp-line); line-height: 1.6; }
.rp-sub { margin: 6px 0 0; color: var(--rp-muted); font-size: 14px; }

.rp-hero { display: grid; grid-template-columns: 200px 1fr 220px; gap: 32px; align-items: center; }
.rp-ring { position: relative; width: 200px; height: 200px; }
.rp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rp-ring circle { fill: none; stroke-width: 12; }
.rp-ring-track { stroke: #e2e6ee; }
.rp-ring-value { stroke: url(#rp-ring-grad); stroke-linecap: round; }
.rp-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rp-ring strong { font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rp-ring small { font-size: 24px; font-weight: 700; margin-left: 2px; }
.rp-ring span { font-size: 24px; color: var(--rp-muted); margin-top: 8px; }
.rp-hero-body h2 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; margin: 14px 0 12px; line-height: 1.3; }
.rp-hero-body p { margin: 0; color: var(--rp-ink); font-size: 16px; line-height: 1.75; }
.rp-quote { margin: 0; padding: 4px 0 4px 24px; border-left: 1px solid var(--rp-line); color: var(--rp-muted); font-size: 16px; line-height: 1.85; }
.rp-quote::before { content: "\201C"; display: block; font-size: 44px; line-height: .8; color: color-mix(in srgb, var(--brand) 45%, white); font-weight: 800; }

.rp-row { display: grid; grid-template-columns: 44px minmax(120px, 190px) 1fr 100px 140px; gap: 16px; align-items: center; padding: 10px 12px; margin: 4px -12px; border-radius: 10px; border: 1px solid transparent; }
.rp-row-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, white); color: var(--brand); }
.rp-row-icon svg { width: 22px; height: 22px; }
.rp-row-name { font-size: 16px; }
.rp-track { height: 16px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.rp-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.rp-row-score { font-size: 15px; color: var(--rp-muted); white-space: nowrap; }
.rp-row-score b { font-size: 30px; color: var(--rp-ink); margin-right: 2px; font-variant-numeric: tabular-nums; }
.rp-row-badge em { display: inline-flex; align-items: center; gap: 6px; font-style: normal; font-size: 13px; font-weight: 600; color: #fff; padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.rp-row-badge svg { width: 15px; height: 15px; }
.rp-row.is-best { background: color-mix(in srgb, var(--rp-best) 7%, white); border-color: color-mix(in srgb, var(--rp-best) 18%, white); }
.rp-row.is-best .rp-row-icon { background: color-mix(in srgb, var(--rp-best) 14%, white); color: var(--rp-best); }
.rp-row.is-best .rp-track i { background: var(--rp-best); }
.rp-row.is-best .rp-row-score b { color: var(--rp-best); }
.rp-row.is-best em { background: var(--rp-best); }
.rp-row.is-weak { background: color-mix(in srgb, var(--rp-weak) 6%, white); border-color: color-mix(in srgb, var(--rp-weak) 16%, white); }
.rp-row.is-weak .rp-row-icon { background: color-mix(in srgb, var(--rp-weak) 12%, white); color: var(--rp-weak); }
.rp-row.is-weak .rp-track i { background: color-mix(in srgb, var(--rp-weak) 75%, white); }
.rp-row.is-weak .rp-row-score b { color: #c62828; }
.rp-row.is-weak em { background: var(--rp-weak); }

.rp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-highlight { display: flex; gap: 24px; align-items: flex-start; }
.rp-highlight-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 90px; height: 90px; border-radius: 50%; }
.rp-highlight-icon svg { width: 44px; height: 44px; }
.rp-highlight h3 { font-size: 30px; font-weight: 800; margin: 12px 0 10px; }
.rp-highlight p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--rp-ink); }
.rp-highlight.is-best { background: color-mix(in srgb, var(--rp-best) 7%, white); border-color: color-mix(in srgb, var(--rp-best) 20%, white); }
.rp-highlight.is-best .rp-highlight-icon { background: color-mix(in srgb, var(--rp-best) 14%, white); color: var(--rp-best); }
.rp-highlight.is-best .rp-chip { color: #0f7a5a; background: color-mix(in srgb, var(--rp-best) 16%, white); }
.rp-highlight.is-weak { background: color-mix(in srgb, var(--rp-weak) 6%, white); border-color: color-mix(in srgb, var(--rp-weak) 18%, white); }
.rp-highlight.is-weak .rp-highlight-icon { background: color-mix(in srgb, var(--rp-weak) 14%, white); color: var(--rp-weak); }
.rp-highlight.is-weak .rp-chip { color: #b42318; background: color-mix(in srgb, var(--rp-weak) 14%, white); }

.rp-actions ol { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.rp-actions li { position: relative; border: 1px solid var(--rp-line); border-radius: 10px; padding: 16px 18px; }
.rp-actions li + li::before { content: "\203A"; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); font-size: 28px; color: #9aa4b5; }
.rp-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; margin-right: 10px; }
.rp-actions strong { font-size: 16px; }
.rp-actions li > div { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; }
.rp-actions li > div svg { flex-shrink: 0; width: 44px; height: 44px; padding: 9px; border-radius: 10px; color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, white); }
.rp-actions li p { margin: 0; font-size: 14px; color: var(--rp-muted); line-height: 1.65; }

.rp-reco { display: grid; grid-template-columns: 200px 1fr auto; gap: 28px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 5%, white), #fff 60%); }
.rp-reco-art h2 { font-size: 24px; margin: 0 0 8px; }
.rp-reco-art svg { width: 170px; }
.rp-reco-art .screen { fill: #33415c; }
.rp-reco-art .glass { fill: color-mix(in srgb, var(--brand) 14%, white); }
.rp-reco-art .play { fill: var(--brand); }
.rp-reco-art .bar { fill: color-mix(in srgb, var(--brand) 60%, white); }
.rp-reco-art .base { fill: #cfd6e2; }
.rp-reco-kicker { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--rp-ink); }
.rp-reco h3 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 10px; }
.rp-reco-body p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--rp-ink); }
.rp-reco-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 108px); gap: 10px; text-align: center; font-size: 14px; line-height: 1.5; }
.rp-reco-points span { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); }
.rp-reco-points svg { width: 26px; height: 26px; }

.rp-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 10px 4px 0; font-size: 13px; color: var(--rp-muted); }
.rp-foot span { display: block; }
.rp-foot strong { display: block; letter-spacing: .12em; color: var(--rp-ink); font-size: 13px; }
.rp-foot p { margin: 0; }

@media (max-width: 880px) {
  .rp { padding: 20px 16px 32px; }
  .rp-deco { width: 96px; }
  .rp-top h1 { font-size: 26px; margin-top: 28px; }
  .rp-top h1 strong { font-size: 36px; }
  .rp-top p { font-size: 15px; }
  .rp-card { padding: 20px 18px; }
  .rp-hero { grid-template-columns: 1fr; gap: 18px; justify-items: center; text-align: center; }
  .rp-ring { width: 160px; height: 160px; }
  .rp-ring strong { font-size: 46px; }
  .rp-ring span { font-size: 18px; }
  .rp-hero-body h2 { font-size: 26px; }
  .rp-quote { display: none; }
  .rp-section-head { flex-direction: column; gap: 4px; }
  .rp-section-head h2 { font-size: 20px; }
  .rp-section-head > p { display: none; }
  .rp-row { grid-template-columns: 36px 1fr auto; gap: 6px 12px; }
  .rp-row-icon { width: 36px; height: 36px; grid-row: span 2; }
  .rp-row-score { grid-column: 3; grid-row: 1; }
  .rp-row-score b { font-size: 22px; }
  .rp-track { grid-column: 2 / 4; height: 12px; }
  .rp-row-badge { grid-column: 2 / 4; }
  .rp-row-badge:empty, .rp-row-badge:not(:has(em)) { display: none; }
  .rp-pair { grid-template-columns: 1fr; gap: 0; }
  .rp-highlight { gap: 16px; }
  .rp-highlight-icon { width: 60px; height: 60px; }
  .rp-highlight-icon svg { width: 30px; height: 30px; }
  .rp-highlight h3 { font-size: 22px; }
  .rp-highlight p { font-size: 15px; }
  .rp-actions ol { grid-template-columns: 1fr; gap: 12px; }
  .rp-actions li + li::before { display: none; }
  .rp-reco { grid-template-columns: 1fr; gap: 16px; }
  .rp-reco-art { display: flex; align-items: center; justify-content: space-between; }
  .rp-reco-art svg { width: 96px; }
  .rp-reco h3 { font-size: 26px; }
  .rp-reco-points { grid-template-columns: repeat(3, 1fr); }
  .rp-foot { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1050px) {
  .row-stat { display: none; }
  .editor-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .editor-content { padding: 20px 24px; }
  .dimension-grid { grid-template-columns: 1fr; }
  .auth-shell { gap: 40px; }
  .editor-card { padding: 22px; }
  .choice-edit-list { --score-col: 54px; }
}
@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 16px; gap: 12px; }
  .topbar nav { min-width: 0; overflow-x: auto; flex-wrap: nowrap; gap: 0; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav .text-link { padding: 6px 6px; font-size: 12px; white-space: nowrap; }
  .topbar nav .button { margin-left: 4px; }
  .topbar .workspace-menu, .workspace-name { display: none; }
  .app-shell { padding: 24px 16px 48px; }
  .heading-row { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 26px; }
  .metric-grid, .metric-grid.four { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metric-card { padding: 16px; }
  .metric-card > strong { font-size: 28px; }
  .metric-grid:not(.four) .metric-card:last-child { grid-column: 1 / -1; }
  .assessment-row { padding: 18px 16px; flex-wrap: wrap; gap: 12px; }
  .assessment-main { width: 75%; }
  .assessment-main p { max-width: 240px; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .panel-heading { padding: 18px 16px; align-items: flex-start; flex-direction: column; }
  .auth-shell { display: flex; flex-direction: column; margin: 28px auto; gap: 28px; padding: 0 16px; }
  .auth-copy h1 { font-size: 28px; }
  .auth-copy > p { font-size: 13px; margin-top: 12px; }
  .auth-card, .wide { width: 100%; padding: 24px; }
  .form-section { padding: 22px 16px; gap: 12px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .section-number { width: 26px; height: 26px; }
  .generator-submit { flex-direction: column; padding: 20px 16px; align-items: stretch; }
  .generator-submit .button { width: 100%; }
  .editor-shell { display: block; }
  .editor-aside { position: relative; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-title, .aside-actions { display: none; }
  .editor-aside .back-link { margin-bottom: 8px; }
  .editor-nav { flex-direction: row; margin: 4px 0 0; gap: 0; overflow-x: auto; }
  .editor-nav a { white-space: nowrap; padding: 8px 10px; font-size: 12px; }
  .editor-content { padding: 16px 12px 24px; }
  .editor-card { padding: 18px 14px; }
  .sticky-save { padding: 10px; bottom: 8px; }
  .sticky-save span { font-size: 12px; }
  .band-editor { grid-template-columns: 1fr; }
  .question-editor { padding: 14px 12px 16px; }
  .question-order-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
  /* On narrow screens the choice text takes its own row; scores sit underneath. */
  .choice-grid-head, .choice-editor { grid-template-columns: repeat(calc(var(--score-cols, 3) + 1), minmax(0, 1fr)) 28px; gap: 6px; }
  .choice-grid-head { font-size: 10px; padding-bottom: 2px; }
  .choice-grid-head span:first-child { display: none; }
  .choice-editor > input:not(.score-input) { grid-column: 1 / -1; }
  .choice-editor .score-input { padding: 0 2px; font-size: 13px; }
  .choice-editor + .choice-editor { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .question-add-row .button { width: 100%; }
  .question-add-row .muted { margin-left: 0; }
  .survey-shell, .report-shell { padding: 18px 18px 40px; }
  .survey-brand .subtle { display: none; }
  .survey-intro { padding-top: 40px; }
  .survey-intro h1 { font-size: 27px; }
  .intro-description { font-size: 14px; }
  .survey-benefits { grid-template-columns: 1fr; text-align: left; gap: 8px; }
  .survey-benefits > div { padding: 14px 16px; display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; }
  .survey-benefits strong { margin: 0; }
  .survey-benefits p { grid-column: 2; }
  .survey-question legend { font-size: 22px; }
  .survey-choice { padding: 14px; font-size: 14px; }
  .survey-progress { margin-bottom: 30px; }
  .report-card { padding: 20px; }
  .filter-bar { padding: 16px; gap: 10px; }
  .filter-bar label { min-width: calc(50% - 5px); }
  .filter-bar input[type=submit] { width: 100%; }
}

/* ------------------------------------------------------------------
   MCP integration page
   ------------------------------------------------------------------ */
.token-reveal { border-color: var(--accent); }
.token-box { margin: 16px 0 0; padding: 14px 16px; background: var(--ink); color: #fff; border-radius: var(--radius-s); font-size: 14px; overflow-x: auto; user-select: all; }
.connect-guide { margin-top: 20px; }
.connect-guide h3 { font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
.connect-guide pre { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12px; line-height: 1.6; overflow-x: auto; }
.editor-card code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.editor-card p code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.tool-list { margin: 18px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.tool-list div { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.tool-list dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; }
.tool-list dd { margin: 0; font-size: 13px; color: var(--muted); }
.token-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.token-form input[type=submit] { height: var(--control-h); }
.token-table td { vertical-align: middle; }
.token-table .is-revoked td { color: var(--muted); }
.token-actions { text-align: right; }
.token-actions form { margin: 0; display: inline-block; }
@media (max-width: 720px) { .tool-list { grid-template-columns: 1fr; } .token-form { grid-template-columns: 1fr; } }
