:root {
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --surface-alt: #F7F9FA;
  --surface-sunk: #EEF1F4;
  --border: #DDE2E7;
  --border-strong: #C5CDD5;
  --text: #17202B;
  --text-muted: #5A6672;
  --text-faint: #8A949E;
  --accent: #24527A;
  --accent-hover: #1B4163;
  --accent-soft: #E8EFF6;
  --green: #2F7A4F; --green-soft: #E6F3EB;
  --red: #B42318; --red-soft: #FDECEA;
  --amber: #8A5A00; --amber-soft: #FFF4DB;
  --violet: #5B3FA8; --violet-soft: #EFEAFB;
  --radius: 8px;
  --font: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Górny pasek ── */
.topbar { height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-muted); min-width: 0; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-faint); }
.crumbs strong { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.save-indicator { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.save-indicator.saving { color: var(--text-muted); }
.save-indicator.error { color: var(--red); }

/* ── Przyciski ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--text); transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover:not(:disabled) { border-color: var(--red); background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-sunk); border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 30px; height: 30px; padding: 0; font-size: 15px; font-weight: 500; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Układ stron ── */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card-pad { padding: 20px 22px; }
.card + .card { margin-top: 16px; }
.kpis .card + .card, .study-list .card + .card { margin-top: 0; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .card-sub { color: var(--text-muted); margin: 0 0 16px; font-size: 13.5px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ── Lista badań ── */
.study-list { display: grid; gap: 10px; }
.study-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 20px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.study-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.study-row.archived { opacity: .6; }
.study-title { font-weight: 700; font-size: 15.5px; }
.study-meta { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.stat { text-align: right; }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }

/* ── Statusy i znaczniki ── */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-sunk); color: var(--text-muted); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.live { background: var(--green-soft); color: var(--green); }
.pill.closed { background: var(--surface-sunk); color: var(--text-muted); }
.pill.draft { background: var(--amber-soft); color: var(--amber); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--surface-sunk); color: var(--text-muted); white-space: nowrap; }
.tag.cond { background: var(--violet-soft); color: var(--violet); }
.tag.ai { background: var(--accent-soft); color: var(--accent); }
.tag.hid { background: var(--amber-soft); color: var(--amber); }

/* ── Nagłówek badania + zakładki ── */
.study-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.study-head-inner { max-width: 1400px; margin: 0 auto; padding: 16px 24px 0; }
.study-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-input { font-size: 21px; font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; min-width: 200px; flex: 1; max-width: 640px; letter-spacing: -.01em; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; }
.tab { padding: 10px 14px; border: none; background: none; cursor: pointer; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.publish-note { font-size: 12.5px; color: var(--amber); white-space: nowrap; }
.workspace { max-width: 1400px; margin: 0 auto; padding: 20px 24px 64px; }

/* ── Przebieg: lista bloków + edytor ── */
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 2px; }
.section-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 8px 2px; display: flex; justify-content: space-between; align-items: center; }
.factor-card { padding: 12px 14px; margin-bottom: 18px; }
.factor-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; }
.factor-line b { font-weight: 600; }
.block-list { display: flex; flex-direction: column; gap: 6px; }
.block-item { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 8px 9px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; position: relative; }
.block-item:hover { border-color: var(--border-strong); }
.block-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.block-item.is-hidden { background: var(--surface-alt); }
.block-item.is-hidden .block-name { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.block-item.dragging { opacity: .4; }
.block-item.drop-before::before, .block-item.drop-after::after { content: ''; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: var(--accent); }
.block-item.drop-before::before { top: -5px; }
.block-item.drop-after::after { bottom: -5px; }
.drag-handle { cursor: grab; color: var(--text-faint); font-size: 13px; text-align: center; user-select: none; letter-spacing: -2px; }
.block-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; background: var(--surface-sunk); }
.block-icon.ai { background: var(--accent-soft); }
.block-num { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.block-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.block-actions { display: flex; gap: 0; opacity: 0; transition: opacity .1s; }
.block-item:hover .block-actions, .block-item.selected .block-actions, .block-item:focus-within .block-actions { opacity: 1; }
.block-actions .btn-icon { width: 26px; height: 26px; font-size: 13px; color: var(--text-muted); }
.add-block { margin-top: 10px; width: 100%; height: 38px; border-style: dashed; color: var(--text-muted); }
.add-menu { display: grid; gap: 4px; }
.add-option { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; text-align: left; padding: 10px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.add-option:hover { background: var(--surface-alt); border-color: var(--border); }
.add-option b { display: block; font-size: 14px; }
.add-option span { font-size: 12.5px; color: var(--text-muted); }

.issues { margin-bottom: 14px; display: grid; gap: 6px; }
.issue { padding: 8px 12px; border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; cursor: default; }
.issue.error { background: var(--red-soft); color: var(--red); }
.issue.warn { background: var(--amber-soft); color: var(--amber); }
.issue[data-block] { cursor: pointer; }

/* ── Formularze edytora ── */
.editor { padding: 0; }
.editor-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.editor-head .block-icon { width: 34px; height: 34px; font-size: 17px; }
.editor-head h2 { margin: 0; font-size: 16px; }
.editor-head .muted { font-size: 13px; }
.editor-body { padding: 6px 22px 22px; }
.fieldset { padding: 18px 0; border-bottom: 1px solid var(--border); }
.fieldset:last-child { border-bottom: none; padding-bottom: 0; }
.fieldset > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fieldset > h3 .desc { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-faint); font-size: 12.5px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field .help { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inp, .sel, .ta { width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); padding: 7px 10px; font-size: 14px; line-height: 1.45; transition: border-color .12s, box-shadow .12s; }
.inp:focus, .sel:focus, .ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ta { resize: vertical; min-height: 72px; }
.ta.tall { min-height: 160px; }
.ta.code { font-family: var(--mono); font-size: 12.5px; }
.sel { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235A6672' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.inp.sm { width: 90px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-muted); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row output { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; font-weight: 600; }

.list-editor { display: grid; gap: 8px; }
.list-row { display: grid; gap: 8px; align-items: start; padding: 10px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; }
.list-row .row-tools { display: flex; gap: 2px; }
.list-row .btn-icon { width: 26px; height: 26px; font-size: 13px; }
.list-row.compact { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; padding: 6px 8px; }
.list-index { font-size: 12px; color: var(--text-faint); text-align: center; font-variant-numeric: tabular-nums; }
.variant-box { margin-top: 10px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--surface-alt); }
.variant-level { margin-top: 10px; }
.variant-level > .field-label { display: flex; align-items: center; gap: 6px; }
.callout { padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-hover); font-size: 13px; }
.callout.warn { background: var(--amber-soft); color: var(--amber); }

/* ── Persony ── */
.persona-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(340px, 440px); gap: 18px; align-items: start; }
.persona-list { display: grid; gap: 6px; }
.persona-item { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.persona-item:hover { border-color: var(--border-strong); }
.persona-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.persona-item b { display: block; font-size: 13.5px; }
.persona-item span { font-size: 12px; color: var(--text-muted); }
.prompt-preview { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--surface-sunk); border-radius: 8px; padding: 12px; color: var(--text); max-height: 320px; overflow: auto; margin: 0; }
.sandbox { position: sticky; top: 72px; display: flex; flex-direction: column; max-height: calc(100vh - 92px); }
.sandbox-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.sandbox-cols { display: grid; grid-template-columns: 1fr; flex: 1; min-height: 0; }
.sandbox-cols.two { grid-template-columns: 1fr 1fr; }
.sandbox-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.sandbox-col:last-child { border-right: none; }
.sandbox-col-head { font-size: 12px; font-weight: 700; padding: 8px 12px; background: var(--surface-alt); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 6px; }
.sandbox-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; }
.bubble { max-width: 90%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--surface-sunk); border-bottom-left-radius: 4px; }
.bubble.error { align-self: stretch; background: var(--red-soft); color: var(--red); font-size: 12.5px; }
.bubble-meta { font-size: 11px; color: var(--text-faint); align-self: flex-start; margin-top: -4px; }
.sandbox-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.sandbox-input textarea { flex: 1; min-height: 40px; max-height: 120px; resize: none; }

/* ── Udostępnianie ── */
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.link-box { display: flex; gap: 8px; align-items: center; }
.link-box .inp { font-family: var(--mono); font-size: 13px; background: var(--surface-alt); }
.status-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-opt { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.status-opt b { display: block; font-size: 14px; margin-bottom: 2px; }
.status-opt span { font-size: 12.5px; color: var(--text-muted); }
.status-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-opt:disabled { opacity: .5; cursor: not-allowed; }
.og-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.og-img { aspect-ratio: 1.91 / 1; background: var(--surface-sunk) center / cover no-repeat; display: grid; place-items: center; color: var(--text-faint); font-size: 13px; }
.og-body { padding: 10px 12px; background: #F0F2F5; }
.og-domain { font-size: 11.5px; text-transform: uppercase; color: #65676B; }
.og-title { font-weight: 700; font-size: 15px; color: #050505; margin-top: 2px; }
.og-desc { font-size: 13px; color: #65676B; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dns-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.dns-table td, .dns-table th { padding: 6px 8px; border: 1px solid var(--border); text-align: left; }
.dns-table th { background: var(--surface-alt); font-weight: 600; }
.version-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.version-row:last-child { border-bottom: none; }

/* ── Wyniki ── */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi span { font-size: 12.5px; color: var(--text-muted); }
.cell-table, .data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cell-table th, .cell-table td, .data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cell-table th, .data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; background: var(--surface-alt); }
.cell-table td.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--surface-sunk); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: var(--accent); border-radius: 4px; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.table-wrap { overflow-x: auto; }

/* ── Modal, szuflada, toasty, menu ── */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 14px 22px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 90; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.drawer-body { overflow: auto; padding: 16px 20px 40px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.transcript { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 14px; box-shadow: var(--shadow-lg); animation: fade .15s; max-width: 90vw; }
.toast.error { background: var(--red); }
.menu { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 190px; }
.menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: none; background: none; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.menu button:hover { background: var(--surface-alt); }
.menu button.danger { color: var(--red); }
.menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Logowanie ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login h1 { font-size: 20px; margin: 14px 0 4px; }
.login .error { color: var(--red); font-size: 13.5px; margin-top: 10px; }

@media (max-width: 1180px) {
  .persona-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .persona-layout .sandbox { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 900px) {
  .split, .share-grid, .persona-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .study-row { grid-template-columns: 1fr auto; }
  .study-row .stat:not(:first-of-type) { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .status-choice { grid-template-columns: 1fr; }
  .crumbs strong { max-width: 160px; }
}
