/* Student library in the UNIVA Night Studio theme, matching /academy and /aioffice: a #05070C canvas with navy glows,
   UNIVA blue and cyan accents, gold for premium tags, hairline glass cards, pill buttons and mono kicker labels.
   Loaded after portal.css, brand.css and membership-benefits.css, so it only restyles; portal.js markup is unchanged. */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #05070C; --bg2: #0A0E17; --surface: #0C111C; --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16);
  --ink: #F2F4F8; --muted: rgba(242,244,248,.72); --faint: rgba(242,244,248,.56);
  --blue: #0054FF; --blue-hi: #3B7BFF; --cyan: #8CC8FF; --ok: #7EE0A8; --gold: #E3B347;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --glass: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  --navy: radial-gradient(90% 120% at 100% 0%, rgba(59,123,255,.5), transparent 62%), linear-gradient(160deg, #0a1a4a, #071028);
  --blue-card: linear-gradient(160deg, #0054FF, #1a3a9e);
  --r: 22px; --pill: 999px;
  /* Older portal tokens, so anything not restyled below still lands on the dark palette */
  --paper: var(--bg); --pale: var(--surface); --soft: rgba(255,255,255,.08); --academy-muted: var(--muted);
  --dark-2: #1a3a9e; --blue-deep: var(--blue-hi); --blue-light: var(--cyan); --font-sans: var(--sans); --font-display: var(--sans);
  color-scheme: dark;
}

[hidden] { display: none !important; }

body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(44vmax 44vmax at 10% 0%, rgba(0,84,255,.16), transparent 70%), radial-gradient(36vmax 36vmax at 100% 40%, rgba(59,123,255,.07), transparent 70%), radial-gradient(44vmax 44vmax at 30% 100%, rgba(0,84,255,.09), transparent 70%); }
::selection { background: rgba(0,84,255,.55); color: #fff; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Type: Instrument Serif page titles, Instrument Sans everywhere else, mono uppercase kickers */
h1, .reader h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.02; color: var(--ink); }
h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -.025em; }
.eyebrow, .side-label, .edition { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.eyebrow { color: var(--cyan); }
.muted, .side-course small, .student small, .note-from p, .section-title > span, .concept p, .lesson-meta, .source-list, .outline p, .page-footer { color: var(--muted); }

/* Buttons: blue glow primary, white primary on the hero and gate, hairline ghost secondary */
.primary, .secondary { border: 0; border-radius: var(--pill); min-height: 48px; padding: 12px 22px; gap: 12px; font-family: var(--sans); font-size: 15px; font-weight: 600; transition: background .2s, box-shadow .2s; }
.primary { background: var(--blue); color: #fff; box-shadow: 0 14px 40px -14px rgba(0,84,255,.75), inset 0 1px 0 rgba(255,255,255,.18); }
.primary:hover { background: var(--blue-hi); }
.primary[aria-pressed="true"] { background: rgba(126,224,168,.12); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(126,224,168,.45); }
.secondary { background: rgba(255,255,255,.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.secondary:hover { background: rgba(255,255,255,.11); }
.quiet { color: var(--muted); font-family: var(--sans); }
.quiet:hover { color: var(--ink); }

/* Sidebar: the top layer, so whatever scrolls under its sticky phone bar (the lesson jump at 30, menus at 40) stays below it */
.sidebar { z-index: 50; background: rgba(7,10,18,.82); border-right: 1px solid var(--line); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.sidebar .brand img { filter: brightness(0) invert(1); }
.sidebar .brand small { font-family: var(--mono); font-weight: 500; color: var(--muted); }
/* PRO at the logo's top-right corner for members, in the gold of the PRO badge on /academy */
.brand-logo { position: relative; display: block; }
.pro-tag { position: absolute; top: 0; right: 0; transform: translate(62%, -58%); font: 600 10px/1 var(--mono); letter-spacing: .12em; padding: 5px 8px; border-radius: var(--pill); color: #1a1205; background: linear-gradient(135deg, #F6DB94, var(--gold) 55%, #B9892E); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -8px rgba(227,179,71,.8); }
.sidebar nav button { color: var(--muted); font-weight: 600; border-radius: 14px; transition: background .2s, color .2s; }
.sidebar nav button span { color: var(--faint); }
.sidebar nav button:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.sidebar nav button.selected, .sidebar nav button.selected:hover { background: var(--blue-card); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 14px 32px -16px rgba(0,84,255,.8); }
.sidebar nav button.selected span { color: var(--cyan); }
.sidebar i { font: 500 10px/1 var(--mono); letter-spacing: .06em; padding: 5px 7px; border-radius: var(--pill); color: var(--cyan); background: rgba(0,84,255,.18); box-shadow: inset 0 0 0 1px rgba(140,200,255,.4); }
.sidebar nav button.selected i { color: #fff; background: rgba(255,255,255,.16); box-shadow: none; }
.side-course { border-top-color: var(--line); }
.side-course p { font-size: 14px; font-weight: 600; color: var(--ink); }
.mini-progress { height: 6px; background: rgba(255,255,255,.1); }
.mini-progress span { background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 6px; }
.sidebar-bottom > a { color: var(--muted); }
.sidebar-bottom > a:hover { color: var(--ink); }
.student { border-top-color: var(--line); }
.avatar { background: var(--navy); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(140,200,255,.35); font-weight: 600; }
.student strong { color: var(--ink); }
#student-validity { display: block; margin-top: 2px; color: var(--cyan); }

/* Topbar */
.topbar { background: transparent; border-bottom: 1px solid var(--line); color: var(--muted); }
.topbar strong { color: var(--ink); font-weight: 600; }
.slash { color: var(--faint); }
.edition { padding: 7px 11px; border-radius: var(--pill); color: var(--gold); background: rgba(227,179,71,.1); box-shadow: inset 0 0 0 1px rgba(227,179,71,.42); }
.course-picker { font-family: var(--mono); font-weight: 500; letter-spacing: .08em; color: var(--faint); }
select { color-scheme: dark; }
.course-picker select, .lesson-jump select { -webkit-appearance: none; appearance: none; border: 0; border-radius: var(--pill); color: var(--ink); font: 600 13px var(--sans);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238CC8FF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 12px 8px;
  box-shadow: inset 0 0 0 1px var(--line2); }
.course-picker select { padding: 8px 34px 8px 14px; }
.lesson-jump select { padding: 12px 38px 12px 16px; font-size: 14px; }
/* Styled dropdowns (portal.js pickMenu): a pill button opening a glass listbox; the native select stays hidden behind it */
.pick-menu { position: relative; z-index: 40; }
.pick-menu-button { display: inline-flex; align-items: center; gap: 12px; min-height: 40px; max-width: 240px; padding: 8px 14px 8px 16px; border: 0; border-radius: var(--pill);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025)), var(--surface); color: var(--ink); font: 600 13px var(--sans); letter-spacing: -.005em; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line2), 0 8px 20px -12px rgba(0,0,0,.8); transition: box-shadow .18s, background .18s; }
.pick-menu-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-menu-button svg { flex: none; color: var(--cyan); transition: transform .2s ease; }
.pick-menu-button:hover { box-shadow: inset 0 0 0 1px rgba(140,200,255,.45), 0 8px 20px -12px rgba(0,0,0,.8); }
.pick-menu-button[aria-expanded="true"] { box-shadow: inset 0 0 0 1px rgba(59,123,255,.75), 0 0 0 4px rgba(0,84,255,.18); }
.pick-menu-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.pick-menu-list { position: absolute; top: calc(100% + 10px); right: 0; min-width: max(100%, 260px); margin: 0; padding: 6px; list-style: none; border-radius: 18px; outline: none;
  background: rgba(12,17,28,.96); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 0 0 1px var(--line2), 0 24px 48px -16px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4); transform-origin: top right; }
.pick-menu-list:not([hidden]) { animation: pick-menu-in .16s ease-out; }
.pick-menu-list [role="option"] { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; cursor: pointer; letter-spacing: 0; transition: background .12s; }
.pick-menu-list [role="option"].active { background: rgba(255,255,255,.06); }
.pick-menu-list [role="option"][aria-selected="true"] { background: rgba(0,84,255,.16); box-shadow: inset 0 0 0 1px rgba(59,123,255,.35); }
.pick-menu-list [role="option"][aria-selected="true"].active { background: rgba(0,84,255,.22); }
.pick-menu-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pick-menu-text strong { font: 600 14px/1.3 var(--sans); color: var(--ink); }
.pick-menu-text small { font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; color: var(--faint); }
.pick-menu-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--blue); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
[aria-selected="true"] > .pick-menu-tick { opacity: 1; transform: none; }
@keyframes pick-menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
/* Lesson jump: full-width bar, a scrolling panel with sticky module headings, numbered steps that turn into checks */
.lesson-jump { position: relative; z-index: 30; }
.pick-menu--lesson { flex: 1; min-width: 0; }
.pick-menu--lesson .pick-menu-button { width: 100%; max-width: none; justify-content: space-between; min-height: 48px; padding: 12px 18px 12px 20px; font-size: 15px; }
.pick-menu--lesson .pick-menu-list { left: 0; right: 0; min-width: 0; max-height: min(62vh, 520px); overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 6px; transform-origin: top center;
  scrollbar-width: thin; scrollbar-color: rgba(140,200,255,.3) transparent; }
.pick-menu-group { position: sticky; top: 0; z-index: 1; margin: 0 -6px; padding: 14px 18px 8px; font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan);
  background: linear-gradient(180deg, rgba(12,17,28,1) 75%, rgba(12,17,28,0)); }
.pick-menu-group:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--line); }
.pick-menu--lesson [role="option"] { gap: 14px; padding: 9px 12px; }
.pick-menu--lesson .pick-menu-text strong { font-weight: 500; font-size: 14.5px; color: rgba(242,244,248,.9); }
.pick-menu--lesson [aria-selected="true"] .pick-menu-text strong { font-weight: 600; color: #fff; }
.pick-menu-step { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 600 11px/1 var(--mono); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.done > .pick-menu-step { color: var(--ok); background: rgba(126,224,168,.12); box-shadow: inset 0 0 0 1px rgba(126,224,168,.45); }
[aria-selected="true"] > .pick-menu-step { color: #fff; background: var(--blue); box-shadow: 0 0 0 4px rgba(0,84,255,.22); }
.pick-menu-time { flex: none; font: 500 11px/1 var(--mono); letter-spacing: .04em; color: var(--faint); }
select option, select optgroup { background: var(--surface); color: var(--ink); }
.topbar #account { padding: 9px 16px; border-radius: var(--pill); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.topbar #account:hover { background: rgba(255,255,255,.07); text-decoration: none; }
/* EN | BM, the same hairline toggle as /academy */
.topbar .lang { display: inline-flex; flex: none; padding: 3px; border-radius: var(--pill); box-shadow: inset 0 0 0 1px var(--line2); }
.topbar .lang button { border: 0; background: none; min-width: 34px; min-height: 30px; padding: 0 10px; border-radius: var(--pill); font: 500 11px/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
.topbar .lang button:hover { color: var(--ink); }
.topbar .lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Home: intro and the navy hero card with the blue textbook */
main { color: var(--ink); }
.intro-row h1 { font-size: clamp(40px, 4.4vw, 62px); }
.intro-row p { color: var(--muted); }
.date-stamp { font: 500 13px var(--mono); letter-spacing: .04em; color: var(--ink); }
.date-stamp small { font-family: var(--mono); color: var(--faint); letter-spacing: .08em; }
.hero { background: var(--navy); border-radius: clamp(24px, 3vw, 36px); box-shadow: inset 0 0 0 1px rgba(59,123,255,.35), 0 40px 80px -40px rgba(0,84,255,.45); color: var(--ink); }
.hero h2 { font-family: var(--sans); font-weight: 600; letter-spacing: -.045em; line-height: .98; font-size: clamp(44px, 4.8vw, 72px); color: #fff; }
.hero h2::after { content: "."; color: var(--cyan); }
.hero p { color: rgba(242,244,248,.78); }
.hero .eyebrow { color: var(--cyan); }
.hero .primary { background: #fff; color: #05070C; box-shadow: 0 14px 34px -16px rgba(255,255,255,.45); }
.hero .primary:hover { background: #E6ECF7; }
.hero-foot { gap: 8px; flex-wrap: wrap; color: #fff; }
.hero-foot span { padding: 6px 12px; border-radius: var(--pill); background: rgba(255,255,255,.1); font-size: 13px; font-weight: 600; }

/* The textbook: an upright blue hardback with a page edge and back board, bobbing slowly over its own shadow.
   Everything scales from --w, the cover width. Hidden on phones, where the hero is a single column. */
.cover-art { --w: 220px; position: relative; display: grid; place-items: center; min-height: 360px; padding: 40px 32px 56px; overflow: hidden;
  background: radial-gradient(50% 50% at 50% 46%, rgba(0,84,255,.34), transparent 72%); }
.cover-art::before, .cover-art::after { content: ""; position: absolute; left: 50%; top: 46%; border-radius: 50%; border: 1px solid rgba(140,200,255,.14); transform: translate(-50%, -50%); pointer-events: none; }
.cover-art::before { width: calc(var(--w) * 1.95); aspect-ratio: 1; }
.cover-art::after { width: calc(var(--w) * 1.45); aspect-ratio: 1; border-color: rgba(140,200,255,.09); }
.cover-float { position: relative; z-index: 1; isolation: isolate; width: var(--w); height: calc(var(--w) * 1.34); }
/* Back board, then the page block, both peeking out on the right */
.cover-float::before, .cover-float::after { content: ""; position: absolute; border-radius: 3px 10px 10px 3px; }
.cover-float::before { z-index: -2; top: 9px; bottom: -7px; left: 6px; right: -13px; background: #0f2470;
  box-shadow: inset 0 0 0 1px rgba(140,200,255,.18), 0 36px 50px -24px rgba(0,16,80,.9); }
.cover-float::after { z-index: -1; top: 5px; bottom: -2px; left: 4px; right: -8px; border-radius: 0 7px 7px 0;
  background: repeating-linear-gradient(90deg, #f1f4fa 0 2px, #b7c3d9 2px 3px); box-shadow: inset -1px 0 0 #8ea0c2; }
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--w) * .12) calc(var(--w) * .1) calc(var(--w) * .1) calc(var(--w) * .17);
  border-radius: 3px 10px 10px 3px; color: #fff; overflow: hidden;
  background: linear-gradient(118deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 38%), linear-gradient(165deg, #2f70ff 0%, #0054FF 45%, #1a3a9e 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.32); }
/* Spine and hinge groove down the left edge */
.cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--w) * .085);
  background: linear-gradient(90deg, rgba(0,10,50,.38), rgba(0,10,50,.12) 70%, rgba(255,255,255,.12)); box-shadow: 1px 0 0 rgba(255,255,255,.16), 3px 0 6px -2px rgba(0,10,50,.35); }
.cover-top { display: flex; justify-content: space-between; gap: 8px; }
.cover-top small, .cover-foot em { font: 500 calc(var(--w) * .041)/1.4 var(--mono); letter-spacing: .14em; font-style: normal; color: rgba(255,255,255,.82); }
.cover-top small:last-child { color: var(--cyan); }
.cover > strong { display: block; margin: calc(var(--w) * .16) 0 0; font: 700 calc(var(--w) * .13)/1.08 var(--sans); letter-spacing: -.035em; color: #fff; }
.cover--short > strong { font-size: calc(var(--w) * .19); line-height: .92; letter-spacing: -.03em; }
.cover--short > strong::after { content: "."; color: var(--cyan); }
.cover-foot { margin-top: auto; display: grid; gap: calc(var(--w) * .055); }
.cover-foot span { display: block; height: 1px; background: rgba(255,255,255,.34); }
.cover-shadow { position: absolute; left: 50%; bottom: 24px; width: calc(var(--w) * .95); height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,3,18,.95), transparent); transform: translateX(-50%); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .cover-float { animation: cover-bob 6s ease-in-out infinite; will-change: transform; }
  .cover-shadow { animation: cover-shadow 6s ease-in-out infinite; }
}
@keyframes cover-bob { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-14px); } }
@keyframes cover-shadow { 0%, 100% { transform: translateX(-50%) scale(1); opacity: .9; } 50% { transform: translateX(-50%) scale(.74); opacity: .45; } }
@media (min-width: 1600px) { .cover-art { --w: 244px; min-height: 400px; } }
@media (min-width: 701px) and (max-width: 1000px) { .cover-art { --w: 180px; min-height: 320px; padding: 32px 20px 50px; } }
@media (max-width: 700px) { .cover-art { display: none; } }

/* AI Office only: the subscription the student needs before starting, as a glass card with two link tiles */
.tools-needed { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 32px; align-items: center; padding: clamp(22px, 3vw, 32px); border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0,0,0,.85); }
.tools-needed h3 { margin: 10px 0 8px; font-size: 22px; line-height: 1.25; }
.tools-needed p { margin: 0; color: var(--muted); font-size: 15px; max-width: 52ch; }
.tools-links { display: grid; gap: 10px; }
.tool-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 16px; align-items: center; min-height: 64px; padding: 14px 18px; border-radius: 16px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); text-decoration: none; transition: background .2s, box-shadow .2s; }
.tool-link img { grid-column: 1; grid-row: 1 / 3; width: 30px; height: 30px; display: block; }
.tool-link strong { grid-column: 2; font-size: 16px; font-weight: 600; }
.tool-link span { grid-column: 2; font-family: var(--mono); font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.tool-link b { grid-column: 3; grid-row: 1 / 3; font-size: 18px; font-weight: 400; color: var(--cyan); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.tool-link:hover, .tool-link:focus-visible { background: rgba(0,84,255,.16); box-shadow: inset 0 0 0 1px rgba(140,200,255,.45); }
.tool-link:hover b, .tool-link:focus-visible b { transform: translate(2px, -2px); }
.tool-link--plain { grid-template-columns: minmax(0, 1fr) auto; }
.tool-link--plain strong, .tool-link--plain span { grid-column: 1; }
.tool-link--plain b { grid-column: 2; }
@media (max-width: 1000px) { .tools-needed { grid-template-columns: minmax(0, 1fr); } }
/* Support card: a large Telegram logo sits behind the right side, softened, and the join button is frosted glass over it */
.support-card { position: relative; overflow: hidden; isolation: isolate; }
.support-card > :not(.tg-mark) { position: relative; z-index: 1; }
.tg-mark { position: absolute; z-index: 0; right: 2%; top: 50%; width: 230px; height: 230px; margin-top: -115px; opacity: .7; filter: blur(1.5px) saturate(1.15); pointer-events: none; animation: tgFloat 9s ease-in-out infinite; }
.tg-mark::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; background: #2aabee; filter: blur(40px); opacity: .55; z-index: -1; }
.tg-mark svg { display: block; width: 100%; height: 100%; transform: rotate(-12deg); }
.support-card .tool-link { background: rgba(14,20,32,.38); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.12), 0 18px 40px -20px rgba(0,0,0,.7); }
.support-card .tool-link:hover, .support-card .tool-link:focus-visible { background: rgba(42,171,238,.18); box-shadow: inset 0 0 0 1px rgba(120,200,255,.5), 0 18px 40px -20px rgba(42,171,238,.5); }
@keyframes tgFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(4deg); } }
@media (max-width: 1000px) { .tg-mark { width: 190px; height: 190px; right: -40px; top: auto; bottom: -40px; margin-top: 0; } }
@media (prefers-reduced-motion: reduce) { .tg-mark { animation: none; } }

/* Golden ticket (a thank-you grant): gold foil with a perforated stub and half-round notches where the stub tears off,
   as on /ai/account */
.gold-ticket { --cut: 12px; margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 190px; color: #2A1D04; filter: drop-shadow(0 26px 40px rgba(227,179,71,.2)); }
.gold-ticket-main, .gold-ticket-stub { position: relative; overflow: hidden; }
.gold-ticket-main { padding: clamp(22px, 3vw, 32px); border-radius: var(--r) 0 0 var(--r);
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,250,225,.75), transparent 55%), linear-gradient(135deg, #F8E4A6 0%, #E9C25E 38%, #CF9C35 68%, #F1D27E 100%);
  -webkit-mask: radial-gradient(circle var(--cut) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--cut) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--cut) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--cut) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat; }
.gold-ticket-main::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 60%); transform: translateX(-120%); animation: gold-sheen 6s ease-in-out 1s infinite; }
.gold-ticket-stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 16px; text-align: center; border-left: 2px dashed rgba(42,29,4,.38); border-radius: 0 var(--r) var(--r) 0;
  background: linear-gradient(160deg, #E7BC55, #C38F2C 70%, #DDB25A);
  -webkit-mask: radial-gradient(circle var(--cut) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--cut) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--cut) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--cut) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat; }
.gold-ticket-kicker, .gold-ticket-stub small, .gold-ticket-admit { font: 600 11px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.gold-ticket-kicker { display: inline-flex; align-items: center; gap: 7px; }
.gold-ticket-kicker::before { content: "\2605"; font-size: 14px; letter-spacing: 0; }
.gold-ticket h3 { margin: 10px 0 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 44px); font-weight: 400; line-height: 1.02; letter-spacing: -.02em; color: #241803; }
.gold-ticket p { margin: 12px 0 0; max-width: 54ch; font-size: 15px; line-height: 1.55; color: rgba(42,29,4,.84); }
.gold-ticket-opens { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 16px 0 0; list-style: none; border-top: 1px solid rgba(42,29,4,.2); }
.gold-ticket-opens li { padding: 6px 11px; border-radius: var(--pill); font-size: 12px; font-weight: 600; color: #241803; background: rgba(255,248,222,.5); box-shadow: inset 0 0 0 1px rgba(42,29,4,.18); }
.gold-ticket-admit { margin-bottom: 8px; padding: 6px 10px; border: 2px solid rgba(42,29,4,.55); border-radius: 8px; letter-spacing: .22em; color: #241803; transform: rotate(-6deg); }
.gold-ticket-stub small { color: rgba(42,29,4,.72); letter-spacing: .12em; }
.gold-ticket-stub strong { font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.1; color: #241803; }
@keyframes gold-sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .gold-ticket-main::after { animation: none; display: none; } }
@media (max-width: 620px) {
  .gold-ticket { grid-template-columns: minmax(0, 1fr); }
  .gold-ticket-main { padding: 22px 18px; border-radius: var(--r) var(--r) 0 0;
    -webkit-mask: radial-gradient(circle var(--cut) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--cut) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
    mask: radial-gradient(circle var(--cut) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--cut) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat; }
  .gold-ticket-stub { flex-direction: row; flex-wrap: wrap; gap: 6px 10px; padding: 18px; border-left: 0; border-top: 2px dashed rgba(42,29,4,.38); border-radius: 0 0 var(--r) var(--r);
    -webkit-mask: radial-gradient(circle var(--cut) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--cut) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
    mask: radial-gradient(circle var(--cut) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--cut) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat; }
  .gold-ticket-admit { margin: 0 6px 0 0; }
  .gold-ticket-stub strong { font-size: 22px; }
}
/* The same ticket as a chip on the sidebar profile */
.ticket-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 5px 9px; border-radius: var(--pill); font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #1a1205; background: linear-gradient(135deg, #F6DB94, var(--gold) 55%, #B9892E); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -8px rgba(227,179,71,.8); }
.ticket-chip::before { content: "\2605"; font-size: 11px; letter-spacing: 0; }
/* The "opens elsewhere" arrow (arrow() in portal.js): a thin SVG line in the text colour, the same on every phone */
.arrow { display: inline-block; flex: none; vertical-align: -.125em; }

/* Learning path and the lower cards */
.section-title h2 { font-size: 26px; font-weight: 600; }
.section-title > span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.module-card { color: var(--ink); background: var(--glass); border: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0,0,0,.85); transition: box-shadow .3s, transform .3s cubic-bezier(.2,.7,.2,1); }
.module-card:hover { background: var(--glass); box-shadow: inset 0 0 0 1px rgba(140,200,255,.42), 0 30px 60px -36px rgba(0,84,255,.6); transform: translateY(-2px); }
.module-card .number { font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; color: var(--cyan); }
.module-card .number > span { color: var(--faint); }
.module-card h3 { color: var(--ink); font-weight: 600; letter-spacing: -.02em; }
.module-card p { color: var(--muted); }
.module-card .meta { border-top-color: var(--line); color: var(--faint); font-family: var(--mono); font-weight: 500; letter-spacing: .04em; }

.daily-feature { background: var(--navy); border: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px rgba(59,123,255,.35); color: var(--ink); }
.daily-feature h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.01em; line-height: 1.1; }
.daily-feature p { color: rgba(242,244,248,.78); }
.daily-feature .quiet { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.note-from { border-left-color: var(--line); }
.note-from h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.01em; }
.note-from strong { color: var(--ink); font-weight: 600; }

/* Reading view */
.back { color: var(--muted); }
.lesson-jump { background: var(--navy); color: var(--ink); border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(59,123,255,.35); }
.lesson-jump label { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.reader h1 { font-size: clamp(40px, 4.6vw, 62px); }
.reader .lede { color: var(--muted); font-size: 19px; }
.lesson-meta { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--faint); border-bottom-color: var(--line); }
.tutorial-video { padding: 8px; border-radius: calc(var(--r) + 8px); background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.015)); box-shadow: inset 0 0 0 1px var(--line2), 0 60px 120px -60px rgba(0,84,255,.6); }
.tutorial-video video { background: #000; border-radius: var(--r); }
.tutorial-video > .eyebrow { padding: 8px 12px 12px; }
.tutorial-video video[hidden] { display: none !important; }
.tutorial-video figcaption { background: var(--surface); border: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 14px; }
.diagram { background: var(--glass); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.diagram p { color: var(--muted); }
.flow span { background: rgba(255,255,255,.04); color: var(--muted); border: 0; box-shadow: inset 0 0 0 1px var(--line2); }
.flow span.active { background: var(--blue); color: #fff; box-shadow: 0 10px 26px -12px rgba(0,84,255,.9), inset 0 1px 0 rgba(255,255,255,.18); }
.flow i { color: var(--faint); }
.diagram button { background: rgba(255,255,255,.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.diagram button:hover { background: rgba(255,255,255,.11); }
.concept { background: var(--glass); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 18px; }
.concept b { color: var(--ink); font-weight: 600; }
.prompt-box { color: var(--ink); border-radius: var(--r); background: radial-gradient(80% 120% at 0% 0%, rgba(0,84,255,.18), transparent 60%), var(--bg2); box-shadow: inset 0 0 0 1px var(--line2); }
.prompt-top .eyebrow { color: var(--cyan); }
.prompt-top button { background: #fff; color: #05070C; font-weight: 600; border-radius: var(--pill); box-shadow: none; }
.prompt-top button:hover { background: #E6ECF7; }
.prompt-top button.quiet { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1px var(--line2); padding: 8px 14px; }
.prompt-top button.quiet:hover { background: rgba(255,255,255,.07); }
.prompt-box p { font-family: var(--mono); color: #DCE6FF; }
.exercise { border-top-color: var(--line); }
.exercise h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.01em; }
.exercise p { color: var(--muted); }
.check { background: rgba(126,224,168,.07); color: var(--ink); border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(126,224,168,.3); }
.check strong { color: var(--ok); }
.notepad { color: var(--ink); font-weight: 600; }
textarea, .search { background: rgba(255,255,255,.04); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line2); font-family: var(--sans); }
textarea { border-radius: 16px; }
.search { border-radius: var(--pill); padding: 12px 18px; }
textarea::placeholder, .search::placeholder { color: var(--faint); }
textarea:hover, .search:hover { box-shadow: inset 0 0 0 1px rgba(140,200,255,.35); }
small.save-status { color: var(--faint); }
.source-list a { color: var(--cyan); text-underline-offset: 3px; }
.lesson-end { border-top-color: var(--line); }
.outline { border-left-color: var(--line); }
.outline button { color: var(--muted); border-bottom-color: var(--line); }
.outline button:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.outline button.current { background: rgba(0,84,255,.18); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(140,200,255,.38); }

/* Daily pages, prompt library and notebook */
.list-page h1 { font-size: clamp(38px, 4.4vw, 58px); }
.list-page > h3 { margin-top: 28px; font-weight: 600; }
.daily-entry, .saved-note { border-bottom-color: var(--line); }
.daily-entry h2, .saved-note h2 { font-family: var(--sans); font-weight: 600; letter-spacing: -.025em; }
.daily-entry p, .saved-note p { color: var(--muted); }
.saved-note .quiet { color: var(--cyan); }
.empty { color: var(--muted); }

/* Access gates: the membership offer for signed-in non-members, and the sign-in / retry gate */
.membership-gate { margin-top: 10px; padding: clamp(28px, 5vw, 56px); border-radius: clamp(24px, 3vw, 36px); background: var(--navy); box-shadow: inset 0 0 0 1px rgba(59,123,255,.35), 0 40px 80px -40px rgba(0,84,255,.45); }
.membership-gate h1 { font-size: clamp(38px, 5vw, 64px); color: #fff; }
.membership-gate > p { color: rgba(242,244,248,.8); font-size: 17px; }
.membership-benefits { color: var(--ink); }
.membership-lead { color: var(--ink); font-size: 18px; }
.membership-access-note { color: var(--muted); font-size: 13px; padding-left: 14px; border-left: 2px solid rgba(140,200,255,.45); }
.membership-gate .membership-help { color: var(--muted); }
.membership-help a { color: var(--cyan); text-underline-offset: 3px; }
.membership-help a.primary { margin-top: 6px; min-height: 52px; padding: 14px 26px; font-size: 16px; color: #05070C; background: #fff; text-decoration: none; box-shadow: 0 14px 34px -16px rgba(255,255,255,.45); }
.membership-help a.primary:hover { background: #E6ECF7; }
.membership-gate [data-retry], .gate [data-retry] { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; padding: 0; min-height: 44px; }
.membership-path, .membership-included { background: var(--glass); border: 0; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.membership-kicker, .membership-path .membership-count { font-family: var(--mono); font-weight: 500; color: var(--cyan); }
.membership-path p, .membership-path li, .membership-included p, .membership-availability { color: var(--muted); }
.gate h1 { font-size: clamp(42px, 6vw, 72px); }
.gate p { color: var(--muted); }
.gate .actions .primary { background: #fff; color: #05070C; box-shadow: 0 14px 34px -16px rgba(255,255,255,.45); }
.gate .actions .primary:hover { background: #E6ECF7; }
.gate .steps div { border-top: 0; padding: 16px 18px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.gate .steps b { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.gate a:not(.primary):not(.secondary) { color: var(--cyan); }

/* Chrome: banner, footer, skip link, toast, loading */
.preview-banner { background: rgba(227,179,71,.1); color: #F2D391; box-shadow: inset 0 0 0 1px rgba(227,179,71,.35); border-radius: 14px; }
.renewal-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; padding: 12px 10px 12px 18px; border-radius: 14px; background: rgba(0,84,255,.14); box-shadow: inset 0 0 0 1px rgba(140,200,255,.38); color: var(--ink); font-size: 14px; }
.renewal-banner p { margin: 0; }
.renewal-banner a { color: var(--cyan); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.renewal-banner button { flex: none; min-width: 44px; min-height: 44px; border-radius: var(--pill); color: var(--muted); font-size: 14px; }
.renewal-banner button:hover { color: var(--ink); background: rgba(255,255,255,.08); text-decoration: none; }
.page-footer { border-top-color: var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.skip { top: -100px; padding: 10px 16px; border-radius: var(--pill); background: var(--ink); color: var(--bg); font-weight: 600; }
.skip:focus { top: 12px; }
#toast { background: rgba(12,17,28,.94); color: var(--ink); border-radius: var(--pill); font-size: 14px; padding: 12px 22px; box-shadow: inset 0 0 0 1px var(--line2), 0 20px 50px -20px rgba(0,0,0,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); max-width: calc(100vw - 32px); }
.loading { color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.loading::before { content: ""; display: block; width: 10px; height: 10px; margin: 0 auto 16px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(140,200,255,.15); animation: portal-pulse 1.4s ease-in-out infinite; }
@keyframes portal-pulse { 50% { opacity: .35; transform: scale(.8); } }

/* Phones: the sidebar becomes a compact sticky bar, logo and label on one row above the four views */
@media (max-width: 700px) {
  .sidebar { background: rgba(5,7,12,.9); border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px 0; }
  .sidebar .brand { flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; min-height: 36px; }
  .sidebar .brand img { width: 58px; }
  .sidebar .brand small { padding-left: 10px; border-left: 1px solid var(--line2); font-size: 10px; letter-spacing: .14em; }
  .sidebar nav { margin: 8px -6px 8px; gap: 4px; }
  .sidebar nav button { position: relative; min-height: 54px; padding: 7px 2px; font-size: 11px; line-height: 1.2; border-radius: 14px; text-align: center; white-space: normal; min-width: 0; }
  /* The BM labels are longer: they wrap onto two lines instead of running into the next button */
  :lang(ms) .sidebar nav button { font-size: 10px; }
  .sidebar nav i { display: block; position: absolute; top: 3px; right: 3px; font-size: 8px; padding: 3px 5px; }
  .pro-tag { font-size: 9px; padding: 4px 6px; transform: translate(85%, -40%); }
  .topbar { border-bottom: 1px solid var(--line); }
  .edition { display: none; }
  .pick-menu--course { flex: 1; min-width: 0; }
  .course-picker .pick-menu-button span { display: block; }
  .course-picker .pick-menu-text { display: grid; }
  .course-picker .pick-menu-tick { display: grid; }
  .pick-menu--course .pick-menu-button { width: 100%; max-width: none; justify-content: space-between; }
  .pick-menu--course .pick-menu-list { left: 0; right: auto; min-width: max(100%, 260px); max-width: calc(100vw - 36px); transform-origin: top left; }
  .pick-menu--lesson .pick-menu-list { max-height: 60vh; }
  .pick-menu-time { display: none; }
  .hero h2 { font-size: clamp(38px, 11vw, 48px); }
  .hero-copy { padding: 26px 22px; }
  .hero .primary { width: 100%; }
  .tools-needed { padding: 22px 18px; }
  .tools-needed h3 { font-size: 20px; }
  .module-card .number { font-size: 40px; }
  .reader .lede { font-size: 17px; }
  .lesson-meta { font-size: 11px; }
  .tutorial-video { padding: 6px; border-radius: 22px; }
  .tutorial-video video, .tutorial-video figcaption { border-radius: 16px; }
  .prompt-top button.quiet { padding: 8px 12px; }
  .membership-gate { padding: 26px 20px; border-radius: 24px; }
  .membership-help a.primary { width: 100%; }
  .gate .steps { flex-direction: column; }
  .page-footer { flex-direction: column; gap: 6px; }
}

/* Risk notice: a module that must be acknowledged before its lessons open (AI Office · JARVIS) */
.risk-box { margin: 26px 0 30px; padding: 24px 26px; border-radius: var(--r); background: linear-gradient(180deg, rgba(255,176,32,.11), rgba(255,176,32,.04)); box-shadow: inset 0 0 0 1px rgba(255,190,80,.45); }
.risk-box .eyebrow { color: #FFC56B; }
.risk-box h2 { margin: 10px 0 12px; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 40px); line-height: 1.05; color: var(--ink); }
.risk-box ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.risk-box li::marker { color: #FFC56B; }
.risk-confirm { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 16px; padding: 14px 16px; border-radius: 14px; background: rgba(5,7,12,.45); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); font-size: 15px; line-height: 1.5; cursor: pointer; }
.risk-confirm input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: #FFB020; }
.risk-box button[disabled] { opacity: .45; cursor: not-allowed; }
.risk-accepted { margin: 16px 0 0; color: var(--ok); font-size: 14px; font-weight: 600; }

/* NEW on a freshly added module: its card on My learning and the eyebrow of its lessons */
.new-tag { display: inline-block; vertical-align: middle; margin: 0 4px; padding: 4px 7px; border-radius: var(--pill); font: 600 10px/1 var(--mono); font-style: normal; letter-spacing: .08em; color: var(--cyan); background: rgba(0,84,255,.18); box-shadow: inset 0 0 0 1px rgba(140,200,255,.4); }
.module-card h3 .new-tag { margin-left: 6px; }

/* NEW on a fresh AI update, in the gold of the PRO badge */
.new-pill { display: inline-block; vertical-align: middle; margin-right: 10px; padding: 5px 9px; border-radius: var(--pill); font: 600 10px/1 var(--mono); font-style: normal; letter-spacing: .12em; color: #1a1205; background: linear-gradient(135deg, #F6DB94, var(--gold) 55%, #B9892E); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -8px rgba(227,179,71,.8); }

/* An AI update written as a blog post: motion graphic on top, a large serif title, short sections */
.daily-post { padding: 28px 0 40px; }
.daily-post .post-meta { display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; color: var(--cyan); }
.daily-post .post-meta time { margin-right: .5ch; }
.daily-post h2 { margin: 14px 0 16px; max-width: 22ch; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 60px); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
.daily-post .post-lede { max-width: 62ch; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; color: rgba(242,244,248,.84); }
.post-byline { margin: 4px 0 8px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.post-section { max-width: 68ch; margin-top: 34px; }
.post-section h3 { margin: 0 0 12px; font-size: clamp(21px, 2.2vw, 26px); line-height: 1.25; }
.daily-post .post-section p, .post-section li { font-size: 16px; line-height: 1.7; color: var(--muted); }
.post-section ol, .post-section ul { margin: 0 0 14px; padding-left: 1.3em; display: grid; gap: 8px; }
.post-section li::marker { color: var(--cyan); font-family: var(--mono); font-size: 13px; }
.post-section li b { color: var(--ink); font-weight: 600; }
.post-section .prompt-box { margin: 20px 0; }
.post-section .prompt-box p { font-size: 14px; line-height: 1.75; color: #DCE6FF; }
.post-repos { max-width: none; }
.daily-post .post-small { font-size: 14px; }
.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.repo-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2); transition: transform .25s, box-shadow .25s; }
.repo-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(140,200,255,.5); }
.repo-card img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; background: #fff; }
.repo-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.repo-body b { font: 600 14px/1.3 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.repo-body span { font-size: 14px; line-height: 1.55; color: var(--muted); }
.repo-body em { margin-top: 4px; font-style: normal; font-size: 14px; font-weight: 600; color: var(--cyan); }
.daily-post > .secondary { margin-top: 30px; }
@media (max-width: 900px) { .repo-grid { grid-template-columns: minmax(0, 1fr); } .repo-card { flex-direction: row; } .repo-card img { width: 42%; flex: none; aspect-ratio: 2 / 1; align-self: center; } }
@media (max-width: 520px) { .repo-card { flex-direction: column; } .repo-card img { width: 100%; } }

/* GitHub library: public repos per course, as the blog's repo cards on a wider grid. The sidebar button carries the
   gold NEW pill until the student opens it; each repo added later carries one under its name until its card is opened. */
.sidebar i.new-pill, .sidebar nav button.selected i.new-pill { margin-right: 0; color: #1a1205; background: linear-gradient(135deg, #F6DB94, var(--gold) 55%, #B9892E); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -8px rgba(227,179,71,.8); }
.github-page { max-width: 1100px; }
.github-page > .muted { max-width: 68ch; }
.github-note { margin: 0; font-size: 13px; color: var(--faint); }
.github-grid { margin-top: 24px; }
.github-card .repo-body { display: flex; flex-direction: column; flex: 1; }
.github-card .repo-body .github-why { padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.github-why strong { font-weight: 600; color: var(--ink); }
.github-card .repo-body .github-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 11px/1.2 var(--mono); letter-spacing: .06em; color: var(--faint); }
.github-meta .new-pill { margin-right: 0; padding: 4px 7px; }
.github-card .repo-body em { margin-top: auto; padding-top: 4px; }
/* Phones: short cards, a small preview beside the name, then what it is, why it helps here and the link */
@media (max-width: 520px) {
  .github-page > .muted { font-size: 15px; line-height: 1.55; }
  .github-grid { gap: 10px; margin-top: 18px; }
  .github-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 12px; border-radius: 16px; }
  .github-card img { width: 100%; border-radius: 8px; }
  .github-card .repo-body { display: contents; }
  .github-card .repo-body b { font-size: 13px; }
  .github-card .repo-body > span, .github-card .repo-body em { grid-column: 1 / -1; font-size: 13px; line-height: 1.45; }
  .github-card .repo-body .github-why { font-size: 13px; }
  .github-card .repo-body em { padding-top: 0; }
}
/* Phones: the views share the sticky bar's row, however many the course shows */
@media (max-width: 700px) {
  .sidebar nav { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}
@media (min-width: 521px) and (max-width: 900px) { .github-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .github-card { flex-direction: column; } .github-card img { width: 100%; } }

/* Notifications: the bell before EN | BM, its panel under it; on phones the bell moves up to the logo row */
.news { position: relative; flex: none; }
.news[hidden], .news-panel[hidden], .news-count[hidden] { display: none; }
.news-bell { position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--pill); background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.news-bell:hover, .news.open .news-bell { background: rgba(255,255,255,.07); }
.news-count { position: absolute; top: -5px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--blue); color: #fff; font: 600 10px/18px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.news-scrim { display: none; }
.news-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 60; width: min(420px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2), 0 24px 60px rgba(0,0,0,.55); text-align: left; font-family: var(--sans); }
.news-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--line); }
.news-head h2 { margin: 0; font: 600 17px/1.2 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.news-close { width: 32px; height: 32px; border: 0; border-radius: var(--pill); background: none; color: var(--muted); font-size: 13px; }
.news-close:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.news-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.news-actions button { border: 0; padding: 7px 12px; border-radius: var(--pill); background: none; color: var(--cyan); font: 500 12px/1.2 var(--sans); box-shadow: inset 0 0 0 1px var(--line2); }
.news-actions button:hover:not(:disabled) { background: rgba(255,255,255,.07); }
.news-actions button:disabled { opacity: .4; cursor: default; }
.news-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.news-list { list-style: none; margin: 0; padding: 6px; }
.news-row { position: relative; display: grid; gap: 5px; width: 100%; padding: 12px 12px 12px 30px; border: 0; border-radius: 14px; background: none; color: var(--muted); text-align: left; font: inherit; }
.news-row:hover { background: rgba(255,255,255,.05); }
.news-row strong { color: var(--ink); font: 600 14px/1.35 var(--sans); }
.news-row:not(.unread) strong { font-weight: 500; color: var(--muted); }
.news-body { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.news-dot { position: absolute; left: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; }
.news-row.unread .news-dot { background: var(--blue-hi); box-shadow: 0 0 0 3px rgba(59,123,255,.22); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .04em; color: var(--faint); }
.news-chip { padding: 4px 8px; border-radius: var(--pill); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--cyan); background: rgba(140,200,255,.1); }
.news-chip--lesson { color: #9DB9FF; background: rgba(59,123,255,.16); }
.news-chip--repo { color: var(--ink); background: rgba(255,255,255,.08); }
.news-chip--free { color: var(--ok); background: rgba(126,224,168,.1); }
.news-chip--members { color: var(--gold); background: rgba(227,179,71,.1); }
.news-chip--news { color: #F0A8D0; background: rgba(240,168,208,.1); }
.news-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.news-empty { margin: 0; padding: 36px 24px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.news-push { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.025); }
.news-push p { margin: 0; display: grid; gap: 3px; }
.news-push strong { font: 600 13px/1.3 var(--sans); color: var(--ink); }
.news-push small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.news-switch { flex: none; position: relative; width: 44px; height: 26px; padding: 0; border: 0; border-radius: var(--pill); background: rgba(255,255,255,.16); }
.news-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .2s ease; }
.news-switch[aria-checked="true"] { background: var(--blue); }
.news-switch[aria-checked="true"] i { transform: translateX(18px); }
@media (max-width: 700px) {
  /* The bell sits at the right end of the sticky bar's logo row (10px padding, 36px row), above the bar itself,
     and its panel drops down under it */
  .news { position: fixed; top: 11px; right: 16px; z-index: 51; }
  .news.open { z-index: 60; }
  .news-bell { width: 34px; height: 34px; }
  .news.open .news-bell { z-index: 60; }
  .news.open .news-scrim { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(3,5,10,.6); }
  .news-panel { top: calc(100% + 10px); max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); }
}
