/* Kernuli: a warm personal assistant, not a database. Cream paper, soft round shapes, shadows instead of lines.
   Inspired by Apple (capsules, frosted glass, concentric corners), ChatGPT (pill composer, bubble-less replies)
   and Muse (warm grays, white cards that float, one violet accent). Colour still comes from the soft abstract
   covers, the course colours and emoji; the chrome stays quiet.
   Type: Rubik for reading and UI (gently rounded corners, great Hebrew), Fredoka for headings and the greeting
   (fully rounded, friendly). Both are served from /fonts (Hebrew + Latin subsets, OFL), never from a third party. */
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/rubik-hebrew.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/rubik-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/fredoka-hebrew.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/fredoka-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --canvas: #f6f3ee;          /* warm paper behind everything (sidebar, phone background) */
  --card: #ffffff;
  --sheet: #fffdfa;           /* the main page: a soft white sheet resting on the paper */
  --inset: #f7f4ef;
  --line: #ece7e0;
  --fill: #efebe5;
  --fill-2: #f5f2ed;
  --ink: #2c2825;
  --ink-2: #6f6862;
  --ink-3: #a39c94;
  --sep: #efeae4;
  --sep-2: #e5dfd7;
  --main: #2c2825;
  --on-main: #ffffff;
  --accent: #5a77ea;          /* periwinkle: the blue end of the backdrop, for links, focus and progress */
  --accent-2: #4964d6;        /* hover / pressed */
  --accent-soft: rgba(90, 119, 234, .14);
  --press-ink: #3b3633;       /* primary buttons: a soft charcoal, like the reference's "Copy link" */
  --red: #e5534b;
  --today: #ef6352;
  --amber: #c9800f;

  --c-moss: #3f9d6b; --c-clay: #e0773f; --c-ink: #4b6fdc;
  --c-plum: #a05cc4; --c-ochre: #cf9a12; --c-sea: #1f9fa5;

  /* aliases the older class names expect */
  --bg: var(--canvas); --side: var(--canvas); --raise: var(--card); --hover: var(--fill-2); --press: var(--fill);
  --rule: var(--sep); --rule-2: var(--sep-2); --focus: var(--accent); --focus-soft: var(--accent-soft);

  --sans: "Rubik", -apple-system, BlinkMacSystemFont, "SF Hebrew", "Segoe UI", "Arial Hebrew", system-ui, sans-serif;
  --display: "Fredoka", "Rubik", ui-rounded, -apple-system, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --r-w: 24px;   /* widget, sheet */
  --r-c: 18px;   /* card / list */
  --r-i: 14px;   /* inputs, small things */
  --r-p: 999px;  /* buttons, chips: capsules */
  /* soft layered shadows instead of hairlines: a whisper of an edge, a short shadow, a wide glow */
  --shadow: 0 0 0 1px rgba(70, 50, 30, .05), 0 1px 2px rgba(70, 50, 30, .04), 0 6px 20px -8px rgba(70, 50, 30, .10);
  --lift: 0 0 0 1px rgba(70, 50, 30, .05), 0 2px 6px rgba(70, 50, 30, .05), 0 14px 34px -10px rgba(70, 50, 30, .16);
  --float: 0 0 0 1px rgba(70, 50, 30, .05), 0 4px 10px rgba(70, 50, 30, .06), 0 18px 48px -8px rgba(70, 50, 30, .20);
  --glass: rgba(255, 253, 250, .78);
  /* the backdrop: quiet warm paper with a fine grain and only a breath of the sky (cool at the top, warm at the
     bottom); the page floats on it like a card. Colour is kept for the bloom and the covers */
  --sky: linear-gradient(172deg, #eceef4 0%, #efedf1 40%, #f2eeeb 75%, #f3eee8 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  .55 .55 0 0 -.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  .55 .55 0 0 -.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* the bloom: Kernuli's glossy flower (chat home, sign-in), the same sky, just louder */
  --sky-soft: linear-gradient(180deg, #f1f2f6 0%, #f4f2f2 45%, #f6f2ed 100%);   /* phones: the same paper, a touch lighter, so text sits on it directly */
  --bloom: conic-gradient(from 200deg at 50% 50%, #ff8db5, #ff9a6c, #ffc174, #f7a8d8, #b9a3ff, #8cb0ff, #ff8db5);
  color-scheme: light;
}

[data-color="moss"]  { --c: var(--c-moss); }
[data-color="clay"]  { --c: var(--c-clay); }
[data-color="ink"]   { --c: var(--c-ink); }
[data-color="plum"]  { --c: var(--c-plum); }
[data-color="ochre"] { --c: var(--c-ochre); }
[data-color="sea"]   { --c: var(--c-sea); }

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html, body { margin: 0; height: 100%; }
/* feel like an app on iPhone and iPad, not a web page:
   - nothing can make the page wider than the screen (that is what let the whole app be zoomed out);
   - the text keeps its size when the phone is turned sideways;
   - no double-tap zoom, no rubber-band of the whole page, no pull-to-refresh or swipe-back from scrolling past the edge;
   - buttons and tabs aren't selected or previewed by a long press (the text in chats and notes still is). */
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body { overflow-x: clip; overscroll-behavior: none; }
button, .btn, .chip, .gp, .tabbar, .nav-item, .nav-chat, .menu, .filters, .tabs, .seg, .status-seg, .topbar-mobile, .side-top, .user-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img.ghost, .brand-mark, .tabbar a, .nav-item, .tabs a { -webkit-touch-callout: none; -webkit-user-drag: none; }
/* a scrolling panel (a sheet, the task, a menu, the side menu) keeps its scroll to itself, not the page behind it */
.modal-body, .drawer-body, .menu, .slash-menu, .palette-list, .nav-courses, .sidebar, .overlay { overscroll-behavior: contain; }
/* and while one is open on a touch screen, the page under it stays still */
@media (hover: none) {
  html:has(> body > .overlay), html:has(> body > .drawer), html:has(> body > .lightbox), html:has(.app.nav-open) { overflow: hidden; }
}
/* iPhone on its side: keep clear of the notch and the rounded corners */
@media (orientation: landscape) and (hover: none) {
  .app { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
}
body { background: var(--canvas); color: var(--ink); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 18px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: 0; }
.mono { font-variant-numeric: tabular-nums; font-size: inherit; }   /* numbers: tabular figures, not a code font */
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.em { font-family: var(--emoji); font-size: 14px; line-height: 1; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
input[type="email"], input[type="time"], input[type="date"], input[type="number"] { direction: ltr; text-align: end; }

/* colour tab */
.tab { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; display: inline-block; }

/* emoji tiles: a soft neutral rounded square; the emoji brings the colour */
.tile, .ctile { width: 28px; height: 28px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; font-family: var(--emoji); font-size: 15px; line-height: 1;
  background: var(--inset); border: 0; padding: 0; }
.ctile.lg { width: 44px; height: 44px; border-radius: 18px; font-size: 24px; }
.ctile.xl { width: 78px; height: 78px; border-radius: 18px; font-size: 56px; cursor: pointer; transition: background .15s; background: none; }
@media (hover: hover) { .ctile.xl:hover { background: var(--fill-2); } }

/* ── controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px;
  border-radius: var(--r-p); border: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .18s, box-shadow .18s, transform .25s var(--spring), opacity .15s;
}
@media (hover: hover) { .btn:hover { background: var(--fill-2); } }
.btn:active { transform: scale(.95); }
.btn.primary { background: var(--press-ink); color: #fff; box-shadow: 0 1px 2px rgba(40, 30, 20, .2), 0 6px 16px -8px rgba(40, 30, 20, .5); }
@media (hover: hover) { .btn.primary:hover { background: var(--ink); } }
.btn.danger { background: var(--red); color: #fff; box-shadow: none; }
.btn.ghost { background: none; color: var(--ink-2); box-shadow: none; }
@media (hover: hover) { .btn.ghost:hover { color: var(--ink); } }
@media (hover: hover) { .btn.ghost:hover { background: var(--fill-2); } }
.btn.sm { height: 30px; padding: 0 13px; font-size: 13.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.wide { width: 100%; height: 46px; font-size: 15px; }
.kbd { font: 500 11px var(--sans); color: var(--ink-3); background: var(--fill-2); border-radius: 8px; padding: 1px 5px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13.5px; cursor: pointer; justify-self: start; }
@media (hover: hover) { .link-btn:hover { text-decoration: underline; } }
.link { color: var(--accent); }
@media (hover: hover) { .link:hover { text-decoration: underline; } }

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .textarea {
  width: 100%; height: 42px; padding: 0 14px; background: var(--fill-2);
  border: 1px solid transparent; border-radius: var(--r-i); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }
.hint { font-size: 12px; color: var(--ink-3); }
.select { appearance: none; padding-inline-end: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 11px center; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fgrid .full { grid-column: 1 / -1; }
.row-2 { display: grid; grid-template-columns: 1fr 130px; gap: 10px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--fill); border-radius: var(--r-p); width: max-content; }
.seg button { border: 0; background: none; height: 30px; padding: 0 16px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-radius: var(--r-p); transition: background .2s, color .2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(70, 50, 30, .12), 0 0 0 .5px rgba(70, 50, 30, .05); font-weight: 600; }
.filters { display: inline-flex; padding: 3px; gap: 2px; background: var(--fill); border-radius: var(--r-p); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { border: 0; background: none; height: 30px; padding: 0 14px; border-radius: var(--r-p); color: var(--ink-2); font-size: 13px; font-weight: 500; display: flex; gap: 6px; align-items: center; white-space: nowrap; flex: none; }
.filters button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(70, 50, 30, .12); font-weight: 600; }
.filters .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; background: var(--fill-2); border-radius: var(--r-p); padding: 7px 14px; font-size: 13.5px; color: var(--ink); white-space: nowrap; flex: none; }
@media (hover: hover) { .chip:hover { background: var(--fill); } }
.chip.sm { padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.chip.on { background: var(--main); color: var(--on-main); }
.pill { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: var(--r-p); background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--c-moss) 16%, transparent); color: var(--c-moss); }

/* switch, iOS proportions */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: var(--fill); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--main); }
.switch input:checked + span::after { background: var(--on-main); }
.switch input:checked + span::after { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* checkbox: a round Reminders-style check */
.check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: none;
  display: grid; place-items: center; padding: 0; flex: none; transition: background .15s, border-color .15s;
}
@media (hover: hover) { .check:hover { border-color: var(--c, var(--ink)); } }
.check svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .22s .04s var(--ease); }
.check.on { background: var(--c, var(--main)); border-color: var(--c, var(--main)); }
.check.on svg { stroke: var(--card); }
.check.on svg { stroke-dashoffset: 0; }
.check.pop { animation: pop .3s var(--ease); }
@keyframes pop { 50% { transform: scale(.8); } }
/* finished, not handed in yet: a half-filled amber circle (the next tap marks it handed in) */
.check.ready { border-color: var(--amber); background: linear-gradient(to left, var(--amber) 50%, transparent 50%); box-shadow: inset 0 0 0 2px var(--card); }
@media (hover: hover) { .check.ready:hover { border-color: var(--amber); } }
.ready-pill { display: inline-flex; align-items: stretch; flex: none; width: max-content; border: 0; padding: 0; border-radius: 99px; overflow: hidden; cursor: pointer;
  font-size: 12px; font-weight: 600; line-height: 1; background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); transition: transform .12s; }
.ready-pill span, .ready-pill b { display: flex; align-items: center; padding: 4px 8px; white-space: nowrap; }
.ready-pill b { background: var(--amber); color: #fff; font-weight: 600; }
@media (hover: hover) { .ready-pill:hover b { background: color-mix(in srgb, var(--amber) 88%, #000); } }
.ready-pill:active { transform: scale(.96); }
.ready-tag { font-size: 11.5px; font-weight: 600; color: var(--amber); background: color-mix(in srgb, var(--amber) 13%, transparent); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.status-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: var(--fill); border-radius: 16px; }
.status-seg button { border: 0; background: none; height: 34px; padding: 0 6px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.status-seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.status-seg button.s-ready { color: var(--amber); }
.status-seg button.s-done { color: var(--c, var(--ink)); }

/* ── brand ── */
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 600; font-size: 18px; }
.brand-mark { width: 26px; height: 26px; flex: none; display: block; }

/* ── shell ── */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; background: var(--grain), var(--sky); background-attachment: fixed; }
.sidebar { position: sticky; top: 0; height: 100vh; background: transparent; display: flex; flex-direction: column; padding: 14px 10px 12px; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 14px; padding-inline: 10px 2px; }
.side-top .btn { color: var(--ink-2); }
.side-top .btn, .nav-section .btn { background: none; box-shadow: none; }
@media (hover: hover) { .side-top .btn:hover, .nav-section .btn:hover { background: rgba(255, 255, 255, .5); } }
.nav-main { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r-p); color: #4f4842; font-size: 14.5px; font-weight: 500; width: 100%; border: 0; background: none; text-align: start; transition: background .12s; }
@media (hover: hover) { .nav-item:hover { background: rgba(255, 255, 255, .42); color: var(--ink); } }
.nav-item.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.nav-item .tile, .nav-item .ctile { background: transparent; width: 22px; height: 22px; font-size: 16px; }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { margin-inline-start: auto; font-size: 13px; color: #8a8079; font-variant-numeric: tabular-nums; }
.nav-section { display: flex; align-items: center; justify-content: space-between; padding: 22px 12px 6px; font-size: 12.5px; color: #7d736c; font-weight: 500; }
.nav-section .btn { color: var(--ink-2); }
.nav-courses { flex: 1; overflow-y: auto; display: grid; gap: 2px; align-content: start; padding: 2px; margin: -2px; }
.nav-empty { padding: 4px 8px; color: var(--ink-3); font-size: 13px; }
/* semester folders in the sidebar (navCourses): a folder row, and its courses as small grey lines under it, Notion style */
.nav-fold .fold-chev { width: 14px; height: 14px; display: inline-grid; place-items: center; flex: none; color: #9a908a; margin-inline-end: -6px; transition: transform .15s; transform: rotate(90deg); }
.nav-fold .fold-chev .i { width: 14px; height: 14px; }
.nav-folder.open > .nav-fold .fold-chev { transform: none; }
.nav-fold .fold-now { font-size: 11px; color: #8a8079; background: rgba(255, 255, 255, .55); border-radius: 999px; padding: 1px 7px; flex: none; }
.nav-folder.faded > .nav-fold { color: #8a8079; }
.nav-sub { display: none; gap: 1px; margin: 1px 0 6px; padding-inline-start: 30px; }
.nav-folder.open > .nav-sub { display: grid; }
.nav-subitem { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: 13px; color: var(--ink-2); min-width: 0; transition: background .12s; }
.nav-subitem .em { font-family: var(--emoji); font-size: 13px; flex: none; opacity: .8; }
.nav-subitem .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-subitem:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.nav-subitem.on { color: var(--ink); font-weight: 600; background: rgba(255, 255, 255, .6); }
.nav-folder.faded .nav-subitem { color: var(--ink-3); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 8px; border: 0; background: none; border-radius: 20px; text-align: start; width: 100%; transition: background .12s; }
@media (hover: hover) { .user-chip:hover { background: rgba(255, 255, 255, .55); } }
.user-chip > svg.i { color: var(--ink-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--main); color: var(--on-main); display: grid; place-items: center; font: 600 11.5px var(--sans); flex: none; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.3; display: grid; }
.user-chip .name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .email { font-size: 12px; color: #6f6862; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }

/* the page: a soft sheet that rests on the paper, rounded like an Apple window (overflow: clip keeps sticky bars working) */
.main { min-width: 0; margin: 10px; margin-inline-end: 0; background: var(--sheet); border-radius: 28px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6), 0 2px 6px rgba(80, 50, 60, .05), 0 24px 60px -24px rgba(80, 50, 60, .28); overflow: clip; min-height: calc(100vh - 20px); }
.topbar-mobile, .tabbar, .nav-scrim { display: none; }
.view { max-width: 1080px; margin: 0 auto; padding: 40px 56px 96px; }
/* Notion's "full width": the courses and missions pages, and every course page, use the whole window */
.view.wide { max-width: none; padding-inline: 96px; }
@media (max-width: 1100px) { .view.wide { padding-inline: 56px; } }

/* ── headers ── */
.hero, .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.hero h1, .page-head h1 { font-size: 40px; line-height: 1.2; font-weight: 600; margin: 0; display: flex; align-items: baseline; gap: 10px; }
.page-head h1 .mono { font-size: 17px; color: var(--ink-3); font-weight: 500; }
.eyebrow { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.greet { color: var(--ink-2); font-size: 14px; margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.facts b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.facts .bad b { color: var(--red); }

/* ── cards ── */
.card, .conn { background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 20px 22px; margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head h2 .faint { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.count-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--today); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.seg-nav { display: flex; align-items: center; gap: 2px; }

.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-head h2 { font-size: 20px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-head .mono, .section-head .faint { font-size: 13.5px; color: var(--ink-2); }

/* ── week ── */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { min-height: 210px; display: flex; flex-direction: column; min-width: 0; border-radius: 20px; }
.day.weekend .day-body { opacity: .85; }
.day.today { background: var(--inset); }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px; }
.day-head .dn { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.day-head .dd { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.day.today .day-head .dn { color: var(--today); }
.day.today .day-head .dd { background: var(--today); color: #fff; }
.day-body { padding: 2px 4px 6px; display: grid; gap: 3px; align-content: start; flex: 1; }
.day-empty { color: var(--ink-3); font-size: 12px; padding: 6px; }

/* timetable slots: tinted blocks like a calendar event */
.slot { display: grid; gap: 1px; padding: 7px 9px; border-radius: 16px; background: color-mix(in srgb, var(--c) 9%, var(--card)); border-inline-start: 3px solid var(--c); cursor: pointer; font-size: 12px; line-height: 1.35; transition: background .12s; }
@media (hover: hover) { .slot:hover { background: color-mix(in srgb, var(--c) 15%, var(--card)); } }
.slot .mono { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.slot-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.slot-t .em { font-size: 12px; }
.slot-l { color: var(--ink-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week.tall { background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 10px; }
.week.tall .day { min-height: 300px; }

/* ── progress ── */
.prog { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.bar { flex: 1; height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 999px; transition: width .5s var(--ease); }

/* ── course gallery ── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; border-radius: var(--r-w); background: var(--card); box-shadow: var(--shadow); border: 0; text-align: start; transition: box-shadow .2s var(--ease), background .2s; min-height: 196px; overflow: hidden; }
.gcover { height: 92px; margin: 0 -16px; position: relative; }
.gcover .art { position: absolute; inset: 0; opacity: .6; }
.gcover .art i { width: calc(var(--s) * 1.25); filter: blur(16px) saturate(1.2); }
.gcard .gtop { margin-top: -26px; position: relative; align-items: flex-end; }
.gcard .gtop .ctile.lg { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
@media (hover: hover) { .gcard:hover { box-shadow: var(--float); } }
.gtop { display: flex; align-items: flex-start; justify-content: space-between; }
.gpct { font-size: 20px; font-weight: 600; letter-spacing: -.03em; color: var(--c); font-variant-numeric: tabular-nums; }
.gbody { display: grid; gap: 10px; margin-top: auto; }
.gcode { font-size: 12px; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.gtitle { font-weight: 700; font-size: 16.5px; line-height: 1.25; letter-spacing: -.015em; }
.gteach { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink); margin-top: -2px; }
.gav { display: flex; flex: none; }
.gav .av { box-shadow: 0 0 0 2px var(--card); }
.gav .av + .av { margin-inline-start: -7px; }
.gnames { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gnames .faint { color: var(--ink-3); }
.gmeta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.gmeta .due { font-size: 12.5px; }
/* grey courses (BGU: the university's general courses, courses without a syllabus): a quiet list under the real ones */
.grey-head { margin-top: 32px; }
/* the courses page by semester: a heading over each semester's gallery */
.sem-head { margin-top: 28px; flex-wrap: wrap; gap: 2px 12px; }
.sem-head h2 { white-space: nowrap; }
.sem-head .faint { white-space: nowrap; }
.sem-head:first-child { margin-top: 4px; }
.sem-head + .gallery + .gallery { margin-top: 16px; }
.grey-list { display: flex; flex-wrap: wrap; gap: 8px; }
.grey-row { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 12px; background: var(--fill-2); color: var(--ink-3); font-size: 14px; filter: grayscale(1); }
@media (hover: hover) { .grey-row:hover { color: var(--ink-2); background: rgba(70, 50, 30, .06); } }
.grey-row .ctile { background: transparent; width: 20px; height: 20px; font-size: 15px; opacity: .7; }
.nav-item.muted { color: var(--ink-3); filter: grayscale(1); opacity: .7; }
.grey-note { color: var(--ink-3); }
.gcard.new { align-items: center; justify-content: center; flex-direction: row; gap: 8px; background: none; box-shadow: none; border: 1px dashed var(--sep-2); color: var(--ink-2); font-size: 15px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .gcard.new:hover { background: var(--fill-2); color: var(--ink); transform: none; box-shadow: none; } }

/* ── grouped lists (tables) ── */
.otable, .table { background: var(--card); border-radius: var(--r-c); box-shadow: var(--shadow); overflow: hidden; }
.orow { display: grid; gap: 14px; align-items: center; min-height: 48px; padding: 0 16px; font-size: 14px; cursor: pointer; position: relative; }
.orow + .orow::before, .otable > .add-row::before, .otable > .empty + .add-row::before { content: ""; position: absolute; top: 0; inset-inline: 16px 0; border-top: 1px solid var(--sep); }
@media (hover: hover) { .orow:hover { background: var(--fill-2); } }
.orow.th { min-height: 36px; font-size: 12px; color: var(--ink-2); font-weight: 600; cursor: default; background: var(--inset); }
@media (hover: hover) { .orow.th:hover { background: var(--inset); } }
.orow.th + .orow::before { display: none; }
.orow .r, .orow.th .r { text-align: end; }
.mrow { grid-template-columns: 20px minmax(0, 2fr) 84px minmax(150px, 1.2fr) 150px 96px; }
.mrow .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mrow.done .title { color: var(--ink-3); text-decoration: line-through; }
.mrow .mt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cref { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); font-weight: 500; max-width: 100%; }
@media (hover: hover) { .cref:hover { color: var(--ink); } }
.add-row { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; color: var(--accent); width: 100%; border: 0; background: none; font-size: 14px; font-weight: 500; text-align: start; position: relative; }
@media (hover: hover) { .add-row:hover { background: var(--fill-2); } }
.empty { color: var(--ink-2); font-size: 14px; padding: 28px 16px; text-align: center; }
.empty b { color: var(--ink); font-weight: 600; display: block; margin-bottom: 4px; font-size: 15px; }
.mlist > .empty, .view > .empty { background: var(--card); border-radius: var(--r-c); box-shadow: var(--shadow); }

.kind { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.kind.k-exam { color: var(--red); }
.kind.k-assignment { color: var(--c-ink); }
.kind.k-reading { color: var(--c-sea); }
.kind.k-project { color: var(--c-plum); }
.prio { font-size: 12px; font-weight: 600; }
.prio.high { color: var(--red); }
.prio.low { color: var(--ink-3); }
.due { font-size: 13px; color: var(--ink-2); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
.due.overdue { color: var(--red); font-weight: 600; }
.due.today { color: var(--amber); font-weight: 600; }

/* ── avatars ── */
.av { display: inline-grid; place-items: center; border-radius: 50%; flex: none; background: var(--fill); color: var(--ink-2); font-weight: 600; line-height: 1; letter-spacing: 0; vertical-align: middle; }
.pname { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.mission .mt .av, .mrow .mt .av { margin-inline-start: 2px; }
.teacher { display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 0 1 auto; margin-inline-start: 4px; padding: 1px 8px 1px 2px; border-radius: 999px; background: var(--inset); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.teacher .av { margin: 0 !important; }
.teacher .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.done .teacher { opacity: .6; }
.tcell { display: flex; min-width: 0; }
.tcell .teacher { margin: 0; max-width: 100%; }
.teacher.t-inline { display: none; }

/* ── course page ── */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--accent); margin-bottom: 18px; }
.crumbs svg.i { width: 14px; height: 14px; color: var(--ink-3); }
.crumbs span { color: var(--ink-2); }
@media (hover: hover) { .crumbs a:hover { text-decoration: underline; } }
.course-head { padding: 6px 0 4px; }
.page-title-row { display: flex; align-items: flex-start; gap: 8px; }
.page-title-row h1 { flex: 1; min-width: 0; font-size: 40px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 16px; }
.page-title-row .btn { margin-top: 10px; }
.ctitle { outline: none; border-radius: var(--r-i); cursor: text; overflow-wrap: anywhere; }
.ctitle:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }
/* properties: one row across the page, a small gray label over each value, so the page below stays open for writing */
.cprops { display: flex; flex-wrap: wrap; gap: 12px 36px; }
.cprop { display: grid; gap: 2px; align-content: start; min-width: 0; }
.cprop-k { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.cprop-k svg.i { width: 14px; height: 14px; }
.cprop-v { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; min-height: 30px; font-size: 14px; }
@media (hover: hover) { .cprop-v a.mono:hover { text-decoration: underline; } }
.cprop-v .prog { width: 150px; }
.cprop-empty, .cprop-person { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; margin-inline-start: -6px; border-radius: var(--r-i); font-size: 14px; }
.cprop-empty { color: var(--ink-3); }
@media (hover: hover) { .cprop-empty:hover, .cprop-person:hover { background: var(--fill-2); color: var(--ink); } }
.cdesc { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); max-width: 820px; line-height: 1.6; white-space: pre-line; }   /* an imported description: about · grading · good to know, a line each */
.course-days { display: flex; flex-wrap: wrap; gap: 6px; }
.course-day { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: 0; border-radius: var(--r-i); background: var(--fill-2); color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; transition: background .15s; }
@media (hover: hover) { .course-day:hover { background: var(--fill); } }
.course-day b { color: var(--ink); font-weight: 600; }
.course-day span { color: var(--ink-3); }

/* links: the course's bookmarks, small cards in one row that wraps */
.course-links { margin: 22px 0 18px; }
.block-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; letter-spacing: -.01em; }
.course-links .block-title { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-bottom: 6px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.clink { display: flex; align-items: center; min-width: 0; max-width: 280px; background: var(--card); border-radius: var(--r-i); box-shadow: var(--shadow); transition: background .15s; }
@media (hover: hover) { .clink:hover { background: var(--fill-2); } }
.clink > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 12px; }
.link-em { font: 20px/1 var(--emoji); flex: none; }
.link-txt { display: grid; min-width: 0; line-height: 1.3; }
.link-t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-t[dir="ltr"], .link-u { text-align: right; }
.link-u { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clink > .btn { opacity: 0; margin-inline-end: 6px; }
.clink:hover > .btn, .clink:focus-within > .btn { opacity: 1; }
@media (hover: none) { .clink > .btn { opacity: 1; } }
/* from Moodle (materialsHtml): soft tiles at a glance (join the meeting, hand-ins, materials, forum), and under them the
   one that is open: rows that open on Moodle, folded by Moodle's own sections */
/* the course's own Kernuli: the nerd ghost in place of the cover icon, with one speech bubble (like a phone message)
   saying it read the course. The bubble opens a chat with it; "מה קראתי" under it lists the files. */
.chero { --c: var(--accent); position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 10px; margin-top: -66px; margin-bottom: 6px; }
.cghost { position: relative; flex: none; display: block; width: 92px; height: 92px; }
.cghost img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--c) 30%, transparent)); animation: bghost-float 5s ease-in-out infinite; }
.cghost::before { content: ""; position: absolute; inset: 6% -10% -4%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 28%, transparent), transparent); filter: blur(10px); }
.cghost-badge { position: absolute; inset-inline-start: -4px; bottom: 4px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff;
  font: 18px/1 var(--emoji); box-shadow: 0 2px 6px rgba(70, 50, 30, .16), 0 0 0 2px color-mix(in srgb, var(--c) 35%, #fff); cursor: pointer; }
@keyframes bghost-float { 50% { transform: translateY(-5px) rotate(-2deg); } }
.cbubble-wrap { display: grid; justify-items: start; gap: 4px; margin-bottom: 22px; min-width: 0; }
.cbubble { position: relative; max-width: 330px; padding: 9px 15px; border: 0; border-radius: 20px; border-end-start-radius: 6px; background: #e9e9eb; color: #1c1c1e;
  font: inherit; text-align: start; cursor: pointer; box-shadow: 0 6px 18px -10px rgba(40, 30, 20, .25); animation: cb-pop .45s var(--spring) both; transition: background .15s, transform .2s var(--spring); }
.cbubble::before { content: ""; position: absolute; bottom: 0; inset-inline-start: -6px; width: 16px; height: 16px; background: #e9e9eb; clip-path: polygon(100% 0, 100% 100%, 0 100%); border-end-start-radius: 4px; }
@media (hover: hover) { .cbubble:hover, .cbubble:hover::before { background: #e1e1e4; } }
.cbubble:active { transform: scale(.97); }
.cb-text { display: grid; gap: 1px; line-height: 1.35; }
.cb-text b { font-size: 15.5px; font-weight: 600; }
.cb-text small { font-size: 13px; color: #48484d; }
.cb-dots { display: none; gap: 4px; padding: 4px 2px; }
.cb-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9a9aa0; animation: kt-dot 1s ease-in-out infinite; }
.cb-dots i:nth-child(2) { animation-delay: .15s; } .cb-dots i:nth-child(3) { animation-delay: .3s; }
.cbubble.typing .cb-dots { display: flex; } .cbubble.typing .cb-text { display: none; }
.cbubble:not(.typing) .cb-text { animation: cb-pop .4s var(--spring) both; }
@keyframes cb-pop { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes kt-dot { 50% { transform: translateY(-3px); opacity: .5; } }
.cb-more { margin-inline-start: 12px; padding: 0; border: 0; background: none; font: 500 12px var(--sans); color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.cb-more .i { width: 12px; height: 12px; transition: transform .25s var(--ease); }
.cb-more.on .i { transform: rotate(180deg); }
@media (hover: hover) { .cb-more:hover { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .cghost img, .cbubble, .cb-text { animation: none !important; } }
.course-brain { margin: 0 0 18px; }
@media (max-width: 640px) { .chero { margin-top: -50px; } .cghost { width: 76px; height: 76px; } .cbubble { max-width: 250px; } .cbubble-wrap { margin-bottom: 14px; } }
/* the chat, opened from a course: that course's Kernuli greets */
.kb-cover .brand-mark.kb-ghost { position: relative; z-index: 2; width: 96px; height: 96px; }
.kb-cover .cghost-badge { position: absolute; inset-inline-start: -4px; bottom: 4px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff;
  font: 19px/1 var(--emoji); box-shadow: 0 2px 6px rgba(70, 50, 30, .16), 0 0 0 2px color-mix(in srgb, var(--c) 35%, #fff); }
.kb-cover .kb-ghost img { width: 100%; height: 100%; object-fit: contain; }
.kb-cover { --bloom: conic-gradient(from 200deg at 50% 50%, var(--c), color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 70%, #ffc174), color-mix(in srgb, var(--c) 40%, #fff), var(--c)); }
/* Kernuli's friends: a row of round characters above Kernuli's own empty chat, one per course (kernuliRow) */
.kn-pals { display: none; }
.chat-view.is-empty .kn-pals { display: flex; gap: 12px; margin: 4px -16px auto; padding: 8px 16px 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; animation: rise .6s var(--ease) both; }
.chat-view.is-empty .kn-pals::-webkit-scrollbar { display: none; }
.chat-view.is-empty:has(.kn-pals) .chat-suggest { margin-bottom: auto; }
.kn-pal:first-child { margin-inline-start: auto; } .kn-pal:last-child { margin-inline-end: auto; }
.kn-pal { flex: none; width: 78px; display: grid; justify-items: center; align-content: start; gap: 7px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; }
.kn-face { position: relative; width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 78%);
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--c) 80%, transparent), inset 0 -5px 12px rgba(0, 0, 0, .07); transition: transform .25s var(--spring); }
.kn-face img { position: absolute; inset: 0; margin: auto; width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(40, 30, 20, .18)); }
.kn-em { position: absolute; inset-inline-end: -3px; bottom: -2px; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #fff; font: 13px/1 var(--emoji); box-shadow: 0 1px 4px rgba(70, 50, 30, .2); }
.kn-name { max-width: 100%; font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--ink-2); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) { .kn-pal:hover .kn-face { transform: translateY(-2px) scale(1.05); } .kn-pal:hover .kn-name { color: var(--ink); } }
.kn-pal:active .kn-face { transform: scale(.94); }
/* a course's Kernuli's chat: its face and name on top (to the course's page), and the way back to Kernuli */
.kn-head { display: flex; align-items: center; gap: 2px; min-width: 0; height: 36px; margin-inline-end: auto; padding: 3px; padding-inline-end: 14px; border-radius: 999px; pointer-events: auto;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); box-shadow: var(--shadow); }
.chat-top .kn-head .btn { width: 30px; height: 30px; box-shadow: none; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.kn-head a { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 52vw; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.kn-head img { flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 50%; object-fit: contain; background: color-mix(in srgb, var(--c) 35%, #fff); }
@media (max-width: 640px) { .chat-view.is-empty.is-course .chat-top { display: flex; } .chat-view.is-empty .kn-pals { margin-top: 0; } }
.kb-chat-h { display: grid; gap: 2px; }
.kb-chat-h small { font: 600 13px var(--sans); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.kb-chat-p { color: var(--ink-2); }
.bpanel { padding: 8px; }
.bgroup + .bgroup { border-top: 1px solid var(--sep); margin-top: 4px; padding-top: 4px; }
.bgroup h4 { margin: 6px 8px 2px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.bfile { width: 24px; height: 24px; flex: none; border-radius: 8px; display: grid; place-items: center; background: #e4f4ea; color: var(--c-moss); font-size: 12px; font-weight: 700; }
.mrow.later { color: var(--ink-3); }
.mrow.later .bfile { background: var(--fill); color: var(--ink-3); }
.mread { width: 20px; height: 20px; flex: none; object-fit: contain; }
.gbrain { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent-2); font-weight: 500; }
.gbrain img { width: 20px; height: 20px; object-fit: contain; }
.course-mat { margin: 0 0 18px; }
.course-mat .block-title { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-bottom: 6px; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.mtile { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 8px 12px; background: var(--card); border: 0; border-radius: var(--r-c);
  box-shadow: var(--shadow); color: var(--ink); text-align: start; font: inherit; cursor: pointer; transition: background .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
@media (hover: hover) { .mtile:hover { background: var(--fill-2); } }
.mtile:active { transform: scale(.98); }
.mtile-em { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--fill-2); font: 19px/1 var(--emoji); }
.mtile-t { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.mtile-t b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtile-t small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtile > .i { flex: none; color: var(--ink-3); width: 16px; height: 16px; transition: transform .25s var(--ease); }
.mtile.on { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.mtile.on > .i { transform: rotate(180deg); color: var(--accent); }
/* the meeting: the one tile with colour, a breath of the bloom, since it's the thing to tap when class starts */
.mtile.live { background: linear-gradient(135deg, #eef1fd 0%, #f6eefa 55%, #fdf0ea 100%); }
.mtile.live .mtile-em { background: rgba(255, 255, 255, .8); }
.mtile.live b { color: var(--accent-2); }
@media (hover: hover) { .mtile.live:hover { background: linear-gradient(135deg, #e6eafc 0%, #f1e6f7 55%, #fbe8df 100%); } }
.mpanel { margin-top: 8px; padding: 6px; background: var(--card); border-radius: var(--r-c); box-shadow: var(--shadow); animation: mpanel-in .28s var(--ease); }
@keyframes mpanel-in { from { opacity: 0; transform: translateY(-4px); } }
.mrow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-radius: var(--r-i); color: var(--ink); }
a.mrow { text-decoration: none; }
@media (hover: hover) { .mrow:hover { background: var(--fill-2); } }
.mrow-t { display: grid; flex: 1; min-width: 0; line-height: 1.3; color: inherit; text-decoration: none; font-size: 14px; }
.mrow-t small { font-size: 12px; color: var(--ink-3); }
.mrow > .i { flex: none; width: 15px; height: 15px; color: var(--ink-3); opacity: 0; transition: opacity .15s; }
.mrow:hover > .i, .mrow:focus-visible > .i { opacity: 1; }
@media (hover: none) { .mrow > .i { opacity: .6; } }
.mrow .mrow-act { color: var(--accent-2); }
.mpill { flex: none; padding: 3px 10px; border-radius: var(--r-p); background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mpill.today { background: #fdf1dc; color: var(--amber); font-weight: 600; }
.mpill.overdue { background: #fde8e6; color: var(--red); font-weight: 600; }
.mpill.ok { background: #e4f4ea; color: var(--c-moss); }
/* a file's type as a small coloured label, like the file icons on Moodle but softer */
.ftile { width: 28px; height: 28px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; font: 700 9px/1 var(--sans); letter-spacing: .02em; }
.ftile.f-red { background: #fde8e6; color: #d2463e; } .ftile.f-clay { background: #fcebe0; color: #c9622c; }
.ftile.f-ink { background: #e8edfb; color: #3f5fc8; } .ftile.f-moss { background: #e4f4ea; color: #2f8458; }
.ftile.f-plum { background: #f2e8f8; color: #8b4bb0; } .ftile.f-sea { background: #e0f3f3; color: #1a8a8f; }
.ftile.f-ochre { background: #f8f0d9; color: #a87c0c; } .ftile.f-grey { background: var(--fill); color: var(--ink-2); }
.msearch { display: flex; align-items: center; gap: 8px; margin: 2px 2px 6px; padding: 0 12px; min-height: 40px; background: var(--fill-2); border-radius: var(--r-p); color: var(--ink-3); }
.msearch input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--ink); }
.msearch:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.mgroup + .mgroup { border-top: 1px solid var(--sep); }
.mgroup > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 8px; list-style: none; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); border-radius: var(--r-i); }
.mgroup > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .mgroup > summary:hover { background: var(--fill-2); } }
.mgroup > summary .i { width: 15px; height: 15px; color: var(--ink-3); transform: rotate(90deg); transition: transform .2s var(--ease); }
.mgroup[open] > summary .i { transform: none; }
.mgroup > summary .n { margin-inline-start: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--fill); padding: 1px 8px; border-radius: var(--r-p); }
.mgroup > .mrow { margin-inline-start: 14px; }
.mempty { margin: 12px; color: var(--ink-3); font-size: 13.5px; text-align: center; }
/* the course's board, read here: each message folds like a section, the newest open; its text as the lecturer wrote it */
.npost + .npost { border-top: 1px solid var(--sep); }
.npost > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px; list-style: none; cursor: pointer; border-radius: var(--r-i); }
.npost > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .npost > summary:hover { background: var(--fill-2); } }
.npost-t { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.npost-t b { font-weight: 600; font-size: 14.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npost-t small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npost > summary > .i { flex: none; width: 15px; height: 15px; color: var(--ink-3); transform: rotate(90deg); transition: transform .2s var(--ease); }
.npost[open] > summary > .i { transform: none; }
.npost[open] > summary .npost-t b { white-space: normal; }
.npost-body { padding: 2px 10px 12px; font-size: 14.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.npost-body > :first-child { margin-top: 0; } .npost-body > :last-child { margin-bottom: 0; }
.npost-body p, .npost-body div { margin: 0 0 8px; }
.npost-body h1, .npost-body h2, .npost-body h3, .npost-body h4, .npost-body h5, .npost-body h6 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; }
.npost-body ul, .npost-body ol { margin: 0 0 8px; padding-inline-start: 22px; }
.npost-body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.npost-body img { max-width: 100%; height: auto; border-radius: var(--r-i); }
.npost-body table { border-collapse: collapse; margin: 6px 0 10px; font-size: 13.5px; display: block; max-width: 100%; overflow-x: auto; }
.npost-body td, .npost-body th { border: 1px solid var(--sep); padding: 4px 8px; text-align: start; }
.npost-body blockquote { margin: 6px 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--sep); color: var(--ink-2); }
.npost-body hr { border: 0; border-top: 1px solid var(--sep); margin: 10px 0; }
.npost-files { padding: 0 0 8px; }
@media (max-width: 640px) { .mtiles { grid-template-columns: 1fr 1fr; } .mtile { min-height: 64px; flex-wrap: wrap; } .mtile > .i { display: none; } .mgroup > .mrow { margin-inline-start: 0; } }
.link-add { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px dashed var(--sep-2); border-radius: var(--r-i); background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-align: start; }
@media (hover: hover) { .link-add:hover { background: var(--fill-2); color: var(--ink); } }
.link-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; background: var(--card); border-radius: var(--r-i); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.link-form input { flex: 1 1 220px; min-width: 0; height: 34px; border: 0; outline: none; background: var(--fill-2); border-radius: var(--r-i); padding: 0 10px; }
.link-form input:focus { background: var(--card); box-shadow: 0 0 0 2px var(--accent); }
.link-form .form-error { flex-basis: 100%; }
.link-sugg { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 2px 6px; }
.link-sugg > .faint { font-size: 12px; margin-inline-end: 2px; }
.link-sugg .chip { display: inline-flex; align-items: center; gap: 5px; }
.link-sugg .chip .em { font-family: var(--emoji); }
.link-sugg .chip svg.i { width: 12px; height: 12px; color: var(--ink-3); }
.link-form .form-error:empty { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; gap: 6px; align-items: center; height: 36px; padding: 0 8px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
@media (hover: hover) { .tabs a:hover { color: var(--ink); } }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 12px; flex-wrap: wrap; }
.toolbar > div:last-child { display: flex; gap: 6px; }

/* a course's missions: one list, with a header row like a Notion table */
.mlist { background: var(--card); border-radius: var(--r-c); box-shadow: var(--shadow); overflow: hidden; }
.mission.th { min-height: 34px; font-size: 12px; color: var(--ink-2); font-weight: 600; cursor: default; background: var(--inset); }
@media (hover: hover) { .mission.th:hover { background: var(--inset); } }
.mission.th::before, .mission.th + *::before { display: none; }
.mission.th .r { text-align: end; }

.mission { display: grid; grid-template-columns: 20px minmax(0, 1fr) 84px 150px 96px 30px; gap: 10px; align-items: center; min-height: 46px; padding: 0 10px 0 16px; cursor: pointer; position: relative; }
.mission::before { content: ""; position: absolute; top: 0; inset-inline: 46px 0; border-top: 1px solid var(--sep); }
@media (hover: hover) { .mission:hover { background: var(--fill-2); } }
.mission .mt { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mission .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.mission.done .title { color: var(--ink-3); text-decoration: line-through; }
.mission.done .due, .mission.done .kind { color: var(--ink-3); }
.mission .note-ind { color: var(--ink-3); display: inline-flex; }
.mission .note-ind svg.i { width: 14px; height: 14px; }
.mission .del { opacity: 0; color: var(--red); }
.mission:hover .del, .mission:focus-within .del { opacity: 1; }
.mission.leaving { opacity: 0; transition: opacity .2s; }
.mission.entering { animation: enter .7s var(--ease); }
@keyframes enter { from { background: var(--accent-soft); } }

.done-divider { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; text-align: start; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); position: relative; }
.done-divider::before { content: ""; position: absolute; top: 0; inset-inline: 46px 0; border-top: 1px solid var(--sep); }
@media (hover: hover) { .done-divider:hover { color: var(--ink); } }
.done-divider svg.i { width: 13px; height: 13px; }

.add-mission { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; height: 46px; padding: 0 16px; color: var(--accent); position: relative; }
.add-mission::before { content: ""; position: absolute; top: 0; inset-inline: 46px 0; border-top: 1px solid var(--sep); }
.add-mission .faint { color: var(--accent); }
.add-mission input { border: 0; outline: none; background: none; height: 100%; width: 100%; color: var(--ink); font-size: 14.5px; }
.add-mission input::placeholder { color: var(--ink-3); }
.add-preview { display: flex; gap: 12px; padding: 0 16px 10px 46px; padding-inline: 46px 16px; }
.add-preview:empty { display: none; }
.add-hint { display: none; color: var(--ink-3); font-size: 12px; padding-inline: 46px 16px; padding-bottom: 10px; }
.add-mission:focus-within + .add-preview:empty + .add-hint { display: block; }
.add-hint code { font: 11.5px var(--mono); color: var(--ink-2); background: var(--fill-2); padding: 1px 4px; border-radius: 7px; }


/* ── menus, modals, drawer, palette ── */
.menu { position: fixed; z-index: 60; min-width: 210px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--card); border-radius: 20px; box-shadow: var(--float); padding: 6px; transform-origin: top; animation: pop-in .22s var(--spring); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: 0; background: none; border-radius: 14px; text-align: start; font-size: 13.5px; }
@media (hover: hover) { .menu button:hover { background: var(--fill-2); } }
.menu button.danger { color: var(--red); }
@media (hover: hover) { .menu button.danger:hover { background: var(--red); color: #fff; } }
.menu hr { border: 0; border-top: 1px solid var(--sep); margin: 5px 10px; }

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(44, 34, 24, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 11vh 16px 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); min-width: 0; background: var(--card); border-radius: 30px; box-shadow: var(--float); display: flex; flex-direction: column; max-height: 82vh; animation: modal-in .38s var(--spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { padding: 26px 28px 0; }
.modal-head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.modal-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.modal-body { padding: 18px 28px; display: grid; gap: 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 24px; }
.modal-foot .btn { height: 40px; padding: 0 20px; }
.modal:has(.sa-list) { width: min(1000px, 100%); }
.modal:has(.mission-form) { width: min(620px, 100%); }

.swatches { display: flex; gap: 10px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--c); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
.emoji-opt { font-family: var(--emoji); font-size: 20px; height: 36px; border: 0; background: none; border-radius: 14px; cursor: pointer; }
@media (hover: hover) { .emoji-opt:hover { background: var(--fill-2); } }
.emoji-opt.on { background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--sep-2); }

.drawer-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(44, 34, 24, .18); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
/* a mission opens as a page in the middle of the screen (Notion's "center peek"): title, properties, then open space to write */
.drawer { position: fixed; z-index: 51; top: 40px; bottom: 40px; inset-inline: 0; margin-inline: auto; width: min(900px, calc(100% - 48px)); background: var(--card); border-radius: var(--r-w); box-shadow: var(--float); display: flex; flex-direction: column; animation: peek .24s var(--ease); overflow: hidden; }
@keyframes peek { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 8px; height: 48px; padding-inline: 20px 10px; font-size: 13px; color: var(--ink-2); }
.drawer-head .path { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.drawer-body { padding: 18px 76px 56px; display: grid; gap: 16px; align-content: start; overflow-y: auto; flex: 1; }
.drawer-title { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.drawer-title .check { margin-top: 9px; width: 24px; height: 24px; }
.drawer-title textarea { border: 0; outline: none; resize: none; background: none; font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1.25; padding: 0; overflow: hidden; }
/* properties: a gray label with its icon, then the value; buttons that belong together stay in one row */
.props { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 12px; align-items: center; font-size: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.props > span { display: flex; align-items: center; gap: 8px; min-height: 38px; color: var(--ink-2); font-size: 14px; }
.props > span svg.i { width: 16px; height: 16px; color: var(--ink-3); }
.props > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.props .input { height: 32px; width: auto; font-size: 13.5px; background: var(--card); }
.props .select { height: 32px; font-size: 13.5px; }
/* a select is as wide as its longest option (a long course name): never wider than its row */
.props .input, .props .select { max-width: 100%; min-width: 0; }
.prow { gap: 6px 12px !important; }
.prow .quick { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.props .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mpage { min-height: 260px; padding-top: 4px; }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; height: 50px; padding-inline: 20px 10px; border-top: 1px solid var(--sep); font-size: 12px; color: var(--ink-3); }
.course-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.drawer.is-new select.need { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 18%, transparent); }
.drawer-title textarea::placeholder { color: var(--ink-3); }
.person-field { display: flex; align-items: center; gap: 8px; }
.props .person-field { flex-wrap: nowrap; max-width: 340px; }
.person-field .select { width: auto; flex: 1; }
.day-hint { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; min-height: 18px; }

/* ── pages: Notion-style blocks (a course's page, a mission's notes) ── */
.page { position: relative; cursor: text; padding-bottom: 24px; }
.blk { position: relative; display: flex; align-items: flex-start; gap: 4px; }
.blk-handle { position: absolute; inset-inline-start: -54px; top: 3px; display: flex; opacity: 0; transition: opacity .12s; }
.blk:hover > .blk-handle, .blk:focus-within > .blk-handle { opacity: 1; }
.blk-btn { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: none; border-radius: 8px; color: var(--ink-3); cursor: pointer; }
@media (hover: hover) { .blk-btn:hover { background: var(--fill-2); color: var(--ink-2); } }
.blk-btn svg.i { width: 16px; height: 16px; }
.blk-btn[data-blk-grip] { cursor: grab; }
.blk-text { flex: 1; min-width: 0; padding: 3px 2px; outline: none; font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--ink); unicode-bidi: plaintext; text-align: right; }   /* an English line reads left to right but stays by its bullet */
.blk-text:empty::before { content: attr(data-ph); color: var(--ink-3); pointer-events: none; }
.b-p .blk-text:not(:focus):not(.ph-main):empty::before { content: ''; }
.b-h1 .blk-text { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; padding-top: 20px; }
.b-h2 .blk-text { font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; padding-top: 12px; }
.b-li::before { content: '•'; flex: none; width: 22px; text-align: center; font-size: 20px; line-height: 1.3; padding-top: 3px; color: var(--ink); }
.b-quote .blk-text { border-inline-start: 3px solid var(--ink); padding-inline-start: 14px; margin-block: 3px; }
.blk-check { flex: none; width: 18px; height: 18px; margin: 6px 2px 0 4px; display: grid; place-items: center; padding: 0; border: 1.5px solid var(--sep-2); border-radius: 7px; background: var(--card); color: transparent; cursor: pointer; transition: background .12s, border-color .12s; }
.blk-check svg.i { width: 12px; height: 12px; stroke-width: 3; }
.blk-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.b-todo.done .blk-text { color: var(--ink-3); text-decoration: line-through; }
.blk-img { position: relative; margin: 8px 0; max-width: 100%; }
.blk-img img { display: block; max-width: 100%; max-height: 520px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); cursor: zoom-in; }
.blk-img.up img { opacity: .45; cursor: default; }
.blk-img.up .spin { position: absolute; top: 12px; inset-inline-start: 12px; }
.img-tools { position: absolute; top: 8px; inset-inline-end: 8px; opacity: 0; transition: opacity .12s; }
.img-tools .btn { background: color-mix(in srgb, var(--card) 90%, transparent); box-shadow: var(--shadow); }
.blk-img:hover .img-tools { opacity: 1; }
.b-widget { display: block; margin: 16px 0 22px; }
.b-widget > .blk-handle { top: 6px; }
.b-widget > .blk-handle [data-blk-add] { display: none; }
.slash-menu { width: 220px; max-height: 320px; overflow-y: auto; }
.slash-menu .slash-h { padding: 6px 10px 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.slash-menu button.on { background: var(--fill-2); }
.slash-menu svg.i { width: 18px; height: 18px; padding: 3px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); box-sizing: content-box; }
/* a file on a page: one quiet row like Notion's, with a little folded page in Notion's soft tag colours saying what it is */
.b-file { margin: 4px 0; }
.blk-file { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 6px; border-radius: 12px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; overflow: hidden; outline: none; transition: background .12s, box-shadow .12s; }
@media (hover: hover) { .blk-file:hover { background: var(--fill-2); } }
.blk-file:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.blk-file.up { cursor: default; }
.blk-file.up .fbadge { opacity: .55; }
.fbadge { position: relative; flex: none; width: 30px; height: 36px; box-sizing: border-box; display: grid; place-items: end center; padding-bottom: 6px; border-radius: 7px;
  background: var(--fb); color: var(--fc); font: 700 8.5px/1 var(--sans); letter-spacing: .04em; direction: ltr;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }
.fbadge::after { content: ''; position: absolute; top: 0; right: 0; width: 9px; height: 9px; border-bottom-left-radius: 3px; background: color-mix(in srgb, var(--fc) 28%, var(--fb)); }
.f-red { --fb: #fdebec; --fc: #d44c47; } .f-blue { --fb: #e7f3f8; --fc: #337ea9; } .f-orange { --fb: #fbecdd; --fc: #d9730d; }
.f-green { --fb: #edf3ec; --fc: #448361; } .f-purple { --fb: #f4f0f7; --fc: #9065b0; } .f-pink { --fb: #f9eef3; --fc: #c14c8a; }
.f-yellow { --fb: #fbf3db; --fc: #cb912f; } .f-brown { --fb: #f4eeee; --fc: #9f6b53; } .f-gray { --fb: #f1f1ef; --fc: #787774; }
.fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fname { font-size: 14.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.fsub { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; unicode-bidi: plaintext; text-align: right; }
.ftools { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.blk-file:hover .ftools, .blk-file:focus-within .ftools { opacity: 1; }
.fbar { display: none; position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; width: var(--p, 0%); background: var(--accent); transition: width .25s ease-out; }
.blk-file.up .fbar { display: block; }
/* touch (phones, iPads): no hover, so the + is shown on the line being written and always on the last line, finger-sized;
   the grip (dragging) is left out. A phone has no margin for it, so the page makes room on its own start side. */
@media (hover: none) {
  .img-tools, .ftools { opacity: 1; }
  .blk-handle { inset-inline-start: -40px; top: 0; visibility: hidden; opacity: 1; transition: none; }
  .blk-handle [data-blk-grip] { display: none; }
  .blk-btn { width: 32px; height: 32px; color: var(--ink-3); }
  .blk-btn svg.i { width: 19px; height: 19px; }
  .blk:focus-within > .blk-handle, .page > .blk:last-child > .blk-handle { visibility: visible; }
  .b-h1 > .blk-handle { top: 17px; } .b-h2 > .blk-handle { top: 9px; }
}
@media (hover: none) and (max-width: 760px) {
  .page { padding-inline-start: 34px; }
  .page > .blk > .blk-handle { inset-inline-start: -36px; }
  .page > .b-widget { margin-inline-start: -34px; }     /* the missions table keeps the whole width */
}
.course-doc { margin-top: 6px; }
.course-doc.page { padding-bottom: 40px; }
.mission .note-ind small { font-size: 11px; margin-inline-start: 2px; font-variant-numeric: tabular-nums; }
.drop-hint { display: none; }
.drawer.dropping .drop-hint { display: grid; place-content: center; justify-items: center; gap: 8px; position: absolute; inset: 8px; z-index: 2; border-radius: var(--r-c);
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--accent); font-weight: 600; font-size: 14px; pointer-events: none; }
.drop-hint svg.i { width: 28px; height: 28px; }
.lightbox { position: fixed; inset: 0; z-index: 65; background: rgba(15, 15, 15, .88); display: grid; place-items: center; padding: 60px 16px 24px; animation: fade .2s; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); object-fit: contain; border-radius: var(--r-i); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); user-select: none; -webkit-user-select: none; }
.lb-bar { position: absolute; top: 0; inset-inline: 0; height: 56px; display: flex; align-items: center; gap: 4px; padding-inline: 18px 10px; padding-top: env(safe-area-inset-top); color: #fff; }
.lb-n { flex: 1; font-size: 13px; opacity: .8; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.lb-bar .btn.ghost { color: #fff; display: inline-flex; height: 36px; width: 36px; }      /* the mascot's .ghost rule would make them blocks */
@media (hover: hover) { .lb-bar .btn.ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; } }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; transition: background .15s; }
@media (hover: hover) { .lb-nav:hover { background: rgba(255, 255, 255, .26); } }
.lb-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.lb-frame { width: min(1000px, 100%); height: calc(100vh - 84px); height: calc(100dvh - 84px); border: 0; border-radius: var(--r-i); background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lb-frame.is-text { width: min(820px, 100%); }
.lightbox video { max-width: 100%; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); border-radius: var(--r-i); background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lb-audio { width: min(420px, 100%); display: grid; justify-items: center; gap: 12px; padding: 26px 22px 20px; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.lb-audio .fbadge { width: 42px; height: 50px; font-size: 10px; }
.lb-audio b { font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.lb-audio audio { width: 100%; }
.lb-nav.prev { inset-inline-start: 14px; }
.lb-nav.next { inset-inline-end: 14px; }
.lb-nav[hidden] { display: none; }
@media (hover: none) { .lb-nav { display: none; } }
.title-input { height: 48px; font-size: 18px; font-weight: 700; }
.people-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.people-pick .link-btn, .mission-form .chips > .faint { white-space: nowrap; flex: none; }
.pchip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding-block: 0; padding-inline: 4px 12px; border: 0; background: var(--fill-2); border-radius: 999px; font-size: 13px; cursor: pointer; transition: background .12s; }
.pchip small { color: var(--ink-2); font-size: 11.5px; }
@media (hover: hover) { .pchip:hover { background: var(--fill); } }
.pchip.on { background: var(--main); color: var(--on-main); }
.pchip.on small { color: color-mix(in srgb, var(--on-main) 75%, transparent); }
.mission-form .chips { align-items: center; }

.related { border-top: 1px solid var(--sep); padding-top: 16px; display: grid; gap: 4px; }
.related h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.rel-course { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.rel-course a { color: var(--accent); }
.rel-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 72px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 16px; font-size: 13.5px; }
@media (hover: hover) { .rel-row:hover { background: var(--fill-2); } }
.rel-row span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-row.done { color: var(--ink-3); }
.related .btn { justify-self: start; margin-top: 6px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; }
.toast { display: flex; align-items: center; gap: 14px; background: color-mix(in srgb, #2c2825 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; padding-inline: 20px 8px; height: 46px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--float); animation: rise .25s var(--ease); }
.toast button { border: 0; background: none; color: #fff; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; font-size: 14px; height: 32px; padding: 0 12px; border-radius: 999px; }
@media (hover: hover) { .toast button:hover { background: rgba(255, 255, 255, .12); } }
.toast.out { opacity: 0; transition: opacity .2s; }

.palette { width: min(620px, 100%); background: var(--card); border-radius: 26px; box-shadow: var(--float); overflow: hidden; animation: rise .2s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--sep); color: var(--ink-2); }
.palette-input svg.i { width: 20px; height: 20px; }
.palette-input input { flex: 1; height: 56px; border: 0; outline: none; background: none; font-size: 19px; font-weight: 400; }
.palette-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.palette-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.palette-item .sub { margin-inline-start: auto; font-size: 12.5px; color: var(--ink-3); }
.palette-item.on { background: var(--fill-2); }

/* ── auth ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.1fr; }
.auth-inner { width: 100%; max-width: 380px; margin: auto; padding: 40px 24px; display: grid; gap: 22px; }
.auth h1 { font-size: 30px; line-height: 1.2; font-weight: 600; margin: 12px 0 0; letter-spacing: -.025em; }
.auth .lede { color: var(--ink-2); margin: -10px 0 0; font-size: 15px; }
.auth-tabs { display: inline-flex; padding: 2px; gap: 2px; background: var(--fill); border-radius: 16px; }
.auth-tabs button { flex: 1; border: 0; background: none; height: 30px; border-radius: 12px; font-weight: 500; font-size: 13.5px; }
.auth-tabs button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.auth form { display: grid; gap: 14px; }
.auth .btn.primary { height: 44px; font-size: 15px; }
.auth-foot { color: var(--ink-3); font-size: 12px; }
.auth-foot a { color: inherit; } @media (hover: hover) { .auth-foot a:hover { color: var(--ink-2); } }
.auth-note { margin: 0; color: var(--ink-3); font-size: 12px; }
.auth-art { margin: 12px; border-radius: 22px; display: grid; place-items: center; position: relative; overflow: hidden; }
.auth-art .art { position: absolute; inset: 0; }
.auth-art .floating { position: relative; z-index: 1; display: grid; gap: 14px; width: min(340px, 80%); }
.fcard { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--float); font-size: 14px; font-weight: 600; }
.fcard small { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.fcard:nth-child(2) { margin-inline-start: 40px; }
.fcard:nth-child(3) { margin-inline-end: 30px; }
.fcard-date { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 18px; align-items: end; padding: 16px 18px; width: 240px; }
.fd-day { grid-column: 1; font-size: 12px; color: var(--today); font-weight: 700; }
.fd-num { grid-column: 1; font-size: 44px; line-height: 1; font-weight: 300; letter-spacing: -.03em; }
.fd-ev { grid-column: 2; grid-row: 1 / 3; display: grid; grid-template-columns: 3px 1fr; gap: 0 8px; font-size: 13px; align-self: center; }
.fd-ev i { grid-row: 1 / 3; background: var(--c-ink); border-radius: 4px; }
.hit-login { background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; }
.hit-login-head { display: grid; gap: 2px; }
.hit-login-head b { font-weight: 700; font-size: 16px; }
.hit-login-head span { font-size: 13px; }
.hit-box, .hit-form { display: grid; gap: 12px; }
.auth-alt { display: grid; gap: 10px; justify-items: start; }
/* onboarding: the university picker — a grid of white cards, each with the institution's own logo (the only brand
   colour on the page) and its name under it */
.auth-inner:has(.uni-picker) { max-width: 440px; }
.uni-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uni-picker > .loading, .uni-picker > .form-error { grid-column: 1 / -1; }
.uni { display: grid; justify-items: center; align-content: start; gap: 10px; width: 100%; padding: 16px 10px 12px; border: 1px solid var(--sep); border-radius: var(--r-w); background: var(--card); box-shadow: var(--shadow); text-align: center; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, background .15s, transform .15s; }
@media (hover: hover) { .uni:hover { border-color: var(--sep-2); background: var(--fill-2); } }
.uni:active { transform: scale(.98); }
.uni:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uni-logo { width: 100%; height: 48px; display: grid; place-items: center; }
.uni-logo img { display: block; height: 48px; width: auto; max-width: min(140px, 100%); object-fit: contain; }
.uni-name { display: grid; gap: 1px; min-width: 0; }
.uni-name b { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.uni-name small { color: var(--ink-3); font-size: 11.5px; }
.hit-code-head { display: flex; align-items: center; gap: 10px; }
.hit-code-head b { font-weight: 600; font-size: 15px; }
.uni-head-logo { height: 44px; width: auto; max-width: 180px; justify-self: start; }
.auth-back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.auth-back .i { width: 14px; height: 14px; }
.hit-hint { margin: 0; padding: 10px 12px; background: var(--fill-2); border-radius: var(--r-i); color: var(--ink-2); font-size: 13.5px; }
.hit-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.keep-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--fill-2); border-radius: var(--r-i); color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.keep-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); flex: none; }
.keep-check b { display: block; color: var(--ink); font-weight: 600; }
.key-panel { display: grid; gap: 8px; margin: 10px 0; padding: 10px 12px; background: var(--fill-2); border-radius: var(--r-i); font-size: 13.5px; }
.key-panel p { margin: 0; }
.key-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.code-input { font-size: 22px; letter-spacing: .35em; height: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.live { border-radius: var(--r-c); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.live img { display: block; width: 100%; height: auto; cursor: pointer; aspect-ratio: 1280 / 900; }
.live-keys { display: flex; gap: 6px; }
.auth-inner:has(.live) { max-width: 640px; }

/* ── loading ── */
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; padding: 10px 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--ink-2); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── sync: the card while an institution's pages are read (minutes). The ghost reads along; a checklist of the
   steps, the course it's on under the current one, a thin bar and a clock. ── */
.sync { display: grid; gap: 14px; }
.sync-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.sync-ghost { width: 40px; height: 40px; animation: ghost-bob 1.1s ease-in-out infinite, ghost-breathe 2.2s ease-in-out infinite; }
.sync-head b { display: block; font-weight: 600; font-size: 15px; }
.sync-head .faint { display: block; font-size: 12.5px; line-height: 1.4; }
.sync-clock { align-self: start; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sync .bar { flex: none; height: 4px; }
.sync-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.sync-steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 5px 0; font-size: 13.5px; color: var(--ink-3); transition: color .3s var(--ease); }
.sync-steps i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sep-2); display: grid; place-items: center; }
.sync-steps i .i { width: 10px; height: 10px; stroke: #fff; stroke-width: 3.5; }
.sync-steps li.done { color: var(--ink-2); }
.sync-steps li.done i { background: var(--c-moss); box-shadow: none; animation: pop .35s var(--ease); }
.sync-steps li.now { color: var(--ink); font-weight: 500; }
.sync-steps li.now i { box-shadow: inset 0 0 0 2px var(--accent-soft); border: 2px solid transparent; border-top-color: var(--accent); animation: spin .8s linear infinite; }
.sync-steps small { font-size: 12px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sync-steps em { grid-column: 2 / -1; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: fade .3s var(--ease); }

/* ── connections ── */
.conn { padding: 22px; display: grid; gap: 16px; }
.conn-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.conn-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.conn-head p { margin: 0; font-size: 14px; max-width: 620px; }
.conn-facts { display: grid; grid-template-columns: 130px 1fr; gap: 0; margin: 0; font-size: 14px; background: var(--inset); border-radius: var(--r-c); overflow: hidden; }
.conn-facts dt, .conn-facts dd { padding: 11px 14px; border-top: 1px solid var(--sep); margin: 0; }
.conn-facts dt:first-of-type, .conn-facts dt:first-of-type + dd { border-top: 0; }
.conn-facts dt { color: var(--ink-2); }
.conn-facts dd { text-align: start; }
/* the university card: the linked one as a logo row; with none, a compact version of the onboarding picker */
.uni-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--inset); border-radius: var(--r-c); min-width: 0; }
.uni-row-logo { flex: none; height: 36px; display: grid; place-items: center; }
.uni-row-logo img { display: block; height: 36px; width: auto; max-width: 120px; object-fit: contain; }
.uni-row > div { display: grid; gap: 1px; min-width: 0; }
.uni-row b { font-weight: 600; font-size: 14.5px; }
.uni-row small { color: var(--ink-3); font-size: 12.5px; }
.uni-picker.sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.uni-picker.sm .uni { gap: 6px; padding: 12px 8px 10px; box-shadow: none; border-radius: var(--r-c); }
.uni-picker.sm .uni-logo, .uni-picker.sm .uni-logo img { height: 28px; }
.uni-picker.sm .uni-name b { font-weight: 500; font-size: 12.5px; }
.uni-picker.sm .uni-name small { display: none; }
#uni-conn .hit-box:has(.sync) ~ .auth-back { display: none; }   /* no "back" while the sync runs */

/* ── smart add ── */
.sa-list { display: grid; gap: 8px; }
.sa-row { display: grid; grid-template-columns: 20px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) 100px 140px; gap: 8px; align-items: center; }
.sa-row .input { height: 34px; font-size: 13.5px; }

/* ── weekly plan ── */

/* ── chat ── */
/* The chat is home. Empty: a calm centred welcome with the composer in the middle.
   Once there are messages: a thread, the composer docked at the bottom. */
.chat-view { max-width: 780px; display: flex; flex-direction: column; min-height: calc(100vh - 20px); padding-top: 16px; padding-bottom: 20px; }
/* "new chat" stays in reach: it floats at the top while the conversation scrolls under it */
.chat-top { display: flex; justify-content: flex-end; gap: 6px; min-height: 30px; position: sticky; top: 12px; z-index: 25; pointer-events: none; }
.chat-top .btn { display: inline-flex; width: auto; height: 34px; color: var(--ink-2); pointer-events: auto; background: var(--glass); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); box-shadow: var(--shadow); border-radius: 999px; }
@media (hover: hover) { .chat-top .btn:hover { color: var(--ink); background: var(--card); } }
.chat-welcome, .chat-suggest { display: none; }
.chat-log { flex: 1; display: grid; gap: 22px; align-content: start; padding: 8px 0 28px; }

.chat-view.is-empty { justify-content: center; padding-top: 24px; padding-bottom: 12vh; }
.chat-view.is-empty .chat-log { display: none; }
.chat-view.is-empty .chat-welcome { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 30px; animation: rise .6s var(--ease) both; }
.chat-cover { position: relative; width: 200px; height: 160px; margin-bottom: 6px; }
/* the bloom: four glossy lobes (overlapping circles cut from the gradient), a highlight on top, a coloured halo
   underneath. It turns very slowly and breathes; the ghost floats in its middle */
.bloom { position: absolute; z-index: 1; inset: 0; margin: auto; width: 136px; height: 136px; animation: bloom-turn 40s linear infinite; }
.bloom::before, .bloom::after { content: ""; position: absolute; inset: 0; }
.bloom::before { background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle at 70% 78%, rgba(120, 60, 160, .22), rgba(120, 60, 160, 0) 45%), var(--bloom);
  --lobe: radial-gradient(closest-side, #000 97%, transparent);
  -webkit-mask: var(--lobe) 50% 0 / 58% 58% no-repeat, var(--lobe) 50% 100% / 58% 58% no-repeat, var(--lobe) 0 50% / 58% 58% no-repeat, var(--lobe) 100% 50% / 58% 58% no-repeat, var(--lobe) 50% 50% / 70% 70% no-repeat;
          mask: var(--lobe) 50% 0 / 58% 58% no-repeat, var(--lobe) 50% 100% / 58% 58% no-repeat, var(--lobe) 0 50% / 58% 58% no-repeat, var(--lobe) 100% 50% / 58% 58% no-repeat, var(--lobe) 50% 50% / 70% 70% no-repeat;
  filter: saturate(1.05); }
.bloom::after { z-index: -1; inset: -10%; border-radius: 50%; background: var(--bloom); filter: blur(34px); opacity: .55; animation: bloom-breathe 6s ease-in-out infinite; }
@keyframes bloom-turn { to { transform: rotate(360deg); } }
@keyframes bloom-breathe { 50% { opacity: .8; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .bloom, .bloom::after { animation: none; } }
.chat-welcome .brand-mark.xl { position: absolute; z-index: 2; inset: 0; margin: auto; width: 100px; height: 100px; }
.chat-welcome h1 { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 600; }
.chat-welcome p { margin: 0; font-size: 17px; color: var(--ink-2); }
.chat-welcome a { color: var(--accent); }
.chat-view.is-empty .composer { position: static; padding: 10px; padding-inline-start: 22px; border-radius: 32px; background: var(--card); box-shadow: var(--float); animation: rise .6s .06s var(--ease) both; }
.chat-view.is-empty .composer { align-items: center; }
.chat-view.is-empty .composer textarea { font-size: 16.5px; padding: 13px 0; }
.chat-view.is-empty .composer .btn.icon { width: 44px; height: 44px; }
.chat-view.is-empty .chat-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; animation: rise .6s .12s var(--ease) both; }
.chat-suggest .chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; font-size: 13px; background: var(--card); box-shadow: var(--shadow); white-space: normal; text-align: start; color: var(--ink-2); transition: transform .25s var(--spring), color .15s, box-shadow .2s; }
@media (hover: hover) { .chat-suggest .chip:hover { background: var(--card); color: var(--ink); box-shadow: var(--lift); transform: translateY(-1px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .chat-welcome, .chat-view .composer, .chat-suggest { animation: none !important; } }

/* typing indicator */
.dots { display: inline-flex; gap: 5px; padding: 10px 0; justify-self: end; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
.msg.user { display: flex; justify-content: flex-start; }
.msg.user .bubble { max-width: 76%; background: var(--fill); color: var(--ink); border-radius: 24px; padding: 11px 18px; line-height: 1.55; font-size: 15.5px; }
.msg.user.failed .bubble { opacity: .5; }
.msg.ai { display: grid; gap: 10px; max-width: 92%; }
.ai-text { background: none; border-radius: 0; padding: 2px 0; line-height: 1.7; font-size: 15.5px; justify-self: end; width: fit-content; max-width: 100%; }
.ai-text p { margin: 0 0 6px; }
.ai-text p:last-child { margin: 0; }
.ai-text ul { margin: 4px 0 8px; padding-inline-start: 20px; display: grid; gap: 3px; }
.ai-text li::marker { color: var(--ink-3); }
.ai-text b { font-weight: 600; }
/* a full answer: headings, numbered lists, tables, quotes, code and links */
.ai-text { overflow-wrap: anywhere; min-width: 0; }
.ai-text p { margin: 0 0 9px; }
.ai-text ol { margin: 4px 0 8px; padding-inline-start: 22px; display: grid; gap: 3px; }
.ai-text li > ul, .ai-text li > ol { margin: 3px 0 2px; }
.ai-text h2, .ai-text h3, .ai-text h4 { margin: 16px 0 6px; line-height: 1.3; font-weight: 650; }
.ai-text h2 { font-size: 19px; } .ai-text h3 { font-size: 16.5px; } .ai-text h4 { font-size: 15px; }
.ai-text > :first-child { margin-top: 0; }
.ai-text > :last-child { margin-bottom: 0; }
.ai-text a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
@media (hover: hover) { .ai-text a:hover { text-decoration-color: currentColor; } }
.ai-text hr { border: 0; border-top: 1px solid var(--sep-2); margin: 14px 0; }
.ai-text blockquote { margin: 6px 0 10px; padding: 2px 12px; border-inline-start: 3px solid var(--sep-2); color: var(--ink-2); }
.ai-text code { font-family: var(--mono); font-size: .88em; background: var(--fill); border-radius: 7px; padding: 1.5px 5px; unicode-bidi: isolate; }
.ai-text .code { margin: 8px 0 12px; border-radius: 16px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.code-top { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px 5px 12px; padding-inline: 12px 8px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.code-copy { border: 0; background: none; font: inherit; color: var(--ink-2); padding: 3px 8px; border-radius: 8px; cursor: pointer; }
@media (hover: hover) { .code-copy:hover { background: var(--fill); color: var(--ink); } }
.ai-text pre { margin: 0; padding: 11px 13px; overflow-x: auto; text-align: left; line-height: 1.55; }
.ai-text pre code { background: none; padding: 0; font-size: 13px; white-space: pre; }
.ai-text .tbl { margin: 8px 0 12px; overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.ai-text table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ai-text th, .ai-text td { padding: 7px 11px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.ai-text th + th, .ai-text td + td { border-inline-start: 1px solid var(--line); }
.ai-text th { white-space: nowrap; background: var(--inset); font-weight: 600; color: var(--ink-2); font-size: 13px; }
.ai-text tr:last-child td { border-bottom: 0; }
/* what Kernuli made (a picture, a file to open or save) and the web pages an answer leans on */
.ai-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.att.ai-file { padding: 0; max-width: 300px; }
.ai-file-open { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 4px 7px 8px; padding-inline: 8px 4px; color: inherit; text-decoration: none; }
@media (hover: hover) { .ai-file:hover { background: var(--fill-2); } }
.ai-file-dl { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-inline-end: 4px; border-radius: 10px; color: var(--ink-3); }
@media (hover: hover) { .ai-file-dl:hover { background: var(--fill); color: var(--ink); } }
.ai-file-dl svg.i { width: 16px; height: 16px; }
.ai-pic { margin: 0; max-width: min(100%, 520px); border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.ai-pic img { display: block; width: 100%; height: auto; }
.ai-pic figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 12px; padding-inline: 12px 4px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
.ai-pic figcaption span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.srcs-h { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-inline-end: 2px; }
.srcs-h svg.i { width: 13px; height: 13px; }
.src { display: inline-flex; align-items: baseline; gap: 7px; max-width: 260px; padding: 4px 10px; border-radius: 999px; background: var(--fill-2); color: var(--ink); text-decoration: none; font-size: 12.5px; }
@media (hover: hover) { .src:hover { background: var(--fill); } }
.src-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-h { flex: none; color: var(--ink-3); font-size: 11.5px; }
.think-status { font-size: 13.5px; color: var(--ink-2); max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.think-status:empty { display: none; }
.acts { display: grid; gap: 8px; justify-items: stretch; }
.act { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; width: 100%; border-radius: 22px; padding: 12px 14px; background: var(--card); box-shadow: var(--shadow); }
.act-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--ink-2); }
.act-body { display: grid; gap: 1px; font-size: 14px; min-width: 0; }
.act-kind { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.act-err { font-size: 12.5px; color: var(--red); }
.act-btns { display: flex; gap: 4px; }
.act-state { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.act.done .act-ic { background: color-mix(in srgb, var(--c-moss) 16%, transparent); color: var(--c-moss); }
.act.done .act-state { color: var(--c-moss); }
.act.skipped { opacity: .5; }
.act.danger:not(.done):not(.skipped) .act-ic { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.act > a.btn { text-decoration: none; }
.act.failed .act-state { color: var(--red); }
.act.blocked .act-state { color: var(--ink-3); }
/* a hand-in on Moodle: what it sends, before the tap */
.hand { display: grid; gap: 2px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.hand-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.hand-k { color: var(--ink-3); }
.hand-warn { color: var(--c-clay); font-weight: 600; }
.hand-note { color: var(--ink-2); margin-top: 2px; }
.composer { position: sticky; bottom: 16px; display: flex; gap: 8px; align-items: flex-end; border-radius: 28px; padding: 7px; padding-inline-start: 20px; background: var(--glass); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8); box-shadow: var(--float); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: none; font: inherit; font-size: 15px; line-height: 1.5; padding: 7px 0; max-height: 200px; }
.composer .btn.icon { width: 38px; height: 38px; border-radius: 50%; }
.composer .btn.primary.icon svg.i { width: 18px; height: 18px; stroke-width: 2.2; }
.composer-note { font-size: 12px; text-align: center; padding-top: 12px; }
/* files in the chat: waiting in the composer (with their upload progress), then under the message they went with */
.composer { flex-wrap: wrap; }
.composer .btn.ghost.icon { color: var(--ink-3); background: none; box-shadow: none; }
@media (hover: hover) { .composer .btn.ghost.icon:hover { color: var(--ink-2); } }
.att-tray { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 2px; }
.att-tray[hidden] { display: none; }
.att { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 6px 8px 6px 6px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.att .fbadge { width: 24px; height: 29px; padding-bottom: 4px; font-size: 7.5px; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
.att .fbadge::after { width: 7px; height: 7px; }
.att-meta { min-width: 0; display: flex; flex-direction: column; }
.att-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.att-sub { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.att-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
@media (hover: hover) { .att-x:hover { background: var(--fill-2); color: var(--ink); } }
.att-x svg.i { width: 14px; height: 14px; }
.att .fbar { display: none; position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; width: var(--p, 0%); background: var(--accent); transition: width .25s ease-out; }
.att.up .fbar { display: block; }
.att.up .fbadge { opacity: .55; }
.msg-body { display: grid; gap: 6px; justify-items: start; max-width: 76%; }
.msg.user .msg-body .bubble { max-width: 100%; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; }
.msg.user.failed .msg-files { opacity: .5; }
.chat-view.dropping .composer { box-shadow: 0 0 0 2px var(--accent), var(--float); }
.chat-view.is-empty .composer-note { display: none; }

/* ═════════════ Tablet ═════════════ */
@media (max-width: 1100px) {
}
@media (max-width: 1000px) {
  .week { grid-template-columns: 1fr; gap: 2px; }
  .day { min-height: 0; }
  .day-head { justify-content: flex-start; gap: 10px; }
  .day-empty { display: none; }
  .mrow { grid-template-columns: 20px minmax(0, 1fr) 84px 110px 84px; }
  .mrow > :nth-child(5) { display: none; }
  .mrow .teacher.t-inline { display: inline-flex; }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

/* ═════════════ Phone ═════════════
   One column, a translucent tab bar, sheets from the bottom, 44px touch targets, 16px inputs (no iOS zoom), safe areas. */
@media (max-width: 760px) {
  /* --tabbar is the floating bar (62px) plus the gap under it, so everything that clears it still does */
  :root { --tabbar: 74px; --safe-b: env(safe-area-inset-bottom, 0px); }
  body { font-size: 15px; }
  .hide-m, .hide-sm, .composer-note { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .main { margin: 0; border-radius: 0; box-shadow: none; background: none; min-height: 0; overflow: visible; }
  /* the sky stays put while the page scrolls over it (iOS ignores background-attachment: fixed, so a fixed layer) */
  .app { background: none; }
  .app::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--grain), var(--sky-soft); }

  .topbar-mobile { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    height: calc(50px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; background: rgba(255, 253, 250, .55); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); }
  .topbar-mobile .btn { color: var(--ink); background: none; box-shadow: none; }
  .topbar-mobile .tb-acts { display: flex; gap: 2px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 2px; position: fixed; inset-inline: 14px; bottom: calc(12px + var(--safe-b)); z-index: 45;
    height: 62px; padding: 5px; border-radius: 999px; background: rgba(255, 253, 250, .72); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 1px rgba(70, 50, 30, .06), 0 10px 30px -8px rgba(70, 50, 30, .22); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 1px; height: 100%; border: 0; background: none; padding: 0; border-radius: 999px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; transition: background .25s, color .2s; }
  .tabbar svg.i { width: 23px; height: 23px; stroke-width: 1.9; }
  .tabbar .on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

  /* pinned to the visible top and bottom, not 100vh: in iPhone Safari 100vh is measured with the toolbar hidden,
     which pushed the profile at the bottom of the menu under the toolbar */
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; height: auto; inset-inline-start: 0; width: min(300px, 84vw); transform: translateX(100%); transition: transform .3s var(--ease);
    padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: calc(10px + var(--safe-b)); border: 0; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(44, 34, 24, .22); }
  .sidebar { background: var(--grain), var(--sky); }
  .sidebar { border-start-start-radius: 0; border-end-start-radius: 0; border-start-end-radius: 28px; border-end-end-radius: 28px; }
  .nav-courses { padding-bottom: 8px; }
  .user-chip { min-height: 52px; padding: 8px 10px; gap: 12px; }
  .user-chip .avatar { width: 34px; height: 34px; }
  .user-chip .name { font-size: 15px; }
  .user-chip .email { font-size: 12.5px; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(44, 34, 24, .25); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .app.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .nav-item { height: 44px; font-size: 16px; }
  .nav-subitem { height: 38px; font-size: 14.5px; }

  .view { padding: 10px 16px calc(var(--tabbar) + var(--safe-b) + 28px); }
  .hero, .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
  .hero h1, .page-head h1 { font-size: 30px; flex-wrap: wrap; }
  .head-actions .btn { height: 36px; }
  .crumbs { margin-bottom: 8px; }


  .card, .conn { padding: 14px 16px; border-radius: 26px; }
  .day { border-radius: 18px; }
  .day-head { padding: 8px 8px 4px; justify-content: space-between; }
  .day-head .dn { font-size: 14px; color: var(--ink); }
  .day:has(.day-empty) { flex-direction: row; align-items: center; }
  .day:has(.day-empty) .day-head { flex: 1; }
  .day:has(.day-empty) .day-body { padding: 0 10px; flex: none; }
  .day-empty { display: block !important; font-size: 13px; }
  .slot { padding: 8px 10px; font-size: 13.5px; }
  .mission .check, .mrow .check { width: 24px; height: 24px; }
  .ready-pill { font-size: 13px; }
  .ready-pill span, .ready-pill b { padding: 8px 11px; }
  .mrow .mt { flex-wrap: wrap; row-gap: 4px; }
  .status-seg button { height: 42px; font-size: 14.5px; }
  .check svg { width: 13px; height: 13px; }

  .course-head h1 { font-size: 26px; }
  .ctile.xl { width: 56px; height: 56px; font-size: 30px; }
  .toolbar { padding: 14px 0 10px; }
  .filters button { height: 32px; padding: 0 12px; font-size: 14px; }
  .tabs a { height: 34px; font-size: 14.5px; }
  .mission.th { display: none; }
  .cprops { gap: 10px 24px; }
  .cprop-v .prog { width: 120px; }
  .clink { max-width: 100%; }
  .course-links { margin: 18px 0 14px; }
  .mission { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; min-height: 54px; padding: 8px 12px 8px 16px; }
  .mission::before, .done-divider::before, .add-mission::before { inset-inline-start: 52px; }
  .mission > span:nth-of-type(1), .mission > span:nth-of-type(2), .mission .del { display: none; }
  .mission .teacher.t-inline { display: inline-flex; }
  .mission .mt { flex-wrap: wrap; row-gap: 2px; }
  .mission .title { white-space: normal; line-height: 1.4; font-size: 15.5px; }
  .add-mission { height: 50px; grid-template-columns: 24px 1fr; }
  .add-mission input { font-size: 16px; }
  .add-hint, .add-preview { padding-inline-start: 52px; }
  .link-form input { font-size: 16px; }

  .orow { min-height: 54px; gap: 10px; padding: 8px 14px; font-size: 15px; grid-template-columns: minmax(0, 1fr) auto auto !important; }
  .orow.th { display: none; }
  .orow:not(.mrow) { grid-template-columns: minmax(0, 1fr) !important; grid-auto-flow: column; grid-auto-columns: auto; }
  .mrow { grid-template-columns: 24px minmax(0, 1fr) auto !important; }
  .mrow > :nth-child(3), .mrow > :nth-child(4), .mrow > :nth-child(5) { display: none; }
  .mrow .title { white-space: normal; }
  .add-row { height: 50px; font-size: 15.5px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gcard { padding: 14px; min-height: 170px; border-radius: 26px; }
  .gtitle { font-size: 15px; }
  .gmeta span:last-child { display: none; }
  .gcard.new { min-height: 120px; }
  .fgrid, .row-2 { grid-template-columns: 1fr; }

  /* sheets */
  .overlay { place-items: end stretch; padding: 0; }
  .modal { width: 100% !important; max-height: 92vh; max-height: 92dvh; border-radius: 26px 20px 0 0; animation: sheet .35s var(--ease); }
  .modal::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 5px; background: var(--sep-2); margin: 8px auto 0; flex: none; }
  @keyframes sheet { from { transform: translateY(60px); opacity: .4; } }
  .modal-head { padding: 12px 18px 0; }
  .modal-body { padding: 14px 18px; }
  .modal-foot { padding: 12px 18px calc(12px + var(--safe-b)); }
  .modal-foot .btn { height: 48px; flex: 1; font-size: 16px; }
  .modal-foot .btn.ghost[data-del] { flex: none; }
  .overlay:has(.palette) { place-items: start stretch; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 0; }
  .palette-item { height: 46px; font-size: 16px; }
  .people-pick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .people-pick::-webkit-scrollbar { display: none; }
  .pchip { flex: none; height: 38px; }
  .seg button { height: 34px; padding: 0 14px; }
  .chip.sm { padding: 7px 12px; font-size: 13.5px; }
  .input, .textarea, .select, .composer textarea, .title-input, .props .input, .props .select { font-size: 16px; }
  .input, .select { height: 44px; }

  .drawer { inset: 0; width: 100%; margin: 0; border-radius: 0; animation: sheet .3s var(--ease); }
  .drawer-head { height: calc(52px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
  .drawer-body { padding: 14px 18px 40px; }
  .drawer-title textarea { font-size: 24px; }
  .drawer-title .check { margin-top: 4px; }
  .drawer-foot { height: auto; padding: 10px 14px calc(10px + var(--safe-b)); }
  .props { grid-template-columns: 104px minmax(0, 1fr); gap: 4px 8px; }
  .props > span { font-size: 13.5px; }
  .person-field .select, .props .select[data-f="kind"] { width: 100%; }
  .prow .input[type="date"] { flex: 1 1 140px; }
  .blk-text { font-size: 16px; }

  .chat-view { min-height: calc(100vh - 50px - var(--tabbar) - var(--safe-b)); min-height: calc(100dvh - 50px - var(--tabbar) - var(--safe-b)); padding-bottom: calc(var(--tabbar) + var(--safe-b) + 92px); }
  .chat-view.is-empty { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 20px); }
  .chat-welcome h1 { font-size: 27px; }
  .chat-top { top: calc(58px + env(safe-area-inset-top, 0px)); }
  .chat-view:not(.is-empty) .composer { position: fixed; inset-inline: 10px; bottom: calc(var(--tabbar) + var(--safe-b) + 8px); z-index: 40; }
  .msg.user .bubble { max-width: 86%; }
  .msg-body { max-width: 86%; }
  .att-x { width: 30px; height: 30px; }
  .act { grid-template-columns: 32px 1fr; }
  .act-btns, .act-state { grid-column: 1 / -1; }
  .act-btns .btn { flex: 1; height: 40px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chat-view.is-empty .chat-suggest { flex-wrap: wrap; }

  .conn-head { flex-direction: column; }
  .conn-facts { grid-template-columns: 100px 1fr; }
  .uni-picker.sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-row { grid-template-columns: 20px 1fr; }
  .sa-row > :nth-child(n+3) { grid-column: 2; }
  .toasts { bottom: calc(var(--tabbar) + var(--safe-b) + 12px); width: calc(100% - 24px); }
  .toast { width: 100%; justify-content: space-between; }
  .auth-inner { padding: calc(28px + env(safe-area-inset-top, 0px)) 20px 28px; }
  .auth h1 { font-size: 26px; }
  .week.tall { padding: 6px; }
  .week.tall .day { min-height: 0; }
}
@media (max-width: 380px) {
  .gallery { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═════════════ Review plans, grade simulator ═════════════ */


.modal-head h2 .tile { background: var(--fill-2); margin-inline-end: 6px; vertical-align: middle; }
.rv-row { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--sep); cursor: pointer; }
.rv-row:last-of-type { border-bottom: 0; }
.rv-row input { width: 18px; height: 18px; accent-color: var(--main); flex: none; }
.rv-t { flex: 1; font-weight: 600; font-size: 14px; }
.rv-d { font-size: 13px; color: var(--ink-2); }

.sim { background: var(--inset); border-radius: 22px; padding: 14px 16px; margin: 0 0 12px; display: grid; gap: 10px; }
.sim-head { display: flex; gap: 12px; align-items: center; }
.sim-head .tile { background: var(--card); }
.sim-head div { display: grid; gap: 2px; }
.sim-head b { font-size: 14.5px; }
.sim-head span { font-size: 13px; color: var(--ink-2); }
.sim-head span b { font-size: 13px; color: var(--ink); }
.sim-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.sim-row label { color: var(--ink-2); font-weight: 600; }
.sim-row input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.sim-x { min-width: 28px; font-size: 15px; }
.sim-out { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim-out b { font-size: 15px; }
.pill.bad { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.sim-note { margin: 0; font-size: 12px; color: var(--ink-3); }
.section-head .mono.bad b { color: var(--red); }
.facts .chip.sm { margin-inline-start: auto; }
.hint-line { margin: -8px 0 18px; font-size: 13px; color: var(--ink-2); }

@media (max-width: 760px) {
}

/* ═════════════ Covers ═════════════
   Notion-style page covers filled with soft abstract art: three blurred pastel blobs drifting slowly over a pale base,
   with a fine grain on top. app.js art() picks the palette and positions from a key, so each page keeps its picture. */
.art { position: relative; overflow: hidden; background: var(--base, #f3f1fb); isolation: isolate; }
.art i { position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 45% 45%, var(--bc) 0 18%, color-mix(in srgb, var(--bc) 0%, transparent) 70%);
  filter: blur(26px) saturate(1.15); opacity: .95; animation: drift 18s var(--d, 0s) ease-in-out infinite alternate; }
.art i:nth-child(2) { animation-duration: 23s; mix-blend-mode: multiply; opacity: .75; }
.art i:nth-child(3) { animation-duration: 29s; }
.art::after { content: ""; position: absolute; inset: 0; z-index: 1; opacity: .34; mix-blend-mode: soft-light; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift { to { transform: translate(8%, 10%) scale(1.12); } }

/* covers: a soft wash, not a banner. The art shows at half strength over the sheet */
.cover { height: 150px; position: relative; margin: 10px; border-radius: 22px; overflow: hidden; }
.cover .art { opacity: .5; }
.cover .art { position: absolute; inset: 0; }
.view.has-cover { padding-top: 0; }
.page-icon { font-family: var(--emoji); font-size: 64px; line-height: 1; margin: -40px 0 14px; position: relative; z-index: 2; width: max-content; }
.view.has-cover > .crumbs { margin: 10px 0 0; }
.view.has-cover > .ctile.xl { display: grid; }
.view.has-cover > .ctile.xl { margin-top: -44px; position: relative; z-index: 2; }
.view.has-cover .hero, .view.has-cover .page-head { margin-top: 0; }

/* Phone: like an iPhone app. Cream background, white rounded cards (iOS grouped style), short rounded covers,
   the ghost on its orb above a big friendly greeting, suggestions as pills. */
@media (max-width: 760px) {
  .view, .view.wide { padding-inline: 16px; }
  .cover { height: 96px; margin: 8px 12px 0; border-radius: 22px; }
  .page-icon { font-size: 44px; margin: -26px 0 8px; }
  .view.has-cover > .ctile.xl { margin-top: -26px; width: 52px; height: 52px; font-size: 38px; border-radius: 16px; }
  .hero h1, .page-head h1, .course-head h1 { font-size: 30px; }
  .hero, .page-head { margin-bottom: 14px; }
  .eyebrow { font-size: 13px; }

  /* chat home */
  .chat-view.is-empty { padding-top: 12px; }
  .chat-view.is-empty .chat-top { display: none; }   /* the recent chats are behind the clock in the top bar */
  .chat-cover { width: 170px; height: 136px; margin-bottom: 2px; }
  .chat-welcome .brand-mark.xl { width: 84px; height: 84px; }
  .bloom { width: 112px; height: 112px; }
  .chat-welcome h1 { font-size: 28px; }
  .chat-welcome p { font-size: 15.5px; }
  .chat-view.is-empty .composer { box-shadow: var(--lift); }
  .chat-view.is-empty .chat-suggest { gap: 8px; margin-top: 18px; }
  .chat-suggest .chip { font-size: 13px; }
  .chat-view.is-empty .chat-suggest { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 6px; }
  .chat-view.is-empty .chat-suggest::-webkit-scrollbar { display: none; }
  .chat-view.is-empty .chat-suggest .chip { flex: none; white-space: nowrap; }
  .chat-view.is-empty .glance.on { gap: 5px; }
  .gp { height: 28px; padding: 0 10px; font-size: 12.5px; }
  .msg.user .bubble { background: var(--card); box-shadow: var(--shadow); }   /* a tinted bubble would melt into the sky */

  /* sections: white rounded cards on the cream, a little tighter */
  .card, .conn { margin-top: 14px; border-radius: 24px; }
  .card { padding: 16px; }
  .mission, .add-mission, .done-divider { padding-inline: 14px; }
  .mlist > .empty, .view > .empty { box-shadow: none; background: var(--card); }

  /* course gallery */
  .gcover { height: 64px; }
  .gcard { box-shadow: 0 0 0 1px var(--line); min-height: 0; gap: 8px; padding-bottom: 12px; }
  .gcard .gtop { margin-top: -20px; }
  .gcard .ctile.lg { width: 36px; height: 36px; font-size: 20px; border-radius: 14px; }
  .gpct { font-size: 16px; }
  .gmeta { display: none; }

  /* sign-in: the art becomes a short band on top */
  .auth-art { display: block; order: -1; height: 120px; margin: 0; border-radius: 0; }
  .auth-art .floating { display: none; }
  .auth { align-content: start; }
  .auth-inner { margin: 0 auto; padding-top: 24px; }
}

/* ═════════════ Explainer animation: the quick-add syntax demo ═════════════
   Motion rules (from the animate skill): only transform/opacity, ease-out-quint on enter, ~300ms, staggered, reduced-motion respected.
   Every element's resting style is its final, visible state, so turning animation off never hides anything. */
:root { --ease-out-quint: cubic-bezier(.23, 1, .32, 1); }

/* quick-add: "סיכום פרק 3 @שישי #קריאה !דחוף" → chips, typed out on a loop while the add field is focused */
.qa-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; color: var(--ink); font-size: 12.5px; }
.qa-line { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.add-hint .qa-tok { animation: qa-tok 6s var(--ease-out-quint) infinite both; animation-delay: calc(var(--k) * .55s); }
.qa-arrow { color: var(--ink-3); animation: qa-chip 6s var(--ease-out-quint) infinite both; animation-delay: 2s; }
.qa-out { display: inline-flex; gap: 6px; }
.qa-chip { font-size: 12px; padding: 1px 6px; border-radius: 7px; background: var(--card); box-shadow: var(--shadow); display: inline-block; animation: qa-chip 6s var(--ease-out-quint) infinite both; animation-delay: calc(2s + var(--k) * .2s); }
@keyframes qa-tok { 0% { opacity: 0; transform: translateY(3px); } 5% { opacity: 1; transform: none; background: var(--accent-soft); } 30%, 80% { opacity: 1; background: var(--fill-2); } 90%, 100% { opacity: 0; } }
@keyframes qa-chip { 0% { opacity: 0; transform: translateY(4px) scale(.92); } 5%, 66% { opacity: 1; transform: none; } 76%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .add-hint .qa-tok, .qa-arrow, .qa-chip { animation: none !important; }
}

/* ═════════════ The study ghost: Kernuli's face ═════════════
   A soft cream 3D buddy (public/mascot/ghost.webp). It materializes and floats on the chat home (poke it), peeks from
   behind the sign-in cards, bobs while it thinks or loads, naps over empty lists, cheers done missions and throws a
   party when a unit is finished. Every resting state is still and fully visible. */
img.ghost { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }
@media (hover: hover) { .brand:hover .ghost { animation: ghost-wiggle .5s var(--ease-out-quint); } }

/* chat home: fades in like a ghost would, then floats; a poke makes it squish, hop and send hearts */
.chat-welcome .brand-mark.xl { cursor: pointer; animation: ghost-appear .9s var(--ease-out-quint) .15s both; }
.brand-mark.xl .ghost { filter: drop-shadow(0 8px 12px rgba(80, 60, 140, .18)); animation: ghost-float 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
.brand-mark.xl.boop .ghost { animation: ghost-boop .65s var(--ease-out-quint), ghost-float 3.6s ease-in-out .65s infinite; }

/* chat thinking + loading: bob and gently fade in and out */
/* Kernuli's side of the chat (the far edge, mirroring the student's ghost on theirs): its face beside every reply,
   and the same spot while it thinks, so the answer lands where the thinking was */
.msg.ai.thinking { display: flex; flex-direction: row-reverse; justify-content: flex-start; align-items: center; gap: 10px; max-width: none; }
.msg.ai:not(.thinking) { grid-template-columns: minmax(0, 1fr) 28px; column-gap: 10px; margin-inline-start: auto; }
.msg.ai > :not(.ai-ghost) { grid-column: 1; }
.ai-ghost { grid-column: 2; grid-row: 1 / span 3; align-self: start; width: 28px; height: 28px; margin-top: 1px; }
.ghost-think { width: 30px; height: 30px; flex: none; animation: ghost-bob 1.1s ease-in-out infinite, ghost-breathe 2.2s ease-in-out infinite; }
.spin-ghost { width: 24px; height: 24px; flex: none; animation: ghost-bob 1.1s ease-in-out infinite, ghost-breathe 2.2s ease-in-out infinite; }

/* sign-in: peeks out from behind the date card, seen softly through its frosted glass */
.auth-art .fcard { position: relative; z-index: 1; }
.auth-ghost { position: absolute; z-index: 0; top: -70px; inset-inline-start: 136px; width: 96px; height: 96px; animation: ghost-peek 1.1s var(--ease-out-quint) .5s both; }
.auth-ghost .ghost { filter: drop-shadow(0 8px 14px rgba(80, 60, 140, .2)); animation: ghost-float 3.6s ease-in-out 1.6s infinite; }

/* empty lists: the ghost naps above the message, with a slow z */
.empty { position: relative; }
.empty::before { content: ""; display: block; width: 58px; height: 58px; margin: 0 auto 10px; background: url(/mascot/moods/sleepy.webp) center / contain no-repeat; animation: ghost-float 3.6s ease-in-out infinite; }
.empty::after { content: "z"; position: absolute; top: 22px; left: calc(50% + 26px); font-size: 13px; font-weight: 700; color: var(--ink-3); animation: ghost-z 2.8s ease-in-out infinite; }
.palette .empty::before { width: 40px; height: 40px; background-image: url(/mascot/moods/surprised.webp); }
.palette .empty::after { display: none; }

/* a done mission: a small ghost pops out of the checkbox, hops, then drifts up and fades */
.ghost-cheer { position: fixed; z-index: 80; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; animation: ghost-cheer 1.25s var(--ease-out-quint) forwards; }
/* a finished unit: the ghost flies up from the bottom, does a happy flip and floats off */
.ghost-party { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: grid; place-items: end center; }
.gp-ghost { width: 120px; height: 120px; margin-bottom: 22vh; filter: drop-shadow(0 14px 22px rgba(80, 60, 140, .28)); animation: ghost-party 2.5s var(--ease-out-quint) forwards; }
/* emoji confetti, flung out along --a by --d */
.burst { position: fixed; z-index: 81; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: 0; top: 0; font-style: normal; font-size: 15px; line-height: 1; translate: -50% -50%; animation: burst-fly .9s var(--ease-out-quint) forwards; }

/* the student's own ghost: their avatar in the sidebar and beside their chat messages */
.avatar.me { position: relative; background: #ece9f6; border-radius: 30%; overflow: hidden; }
/* the picture fills the whole tile (.avatar centres its content, which shrank it to a thin strip) */
.avatar.me > .me-ghost { position: absolute; inset: 0; width: auto; height: auto; }
/* a still frame by default; the animated loop is layered on top only when it should feel alive (hover, chosen, meeting
   it), so the still shows while the loop loads and nothing moves in the corner of your eye */
.me-ghost { display: block; width: 100%; height: 100%; background: var(--g) 50% 42% / 150% no-repeat; }
.gg-opt.on .me-ghost, .meet-ghost .me-ghost { background-image: var(--ga), var(--g); } @media (hover: hover) { .user-chip:hover .me-ghost, .gg-opt:hover .me-ghost { background-image: var(--ga), var(--g); } }
.msg.user { align-items: flex-end; gap: 8px; }
.msg.user .avatar.me { width: 28px; height: 28px; margin-bottom: 2px; }
/* the ghost picker: app-icon tiles, the chosen one dances inside a ring */
.ghost-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; }
.gg-opt { display: grid; justify-items: center; gap: 7px; padding: 8px 4px 6px; border: 0; background: none; border-radius: 20px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: background .12s, color .12s; }
@media (hover: hover) { .gg-opt:hover { background: var(--fill-2); color: var(--ink); } }
.gg-opt .me-ghost { width: 72px; height: 72px; border-radius: 28px; background-size: 118%; background-position: 50% 45%; box-shadow: 0 1px 2px rgba(15, 15, 15, .08); transition: box-shadow .15s var(--ease), transform .3s var(--ease-out-quint); }
@media (hover: hover) { .gg-opt:hover .me-ghost { transform: translateY(-3px); } }
.gg-opt.on { color: var(--ink); font-weight: 650; }
.gg-opt.on .me-ghost { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5px var(--main), 0 8px 18px rgba(15, 15, 15, .14); animation: ghost-pick .45s var(--ease-out-quint); }
/* meet your ghost: one warm moment the first time, centred like a card being handed over */
.meet-modal { width: min(400px, 100%); }
.meet { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 30px 28px 24px; }
.meet-ghost { width: 168px; height: 168px; border-radius: 44px; overflow: hidden; box-shadow: 0 18px 36px rgba(60, 40, 120, .22); margin-bottom: 8px; animation: meet-in .7s var(--ease-out-quint) .1s both; }
.meet-ghost .me-ghost { background-size: 100%; background-position: center; }
.meet h2 { margin: 6px 0 0; font-size: 22px; font-weight: 600; }
.meet p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; text-wrap: balance; }
.meet p b { color: var(--ink); }
.meet-btns { display: flex; gap: 8px; margin-top: 12px; width: 100%; }
.meet-btns .btn { flex: 1; height: 40px; }
@keyframes meet-in { from { opacity: 0; transform: translateY(18px) scale(.8) rotate(-6deg); } }
@keyframes ghost-pick { 40% { transform: scale(1.12) rotate(-6deg); } }
@media (max-width: 560px) { .ghost-grid { grid-template-columns: repeat(3, 1fr); } }

@keyframes ghost-float { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes ghost-bob { 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes ghost-breathe { 50% { opacity: .6; } }
@keyframes ghost-wiggle { 30% { transform: rotate(-8deg); } 65% { transform: rotate(6deg); } }
@keyframes ghost-appear { from { opacity: 0; transform: translateY(16px) scale(.7); filter: blur(6px); } }
@keyframes ghost-peek { from { opacity: 0; transform: translateY(56px) scale(.9); } 60% { opacity: 1; transform: translateY(-6px); } }
@keyframes ghost-boop {
  0% { transform: none; } 18% { transform: translateY(4px) scale(1.18, .82); }
  45% { transform: translateY(-22px) scale(.9, 1.12) rotate(-6deg); } 72% { transform: translateY(2px) scale(1.08, .93); } 100% { transform: none; }
}
@keyframes ghost-z { 0% { opacity: 0; transform: translate(0, 6px) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -14px) scale(1.15); } }
@keyframes ghost-cheer {
  0% { opacity: 0; transform: translateY(0) scale(.3); } 22% { opacity: 1; transform: translateY(-30px) scale(1.12); }
  34% { transform: translateY(-24px) scale(1.12, .9); } 50% { transform: translateY(-38px) rotate(-10deg); }
  64% { transform: translateY(-34px) rotate(8deg); } 100% { opacity: 0; transform: translateY(-70px) scale(.85); }
}
@keyframes ghost-party {
  0% { opacity: 0; transform: translateY(40vh) scale(.6); } 22% { opacity: 1; transform: translateY(-10px) scale(1.05); }
  30% { transform: translateY(0) scale(1.14, .88); } 42% { transform: translateY(-40px) rotate(-180deg) scale(.95); }
  54% { transform: translateY(0) rotate(-360deg) scale(1.1, .9); } 62% { transform: rotate(-360deg); }
  80% { opacity: 1; transform: translateY(-20px) rotate(-360deg); } 100% { opacity: 0; transform: translateY(-34vh) rotate(-360deg) scale(.8); }
}
@keyframes burst-fly {
  from { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(calc(var(--a) * -1)) scale(.3); }
  70% { opacity: 1; } to { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(calc(var(--a) * -1)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ghost, .ghost-think, .spin-ghost, .brand-mark.xl, .auth-ghost, .empty::before, .ghost-cheer, .gp-ghost, .gg-opt .me-ghost, .meet-ghost { animation: none !important; }
  .me-ghost { background-image: var(--g) !important; }
  .empty::after { display: none; }
}

/* ═════════════ Landing ═════════════
   The landing page itself is public/landing.css (loaded only with it). The sign-in screen shares these two. */
.btn.lg { height: 50px; padding: 0 28px; font-size: 16px; font-weight: 600; border-radius: var(--r-p); }
.auth .brand.is-link { cursor: pointer; width: fit-content; }

/* ───────── Exam schedule (#/exams): its own page, never the mission board ───────── */
.moed { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--fill-2); border-radius: 8px; padding: 1px 7px; margin-inline-start: 6px; white-space: nowrap; vertical-align: 1px; }
.xleft { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--fill-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xleft.near { color: var(--amber); background: color-mix(in srgb, var(--amber) 11%, var(--card)); }
.xleft.soon { color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--card)); }
.dot { color: var(--ink-3); margin-inline: 6px; }

/* the next exam: date block, what and where, and the countdown */
.xnext { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 18px; padding: 20px 22px; border-radius: var(--r-w);
  background: color-mix(in srgb, var(--c, var(--accent)) 7%, var(--card)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 22%, var(--line)); }
.xnext-date { display: grid; justify-items: center; width: 74px; padding: 8px 0 10px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.xnext-date span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.xnext-date span:first-child { color: var(--today); }
.xnext-date b { font-size: 32px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.xnext-body { min-width: 0; cursor: pointer; }
.xnext-eyebrow { font-size: 12px; font-weight: 600; color: var(--c, var(--ink-2)); text-transform: none; }
.xnext h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.xnext h2 .em { font-size: 22px; }
.xnext .xs { font-size: 13.5px; }
.xnext-side { display: grid; justify-items: center; gap: 8px; text-align: center; }
.xnext-count { display: grid; justify-items: center; line-height: 1; }
.xnext-count b { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.xnext-count b.word { font-size: 26px; color: var(--red); }
.xnext-count span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.xplan { font-size: 12.5px; color: var(--c-moss); font-weight: 600; }

/* the rest, by month */
.xmonth { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 26px 4px 8px; }
.xlist { display: grid; gap: 2px; }
.xrow { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 10px 10px; border-radius: var(--r-c); cursor: pointer; transition: background .12s; }
.xrow:focus-visible { background: var(--fill-2); } @media (hover: hover) { .xrow:hover { background: var(--fill-2); } }
.xdate { display: grid; justify-items: center; padding: 5px 0; border-radius: 16px; background: color-mix(in srgb, var(--c, var(--ink-3)) 10%, var(--card)); border-inline-start: 3px solid var(--c, var(--ink-3)); }
.xdate b { font-size: 19px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.xdate span { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.xbody { min-width: 0; }
.xt { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; min-width: 0; }
.xs { display: flex; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.xs .cref { font-weight: 600; }
.xwarn { font-size: 12px; color: var(--amber); font-weight: 600; margin-top: 4px; }
.xrow.past { opacity: .55; }
.xpast { margin-top: 26px; }
.xpast summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 4px 6px; border-radius: 10px; }
.xpast summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .xpast summary:hover { background: var(--fill-2); } }
.xpast summary svg.i { transition: transform .15s var(--ease); transform: rotate(90deg); }
.xpast[open] summary svg.i { transform: none; }
.xpast .xlist { margin-top: 6px; }

/* an exam on a day of the week: a slot with a red edge, above the classes */

@media (max-width: 760px) {
  .xnext { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; }
  .xnext-side { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: space-between; align-items: center; border-top: 1px solid var(--sep); padding-top: 12px; }
  .xnext-count { grid-auto-flow: column; align-items: baseline; gap: 6px; }
  .xnext-count b { font-size: 26px; }
  .xnext-count span { margin-top: 0; }
  .xnext h2 { font-size: 18px; }
  .xnext-date { width: 60px; }
  .xnext-date b { font-size: 26px; }
  .xrow { grid-template-columns: 44px 1fr; }
  .xrow .xleft { grid-column: 2; justify-self: start; margin-top: -4px; }
}

/* ───────────── Week (#/week): Kernuli plans the week with you ─────────────
   Notion Calendar's calm: the month as the title, a day / week / month switch, thin lines, soft rounded events, today
   in a red circle and a red line for now. The ghost is a slim strip of tags over it (its sentences open on a tap).
   A phone sees the whole week too, in narrow columns: titles only, deadlines as dots under the date. */
.show-m { display: none; }
.week-view { max-width: 1240px; padding-inline: 40px; padding-top: 28px; }

.cal-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-title { margin: 0; font-size: 32px; line-height: 1.15; display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.cal-title small { font-family: var(--sans); font-size: 15px; font-weight: 400; color: var(--ink-3); }
.cal-nav { display: flex; gap: 4px; }
.cal-nav .btn { box-shadow: none; background: none; }
@media (hover: hover) { .cal-nav .btn:hover { background: var(--fill-2); } }
.cal-nav .btn:disabled { opacity: .4; }
.cal-seg button { min-width: 56px; }

/* the ghost, small */
.gs { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 8px 10px; margin-bottom: 14px; }
.gs.is-props { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow); }
.gs-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gs-ghost { width: 38px; height: 38px; flex: none; border: 0; padding: 0; background: none; cursor: pointer; }
.gs-ghost .ghost { filter: drop-shadow(0 4px 8px rgba(80, 60, 140, .16)); animation: ghost-float 3.6s ease-in-out infinite; }
.gs-tags { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; cursor: pointer; }
.gs-tags::-webkit-scrollbar { display: none; }
.gs-tags span { flex: none; font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 99px; background: var(--fill-2); white-space: nowrap; }
.gs-acts { display: flex; gap: 6px; flex: none; }
.gs-acts .btn.sm { height: 32px; }
.gs-says { display: none; padding: 8px 6px 4px 48px; padding-inline: 48px 6px; }
.gs.open .gs-says, .gs.is-props .gs-says { display: grid; gap: 4px; }
.gs-says p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.gs-says p:first-child { color: var(--ink); }
.gs-says .link-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.gs-says .link-btn svg.i { width: 14px; height: 14px; }

/* the time grid (one day or seven): --hh an hour, a 44px column of hours */
.wk { --hh: 48px; --ppm: calc(var(--hh) / 60); --gut: 44px; background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 6px 8px 10px; overflow: hidden; }
.wk-top, .wk-grid { display: grid; grid-template-columns: var(--gut) repeat(var(--cols), minmax(0, 1fr)); }
.wk-top { position: sticky; top: 0; z-index: 3; background: var(--card); padding-bottom: 6px; border-bottom: 1px solid var(--sep); }
.wk-dh { min-width: 0; padding: 4px 3px 0; display: grid; gap: 4px; align-content: start; }
.wk-dn { display: flex; align-items: center; gap: 6px; padding: 2px 5px; border: 0; background: none; border-radius: 12px; cursor: pointer; width: max-content; max-width: 100%; }
@media (hover: hover) { .wk-dn:hover { background: var(--fill-2); } }
.wk.one .wk-dn { cursor: default; background: none; }
.wk-dn > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.wk-dn b { font-family: var(--display); font-size: 17px; font-weight: 600; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.wk-dh.today .wk-dn > span { color: var(--today); }
.wk-dh.today .wk-dn b { background: var(--today); color: #fff; }
.wk-dh.past { opacity: .55; }
.wk-flags { display: grid; gap: 3px; min-width: 0; }
.wk-dots { display: none; }
.wk-flag { display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; border: 0; padding: 3px 8px; border-radius: 8px; font-size: 11.5px; font-weight: 500; text-align: start;
  background: color-mix(in srgb, var(--c, var(--ink-3)) 12%, var(--card)); color: var(--ink); cursor: pointer; }
.wk-flag[draggable] { cursor: grab; }
.wk-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }
.wk-flag .em { display: none; }
.wk-flag.done { opacity: .5; text-decoration: line-through; }
.wk-flag.ready { box-shadow: inset 0 0 0 1.5px var(--amber); }
.wk-flag.exam { background: color-mix(in srgb, var(--today) 12%, var(--card)); color: color-mix(in srgb, var(--today) 70%, var(--ink)); font-weight: 600; }
.wk-flag.exam::before { display: none; }
.wk-flag.exam .em { display: inline; font-size: 11px; }

.wk-grid { position: relative; height: calc(var(--hours) * var(--hh)); margin-top: 4px; }
.wk-hours { display: grid; grid-auto-rows: var(--hh); }
.wk-hours > span { font-size: 10.5px; color: var(--ink-3); transform: translateY(-7px); text-align: center; font-variant-numeric: tabular-nums; }
.wk-hours > span:first-child { visibility: hidden; }
.wk-col { position: relative; min-width: 0; border-inline-start: 1px solid var(--sep); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hh) - 1px), var(--sep) calc(var(--hh) - 1px) var(--hh)); }
.wk-col.wkend { background-color: rgba(70, 50, 30, .018); }
.wk-col.today { background-color: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.wk-col.past { cursor: default; background-color: rgba(70, 50, 30, .025); }
.wk-col.drop { background-color: var(--accent-soft); }
.wk-now { position: absolute; z-index: 2; inset-inline: -1px; top: calc((var(--s) - var(--from) * 60) * var(--ppm)); height: 2px; background: var(--today); pointer-events: none; }
.wk-now::before { content: ""; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--today); }

.wb { position: absolute; --w: calc((100% - 6px) / var(--lanes, 1)); inset-inline-start: calc(3px + var(--w) * var(--lane, 0)); width: calc(var(--w) - 2px);
  top: calc((var(--s) - var(--from) * 60) * var(--ppm) + 1px); height: calc(var(--m) * var(--ppm) - 2px); min-height: 18px;
  display: grid; align-content: start; gap: 1px; padding: 4px 7px; border-radius: 8px; overflow: hidden; cursor: pointer; font-size: 11.5px; line-height: 1.3; text-align: start;
  transition: transform .2s var(--spring), box-shadow .2s; }
.wb b { font-weight: 600; display: flex; gap: 4px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb b .em { font-size: 11px; }
.wb span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
@media (hover: hover) { .wb:hover { transform: scale(1.02); z-index: 2; } }
.wb.cls { background: color-mix(in srgb, var(--c) 13%, var(--card)); }
.wb.xm { background: color-mix(in srgb, var(--today) 14%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--today) 45%, transparent); }
.wb.study { background: var(--card); border-inline-start: 3px solid var(--c); box-shadow: 0 0 0 1px rgba(70, 50, 30, .07), 0 4px 12px -6px rgba(70, 50, 30, .25); }
.wb-due { display: none; font-style: normal; }
.wb.study.done { opacity: .5; }
.wb.study.done b { text-decoration: line-through; }
.wb.study.dragging, .wk-flag.dragging { opacity: .4; }
.wb.free { border: 1.5px dashed var(--sep-2); background: none; color: var(--ink-3); align-content: center; justify-items: center; }
.wb.free b { color: var(--accent); font-weight: 500; }
.wb.free svg.i { width: 13px; height: 13px; }
@media (hover: hover) { .wb.free:hover { transform: none; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); } }
.wb.prop { background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); cursor: default; animation: prop-in .45s var(--spring) both; }
@media (hover: hover) { .wb.prop:hover { z-index: 3; } }
@keyframes prop-in { from { opacity: 0; transform: scale(.9); } }
.prop-btns { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: color-mix(in srgb, var(--card) 70%, transparent);
  backdrop-filter: blur(2px); opacity: 0; transition: opacity .15s; }
.wb.prop:hover .prop-btns, .wb.prop:focus-within .prop-btns { opacity: 1; }
.prop-btns button { width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0; background: var(--card); color: var(--ink-2); box-shadow: var(--shadow); cursor: pointer; }
.prop-btns button:last-child { background: var(--accent); color: #fff; }
.prop-btns svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
/* one day: room for everything */
.wk.one .wb { font-size: 13.5px; padding: 7px 12px; }
.wk.one .wb span { font-size: 12px; }
.wk.one .wb-due { display: inline; }
.wk.one .prop-btns { opacity: 1; background: none; backdrop-filter: none; inset: auto; top: 6px; inset-inline-end: 8px; }
.wk.one .wk-flag { font-size: 13px; padding: 5px 10px; }

/* the month */
.mo { background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 6px 8px 8px; }
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head span { font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 6px 8px; }
.mo-grid { border-top: 1px solid var(--sep); }
.mc { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 128px; padding: 5px 4px 6px; border: 0; background: none; text-align: start;
  border-bottom: 1px solid var(--sep); border-inline-start: 1px solid var(--sep); cursor: pointer; transition: background .15s; }
.mc:nth-child(7n + 1) { border-inline-start: 0; }
@media (hover: hover) { .mc:hover { background: var(--fill-2); } }
.mc.wkend { background-color: rgba(70, 50, 30, .018); }
.mc > b { font-family: var(--display); font-size: 14px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mc.out > b { color: var(--ink-3); font-weight: 500; }
.mc.out .mc-ev { opacity: .55; }
.mc.today > b { background: var(--today); color: #fff; }
.mc-ev { display: grid; gap: 2px; min-width: 0; }
.me { display: block; font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--ink-3)) 13%, var(--card)); color: var(--ink); }
.me.cl { background: none; color: var(--ink-2); font-weight: 400; padding-inline: 4px; display: flex; align-items: center; gap: 4px; }
.me.cl::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }
.me.cl .ltr { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mc-cls { display: none; }
.me.st { background: none; box-shadow: inset 2px 0 0 var(--c); color: var(--ink-2); }
.me.x { background: color-mix(in srgb, var(--today) 13%, var(--card)); color: color-mix(in srgb, var(--today) 70%, var(--ink)); font-weight: 600; }
.me.done { opacity: .5; text-decoration: line-through; }
.me.more { background: none; color: var(--ink-3); padding-top: 0; }
.mc-dots { display: none; }
.mc-dots u, .wk-dots u { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.mc-dots u.x, .wk-dots u.x { background: var(--today); }
.mc-dots u.st { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }

/* a day's list (under the month on a phone) */
.ag { margin-top: 12px; background: var(--card); border-radius: var(--r-w); box-shadow: var(--shadow); padding: 14px 12px 10px; }
.ag h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; font-size: 18px; }
.ag h3 .faint { font-family: var(--sans); font-size: 13px; font-weight: 400; }
.ag-row { display: grid; grid-template-columns: 48px 3px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 8px 4px; border: 0; background: none; border-radius: 14px; text-align: start; cursor: pointer; }
@media (hover: hover) { .ag-row:hover { background: var(--fill-2); } }
.ag-t { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ag-bar { align-self: stretch; border-radius: 3px; background: var(--c, var(--ink-3)); }
.ag-row.exam .ag-bar { background: var(--today); }
.ag-row.study .ag-bar { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.ag-main { display: grid; gap: 1px; min-width: 0; }
.ag-main b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-main span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-row.done .ag-main b { text-decoration: line-through; color: var(--ink-3); }
.ag-empty { margin: 4px 4px 8px; color: var(--ink-3); font-size: 14px; }
.ag-open { margin-top: 6px; }

/* phone: the whole week in narrow columns, the ghost in one line, the month as dots */
@media (max-width: 760px) {
  .show-m { display: revert; }
  span.show-m { display: inline; }
  .week-view { padding: 6px 10px calc(var(--tabbar) + var(--safe-b) + 24px); }
  .cal-head { grid-template-columns: 1fr auto; gap: 8px 6px; margin-bottom: 10px; padding-inline: 4px; }
  .cal-title { font-size: 26px; }
  .cal-title small { font-size: 13px; }
  .cal-seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .cal-nav .btn.sm { height: 32px; }
  .gs { padding: 6px 8px; border-radius: 20px; margin-bottom: 10px; }
  .gs-ghost { width: 32px; height: 32px; }
  .gs-tags span { font-size: 12.5px; padding: 4px 9px; }
  .gs-acts .btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
  .gs-acts .btn.sm:not(.primary):not(.icon) { display: none; }
  .gs-acts .btn.sm:only-child:not(.primary) { display: inline-flex; }
  .gs-says { padding-inline: 42px 4px; }
  .gs.is-props:not(.open) .gs-says { display: none; }   /* the tags already say it; the sentences open on a tap */
  .gs-says p { font-size: 14px; }

  .wk { --hh: 40px; --gut: 28px; padding: 4px 4px 8px; border-radius: 20px; }
  .wk-dh { padding: 2px 0 0; justify-items: center; gap: 3px; }
  .wk-dn { flex-direction: column; gap: 0; padding: 2px; }
  .wk-dn > span { font-size: 11px; }
  .wk-dn b { font-size: 15px; min-width: 26px; height: 26px; }
  .wk:not(.one) .wk-flags { display: none; }
  .wk:not(.one) .wk-dots { display: flex; gap: 3px; height: 5px; justify-content: center; }
  .wk-hours > span { font-size: 9.5px; }
  .wk:not(.one) .wb { --w: calc((100% - 2px) / var(--lanes, 1)); inset-inline-start: calc(1px + var(--w) * var(--lane, 0)); width: calc(var(--w) - 1px);
    padding: 3px; border-radius: 6px; font-size: 9.5px; line-height: 1.2; }
  .wk:not(.one) .wb b { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; font-weight: 600; }
  .wk:not(.one) .wb b .em, .wk:not(.one) .wb span { display: none; }
  .wk:not(.one) .wb.study { border-inline-start-width: 2px; }
  .wk:not(.one) .prop-btns { opacity: 1; background: none; backdrop-filter: none; inset: auto; bottom: 2px; inset-inline-start: 2px; gap: 2px; }
  .wk:not(.one) .prop-btns button { width: 20px; height: 20px; }
  .wk:not(.one) .prop-btns button:first-child { display: none; }
  .wk.one .wk-dh { justify-items: stretch; }
  .wk.one .wk-dn { flex-direction: row; gap: 6px; }
  @media (hover: hover) { .wb:hover { transform: none; } }

  .mo { padding: 4px 4px 6px; border-radius: 20px; }
  .mo-head span { text-align: center; padding: 4px 0; font-size: 11px; }
  .mc { min-height: 54px; align-items: center; padding: 4px 0 6px; gap: 4px; border-inline-start: 0; }
  .mc > b { font-size: 15px; width: 30px; height: 30px; }
  .mc.sel:not(.today) > b { background: var(--ink); color: #fff; }
  .mc.sel { background: var(--fill-2); }
  .mc-ev { display: none; }
  .mc-dots { display: flex; gap: 3px; height: 5px; }
  /* the day's lessons: short lines in their course colours, under the round dots of what's due */
  .mc-cls { display: flex; gap: 2px; }
  .mc-cls u { width: 7px; height: 3px; border-radius: 2px; background: var(--c, var(--ink-3)); opacity: .75; }
  .mc.out .mc-cls { opacity: .4; }
  .ag { border-radius: 20px; }
}

/* the year around the days: holidays (amber), the semester's first and last day (neutral), the exam period (soft red) */
.wk-flag.mark { cursor: default; background: color-mix(in srgb, var(--amber) 13%, var(--card)); color: color-mix(in srgb, var(--amber) 55%, var(--ink)); }
.wk-flag.mark::before { display: none; }
.wk-flag.mark .em { display: inline; font-size: 11px; }
.wk-flag.mark.term { background: var(--fill-2); color: var(--ink-2); }
.wk-flag.mark.exams { background: color-mix(in srgb, var(--today) 9%, var(--card)); color: color-mix(in srgb, var(--today) 65%, var(--ink)); }
.wk-dh.in-exams .wk-dn > span::after { content: " · מבחנים"; color: var(--today); }
.wk-col.off { background-color: color-mix(in srgb, var(--amber) 6%, transparent); }
.wk-dots u.mk { background: var(--amber); }
.wk-dots u.mk.term { background: var(--ink-3); }

.mb { display: block; font-size: 11px; font-weight: 600; padding: 2px 6px; margin-inline: -5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.45;
  background: color-mix(in srgb, var(--amber) 15%, var(--card)); color: color-mix(in srgb, var(--amber) 55%, var(--ink)); }
.mb.s { margin-inline-start: 0; border-start-start-radius: 6px; border-end-start-radius: 6px; }
.mb.e { margin-inline-end: 0; border-start-end-radius: 6px; border-end-end-radius: 6px; }
.mb.term { background: var(--fill); color: var(--ink-2); }
.mb.exams { background: color-mix(in srgb, var(--today) 11%, var(--card)); color: color-mix(in srgb, var(--today) 65%, var(--ink)); }
.mc.off > b { color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.mo-marks { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 4px 2px; }
.mo-mark { font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--amber) 12%, var(--card)); }
.mo-mark.term { background: var(--fill-2); }
.mo-mark.exams { background: color-mix(in srgb, var(--today) 9%, var(--card)); }
.mo-mark .faint { font-weight: 400; margin-inline-start: 2px; }
.ag-row.mark { cursor: default; }
.ag-row.mark .ag-bar { background: var(--amber); }
.ag-row.mark.term .ag-bar { background: var(--ink-3); }
.ag-row.mark.exams .ag-bar { background: var(--today); }
@media (max-width: 760px) {
  .wk-dh.in-exams .wk-dn > span::after { content: none; }
  /* a phone's month: the exam period and holidays tint their days; the names are in the list under the month */
  .mc.in-exams { background: color-mix(in srgb, var(--today) 6%, transparent); }
  .mc.in-hol { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--amber) 55%, transparent); }
  .mo-marks { padding: 10px 2px 2px; gap: 5px; }
  .mo-mark { font-size: 12px; padding: 3px 9px; }
}

/* the chat home's glance: a row of small pills under the greeting, like a status line */
.glance { display: none; }
.chat-view.is-empty .glance.on { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; max-width: 100%; min-width: 0; animation: rise .5s .1s var(--ease) both; }
.gp { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(70, 50, 30, .055);
  color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; max-width: 100%; min-width: 0; }
@media (hover: hover) { .gp:hover { background: rgba(70, 50, 30, .09); color: var(--ink); } }
.chat-welcome a.gp { color: var(--ink-2); }
@media (hover: hover) { .chat-welcome a.gp:hover { color: var(--ink); } }
.gp .bad { color: var(--red); }
.gp .faint { color: var(--ink-3); }
.gp-k { color: var(--ink-3); }
.gp-ring { width: 15px; height: 15px; transform: rotate(-90deg); }
.gp-ring circle { fill: none; stroke: rgba(70, 50, 30, .14); stroke-width: 2.6; }
.gp-ring circle.v { stroke: var(--accent); stroke-linecap: round; }

/* the recent chats, in the sidebar under "שיחה" */
.nav-chats { display: grid; gap: 1px; margin: 2px 0 6px; padding-inline-start: 34px; }
.nav-chat { display: block; width: 100%; height: 30px; padding: 0 10px; border: 0; background: none; border-radius: 999px; text-align: start; font-size: 13px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .nav-chat:hover { background: rgba(255, 255, 255, .5); color: var(--ink); } }
.nav-chat.on { color: var(--ink); font-weight: 600; background: rgba(255, 255, 255, .6); }
/* a computer has them in the sidebar, so the top's "אחרונות" shows only inside a chat (for deleting it) */
@media (min-width: 761px) { .chat-view.is-empty .chat-top [data-action="chat-history"] { display: none; } }

/* iPad and computer: the screen's real height. 100vh is taller than what's visible while Safari's toolbar shows, so the
   side menu's bottom (the profile) and the chat's composer slipped under it */
@supports (height: 100dvh) {
  .app, #root:empty { min-height: 100dvh; }
  .menu { max-height: calc(100dvh - 16px); }
  @media (min-width: 761px) {
    .sidebar { height: 100dvh; }
    .main { min-height: calc(100dvh - 20px); }
    .chat-view { min-height: calc(100dvh - 20px); }
  }
}

/* kept in step with Moodle: the "N עדכונים מהמודל" pill on the chat home, the list of what changed, the "new" marks */
.gp.gp-moodle { background: linear-gradient(135deg, #eef1fd, #f6eefa 60%, #fdf0ea); color: var(--accent-2); font-weight: 600; }
.chg-modal { width: min(460px, 100%); }
.chg-list { display: grid; gap: 2px; max-height: min(60vh, 520px); overflow-y: auto; margin: 4px 0 12px; }
.chg { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-i); color: var(--ink); text-decoration: none; }
@media (hover: hover) { .chg:hover { background: var(--fill-2); } }
.chg-em { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--fill-2); font: 17px/1 var(--emoji); }
.chg.unseen .chg-em { background: var(--accent-soft); }
.chg-t { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.chg-t small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg-t b { font-weight: 600; font-size: 14.5px; }
.chg-t .faint { font-size: 12.5px; }
.chg-when { flex: none; font-size: 12px; }
.mnew { flex: none; padding: 2px 8px; border-radius: var(--r-p); background: var(--accent-soft); color: var(--accent-2); font-size: 11.5px; font-weight: 600; }
.mnew-t { color: var(--accent-2); font-weight: 600; }

/* ═════════════ Phone polish (2026-11-24) ═════════════
   After Grok / ChatGPT / Claude / Muse on iOS: Kernuli's answer is the page (full width, no face beside every line), the
   header holds the two chat actions instead of pills floating over the text, nothing peeks between the composer and the
   tab bar, and the tab bar steps aside while the student types. */
.c-inline { display: none; }
.tb-new { display: none !important; }
@media (max-width: 760px) {
  /* chat: the conversation's actions live in the top bar (history was there already; "new chat" joins it) */
  .app:has(.chat-view:not(.is-empty)) .tb-new { display: inline-flex !important; }
  .chat-view .chat-top > .btn { display: none; }
  .chat-view:not(:has(.kn-head)) .chat-top { min-height: 0; }

  /* the answer gets the whole width, like a page; the student's own line stays a bubble, without their face */
  .msg.ai:not(.thinking) { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 100%; margin-inline-start: 0; }
  .msg.ai > .ai-ghost { display: none; }
  .msg.user .avatar.me { display: none; }
  .msg.user .msg-body, .msg.user .bubble { max-width: 84%; }
  .msg.user .bubble { border-radius: 22px; border-end-start-radius: 8px; }
  .ai-text { font-size: 16px; line-height: 1.65; }
  .chat-log { gap: 26px; }

  /* the paper fades in under the composer and the tab bar, so no half-line of text shows between them */
  .chat-view:not(.is-empty)::after { content: ""; position: fixed; inset-inline: 0; bottom: 0; z-index: 39; pointer-events: none;
    height: calc(var(--tabbar) + var(--safe-b) + 84px);
    background: linear-gradient(to bottom, rgba(246, 242, 237, 0), rgba(246, 242, 237, .92) 38%, rgb(246, 242, 237)); }

  /* typing: the tab bar steps aside and the composer sits on the keyboard */
  .app:has(.composer textarea:focus) .tabbar { opacity: 0; transform: translateY(24px); pointer-events: none; }
  .app:has(.composer textarea:focus) .chat-view:not(.is-empty) .composer { bottom: calc(var(--safe-b) + 8px); }
  .app:has(.composer textarea:focus) .chat-view:not(.is-empty)::after { height: calc(var(--safe-b) + 84px); }
  .tabbar { transition: opacity .2s, transform .3s var(--ease); }
  .chat-view:not(.is-empty) .composer { transition: bottom .3s var(--ease); }

  /* list pages (tasks, exams, courses, grades…): a large title with its button beside it, like an iOS large title.
     The decorative cover and big emoji cost a third of the screen before the first row */
  #view:has(> .view > .page-head) > .cover, .view:has(> .page-head) > .page-icon { display: none; }
  .view:has(> .page-head) { padding-top: 14px; }
  .page-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .page-head h1 { font-size: 30px; }
  .page-head .head-actions { flex: none; }
  .page-head .head-actions .btn { height: 38px; border-radius: 999px; }

  /* the tasks list names each task's course (what a student scans for); the course page itself doesn't repeat its lecturer */
  .mrow .c-inline { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; padding: 1px 9px 1px 7px; border-radius: 999px;
    background: color-mix(in srgb, var(--c, var(--ink-3)) 11%, var(--card)); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
  .mrow .c-inline .em { font-size: 12px; }
  .mrow .c-inline .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
  .mrow .teacher.t-inline, .mission .teacher.t-inline { display: none; }

  /* week: the days stay on top while the hours scroll (overflow: clip keeps the corners without trapping the sticky row) */
  .wk { overflow: clip; }
  .wk-top { top: calc(50px + env(safe-area-inset-top, 0px)); }

  /* a task's details: labels sit at the top of their row; the date's quick picks are pills in one row */
  .props > span { align-self: start; min-height: 44px; }
  .prow .quick { width: 100%; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .prow .quick::-webkit-scrollbar { display: none; }
  .prow .quick .btn { flex: none; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--fill-2); color: var(--ink-2); font-size: 13.5px; }
  .prow .day-hint { font-size: 13px; }
}
/* ═════════════ Views: Kernuli's interactive answers (public/views.js) ═════════════
   A tile under the answer; the stage beside the chat (a full sheet on a phone or a tablet). */
:root { --stage-w: clamp(380px, 44vw, 720px); }
.vtiles { display: grid; gap: 8px; justify-items: start; }
.vtile { display: flex; align-items: center; gap: 12px; width: min(100%, 440px); padding: 9px; padding-inline-end: 12px; border: 0; border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow); text-align: start; color: var(--ink); cursor: pointer; transition: transform .3s var(--spring), box-shadow .2s; }
@media (hover: hover) { .vtile:hover { box-shadow: var(--lift); transform: translateY(-1px); } }
.vtile:active { transform: scale(.98); }
.vtile.on { box-shadow: 0 0 0 2px var(--accent), var(--lift); }
.vtile.old { opacity: .7; }
.vtile-ic { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font: 23px/1 var(--emoji); background: var(--k, var(--inset)); }
.vtile-ic[data-kind="flashcards"] { --k: linear-gradient(140deg, #ffe7d6, #ffd9e4); }
.vtile-ic[data-kind="quiz"]       { --k: linear-gradient(140deg, #e3e9ff, #ece2ff); }
.vtile-ic[data-kind="match"]      { --k: linear-gradient(140deg, #f2e3fb, #ffe3ef); }
.vtile-ic[data-kind="cloze"]      { --k: linear-gradient(140deg, #fff3d1, #ffe6cc); }
.vtile-ic[data-kind="steps"]      { --k: linear-gradient(140deg, #dcf3e6, #e2f2fb); }
.vtile-ic[data-kind="table"]      { --k: linear-gradient(140deg, #d9f2f3, #e3ecff); }
.vtile-ic[data-kind="html"]       { --k: linear-gradient(140deg, #ffe0ec, #e4e2ff 55%, #dff1ff); }
.vtile-t { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.vtile-t b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtile-t small { font-size: 12.5px; color: var(--ink-3); }
.vtile-old { display: none; } .vtile.old .vtile-old { display: inline; }
.vtile-go { flex: none; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--fill); border-radius: 999px; padding: 6px 13px; }
.vtile.on .vtile-go { background: var(--accent-soft); color: var(--accent); }

.stage { position: fixed; z-index: 40; top: 16px; bottom: 16px; inset-inline-end: 16px; width: var(--stage-w); display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 28px; box-shadow: var(--float); overflow: hidden;
  opacity: 0; transform: translateX(-28px) scale(.985); transition: opacity .25s, transform .45s var(--ease); }
.stage.on { opacity: 1; transform: none; }
@media (min-width: 1001px) { html.stage-on .main { padding-inline-end: calc(var(--stage-w) + 22px); } html.stage-on .chat-view { max-width: 720px; padding-inline: 32px; } }
.stage-head { display: flex; align-items: center; gap: 11px; padding: 12px 12px 12px 14px; padding-inline: 16px 12px; border-bottom: 1px solid var(--sep); background: var(--glass); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); }
.stage-ic { flex: none; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; font: 20px/1 var(--emoji); background: var(--inset); }
.stage-t { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.stage-t b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-t small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-back { display: none; }
.stage-body { flex: 1; min-height: 0; overflow: auto; padding: 22px 28px 32px; overscroll-behavior: contain; }
.stage-body.is-frame { padding: 0; overflow: hidden; }
.stage[data-kind="table"] .stage-body { display: flex; flex-direction: column; }
@media (max-width: 1000px) {
  .stage { inset: 0; width: auto; z-index: 70; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top, 0px); transform: translateY(32px); }
  .stage-back { display: inline-flex; } .stage-x { display: none; }
  .stage-head { padding-inline: 8px 16px; }
  .stage-body { padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .stage, .fc-card, .v-bar i { transition: none !important; } }

/* text inside views (the AI's Markdown) */
.stage-body p { margin: 0 0 8px; } .stage-body p:last-child { margin-bottom: 0; }
.stage-body ul, .stage-body ol { margin: 4px 0 8px; padding-inline-start: 20px; display: grid; gap: 3px; text-align: start; }
.stage-body code { font-family: var(--mono); font-size: .88em; background: var(--fill); border-radius: 7px; padding: 1.5px 5px; unicode-bidi: isolate; }
.stage-body .code { margin: 8px 0; border-radius: 14px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; text-align: left; }
.stage-body .code-top { display: none; }
.stage-body pre { margin: 0; padding: 10px 12px; overflow-x: auto; } .stage-body pre code { background: none; padding: 0; font-size: 13px; }
.stage-body b { font-weight: 600; }

/* shared: progress, keys, the end */
.v-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; min-height: 30px; }
.v-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.v-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8cb0ff, var(--accent)); transition: width .45s var(--ease); }
.v-count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.v-lead { margin: -6px 0 16px; font-size: 14px; color: var(--ink-3); }
.v-lead.good { color: var(--c-moss); font-weight: 500; margin-top: 14px; }
.v-keys { margin: 16px 0 0; text-align: center; font-size: 12px; color: var(--ink-3); }
@media (hover: none) { .v-keys { display: none; } }
.v-done { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 26px 0 10px; animation: rise .5s var(--ease) both; }
.v-done-ring { position: relative; width: 128px; height: 128px; }
.v-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.v-ring circle { fill: none; stroke: var(--fill); stroke-width: 8; }
.v-ring circle.v { stroke: var(--c-moss); stroke-linecap: round; animation: ring-in 1.1s var(--ease) both; }
@keyframes ring-in { from { stroke-dashoffset: 213.6; } }
.v-done-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 28px var(--display); direction: ltr; }
.v-done > p { margin: 4px 0 2px; font-size: 16px; color: var(--ink-2); max-width: 400px; }
.v-done-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.good { color: var(--c-moss); } .bad { color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* flashcards */
.fc-deck { position: relative; perspective: 1400px; }
.fc-card { position: relative; height: clamp(260px, 48vh, 420px); transform-style: preserve-3d; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none;
  transform: translateX(var(--dx, 0px)) rotate(var(--rot, 0deg)) rotateY(var(--fy, 0deg)); transition: transform .6s var(--ease); }
.fc-card.flipped { --fy: 180deg; }
.fc-card.dragging { transition: none; cursor: grabbing; }
.fc-card:focus-visible .fc-face { box-shadow: 0 0 0 3px var(--accent-soft), var(--lift); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; background: var(--card); box-shadow: var(--lift);
  display: grid; align-content: center; justify-items: center; text-align: center; padding: 48px 30px; overflow: auto; }
.fc-back { transform: rotateY(180deg); background: linear-gradient(170deg, #ffffff, #f7f5ff); }
.fc-txt { font-size: clamp(19px, 2vw, 24px); line-height: 1.45; font-weight: 500; max-width: 100%; }
.fc-back .fc-txt { font-size: 17.5px; font-weight: 400; line-height: 1.6; }
.fc-tag { position: absolute; top: 16px; inset-inline-start: 18px; font-size: 12px; color: var(--ink-3); background: var(--fill); padding: 2px 10px; border-radius: 999px; }
.fc-back .fc-tag { background: var(--accent-soft); color: var(--accent); }
.fc-tap { position: absolute; bottom: 16px; inset-inline: 0; font-size: 12.5px; color: var(--ink-3); }
.fc-hint { margin-top: 16px; font-size: 14.5px; color: var(--ink-2); background: #fff6df; border-radius: 12px; padding: 6px 14px; animation: rise .3s var(--ease) both; }
.fc-stamp { position: absolute; top: 22px; z-index: 2; padding: 3px 14px; border: 3px solid; border-radius: 12px; font: 700 18px var(--display); pointer-events: none; transform: rotate(-10deg); background: rgba(255, 255, 255, .85); }
.fc-stamp.yes { inset-inline-end: 22px; color: var(--c-moss); opacity: var(--yes, 0); }
.fc-stamp.no { inset-inline-start: 22px; color: var(--red); opacity: var(--no, 0); transform: rotate(10deg); }
.fc-acts { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.fc-acts .btn { height: 48px; min-width: 136px; font-size: 15.5px; }
.btn.fc-no { background: #fdeceb; color: #c2413a; box-shadow: none; }
.btn.fc-yes { background: var(--c-moss); color: #fff; }

/* quiz */
.qz-q { font-size: 18.5px; font-weight: 500; line-height: 1.55; margin-bottom: 18px; }
.qz-opts { display: grid; gap: 10px; }
.qz-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 18px; background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line); text-align: start; font-size: 15.5px; line-height: 1.45; cursor: pointer; transition: box-shadow .15s, background .15s, transform .25s var(--spring), opacity .2s; }
@media (hover: hover) { .qz-opt:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--accent); background: #fafbff; } }
.qz-opt:not(:disabled):active { transform: scale(.985); }
.qz-opt:disabled { cursor: default; }
.qz-l { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--fill); display: grid; place-items: center; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .2s, color .2s; }
.qz-o { flex: 1; min-width: 0; }
.qz-mark { flex: none; font-weight: 700; font-size: 16px; }
.qz-opt.right { background: #ebf7f0; box-shadow: inset 0 0 0 2px var(--c-moss); }
.qz-opt.right .qz-l { background: var(--c-moss); color: #fff; } .qz-opt.right .qz-mark { color: var(--c-moss); }
.qz-opt.wrong { background: #fdefee; box-shadow: inset 0 0 0 2px var(--red); animation: shake .4s; }
.qz-opt.wrong .qz-l { background: var(--red); color: #fff; } .qz-opt.wrong .qz-mark { color: var(--red); }
.qz-opt.dim { opacity: .5; }
.qz-explain { margin-top: 14px; padding: 12px 16px; border-radius: 18px; background: var(--inset); font-size: 14.5px; line-height: 1.6; animation: rise .35s var(--ease) both; }
.qz-explain > b { display: block; margin-bottom: 2px; } .qz-explain.ok > b { color: var(--c-moss); } .qz-explain.no > b { color: var(--red); }
.qz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.qz-score { font-size: 13px; color: var(--c-moss); font-weight: 600; white-space: nowrap; }
.qz-open textarea { width: 100%; border: 0; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); padding: 12px 14px; font: inherit; font-size: 15px; resize: vertical; outline: none; }
.qz-open textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.qz-open > .btn { margin-top: 12px; }
.qz-model { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: #f2f5ff; font-size: 15px; line-height: 1.6; animation: rise .35s var(--ease) both; }
.qz-model .fc-tag { position: static; display: inline-block; margin-bottom: 6px; background: var(--accent-soft); color: var(--accent); }
.qz-self { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: 14.5px; color: var(--ink-2); }
.qz-review { display: grid; gap: 10px; margin-top: 18px; }
.qz-rev { padding: 14px 16px; border-radius: 18px; background: var(--inset); font-size: 14.5px; }
.qz-rev-q { font-weight: 500; margin-bottom: 6px; }
.qz-rev-a { display: grid; gap: 2px; font-size: 14px; }
.qz-rev-x { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }

/* match */
.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mt-col { display: grid; gap: 9px; align-content: start; }
.mt-t { width: 100%; min-height: 54px; padding: 10px 14px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14.5px; line-height: 1.4; cursor: pointer; transition: box-shadow .15s, background .2s, transform .25s var(--spring), opacity .3s; }
@media (hover: hover) { .mt-t:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--accent); } }
.mt-t.on { box-shadow: inset 0 0 0 2px var(--accent); background: #f3f6ff; transform: scale(1.02); }
.mt-t.done { background: hsl(var(--hue) 75% 95%); box-shadow: inset 0 0 0 1.5px hsl(var(--hue) 55% 78%); color: hsl(var(--hue) 35% 30%); cursor: default; animation: pop .35s var(--spring); }
.mt-t.shake { box-shadow: inset 0 0 0 2px var(--red); background: #fdefee; animation: shake .4s; }
@keyframes pop { 50% { transform: scale(1.04); } }

/* cloze */
.cz-text { font-size: 17px; line-height: 2.35; }
.cz-in { width: var(--w); max-width: 100%; height: 34px; border: 0; border-bottom: 2px solid var(--sep-2, var(--line)); border-radius: 9px 9px 3px 3px; background: var(--inset);
  padding: 0 6px; margin: 0 2px; font: inherit; font-size: 16px; font-weight: 500; text-align: center; color: var(--accent); outline: none; vertical-align: baseline; transition: background .2s, border-color .2s; }
.cz-in:focus { border-bottom-color: var(--accent); background: #f1f4ff; }
.cz-in.right { color: var(--c-moss); border-bottom-color: var(--c-moss); background: #ebf7f0; }
.cz-in.wrong { color: var(--red); border-bottom-color: var(--red); background: #fdefee; animation: shake .4s; }
.cz-in.empty { border-bottom-color: var(--amber); }
.cz-in.shown { color: var(--c-ink); border-bottom-color: var(--c-ink); background: #eef2fe; }
.cz-bank { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding: 12px; border-radius: 18px; background: var(--inset); animation: rise .3s var(--ease) both; }
.cz-bank .chip { background: var(--card); box-shadow: var(--shadow); cursor: pointer; }
.cz-bank .chip:disabled { opacity: .35; box-shadow: none; }
.cz .v-done-btns { justify-content: flex-start; margin-top: 22px; }

/* steps */
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sp-step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.sp-step:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 15px; top: 36px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.sp-step.open:not(:last-child)::before { background: color-mix(in srgb, var(--c-moss) 45%, var(--line)); }
.sp-n { flex: none; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--fill); color: var(--ink-3); }
.sp-step.open .sp-n { background: var(--c-moss); color: #fff; }
.sp-step.next .sp-n { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); }
.sp-main { flex: 1; min-width: 0; padding-top: 4px; display: grid; gap: 8px; justify-items: start; }
.sp-main > b { font-weight: 600; font-size: 15.5px; }
.sp-step.locked .sp-main > b { color: var(--ink-3); font-weight: 500; }
.sp-body { width: 100%; background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 12px 16px; line-height: 1.65; font-size: 15px; animation: rise .4s var(--ease) both; }

/* table */
.tb { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.tb-bar { display: flex; align-items: center; gap: 10px; }
.tb-bar input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); padding: 0 16px; font: inherit; font-size: 15px; outline: none; }
.tb-bar input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.tb-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.tb-wrap { flex: 1; min-height: 120px; overflow: auto; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tb table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.tb th { position: sticky; top: 0; z-index: 1; padding: 0; background: var(--inset); border-bottom: 1px solid var(--line); text-align: start; }
.tb th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tb th button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.tb-arrow { font-size: 11px; color: var(--ink-3); }
.tb th [aria-sort="ascending"] .tb-arrow, .tb th [aria-sort="descending"] .tb-arrow { color: var(--accent); }
.tb td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.tb td + td, .tb th + th { border-inline-start: 1px solid var(--line); }
.tb tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .tb tbody tr:hover td { background: #fbf9f5; } }
.tb-none { text-align: center; color: var(--ink-3); padding: 28px !important; }

/* a page the AI wrote */
.hv { display: block; width: 100%; height: 100%; border: 0; background: #fffdfa; }
.hv-load { height: 100%; display: grid; place-items: center; }
.cz-gap { display: block; height: 10px; }

/* ── board: an overview right in the chat (public/views.js boardHtml) ── */
.msg.ai .board { justify-self: stretch; }
.board { display: grid; gap: 12px; width: 100%; }
.bd-head { display: grid; gap: 1px; padding-inline: 4px; }
.bd-head b { font: 600 18px var(--display); }
.bd-head small { font-size: 13px; color: var(--ink-3); }
.bd-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-stat { flex: 1 1 120px; display: grid; justify-items: start; gap: 0; padding: 12px 16px 11px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow);
  animation: rise .5s calc(var(--d) * 60ms) var(--ease) both; }
.bd-stat-e { font: 18px/1 var(--emoji); margin-bottom: 6px; }
.bd-stat b { font: 600 28px/1.1 var(--display); letter-spacing: -.01em; }
.bd-stat small { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.bd-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; align-items: start; }
.board.one .bd-groups { grid-template-columns: 1fr; }
.bd-g:not([data-color]) { --c: var(--ink-3); }
.bd-g { padding: 12px 14px 8px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow);
  animation: rise .5s calc(120ms + var(--d) * 70ms) var(--ease) both; }
.bd-g header { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.bd-g-ic { flex: none; width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; font: 17px/1 var(--emoji);
  background: color-mix(in srgb, var(--c) 14%, #fff); }
.bd-g header b { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.bd-g header a { color: inherit; text-decoration: none; }
@media (hover: hover) { .bd-g header a:hover { color: var(--c); } }
.bd-g-n { flex: none; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  color: color-mix(in srgb, var(--c) 80%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); }
.bd-g ul { list-style: none; margin: 0; padding: 0; }
.bd-i { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 0; border-top: 1px solid var(--sep); font-size: 14.5px; line-height: 1.35; }
.bd-i.later { display: none; } .bd-g.open .bd-i.later { display: flex; }
.bd-i-t { flex: 1; min-width: 0; }
.bd-i-t a { color: inherit; text-decoration: none; }
@media (hover: hover) { .bd-i-t a:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; } }
.bd-i-s { flex: none; font-size: 12px; color: var(--ink-2); background: var(--inset); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.bd-dot { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: none;
  box-shadow: inset 0 0 0 1.8px var(--sep-2); color: transparent; transition: background .2s, box-shadow .2s, transform .3s var(--spring); }
button.bd-dot { cursor: pointer; }
@media (hover: hover) { button.bd-dot:hover { box-shadow: inset 0 0 0 1.8px var(--c-moss); } }
button.bd-dot:active { transform: scale(.85); }
.bd-dot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bd-i.done .bd-dot { background: var(--c-moss); box-shadow: none; color: #fff; animation: pop .35s var(--spring); }
.bd-i.done .bd-i-t { color: var(--ink-2); }
.bd-i.late .bd-dot { box-shadow: inset 0 0 0 1.8px var(--red); }
.bd-i.late .bd-i-s { color: #c2413a; background: #fdeeed; }
.bd-i.none .bd-dot { width: 8px; height: 8px; margin-inline: 7px; box-shadow: none; background: color-mix(in srgb, var(--c) 55%, #fff); }
.bd-more { display: block; width: 100%; margin-top: 2px; padding: 8px 0 6px; border: 0; border-top: 1px solid var(--sep); background: none; font: inherit; font-size: 13px; color: var(--ink-3); cursor: pointer; }
@media (hover: hover) { .bd-more:hover { color: var(--ink); } }
.bd-g.tone-warn { background: linear-gradient(180deg, #fff6ea, #fff); box-shadow: 0 0 0 1px #f6dfc0, var(--shadow); }
.bd-g.tone-warn .bd-g-ic { background: #ffe8c8; }
.bd-g.tone-warn .bd-g-n { color: #a0610a; background: #ffeed6; }
.bd-g.tone-good { background: linear-gradient(180deg, #eef8f1, #fff); }
@media (max-width: 760px) { .bd-stat { padding: 10px 13px; } .bd-stat b { font-size: 24px; } .bd-groups { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bd-stat, .bd-g { animation: none; } }
.bd-i.has-d { align-items: flex-start; padding: 9px 0; }
.bd-i.has-d .bd-dot { margin-top: 2px; }
.bd-i.has-d.none .bd-dot { margin-top: 7px; }
.bd-i-t { display: grid; gap: 2px; }
.bd-i-t b { font-weight: 600; }
.bd-i-d { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.bd-i.has-d .bd-i-s { margin-top: 1px; }
.bd-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.55;
  background: #f2f5ff; box-shadow: inset 0 0 0 1px #e1e7fb; animation: rise .5s calc(160ms + var(--d) * 70ms) var(--ease) both; }
.bd-note.warn { background: #fff6ea; box-shadow: inset 0 0 0 1px #f6dfc0; }
.bd-note.good { background: #eef8f1; box-shadow: inset 0 0 0 1px #d4eedd; }
.bd-note-e { flex: none; font: 17px/1.3 var(--emoji); }
.bd-next { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-next .chip { display: inline-flex; align-items: center; padding: 7px 14px; font-size: 13.5px; background: var(--card); color: var(--ink-2); box-shadow: var(--shadow); white-space: normal; text-align: start; cursor: pointer; transition: transform .25s var(--spring), color .15s, box-shadow .2s; }
@media (hover: hover) { .bd-next .chip:hover { color: var(--ink); box-shadow: var(--lift); transform: translateY(-1px); } }

/* ── Kernuli thinking: one line that changes as it works (like Claude's chat), the reply as it's typed ── */
.msg.ai.thinking { align-items: flex-start; }
.msg.ai.thinking .ghost-think { margin-top: 0; }
.think { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.think-line { display: flex; align-items: baseline; gap: 8px; min-height: 30px; padding-top: 4px; font-size: 14.5px; line-height: 1.5; }
/* the words shimmer, like a thought passing; a new step fades in */
.think-line .ts-t { font-weight: 500; color: transparent; background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 40%, var(--ink-3) 80%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; animation: ts-shine 2.2s linear infinite, ts-in .35s var(--ease) both; }
.ts-time { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ts-time:empty { display: none; }
@keyframes ts-in { from { opacity: 0; transform: translateY(3px); } }
@keyframes ts-shine { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.think-draft { width: 100%; justify-self: start; animation: rise .3s var(--ease) both; }
.think-draft > :last-child { display: inline; }
.caret { display: inline-block; width: 7px; height: 1.05em; margin-inline-start: 3px; vertical-align: -2px; border-radius: 2px; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .think-line .ts-t, .caret { animation: none; } .think-line .ts-t { color: var(--ink-2); background: none; } }

/* the same steps, folded above the answer: "חשב 17 שנ׳ ›" */
.trace { justify-self: start; font-size: 13px; color: var(--ink-3); }
.trace summary { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; margin-inline-start: -10px; border-radius: 999px; cursor: pointer; list-style: none; user-select: none; transition: background .15s, color .15s; }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::after { content: "›"; display: inline-block; font-size: 15px; line-height: 1; transform: rotate(-90deg); transition: transform .2s; }
.trace[open] summary::after { transform: rotate(90deg); }
@media (hover: hover) { .trace summary:hover { background: var(--fill); color: var(--ink-2); } }
.trace ol { list-style: none; margin: 4px 0 2px; padding: 2px 12px; display: grid; gap: 3px; border-inline-start: 2px solid var(--sep); animation: rise .25s var(--ease) both; }

/* ───────────── A course's Kernuli knows its course, and only it ─────────────
   What it learned is shown, never boxed: a line of dots for the lectures (how far into the course it got), the kinds
   it read in their colours, marks in the answer pointing at the slide, and a plain "לא נלמד בקורס" when it wasn't. */
.kn-cap { display: none; }
.chat-view.is-empty .kn-cap { display: block; margin: 4px 0 -4px; text-align: center; font-size: 12.5px; color: var(--ink-3); animation: rise .6s var(--ease) both; }
.chat-view.is-empty .kn-cap + .kn-pals { margin-top: 0; }
.kn-know { margin-top: -4px; font-size: 11px; line-height: 1.2; color: color-mix(in srgb, var(--c) 70%, var(--ink-2)); white-space: nowrap; }
.kn-pal.unread .kn-face { background: var(--fill-2); box-shadow: inset 0 0 0 1.5px var(--sep-2); }
.kn-pal.unread .kn-face img { opacity: .6; filter: grayscale(.5); }
.kn-pal.unread .kn-know { color: var(--ink-3); }

.kb-say { max-width: 460px; font-size: 16px !important; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.kb-know { display: grid; justify-items: center; gap: 10px; margin-top: 6px; padding: 6px 10px; border: 0; background: none; font: inherit; color: var(--ink-2); cursor: pointer; border-radius: 18px; }
/* the lectures as a line: a filled dot where it learned that lecture */
.kt-line { position: relative; display: flex; gap: 6px; direction: rtl; }
.kt-line::before { content: ""; position: absolute; inset-inline: 9px; top: 50%; height: 1.5px; background: var(--sep-2); }
.kt-line i { position: relative; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font: 600 10px/1 var(--sans); font-style: normal; font-variant-numeric: tabular-nums; }
.kt-line i.on { background: var(--c, var(--accent)); color: #fff; box-shadow: 0 0 0 3px var(--sheet); }
.kt-line i.later { background: var(--sheet); color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--sep-2), 0 0 0 3px var(--sheet); border: 0; }
.kt-line i.gap { background: var(--sheet); color: transparent; width: 9px; height: 9px; margin: 5px; box-shadow: inset 0 0 0 1.5px var(--sep-2); }
.kt-sum { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; font-size: 13px; }
.kt-sum span { display: inline-flex; align-items: center; gap: 6px; }
.kt-sum span i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.kt-sum b { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--ink); }
.kt-sum b svg.i { width: 14px; height: 14px; transform: rotate(90deg); }
@media (hover: hover) { .kb-know:hover { background: var(--fill-2); } .kb-know:hover .kt-sum b { color: var(--accent); } }
.chat-view.is-empty .kn-shelf-btn { display: none; }

/* answers: where they come from */
.ground { display: inline-flex; align-items: center; gap: 7px; justify-self: start; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ground::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px dashed var(--ink-3); }
.ground.partly::before { border-style: solid; border-color: var(--c, var(--accent)); background: linear-gradient(90deg, transparent 50%, var(--c, var(--accent)) 50%); }
.cite-in { display: inline; padding: 0 4px; margin: 0 1px; border-radius: 6px; background: color-mix(in srgb, var(--k) 13%, transparent); color: inherit; font-weight: 500; text-decoration: none; box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: nowrap; }
a.cite-in { cursor: pointer; }
@media (hover: hover) { a.cite-in:hover { background: color-mix(in srgb, var(--k) 24%, transparent); } }
.from-course .srcs-h { color: color-mix(in srgb, var(--c, var(--ink-3)) 70%, var(--ink-3)); }
.cite { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 10px; border-radius: 999px; background: var(--fill-2); color: var(--ink); text-decoration: none; font-size: 12.5px; }
.cite i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.cite span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { a.cite:hover { background: var(--fill); } }

/* the shelf beside the chat: everything it learned, by kind */
.sh { display: grid; gap: 22px; }
.sh-lead { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.sh-g h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 600 13px var(--sans); color: var(--ink-2); }
.sh-g h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.sh-g h4 span { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.sh-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--sep); }
.sh-row:last-child { border-bottom: 0; }
.sh-ask { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 9px 4px; border: 0; background: none; font: inherit; text-align: start; color: var(--ink); cursor: pointer; border-radius: 10px; }
.sh-ask small { font-size: 12px; color: var(--ink-3); }
.sh-t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .sh-ask:not(:disabled):hover .sh-t { color: var(--accent); } }
.sh-row.later .sh-ask { cursor: default; } .sh-row.later .sh-t { color: var(--ink-3); }
.sh-open { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--ink-3); }
.sh-open svg.i { width: 15px; height: 15px; }
@media (hover: hover) { .sh-open:hover { background: var(--fill-2); color: var(--ink); } }
@media (max-width: 760px) { .chat-view:not(.is-empty) .chat-top > .kn-shelf-btn { display: inline-flex; height: 36px; } }
.cite-in { padding: 0 3px; }

/* exams: the course's own Kernuli offers to practice (examKernuli) */
.kn-face.sm { width: 42px; height: 42px; flex: none; }
.kn-face.xs { width: 28px; height: 28px; flex: none; box-shadow: none; }
.xkn { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--c, var(--accent)) 16%, var(--sep)); }
.xkn p { flex: 1; min-width: 0; margin: 0; display: grid; gap: 1px; }
.xkn b { font-size: 14.5px; font-weight: 600; }
.xkn small { font-size: 12.5px; color: var(--ink-2); }
.xkn .btn { flex: none; }
.xkn.unread .kn-face { background: var(--fill-2); box-shadow: inset 0 0 0 1.5px var(--sep-2); }
.xkn.unread .kn-face img { opacity: .6; filter: grayscale(.5); }
.xkn.unread b { color: var(--ink-2); }
.xrow:has(.xkn-mini) { grid-template-columns: 48px 1fr auto auto; }
.xkn-mini { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 3px; padding-inline-end: 12px; border: 0; border-radius: 999px; background: none; font: 500 13px var(--sans); color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.xkn-mini .kn-face { transition: transform .25s var(--spring); }
@media (hover: hover) { .xkn-mini:hover { background: var(--card); color: var(--ink); box-shadow: var(--shadow); } .xkn-mini:hover .kn-face { transform: scale(1.08); } }
@media (max-width: 760px) {
  .xkn { flex-wrap: wrap; } .xkn p { flex-basis: calc(100% - 54px); } .xkn .btn { margin-inline-start: 54px; }
  .xrow:has(.xkn-mini) { grid-template-columns: 44px 1fr auto; }
  .xkn-mini { grid-column: 3; grid-row: 1 / span 2; padding-inline-end: 3px; } .xkn-mini > span:not(.kn-face) { display: none; }
  .xkn-mini .kn-face.xs { width: 34px; height: 34px; }
}

/* Connected to the university and kept up to date? (linkChip on the chat home, linkPill / noKeyNote in connections) */
.kn-link { display: none; }
.chat-view.is-empty .kn-link { display: flex; justify-content: center; margin: 0 0 2px; animation: rise .6s var(--ease) both; }
.link-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; text-decoration: none; color: var(--ink-2); background: var(--fill); transition: background .15s; }
.link-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.link-chip.ok i { background: var(--c-moss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-moss) 20%, transparent); }
.link-chip.busy i { background: var(--c-ochre); animation: link-pulse 1.2s ease-in-out infinite; }
.link-chip.warn { color: #9a5a12; background: #fff3e2; }
.link-chip.warn i { background: var(--c-clay); }
@media (hover: hover) { .link-chip:hover { background: var(--fill-2); } .link-chip.warn:hover { background: #ffead0; } }
@keyframes link-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .link-chip.busy i { animation: none; } }
.pill.warn { background: #fff3e2; color: #9a5a12; }
.key-panel.warn { background: #fff6ea; box-shadow: inset 0 0 0 1px #f6dfc0; }

/* ═════════════ The Kernulis are the app (2026-11-24) ═════════════
   After Grok Bot (x.ai/bot): a slim rail of faces instead of a menu of pages, Kernuli on top and one Kernuli per
   course under it, like teammates in a chat app. The chat's top is one capsule (whose chat, what it learned); Kernuli's
   home is a feed of short notes from the team, each with a small widget and one next step. Kept warm and light. */

/* ── the rail ── */
.app { grid-template-columns: 84px 1fr; }
.rail { align-items: center; gap: 6px; padding: 14px 0 14px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-head, .rail-cap, .rail .rb-label { display: none; }
.rail-home { display: grid; }
.rail-sep { width: 28px; height: 2px; border-radius: 2px; background: rgba(70, 50, 30, .09); margin: 4px 0; flex: none; }
.rail-sep.thin { width: 18px; height: 1.5px; margin: 2px auto; }
.rail-bots { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; padding: 4px 0; margin: -4px 0; }
.rail-bots::-webkit-scrollbar { display: none; }
.rail-bot { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; padding: 0; border: 0; border-radius: 20px; background: none; cursor: pointer; transition: background .2s, box-shadow .2s; }
.rail-bot::before { content: ""; position: absolute; inset-inline-start: -14px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--ink); transform: translateY(-50%); transition: height .25s var(--spring); }
[dir="rtl"] .rail-bot::before { border-radius: 4px 0 0 4px; }
.rail-bot.on { background: var(--card); box-shadow: var(--shadow); }
.rail-bot.on::before { height: 26px; }
@media (hover: hover) { .rail-bot:not(.on):hover { background: rgba(255, 255, 255, .55); } .rail-bot:not(.on):hover::before { height: 10px; } }
.rb-face { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--c, #c8b8ff) 32%, #fff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 2px 8px -2px color-mix(in srgb, var(--c, #8a7cff) 45%, transparent); transition: transform .3s var(--spring); }
.rb-face img { width: 38px; height: 38px; object-fit: contain; margin-top: 4px; pointer-events: none; }
.rail-bot:active .rb-face { transform: scale(.92); }
@media (hover: hover) { .rail-bot:hover .rb-face { transform: translateY(-1px) scale(1.04); } }
.rail-bot.home .rb-face { background: var(--bloom); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 4px 14px -4px rgba(185, 120, 255, .55); }
.rail-bot.home .rb-face .ghost { width: 36px; height: 36px; margin-top: 3px; }
.rb-em { position: absolute; inset-inline-end: -4px; bottom: -3px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--card); font: 11px/1 var(--emoji); box-shadow: 0 1px 3px rgba(70, 50, 30, .18); }
.rb-badge { position: absolute; inset-inline-start: -5px; top: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font: 600 10.5px/18px var(--sans); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #f1eff2; }
.rail-bot.unread .rb-face { background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--sep-2); }
.rail-bot.unread .rb-face img { opacity: .55; filter: grayscale(.6); }
.rail-add, .rail-pg { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.rail-add { border: 1.5px dashed rgba(70, 50, 30, .18); margin-top: 4px; }
.rail-add svg.i, .rail-pg svg.i { width: 20px; height: 20px; }
@media (hover: hover) { .rail-add:hover, .rail-pg:hover { background: rgba(255, 255, 255, .6); color: var(--ink); } }
.rail-pg.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.rp-n { position: absolute; inset-inline-start: -3px; top: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--card); color: var(--ink-2); font: 600 10px/16px var(--sans); box-shadow: 0 0 0 1px rgba(70, 50, 30, .1); }
.rail-dock { display: grid; gap: 4px; justify-items: center; margin-top: auto; padding-top: 10px; }
.rail-me { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; margin-top: 6px; }
.rail-me .avatar { width: 34px; height: 34px; }
.rail-tip { position: fixed; z-index: 200; transform: translate(-100%, -50%); display: grid; gap: 1px; width: max-content; max-width: 300px; white-space: nowrap; padding: 8px 13px; border-radius: 14px; background: rgba(44, 40, 37, .92); color: #fff; pointer-events: none;
  box-shadow: 0 8px 24px -8px rgba(44, 34, 24, .4); animation: tip-in .16s var(--ease) both; }
.rail-tip b { font-size: 13px; font-weight: 600; }
.rail-tip small { font-size: 11.5px; color: rgba(255, 255, 255, .7); }
@keyframes tip-in { from { opacity: 0; transform: translate(calc(-100% + 4px), -50%); } }

/* ── the chat's top: one capsule in the middle ── */
.chat-view .chat-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-content: stretch; gap: 8px; min-height: 44px; }
.ct-side { display: flex; gap: 6px; }
.ct-side.end { justify-content: flex-end; }
.chat-top .ct-side .btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
.bot-pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 9px; max-width: min(420px, 60vw); height: 44px; padding: 4px; padding-inline-end: 12px; border: 0; border-radius: 999px; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s var(--spring); }
@media (hover: hover) { .bot-pill:hover { box-shadow: var(--lift); background: var(--card); } }
.bot-pill:active { transform: scale(.98); }
.bp-face { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c, #c8b8ff) 32%, #fff); overflow: hidden; }
.bot-pill.home .bp-face { background: var(--bloom); }
.bp-face img { width: 32px; height: 32px; object-fit: contain; margin-top: 3px; }
.bp-t { display: grid; min-width: 0; text-align: start; line-height: 1.2; }
.bp-t b { font-size: 14px; font-weight: 600; }
.bp-t small { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.bp-t small.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3fbf72; box-shadow: 0 0 0 2.5px rgba(63, 191, 114, .18); }
.bot-pill > svg.i { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.chat-view.is-empty .chat-top { display: grid !important; margin-bottom: 8px; }
.chat-view .kn-head { display: none; }

/* ── Kernuli's home: greeting, the question box, then the team's notes ── */
@media (min-width: 761px) {
  .chat-view.is-empty:has(.team:not([hidden])) { justify-content: flex-start; padding-bottom: 48px; }
  .chat-view.is-empty:has(.team:not([hidden])) .chat-welcome { margin-top: 4vh; }
}
.team { display: none; }
.chat-view.is-empty .team:not([hidden]) { display: block; margin-top: 40px; animation: rise .6s .18s var(--ease) both; }
.team-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 4px 14px; }
.team-h h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; }
.team-h span { font-size: 13.5px; color: var(--ink-3); }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tnote { display: grid; gap: 10px; padding: 14px 16px 16px; border-radius: 24px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 8%, var(--card)) 0%, var(--card) 70%); box-shadow: var(--shadow); min-width: 0; }
.tnote.quiet { background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px var(--sep); }
.tnote.quiet .tn-say { color: var(--ink-2); font-size: 13.5px; }
.tn-head { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.tn-head > svg.i { margin-inline-start: auto; width: 16px; height: 16px; color: var(--ink-3); flex: none; transition: transform .2s var(--spring); }
@media (hover: hover) { .tn-head:hover > svg.i { transform: translateX(-3px); color: var(--ink); } .tn-head:hover b { color: var(--ink); } }
.tn-face { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--c) 30%, #fff); }
.tn-face img { width: 33px; height: 33px; object-fit: contain; margin-top: 3px; }
.tnote.quiet .tn-face { background: var(--fill); } .tnote.quiet .tn-face img { opacity: .6; filter: grayscale(.6); }
.tn-who { display: grid; min-width: 0; line-height: 1.25; }
.tn-who b { font-size: 14.5px; font-weight: 600; }
.tn-who small, .tn-tag { font-size: 12px; color: var(--ink-3); }
.tn-say { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.tn-w { display: grid; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--inset); }
.tn-rows { display: grid; gap: 2px; }
.tn-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 34px; }
.tn-row .check { width: 20px; height: 20px; }
.tn-rt { padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: start; cursor: pointer; }
.tn-row.done .tn-rt { color: var(--ink-3); text-decoration: line-through; }
@media (hover: hover) { .tn-rt:hover { text-decoration: underline; text-decoration-color: var(--sep-2); } }
.tn-row .due { font-size: 12.5px; }
.tn-more { font-size: 12.5px; color: var(--ink-3); padding-inline-start: 32px; }
.tn-count { display: flex; align-items: center; gap: 12px; }
.tn-count b { font-family: var(--display); font-size: 38px; line-height: 1; font-weight: 600; color: var(--c); font-variant-numeric: tabular-nums; }
.tn-count span { display: grid; font-size: 14px; font-weight: 600; min-width: 0; }
.tn-count small { font-size: 12.5px; font-weight: 400; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-know { display: grid; justify-items: start; gap: 8px; overflow: hidden; }
.tn-know .kt-line i.on, .tn-know .kt-line i.later, .tn-know .kt-line i.gap { box-shadow: 0 0 0 3px var(--inset); }
.tn-know .kt-line i.later { background: var(--inset); box-shadow: inset 0 0 0 1.5px var(--sep-2), 0 0 0 3px var(--inset); }
.tn-know .kt-sum { justify-content: flex-start; font-size: 12.5px; color: var(--ink-2); }
.tn-act { justify-self: start; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; border: 0; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: color-mix(in srgb, var(--c) 72%, #1d1a18); background: color-mix(in srgb, var(--c) 15%, #fff); transition: background .15s, transform .2s var(--spring); }
@media (hover: hover) { .tn-act:hover { background: color-mix(in srgb, var(--c) 24%, #fff); } }
.tn-act:active { transform: scale(.97); }
/* a course's own chat: its note sits under the questions, as one widget */
.chat-view.is-course.is-empty .team:not([hidden]) { margin-top: 26px; }
.tnote.solo { max-width: 460px; width: 100%; margin: 0 auto; }
.tnote.solo .tn-head { justify-content: flex-start; }

@media (max-width: 1100px) and (min-width: 761px) { .team-grid { grid-template-columns: 1fr; } }

/* ── phone: the rail is the drawer, with names; the tab bar's last tab is the team ── */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { align-items: stretch; gap: 2px; padding-inline: 12px; }
  .rail-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
  .rail-head .btn { background: none; box-shadow: none; }
  .rail-cap { display: block; margin: 8px 10px 4px; font-size: 12.5px; color: var(--ink-3); }
  .rail .rb-label { display: grid; min-width: 0; line-height: 1.25; text-align: start; }
  .rail .rb-label b { font-size: 15.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail .rb-label small { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-sep { margin: 6px 10px; width: auto; }
  .rail-sep.thin { width: auto; margin: 4px 10px; }
  .rail-bots { align-items: stretch; padding: 2px; margin: 0; }
  .rail-bot { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 60px; padding: 0 8px; border-radius: 20px; }
  .rail-bot::before { display: none; }
  .rail-add, .rail-pg { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 46px; padding: 0 14px; border-radius: 16px; border: 0; margin: 0; }
  .rail-add { color: var(--ink-2); }
  .rail-add .rb-label b, .rail-pg .rb-label b { font-size: 15px; font-weight: 500; color: inherit; }
  .rp-n { position: static; margin-inline-start: auto; background: none; box-shadow: none; font-size: 13px; }
  .rail-dock { display: grid; grid-template-columns: 1fr; gap: 0; justify-items: stretch; padding-top: 8px; border-top: 1px solid rgba(70, 50, 30, .07); }
  .rail-me { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 58px; padding: 0 10px; border-radius: 18px; }
  .rail-tip { display: none !important; }
  .tb-team { margin-inline-end: -6px; }
  .topbar-mobile .brand { margin-inline-end: auto; }
  .tb-faces { display: flex; height: 23px; align-items: center; }
  .tb-faces img { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; background: color-mix(in srgb, var(--c) 35%, #fff); box-shadow: 0 0 0 2px #fbf9f6; margin-inline-start: -8px; padding-top: 2px; }
  .tb-faces img:first-child { margin-inline-start: 0; }
  .tabbar .on .tb-faces img { box-shadow: 0 0 0 2px #e8ebfb; }

  .chat-view .chat-top { grid-template-columns: 1fr; justify-items: center; }
  .chat-view .chat-top .ct-side { display: none; }
  .bot-pill { max-width: 86vw; }
  .chat-view.is-empty .chat-top { margin-bottom: 0; }
  .team-grid { grid-template-columns: 1fr; gap: 12px; }
  .chat-view.is-empty .team:not([hidden]) { margin-top: 28px; }
  .chat-view.is-empty:has(.team:not([hidden])) { justify-content: flex-start; }
  .tnote { border-radius: 26px; }
}
@media (min-width: 761px) { .chat-view.is-empty .chat-top .ct-side [data-action="chat-history"] { display: inline-flex; } }

/* ═════════════ One surface per widget (2026-11-24) ═════════════
   No box in a box: inside a card, parts are set apart by space or a hairline, never by another filled or shadowed
   box; an action inside a card is a plain coloured text button; lists inside cards are flat rows. Pages that are a
   grid of their own (the week, the timetable) sit on the sheet without a card around them. */

/* Kernuli's home: the team's notes */
.tn-w { padding: 10px 0 0; border-radius: 0; background: none; border-top: 1px solid color-mix(in srgb, var(--c) 14%, var(--sep)); }
.tn-know .kt-line i.on, .tn-know .kt-line i.gap { box-shadow: 0 0 0 3px var(--card); }
.tn-know .kt-line i.later { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--sep-2), 0 0 0 3px var(--card); }
.tn-know .kt-line i.gap { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--sep-2); }
.tn-act { height: auto; padding: 2px 0; margin-top: -2px; background: none; border-radius: 6px; color: color-mix(in srgb, var(--c) 78%, #1d1a18); }
.tn-act::after { content: "←"; font-weight: 500; transition: transform .2s var(--spring); }
@media (hover: hover) { .tn-act:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } .tn-act:hover::after { transform: translateX(-3px); } }

/* segmented controls: only the chosen one is a pill, no track around it */
.seg, .filters { background: none; padding: 0; gap: 4px; }
.seg button:not(.on):hover, .filters button:not(.on):hover { color: var(--ink); }

/* tables: the header is quiet text over a hairline; chips inside rows are plain text */
.orow.th { background: none; box-shadow: inset 0 -1px 0 var(--sep); }
.otable .teacher, .mlist .teacher { padding: 0; background: none; }
.mlist > .empty { background: none; box-shadow: none; }
@media (max-width: 760px) { .mrow .c-inline { padding: 0; background: none !important; } .mlist > .empty, .view > .empty { background: none; } }

/* the courses' cards and the course page's Moodle tiles: the emoji alone, no tile behind it */
.gcard .gtop .ctile.lg { background: none; box-shadow: none; font-size: 32px; filter: drop-shadow(0 3px 6px rgba(70, 50, 30, .18)); }
.mtile-em, .mtile.live .mtile-em { background: none; width: 28px; }

/* the week: the summary is a line on the page (its tags are the only pills); the grid sits on the sheet */
.gs, .gs.is-props { background: none; box-shadow: none; padding: 0 0 2px; }
.wk { background: none; box-shadow: none; padding-inline: 0; border-radius: 0; }
.wk-flag, .wk-flag.exam, .wk-flag.mark, .wk-flag.mark.term, .wk-flag.mark.exams { background: none; padding-inline: 2px; }
.wk-flag.ready { box-shadow: none; color: var(--amber); }
.week.tall { background: none; box-shadow: none; padding: 0; }
.day.today { background: none; }

/* connections: facts are hairline rows, the institution and key are plain lines, a status is a dot and a word */
.conn .pill { padding: 0; background: none; display: inline-flex; align-items: center; gap: 6px; }
.conn .pill.ok::before, .conn .pill.bad::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn-facts { background: none; border-radius: 0; border-block: 1px solid var(--sep); }
.conn-facts dt, .conn-facts dd { padding-inline: 0; }
.uni-row { padding: 4px 0; background: none; border-radius: 0; }
.key-panel { padding: 10px 0 0; background: none; border-radius: 0; border-top: 1px solid var(--sep); }

/* the chat's cards: an approval's buttons are text, a hand-in's details are lines, a board's counts are words */
.act .act-btns .btn { background: none; box-shadow: none; padding: 0 10px; }
.act .act-btns .btn.primary { color: var(--accent-2); font-weight: 600; }
.act .act-btns .btn.danger { color: var(--red); font-weight: 600; }
.act .act-btns .btn.ghost { color: var(--ink-3); }
.hand { padding: 6px 0 0; background: none; border-radius: 0; border-top: 1px solid var(--sep); }
.bd-g-ic, .bd-g.tone-warn .bd-g-ic { background: none !important; width: 24px; }
.bd-g-n, .bd-g.tone-warn .bd-g-n { background: none !important; padding: 0; min-width: 0; }
.bd-i-s, .bd-i.late .bd-i-s { background: none; padding: 0; }
@media (hover: hover) { .act .act-btns .btn:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } }
/* connections: buttons inside a card (not a form's own submit) are coloured text; a hint is a plain line */
.conn .btn:not(form .btn):not(.icon) { width: auto; height: auto; min-height: 30px; padding: 4px 0; justify-self: start; background: none; box-shadow: none; border: 0; color: var(--accent-2); font-weight: 600; }
.conn .btn.danger:not(form .btn) { color: var(--red); }
@media (hover: hover) { .conn .btn:not(form .btn):not(.icon):hover { background: none; text-decoration: underline; text-underline-offset: 3px; } }
.conn .hit-hint { padding: 0; background: none; border-radius: 0; }

/* ═════════════ The team row, after Grok Bot's bot picker (2026-11-24) ═════════════
   Kernuli's home starts with its team: a big solid face per Kernuli and its name under it, nothing else; the one
   you're talking to sits in a soft grey rounded square. The rail marks the open one the same way. */
.chat-view.is-empty .kn-pals { gap: 2px; margin: 0 -16px 8px; padding: 4px 16px 8px; }
.kn-pal { width: 106px; gap: 10px; padding: 12px 6px 12px; border-radius: 22px; transition: background .2s; }
.kn-pal.on { background: rgba(70, 50, 30, .065); }
@media (hover: hover) { .kn-pal:not(.on):hover { background: rgba(70, 50, 30, .035); } .kn-pal:hover .kn-face { transform: none; } }
.kn-face { width: 76px; height: 76px; background: color-mix(in srgb, var(--c) 78%, #fff); box-shadow: none; }
.kn-face img { width: 80%; height: 80%; filter: none; }
.kn-face.home { background: var(--bloom); display: grid; place-items: center; }
.kn-face.home .ghost { position: absolute; inset: 0; margin: auto; width: 78%; height: 78%; }
.kn-em, .kn-know { display: none; }
.kn-name { font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--ink); }
.kn-pal.unread .kn-face { background: var(--fill); box-shadow: none; }
.chat-view.is-empty .kn-cap { margin: 0 0 6px; }
.rail-bot.on { background: rgba(70, 50, 30, .07); box-shadow: none; }
.rail-bot::before { display: none; }
.rb-face { box-shadow: none; background: color-mix(in srgb, var(--c, #c8b8ff) 78%, #fff); }
.rail-bot.home .rb-face { box-shadow: none; }
@media (max-width: 760px) { .kn-pal { width: 92px; padding: 10px 4px; } .kn-face { width: 68px; height: 68px; } .kn-name { font-size: 13px; } }
@media (min-width: 761px) {
  .chat-view.is-empty .kn-pals { flex-wrap: wrap; justify-content: center; overflow: visible; margin-inline: -40px; }
  .chat-view.is-empty .kn-pals .kn-pal { margin: 0; width: 94px; }
  .chat-view.is-empty .kn-pals .kn-face { width: 68px; height: 68px; }
  .chat-view.is-empty .kn-pals .kn-name { font-size: 13.5px; }
}
.rb-em { display: none; }

/* ═════════════ Warm and calm (2026-11-24) ═════════════
   The warm look's paper, rounded sheet, Fredoka headings, course colours and a small bloom, made calm: hairlines
   instead of shadows, no covers or page emoji, plain white cards. */
:root {
  --sky: linear-gradient(180deg, #f3f1ee 0%, #f4f1ec 100%); --sheet: #fffefc; --card: #ffffff;
  --shadow: 0 0 0 1px rgba(70, 50, 30, .085);
  --lift: 0 0 0 1px rgba(70, 50, 30, .10), 0 6px 18px -12px rgba(70, 50, 30, .20);
  --float: 0 0 0 1px rgba(70, 50, 30, .085), 0 6px 20px -12px rgba(70, 50, 30, .18);
  --glass: rgba(255, 254, 252, .92);
}
@media (min-width: 761px) { .main { box-shadow: 0 0 0 1px rgba(70, 50, 30, .07); } }
/* pages: no covers or big page emoji */
.cover, .page-icon, .gcover .art { display: none; }
.view.has-cover { padding-top: 40px; }
.gcover { height: 28px; }
.gcard .gtop { margin-top: 0; }
.mtile.live { background: var(--card); }
/* the chat: a smaller, softer bloom; a white box with a hairline */
.chat-cover { width: 150px; height: 124px; }
.bloom { width: 100px; height: 100px; }
.bloom::after { opacity: .35; }
.chat-welcome .brand-mark.xl { width: 80px; height: 80px; }
.chat-welcome h1 { font-size: 32px; }
.composer { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chat-top .ct-side .btn { box-shadow: none; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.glance.on { gap: 0; }
.gp { background: none; box-shadow: none; padding-inline: 10px; }
.gp + .gp { border-inline-start: 1px solid var(--sep-2); border-radius: 0; }
/* the team's notes: plain white cards with a hairline, the course colour only on the face and the action */
.tnote { background: var(--card); }
.tn-w { border-top-color: var(--sep); }
.tn-face { background: color-mix(in srgb, var(--c) 70%, #fff); }
.btn.primary { box-shadow: none; }
.seg button.on, .filters button.on { box-shadow: 0 0 0 1px rgba(70, 50, 30, .09); }
.tabbar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 1px rgba(70, 50, 30, .08), 0 8px 24px -12px rgba(70, 50, 30, .2); }
.chat-view.is-empty:has(.team:not([hidden])) .chat-suggest { margin-bottom: 0; }
.chero { margin-top: 0; }
.view.has-cover:has(.chero) { padding-top: 28px; }

/* ═════════════ Phone, easy to use (2026-11-24) ═════════════
   One header on the chat (menu, whose chat, history / new chat), the question box always at the bottom in thumb's
   reach, the team one tap away as a sheet of faces, and 44px targets. */
.ct-menu { display: none !important; }
.team-sheet { width: 440px; padding: 6px 18px 18px; overflow-y: auto; }
.ts-h { display: grid; gap: 1px; padding: 12px 4px 10px; text-align: center; }
.ts-h b { font: 600 19px var(--display); }
.ts-h small { font-size: 13px; color: var(--ink-3); }
.ts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ts-grid .kn-pal { width: auto; }
.ts-list { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
.ts-list:empty { display: none; }
.ts-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 6px; border: 0; border-top: 1px solid var(--sep); background: none; font: inherit; font-size: 15.5px; color: var(--ink); text-align: start; text-decoration: none; cursor: pointer; }
.ts-row svg.i { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.ts-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-row small { flex: none; font-size: 12.5px; color: var(--ink-3); }
@media (hover: hover) { .ts-row:hover { color: var(--accent-2); } }

@media (max-width: 760px) {
  /* one header: the chat's own bar replaces the app's top bar */
  .app:has(.chat-view) .topbar-mobile { display: none; }
  .chat-view .chat-top, .chat-view.is-empty .chat-top { position: sticky; top: 0; z-index: 45; display: grid !important; grid-template-columns: 88px minmax(0, 1fr) 88px; justify-items: center;
    margin: -10px -16px 6px; padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px; min-height: 0;
    background: rgba(250, 248, 245, .88); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); pointer-events: auto; }
  .chat-view.is-empty .chat-top { margin-top: -12px; }
  .chat-view .chat-top .ct-side { display: flex; width: 100%; gap: 0; }
  .chat-view .chat-top .ct-side.end { justify-content: flex-end; }
  .chat-view .chat-top .ct-side .btn { display: inline-flex !important; width: 44px; height: 44px; color: var(--ink); }
  .ct-menu { display: inline-flex !important; }
  .bot-pill { max-width: 100%; height: 44px; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bot-pill .bp-face { width: 34px; height: 34px; }

  /* home: compact welcome; the team row first, its caption dropped */
  .chat-view.is-empty .kn-cap { display: none; }
  .chat-view.is-empty .kn-pals { margin-top: 4px; }
  .chat-cover { width: 120px; height: 96px; margin-bottom: 0; }
  .bloom { width: 78px; height: 78px; }
  .chat-welcome .brand-mark.xl { width: 66px; height: 66px; }
  .kb-cover .brand-mark.kb-ghost { width: 72px; height: 72px; }
  .chat-welcome h1, .kb-chat-h { font-size: 25px !important; }
  .chat-view.is-empty .chat-welcome { margin-bottom: 4px; gap: 6px; }

  /* the question box stays at the bottom, over a paper fade, on the home and a course's first screen too */
  .chat-view.is-empty .composer { order: 10; position: sticky; bottom: calc(var(--tabbar) + var(--safe-b) + 10px); z-index: 40; margin-top: auto; }
  .chat-view.is-empty .composer-note { order: 11; }
  .chat-view.is-empty .chat-suggest { margin-top: 10px; }
  .chat-view.is-empty::after { content: ""; position: fixed; inset-inline: 0; bottom: 0; z-index: 39; pointer-events: none; height: calc(var(--tabbar) + var(--safe-b) + 84px);
    background: linear-gradient(to bottom, rgba(244, 241, 236, 0), rgba(244, 241, 236, .92) 38%, rgb(244, 241, 236)); }
  .chat-view.is-empty { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 12px); }
  .app:has(.composer textarea:focus) .chat-view.is-empty .composer { bottom: calc(var(--safe-b) + 8px); }
  .app:has(.composer textarea:focus) .chat-view.is-empty::after { height: calc(var(--safe-b) + 84px); }
  .chat-view.is-empty .team:not([hidden]) { margin-top: 22px; margin-bottom: 18px; }

  /* the team's notes: whole rows to tap, ticks a finger can hit */
  .tn-head { min-height: 44px; }
  .tn-row { min-height: 44px; grid-template-columns: 28px minmax(0, 1fr) auto; }
  .tn-row .check { width: 24px; height: 24px; }
  .tn-rt { font-size: 15px; min-height: 44px; }
  .tn-act { min-height: 40px; font-size: 14.5px; }
  .tn-say { font-size: 15px; }

  /* the team sheet */
  .team-sheet { padding: 0 14px calc(14px + var(--safe-b)); }
  .ts-grid .kn-face { width: 64px; height: 64px; }
  .ts-grid .kn-name { font-size: 13px; }
}
.ts-grid .kn-pal { margin: 0; }

/* a phone's month: the year's marks as named bars along the bottom of their days (monthHtml's bars) */
.mc-bars { display: none; }
@media (max-width: 760px) {
  .mc { position: relative; padding-bottom: 6px; }
  .mc:has(.mc-bars) { padding-bottom: 20px; }
  .mc:has(.mc-bars .mbar + .mbar) { padding-bottom: 34px; }
  .mc.in-hol { box-shadow: none; }
  .mc-bars { display: grid; gap: 2px; position: absolute; inset-inline: 0; bottom: 3px; }
  .mbar { position: relative; display: block; height: 13px; background: color-mix(in srgb, var(--amber) 22%, var(--card)); }
  .mbar.exams { background: color-mix(in srgb, var(--today) 16%, var(--card)); }
  .mbar.term { background: var(--fill); }
  .mbar.s { margin-inline-start: 3px; border-start-start-radius: 7px; border-end-start-radius: 7px; }
  .mbar.e { margin-inline-end: 3px; border-start-end-radius: 7px; border-end-end-radius: 7px; }
  .mbar-t { position: absolute; z-index: 2; inset-inline-start: 5px; top: 0; width: calc(var(--n) * 100% - 10px); font: 600 10px/13px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start;
    color: color-mix(in srgb, var(--amber) 60%, var(--ink)); pointer-events: none; }
  .mbar.exams .mbar-t { color: color-mix(in srgb, var(--today) 70%, var(--ink)); }
  .mbar.term .mbar-t { color: var(--ink-2); }
}

/* ═════════════ The course page, made easy (2026-11-24) ═════════════
   Its Kernuli on top (face → chat, a box to ask it, what it learned), the course in one line, three quick facts;
   Moodle's buttons; the details folded under "פרטי הקורס"; then the tasks. */
.course-page.easy { padding-top: 28px; }
.course-page.easy .crumbs { margin-bottom: 14px; }
.ch { display: flex; align-items: center; gap: 18px; }
.ch-face { flex: none; display: grid; place-items: center; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--c) 78%, #fff); transition: transform .25s var(--spring); }
.ch-face img { width: 82%; height: 82%; object-fit: contain; margin-top: 6px; pointer-events: none; }
@media (hover: hover) { .ch-face:hover { transform: scale(1.04); } }
.ch-face:active { transform: scale(.95); }
.ch-id { flex: 1; min-width: 0; }
.ch .page-title-row h1 { margin: 0; font-size: 36px; line-height: 1.15; }
.ch-line { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); }
.ch-ask { display: flex; align-items: center; gap: 8px; max-width: 680px; margin-top: 20px; padding: 6px; padding-inline-start: 20px; border-radius: 28px; background: var(--card); box-shadow: var(--float); }
.ch-ask:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent), var(--float); }
.ch-ask input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: none; font: inherit; font-size: 15.5px; color: var(--ink); }
.ch-ask .btn.icon { flex: none; width: 42px; height: 42px; border-radius: 50%; }
.ch-know { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 6px 0; font-size: 13px; color: var(--ink-3); }
.ch-know .live { width: 7px; height: 7px; border-radius: 50%; background: #3fbf72; box-shadow: 0 0 0 3px rgba(63, 191, 114, .16); margin-inline-end: 2px; }
.ch-know .cb-more { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ch-know .cb-more svg.i { width: 14px; height: 14px; transition: transform .2s; }
.ch-know .cb-more.on svg.i { transform: rotate(180deg); }
@media (hover: hover) { .ch-know .cb-more:hover { color: var(--ink); } }
.ch-glance { display: flex; flex-wrap: wrap; align-items: center; margin: 18px 0 6px; }
.chg { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; height: 32px; padding: 0 14px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: none; }
.chg:first-child { padding-inline-start: 0; }
.chg + .chg { border-inline-start: 1px solid var(--sep-2); }
.chg.bad { color: var(--red); }
.chg .ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .chg:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sep-2); } }
.course-page.easy .course-mat { margin-top: 18px; }
.course-page.easy .course-mat .block-title { display: none; }
.ch-more { margin: 18px 0 4px; border-block: 1px solid var(--sep); }
.ch-more > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; list-style: none; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.ch-more > summary::-webkit-details-marker { display: none; }
.ch-more > summary svg.i { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s; }
.ch-more[open] > summary svg.i { transform: none; }
@media (hover: hover) { .ch-more > summary:hover { color: var(--ink); } }
.ch-more .cprops { margin: 2px 0 14px; }
.ch-more .cdesc { margin: 0 0 14px; }
.ch-more .course-links { margin: 0 0 16px; }
@media (max-width: 760px) {
  .course-page.easy { padding-top: 12px; }
  .ch { gap: 14px; }
  .ch-face { width: 60px; height: 60px; }
  .ch .page-title-row h1 { font-size: 25px; }
  .ch-line { font-size: 13.5px; }
  .ch-ask { margin-top: 16px; }
  .ch-ask input { font-size: 16px; }
  .ch-glance { margin: 12px -2px 2px; row-gap: 2px; }
  .chg { height: 40px; padding: 0 10px; font-size: 14px; }
  .chg .ellipsis { max-width: 150px; }
}
.ch-ask input:placeholder-shown { direction: rtl; }
@media (max-width: 760px) { .ch-glance { gap: 0 16px; } .chg, .chg:first-child { padding: 0; } .chg + .chg { border: 0; } }

/* ═════════════ A plain title, and switching in place (2026-11-24) ═════════════
   The chat's top is an iOS-style bar: just whose chat it is, centred, in plain type; its few actions at the end.
   A face in the team row switches the Kernuli in place: no entrance animation, the row keeps still. */
.chat-view .chat-top { grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr); top: 0; margin-inline: -24px; padding: 10px 24px; min-height: 56px;
  background: color-mix(in srgb, var(--sheet) 86%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); pointer-events: auto; }
.nav-title { margin: 0; min-width: 0; max-width: 100%; font: 600 16px/1.3 var(--sans); letter-spacing: 0; color: var(--ink); text-align: center; }
.nav-title .ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-view .chat-top .ct-side .btn { color: var(--ink-2); }
.chat-view.calm :is(.kn-pals, .kn-cap, .chat-welcome, .chat-welcome .brand-mark.xl, .composer, .chat-suggest, .team, .glance) { animation: none !important; }
.chat-view.is-course.is-empty .kn-pals { margin-bottom: 4px; }
@media (max-width: 760px) {
  .chat-view .chat-top, .chat-view.is-empty .chat-top { margin-inline: -16px; padding-inline: 8px; background: rgba(250, 248, 245, .88); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); }
  .nav-title { font-size: 17px; }
}
@media (max-width: 760px) { .chat-view .chat-top, .chat-view.is-empty .chat-top { grid-template-columns: minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto); } .chat-view .chat-top .ct-side .btn { width: 40px; } }

/* ── the rail by semester: the semester running now is the team; every other one folds into a tile of tiny faces
   (after Discord's folders), the ended ones into one "קודמים". Tap a folder: its faces open under it. ── */
.rail-sem { display: grid; justify-items: center; gap: 1px; margin: 2px 0 0; padding: 0 4px; text-align: center; line-height: 1.15; cursor: default; }
.rail-sem span { font: 600 11.5px/1.15 var(--sans); color: var(--ink-2); white-space: nowrap; }
.rail-sem small { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); }
.rail-sem small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #5bb98b; box-shadow: 0 0 0 3px rgba(91, 185, 139, .18); }
.team-sem { display: inline-flex; align-items: center; height: 24px; margin-inline-start: 6px; padding: 0 10px; border-radius: 999px; background: rgba(91, 185, 139, .14); color: #3e8b65; font: 600 12.5px/1 var(--sans); vertical-align: middle; }
.rail-fold { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; border-radius: 22px; transition: background .2s; }
.rail-fold.open { background: rgba(70, 50, 30, .045); padding-bottom: 6px; }
.rail-fold-tile { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; padding: 0; border: 0; border-radius: 20px; background: none; color: var(--ink-3); cursor: pointer; }
.rail-fold-tile > svg.i { display: none; }
.rf-faces { display: grid; grid-template-columns: repeat(2, 19px); grid-auto-rows: 19px; gap: 2px; place-content: center; width: 44px; height: 44px; border-radius: 16px; background: rgba(70, 50, 30, .06); transition: transform .3s var(--spring), background .2s; }
.rf-faces img { width: 19px; height: 19px; border-radius: 50%; object-fit: contain; padding-top: 2px; background: color-mix(in srgb, var(--c, #c8b8ff) 32%, #fff); pointer-events: none; }
.rf-faces svg.i { display: none; }
.rail-fold.open .rf-faces { display: grid; place-items: center; grid-template-columns: 1fr; background: none; }
.rail-fold.open .rf-faces img { display: none; }
.rail-fold.open .rf-faces svg.i { display: block; }
.rail-fold.open .rf-faces svg.i { width: 18px; height: 18px; transform: rotate(180deg); }
.rf-dot { position: absolute; inset-inline-start: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #f1eff2; }
@media (hover: hover) { .rail-fold-tile:hover .rf-faces { background: rgba(70, 50, 30, .1); transform: translateY(-1px) scale(1.04); } }
.rail-fold-tile:active .rf-faces { transform: scale(.92); }
@media (max-width: 760px) {
  .rail-sem { display: flex; align-items: center; gap: 8px; justify-items: start; margin: 8px 10px 2px; padding: 0; }
  .rail-sem span { font-size: 12.5px; color: var(--ink-3); }
  .rail-sem small { font-size: 12px; }
  .rail-fold { align-items: stretch; gap: 2px; border-radius: 0; }
  .rail-fold.open { background: none; padding: 0; }
  .rail-fold-tile { display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 52px; padding: 0 8px; border-radius: 18px; }
  .rail-fold-tile .rb-label b { font-size: 14.5px; }
  .rail-fold-tile > svg.i { display: block; width: 16px; height: 16px; margin-inline-start: auto; color: var(--ink-3); transition: transform .2s; }
  .rail-fold.open .rail-fold-tile > svg.i { transform: rotate(180deg); }
  .rf-faces, .rail-fold.open .rf-faces { display: flex; flex: none; width: auto; min-width: 44px; height: 44px; padding: 0; background: none; border-radius: 0; place-content: center flex-start; }
  .rf-faces img { width: 24px; height: 24px; margin-inline-start: -9px; box-shadow: 0 0 0 2px #fbf9f6; }
  .rf-faces img:first-child { margin-inline-start: 0; }
  .rail-fold.open .rf-faces img { display: block; }
  .rf-faces svg.i, .rail-fold.open .rf-faces svg.i { display: none; }
  .rf-dot { position: static; order: 3; }
}

/* ── Kernulis answering side by side: a face that's answering in a chat the student left shows three dots; one that
   answered shows a green dot; and a note at the top says who answered (after ChatGPT). ── */
.rb-live { position: absolute; inset-inline-end: -5px; top: -4px; display: flex; align-items: center; justify-content: center; gap: 2px; height: 16px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--card); box-shadow: 0 0 0 2px #f1eff2, 0 1px 3px rgba(70, 50, 30, .2); }
.rb-live.busy i { width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--ink-2); animation: kn-dot 1.1s ease-in-out infinite; }
.rb-live.busy i:nth-child(2) { animation-delay: .15s; } .rb-live.busy i:nth-child(3) { animation-delay: .3s; }
.rb-live.fresh { min-width: 12px; width: 12px; height: 12px; padding: 0; border-radius: 50%; background: #34c37a; inset-inline-end: -2px; top: -1px; }
@keyframes kn-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.kn-notes { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.kn-note { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 22px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 10px 30px -10px rgba(60, 40, 20, .28), 0 0 0 1px rgba(70, 50, 30, .06); text-align: start; cursor: pointer; animation: kn-note-in .35s var(--spring) both; }
.kn-note.out { animation: kn-note-out .2s ease both; }
.kn-note-face { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--c, #c8b8ff) 32%, #fff); }
.kn-note-face img { width: 34px; height: 34px; object-fit: contain; margin-top: 3px; }
.kn-note-face .ghost { width: 32px; height: 32px; }
.kn-note-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.kn-note-t b { font: 600 14px/1.25 var(--sans); color: var(--ink); }
.kn-note-t small { font-size: 12.5px; line-height: 1.35; color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kn-note-go { flex: none; font: 600 13px/1 var(--sans); color: var(--ink-2); }
@keyframes kn-note-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes kn-note-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
@media (max-width: 760px) { .kn-notes { top: calc(10px + env(safe-area-inset-top, 0px)); } }

/* ── Kernuli hands a course's question to that course's Kernuli: one pill (Kernuli → dots → the course's face), then the
   chat slides over to the new chat ── */
.handoff { justify-self: start; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--ink); font: inherit; text-align: start; animation: ho-in .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.handoff .ho-from { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; transition: transform .5s cubic-bezier(.3, .7, .4, 1); }
.handoff .ho-from .ghost { width: 26px; height: 26px; }
.ho-path { flex: none; display: flex; gap: 4px; }
.ho-path i { width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--c) 45%, #fff); }
.ho-to { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--c) 45%, #fff), var(--c) 78%); }
.ho-to img { position: absolute; inset: 0; margin: auto; width: 78%; height: 78%; object-fit: contain; }
.ho-badge { position: absolute; inset-inline-start: -5px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; line-height: 1; }
.ho-t { display: grid; gap: 1px; min-width: 0; }
.ho-t b { font-weight: 600; font-size: 14px; }
.ho-t small { font-size: 12px; color: var(--ink-3); }
@media (hover: hover) { .handoff:hover .ho-to { transform: scale(1.06); } }
.ho-to { transition: transform .2s; }
/* live: Kernuli leans toward it, the dots walk over, the course's Kernuli pops up to take it */
.handoff.go .ho-from { transform: translateX(-5px) rotate(-8deg); }
.handoff.go .ho-path i { animation: ho-walk .9s ease-in-out both; }
.handoff.go .ho-path i:nth-child(2) { animation-delay: .15s; }
.handoff.go .ho-path i:nth-child(3) { animation-delay: .3s; }
.handoff.go .ho-to { animation: ho-pop .55s .75s cubic-bezier(.3, 1.6, .5, 1) both; }
.chat-view.handing #chat-log, .chat-view.handing .composer-wrap, .chat-view.handing #composer { transition: opacity .26s, transform .26s; opacity: 0; transform: translateX(-28px); }
.chat-view.arrived #chat-log, .chat-view.arrived .chat-top { animation: ho-arrive .42s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes ho-in { from { opacity: 0; transform: translateY(6px) scale(.94); } }
@keyframes ho-walk { 0%, 100% { background: color-mix(in srgb, var(--c) 45%, #fff); transform: none; } 45% { background: var(--c); transform: scale(1.6); } }
@keyframes ho-pop { 0% { transform: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 50% { transform: scale(1.2); }
  100% { transform: none; box-shadow: 0 0 0 12px transparent; } }
@keyframes ho-arrive { from { opacity: 0; transform: translateX(28px); } }
@media (prefers-reduced-motion: reduce) { .handoff, .handoff.go *, .chat-view.arrived * { animation: none !important; transition: none !important; } }

/* ═════════════ The chat, like a chat app (2026-11-25) ═════════════
   Every answer starts with who answers: a round face (Kernuli on its bloom, a course's Kernuli on the course's colour)
   and its name, then the answer across the whole width, on a phone and a computer alike. A sent question goes to the
   top of the screen and the answer grows under it (chatRoom); a round button jumps to the end. */
.msg.ai:not(.thinking), .msg.ai.thinking { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 100%; margin-inline-start: 0; align-items: start; }
.msg.ai > * { grid-column: 1; }
.ai-who { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14.5px; color: var(--ink); }
.ai-who b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-av { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #c8b8ff) 78%, #fff); }
.ai-av.home { background: var(--bloom); }
.ai-av .ghost { width: 82%; height: 82%; object-fit: contain; }
.thinking .ai-av .ghost { animation: ghost-bob 1.1s ease-in-out infinite; }
.msg.ai.thinking .think-line { padding-top: 0; min-height: 0; }
.chat-room { flex: none; height: 0; pointer-events: none; }
.chat-end { position: fixed; z-index: 41; width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px rgba(70, 50, 30, .1), 0 6px 16px -6px rgba(70, 50, 30, .3); animation: rise .25s var(--ease) both; -webkit-tap-highlight-color: transparent; }
.chat-end[hidden] { display: none; }
.chat-end svg.i { width: 19px; height: 19px; }
@media (hover: hover) { .chat-end:hover { background: var(--fill-2); } }
@media (max-width: 760px) { .ai-who { font-size: 15px; } .chat-end { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .thinking .ai-av .ghost { animation: none; } }

/* ═════════════ A course's two sides, one switch (2026-11-25) ═════════════
   Every course has two sides, its Kernuli's chat and its page. The top bar of both says the course's name in the middle
   and, under it, the switch between the sides (after iOS's segmented control in a navigation bar): the same place on
   both sides, on a computer and on a phone. The page's bar goes back to all the courses (after Notion's breadcrumb)
   and takes the course's name once its big title scrolls under it (after iOS's large titles). */
.ct-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.sides { display: inline-flex; gap: 2px; }
.sides > * { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s; }
.sides svg.i { width: 16px; height: 16px; flex: none; }
.sides > .on { background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--ink); font-weight: 600; cursor: default; }
@media (hover: hover) { .sides > :not(.on):hover { background: var(--fill-2); color: var(--ink); } }
.sides > :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-view .chat-top:has(.sides) { padding-block: 8px; }

/* the course page's bar */
.course-page.easy { --pi: 96px; padding-top: 0; }
@media (max-width: 1100px) { .course-page.easy { --pi: 56px; } }
.cbar { position: sticky; top: 0; z-index: 25; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 8px;
  margin: 0 calc(-1 * var(--pi)) 18px; padding: 8px var(--pi); min-height: 56px;
  background: color-mix(in srgb, var(--sheet) 86%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); }
.cbar .ct-side { display: flex; }
.cbar-back { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px 0 14px; padding-inline: 6px 12px; margin-inline-start: -6px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.cbar-back svg.i { width: 20px; height: 20px; }
@media (hover: hover) { .cbar-back:hover { background: var(--fill-2); } }
/* the name stays out of the bar while the big title is on screen; it slides in as the title goes under */
.cbar .nav-title { max-height: 0; opacity: 0; transform: translateY(4px); transition: max-height .25s var(--ease), opacity .2s, transform .25s var(--ease); }
.cbar.titled .nav-title { max-height: 24px; opacity: 1; transform: none; }
.cbar.titled { box-shadow: 0 1px 0 var(--sep); }

@media (max-width: 760px) {
  .course-page.easy { --pi: 16px; padding-top: 0; }
  /* one header on a phone: the page's own bar replaces the app's top bar, like the chat's */
  .app:has(.course-page) .topbar-mobile { display: none; }
  .cbar { grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr); margin-bottom: 12px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; padding-inline: 8px;
    background: rgba(250, 248, 245, .88); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); }
  .cbar-back { height: 44px; margin: 0; padding-inline: 2px 8px; font-size: 16px; }
  .cbar.titled .nav-title { max-height: 26px; }
  .sides > * { height: 34px; padding: 0 14px; font-size: 14px; }
}
@media (max-width: 380px) { .cbar-back span { display: none; } }

/* ═════════════ The phone's top, after Grok Bot (2026-11-25) ═════════════
   No bar: round glass buttons float at the sides and, in the middle, the Kernuli's profile as a pill (its face, its
   name). A course's pill opens its page; there its face flies into the page's big face (a view transition), and the
   page's round chat button flies it back. The face floats a little while it waits. The computer keeps its switch. */
.kpill, .cbar-circle { display: none; }
@keyframes kbob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-5deg); } }
@media (max-width: 760px) {
  .chat-view .chat-top .nav-title, .chat-view .chat-top .sides, .cbar .nav-title, .cbar .sides, .cbar-back { display: none !important; }
  .glassy, .kpill, .cbar-circle, .chat-view .chat-top .ct-side.end:not(:empty), .chat-view .chat-top .ct-side:first-child .btn {
    background: rgba(255, 254, 252, .82); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: 0 0 0 1px rgba(70, 50, 30, .07), 0 6px 18px -8px rgba(70, 50, 30, .22); }
  /* the top floats over the page: a soft fade behind it instead of a bar */
  .chat-view .chat-top, .chat-view.is-empty .chat-top, .cbar { align-items: center; min-height: 0; box-shadow: none !important;
    background: linear-gradient(to bottom, rgba(250, 248, 245, .96) 0%, rgba(250, 248, 245, .8) 62%, rgba(250, 248, 245, 0) 100%); backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 14px; }
  .chat-view .chat-top, .chat-view.is-empty .chat-top { grid-template-columns: minmax(48px, 1fr) minmax(0, auto) minmax(48px, 1fr) !important; }
  /* a round button at the start; the chat's actions grouped in one capsule at the end (like iOS's toolbar groups) */
  .chat-view .chat-top .ct-side:first-child .btn, .cbar-circle { display: inline-grid !important; place-items: center; width: 46px !important; height: 46px !important; padding: 0; border: 0; border-radius: 50%; color: var(--ink) !important; cursor: pointer; }
  .cbar-circle svg.i, .chat-view .chat-top .ct-side .btn svg.i { width: 21px; height: 21px; }
  .chat-view .chat-top .ct-side.end { width: auto !important; justify-self: end; border-radius: 999px; gap: 0 !important; }
  .chat-view .chat-top .ct-side.end .btn { width: 44px !important; height: 46px !important; background: none !important; box-shadow: none !important; }
  .chat-view .chat-top .ct-side.end:empty { display: none !important; }
  .cbar .ct-side.end { justify-content: flex-end; }
  .cbar-circle:active, .kpill:active, .chat-view .chat-top .ct-side .btn:active { transform: scale(.94); }
  .cbar-circle, .kpill { transition: transform .2s var(--spring); }

  /* the profile pill */
  .kpill { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-width: 0; height: 46px; padding: 5px; padding-inline-end: 12px; border: 0; border-radius: 999px;
    font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
  .kpill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
  .kpill > svg.i { flex: none; width: 15px; height: 15px; color: var(--ink-3); margin-inline-start: -3px; }
  .kp-face { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 78%, #fff); }
  .kpill.home .kp-face { background: var(--bloom); }
  .kp-face img { width: 32px; height: 32px; object-fit: contain; margin-top: 4px; animation: kbob 3.6s ease-in-out infinite; transform-origin: 50% 80%; }
  .chat-view .chat-top .kp-face { view-transition-name: kface; }
  .course-page .ch-face { view-transition-name: kface; }

  /* the page's pill comes in as its big face goes under the top */
  .cbar { grid-template-columns: minmax(48px, 1fr) minmax(0, auto) minmax(48px, 1fr); }
  .cbar .kpill { opacity: 0; transform: translateY(-6px) scale(.92); pointer-events: none; transition: opacity .2s, transform .3s var(--spring); }
  .cbar.titled .kpill { opacity: 1; transform: none; pointer-events: auto; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .kp-face img { animation: none; } }
::view-transition-group(kface) { animation-duration: .5s; animation-timing-function: cubic-bezier(.32, .72, 0, 1); }
::view-transition-image-pair(kface) { isolation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* ───── lesson summaries (סיכומי שיעורים): the rows under "סיכום שיעור מהקלטה", and a summary opened ───── */
#lessons .mtiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mtile:disabled { opacity: .55; cursor: default; }
button.mrow.lrow { width: 100%; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; }
.lrow > .i { opacity: .6; }
.lbar { flex: none; width: 72px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; position: relative; }
.lbar::after { content: ''; position: absolute; inset: 0; inset-inline-end: auto; width: calc(var(--p, 0) * 100%); background: var(--accent); border-radius: inherit; transition: width .2s; }
.mpill.lwait { animation: lwait 1.6s ease-in-out infinite; }
@keyframes lwait { 50% { opacity: .45; } }
@media (max-width: 560px) { .mpill.lwait { display: none; } }
.lerr { color: var(--red) !important; white-space: normal; }
.lmodal { width: min(640px, 100%); }
.lsum { padding: 14px 28px 4px; overflow-y: auto; font-size: 14.5px; line-height: 1.6; }
.lsum h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.lsum ul { margin: 4px 0 0; padding-inline-start: 18px; }
.lsum li + li { margin-top: 2px; }
.ltopic { padding: 12px 0; }
.ltopic + .ltopic { border-top: 1px solid var(--sep); }
.ltopic-h { display: flex; align-items: baseline; gap: 10px; }
.ltopic-h b { font-weight: 600; font-size: 15px; }
.lat { flex: none; font-size: 12px; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; direction: ltr; }
.ltopic small { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.lsum dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.lsum dt { font-weight: 600; }
.lsum dd { margin: 0; color: var(--ink-2); }
.lnote { margin: 18px 0 6px; font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) { .lsum { padding: 12px 20px 4px; } .lsum dl { grid-template-columns: 1fr; } .lsum dd { margin-bottom: 6px; } }

/* ═════════════ The chat as a conversation, after Grok Bot (2026-11-25) ═════════════
   Two sides, like talking to somebody: the student's lines are dark bubbles on their side, the Kernuli's answers are
   soft bubbles on the other side with its face beside them and its name above (a course's Kernuli gets a hint of the
   course's colour). Only the words sit in the bubble; what it made or did (cards, files, sources) follows under it,
   each its own surface, and "חשב 10 שנ׳" goes under the bubble like a message's time. */
.chat-view { --bub: var(--fill); }
.chat-view.is-course { --bub: color-mix(in srgb, var(--c) 12%, var(--fill-2)); }
.chat-log { gap: 18px; }
.msg.ai:not(.thinking), .msg.ai.thinking { display: grid; grid-template-columns: minmax(0, 1fr) 30px; column-gap: 8px; row-gap: 6px;
  max-width: min(88%, 700px); margin-inline-start: auto; justify-items: end; align-items: start; }
.msg.ai > * { grid-column: 1; }
.msg.ai .ai-who { display: contents; }
.msg.ai .ai-av { grid-column: 2; grid-row: 1 / span 2; width: 30px; height: 30px; }
.msg.ai .ai-who b { grid-column: 1; grid-row: 1; padding-inline: 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.msg.ai .ai-text, .msg.ai .think { justify-self: end; width: fit-content; max-width: 100%; padding: 10px 16px; border-radius: 22px; background: var(--bub); }
.msg.ai .ai-text:empty { display: none; }
.msg.ai .ai-text, .msg.ai .think-draft { line-height: 1.6; }
.msg.ai .think { flex: none; gap: 4px; }
.msg.ai .think-line { min-height: 0; padding: 0; }
/* inside a bubble: code, tables and inline code sit on white so they still read as their own thing */
.msg.ai .ai-text code { background: rgba(255, 255, 255, .7); }
.msg.ai .ai-text .code, .msg.ai .ai-text .tbl { background: var(--card); }
.msg.ai .ai-text th { background: var(--fill-2); }
/* under the bubble: what it did ("חשב 10 שנ׳") first, then what it made */
.msg.ai .trace { order: 1; padding-inline: 14px; font-size: 12.5px; }
.msg.ai .trace summary { margin-inline-start: -10px; }
.msg.ai > .handoff, .msg.ai > .board, .msg.ai > .vtiles, .msg.ai > .ai-files, .msg.ai > .srcs, .msg.ai > .acts { order: 2; }
.msg.ai > .acts, .msg.ai > .board { justify-self: stretch; }
.msg.ai .ground { padding-inline: 14px; }
/* the student's side: a dark bubble, like a sent message */
.msg.user .bubble, .msg.user .msg-body .bubble { background: var(--press-ink); color: #fff; box-shadow: none; border-radius: 22px; padding: 10px 16px; line-height: 1.5; }
.msg.user .msg-files { justify-content: flex-start; }
@media (max-width: 760px) {
  .chat-log { gap: 16px; }
  .msg.ai:not(.thinking), .msg.ai.thinking { max-width: 94%; grid-template-columns: minmax(0, 1fr) 26px; column-gap: 7px; }
  .msg.ai .ai-av { width: 26px; height: 26px; }
  .msg.ai .ai-text { font-size: 16px; }
  .msg.user .bubble, .msg.user .msg-body .bubble { border-radius: 22px; font-size: 16px; }
  .msg.user .msg-body, .msg.user .bubble { max-width: 82%; }
}

/* ── A phone's empty chat while the student writes (.composing, set in showChat) ──
   Only the Kernuli, a few questions and the box stay; the box sits on the keyboard, the rest steps aside. */
@media (max-width: 760px) {
  .chat-view.is-empty.composing { padding-top: 0; padding-bottom: 10px; justify-content: flex-start; }
  .chat-view.composing .team, .chat-view.composing .kn-pals, .chat-view.composing .kn-cap, .chat-view.composing .kn-link,
  .chat-view.composing .glance, .chat-view.composing .kb-know, .chat-view.composing .kb-say, .chat-view.composing .composer-note { display: none !important; }
  .chat-view.composing .chat-welcome { margin-top: auto; margin-bottom: 14px; animation: rise .35s var(--ease) both; }
  .chat-view.composing .chat-suggest { order: 1; margin: 0 -16px 10px !important; animation: rise .35s .05s var(--ease) both; }
  .chat-view.composing .composer { order: 2; margin-top: 0 !important; animation: none; }
}
