/* ==========================================================================
   LearnToBuild — Violet UI
   Hand-written CSS (no build step) so the app deploys to shared hosting as-is.
   Tokens map 1:1 to the design canvas notes.
   ========================================================================== */

:root {
  --ink: #262551;
  --page: #DCDEEC;
  --card: #FFFFFF;
  --line: #E6E4F1;
  --line-soft: #ECEBF5;
  --violet: #6355B0;
  --violet-text: #5A4BA6;
  --violet-hover: #3F3380;
  --violet-soft: #7466BE;
  --violet-border: #8A7DD0;
  --violet-faint: #A99FE0;
  --lavender: #ECE9F9;
  --surface: #F7F6FC;
  --input-line: #CFCBE5;
  --pink: #F06A96;
  --pink-deep: #C93A6E;
  --pink-light: #FFD6E4;
  --pink-text: #FFE3EC;
  --green: #1F7A63;
  --green-tint: #E2F3EE;
  --amber: #8A5A00;
  --amber-tint: #FFF2D6;
  --red: #B42318;
  --red-tint: #FDECEA;
  --muted: #5A5875;
  --muted-2: #45435F;
  --on-violet: #F4F3FA;
  --on-violet-2: #E9E6F8;
  --on-violet-3: #E1DDF5;
  --r-shell: 28px;
  --r-card: 22px;
  --r-input: 14px;
  --shadow: 0 18px 40px -28px rgba(76, 64, 150, .45);
  --font-ui: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Poppins, var(--font-ui);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.5 var(--font-ui); }
img, svg { display: block; max-width: 100%; }
a { color: var(--violet-text); }
a:hover { color: var(--violet-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Typography helpers ---------- */
.display { font-family: var(--font-display); font-weight: 600; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.big-num { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; }
.big-num small { font-size: 20px; color: var(--muted); font-weight: 600; }
.h-section { font-size: 16px; font-weight: 700; }
.text-green { color: var(--green); }
.text-pink { color: var(--pink-deep); }
.text-red { color: var(--red); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { display: flex; flex-wrap: wrap; align-items: flex-start; min-height: 100vh; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row--tight { gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--lg { gap: 20px; }
.stack--sm { gap: 8px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cluster--sm { gap: 8px; }
.between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.f2 { flex: 2 1 520px; min-width: 0; }
.f1 { flex: 1 1 300px; min-width: 0; }
.f1s { flex: 1 1 200px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.mt-auto { margin-top: auto; }

/* ---------- Sidebar ---------- */
.side { flex: 1 1 264px; max-width: 300px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--violet); color: var(--on-violet); border-radius: 0 var(--r-shell) var(--r-shell) 0; padding: 32px 20px 24px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__mark { width: 44px; height: 44px; border-radius: 14px; background: var(--violet-soft); border: 1px solid var(--violet-border); display: flex; align-items: center; justify-content: center; color: var(--pink-light); flex: none; }
.brand__name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.brand__name span, .brand__accent { color: var(--pink-light); }
.brand__tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--on-violet-3); display: block; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 14px; color: #EEECFA; text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { background: var(--violet-soft); color: #fff; }
.nav a[aria-current="page"] { background: var(--on-violet); color: var(--ink); font-weight: 600; }
.nav .count { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--pink-light); color: var(--ink); font-size: 11px; font-weight: 800; }
.nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--on-violet-3); padding: 10px 14px 2px; }
.side-card { border-radius: 20px; background: var(--violet-soft); border: 1px solid var(--violet-border); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.side-card p { font-size: 13px; color: var(--on-violet-2); }
.side-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--violet-soft); border: 1px solid var(--violet-border); }
.side-user .avatar { background: var(--pink-light); border-color: var(--pink-light); color: var(--ink); width: 40px; height: 40px; font-size: 13px; }
.side-user small { display: block; color: var(--on-violet-3); font-size: 12px; }
.side .side-toggle { display: none; }
.side-head { display: flex; align-items: center; gap: 8px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 4px 0; }
.topbar h1 { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.05; }
.topbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); min-width: 240px; }
.search input { border: 0; outline: 0; background: transparent; font-weight: 500; font-size: 14px; color: var(--ink); width: 100%; }
.icon-btn { position: relative; width: 48px; height: 48px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn .dot { position: absolute; top: 11px; right: 12px; width: 9px; height: 9px; border-radius: 999px; background: var(--violet); border: 2px solid #fff; }
.avatar { width: 48px; height: 48px; border-radius: 999px; background: var(--lavender); border: 1px solid var(--pink-light); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: var(--violet-text); flex: none; text-decoration: none; }
.avatar--sm { width: 36px; height: 36px; font-size: 12px; }
.avatar--md { width: 40px; height: 40px; font-size: 13px; }
.avatar--green { background: var(--green-tint); color: var(--green); border-color: var(--green-tint); }
.avatar--pink { background: var(--pink-light); color: var(--ink); border-color: var(--pink-light); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.breadcrumb a { font-weight: 700; text-decoration: none; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-shell); padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card--pad-sm { padding: 22px; }
.card--shadow { box-shadow: var(--shadow); }
.card--violet { position: relative; overflow: hidden; background: var(--violet); border-color: var(--violet); color: var(--on-violet); }
.card--violet .muted, .card--violet p { color: var(--on-violet-2); }
.card--pink { background: var(--pink-deep); border-color: var(--pink-deep); color: #fff; }
.card--pink .muted { color: var(--pink-text); }
.card--soft { background: var(--surface); border-color: var(--line); }
.card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; }
.card__head h2 { font-size: 16px; font-weight: 700; }
.deco { position: absolute; pointer-events: none; }
.relative { position: relative; }
.tile { flex: 1 1 200px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile--violet { background: var(--violet); border-color: var(--violet); color: #fff; }
.tile--violet .tile__label, .tile--violet .muted { color: var(--on-violet-2); }
.tile--pink { background: var(--pink-deep); border-color: var(--pink-deep); color: #fff; }
.tile--pink .tile__label, .tile--pink .muted { color: var(--pink-text); }
.item { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); align-items: flex-start; }
.item__icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--violet); color: var(--pink-light); }
.item__icon--green { background: var(--green-tint); color: var(--green); }
.item__icon--lav { background: var(--lavender); color: var(--violet-text); }
.item__title { font-size: 14px; font-weight: 600; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }
.empty { padding: 28px; border-radius: 20px; border: 1px dashed var(--violet-faint); background: var(--surface); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- Pills & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--lavender); color: var(--violet-text); white-space: nowrap; }
.pill--green { background: var(--green-tint); color: var(--green); }
.pill--violet { background: var(--violet); color: var(--on-violet); }
.pill--pink { background: var(--pink-light); color: var(--ink); }
.pill--amber { background: var(--amber-tint); color: var(--amber); }
.pill--red { background: var(--red-tint); color: var(--red); }
.pill--ghost { background: transparent; border: 1px solid var(--violet-border); color: var(--on-violet-2); }
.pill--live { background: var(--violet-soft); border: 1px solid var(--violet-border); color: var(--pink-light); letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; }
.pill--live::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--pink-light); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.score { padding: 4px 10px; border-radius: 999px; background: var(--violet); color: var(--on-violet); font-size: 12px; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--violet); color: #fff; text-decoration: none; font: 700 14px var(--font-ui); cursor: pointer; white-space: nowrap; transition: transform .12s ease, background-color .12s ease; }
.btn:hover { background: #54479E; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--lg { min-height: 54px; font-size: 15px; padding: 0 24px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--pink { background: var(--pink-light); color: var(--ink); }
.btn--pink:hover { background: #FFC2D7; color: var(--ink); }
.btn--outline { background: #fff; color: var(--ink); border: 1px solid var(--input-line); }
.btn--outline:hover { background: var(--surface); color: var(--ink); }
.btn--ghost-light { background: transparent; border: 1px solid #A59BDD; color: var(--on-violet); }
.btn--ghost-light:hover { background: var(--violet-soft); color: #fff; }
.btn--danger { background: var(--red); }
.btn--danger:hover { background: #8F1C13; }
.btn--green { background: var(--green); }
.btn--green:hover { background: #18604E; }
.btn--text { background: transparent; color: var(--violet-text); padding: 0 6px; min-height: 44px; font-weight: 800; }
.btn--text:hover { background: transparent; color: var(--violet-hover); text-decoration: underline; }
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.share-grid > * { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: 600 12px var(--font-ui); color: var(--ink); display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.share-grid > *:hover { background: var(--surface); color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r-input); border: 1px solid var(--input-line); background: var(--surface); font: 500 14px var(--font-ui); color: var(--ink); }
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
.textarea--code { font-family: var(--mono); font-size: 13px; min-height: 260px; white-space: pre; }
.input::placeholder, .textarea::placeholder { color: #8A88A3; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99, 85, 176, .18); background: #fff; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.error { font-size: 12px; color: var(--red); font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); flex: none; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 2px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.strength { display: flex; gap: 4px; }
.strength span { flex: 1; height: 6px; border-radius: 999px; background: var(--lavender); }
.strength[data-level="1"] span:nth-child(-n+1),
.strength[data-level="2"] span:nth-child(-n+2),
.strength[data-level="3"] span:nth-child(-n+3),
.strength[data-level="4"] span:nth-child(-n+4) { background: var(--pink-deep); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.rules li { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rules li::before { content: ""; width: 18px; height: 18px; border-radius: 999px; background: var(--lavender); flex: none; }
.rules li.ok { color: var(--green); }
.rules li.ok::before { background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F7A63' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 11px no-repeat; }
.range-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 70px; gap: 12px; align-items: center; font-size: 13px; font-weight: 600; }
.range-row input[type="range"] { width: 100%; accent-color: var(--violet); }
.range-row .input { min-height: 40px; text-align: center; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--input-line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--violet); }
.switch input:checked::after { transform: translateX(18px); }
.code-chip { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 16px; border: 1px dashed var(--violet-faint); background: var(--surface); }
.code-chip__code { flex: 1; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: .08em; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Segmented tabs ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.tabs a[aria-current="true"] { background: var(--violet); color: #fff; }
.tabs .n { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--lavender); color: var(--violet-text); }
.tabs a[aria-current="true"] .n { background: var(--violet-soft); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line-soft); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFAFE; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-size: 14px; }
.who small { display: block; color: var(--muted); font-size: 12px; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; background: transparent; }
.bar > span { min-width: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--lavender); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--violet); }
.meter--pink > span { background: var(--pink-deep); }
.meter--green > span { background: var(--green); }

/* ---------- Leaderboard ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; }
.rank-list .n { width: 28px; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--violet-text); }
.rank-list .name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.rank-list .val { font-size: 14px; font-weight: 700; }
.rank-list li.me { background: var(--violet); color: var(--on-violet); padding: 10px 12px; }
.rank-list li.me .n { color: var(--pink-light); }

/* ---------- Day page ---------- */
.notes { font-size: 15px; line-height: 1.7; color: var(--muted-2); }
.notes h3 { font-size: 18px; color: var(--ink); margin: 18px 0 6px; }
.notes p { margin: 0 0 12px; }
.notes ul, .notes ol { margin: 0 0 12px; padding-left: 20px; }
.notes code { font-family: var(--mono); font-size: 13px; background: var(--lavender); padding: 2px 6px; border-radius: 6px; color: var(--ink); }
.notes pre { background: var(--ink); color: #F4F3FA; padding: 16px; border-radius: 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.notes pre code { background: transparent; color: inherit; padding: 0; }
.objective { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.objective b { width: 26px; height: 26px; border-radius: 999px; background: var(--lavender); color: var(--violet-text); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.countdown { display: flex; gap: 10px; }
.countdown div { min-width: 64px; padding: 10px; border-radius: 16px; background: var(--violet-soft); border: 1px solid var(--violet-border); text-align: center; }
.countdown b { display: block; font-family: var(--font-display); font-size: 28px; color: #fff; line-height: 1.1; }
.countdown span { font-size: 11px; color: var(--on-violet-3); text-transform: uppercase; letter-spacing: .1em; }
.resource { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.resource:hover { background: var(--surface); color: var(--ink); }
.codeblock { background: var(--ink); color: #F4F3FA; border-radius: 16px; padding: 14px 16px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-x: auto; }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: 14px; font-weight: 600; background: var(--green-tint); color: var(--green); }
.alert--error { background: var(--red-tint); color: var(--red); }
.alert--info { background: var(--lavender); color: var(--violet-text); }
.alert--warn { background: var(--amber-tint); color: var(--amber); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- AI assistant ---------- */
.ai-fab { position: fixed; right: 28px; bottom: 28px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 800 14px var(--font-ui); box-shadow: 0 18px 40px -16px rgba(38, 37, 81, .7); cursor: pointer; }
.ai-fab__icon { width: 32px; height: 32px; border-radius: 999px; background: var(--pink-light); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.ai-panel { position: fixed; right: 28px; bottom: 96px; z-index: 41; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 140px)); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 60px -20px rgba(38, 37, 81, .45); display: flex; flex-direction: column; overflow: hidden; }
.ai-panel[hidden] { display: none; }
.ai-panel header { padding: 16px 18px; background: var(--violet); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-height: 200px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.msg--ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.typing { display: inline-flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 999px; background: var(--violet-faint); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Auth split screen ---------- */
.auth { min-height: 100vh; padding: 24px; display: flex; align-items: center; justify-content: center; }
.auth__inner { width: 100%; max-width: 1240px; display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.auth__panel { flex: 1 1 420px; position: relative; overflow: hidden; border-radius: 32px; background: var(--violet); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 640px; }
.auth__panel h2 { font-family: var(--font-display); font-size: 38px; font-weight: 600; }
.auth__panel p { font-size: 16px; line-height: 1.6; color: var(--on-violet-2); max-width: 460px; }
.auth__feature { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--on-violet-2); }
.auth__feature span { width: 34px; height: 34px; border-radius: 11px; background: var(--violet-soft); color: var(--pink-light); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.auth__main { flex: 1 1 420px; border-radius: 32px; background: #fff; padding: 48px clamp(24px, 6vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.auth__form { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.auth__form h1 { font-family: var(--font-display); font-size: 32px; font-weight: 600; }
.logo-tile { width: 48px; height: 48px; border-radius: 11px; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-badge { width: 64px; height: 64px; border-radius: 20px; background: var(--lavender); color: var(--violet-text); display: inline-flex; align-items: center; justify-content: center; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--lavender); }
.steps span.on { background: var(--violet); }

/* ---------- Public pages ---------- */
.pub-nav { position: sticky; top: 0; z-index: 20; background: rgba(220, 222, 236, .88); backdrop-filter: blur(10px); }
.pub-nav__inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pub-nav .brand { color: var(--ink); }
.pub-nav .brand__name span { color: var(--pink-deep); }
.pub-nav .brand__mark { background: #fff; border-color: var(--line); color: var(--violet); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 40px 0 24px; }
.hero__card { position: relative; overflow: hidden; border-radius: 36px; background: var(--violet); color: #fff; padding: clamp(28px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.hero__card h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 64px); font-weight: 600; line-height: 1.02; }
.hero__card p { color: var(--on-violet-2); font-size: 17px; line-height: 1.6; }
.section { padding: 40px 0; }
.section h2.title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 600; margin-bottom: 8px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.day-grid div { padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.day-grid b { display: block; font-size: 11px; color: var(--violet-text); letter-spacing: .1em; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--violet-text); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 10px; color: var(--muted); }
.footer { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sum-row--total { font-size: 18px; font-weight: 800; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cert { position: relative; overflow: hidden; border-radius: 28px; background: #fff; border: 1px solid var(--line); padding: clamp(28px, 5vw, 56px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cert__name { font-family: var(--font-display); font-size: clamp(28px, 5vw, 44px); font-weight: 600; }
.ring-wrap { position: relative; width: 140px; height: 140px; flex: none; }
.ring-wrap__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pagination a, .pagination span { min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 700; color: var(--ink); }
.pagination [aria-current="page"] span, .pagination .active { background: var(--violet); color: #fff; border-color: var(--violet); }
.pagination .disabled { opacity: .45; }

/* ---------- Attendance grid ---------- */
.att { border-collapse: separate; border-spacing: 4px; font-size: 12px; }
.att th { font-weight: 700; color: var(--muted); padding: 4px; white-space: nowrap; }
.att td.name { white-space: nowrap; font-weight: 600; font-size: 13px; padding-right: 10px; }
.att button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; }
.att button[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); }
.att button[aria-pressed="true"]::after { content: "✓"; color: #fff; font-weight: 800; }

/* ---------- AST report ---------- */
.finding { display: grid; grid-template-columns: 78px 60px 1fr; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: 13px; }
.finding .mono { color: var(--muted); }
.sev { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; text-align: center; }
.sev--high { background: var(--red-tint); color: var(--red); }
.sev--medium { background: var(--amber-tint); color: var(--amber); }
.sev--low { background: var(--lavender); color: var(--violet-text); }
.sev--info { background: var(--line-soft); color: var(--muted); }

/* ==========================================================================
   Skeleton loader (LinkedIn-style). Shown until the page and fonts are ready
   and again while navigating to the next page.
   ========================================================================== */
.skeleton-screen { position: fixed; inset: 0; z-index: 90; background: var(--page); display: flex; flex-wrap: wrap; align-items: flex-start; overflow: hidden; transition: opacity .25s ease, visibility .25s; }
html.is-ready .skeleton-screen { opacity: 0; visibility: hidden; pointer-events: none; }
html.is-navigating .skeleton-screen { opacity: 1; visibility: visible; }
.sk { position: relative; overflow: hidden; background: #E9E8F3; border-radius: 12px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: shimmer 1.4s infinite; }
.sk--dark { background: #7466BE; }
.sk--dark::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-side { flex: 1 1 264px; max-width: 300px; height: 100vh; background: var(--violet); border-radius: 0 28px 28px 0; padding: 32px 20px; display: flex; flex-direction: column; gap: 14px; }
.sk-main { flex: 999 1 560px; padding: 36px 32px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sk-card { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.sk-row { display: flex; flex-wrap: wrap; gap: 24px; }
.sk-line { height: 12px; }
.sk-line--lg { height: 28px; }
.sk-circle { border-radius: 999px; }
.sk-auth { width: 100%; padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; max-width: 1240px; margin: auto; min-height: 100vh; align-items: center; }
.sk-auth > div { flex: 1 1 420px; min-height: 640px; border-radius: 32px; }
.loader-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 95; background: linear-gradient(90deg, var(--violet), var(--pink)); transform-origin: left; transform: scaleX(0); opacity: 0; }
html.is-navigating .loader-bar { opacity: 1; animation: load 2.5s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes load { to { transform: scaleX(.9); } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .side { position: static; height: auto; max-width: none; flex-basis: 100%; border-radius: 0 0 28px 28px; padding: 18px 16px; gap: 14px; }
  .side .side-toggle { display: inline-flex; margin-left: auto; background: var(--violet-soft); border-color: var(--violet-border); color: #fff; }
  .side .nav, .side .side-card, .side .side-user, .side .nav-label { display: none; }
  .side.is-open .nav, .side.is-open .side-card, .side.is-open .side-user, .side.is-open .nav-label { display: flex; }
  .main { padding: 20px 16px 96px; }
  .topbar h1 { font-size: 30px; }
  .search { min-width: 0; flex: 1 1 100%; }
  .card { padding: 22px; border-radius: 24px; }
  .big-num { font-size: 34px; }
  .ai-fab { right: 16px; bottom: 16px; }
  .ai-panel { right: 16px; bottom: 84px; }
  .sk-side { display: none; }
  .auth { padding: 12px; }
  .auth__panel { min-height: 0; padding: 28px; }
  .auth__panel .auth__features { display: none; }
  .range-row { grid-template-columns: 1fr 70px; }
  .range-row label { grid-column: 1 / -1; }
  .finding { grid-template-columns: 70px 1fr; }
  .finding .mono { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .side, .ai-fab, .ai-panel, .topbar__actions, .skeleton-screen, .loader-bar, .pub-nav { display: none !important; }
  body { background: #fff; }
}
