/* "Recreo": the shared look (docs/design/DESIGN.md). Loaded last; colours come from tokens.css.
   Selectors start with :root:root so they win over styles.css and reference.css without !important. */

/* ---------------------------------------------------------------- Type */
:root:root body { font-weight: 500; }
:root:root :where(h1, h2, h3, h4) { font-family: var(--cp-font-heading); font-weight: 700; letter-spacing: 0; }
:root:root :where(.streak-number strong, .ring-value, .report-score, .inventory-stats strong, .goal-value, .milestone-count, .timer) { font-family: var(--cp-font-display); font-weight: 400; letter-spacing: 0; }
:root:root :focus-visible { outline: 4px solid var(--cp-text); outline-offset: 3px; }

/* ---------------------------------------------------------------- Mascot */
.nubi { display: block; flex: none; overflow: visible; }
.nubi-body { fill: var(--tinta-white); stroke: var(--tinta-ink); stroke-width: 7; stroke-linejoin: round; }
.nubi-ink { fill: var(--tinta-ink); }
.nubi-line { fill: none; stroke: var(--tinta-ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.nubi-mouth { fill: var(--tinta-accent); stroke: var(--tinta-ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.nubi-cheek { fill: var(--tinta-highlight); }
.nubi-ground { fill: var(--tinta-ink); opacity: .25; }
.nubi-bob { animation: nubi-bob 3.2s ease-in-out infinite; }
.nubi-eyes { transform-box: fill-box; transform-origin: center; animation: nubi-blink 4s infinite; }
@keyframes nubi-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes nubi-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
:root:root .logo { width: 46px; height: 37px; border-radius: 0; background: none; box-shadow: none; }
.logo .nubi { width: 46px; height: 37px; }
.logo .nubi-body { stroke-width: 8; }
.logo :is(.nubi-cheek, .nubi-ground) { display: none; }
:root:root .brand { gap: 10px; text-decoration: none; }
:root:root .brand b { font-family: var(--cp-font-display); font-weight: 400; font-size: 1.3rem; line-height: 1; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }

/* ---------------------------------------------------------------- Buttons: outlined, with a hard shadow that presses down */
:root:root :where(button, .button-link, .secondary-link, .secondary-button, .domain-actions a):where(:not(.inline-button, .text-button, .account-logout, .settings-tab, .site-menu, .mobile-nav, .send-button, .icon-button)) {
  border: 3px solid var(--cp-border); border-radius: 14px; font-family: var(--cp-font-heading); font-weight: 600;
  box-shadow: 0 4px 0 var(--cp-hard); transition: transform .08s ease, box-shadow .08s ease;
}
/* No lift on hover: a button that moves under the pointer can flicker at its edge. It only presses down. */
:root:root :where(button, .button-link, .secondary-link, .secondary-button, .domain-actions a):where(:not(.inline-button, .text-button, .account-logout, .settings-tab, .site-menu, .mobile-nav, .send-button, .icon-button)):active:where(:not(:disabled, [aria-disabled="true"])) { transform: translateY(4px); box-shadow: 0 0 0 var(--cp-hard); }
:root:root :where(button:disabled, [aria-disabled="true"]) { box-shadow: none; }
:root:root :is(button.primary, .button-link),
:root:root :is(button.primary, .button-link):hover:not(:disabled) { background: var(--cp-cta-bg); color: var(--cp-cta-fg); border-color: var(--cp-border); box-shadow: 0 5px 0 var(--cp-hard); font-weight: 700; }
:root:root :is(button.primary, .button-link):active:not(:disabled) { box-shadow: 0 0 0 var(--cp-hard); }
:root:root .button-link { text-decoration: none; }

/* ---------------------------------------------------------------- Cards: thick outline, hard shadow */
:root:root :where(.mock-panel, .next-step, .exam-card, .inventory-stats > div, .path-steps > article, .recommendation, .home-overview .metric,
  .dashboard-strip, .practice-ring-card, .momentum-card, .week-activity, .dashboard-weak, .roadmap, .goal-tile, .tour-card, .cert-item,
  .community-block, .admin-pool-fill, .landing .cards article, .mistake, .case-study, .catalogue-group) {
  border: 3px solid var(--cp-border); border-radius: 22px; box-shadow: var(--cp-shadow);
}
:root:root :where(.catalogue-card, .settings-links a, .settings-link, .tree-exam, .memory-note, .memory-context, .interview-option, .order-item, .week-session) {
  border: 3px solid var(--cp-border); border-radius: 18px; box-shadow: none;
}
:root:root dialog { border: 4px solid var(--cp-border); border-radius: 24px; box-shadow: 8px 8px 0 var(--cp-hard); }
:root:root :where(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):where(:not(.pill-select select, .compose-row *)) {
  border: 3px solid var(--cp-border); border-radius: 14px; font-weight: 700;
}
:root:root :where(.pill-select, .roadmap-chip, .session-pill, .exam-tag, .account-row, .compose-row) { border-width: 3px; }

/* ---------------------------------------------------------------- Top bar (wider than a phone): the sidebar element laid out as a bar */
@media (min-width: 801px) {
  :root:root body.with-shell { padding-left: 0; padding-top: 60px; }
  :root:root .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
  :root:root :is(.site-sidebar, .app > .sidebar) {
    flex-direction: row; align-items: center; gap: 8px 20px; height: 60px; padding: 0 24px; overflow: visible;
    border: 0; border-bottom: 4px solid var(--cp-border); background: var(--cp-bg-elevated);
  }
  :root:root .site-sidebar { position: fixed; inset: 0 0 auto 0; width: auto; }
  :root:root .sidebar > .brand { margin: 0; padding: 0; min-height: 48px; }
  :root:root .sidebar > .primary-nav { display: flex; flex-direction: row; gap: 6px; flex: 1 1 auto; min-width: 0; }
  :root:root .sidebar .primary-nav a { min-height: 44px; padding: 0 16px; gap: 8px; border: 3px solid transparent; border-radius: 999px;
    font-family: var(--cp-font-heading); font-weight: 600; font-size: 1rem; color: var(--cp-text); white-space: nowrap; box-shadow: none; }
  :root:root .sidebar .primary-nav a:hover { background: var(--cp-accent-soft); color: var(--cp-text); }
  :root:root .sidebar .primary-nav a[aria-current] { background: var(--cp-cta-bg); color: var(--cp-cta-fg); border-color: var(--cp-border); }
  :root:root .sidebar .primary-nav a[aria-current] .ui-icon { color: inherit; }
  :root:root .primary-nav a[aria-current]::before { display: none; }
  :root:root .shell-bottom { flex-direction: row; align-items: center; gap: 10px; margin: 0 0 0 auto; padding: 0; border: 0; flex: none; }
  :root:root .shell-bottom .selected-path { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  :root:root .shell-bottom .exam-pill { width: 132px; min-height: 44px; border-radius: 999px; background: var(--cp-surface); }
  :root:root .shell-bottom .primary-nav { display: flex; flex-direction: row; align-items: center; gap: 10px; }
  /* Settings and admin become round icon buttons; their text stays for screen readers. */
  :root:root .shell-bottom .primary-nav > a { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; gap: 0; font-size: 0;
    border: 3px solid var(--cp-border); border-radius: 50%; background: var(--cp-surface); box-shadow: 0 4px 0 var(--cp-hard); }
  :root:root .shell-bottom .primary-nav > a .ui-icon { width: 22px; height: 22px; }
  :root:root .shell-bottom .account-row { min-height: 48px; padding: 0 6px 0 0; gap: 4px; border-radius: 999px; background: var(--cp-surface); box-shadow: 0 4px 0 var(--cp-hard); }
  :root:root .shell-bottom .account-row .account-card { width: auto; height: auto; min-height: 42px; padding: 0 8px 0 4px; gap: 8px; font-size: 1rem; border: 0; border-radius: 999px; background: none; box-shadow: none; }
  :root:root .shell-bottom .account-row .account-sub { display: none; }
  :root:root .shell-bottom .account-row .account-name { max-width: 110px; font-size: .95rem; }
  :root:root .account-avatar { width: 36px; height: 36px; background: var(--cp-accent-soft); color: var(--cp-text); border: 3px solid var(--cp-border); font-family: var(--cp-font-heading); font-weight: 700; }
  :root:root .primary-nav a.account-card > .account-avatar { width: 36px; height: 36px; font-size: 1rem; }
  :root:root .account-signin, :root:root .primary-nav a.account-signin { min-height: 36px; padding: 0 12px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-cta-bg); color: var(--cp-cta-fg); font-size: .9rem; font-weight: 700; }
  :root:root .app .topbar { min-height: 48px; padding: 2px 20px; }
  /* The conversation list sits beside the chat from tablet width up; it no longer shares the bar. */
  :root:root .main { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); }
  :root:root .thread-panel { display: flex; grid-column: 1; grid-row: 1 / 5; border-right: 4px solid var(--cp-border); }
  :root:root .main > :is(.topbar, .study-toolbar, .status-bar, .workspace) { grid-column: 2; }
  :root:root .main > .topbar { grid-row: 1; }
  :root:root .main > .study-toolbar { grid-row: 2; }
  :root:root .main > .status-bar { grid-row: 3; }
  :root:root .main > .workspace { grid-row: 4; }
}
@media (min-width: 801px) and (max-width: 1100px) {
  :root:root .sidebar > .primary-nav .ui-icon { display: none; }
  :root:root .sidebar .primary-nav a { padding: 0 11px; font-size: .95rem; }
  :root:root .brand b { font-size: 1.05rem; }
  :root:root .shell-bottom .exam-pill { width: 104px; }
  :root:root .shell-bottom .account-row .account-name { display: none; }
  :root:root .main { grid-template-columns: 210px minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- Phone: drawer and bottom bar keep their behaviour */
@media (max-width: 800px) {
  :root:root :is(.sidebar, .site-sidebar) { border-right: 4px solid var(--cp-border); }
  :root:root .bottom-nav { border-top: 4px solid var(--cp-border); }
  :root:root .bottom-nav a { font-family: var(--cp-font-heading); font-weight: 600; }
  :root:root .bottom-nav a[aria-current]::before { height: 6px; top: -4px; width: 44px; border-radius: 0 0 6px 6px; background: var(--cp-cta-bg); border: 2px solid var(--cp-border); border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nubi-bob, .nubi-eyes { animation: none; }
  :root:root :where(button, .button-link, .secondary-link, .secondary-button, .domain-actions a) { transition: none; }
}

/* Headings focused by the router for screen readers do not need a visible ring. */
:root:root [tabindex="-1"]:focus-visible { outline: none; }

/* ---------------------------------------------------------------- Hero blocks (landing and home): one deep block, light text, Nubi */
:root:root :is(.landing .hero, .home-intro) {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 32px;
  max-width: none; margin: 0 0 28px; padding: 40px; text-align: left; overflow: hidden;
  background: var(--cp-hero-bg); color: var(--cp-hero-fg);
  border: 4px solid var(--cp-border); border-radius: 28px; box-shadow: 8px 8px 0 var(--cp-hard);
}
:root:root :is(.landing .hero, .home-intro) :is(h1, h2, p, .small) { color: var(--cp-hero-fg); }
:root:root .landing .hero > :not(.nubi-spot) { grid-column: 1; margin-inline: 0; }
:root:root .landing .hero > .nubi-spot { grid-column: 2; grid-row: 1 / span 6; }
:root:root .landing .hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1; letter-spacing: 0; font-weight: 700; margin: 8px 0; }
:root:root .landing .hero h1 span:last-of-type { display: inline-block; margin-top: 8px; padding: 0 12px; background: var(--cp-cta-bg); color: var(--cp-cta-fg);
  border: 4px solid var(--tinta-ink); border-radius: 14px; transform: rotate(-2deg); }
:root:root .landing .hero > p:not(.eyebrow, .small) { font-size: 1.25rem; font-weight: 700; max-width: 32em; }
:root:root .landing .hero .eyebrow { justify-self: start; border: 3px solid var(--tinta-ink); background: var(--tinta-soft); color: var(--tinta-ink); font-weight: 800; }
:root:root :is(.landing .hero, #authModal, #guestWelcome) [hidden] { display: none; }
:root:root .hero-actions { justify-content: flex-start; flex-wrap: wrap; margin: 16px 0 8px; }
:root:root :is(.landing .hero, .home-intro) .button-link { min-height: 56px; padding: 0 28px; font-family: var(--cp-font-display); font-weight: 400; font-size: 1.15rem; text-transform: uppercase;
  border-color: var(--tinta-ink); box-shadow: 0 6px 0 var(--tinta-ink); }
:root:root :is(.landing .hero, .home-intro) .secondary-link { min-height: 56px; display: inline-flex; align-items: center; padding: 0 22px; background: var(--tinta-white); color: var(--tinta-ink);
  border: 3px solid var(--tinta-ink); border-radius: 14px; box-shadow: 0 5px 0 var(--tinta-ink); text-decoration: none; font-weight: 700; }
/* Three roots: the shared hero rule above carries the weight of ".landing .hero". */
:root:root:root .home-intro { padding: 28px 32px; grid-template-columns: auto minmax(0, 1fr) auto; }
:root:root .home-intro h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; letter-spacing: 0; }
:root:root .home-intro p { font-weight: 700; font-size: 1.1rem; }
:root:root .home-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.nubi-spot { display: flex; justify-content: center; align-items: flex-end; }

/* ---------------------------------------------------------------- Landing tiles */
:root:root .landing { max-width: 1180px; }
:root:root .inventory-stats > div { padding: 22px; background: var(--cp-surface); }
:root:root .inventory-stats > div:nth-child(1) { background: var(--tinta-accent); }
:root:root .inventory-stats > div:nth-child(3) { background: var(--tinta-soft); }
:root:root .inventory-stats > div:is(:nth-child(1), :nth-child(3)) :is(strong, span) { color: var(--tinta-ink); }
:root:root .inventory-stats strong { font-family: var(--cp-font-display); font-size: 3.4rem; line-height: 1; }
:root:root .inventory-stats span { font-weight: 800; font-size: 1rem; }
:root:root .landing .cards h2 { font-size: 1.4rem; }
:root:root .landing .cards p { font-size: .95rem; font-weight: 700; color: var(--cp-text); }
:root:root .landing .cards article:nth-child(2) { background: var(--cp-surface-soft); }

/* ---------------------------------------------------------------- Home as a board of tiles (Tablero) */
:root:root :is(.reports, .explore-page) { max-width: 1180px; }
:root:root .home-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
:root:root .home-overview > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
:root:root .home-overview > [hidden] { display: none; }
@media (min-width: 981px) {
  :root:root .home-overview:has(> .week-plan:not([hidden])) > .next-step:not(.week-plan),
  :root:root .home-overview:has(> .week-plan:not([hidden])) > .week-activity { grid-column: 1; }
  :root:root .home-overview:has(> .week-plan:not([hidden])) > .week-plan { grid-column: 2; grid-row: span 2; align-self: stretch; }
}
:root:root .readiness-row { margin: 0; }
/* The streak tile: accent fill, dark text in both themes. */
:root:root .week-activity { background: var(--tinta-accent); }
:root:root .week-activity, :root:root .week-activity :where(p, span, h3, strong, li, a, small) { color: var(--tinta-ink); }
:root:root .week-activity { border-color: var(--tinta-ink); }
:root:root .streak-number strong { font-size: 4.2rem; line-height: .9; }
:root:root .recommendation:first-child { background: var(--cp-surface-soft); }
:root:root .next-step { background: var(--cp-surface); }

/* ---------------------------------------------------------------- Sign-in dialog */
:root:root dialog::backdrop { background: var(--cp-overlay); backdrop-filter: none; }
:root:root #authModal { overflow: visible; }
:root:root #authModal > .nubi-spot { margin: -92px 0 4px; }
:root:root #authModal h2 { text-align: center; font-size: 2rem; }

@media (max-width: 800px) {
  :root:root:root :is(.landing .hero, .home-intro) { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; box-shadow: 5px 5px 0 var(--cp-hard); }
  :root:root .landing .hero > .nubi-spot { grid-column: 1; grid-row: auto; order: -1; }
  :root:root .landing .hero > .nubi-spot .nubi, :root:root .home-intro > .nubi-spot .nubi { width: 130px; height: auto; }
  :root:root .home-overview { grid-template-columns: minmax(0, 1fr); }
  :root:root .home-actions { align-items: stretch; }
}

/* Big numbers and the highlighted headline word scale with the screen so they never widen a phone page. */
:root:root .inventory-stats > div { min-width: 0; }
:root:root .inventory-stats strong { font-size: clamp(1.5rem, 8vw, 3.4rem); }
:root:root .inventory-stats span { overflow-wrap: anywhere; }
:root:root .landing .hero h1 { overflow-wrap: anywhere; }
:root:root .landing .hero h1 span:last-of-type { max-width: 100%; }
@media (max-width: 800px) {
  :root:root .inventory-stats > div { padding: 12px 6px; box-shadow: 3px 3px 0 var(--cp-hard); }
  :root:root .inventory-stats span { font-size: .75rem; }
  :root:root .landing .hero h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  :root:root :is(.landing .hero, .home-intro) .button-link { font-size: 1rem; padding: 0 18px; white-space: normal; text-align: center; }
}

/* ================================================================ Practice: exam list, mock exam, report, mistake notebook */
:root:root progress { appearance: none; -webkit-appearance: none; height: 18px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-bg); overflow: hidden; }
:root:root progress::-webkit-progress-bar { background: var(--cp-bg); }
:root:root progress::-webkit-progress-value { background: var(--cp-accent); border-radius: 0; }
:root:root progress::-moz-progress-bar { background: var(--cp-accent); border-radius: 0; }
:root:root :where(.evidence-bar, .goal-bar) { height: 16px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-bg); overflow: hidden; }
:root:root .roadmap-chip { font-family: var(--cp-font-heading); font-weight: 600; box-shadow: 0 3px 0 var(--cp-hard); }
:root:root .roadmap-chip[aria-pressed="true"] { background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--cp-border); }
:root:root .catalogue-card h3 { font-family: var(--cp-font-display); font-weight: 400; font-size: 1.15rem; }
:root:root .catalogue-card .inventory-count { font-family: var(--cp-font-body); font-weight: 700; }
:root:root .exam-search input { min-height: 52px; border-radius: 999px; }

:root:root .mock-panel { max-width: 860px; border-width: 4px; border-radius: 26px; box-shadow: 8px 8px 0 var(--cp-hard); }
:root:root .mock-meta { border-bottom: 3px dashed var(--cp-border); font-weight: 700; }
:root:root .timer { padding: 6px 16px; border: 3px solid var(--tinta-ink); background: var(--tinta-highlight); color: var(--tinta-ink); font-family: var(--cp-font-display); font-size: 1rem; }
:root:root .mock-question legend { font-size: 1.35rem; font-weight: 600; line-height: 1.35; }
:root:root .mock-option { padding: 16px 18px; border: 3px solid var(--cp-border); border-radius: 18px; background: var(--cp-surface); font-size: 1.05rem; font-weight: 700;
  box-shadow: 0 5px 0 var(--cp-hard); cursor: pointer; transition: transform .08s ease, box-shadow .08s ease, background .15s ease; }
:root:root .mock-option:hover { background: var(--cp-accent-soft); }
:root:root .mock-option:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cp-hard); }
:root:root .mock-option:has(input:checked) { background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--tinta-ink); }
:root:root .mock-option input { width: 22px; height: 22px; accent-color: var(--tinta-ink); }
:root:root .mock-details { border: 3px solid var(--cp-border); border-radius: 16px; }
/* Answer feedback: a full outlined panel instead of a coloured side stripe. */
:root:root .feedback { padding: 20px; border: 3px solid var(--cp-border); border-radius: 20px; background: var(--cp-surface-soft); }
:root:root .report-score { font-size: clamp(3rem, 9vw, 5rem); line-height: 1; }
:root:root .mock-domain-bars h4 { font-size: 1rem; }
:root:root .mistake { padding: 22px; }
:root:root .mistake-options li { border-width: 3px; border-radius: 14px; font-weight: 700; }
:root:root .mistake-meta .pill { border-width: 3px; font-weight: 800; }
:root:root .exam-nav-item { border-width: 3px; border-radius: 12px; font-family: var(--cp-font-display); }
:root:root :where(.exam-nav-item.is-answered) { background: var(--cp-accent-soft); }
@media (prefers-reduced-motion: reduce) { :root:root .mock-option { transition: none; } }

/* ================================================================ Tutor (chat) */
:root:root .welcome { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: center; max-width: 760px; }
:root:root .welcome > :not(.nubi-spot) { grid-column: 2; }
:root:root .welcome > .nubi-spot { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
:root:root .welcome h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: 0; }
:root:root .welcome .eyebrow { display: none; }
:root:root .msg { border: 3px solid var(--cp-border); font-size: 1rem; font-weight: 600; box-shadow: 4px 4px 0 var(--cp-hard); }
:root:root .msg.bot { border-radius: 22px 22px 22px 6px; background: var(--cp-surface); }
:root:root .msg.user { border-radius: 22px 22px 6px 22px; background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--tinta-ink); }
:root:root .msg.user .msg-label { color: var(--tinta-ink); }
:root:root .thread-panel #newChat { min-height: 48px; background: var(--cp-cta-bg); color: var(--cp-cta-fg); border-color: var(--cp-border); font-size: 1rem; }
:root:root .convo { border-width: 3px; border-radius: 16px; }
:root:root .convo.active { background: var(--cp-accent-soft); box-shadow: 4px 4px 0 var(--cp-hard); }
:root:root .compose-row { border-radius: 22px; box-shadow: 0 5px 0 var(--cp-hard); }
:root:root .compose-row .send-button { border: 3px solid var(--cp-border); border-radius: 50%; background: var(--cp-cta-bg); color: var(--cp-cta-fg); box-shadow: 0 4px 0 var(--cp-hard); }
:root:root .composer .study-toolbar :is(button, select) { border-width: 3px; font-family: var(--cp-font-heading); font-weight: 600; }
:root:root .session-pill { font-weight: 800; }
@media (max-width: 800px) {
  :root:root .welcome { grid-template-columns: minmax(0, 1fr); }
  :root:root .welcome > :not(.nubi-spot), :root:root .welcome > .nubi-spot { grid-column: 1; grid-row: auto; }
  :root:root .welcome > .nubi-spot { justify-content: flex-start; }
  :root:root .welcome > .nubi-spot .nubi { width: 90px; height: auto; }
}

/* ================================================================ Progress, achievements, profile, interview, settings */
/* Goal tiles: the wrapper is the card; the button inside it is plain. */
:root:root .goal-choice { border: 3px solid var(--cp-border); border-radius: 18px; background: var(--cp-surface); box-shadow: 0 4px 0 var(--cp-hard); }
:root:root:root .goal-choice button, :root:root:root .goal-choice button[aria-pressed="true"] { border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
:root:root .goal-choice:has([aria-pressed="true"]) { background: var(--tinta-highlight); border-color: var(--tinta-ink); }
:root:root .goal-choice:has([aria-pressed="true"]) :is(button, p, span, strong, b) { color: var(--tinta-ink); }
:root:root .goal-choice > p { font-size: .85rem; font-weight: 700; }
:root:root .profile-avatar { width: 72px; height: 72px; border: 4px solid var(--cp-border); background: var(--tinta-highlight); color: var(--tinta-ink); font-family: var(--cp-font-display); font-size: 1.8rem; font-weight: 400; box-shadow: 0 5px 0 var(--cp-hard); }
:root:root .report-section h2 { font-size: 1.5rem; font-weight: 700; }
:root:root .cert-item { padding: 14px 16px; }

/* Achievements: tiles that sit slightly askew, like stickers. */
:root:root .achievement-summary { background: var(--tinta-highlight); border-color: var(--tinta-ink); }
:root:root .achievement-summary :where(h2, p, span) { color: var(--tinta-ink); }
:root:root .achievement-summary h2 { font-family: var(--cp-font-display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.4rem); text-transform: uppercase; }
:root:root .milestone { border: 3px solid var(--cp-border); border-radius: 22px; padding: 22px; box-shadow: var(--cp-shadow); background: var(--cp-surface); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
:root:root .milestone:nth-child(odd) { transform: rotate(-1deg); }
:root:root .milestone:nth-child(even) { transform: rotate(1deg); }
:root:root .milestone:hover { transform: rotate(0deg) scale(1.02); }
:root:root .milestone.earned { background: var(--tinta-accent); border-color: var(--tinta-ink); }
:root:root .milestone.earned :where(h2, p, span) { color: var(--tinta-ink); }
:root:root .milestone :is(.milestone-icon, .track-icon) { width: 56px; height: 56px; border: 3px solid var(--cp-border); border-radius: 50%; }
:root:root .milestone.earned :is(.milestone-icon, .track-icon) { background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--tinta-ink); }
:root:root .milestone h2 { font-size: 1.3rem; }
:root:root .milestone-count { border-width: 3px; font-size: .9rem; }

/* Settings: tabs as pills, study days as chips. */
:root:root .settings-tabs { gap: 10px; margin: 8px 0 24px; border: 0; }
:root:root .settings-tab { min-height: 48px; margin: 0; padding: 0 18px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-surface); color: var(--cp-text);
  font-family: var(--cp-font-heading); font-weight: 600; font-size: 1rem; box-shadow: 0 3px 0 var(--cp-hard); }
:root:root .settings-tab[aria-selected="true"] { background: var(--cp-cta-bg); color: var(--cp-cta-fg); border-color: var(--cp-border); box-shadow: 0 5px 0 var(--cp-hard); }
:root:root .settings-tab:hover { background: var(--cp-accent-soft); }
:root:root .settings-tab[aria-selected="true"]:hover { background: var(--cp-cta-bg); }
:root:root .check-label { min-height: 48px; padding: 0 14px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-surface); font-weight: 700; }
:root:root .check-label:has(input:checked) { background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--tinta-ink); }
:root:root .check-label input { accent-color: var(--tinta-ink); }
:root:root .memory-note, :root:root .memory-context { padding: 12px 14px; }

/* Interview */
:root:root .interview-option { padding: 16px 18px; font-family: var(--cp-font-heading); font-weight: 600; font-size: 1.1rem; box-shadow: 0 5px 0 var(--cp-hard); }
:root:root .interview-option:hover { background: var(--cp-accent-soft); }
:root:root .interview-path-step { border-width: 3px; border-radius: 18px; }

/* Tables (progress, usage, admin) */
:root:root table { border-collapse: separate; border-spacing: 0; }
:root:root .table-wrap { border: 3px solid var(--cp-border); border-radius: 18px; overflow: auto; background: var(--cp-surface); }
:root:root .table-wrap th { background: var(--cp-surface-soft); font-family: var(--cp-font-heading); font-weight: 700; }
:root:root .day-square { border-width: 3px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { :root:root .milestone { transition: none; transform: none; } }

/* Fixes after review: plain buttons that must not take the press-button look */
:root:root:root .sort-button { border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; font: inherit; font-weight: 700; }
:root:root .interview-option { justify-content: flex-start; text-align: left; gap: 12px; }
:root:root .interview-option:has(input:checked) { background: var(--tinta-highlight); color: var(--tinta-ink); border-color: var(--tinta-ink); }
:root:root .interview-option input { flex: none; width: 20px; height: 20px; accent-color: var(--tinta-ink); }
/* Section switcher on the progress page */
:root:root .reports-header nav { padding: 4px; border: 3px solid var(--cp-border); border-radius: 999px; background: var(--cp-surface); }
:root:root .reports-header nav a { min-height: 40px; padding: 0 16px; border-radius: 999px; font-family: var(--cp-font-heading); font-weight: 600; font-size: .95rem; color: var(--cp-text); }
:root:root .reports-header nav a[aria-current] { background: var(--cp-cta-bg); color: var(--cp-cta-fg); }
:root:root main details:where(:not(.header-more)) { border-width: 3px; border-radius: 16px; }
/* Domain rows: an outlined row instead of a side stripe */
:root:root .domain-signal { padding: 14px 16px; border: 3px solid var(--cp-border); border-radius: 16px; background: var(--cp-surface); }

/* ================================================================ Instructor (owner) console */
:root:root .admin-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
:root:root .goal-tile { padding: 18px; }
:root:root .admin-kpi:nth-child(1) { background: var(--tinta-accent); border-color: var(--tinta-ink); }
:root:root .admin-kpi:nth-child(3) { background: var(--cp-surface-soft); }
:root:root .admin-kpi:last-child { background: var(--tinta-highlight); border-color: var(--tinta-ink); }
:root:root .admin-kpi:is(:nth-child(1), :last-child) :where(p, span, strong, b, div) { color: var(--tinta-ink); }
:root:root .goal-value { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1; }
:root:root .bar-track { height: 16px; border: 3px solid var(--cp-border); background: var(--cp-bg); }
:root:root .bar-fill { background: var(--cp-accent); border-radius: 0; }
:root:root .bar-label, :root:root .bar-value { font-weight: 700; }
:root:root .admin-table th, :root:root .admin-table td { padding: 10px 12px; }
:root:root .admin-pool-fill { box-shadow: none; }
/* Instructor console: create accounts and hand out one-time activation codes. */
:root:root .admin-invite form { display: grid; gap: 8px; justify-items: start; max-width: 520px; }
:root:root .admin-invite textarea { width: 100%; font-family: var(--cp-mono); }
:root:root .admin-codes { display: grid; gap: 10px; justify-items: start; margin-top: 18px; }
:root:root .admin-codes[hidden] { display: none; }
:root:root .admin-codes .table-wrap { width: 100%; }
:root:root .admin-codes code { font-family: var(--cp-mono); overflow-wrap: anywhere; }
:root:root .admin-table td .secondary-button + .secondary-button { margin-left: 8px; }
:root:root .admin-table td:last-child { white-space: nowrap; }
/* Wide tables scroll inside their own box and never widen the page. */
:root:root .table-wrap { position: relative; display: block; max-width: 100%; overflow-x: auto; }
:root:root :is(.report-section, .explore-page > *, #exploreContent > *) { min-width: 0; max-width: 100%; }
