/* Logged-in app shell. Layers on site.css tokens (--navy, --blue, --green, --line, etc.). */
.app-body { background: #F6F8FB; min-height: 100vh; display: flex; flex-direction: column; }
.app-header { background: #fff; border-bottom: 1px solid var(--line); }
.app-header-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
.app-header .brand-logo { height: 36px; }
.crumbs { font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--navy); font-weight: 500; }
.crumbs span { margin: 0 6px; color: var(--line); }
.app-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }
.app-user-name { color: var(--muted); }
.app-user-link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); font-weight: 500; cursor: pointer; }
.app-user-link:hover { color: var(--blue); }
.inline-form { display: inline; }
.app-main { max-width: 1120px; width: 100%; margin: 0 auto; padding: 36px 24px 64px; flex: 1; }
.app-footer { text-align: center; font-size: 0.8rem; color: var(--muted); padding: 20px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { font-size: 1.9rem; line-height: 1.15; margin: 0; }
.page-head .eyebrow { margin-bottom: 6px; }
.muted { color: var(--muted); }
.section-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 28px 0 12px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; }
/* The "path" hairline — blue (here) to green (anywhere). Atlara's signature accent. */
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%); }
.stat-num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-num.stat-text { font-size: 1.05rem; }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.15rem; margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table a { color: var(--navy); }
.table a:hover { color: var(--blue); }
.td-actions { text-align: right; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--blue); font-size: 0.78rem; font-weight: 600; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; color: #C0392B; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.org-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; color: inherit; transition: box-shadow 0.15s, transform 0.15s; }
.org-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.org-card-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); font-weight: 700; }
.org-card-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--navy); margin: 6px 0 4px; }
.org-card-meta { font-size: 0.85rem; color: var(--muted); }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 30px 32px; text-align: center; color: var(--muted); }
.empty::before {
  content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 10px; opacity: 0.45;
  background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6782' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'/%3E%3C/svg%3E");
}

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 28px; max-width: 760px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field .help { font-size: 0.78rem; color: var(--muted); }
.field .error { font-size: 0.8rem; color: #C0392B; }
.field-error input, .field-error select { border-color: #C0392B; }
.req { color: #C0392B; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

.app-messages { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; margin-bottom: 10px; }
.flash-success { background: #E7F6EE; color: #1F7A4D; }
.flash-error { background: #FDECEA; color: #B03A2E; }
.flash-info { background: var(--blue-tint); color: var(--blue); }

.auth-wrap {
  display: flex; justify-content: center; padding: 40px 16px 60px;
  background: var(--topo-ink) right -80px top -40px no-repeat, var(--topo-ink) left -140px bottom -120px no-repeat;
  min-height: 70vh;
}
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px 36px; width: 100%; max-width: 440px; box-shadow: var(--shadow); position: relative; overflow: hidden; height: fit-content; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--green)); }
.demo-personas { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.demo-personas-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 10px; }
.demo-personas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-persona {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: #F7FAFD;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.demo-persona:hover { border-color: var(--blue); background: var(--blue-tint); }
.demo-persona .avatar { width: 30px; height: 30px; font-size: 0.7rem; }
.demo-persona strong { display: block; font-size: 0.82rem; color: var(--navy); line-height: 1.2; }
.demo-persona small { font-size: 0.72rem; color: var(--muted); }
.demo-personas-more { font-size: 0.72rem; margin-top: 10px; }
@media (max-width: 480px) { .demo-personas-grid { grid-template-columns: 1fr; } }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 18px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field-grid { grid-template-columns: 1fr; }
.auth-links { margin-top: 16px; text-align: center; font-size: 0.9rem; }

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .app-user-name { display: none; }
}

/* ================= Shared platform components (used by every feature app) ================= */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; color: inherit; text-decoration: none; transition: box-shadow 0.15s, transform 0.15s; }
a.tile:hover { box-shadow: 0 6px 18px rgba(21,42,92,0.10); transform: translateY(-1px); }
.tile h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--navy); }
.tile p { margin: 0; font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
.tile-kpi { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

.progress { height: 8px; background: #E8EDF5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress.is-blue > span { background: var(--blue); }
.progress.is-warn > span { background: #E67E22; }
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-line .progress { flex: 1; }
.progress-pct { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; background: var(--blue-tint); color: var(--blue); white-space: nowrap; }
.badge-green { background: #E7F6EE; color: #1F7A4D; }
.badge-warn { background: #FDF3E7; color: #B9770E; }
.badge-red { background: #FDECEA; color: #B03A2E; }
.badge-gray { background: #EEF1F6; color: var(--muted); }
.badge-navy { background: var(--navy); color: #fff; }

.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main .name { font-weight: 600; color: var(--navy); }
.list-row-main .sub { font-size: 0.83rem; color: var(--muted); }
.list-row-side { text-align: right; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.checklist li:last-child { border-bottom: 0; }
.check-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; }
.checklist .is-done .check-dot { background: var(--green); border-color: var(--green); position: relative; }
.checklist .is-done .check-dot::after { content: "✓"; color: #fff; font-size: 12px; position: absolute; top: -1px; left: 4px; }
.checklist .is-done { color: var(--muted); }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.hero-panel {
  background: linear-gradient(135deg, var(--navy) 0%, #1D3E7E 100%); color: #fff;
  border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.hero-panel::before { content: ""; position: absolute; inset: 0; background: var(--topo) right -40px top -60px no-repeat, var(--topo) left -120px bottom -160px no-repeat; pointer-events: none; }
.hero-panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%); opacity: 0.9; }
.hero-panel > * { position: relative; }
.hero-panel h2 { color: #fff; margin: 0 0 6px; font-size: 1.45rem; letter-spacing: -0.01em; }
.hero-panel p { color: rgba(255,255,255,0.85); margin: 0; max-width: 640px; }
.hero-panel .btn { margin-top: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 2px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; }
.timeline .tl-date { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.timeline .tl-title { font-weight: 600; color: var(--navy); }
.timeline .tl-sub { font-size: 0.88rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.filter-bar select, .filter-bar input[type="search"], .filter-bar input[type="text"] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.9rem; background: #fff; }

/* Generic assessment/quiz components (mirrors career_exploration's ce-quiz look). */
.quiz { max-width: 860px; }
.quiz-q { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-q-text { font-size: 0.97rem; color: var(--ink); }
.quiz-q-num { color: var(--muted); font-size: 0.8rem; margin-right: 8px; }
.quiz-scale { display: flex; gap: 6px; }
.quiz-scale label { position: relative; cursor: pointer; }
.quiz-scale input { position: absolute; opacity: 0; width: 0; height: 0; }
.quiz-scale span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); font-size: 0.85rem; font-weight: 600; color: var(--muted); transition: all 0.12s; }
.quiz-scale input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.quiz-scale label:hover span { border-color: var(--blue); }
.quiz-scale input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.quiz-scale-key { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin: 6px 0 2px; padding: 0 4px; }
.quiz-progress { position: sticky; top: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; font-size: 0.85rem; color: var(--muted); }
.quiz-progress-bar { flex: 1; height: 8px; background: #EEF2F7; border-radius: 999px; overflow: hidden; }
.quiz-progress-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.2s; }
.result-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.result-code { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; border-top: 4px solid var(--blue); }
.result-code-letter { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--blue); line-height: 1; }
.result-code-rank { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.result-code h3 { margin: 6px 0 2px; font-size: 1.05rem; }
.result-code-nick { font-size: 0.82rem; color: var(--green); font-weight: 600; margin-bottom: 8px; }
.result-code p { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.45; }
.result-bars { display: grid; gap: 8px; }
.result-bar { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; font-size: 0.86rem; }
.result-bar-track { height: 12px; background: #EEF2F7; border-radius: 999px; overflow: hidden; }
.result-bar-track i { display: block; height: 100%; background: var(--line); border-radius: 999px; }
.result-bar.is-top .result-bar-track i { background: var(--blue); }
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-picker label { position: relative; cursor: pointer; }
.chip-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-picker span { display: inline-block; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--line); font-size: 0.86rem; color: var(--ink); background: #fff; transition: all 0.12s; }
.chip-picker input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-picker label:hover span { border-color: var(--blue); }

/* Impersonation banner (internal team "log in as"). */
.impersonation-bar {
  position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 8px 16px; background: var(--navy); color: #fff; font-size: 0.85rem;
  border-bottom: 3px solid var(--green);
}
.impersonation-bar button { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.impersonation-bar button:hover { background: rgba(255,255,255,0.25); }

/* Resume document (portfolios app) — professional, recruiter-grade styling.
   The look: what a strong big-tech resume actually looks like on paper —
   restrained, typographic, single accent rule, generous but tight. */
.resume {
  max-width: 780px; padding: 44px 52px !important; color: #1a1f2e;
  font-size: 0.92rem; line-height: 1.42; font-family: var(--font-body);
}
.resume-head { text-align: left; border-bottom: 2.5px solid #1a1f2e; padding-bottom: 14px; }
.resume-head h2 { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.015em; color: #10142a; font-family: var(--font-head); }
.resume-headline { color: #3a4665; font-weight: 500; margin-top: 3px; font-size: 0.98rem; }
.resume-contact { font-size: 0.84rem; color: #5a6478; margin-top: 6px; letter-spacing: 0.01em; }
.resume-summary { margin: 14px 0 0; color: #2a3145; }
.resume h3 {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700;
  color: #10142a; margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #C9CFDB;
}
.resume-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px 0; }
.resume-row > div:first-child { min-width: 0; }
.resume-row > div:last-child { color: #5a6478; white-space: nowrap; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.resume-row strong { font-weight: 650; color: #10142a; }
.resume-detail { color: #4a5268; font-size: 0.86rem; }
.resume-skills { display: block; font-size: 0.9rem; color: #2a3145; }
.resume-skills .badge { background: none !important; color: #2a3145 !important; padding: 0; font-weight: 500; font-size: 0.9rem; white-space: normal; }
.resume-skills .badge:not(:last-child)::after { content: "  ·  "; color: #9aa3b5; }
.resume-footnote { color: #8a92a5; font-size: 0.72rem; margin-top: 22px; text-transform: uppercase; letter-spacing: 0.1em; }

@media print {
  @page { size: letter; margin: 0.55in; }
  .sidebar, .sidebar-backdrop, .app-topbar, .tool-tabs, .no-print, .app-messages, .app-footer,
  .impersonation-bar { display: none !important; }
  .platform-main { margin: 0 !important; }
  .app-main { padding: 0 !important; max-width: none !important; }
  .has-sidebar, .app-body { background: #fff !important; }
  .panel { border: 0 !important; box-shadow: none !important; margin: 0 !important; }
  .resume { padding: 0 !important; max-width: none; font-size: 10.5pt; }
  .resume h3 { break-after: avoid; }
  .resume-row { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .quiz-q { grid-template-columns: 1fr; gap: 8px; }
  .quiz-scale span { width: 36px; height: 36px; }
  .result-bar { grid-template-columns: 90px 1fr 34px; }
}
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .panel { padding: 16px; }
  .hero-panel { padding: 20px; }
  .list-row-side { display: none; }
}
@media (max-width: 480px) {
  .tile-grid { grid-template-columns: 1fr; }
}

/* ================= Platform shell: sidebar + tool tabs ================= */
:root {
  --sidebar-w: 248px;
  /* Faint contour-line "topo" motif — maps/terrain, echoing the Atlara mark. */
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'%3E%3Cpath d='M-20 330 C 80 260, 150 350, 240 300 S 400 250, 460 290'/%3E%3Cpath d='M-20 370 C 90 300, 160 390, 250 340 S 410 290, 470 330'/%3E%3Cpath d='M-20 60 C 60 110, 170 20, 260 70 S 390 130, 460 80'/%3E%3Cpath d='M-20 100 C 70 150, 180 60, 270 110 S 400 170, 470 120'/%3E%3Ccircle cx='330' cy='180' r='34'/%3E%3Ccircle cx='330' cy='180' r='58'/%3E%3Ccircle cx='330' cy='180' r='84'/%3E%3Ccircle cx='90' cy='230' r='26'/%3E%3Ccircle cx='90' cy='230' r='48'/%3E%3C/svg%3E");
  --topo-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke='%23152A5C' stroke-opacity='0.05' stroke-width='1.5'%3E%3Cpath d='M-20 330 C 80 260, 150 350, 240 300 S 400 250, 460 290'/%3E%3Cpath d='M-20 370 C 90 300, 160 390, 250 340 S 410 290, 470 330'/%3E%3Cpath d='M-20 60 C 60 110, 170 20, 260 70 S 390 130, 460 80'/%3E%3Cpath d='M-20 100 C 70 150, 180 60, 270 110 S 400 170, 470 120'/%3E%3Ccircle cx='330' cy='180' r='34'/%3E%3Ccircle cx='330' cy='180' r='58'/%3E%3Ccircle cx='330' cy='180' r='84'/%3E%3Ccircle cx='90' cy='230' r='26'/%3E%3Ccircle cx='90' cy='230' r='48'/%3E%3C/svg%3E");
}
.has-sidebar { background: #F6F8FB; }
.platform { display: flex; min-height: 100vh; }

/* Accessible focus everywhere (keyboard users get the blue ring). */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.sidebar {
  width: var(--sidebar-w); flex: none; color: rgba(255,255,255,0.78);
  background: linear-gradient(178deg, var(--navy-deep, #0E1D42) 0%, #13264F 62%, #16305F 100%);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }
.sidebar-backdrop { display: none; }
.sidebar-brand { display: block; padding: 18px 20px 10px; }
.sidebar-brand img { height: 34px; width: auto; display: block; }
.sidebar-nav { flex: 1; padding: 8px 12px 16px; }
/* Category = collapsible accordion button (CodeHS style); apps nest under a left rail. */
.sidebar-cat { margin-top: 6px; border-radius: 10px; }
.sidebar-cat.is-open { background: rgba(255,255,255,0.04); padding-bottom: 4px; }
.sidebar-cat-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: 0; cursor: pointer; color: rgba(255,255,255,0.92);
  padding: 9px 10px; border-radius: 10px; font: inherit; text-align: left;
}
.sidebar-cat-btn:hover { background: rgba(255,255,255,0.07); }
.sidebar-cat.is-current > .sidebar-cat-btn { color: #fff; }
.sidebar-cat-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.92; }
.sidebar-caret { width: 14px; height: 14px; transition: transform 0.2s; }
.sidebar-cat.is-open .sidebar-caret { transform: rotate(180deg); }
.sidebar-apps { display: none; margin: 2px 0 2px 18px; padding-left: 8px; border-left: 2px solid rgba(255,255,255,0.14); }
.sidebar-cat.is-open .sidebar-apps { display: block; }
.sidebar-cat[data-cat="home"] .sidebar-apps { display: block; margin: 0; padding: 0; border: 0; }
.sidebar-app {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; margin: 2px 0;
  color: rgba(255,255,255,0.78); font-size: 0.86rem; font-weight: 500; line-height: 1.25;
}
.sidebar-app:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-app.is-active {
  background: linear-gradient(90deg, #2E7CD6 0%, #3B87DD 100%); color: #fff;
  box-shadow: inset 3px 0 0 var(--green), 0 4px 12px rgba(46,124,214,0.35);
}
.sidebar-cat[data-cat="home"] .sidebar-app { font-size: 0.9rem; padding: 9px 10px; }
.sidebar-icon { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.sidebar-user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sidebar-link { background: none; border: 0; padding: 0; font: inherit; color: rgba(255,255,255,0.7); cursor: pointer; }
.sidebar-link:hover { color: #fff; }
.sidebar-collapse { background: rgba(255,255,255,0.08); border: 0; border-radius: 8px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); cursor: pointer; flex: none; }
.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,0.16); }
.sidebar-collapse svg { width: 15px; height: 15px; transition: transform 0.2s; }

/* Minimized sidebar (desktop): a slim icon rail; labels reappear on expand. */
@media (min-width: 901px) {
  .sidebar-mini .sidebar { width: 64px; }
  .sidebar-mini .sidebar-brand { padding: 14px 0 6px; text-align: center; }
  .sidebar-mini .sidebar-brand img { display: none; }
  .sidebar-mini .sidebar-brand::after {
    content: ""; display: inline-block; width: 26px; height: 26px;
    background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236FBF9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  }
  .sidebar-mini .sidebar-nav { padding: 8px 8px 16px; }
  .sidebar-mini .sidebar-cat-btn, .sidebar-mini .sidebar-cat-label, .sidebar-mini .sidebar-caret,
  .sidebar-mini .sidebar-app span, .sidebar-mini .sidebar-user, .sidebar-mini .sidebar-foot .inline-form { display: none; }
  .sidebar-mini .sidebar-cat { background: none; padding-bottom: 0; }
  .sidebar-mini .sidebar-cat .sidebar-apps { display: block; margin: 0; padding: 0; border: 0; }
  .sidebar-mini .sidebar-cat + .sidebar-cat { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 8px; padding-top: 6px; border-radius: 0; }
  .sidebar-mini .sidebar-app { justify-content: center; padding: 10px 0; }
  .sidebar-mini .sidebar-icon { width: 19px; height: 19px; }
  .sidebar-mini .sidebar-foot { padding: 12px; justify-content: center; }
  .sidebar-mini .sidebar-collapse svg { transform: rotate(180deg); }
}

.platform-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(255,255,255,0.94);
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-topbar-title { min-width: 0; }
.app-topbar-title h1 { font-size: 1.3rem; margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-cat { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green); font-weight: 700; margin-bottom: 1px; }
.sidebar-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; flex: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-avatar { width: 34px; height: 34px; font-size: 0.78rem; text-decoration: none; }
.global-search { position: relative; }
.global-search input {
  width: 230px; padding: 8px 12px 8px 32px; border: 1px solid var(--line); border-radius: 99px;
  font: inherit; font-size: 0.86rem; background: #F4F7FB
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%235A6782' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 11px center;
  transition: width 0.15s, background-color 0.15s;
}
.global-search input:focus { width: 280px; background-color: #fff; outline: none; border-color: var(--blue); }

.tool-tabs {
  display: flex; gap: 4px; padding: 14px 32px 0; background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; overscroll-behavior-x: contain; touch-action: pan-x; align-items: flex-end;
}
.tool-tab {
  padding: 10px 14px; font-size: 0.9rem; font-weight: 500; color: var(--muted); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; flex: none;
}
.tool-tab:hover { color: var(--navy); border-bottom-color: var(--line); }
.tool-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

.platform .app-main { max-width: none; padding: 28px 32px 64px; }
.platform .page-head h1 { font-size: 1.5rem; }

.coming-soon { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 48px 40px; max-width: 720px; }
.coming-soon-badge { display: inline-block; background: var(--blue-tint); color: var(--blue); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.coming-soon h2 { margin: 0 0 10px; font-size: 1.4rem; }
.coming-soon code { background: #F1F4F8; padding: 1px 6px; border-radius: 4px; font-size: 0.85em; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: none; height: 100dvh; }
  .sidebar-open .sidebar { transform: none; box-shadow: 12px 0 40px rgba(14,29,66,0.35); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(14,29,66,0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s; border: 0; padding: 0; }
  .sidebar-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .sidebar-open { overflow: hidden; }
  /* Bigger tap targets in the drawer. */
  .sidebar-app { padding: 11px 12px; font-size: 0.92rem; }
  .sidebar-cat-btn { padding: 12px 10px; }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 1.15rem; }
  .app-topbar { padding: 10px 16px; gap: 12px; }
  .global-search input, .global-search input:focus { width: 34px; padding-left: 32px; color: transparent; }
  .global-search input:focus { width: 170px; color: inherit; }
  /* Mobile tabs: stable pill bar — no underline math, no vertical wiggle. */
  .tool-tabs { padding: 10px 16px; gap: 8px; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; align-items: center; }
  .tool-tabs::-webkit-scrollbar { display: none; }
  .tool-tab { padding: 8px 14px; margin-bottom: 0; border: 1px solid var(--line); border-radius: 99px; background: #F7FAFD; line-height: 1.2; }
  .tool-tab:hover { border-color: var(--line); }
  .tool-tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
  /* Filter bars: never overflow the viewport. */
  .filter-bar { gap: 8px; }
  .filter-bar input, .filter-bar select { min-width: 0 !important; max-width: 100%; flex: 1 1 130px; }
  .filter-bar .btn, .filter-bar button { flex: 0 0 auto; margin-left: 0 !important; }
  .filter-bar form { max-width: 100%; }
  .platform .app-main { padding: 18px 16px 56px; }
}

/* ================= Account menu (topbar avatar dropdown) ================= */
.account-menu { position: relative; }
.account-menu .topbar-avatar { border: 0; cursor: pointer; }
.account-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 10px); z-index: 80;
  min-width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(14,29,66,0.18); padding: 6px;
}
.account-menu.is-open .account-pop { display: block; }
.account-pop-id { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-pop-id strong { font-size: 0.95rem; color: var(--navy); }
.account-pop-id span { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.account-pop a, .account-pop form button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none;
  border-radius: 8px; color: var(--ink); font-size: 0.92rem; font-weight: 500; cursor: pointer; font-family: inherit;
}
.account-pop a:hover, .account-pop form button:hover { background: var(--blue-tint); color: var(--blue); }

/* Account settings page */
.account-id-row { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.account-id-row .avatar { width: 52px; height: 52px; font-size: 1.05rem; }
.account-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.invite-list { margin-top: 14px; display: grid; gap: 12px; }
.invite-row { display: grid; gap: 6px; font-size: 0.9rem; }
.invite-url {
  width: 100%; font-size: 0.8rem; padding: 8px 10px; border: 1px dashed var(--line);
  border-radius: 8px; background: #F7FAFD; color: var(--muted); font-family: ui-monospace, monospace;
}
.sidebar-foot .sidebar-user { color: inherit; text-decoration: none; }
.sidebar-foot .sidebar-user:hover { color: #fff; }

/* ================= Topbar notification bell ================= */
.notif-bell {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: var(--muted);
}
.notif-bell:hover { background: var(--blue-tint); color: var(--blue); }
.notif-bell svg { width: 19px; height: 19px; }
.notif-dot {
  position: absolute; top: -2px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: #B03A2E; color: #fff; font-size: 0.66rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* Tables scroll sideways on small screens instead of squishing. */
@media (max-width: 900px) {
  .panel .table, .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
}

/* Mobile overflow guards: grid/flex children default to min-width:auto, which
   lets long content push the page wider than the phone. Clamp everything. */
@media (max-width: 900px) {
  .app-main { overflow-wrap: anywhere; }
  .app-main .panel, .two-col > *, .list-rows, .list-row, .list-row-main,
  .timeline, .timeline li { min-width: 0; max-width: 100%; }
  .app-main select, .app-main input, .app-main textarea { max-width: 100%; }
  .panel-head { flex-wrap: wrap; gap: 8px; row-gap: 4px; }
  .tool-tabs { max-width: 100vw; }
}

/* ---- pagination (shared) ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 4px; }
