/* ============================================================================
   Mentor.ai reskin
   ----------------------------------------------------------------------------
   Presentation only. Loaded after shaurya.css so it owns the final look.
   Tokens come from the Mentor.ai design handoff (01-design-tokens.md).
   Mobile pass: everything below is scoped to viewports <= 767px.
   The laptop pass will add its own block for >= 1024px.
   ========================================================================== */

:root {
  --ink: #12142b; --muted: #5b6178; --bg: #f6f7fb; --card: #ffffff; --line: #e4e6ef; --line-2: #d5d8e4;
  --navy: #1e1b4b; --navy-2: #312e81;
  --indigo: #4338ca; --indigo-d: #3730a3; --indigo-l: #eef2ff; --indigo-m: #c7d2fe; --indigo-s: #a5b4fc; --indigo-x: #818cf8;
  --ok: #15803d; --ok-bg: #f0fdf4; --ok-line: #bbf7d0;
  --warn: #c2410c; --warn-bg: #fff7ed; --warn-line: #fed7aa; --pro-bg: #fed7aa; --pro-ink: #7c2d12;
  --bad: #b91c1c; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --pet: #6366f1; --pet-cheek: #f9a8d4;
  --r-card: 18px; --r-card-sm: 14px; --r-btn: 12px; --r-chip: 17px; --r-tag: 7px;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
}

/* Mobile-only helpers stay hidden until the phone block turns them on. */
html body .mai-mobile-only { display: none !important; }

@media (max-width: 767px) {
  html body .mai-mobile-only { display: block !important; }
  html body .mai-streak.mai-mobile-only,
  html body .mai-avatar.mai-mobile-only { display: inline-flex !important; }

  html body,
  html body button,
  html body input,
  html body select,
  html body textarea {
    font-family: var(--font-body) !important;
  }
  html body h1,
  html body h2,
  html body h3,
  html body .big,
  html body .product-lockup p,
  html body .product-lockup strong {
    font-family: var(--font-display) !important;
  }
  html body {
    background: var(--bg) !important;
    color: var(--ink);
  }

  /* ---- App shell: 20px padding, centred 430px column, room for bottom nav ---- */
  html body #app.app-shell {
    max-width: 430px;
    margin: 0 auto;
    padding: 16px 20px calc(96px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box;
  }

  /* ---- Top bar: logo + More on one row, chips below ---- */
  html body .app-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 !important;
    margin: 0 0 14px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  /* Header dissolves into the page so the logo row can stay pinned (with More) while content scrolls under it. */
  html body .app-header { display: contents !important; }
  html body .app-brand {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 52px;
    margin: -16px -20px 0 !important;
    padding: 0 96px 0 20px !important;
    background: var(--bg);
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }
  html body .app-vitals { margin: 0 0 14px !important; }
  html body .product-lockup { display: flex; align-items: center; gap: 0; }
  html body .product-lockup p {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--indigo) !important;
    text-transform: none;
  }
  /* The tagline moves to the page title / meta. Logo stands alone on phones. */
  html body .product-lockup h1 { display: none; }
  html body .app-vitals { gap: 8px; padding: 0 !important; background: transparent !important; border: 0 !important; }
  html body .app-vitals span {
    height: 34px;
    padding: 0 12px;
    border-radius: var(--r-chip);
    background: #fff !important;
    border: 1px solid var(--line) !important;
    color: var(--muted) !important;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: none !important;
  }
  html body .app-vitals span strong { color: var(--ink) !important; font-weight: 800; }
  html body .app-vitals .risk.needs-push,
  html body .app-vitals .risk.needs-push strong { background: var(--warn-bg) !important; border-color: var(--warn-line) !important; color: var(--warn) !important; }
  html body .app-vitals .risk.safe,
  html body .app-vitals .risk.safe strong { background: var(--ok-bg) !important; border-color: var(--ok-line) !important; color: var(--ok) !important; }
  html body .app-vitals .risk.danger,
  html body .app-vitals .risk.danger strong { background: var(--bad-bg) !important; border-color: var(--bad-line) !important; color: var(--bad) !important; }

  /* ---- Bottom nav: Today · Plan · Mentor (raised centre) · Practice · Progress ---- */
  html body nav.tab-bar {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    top: auto !important;
    z-index: 40;
    display: flex !important;
    align-items: flex-start;
    justify-content: space-around;
    gap: 0 !important;
    height: calc(78px + env(safe-area-inset-bottom));
    padding: 10px 6px env(safe-area-inset-bottom) !important;
    margin: 0 !important;
    background: #fff !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    overflow: visible;
  }
  html body nav.tab-bar > button {
    order: 5;
    flex: 0 0 64px;
    width: 64px;
    min-width: 0;
    min-height: 44px !important;
    padding: 30px 0 0 !important;
    position: relative;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--muted) !important;
    font: 600 11px/1.1 var(--font-body) !important;
    text-align: center;
    border-radius: 0 !important;
  }
  html body nav.tab-bar > button::before {
    content: "";
    position: absolute;
    top: 4px; left: 50%;
    width: 22px; height: 22px;
    margin-left: -11px;
    background-color: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat;
    mask: var(--ic) center / contain no-repeat;
  }
  html body nav.tab-bar > button.active { color: var(--indigo) !important; background: transparent !important; }
  html body nav.tab-bar > button:nth-of-type(1) { order: 1; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(2) { order: 2; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(3) { order: 4; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z'/%3E%3Cpath d='M4 19V5'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(4) { order: 5; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
  /* Mentor: raised 52px centre button. */
  html body nav.tab-bar > button:nth-of-type(5) {
    order: 3;
    flex-basis: 64px;
    color: var(--muted) !important;
  }
  html body nav.tab-bar > button:nth-of-type(5)::before {
    top: -18px;
    width: 52px; height: 52px;
    margin-left: -26px;
    border-radius: 26px;
    background-color: var(--indigo);
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.35);
    -webkit-mask: none;
    mask: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 28px;
  }
  html body nav.tab-bar > button:nth-of-type(5).active { color: var(--indigo) !important; }

  /* More tools: small pill at the top right, opens a sheet under it. */
  html body nav.tab-bar > .more-nav {
    position: fixed;
    top: 8px;
    right: calc(max(0px, (100vw - 430px) / 2) + 20px);
    z-index: 45;
    order: 9;
    margin: 0 !important;
    width: auto;
    flex: none;
  }
  html body .more-nav > summary {
    height: 36px;
    min-height: 36px;
    padding: 0 14px !important;
    border-radius: 18px !important;
    background: #fff !important;
    border: 1px solid var(--line-2) !important;
    color: var(--ink) !important;
    font: 800 13px/1 var(--font-body) !important;
    box-shadow: none !important;
  }
  html body .more-nav[open] > div {
    position: absolute;
    top: 44px;
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 40px));
    background: #fff !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 1px solid var(--line);
    border-radius: var(--r-card-sm);
    box-shadow: 0 14px 30px rgba(18, 20, 43, 0.16);
    padding: 6px;
  }
  html body .more-nav[open] > summary { background: var(--indigo-l) !important; border-color: var(--indigo-m) !important; color: var(--indigo) !important; }
  html body .more-nav[open] > div button {
    background: transparent !important;
    min-height: 44px;
    border-radius: 10px;
    font: 700 14px var(--font-body) !important;
    color: var(--ink) !important;
  }
  html body .more-nav[open] > div button.active { background: var(--indigo-l) !important; color: var(--indigo) !important; }

  /* ---- Focus ring ---- */
  html body :focus-visible { outline: 2px solid var(--indigo) !important; outline-offset: 2px; }

}

/* Screen skins below apply on every screen size; layout tweaks for laptops live at the end of the file. */
@media all {
  /* ========================================================================
     TODAY
     ====================================================================== */
  html body .today-view { display: flex; flex-direction: column; gap: 12px; padding: 0 !important; }
  html body .today-greeting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body .mai-greet-text { flex: 1; min-width: 0; }
  html body .mai-date { margin: 0 0 2px !important; font-size: 12px; font-weight: 600; color: var(--muted); }
  html body .today-greeting h1 {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px;
    line-height: 1.15;
    color: var(--ink) !important;
  }
  html body .mai-greet-sub { display: none; }
  html body .mai-streak {
    height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    color: var(--warn);
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  html body .mai-streak .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  html body .mai-avatar {
    width: 44px; height: 44px;
    border-radius: 22px;
    background: #e0e7ff;
    color: var(--indigo);
    font-weight: 700;
    align-items: center;
    justify-content: center;
    display: inline-flex;
    flex-shrink: 0;
  }

  /* Navy hero (the existing "start" card) */
  html body .start-card.mentor-command {
    position: relative;
    overflow: hidden;
    background: var(--navy) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 24px !important;
    padding: 16px !important;
    gap: 12px;
    box-shadow: 0 14px 30px rgba(30, 27, 75, 0.28) !important;
  }
  html body .start-card.mentor-command::before,
  html body .start-card.mentor-command::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: var(--navy-2);
    inset: auto;
  }
  html body .start-card.mentor-command::before { width: 180px; height: 180px; right: -60px; top: -70px; }
  html body .start-card.mentor-command::after { width: 90px; height: 90px; right: 40px; top: 60px; background: var(--indigo-d); opacity: 0.6; }
  html body .start-card.mentor-command > * { position: relative; z-index: 1; }
  html body .start-card.mentor-command p,
  html body .start-card.mentor-command span,
  html body .start-card.mentor-command small,
  html body .start-card.mentor-command b { color: var(--indigo-m) !important; }
  html body .start-card.mentor-command h2,
  html body .start-card.mentor-command strong { color: #fff !important; font-family: var(--font-display) !important; }
  html body .start-phase { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; border: 0 !important; padding: 0 !important; margin: 0 !important; text-align: left; }
  html body .start-phase b { color: #fff !important; }
  html body .start-card .mentor-chip { background: rgba(255, 255, 255, 0.1) !important; border: 0 !important; border-radius: 12px !important; }
  html body .start-card .mentor-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px !important; }
  html body .start-card .mentor-chip .mentor-chip-mode { background: rgba(255, 255, 255, 0.16) !important; color: #fff !important; border-radius: 7px !important; padding: 3px 8px; font-size: 11px; font-weight: 800; }
  html body .start-card .mentor-chip .mentor-chip-state { color: var(--indigo-m) !important; font-size: 12px; font-weight: 600; }
  html body .start-card .mentor-truth { font-size: 13px; font-weight: 600; line-height: 1.4; margin: 0; color: #fff !important; }
  html body .start-main { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 14px; margin: 0 !important; }
  html body .start-main > div:not(.mai-ring) { flex: 1; min-width: 0; }
  html body .start-main > div p { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin: 0; color: var(--indigo-s) !important; }
  html body .start-main > div h2 { font-size: 20px !important; font-weight: 700 !important; line-height: 1.15; margin: 2px 0 0 !important; }
  html body .start-main > div span { display: block; font-size: 12px; margin-top: 4px; }
  html body .start-main > strong { flex-shrink: 0; font-size: 28px !important; font-weight: 800 !important; line-height: 1; display: flex; flex-direction: column; align-items: flex-end; }
  html body .start-main > strong small { font-size: 11px; font-weight: 600; margin: 0; }
  html body .start-card .next-action-reason {
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07) !important;
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
  }
  html body .mai-ring { position: relative; width: 84px; height: 84px; flex-shrink: 0; display: block; }
  html body .mai-ring svg { transform: rotate(-90deg); display: block; }
  html body .mai-ring circle { fill: none; stroke-width: 9; }
  html body .mai-ring .mai-ring-track { stroke: var(--indigo-d); }
  html body .mai-ring .mai-ring-fill { stroke: #fff; stroke-linecap: round; }
  html body .start-card .mai-ring b {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font: 800 22px/1 var(--font-display);
    color: #fff !important;
  }
  html body .start-card .focus-timer { background: rgba(255, 255, 255, 0.07) !important; border-radius: 12px; color: #fff !important; }
  html body .start-card .focus-timer span { color: #fff !important; }
  html body .start-actions { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px; margin: 0 !important; }
  html body .start-card .start-actions .primary-button {
    flex: 1 1 auto !important;
    width: auto !important;
    height: 48px;
    min-height: 48px;
    padding: 0 10px !important;
    border-radius: 14px;
    background: #fff !important;
    color: var(--navy-2) !important;
    border: 0 !important;
    font: 800 14px var(--font-body) !important;
    white-space: nowrap;
    box-shadow: none !important;
  }
  html body .start-card .start-actions .secondary-button {
    height: 48px;
    min-height: 48px;
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 0 14px;
    border-radius: 14px;
    background: transparent !important;
    color: #fff !important;
    border: 1px solid var(--pet) !important;
    font: 600 14px var(--font-body) !important;
  }
  html body .start-card .mentor-report p { font-size: 12px; font-weight: 600; margin: 0 0 6px; }
  html body .start-card .mentor-quick-replies { display: flex; gap: 6px; flex-wrap: wrap; }
  html body .start-card .quick-reply {
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--r-chip);
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(165, 180, 252, 0.4) !important;
    color: #fff !important;
    font: 700 13px var(--font-body) !important;
  }
  html body .start-card .first-receipt { background: rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 4px 10px; }
  html body .start-card .first-receipt summary { color: var(--indigo-m) !important; font-size: 12px; font-weight: 700; min-height: 36px; display: flex; align-items: center; }

  /* Progress cards (Today %, This week, Subjects improving): light cards, indigo bars */
  html body .sh-progress-cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 !important; }
  html body .sh-progress-card {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card-sm) !important;
    padding: 14px !important;
    box-shadow: none !important;
  }
  html body .sh-progress-card > span { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted) !important; }
  html body .sh-progress-card > strong { font: 800 26px/1.1 var(--font-display) !important; color: var(--ink) !important; }
  html body .sh-progress-card > p { font-size: 12px; color: var(--muted) !important; margin: 2px 0 8px; line-height: 1.45; }
  html body .sh-progress-card > i { display: block; height: 8px; border-radius: 4px; background: var(--line) !important; overflow: hidden; }
  html body .sh-progress-card > i::before,
  html body .sh-progress-card > i::after { background: var(--indigo) !important; border-radius: 4px; }

  /* Streak heatmap (real study data), indigo scale */
  html body .streak-panel { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: var(--r-card) !important; padding: 14px !important; box-shadow: none !important; }
  html body .streak-panel .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted) !important; }
  html body .streak-panel h3 { font: 800 15px/1.3 var(--font-display) !important; color: var(--ink) !important; margin: 2px 0 0 !important; }
  html body .streak-stats { display: flex; gap: 14px; }
  html body .streak-stats span { font-size: 11px; color: var(--muted) !important; }
  html body .streak-stats strong { display: block; font: 800 20px/1 var(--font-display) !important; color: var(--ink) !important; }
  html body .streak-grid { overflow-x: auto; }
  html body .streak-cell.level-0 { background: var(--heat0, #e4e6ef) !important; }
  html body .streak-cell.level-1 { background: #c7d2fe !important; }
  html body .streak-cell.level-2 { background: #818cf8 !important; }
  html body .streak-cell.level-3 { background: #4338ca !important; }
  html body .streak-cell.level-4 { background: #312e81 !important; }

  /* Mentor memory + nudge */
  html body .mentor-memory .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted) !important; text-transform: uppercase; }
  html body .memory-card { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: var(--r-card-sm) !important; box-shadow: none !important; }
  html body .memory-card span { color: var(--indigo) !important; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; }
  html body .mentor-nudge {
    background: var(--indigo-l) !important;
    border: 1px solid var(--indigo-m) !important;
    border-radius: var(--r-card-sm) !important;
    box-shadow: none !important;
    text-align: left;
  }
  html body .mentor-nudge span { color: var(--indigo) !important; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
  html body .mentor-nudge strong { color: var(--ink) !important; font-weight: 800; }
  html body .mentor-nudge b { color: var(--indigo) !important; }
  html body .sh-more-tools { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card-sm); }
  html body .sh-more-tools > summary { color: var(--ink) !important; font-weight: 800; }
}

@media (prefers-reduced-motion: no-preference) {
  html body .mai-ring .mai-ring-fill { transition: stroke-dashoffset 0.6s ease; }
}

/* ============================================================================
   PLAN (the "Week" tab) 
   ========================================================================== */
@media all {
  html body .adaptive-header { display: flex; flex-direction: column; gap: 4px; padding: 0 !important; margin: 0 0 12px !important; background: transparent !important; border: 0 !important; }
  html body .adaptive-header .eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted) !important; }
  html body .adaptive-header h2 { margin: 0; font: 800 24px/1.15 var(--font-display) !important; letter-spacing: -0.3px; color: var(--ink) !important; }
  html body .adaptive-header h2 + p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted) !important; }
  html body .adaptive-header .source-link { font-size: 12px; font-weight: 800; color: var(--indigo) !important; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }

  html body .roadmap-overview {
    background: var(--navy) !important;
    border: 0 !important;
    border-radius: var(--r-card) !important;
    padding: 16px !important;
    margin: 0 0 12px !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(30, 27, 75, 0.22) !important;
  }
  html body .roadmap-overview span,
  html body .roadmap-overview p,
  html body .roadmap-overview small,
  html body .roadmap-overview em { color: var(--indigo-m) !important; }
  html body .roadmap-overview strong,
  html body .roadmap-overview b { color: #fff !important; }
  html body .roadmap-overview-head b { font: 800 34px/1 var(--font-display) !important; text-align: right; }
  html body .roadmap-overview-head strong { font: 700 18px/1.2 var(--font-display) !important; }
  html body .roadmap-pacing { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: var(--r-tag); background: rgba(255, 255, 255, 0.14) !important; font-style: normal; font-size: 11px; font-weight: 800; color: #fff !important; }
  html body .roadmap-meter { height: 8px !important; border-radius: 4px !important; background: var(--navy-2) !important; }
  html body .roadmap-meter i { background: #fff !important; border-radius: 4px !important; }
  html body .roadmap-timeline { border-top: 1px solid rgba(165, 180, 252, 0.25) !important; }
  html body .roadmap-timeline > div { border-color: rgba(165, 180, 252, 0.25) !important; }
  html body .roadmap-timeline > div.active strong { color: #fff !important; }

  html body .week-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    background: transparent !important;
    border: 0 !important;
    margin: 0 0 12px !important;
  }
  html body .week-summary > span {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card-sm) !important;
    padding: 12px 8px !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--muted) !important;
    text-align: center;
    min-width: 0;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  html body .week-summary > span strong { display: block; margin-bottom: 2px; font: 800 17px/1.15 var(--font-display) !important; color: var(--ink) !important; }

  html body .week-capacity > summary { min-height: 44px; font-size: 13px; font-weight: 800; color: var(--indigo) !important; border: 0 !important; }
  html body .week-capacity > summary span { color: var(--muted) !important; font-weight: 600; }
  html body .week-settings .segmented-control,
  html body .segmented-control { background: #e9ebf2 !important; border-radius: 12px !important; padding: 4px !important; gap: 4px; }
  html body .segmented-control button { min-height: 36px; border-radius: 9px !important; background: transparent !important; color: var(--muted) !important; font: 700 13px var(--font-body) !important; border: 0 !important; box-shadow: none !important; }
  html body .segmented-control button.active { background: #fff !important; color: var(--ink) !important; box-shadow: 0 1px 3px rgba(18, 20, 43, 0.12) !important; }

  html body .week-days { display: flex; flex-direction: column; gap: 8px; }
  html body .week-day {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-left-width: 1px !important;
    border-radius: var(--r-card-sm) !important;
    box-shadow: none !important;
    overflow: hidden;
  }
  html body .week-day.today { border-color: var(--indigo-s) !important; box-shadow: 0 6px 16px rgba(67, 56, 202, 0.12) !important; }
  html body .week-day > summary { padding: 12px 14px !important; min-height: 44px; }
  html body .week-date strong { font: 800 15px/1.2 var(--font-display) !important; color: var(--ink) !important; }
  html body .week-date span { font-size: 12px; font-weight: 600; color: var(--muted) !important; }
  html body .week-focus { font-size: 12px; font-weight: 500; line-height: 1.45; color: var(--muted) !important; }
  html body .week-duration { font-size: 11px; font-weight: 800; padding: 4px 7px; border-radius: var(--r-tag); background: var(--indigo-l) !important; color: var(--indigo-d) !important; justify-self: end; align-self: start; white-space: nowrap; }
  html body .week-day.today .week-duration { background: var(--navy) !important; color: #fff !important; }
  html body .week-blocks { border-top: 1px solid var(--line); }
  html body .week-block { padding: 12px 14px !important; border-color: var(--line) !important; }
  html body .week-block-number { background: var(--indigo-l) !important; color: var(--indigo) !important; font-weight: 800; }
  html body .week-block-copy strong { font-size: 14px; font-weight: 700; color: var(--ink) !important; }
  html body .week-block-copy p,
  html body .week-block-copy span { font-size: 12px; color: var(--muted) !important; }
  html body .week-block-target { font-size: 11px; font-weight: 800; padding: 4px 7px; border-radius: var(--r-tag); background: var(--indigo-l) !important; color: var(--indigo-d) !important; width: fit-content; }

  html body .weekly-reflection { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: var(--r-card) !important; box-shadow: none !important; }
  html body .weekly-reflection .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted) !important; }
  html body .weekly-reflection h2 { font: 800 18px/1.2 var(--font-display) !important; color: var(--ink) !important; }
  html body .weekly-reflection .primary-button,
  html body .primary-button {
    min-height: 44px;
    border-radius: var(--r-btn) !important;
    background: var(--indigo) !important;
    color: #fff !important;
    border: 0 !important;
    font: 800 14px var(--font-body) !important;
    box-shadow: none !important;
  }
  html body .secondary-button { min-height: 44px; border-radius: var(--r-btn) !important; font: 700 14px var(--font-body) !important; }
  html body input, html body select, html body textarea { font-size: 16px !important; border-radius: 10px; }
}

/* Mentor pet (CSS only, decorative). Used on Today and Mentor only. */
.pet { position: relative; width: 60px; height: 62px; flex-shrink: 0; display: block; }
.pet .bd { position: absolute; left: 4px; bottom: 0; width: 52px; height: 48px; border-radius: 26px 26px 22px 22px; background: var(--pet); box-shadow: inset -6px -6px 0 rgba(30, 27, 75, 0.2); }
.pet .ey { position: absolute; top: 15px; width: 9px; height: 11px; border-radius: 5px; background: #fff; }
.pet .ey::after { content: ""; position: absolute; left: 2px; top: 3px; width: 5px; height: 6px; border-radius: 3px; background: var(--navy); }
.pet .e1 { left: 13px; }
.pet .e2 { left: 30px; }
.pet .ck { position: absolute; top: 29px; width: 8px; height: 4px; border-radius: 2px; background: var(--pet-cheek); }
.pet .k1 { left: 7px; }
.pet .k2 { left: 37px; }
.pet .mo { position: absolute; top: 28px; left: 21px; width: 10px; height: 5px; border-bottom: 2px solid var(--navy); border-radius: 0 0 6px 6px; }
.pet .sp { position: absolute; top: 0; left: 22px; width: 16px; height: 16px; }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .bob { animation: none; } }

/* ============================================================================
   MENTOR (the "Your Mentor" tab) 
   ========================================================================== */
@media all {
  html body .mentor-view { display: flex; flex-direction: column; gap: 12px; padding: 0 !important; }
  html body .mentor-topbar {
    background: var(--navy) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 24px !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 14px 30px rgba(30, 27, 75, 0.22) !important;
  }
  html body .mentor-heading { display: flex; gap: 12px; align-items: center; }
  html body .mentor-presence {
    width: 48px; height: 48px;
    border-radius: 16px !important;
    background: var(--navy-2) !important;
    display: flex; align-items: flex-end; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: transparent;
  }
  html body .mentor-presence .mai-m { display: none; }
  html body .mentor-presence .pet { transform: scale(0.72); transform-origin: 50% 100%; margin-bottom: -2px; }
  html body .mentor-topbar .eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--indigo-s) !important; }
  html body .mentor-topbar h2 { margin: 0; font: 700 17px/1.25 var(--font-display) !important; color: #fff !important; }
  html body .mentor-tools { display: flex; gap: 8px; flex-wrap: wrap; }
  html body .mentor-tools .connect-button,
  html body .mentor-tools .tool-button {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 20px !important;
    border: 0 !important;
    background: #fff !important;
    color: var(--navy) !important;
    font: 800 12px var(--font-body) !important;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: none !important;
  }
  html body .mentor-tools [hidden] { display: none !important; }
  html body .mentor-tools .connect-button span { width: 7px; height: 7px; border-radius: 4px; background: var(--indigo-s) !important; display: block; }
  html body .mentor-tools .connect-button.connected span { background: #4ade80 !important; }

  html body .mentor-briefing {
    background: var(--indigo-l) !important;
    border: 1px solid var(--indigo-m) !important;
    border-left: 1px solid var(--indigo-m) !important;
    border-radius: var(--r-card) !important;
    padding: 14px !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  html body .mentor-briefing span { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--indigo) !important; }
  html body .mentor-briefing h3 { margin: 4px 0; font: 800 17px/1.2 var(--font-display) !important; color: var(--ink) !important; }
  html body .mentor-briefing p { font-size: 13px; line-height: 1.5; color: var(--muted) !important; }

  html body .mentor-chat-panel { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; display: flex; flex-direction: column; gap: 10px; }
  html body .mentor-quick-prompts { display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; padding: 0 0 2px; scrollbar-width: none; }
  html body .mentor-quick-prompts::-webkit-scrollbar { display: none; }
  html body .mentor-quick-prompts .mode-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--r-chip) !important;
    background: #fff !important;
    border: 1px solid var(--line-2) !important;
    color: var(--ink) !important;
    font: 700 12px var(--font-body) !important;
    box-shadow: none !important;
    white-space: nowrap;
  }
  html body .mentor-chat-log { display: flex; flex-direction: column; gap: 10px; background: transparent !important; border: 0 !important; padding: 0 !important; max-height: none !important; overflow: visible !important; }
  html body .chat-message { max-width: 100%; border-radius: 16px !important; padding: 12px 14px !important; box-shadow: none !important; }
  html body .chat-message.assistant { background: #fff !important; border: 1px solid var(--line) !important; border-bottom-left-radius: 4px !important; align-self: flex-start; }
  html body .chat-message.user { background: var(--indigo) !important; border: 0 !important; color: #fff !important; border-bottom-right-radius: 4px !important; align-self: flex-end; max-width: 88%; }
  html body .chat-message.user p,
  html body .chat-message.user .chat-meta span { color: #fff !important; }
  html body .chat-message p { font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
  html body .chat-meta span { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted) !important; }
  html body .chat-meta small { margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: var(--indigo-l); color: var(--indigo) !important; font-size: 10px; font-weight: 800; }
  html body .chat-message.stale { opacity: 0.7; }
  html body .chat-message .mentor-chip { background: var(--indigo-l) !important; border: 0 !important; border-radius: 10px !important; color: var(--indigo-d) !important; }
  html body .chat-message .mentor-chip span { color: var(--indigo-d) !important; }
  html body .next-action-card { background: var(--indigo-l) !important; border: 1px solid var(--indigo-m) !important; border-radius: 14px !important; box-shadow: none !important; }
  html body .mentor-action { background: var(--ok-bg) !important; border: 1px solid var(--ok-line) !important; border-radius: 14px !important; color: var(--ok) !important; box-shadow: none !important; }
  html body .chat-message .mentor-quick-replies { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  html body .chat-message .quick-reply { min-height: 44px; padding: 0 14px; border-radius: var(--r-chip); font: 800 13px var(--font-body) !important; }
  html body .chat-message .quick-reply-done { background: var(--ok-bg) !important; border: 1px solid var(--ok-line) !important; color: var(--ok) !important; }
  html body .chat-message .quick-reply-partial { background: var(--warn-bg) !important; border: 1px solid var(--warn-line) !important; color: var(--warn) !important; }
  html body .chat-message .quick-reply-stuck { background: var(--bad-bg) !important; border: 1px solid var(--bad-line) !important; color: var(--bad) !important; }
  html body .chat-message .quick-reply-skipped { background: #fff !important; border: 1px solid var(--line-2) !important; color: var(--muted) !important; }

  /* Message bar sits just above the bottom nav while the chat scrolls. */
  html body .mentor-compose {
    position: sticky;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex !important;
    align-items: flex-end;
    gap: 8px;
    margin: 0 -20px !important;
    padding: 10px 20px !important;
    background: var(--bg) !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html body .mentor-compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 120px;
    border-radius: 22px !important;
    border: 1px solid var(--line-2) !important;
    background: #fff !important;
    padding: 11px 16px !important;
    font-size: 16px !important;
    resize: none;
  }
  html body .mentor-compose .primary-button { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; border-radius: 22px !important; font-size: 0 !important; position: relative; }
  html body .mentor-compose .primary-button::before {
    content: "";
    position: absolute; inset: 0;
    background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 22px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  }
  html body .mentor-status-line { font-size: 11px; color: var(--muted) !important; text-align: center; }
}

/* ============================================================================
   PRACTICE 
   ========================================================================== */
@media all {
  html body .practice-evidence {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: transparent !important;
    border: 0 !important;
    margin: 0 0 12px !important;
  }
  html body .practice-evidence > span {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card-sm) !important;
    padding: 12px !important;
    font-size: 12px;
    color: var(--muted) !important;
    line-height: 1.3;
  }
  html body .practice-evidence > span strong { display: block; font: 800 22px/1.1 var(--font-display) !important; color: var(--ink) !important; }

  /* Mode picker: one horizontally scrolling row of 44px chips */
  html body .practice-mode {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 6px !important;
    margin: 0 0 12px !important;
    background: transparent !important;
    border: 0 !important;
    scrollbar-width: none;
  }
  html body .practice-mode::-webkit-scrollbar { display: none; }
  html body .practice-mode button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--r-chip) !important;
    background: #fff !important;
    border: 1px solid var(--line-2) !important;
    color: var(--ink) !important;
    font: 700 13px var(--font-body) !important;
    box-shadow: none !important;
    white-space: nowrap;
  }
  html body .practice-mode button.active { background: var(--indigo) !important; border-color: var(--indigo) !important; color: #fff !important; }

  html body .practice-explainer {
    background: var(--indigo-l) !important;
    border: 1px solid var(--indigo-m) !important;
    border-left: 1px solid var(--indigo-m) !important;
    border-radius: var(--r-card-sm) !important;
    padding: 12px 14px !important;
    margin: 0 0 12px !important;
    box-shadow: none !important;
  }
  html body .practice-explainer strong { font: 800 14px/1.3 var(--font-display) !important; color: var(--indigo-d) !important; }
  html body .practice-explainer p { font-size: 13px; line-height: 1.5; color: var(--muted) !important; margin: 4px 0 0; }

  html body .practice-card {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card) !important;
    padding: 16px !important;
    box-shadow: none !important;
  }
  html body .practice-card-topline { font-size: 11px; font-weight: 800; letter-spacing: 0.4px; color: var(--muted) !important; }
  html body .practice-question h3 { font: 700 17px/1.35 var(--font-display) !important; color: var(--ink) !important; }
  html body .practice-question p { font-size: 12px; color: var(--muted) !important; }
  html body .practice-workspace textarea { font-size: 16px !important; border-radius: var(--r-btn) !important; border: 1px solid var(--line-2) !important; background: #fff !important; }
  html body .practice-timer { color: var(--ink) !important; font-weight: 800; }
  html body .answer-review-entry { background: var(--warn-bg) !important; border: 1px solid var(--warn-line) !important; border-radius: var(--r-card-sm) !important; box-shadow: none !important; }
  html body .answer-review-entry .eyebrow { color: var(--warn) !important; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
  html body .answer-review-entry h3 { font: 800 15px/1.25 var(--font-display) !important; color: var(--ink) !important; }
  html body .answer-review-entry p { color: var(--muted) !important; font-size: 12px; }
  html body .practice-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  html body .practice-actions button { min-height: 44px; border-radius: var(--r-chip) !important; font: 800 13px var(--font-body) !important; }

  html body .section-heading { margin: 8px 0 6px !important; }
  html body .section-heading .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted) !important; }
  html body .section-heading h2 { font: 800 18px/1.2 var(--font-display) !important; color: var(--ink) !important; }
  html body .repair-section,
  html body .practice-history { background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: var(--r-card) !important; padding: 14px !important; box-shadow: none !important; margin-top: 12px; }
  html body .empty-state { font-size: 13px; color: var(--muted) !important; background: transparent !important; }
}

/* ============================================================================
   PROGRESS (the "Analytics" tab) 
   ========================================================================== */
@media all {
  html body .analytics-cards { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; margin: 0 0 12px !important; }
  html body .analytics-card {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card-sm) !important;
    padding: 12px 10px !important;
    box-shadow: none !important;
    min-width: 0;
  }
  html body .analytics-card .eyebrow { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted) !important; }
  html body .analytics-card strong { display: block; margin: 4px 0 2px; font: 800 20px/1.1 var(--font-display) !important; color: var(--ink) !important; }
  html body .analytics-card small { font-size: 11px; line-height: 1.35; color: var(--muted) !important; }

  html body .analytics-block {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card) !important;
    padding: 14px !important;
    margin: 0 0 12px !important;
    box-shadow: none !important;
  }
  html body .analytics-block .section-heading { margin: 0 0 8px !important; }

  html body .analytics-readiness { display: flex; flex-direction: column; gap: 10px; }
  html body .analytics-readiness-row {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    grid-template-areas: "name bar pct" "note note note";
    gap: 4px 10px;
    align-items: center;
  }
  html body .analytics-readiness-row .analytics-subject { grid-area: name; font-size: 13px; font-weight: 700; color: var(--ink) !important; }
  html body .analytics-readiness-row .meter { grid-area: bar; height: 8px !important; border-radius: 4px !important; background: var(--line) !important; overflow: hidden; }
  html body .analytics-readiness-row .meter i,
  html body .analytics-readiness-row .meter span { background: var(--indigo) !important; border-radius: 4px !important; }
  html body .analytics-readiness-row b { grid-area: pct; font: 800 13px var(--font-body); color: var(--ink) !important; min-width: 36px; text-align: right; }
  html body .analytics-readiness-row em { grid-area: note; font-style: normal; font-size: 11px; color: var(--muted) !important; }

  html body .analytics-weak-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  html body .analytics-weak-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  html body .analytics-weak-list li:last-child { border-bottom: 0; }
  html body .analytics-weak-tag { font-size: 10px; font-weight: 800; padding: 4px 7px; border-radius: var(--r-tag); white-space: nowrap; background: var(--indigo-l) !important; color: var(--indigo-d) !important; }
  html body .analytics-weak-tag.is-weak { background: var(--warn-bg) !important; color: var(--warn) !important; border: 1px solid var(--warn-line) !important; }

  html body .analytics-movement .review-subject-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  html body .review-subject-counts { font-size: 12px; color: var(--muted) !important; }
  html body .review-movement { font-size: 10px; font-weight: 800; padding: 4px 7px; border-radius: var(--r-tag); background: var(--indigo-l) !important; color: var(--indigo-d) !important; white-space: nowrap; }
  html body .analytics-delta { font-size: 13px; line-height: 1.5; color: var(--muted) !important; }
  html body .analytics-delta.is-down { color: var(--warn) !important; }
  html body .analytics-delta.is-up { color: var(--ok) !important; }
}

/* ============================================================================
   ONBOARDING 
   ========================================================================== */
@media all {
  html body .onboarding {
    min-height: 100vh;
    align-items: flex-start;
    padding: 4px 0 calc(24px + env(safe-area-inset-bottom)) !important;
    background: var(--bg) !important;
  }
  html body .onboarding-card {
    max-width: 430px !important;
    margin: 0 auto;
    padding: 20px 18px !important;
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card) !important;
    box-shadow: none !important;
  }
  html body .onboarding-brand { margin-bottom: 16px !important; }
  html body .onboarding-brand strong { font: 800 22px/1 var(--font-display) !important; letter-spacing: -0.4px !important; text-transform: none !important; color: var(--indigo) !important; }
  html body .onboarding-brand span { color: var(--muted) !important; }
  html body .onboarding-progress { gap: 4px !important; }
  html body .onboarding-dot { height: 6px !important; border-radius: 3px !important; background: var(--line) !important; }
  html body .onboarding-dot.done { background: var(--indigo-x) !important; }
  html body .onboarding-dot.active { background: var(--indigo) !important; }
  html body .onboarding-eyebrow { font-size: 11px !important; font-weight: 800 !important; letter-spacing: 1px !important; text-transform: uppercase; color: var(--muted) !important; }
  html body .onboarding-title { font: 800 24px/1.15 var(--font-display) !important; letter-spacing: -0.3px; color: var(--ink) !important; }
  html body .onboarding-sub { font-size: 14px !important; line-height: 1.5; color: var(--muted) !important; }
  html body .onboarding-field > label { font-size: 13px !important; font-weight: 800 !important; color: var(--ink) !important; }
  html body .onboarding-field input[type="text"],
  html body .onboarding-field input[type="date"],
  html body .onboarding-field select {
    min-height: 48px;
    border: 1px solid var(--line-2) !important;
    border-radius: var(--r-btn) !important;
    background: #fff !important;
    font-size: 16px !important;
    color: var(--ink) !important;
  }
  html body .onboarding-choice-grid { gap: 8px !important; }
  html body .onboarding-choice {
    min-height: 48px !important;
    border: 1px solid var(--line-2) !important;
    border-radius: var(--r-btn) !important;
    background: #fff !important;
    color: var(--ink) !important;
    font: 700 14px var(--font-body) !important;
  }
  html body .onboarding-choice:hover { border-color: var(--indigo-x) !important; background: var(--indigo-l) !important; }
  html body .onboarding-choice.active { border-color: var(--indigo) !important; background: var(--indigo) !important; color: #fff !important; }
  html body .onboarding-summary > div { background: var(--indigo-l) !important; border-radius: var(--r-card-sm) !important; }
  html body .onboarding-summary span { color: var(--muted) !important; }
  html body .onboarding-summary strong { color: var(--ink) !important; }
  html body .onboarding-actions { gap: 8px !important; }
  html body .onboarding-next,
  html body .onboarding-back { min-height: 48px !important; border-radius: var(--r-btn) !important; font: 800 15px var(--font-body) !important; }
  html body .onboarding-next { background: var(--indigo) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }
  html body .onboarding-next:hover { background: var(--indigo-d) !important; }
  html body .onboarding-back { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; }
  html body .onboarding-back[disabled] { opacity: 0.5; }
  html body .onboarding-demo-link { min-height: 44px; color: var(--indigo) !important; font: 800 14px var(--font-body) !important; }
}

/* ============================================================================
   "MORE TOOLS" SCREENS — phone (Learn, Level check, Subjects, Review,
   Study map, How this works). Same cards, buttons and chips as above so
   nothing on a phone still wears the old green theme.
   ========================================================================== */
@media all {
  html body .learning-header .eyebrow,
  html body .review-header .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted) !important; }
  html body .learning-card,
  html body .recall-card,
  html body .baseline-row,
  html body .topic-group,
  html body .progress-card,
  html body .rule-card,
  html body .estimate-card,
  html body .score-section,
  html body .data-section,
  html body .progress-roadmap,
  html body .content-panel,
  html body .side-panel,
  html body .retention-summary,
  html body .baseline-summary {
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card) !important;
    box-shadow: none !important;
  }
  html body .learning-card h3,
  html body .recall-card h3,
  html body .rule-card h3,
  html body .progress-card h3 { font: 800 17px/1.25 var(--font-display) !important; color: var(--ink) !important; }
  html body .learning-focus,
  html body .learning-command,
  html body .revision-preview { background: var(--indigo-l) !important; border: 1px solid var(--indigo-m) !important; border-radius: var(--r-card-sm) !important; box-shadow: none !important; }
  html body .learning-card a { color: var(--indigo) !important; font-weight: 800; text-decoration: none; }
  html body .learning-card .eyebrow,
  html body .recall-card-top,
  html body .rule-card .eyebrow { color: var(--muted) !important; font-size: 11px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; }
  html body .retention-summary > * { border-color: var(--line) !important; }
  html body .retention-summary strong,
  html body .baseline-summary strong { font: 800 22px/1.1 var(--font-display) !important; color: var(--ink) !important; }
  html body .subject-switch { display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; padding: 2px 0 6px !important; background: transparent !important; border: 0 !important; scrollbar-width: none; }
  html body .subject-switch::-webkit-scrollbar { display: none; }
  html body .subject-switch button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: var(--r-chip) !important; background: #fff !important; border: 1px solid var(--line-2) !important; color: var(--ink) !important; font: 700 13px var(--font-body) !important; box-shadow: none !important; white-space: nowrap; }
  html body .subject-switch button.active { background: var(--indigo) !important; border-color: var(--indigo) !important; color: #fff !important; }
  html body .level-buttons button { min-height: 44px; border-radius: var(--r-chip) !important; border: 1px solid var(--line-2) !important; background: #fff !important; color: var(--ink) !important; font: 700 13px var(--font-body) !important; }
  html body .level-buttons button.active { background: var(--indigo) !important; border-color: var(--indigo) !important; color: #fff !important; }
  html body .official-mark { background: var(--ok-bg) !important; color: var(--ok) !important; border-radius: var(--r-tag) !important; }
  html body .progress-grid .meter,
  html body .topic-row .meter { height: 8px !important; border-radius: 4px !important; background: var(--line) !important; overflow: hidden; }
  html body .progress-grid .meter i,
  html body .progress-grid .meter span,
  html body .topic-row .meter i,
  html body .topic-row .meter span { background: var(--indigo) !important; border-radius: 4px !important; }
  html body .secondary-button { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; box-shadow: none !important; }
  html body details > summary { min-height: 44px; }
  html body .adaptive-header .eyebrow + h2 { margin-top: 0; }
}


/* ============================================================================
   LAPTOP / TABLET PASS  (>= 768px)
   Navy sidebar (224px, or a 72px icon rail from 768 to 1023) + 64px top bar.
   Uses :has() so the first-run questions keep their own centred layout.
   ========================================================================== */
html body .mai-desktop-only { display: none !important; }

@media (min-width: 768px) {
  html body .mai-desktop-only { display: flex !important; }
  html body .mai-top-title.mai-desktop-only { display: block !important; }

  html body,
  html body button,
  html body input,
  html body select,
  html body textarea { font-family: var(--font-body) !important; }
  html body h1, html body h2, html body h3,
  html body .big { font-family: var(--font-display) !important; }
  html body { background: var(--bg) !important; color: var(--ink); }
  html body :focus-visible { outline: 2px solid var(--indigo) !important; outline-offset: 2px; }

  /* ---- Shell grid ---- */
  html body #app.app-shell:has(> nav.tab-bar) {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    align-items: start;
  }
  html body #app.app-shell:has(> nav.tab-bar) > :not(header):not(nav) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 0 !important;
    padding: 18px 24px 40px !important;
    box-sizing: border-box;
    width: auto !important;
    max-width: none !important;
  }

  /* ---- Top bar ---- */
  html body .app-header {
    grid-column: 2; grid-row: 1;
    position: sticky; top: 0; z-index: 30;
    height: 64px;
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 0 24px !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html body .app-brand { display: none !important; }
  html body .mai-top-title {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px;
    color: var(--ink) !important;
    white-space: nowrap;
  }
  html body .app-vitals {
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    flex-wrap: nowrap;
    overflow: visible;
  }
  html body .app-vitals > span {
    height: 34px;
    padding: 0 12px !important;
    border-radius: var(--r-chip) !important;
    background: #fff !important;
    border: 1px solid var(--line) !important;
    color: var(--muted) !important;
    font: 700 12px/1 var(--font-body) !important;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: none !important;
  }
  html body .app-vitals > span strong { color: var(--ink) !important; font-weight: 800; }
  html body .app-vitals .ic { width: 15px; height: 15px; fill: none; stroke: var(--warn); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  html body .app-vitals .mai-top-streak { background: var(--warn-bg) !important; border-color: var(--warn-line) !important; color: var(--warn) !important; }
  html body .app-vitals .mai-top-streak strong { color: var(--warn) !important; }
  html body .app-vitals .risk.needs-push,
  html body .app-vitals .risk.needs-push strong { background: var(--pro-bg) !important; border-color: var(--warn-line) !important; color: var(--pro-ink) !important; }
  html body .app-vitals .risk.safe,
  html body .app-vitals .risk.safe strong { background: var(--ok-bg) !important; border-color: var(--ok-line) !important; color: var(--ok) !important; }
  html body .app-vitals .risk.danger,
  html body .app-vitals .risk.danger strong { background: var(--bad-bg) !important; border-color: var(--bad-line) !important; color: var(--bad) !important; }

  /* ---- Sidebar ---- */
  html body nav.tab-bar {
    grid-column: 1; grid-row: 1 / span 2;
    position: sticky !important; top: 0 !important;
    height: 100vh;
    z-index: 40;
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3px !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 20px 14px 16px !important;
    background: var(--navy) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: hidden; overflow-y: auto;
    scrollbar-width: none;
  }
  html body nav.tab-bar::-webkit-scrollbar { display: none; }
  html body nav.tab-bar::before {
    content: "Mentor.ai";
    display: block;
    flex: none;
    height: 34px;
    margin: 0 0 14px;
    padding-left: 42px;
    line-height: 34px;
    color: #fff;
    font: 800 20px/34px var(--font-display);
    letter-spacing: -0.3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='9' fill='%234338CA'/%3E%3Cpath d='M16 7l1.9 5.6L23.5 14.5l-5.6 1.9L16 22l-1.9-5.6L8.5 14.5l5.6-1.9z' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") left center / 32px 32px no-repeat;
  }
  html body nav.tab-bar > button {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%; flex: none;
    height: 42px; min-height: 42px !important;
    padding: 0 12px 0 44px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--indigo-m) !important;
    font: 700 14px/1 var(--font-body) !important;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
  }
  html body nav.tab-bar > button::before {
    content: "";
    position: absolute; left: 13px; top: 50%;
    width: 18px; height: 18px; margin-top: -9px;
    background-color: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat;
    mask: var(--ic) center / contain no-repeat;
  }
  html body nav.tab-bar > button:hover { background: rgba(255, 255, 255, 0.07) !important; color: #fff !important; }
  html body nav.tab-bar > button.active { background: var(--indigo) !important; color: #fff !important; }
  html body nav.tab-bar > button:nth-of-type(1) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(2) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(3) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z'/%3E%3Cpath d='M4 19V5'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(4) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
  html body nav.tab-bar > button:nth-of-type(5) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z'/%3E%3C/svg%3E"); }

  /* MORE section: always open on laptop. */
  html body nav.tab-bar > .more-nav {
    position: static !important;
    margin: 6px 0 0 !important;
    width: 100% !important; min-width: 0 !important; flex: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html body .more-nav > summary,
  html body .more-nav[open] > summary {
    display: block;
    width: 100%; box-sizing: border-box;
    height: auto; min-height: 0;
    padding: 12px 12px 4px !important;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--indigo-x) !important;
    font: 800 10px/1 var(--font-body) !important;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    list-style: none;
    pointer-events: none;
    cursor: default;
  }
  html body .more-nav > summary::-webkit-details-marker { display: none; }
  html body .more-nav > summary::after { display: none !important; }
  html body .more-nav[open] > div {
    position: static !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important; box-sizing: border-box;
    display: flex; flex-direction: column; gap: 1px;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  html body .more-nav[open] > div button {
    display: block; width: 100%;
    height: 34px; min-height: 34px;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    color: var(--indigo-s) !important;
    font: 600 13px/1 var(--font-body) !important;
    text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html body .more-nav[open] > div button:hover { background: rgba(255, 255, 255, 0.07) !important; color: #fff !important; }
  html body .more-nav[open] > div button.active { background: rgba(99, 102, 241, 0.35) !important; color: #fff !important; }

  /* Pet card + profile row at the bottom of the sidebar. */
  html body .mai-side-foot {
    margin-top: auto;
    min-width: 0; width: 100%; box-sizing: border-box;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
  }
  html body .mai-side-pet {
    display: flex; align-items: flex-end; gap: 6px;
    padding: 10px 6px 8px 10px;
    min-width: 0; box-sizing: border-box;
    border-radius: 16px;
    background: var(--navy-2);
  }
  html body .mai-side-pet p {
    margin: 0 0 6px; flex: 1; min-width: 0;
    padding: 8px 10px;
    border-radius: 12px 12px 12px 4px;
    background: #fff;
    color: var(--ink);
    font: 700 12px/1.35 var(--font-body);
  }
  html body .mai-side-pet .pet { transform-origin: bottom center; }
  html body .mai-side-me { display: flex; align-items: center; gap: 10px; padding: 0 4px; color: #fff; min-width: 0; }
  html body .mai-side-me > span:last-child { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
  html body .mai-side-me strong { font: 800 13px/1.1 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body .mai-side-me small { font: 600 11px/1.1 var(--font-body); color: var(--indigo-s); }
  html body .mai-avatar-lg {
    flex: none; width: 36px; height: 36px; border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--indigo); color: #fff; font: 800 15px var(--font-display);
  }
}

/* ---- Icon rail: 768 to 1023 ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  html body nav.tab-bar { padding: 16px 10px !important; align-items: center; }
  html body nav.tab-bar::before { width: 32px; margin: 0 0 12px; background-position: center; padding-left: 0; font-size: 0; overflow: hidden; }
  html body nav.tab-bar > button { width: 44px; padding: 0 !important; font-size: 0 !important; justify-content: center; }
  html body nav.tab-bar > button::before { left: 13px; }
  html body nav.tab-bar > .more-nav,
  html body .mai-side-foot { display: none !important; }
  html body .mai-top-streak { display: none !important; }
}

/* ---- Full sidebar from 1024 ---- */
@media (min-width: 1024px) {
  html body #app.app-shell:has(> nav.tab-bar) { grid-template-columns: 224px minmax(0, 1fr); }
  html body .app-header { padding: 0 28px !important; }
}


/* ============================================================================
   LAPTOP LAYOUT (>= 1024px): screens fill the width with a main column and a
   300px side column, as in the Desktop* designs.
   ========================================================================== */
@media (min-width: 768px) {
  html body .mai-greet-sub { display: block; margin: 2px 0 0; font-size: 13px; color: var(--muted) !important; }
  html body .today-greeting h1 { font-size: 26px !important; }
  html body .mentor-compose { position: static; margin: 0 !important; bottom: auto; }
  html body .onboarding-card { max-width: 560px !important; }
}

@media (min-width: 1024px) {
  html body .today-view {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 14px;
    row-gap: 14px;
    align-items: start;
  }
  html body .today-view > * { min-width: 0; margin: 0 !important; }
  html body .today-view > .today-greeting,
  html body .today-view > .start-card,
  html body .today-view > .sh-more-tools { grid-column: 1 / -1; }
  html body .today-view > .mai-today-cols { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
  html body .sh-progress-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body .start-card.mentor-command { padding: 22px 24px !important; gap: 14px; }
  html body .start-card.mentor-command::before { width: 260px; height: 260px; right: -70px; top: -110px; }
  html body .start-card.mentor-command::after { width: 120px; height: 120px; right: 150px; top: 90px; }
  html body .mai-ring { width: 120px; height: 120px; }
  html body .mai-ring svg { width: 120px; height: 120px; }
  html body .start-card .mai-ring b { font-size: 30px; }
  html body .start-main { gap: 22px; }
  html body .start-main > div h2 { font-size: 32px !important; }
  html body .start-main > strong { font-size: 40px !important; }
  html body .start-card .start-actions .primary-button { flex: 0 0 auto !important; padding: 0 22px !important; }
  html body .start-card .mentor-quick-replies { flex-wrap: nowrap; }
  html body .start-card .mentor-quick-replies .quick-reply { flex: 1; }
  html body .mentor-memory .memory-grid { display: flex !important; flex-direction: column; gap: 8px; }
}

@media (min-width: 768px) {
  html body .start-card .quick-reply-done { background: #6ee7a0 !important; border-color: #6ee7a0 !important; color: #14532d !important; }
  html body .start-card .quick-reply-partial { background: #fed7aa !important; border-color: #fed7aa !important; color: #7c2d12 !important; }
  html body .start-card .quick-reply-stuck { background: #fbcfe8 !important; border-color: #fbcfe8 !important; color: #831843 !important; }
  html body .start-card .quick-reply-skipped { background: transparent !important; border: 1px solid var(--indigo-s) !important; color: #fff !important; }
}

html body .mai-today-cols,
html body .mai-today-main,
html body .mai-today-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
html body .mai-today-main > *, html body .mai-today-side > * { margin: 0 !important; }
@media (min-width: 1024px) {
  html body .mai-today-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
}

/* Study grid fills its card on larger screens (same 12 weeks of real data). */
@media (min-width: 768px) {
  html body .streak-grid { overflow: visible; }
  html body .streak-columns { flex: 1; gap: 4px; }
  html body .streak-col { flex: 1; gap: 4px; }
  html body .streak-cell { width: 100%; height: 22px; border-radius: 5px; }
  html body .streak-weekdays { gap: 4px; }
  html body .streak-weekdays span { height: 22px; line-height: 22px; }
}

/* ---- PLAN on laptop ---- */
@media (min-width: 768px) {
  html body .adaptive-header { flex-direction: row !important; align-items: flex-end; justify-content: space-between; gap: 16px; }
  html body .adaptive-header > div { max-width: 720px; text-align: left; }
  html body .adaptive-header h2 { font-size: 26px !important; }
}
@media (min-width: 1024px) {
  html body section.adaptive-view:has(> .week-days) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: 14px;
    align-items: start;
  }
  html body section.adaptive-view:has(> .week-days) > * { min-width: 0; }
  html body section.adaptive-view:has(> .week-days) > .adaptive-header { grid-column: 1 / -1; }
  html body section.adaptive-view:has(> .week-days) > .roadmap-overview { grid-column: 1; grid-row: 2; }
  html body section.adaptive-view:has(> .week-days) > .week-summary { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; margin: 0 0 12px !important; align-self: stretch; }
  html body section.adaptive-view:has(> .week-days) > .week-summary > span { display: flex; flex-direction: column; justify-content: center; text-align: left; padding: 10px 14px !important; }
  html body section.adaptive-view:has(> .week-days) > .week-capacity { grid-column: 1; grid-row: 3; }
  html body section.adaptive-view:has(> .week-days) > .week-days { grid-column: 1; grid-row: 4; }
  html body section.adaptive-view:has(> .week-days) > .weekly-reflection { grid-column: 2; grid-row: 3 / span 2; position: sticky; top: 82px; }
}
@media (min-width: 1024px) {
  html body section.adaptive-view:has(> .week-days) { grid-template-rows: auto auto auto 1fr; }
  html body .weekly-reflection { padding: 16px !important; }
  html body .weekly-reflection-summary { display: flex !important; flex-direction: column; gap: 10px; }
  html body .weekly-reflection-summary > div:last-child { text-align: left; }
  html body .weekly-reflection h2 { font-size: 17px !important; }
  html body .weekly-reflection-summary strong { font: 800 28px/1 var(--font-display) !important; color: var(--indigo) !important; }
  html body .review-block { background: var(--indigo-l); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
  html body .review-block strong { color: var(--ink) !important; }
}
html body .review-subject-row { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
html body .review-subject-row > * { position: static !important; }

/* ---- PROGRESS on laptop ---- */
@media (min-width: 1024px) {
  html body section.analytics-view {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    grid-auto-flow: dense;
  }
  html body section.analytics-view > * { min-width: 0; margin: 0 !important; }
  html body section.analytics-view > .adaptive-header { grid-column: 1; grid-row: 1; }
  html body section.analytics-view > .streak-panel { grid-column: 2; grid-row: 1 / span 2; }
  html body section.analytics-view > .analytics-cards { grid-column: 1; grid-row: 2; }
  html body .analytics-view .adaptive-header { flex-direction: column !important; align-items: flex-start; }
  html body .analytics-view .practice-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}

/* ---- MENTOR on laptop: context on the left, chat on the right ---- */
@media (min-width: 1024px) {
  html body .mentor-view {
    display: grid !important;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 14px;
    align-items: start;
  }
  html body .mentor-view > .mentor-topbar { grid-column: 1; grid-row: 1; }
  html body .mentor-view > .mentor-briefing { grid-column: 1; grid-row: 2; align-self: start; }
  html body .mentor-view > .mentor-chat-panel {
    grid-column: 2; grid-row: 1 / span 2;
    height: calc(100vh - 64px - 58px);
    min-height: 480px;
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-card) !important;
    padding: 14px !important;
    box-sizing: border-box;
    min-width: 0;
  }
  html body .mentor-view .mentor-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; }
  html body .mentor-view .mentor-compose { flex: none; border-top: 1px solid var(--line) !important; background: transparent !important; padding: 10px 0 0 !important; }
  html body .mentor-view .mentor-quick-prompts { flex: none; flex-wrap: wrap !important; overflow: visible; }
  html body .mentor-view .mentor-status-line { flex: none; margin: 0; }
}

/* ---- First-run questions on laptop: navy rail on the left, form on the right ---- */
@media (min-width: 1024px) {
  html body .onboarding {
    position: relative;
    display: grid !important;
    grid-template-columns: 38% minmax(0, 1fr);
    grid-template-rows: minmax(100vh, auto);
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: var(--bg) !important;
  }
  html body .onboarding::before { content: "" !important; display: block !important; position: static !important; inset: auto !important; width: auto !important; height: auto !important; opacity: 1 !important; transform: none !important; grid-column: 1; grid-row: 1; align-self: stretch !important; background: var(--navy) !important; border-radius: 0 !important; }
  html body .onboarding::after {
    content: "Plan your last months. One clear step each day.";
    position: absolute; left: 48px; bottom: 72px;
    width: calc(38% - 96px);
    color: #fff;
    font: 800 34px/1.15 var(--font-display);
    letter-spacing: -0.4px;
  }
  html body .onboarding-card {
    position: static !important;
    grid-column: 2; grid-row: 1;
    align-self: center; justify-self: center;
    width: min(560px, calc(100% - 64px));
    max-width: none !important;
    margin: 0 !important;
  }
  html body .onboarding-brand { position: absolute; left: 48px; top: 44px; margin: 0 !important; z-index: 2; }
  html body .onboarding-brand strong { color: #fff !important; font-size: 26px !important; }
  html body .onboarding-brand span { display: block; margin-top: 4px; color: var(--indigo-m) !important; }
}
@media (min-width: 1024px) {
  html body #app.app-shell:not(:has(> nav.tab-bar)) { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
}

/* Sample student view: a plain, always-visible label above the app (outside the shell grid). */
#sample-view-banner:empty { display: none; }
.sample-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 8px auto 0;
  padding: 10px 16px;
  max-width: 1100px;
  box-sizing: border-box;
  border: 1px solid var(--warn-line);
  border-radius: var(--r-card-sm);
  background: var(--warn-bg);
  color: var(--pro-ink);
  font-family: var(--font-body);
  font-size: 14px;
}
.sample-banner p { margin: 0; }
.sample-banner strong { margin-right: 6px; }
.sample-banner button {
  padding: 8px 14px;
  border: 1px solid var(--warn-line);
  border-radius: var(--r-btn);
  background: #fff;
  color: var(--pro-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 767px) {
  .sample-banner { max-width: 430px; margin: 8px auto 0; width: calc(100% - 40px); font-size: 13px; }
}

/* Static placeholder inside #app until the first render replaces it. */
.app-loading { margin: 48px auto; padding: 0 20px; max-width: 430px; text-align: center; color: var(--muted); font-family: var(--font-body); }
