/* ResearchFlow design system. One set of tokens for the public site and the app.
   Conference = violet, Journal = teal, shared actions = indigo ink. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --ink: #15132e;
  --ink-2: #221f47;
  --text: #26243f;
  --muted: #6b6985;
  --faint: #9a98b0;
  --line: #e8e7f1;
  --line-2: #f0eff7;
  --bg: #f6f6fb;
  --surface: #ffffff;

  --primary: #4a3fdb;
  --primary-600: #3c32bd;
  --primary-50: #eeecfd;
  --conf: #6d4cf5;
  --conf-50: #f1edff;
  --jour: #0b8f7d;
  --jour-50: #e3f6f2;
  --apricot: #ff9457;
  --apricot-50: #fff1e8;

  --green: #138a4b;  --green-50: #e5f6ec;
  --amber: #a96800;  --amber-50: #fff3da;
  --red: #c8362f;    --red-50: #fdebea;
  --blue: #2563c9;   --blue-50: #e8f0fd;
  --teal: #0b8f7d;   --teal-50: #e3f6f2;
  --violet: #6d4cf5; --violet-50: #f1edff;
  --gray: #5f5d78;   --gray-50: #eeedf4;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(21, 19, 46, .05), 0 1px 3px rgba(21, 19, 46, .04);
  --shadow: 0 8px 24px -12px rgba(21, 19, 46, .18), 0 2px 6px rgba(21, 19, 46, .04);
  --shadow-lg: 0 28px 60px -24px rgba(21, 19, 46, .35);

  --font: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', 'Hind Siliguri', Georgia, serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --side: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.18rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
h4 { font-size: .9rem; font-weight: 700; }
p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 3px solid rgba(74, 63, 219, .45); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 200; background: #fff; padding: 8px 14px; border-radius: 8px; }

/* ---------- helpers ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: .92em; }
.serif { font-family: var(--serif); }
.strong { font-weight: 700; color: var(--ink); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack.sm { gap: 10px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand .brand-flow { color: var(--primary); }

/* ---------- icons ---------- */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- buttons ---------- */
.btn { --b: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--b); border-radius: 10px; background: transparent; color: var(--ink); font: 600 .9rem/1.2 var(--font); cursor: pointer; text-align: center; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(74, 63, 219, .8); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-soft { background: var(--primary-50); color: var(--primary-600); }
.btn-soft:hover { background: #e2dffc; color: var(--primary-600); }
.btn-outline { --b: var(--line); background: #fff; }
.btn-outline:hover { --b: #cfcde0; background: #fcfcff; color: var(--ink); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0f7540; color: #fff; }
.btn-danger { --b: #f3c9c6; background: #fff; color: var(--red); }
.btn-danger:hover { background: var(--red-50); color: var(--red); }
.btn-conf { background: var(--conf); color: #fff; }
.btn-conf:hover { background: #5c3ce0; color: #fff; }
.btn-jour { background: var(--jour); color: #fff; }
.btn-jour:hover { background: #097565; color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .82rem; border-radius: 8px; gap: 6px; }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { margin: 0; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 20px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.card-flush { overflow: hidden; }
a.card, .card-link { color: inherit; transition: border-color .15s, box-shadow .2s, transform .2s; }
a.card:hover, .card-link:hover { text-decoration: none; border-color: #d4d1ee; box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; max-width: 70ch; }
@media (max-width: 640px) { .page-head > .grow { flex-basis: 100%; } }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--primary); }
.eyebrow.conf { color: var(--conf); } .eyebrow.jour { color: var(--jour); }

/* ---------- stats ---------- */
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; color: inherit; }
a.stat:hover { text-decoration: none; border-color: #d4d1ee; box-shadow: var(--shadow); }
.stat .tile { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat .tile .icon { width: 22px; height: 22px; }
.stat .num { font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.03em; }
.stat .lbl { color: var(--muted); font-size: 13px; line-height: 1.35; }
@media (max-width: 640px) { .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; } .stat .num { font-size: 1.3rem; } }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-teal { background: var(--teal-50); color: var(--teal); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-gray { background: var(--gray-50); color: var(--gray); }
.tone-apricot { background: var(--apricot-50); color: #c2581c; }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--gray-50); color: var(--gray); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-violet { background: var(--violet-50); color: #5433d6; }
.badge-teal { background: var(--teal-50); color: #08705f; }
.badge-amber { background: var(--amber-50); color: #8a5500; }
.badge-green { background: var(--green-50); color: #0f6e3c; }
.badge-blue { background: var(--blue-50); color: #1d4f9f; }
.badge-red { background: var(--red-50); color: #a82a24; }
.badge-gray { background: var(--gray-50); color: var(--gray); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--line); background: #fff; border-radius: 99px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.chip.conf { background: var(--conf-50); border-color: transparent; color: #5433d6; }
.chip.jour { background: var(--jour-50); border-color: transparent; color: #08705f; }
.kind-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--conf); }
.kind-dot.journal { background: var(--jour); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full, .form-grid > .full { grid-column: 1 / -1; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--ink); }
.req { color: var(--red); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field-error { font-size: 12.5px; color: var(--red); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #dbd9e8; border-radius: 10px; background: #fff; color: var(--ink); font: 400 14.5px/1.45 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6985' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 11px center no-repeat; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 63, 219, .14); }
input[type=color] { width: 56px; height: 42px; padding: 4px; border: 1px solid #dbd9e8; border-radius: 10px; background: #fff; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.filebox { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed #cbc8e2; border-radius: var(--r); background: #fbfbff; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.filebox:hover, .filebox.drag { border-color: var(--primary); background: var(--primary-50); }
.filebox input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.filebox .tile { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.filebox strong { display: block; color: var(--ink); font-size: 14px; word-break: break-word; }
.filebox span.help { display: block; }
.choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.choice label { position: relative; display: block; border: 1px solid #dbd9e8; border-radius: var(--r); padding: 13px 15px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice label:has(input:focus-visible) { outline: 3px solid rgba(74, 63, 219, .45); }
.choice strong { display: block; color: var(--ink); font-size: 14px; }
.choice span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: grid; place-items: center; min-width: 46px; height: 42px; padding: 0 10px; border: 1px solid #dbd9e8; border-radius: 10px; font-weight: 700; cursor: pointer; background: #fff; }
.scale input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.scale input:focus-visible + span { outline: 3px solid rgba(74, 63, 219, .45); }
.input-group { display: flex; gap: 8px; }
.input-group > :first-child { flex: 1; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; padding: 0; }
@media (max-width: 700px) { .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.table th { text-align: left; padding: 11px 16px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; border-bottom: 1px solid var(--line); background: #fbfbfe; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfcff; }
.table .title { font-weight: 700; color: var(--ink); display: block; max-width: 520px; }
.table a.title:hover { color: var(--primary); }
.table .actions { text-align: right; white-space: nowrap; }
.table th.right, .table td.right { text-align: right; }
.table .actions form { display: inline; }
@media (max-width: 760px) {
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.cards td { padding: 3px 0; border: 0; text-align: left; }
  .table.cards td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 96px; margin-right: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
  .table.cards .actions { text-align: left; padding-top: 8px; white-space: normal; }
}

/* ---------- tabs, toolbar, pagination ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 13.8px var(--font); white-space: nowrap; cursor: pointer; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .active { color: var(--primary); border-bottom-color: var(--primary); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--gray-50); color: var(--gray); font-size: 11.5px; font-weight: 700; text-align: center; line-height: 19px; }
.active .count { background: var(--primary-50); color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select { width: auto; min-width: 160px; }
@media (max-width: 640px) { .toolbar input[type=search], .toolbar select { max-width: none; width: 100%; } }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 16px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--text); }
.pagination a:hover { text-decoration: none; border-color: var(--primary); }
.pagination .on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .off { opacity: .45; }

/* ---------- alerts, empty ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r); border: 1px solid transparent; margin-bottom: 16px; font-size: 14px; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--green-50); color: #0d5c33; border-color: #c7ebd6; }
.alert-error { background: var(--red-50); color: #8f231e; border-color: #f6cfcc; }
.alert-info { background: var(--blue-50); color: #1a4388; border-color: #cfdef8; }
.alert-warn { background: var(--amber-50); color: #754800; border-color: #f6e2b0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.empty { text-align: center; padding: 42px 22px; color: var(--muted); }
.empty .tile { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty .tile .icon { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 4px; }
.empty p { max-width: 44ch; margin: 0 auto 14px; }

/* ---------- people ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 12.5px; color: #fff; background: var(--primary); letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.av-0 { background: #6d4cf5; } .av-1 { background: #0b8f7d; } .av-2 { background: #d9642a; } .av-3 { background: #2563c9; } .av-4 { background: #b8398a; } .av-5 { background: #4d7c0f; }
.avatar.anon { background: var(--gray-50); color: var(--gray); }
.person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.person > div { min-width: 0; line-height: 1.35; }
.person strong { display: block; color: var(--ink); font-size: 13.8px; }
.person span:not(.avatar, .logo-box, .badge) { display: block; color: var(--muted); font-size: 12.5px; }
.person strong span:not(.badge) { display: inline; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list .grow strong, .list .grow a.strong { display: block; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13.8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 10px; } }
.progress { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.progress.jour > span { background: var(--jour); }
.progress.conf > span { background: var(--conf); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; color: var(--faint); font-size: 12px; }
.timeline .private::before { background: var(--faint); box-shadow: 0 0 0 3px var(--gray-50); }

/* workflow stepper */
.steps { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; counter-reset: s; scrollbar-width: none; }
.steps li { flex: 1; min-width: 96px; position: relative; text-align: center; font-size: 12px; font-weight: 600; color: var(--faint); counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 7px; border-radius: 50%; background: #fff; border: 2px solid var(--line); position: relative; z-index: 1; font-size: 12px; }
.steps li::after { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: '✓'; background: var(--primary); border-color: var(--primary); color: #fff; }
.steps li.done::after, .steps li.current::after { background: var(--primary); }
.steps li.current { color: var(--primary); }
.steps li.current::before { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.steps li.bad::before { content: '✕'; background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.steps li.bad { color: var(--red); }

/* ---------- venue cards ---------- */
.cover { position: relative; height: 116px; overflow: hidden; color: #fff; display: flex; align-items: flex-end; padding: 16px 20px; }
.cover svg.cover-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .32; }
.cover strong { position: relative; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.cover .cover-tag { position: absolute; top: 12px; right: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-size: 11.5px; font-weight: 700; backdrop-filter: blur(4px); }
.cover-1 { background: linear-gradient(125deg, #2b1e7a, #6d4cf5 70%, #9a6bff); }
.cover-2 { background: linear-gradient(125deg, #0b3b46, #0b8f7d 70%, #34c3a5); }
.cover-3 { background: linear-gradient(125deg, #4a1442, #a8327a 65%, #ff9457); }
.cover-4 { background: linear-gradient(125deg, #10244f, #2563c9 70%, #4fb3e8); }
.cover-5 { background: linear-gradient(125deg, #3b2204, #b45f12 70%, #f2b441); }
.cover-6 { background: linear-gradient(125deg, #15132e, #3d3a6b 70%, #6e6aa8); }
.venue-card { overflow: hidden; display: flex; flex-direction: column; }
.venue-card .card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.venue-card h3 { margin: 0; line-height: 1.35; }
.venue-card .meta { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.venue-card .meta span { display: flex; gap: 8px; align-items: center; }
.venue-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }

.logo-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 13px; overflow: hidden; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; background: linear-gradient(178deg, #171532 0%, #1d1944 55%, #15132e 100%); color: #c9c6e6; z-index: 60; transition: transform .25s ease; }
.sidebar .brand { color: #fff; padding: 18px 20px 12px; }
.sidebar .brand .brand-flow { color: #a99bff; }
.org-switch { margin: 4px 14px 10px; }
.org-switch select { background-color: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); color: #fff; font-size: 13px; min-height: 38px; }
.org-switch select option { color: var(--ink); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-label { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #716da0; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 11px; margin-bottom: 2px; border-radius: 10px; color: #c4c1e4; font-weight: 600; font-size: 13.8px; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-nav a.active { background: linear-gradient(100deg, rgba(120, 98, 255, .38), rgba(120, 98, 255, .14)); color: #fff; box-shadow: inset 3px 0 0 #9d8bff; }
.side-nav a .pill { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--apricot); color: #2c1204; font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #8480b3; }
.side-foot a { color: #c4c1e4; }
.main { margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 28px; background: rgba(246, 246, 251, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.search-trigger { display: flex; align-items: center; gap: 10px; width: min(420px, 100%); min-width: 0; flex: 0 1 420px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--faint); font: 500 13.5px var(--font); cursor: pointer; text-align: left; }
.search-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger kbd { flex: none; margin-left: auto; font: 600 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
.icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: #cfcde0; text-decoration: none; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--apricot); box-shadow: 0 0 0 2px #fff; }
.burger { display: none; }
.content { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 28px 60px; }
.demo-bar { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 7px 16px; background: var(--apricot-50); color: #8a3c0c; font-size: 12.5px; font-weight: 600; text-align: center; }
.demo-bar a { color: #8a3c0c; text-decoration: underline; }
.bottom-nav { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(21, 19, 46, .5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }

@media (max-width: 1020px) {
  .sidebar { transform: translateX(-102%); }
  .side-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .side-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .burger { display: grid; }
  .topbar { padding: 0 16px; gap: 9px; }
  .content { padding: 18px 16px 96px; }
  .search-trigger kbd { display: none; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a, .bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; background: none; border: 0; color: var(--muted); font: 600 10.5px var(--font); cursor: pointer; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .active { color: var(--primary); }
  .bottom-nav .icon { width: 21px; height: 21px; }
  .bottom-nav .pill { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; padding: 0 4px; border-radius: 99px; background: var(--apricot); color: #2c1204; font-size: 10px; line-height: 16px; }
}
@media (max-width: 520px) { .search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .topbar .hide-xs { display: none; } }

/* ---------- dropdown, modal, search palette ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; max-width: min(360px, 92vw); padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 80; display: none; }
.dropdown.open > .menu { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 500 13.5px var(--font); text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--line-2); text-decoration: none; }
.menu-head { padding: 9px 11px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.menu-head strong { display: block; color: var(--ink); }
.menu-head span { color: var(--muted); font-size: 12.5px; }
.menu.wide { width: 360px; }
.menu .note { align-items: flex-start; }
.menu .note strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.35; }
.menu .note span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.menu .note.unread { background: var(--primary-50); }
@media (max-width: 520px) { .menu.wide { position: fixed; left: 8px; right: 8px; top: 66px; width: auto; max-width: none; } }

dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal.wide { width: min(780px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(21, 19, 46, .55); backdrop-filter: blur(2px); }
dialog.modal.confirm { width: min(420px, calc(100vw - 32px)); }
dialog.modal.confirm p { margin: 4px 0; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.5; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }

dialog.palette { width: min(620px, calc(100vw - 20px)); margin-top: 10vh; padding: 0; border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.palette::backdrop { background: rgba(21, 19, 46, .55); backdrop-filter: blur(2px); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--line); }
.palette-input input { border: 0; box-shadow: none !important; min-height: 52px; padding: 0; font-size: 16px; }
.palette-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-results a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.palette-results a:hover, .palette-results a.sel { background: var(--primary-50); text-decoration: none; }
.palette-results strong { display: block; color: var(--ink); font-size: 13.8px; line-height: 1.35; }
.palette-results span { display: block; color: var(--muted); font-size: 12px; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; gap: 10px; align-items: center; max-width: min(420px, calc(100vw - 36px)); padding: 13px 18px; border-radius: 13px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.8px; animation: rise .3s ease; }
.toast .icon { color: #67e3a8; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 1020px) { .toast { bottom: 78px; right: 12px; left: 12px; max-width: none; } }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 18px; }
.bars .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bars .pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: calc(100% - 22px); }
.bars i { display: block; width: min(20px, 46%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--conf); position: relative; }
.bars i.j { background: var(--jour); }
.bars i.p { background: var(--primary); width: min(32px, 80%); }
.bars i:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 6px; background: var(--ink); color: #fff; font: 600 11px var(--font); font-style: normal; white-space: nowrap; }
.bars small { font-size: 11px; color: var(--faint); white-space: nowrap; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--conf); }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; }
.donut { width: 160px; height: 160px; flex: none; }
.donut text { font-family: var(--font); fill: var(--ink); }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; min-width: 170px; flex: 1; }
.donut-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.donut-legend li b { margin-left: auto; color: var(--ink); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hbar { display: grid; grid-template-columns: minmax(90px, 180px) 1fr 42px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar b { text-align: right; color: var(--ink); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; padding: 40px 48px; color: #d9d6f5; background: radial-gradient(900px 500px at 0% 0%, #4a3fdb 0%, transparent 60%), radial-gradient(700px 500px at 100% 100%, #0b8f7d 0%, transparent 62%), #17153a; }
.auth-art .brand { color: #fff; } .auth-art .brand .brand-flow { color: #bdb2ff; }
.auth-art h2 { color: #fff; font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 2.6vw, 2.4rem); max-width: 18ch; }
.auth-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-art li { display: flex; gap: 11px; align-items: center; }
.auth-art li .icon { color: #8ff0d6; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 36px 20px; }
.auth-box { width: 100%; max-width: 460px; }
.auth-box h1 { margin-bottom: 4px; }
.demo-accounts { display: grid; gap: 9px; margin: 16px 0 6px; }
.demo-accounts button { display: flex; gap: 13px; align-items: center; width: 100%; text-align: left; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; font-family: var(--font); transition: border-color .15s, box-shadow .15s, transform .15s; }
.demo-accounts button:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.demo-accounts .tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.demo-accounts strong { display: block; color: var(--ink); font-size: 13.8px; }
.demo-accounts span span { display: block; color: var(--muted); font-size: 12.3px; }
.demo-accounts .icon-chev { margin-left: auto; color: var(--faint); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } .auth-main { align-items: flex-start; } }
.only-mobile { display: none; }
@media (max-width: 900px) { .only-mobile { display: inline-flex; } }

@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .demo-bar, .toast, .no-print { display: none !important; }
  .main { margin: 0; } .content { padding: 0; max-width: none; } body { background: #fff; }
  .card { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
