/* Mr.Bot Meet, the web app.
   One design system in three layers of tokens (primitive → semantic → component), then the base, the layout and the
   components; the pages' own parts follow further down. Colours are never written in a component: they come from the
   semantic tokens, so the dark theme only redefines those. Every pair of text and background reaches 4.5:1, status is
   always a word (or an icon) as well as a colour, and controls are 40 px high (44 px on touch screens). */

/* ==== 1. Fonts: Inter for Latin text, Vazirmatn for Persian (both SIL OFL, fetched at build: tools/fetch_fonts.py) ==== */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght.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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Vazirmatn"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/vazirmatn-arabic-wght.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ==== 2. Tokens ======================================================================================================== */
:root {
  /* -- primitives: the raw palette and scales; nothing below uses them except the semantic layer -- */
  --indigo-50: #eef0fe; --indigo-100: #e0e3ff; --indigo-400: #8b93ff; --indigo-300: #a5abff; --indigo-600: #4f46e5; --indigo-700: #4338ca;
  --violet-700: #6d28d9;
  --slate-0: #ffffff; --slate-50: #f5f6fb; --slate-100: #eef0f7; --slate-150: #e7e9f3; --slate-200: #dfe2ee; --slate-300: #c9cede;
  --slate-500: #636a89; --slate-600: #545b7a; --slate-900: #12152a;
  --night-950: #0b0e1a; --night-925: #10142a; --night-900: #141829; --night-850: #1c2136; --night-800: #232946; --night-750: #272d47;
  --night-700: #353c5c; --night-300: #9ba2bd; --night-350: #8a91ad; --night-100: #e9ebf6;
  --green-600: #047857; --green-400: #34d399; --amber-700: #b45309; --amber-400: #fbbf24; --rose-600: #e11d48; --rose-400: #fb7185;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 260ms; --ease: cubic-bezier(.2, .7, .2, 1);

  /* -- semantic: what each colour is for -- */
  --bg: var(--slate-50);
  --surface: var(--slate-0);
  --surface-2: var(--slate-100);
  --surface-3: var(--slate-150);
  --field-bg: var(--slate-0);
  --text: var(--slate-900);
  --muted: var(--slate-600);
  --subtle: var(--slate-500);
  --line: var(--slate-200);
  --line-strong: var(--slate-300);
  --accent: var(--indigo-600);
  --accent-hover: var(--indigo-700);
  --accent-soft: var(--indigo-50);
  --accent-text: #ffffff;
  --focus: var(--indigo-600);
  --ok: var(--green-600);
  --warn: var(--amber-700);
  --danger: var(--rose-600);
  --danger-solid: var(--rose-600);
  --mode: var(--indigo-600);
  /* the main action: indigo to violet, both dark enough for white text (6.3:1 and 7.1:1) */
  --grad: linear-gradient(135deg, var(--indigo-600) 0%, var(--violet-700) 100%);
  --shadow-xs: 0 1px 2px rgba(18, 21, 42, .05);
  --shadow-sm: 0 1px 2px rgba(18, 21, 42, .04), 0 4px 14px -6px rgba(18, 21, 42, .10);
  --shadow-md: 0 2px 4px rgba(18, 21, 42, .04), 0 12px 28px -12px rgba(18, 21, 42, .18);
  --shadow-lg: 0 4px 8px rgba(18, 21, 42, .06), 0 24px 48px -16px rgba(18, 21, 42, .28);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23545b7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --spk-0: #4f46e5; --spk-1: #0e7490; --spk-2: #c2410c; --spk-3: #15803d; --spk-4: #be185d; --spk-5: #7c3aed;
  --font: "Inter", "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;

  /* -- component: sizes the components share -- */
  --header-h: 64px;
  --control-h: 42px;
  --btn-h: 40px;
  --btn-h-lg: 50px;
  --card-r: var(--r-lg);
  --card-pad: 22px;
  --radius: var(--card-r);      /* older name, still used by the pages' parts */
  --shadow: var(--shadow-sm);   /* older name */
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: var(--night-950);
    --surface: var(--night-900);
    --surface-2: var(--night-850);
    --surface-3: var(--night-800);
    --field-bg: var(--night-925);
    --text: var(--night-100);
    --muted: var(--night-300);
    --subtle: var(--night-350);
    --line: var(--night-750);
    --line-strong: var(--night-700);
    --accent: var(--indigo-400);
    --accent-hover: var(--indigo-300);
    --accent-soft: #222848;
    --accent-text: var(--night-950);
    --focus: var(--indigo-400);
    --ok: var(--green-400);
    --warn: var(--amber-400);
    --danger: var(--rose-400);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px -8px rgba(0, 0, 0, .5);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .7);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239ba2bd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --spk-0: #a5abff; --spk-1: #22d3ee; --spk-2: #fb923c; --spk-3: #4ade80; --spk-4: #f472b6; --spk-5: #c4b5fd;
  }
}
@media (pointer: coarse) { :root { --control-h: 44px; --btn-h: 44px; } }

/* one colour per mode (each reaches 4.5:1 as text on the page; the dark theme gets lighter ones) */
[data-mode="service-desk"] { --mode: #0f766e; }
[data-mode="university"] { --mode: #c2410c; }
[data-mode="business"] { --mode: #1d4ed8; }
[data-mode="medical"] { --mode: #0e7490; }
[data-mode="sales"] { --mode: #15803d; }
[data-mode="interview"] { --mode: #6d28d9; }
[data-mode="field"] { --mode: #b45309; }
[data-mode="legal"] { --mode: #475569; }
[data-mode="language"] { --mode: #be185d; }
@media (prefers-color-scheme: dark) {
  [data-mode="default"], :root:not([data-mode]) { --mode: var(--indigo-400); }
  [data-mode="service-desk"] { --mode: #2dd4bf; }
  [data-mode="university"] { --mode: #fb923c; }
  [data-mode="business"] { --mode: #60a5fa; }
  [data-mode="medical"] { --mode: #22d3ee; }
  [data-mode="sales"] { --mode: #4ade80; }
  [data-mode="interview"] { --mode: #a78bfa; }
  [data-mode="field"] { --mode: #fbbf24; }
  [data-mode="legal"] { --mode: #94a3b8; }
  [data-mode="language"] { --mode: #f472b6; }
}

/* ==== 3. Base =========================================================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: var(--fs-base)/1.6 var(--font);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
html:is([lang="fa"], [lang="ar"]) body { line-height: 1.8; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.lead { color: var(--muted); font-size: var(--fs-lg); line-height: 1.55; margin: -6px 0 var(--sp-6); max-width: 62ch; }

h1 { font-size: var(--fs-3xl); line-height: 1.2; margin: 4px 0 var(--sp-5); letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: var(--fs-xl); line-height: 1.3; margin: var(--sp-6) 0 var(--sp-3); letter-spacing: -.015em; font-weight: 700; }
h3 { font-size: 13.5px; line-height: 1.4; margin: var(--sp-5) 0 var(--sp-2); color: var(--muted); font-weight: 650; }
.card > h2:first-child, .output h2 { margin-top: 0; }
html:is([lang="fa"], [lang="ar"]) h1, html:is([lang="fa"], [lang="ar"]) h2 { letter-spacing: 0; line-height: 1.45; }

/* a new page fades in once (not on every refresh of the same page) */
main.enter { animation: page-in var(--dur-3) var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ==== 4. Layout: the header, the menu, the page ========================================================================== */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  min-height: var(--header-h); padding: 10px var(--sp-6);
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.top::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--mode); opacity: .9; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 8px; box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--accent) 55%, transparent); }

/* the mode switcher: a pill in the mode's colour */
.modebar {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 12px; border-radius: var(--r-full);
  background: color-mix(in srgb, var(--mode) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mode) 32%, var(--line));
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
html[dir="rtl"] .modebar { padding: 0 12px 0 4px; }
.modebar:hover { border-color: color-mix(in srgb, var(--mode) 60%, var(--line)); }
.modebar:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode) 28%, transparent); }
.modebar:empty { display: none; }
.mode-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mode); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode) 22%, transparent); }
.modebar select {
  width: auto; min-height: 34px; border: 0; box-shadow: none; padding: 0 30px 0 4px; font-weight: 700; font-size: 14.5px; color: var(--text);
  background-color: transparent; cursor: pointer;
}
html[dir="rtl"] .modebar select { padding: 0 4px 0 30px; }
/* the opened list is drawn by the browser: it needs the page's colours, or the text is light on light in the dark theme */
select option, select optgroup { background-color: var(--surface); color: var(--text); }
.modebar select:focus, .modebar select:focus-visible { outline: none; box-shadow: none; }

#nav { display: flex; gap: 2px; flex-wrap: nowrap; margin-inline-start: auto; }
#nav a {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 11px; border-radius: 10px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background-color var(--dur-1), color var(--dur-1);
}
#nav a:hover { background: var(--surface-2); color: var(--text); }
#nav a.active { background: color-mix(in srgb, var(--mode) 12%, transparent); color: var(--mode); }
#nav a .icon { width: 17px; height: 17px; }
/* the menu stays on one line: on a laptop the extra pages (Examples, Help, Account) keep only their icon, on a small
   screen every page does (each keeps its name as a tooltip and for screen readers) */
@media (min-width: 721px) and (max-width: 1439px) { #nav a.nav-extra { padding: 0 10px; } #nav a.nav-extra .nav-full { display: none; } }
@media (min-width: 721px) and (max-width: 1100px) { #nav a { padding: 0 10px; } #nav a .nav-full { display: none; } .top { gap: var(--sp-3); } }

main { max-width: 1080px; margin: 0 auto; padding: var(--sp-7) var(--sp-6) 96px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--sp-2); text-decoration: none; font-weight: 600; font-size: 14px; }

/* the sign-in page: one narrow column in the middle, under the app's mark */
main[data-page="login"] { max-width: 480px; padding-top: var(--sp-9); }
main[data-page="login"] h1, main[data-page="login"] .lead { text-align: center; }
main[data-page="login"] h1::before { content: ""; display: block; width: 56px; height: 56px; margin: 0 auto var(--sp-4); background: url("favicon.svg") center / contain no-repeat; filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--accent) 40%, transparent)); }
main[data-page="login"] .lead { margin-inline: auto; font-size: var(--fs-md); }
main[data-page="login"] .card { max-width: none; }
main[data-page="login"] .card .button, main[data-page="login"] form.card button { width: 100%; margin-top: var(--sp-2); }
main[data-page="login"] form.card label { display: block; font-weight: 650; font-size: var(--fs-sm); margin-bottom: 6px; }

/* ==== 5. Components ======================================================================================================= */
/* -- card -- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--card-r); padding: var(--card-pad); margin-bottom: var(--sp-4); box-shadow: var(--shadow-xs); }
.card.narrow { max-width: 480px; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
details.fold > summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
details.fold form.card { border: 0; box-shadow: none; padding: 14px 0 0; margin: 0; }

/* -- button: secondary (default), primary, danger, link; hover, active, focus, disabled --
   | state    | secondary          | primary                 |
   | default  | surface, line      | indigo→violet, white    |
   | hover    | surface-2          | brighter, deeper shadow |
   | active   | 1 px down          | 1 px down, flatter      |
   | disabled | 55 % (busy cursor) | 55 % (busy cursor)      | */
input, select, textarea, button, .button { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 8px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
  cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.25; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-2), transform var(--dur-1), filter var(--dur-1);
}
button:hover, .button:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 22%, var(--line-strong)); }
.button:hover { color: var(--text); }
button:active, .button:active { transform: translateY(1px); }
button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: progress; transform: none; }
.primary, .button.primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(18, 21, 42, .12), 0 8px 18px -8px color-mix(in srgb, var(--indigo-600) 75%, transparent);
}
.primary:hover, .button.primary:hover { background: var(--grad); color: #fff; border-color: transparent; filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 1px 2px rgba(18, 21, 42, .12), 0 12px 24px -10px color-mix(in srgb, var(--indigo-600) 85%, transparent); }
.primary:active, .button.primary:active { filter: brightness(.96); box-shadow: 0 1px 2px rgba(18, 21, 42, .15); }
.danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.danger:hover { background: var(--danger-solid); color: #fff; filter: brightness(1.08); }
.big { min-height: var(--btn-h-lg); padding: 12px 22px; font-size: var(--fs-md); width: 100%; margin-top: var(--sp-3); border-radius: 14px; }
button.link { background: none; border: none; box-shadow: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
button.link:hover { background: none; color: var(--accent-hover); }

/* -- fields -- */
input[type=text], input[type=search], input[type=password], input[type=email], input[type=url], input[type=number], select, textarea {
  width: 100%; min-height: var(--control-h); padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background-color: var(--field-bg); color: var(--text); box-shadow: inset 0 1px 1px rgba(18, 21, 42, .03);
  transition: border-color var(--dur-1), box-shadow var(--dur-2);
}
textarea { line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 26%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); outline: none; }
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 38px;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
html[dir="rtl"] select:not([multiple]) { background-position: left 14px center; }
select[multiple] { min-height: 160px; padding: 6px; }
input[type=checkbox], input[type=radio], input[type=range], progress { accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
label.field { display: grid; gap: 6px; margin: 0 0 var(--sp-4); }
label.field > span { font-weight: 650; font-size: var(--fs-sm); color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }

/* a group of fields: its title sits inside the box (a floated legend), not on its border */
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) 18px 6px; margin: 0 0 var(--sp-4); min-width: 0;
  background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
fieldset > legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--sp-3); font-weight: 700; font-size: var(--fs-md); }
html[dir="rtl"] fieldset > legend { float: right; }
fieldset > legend + * { clear: both; }
fieldset > legend label.inline, .card fieldset > legend label.inline, form fieldset > legend label.inline { margin: 0; }
fieldset > legend + p { margin-top: 0; }
fieldset > p.small { margin: 0 0 var(--sp-3); }
.sub { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 var(--sp-4); align-items: start; }

/* a choice of one among a few, as cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer;
  background: var(--surface); transition: border-color var(--dur-1), background-color var(--dur-1), box-shadow var(--dur-1); }
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* -- toolbars, lists, meeting cards -- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-4); }
.toolbar .search { flex: 1 1 240px; width: auto; }
.toolbar select { width: auto; }
input[type=search] { padding-inline-start: 40px; background-repeat: no-repeat; background-size: 16px 16px; background-position: left 14px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23636a89' d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E"); }
html[dir="rtl"] input[type=search] { background-position: right 14px center; }
.list { display: grid; gap: 10px; }
.list > * { min-width: 0; }  /* a long title is cut, it does not widen the list */
.list.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.meeting { color: inherit; text-decoration: none; margin: 0; padding: 16px 18px;
  transition: border-color var(--dur-2), box-shadow var(--dur-2), transform var(--dur-2) var(--ease); }
.meeting:hover { color: inherit; border-color: color-mix(in srgb, var(--mode) 45%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.row { display: flex; align-items: center; gap: var(--sp-3); justify-content: space-between; }
.meeting .title { font-size: var(--fs-md); font-weight: 700; }
.meta { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); margin-top: 6px; }
.empty { color: var(--muted); padding: var(--sp-9) var(--sp-6); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--card-r);
  background: color-mix(in srgb, var(--surface) 70%, transparent); }
.empty p { margin: var(--sp-3) auto var(--sp-5); max-width: 46ch; }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: color-mix(in srgb, var(--mode) 13%, transparent); color: var(--mode); }
.empty-icon .icon { width: 26px; height: 26px; }
.error-line { color: var(--danger); font-size: var(--fs-sm); margin-top: 6px; }

/* -- chips; a status chip has a dot, which pulses while the work goes on -- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 650; line-height: 1.5; padding: 2px 10px;
  border-radius: var(--r-full); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip[class*="st-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-ready { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.st-error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.st-recording { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.st-processing, .st-queued, .st-uploading { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.st-processing::before, .st-uploading::before, .st-recording::before { animation: pulse 1.4s infinite; }

/* -- recording -- */
.running .row { justify-content: flex-start; flex-wrap: wrap; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 22%, transparent); }
@keyframes pulse { 50% { opacity: .35; } }
.timer { font-size: 30px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.meters { display: grid; gap: 8px; margin: 14px 0; }
.meter { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .15s; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--sp-4); }
.slider input { width: 100%; }

.captions { max-height: 55vh; overflow-y: auto; display: grid; gap: 10px; }
.cap { border-inline-start: 3px solid var(--accent); padding: 4px 12px; }
.cap p { margin: 0; }
.cap .src { color: var(--muted); font-size: 14px; }
.cap .tgt { font-size: var(--fs-lg); font-weight: 500; }
.cap.partial { border-color: var(--line); opacity: .8; }

/* -- the meeting page: title, steps, player, tabs and the panel under them -- */
.head { display: flex; gap: var(--sp-3); align-items: center; }
.title-edit { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: var(--fs-2xl) !important; font-weight: 750; letter-spacing: -.02em;
  border-color: transparent !important; box-shadow: none !important; padding-inline: 6px !important; margin-inline-start: -6px; background: transparent !important; }
.title-edit:hover { border-color: var(--line) !important; }
.title-edit:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent) !important; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: var(--sp-3) 0; }
.step { font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); background: var(--surface-2); color: var(--muted); }
.s-done { color: var(--ok); }
.s-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.s-running, .s-queued { color: var(--warn); }
audio { width: 100%; margin: 10px 0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: var(--sp-5) 0 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none; box-shadow: none; color: var(--muted);
  min-height: 46px; padding: 0 16px; white-space: nowrap; font-weight: 650; }
.tabs button:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); color: var(--text); border: 0; }
.tabs button:active { transform: none; }
.tabs button.active { color: var(--text); }
.tabs button.active::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--mode); }
.panel { background: var(--surface); border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--card-r) var(--card-r);
  padding: 22px var(--sp-6); min-height: 200px; box-shadow: var(--shadow-xs); }

/* the transcript: the time, the speaker in their own colour, the words */
.segments { display: grid; gap: 2px; }
.seg { display: grid; grid-template-columns: 68px 1fr; gap: var(--sp-3); padding: 8px 10px; border-radius: 10px; transition: background-color var(--dur-1); }
.seg:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.seg.now { background: var(--accent-soft); }
.seg p { margin: 0; line-height: 1.65; }
.seg .second { color: var(--muted); margin-top: 2px; }
.time { font-variant-numeric: tabular-nums; font-size: var(--fs-xs); font-weight: 650; line-height: 1; padding: 5px 9px; min-height: 26px; border-radius: var(--r-full);
  height: fit-content; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); border: 0; box-shadow: none; justify-self: start; }
.time:hover { background: color-mix(in srgb, var(--accent) 17%, transparent); color: var(--accent); border: 0; }
.speaker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em; }
.c0 { color: var(--spk-0); } .c1 { color: var(--spk-1); } .c2 { color: var(--spk-2); } .c3 { color: var(--spk-3); } .c4 { color: var(--spk-4); } .c5 { color: var(--spk-5); }

/* a row that makes something again ("Translate into … Go") */
.action { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.action select { width: auto; max-width: 260px; }
.action > span { font-weight: 650; font-size: 14px; }
.dub { display: grid; gap: 4px; margin: 8px 0 14px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-md); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; } .meter { grid-template-columns: 100px 1fr; } }

/* the summary reads like the outputs: small titles over each part */
.summary h2 { margin-top: 4px; font-size: var(--fs-xl); }
.summary h3 { margin: var(--sp-5) 0 var(--sp-2); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html:is([lang="fa"], [lang="ar"]) .summary h3 { letter-spacing: 0; text-transform: none; font-size: 14px; }
.summary p { margin: 0; line-height: 1.7; }
.summary ul { padding-inline-start: 22px; margin: 0; }
.summary li { margin: 5px 0; }
.summary li .time { margin-inline-end: 6px; }
.summary .todo li::marker { content: "☐  "; }
.exports { display: grid; gap: 8px; max-width: 460px; margin-bottom: var(--sp-5); }  /* one option under the other, not a wrapped crowd */
.exports .button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; text-align: start; }
.exports + h3, #panel h3 + .exports { margin-top: var(--sp-2); }
table.details { border-collapse: collapse; width: 100%; margin-bottom: var(--sp-4); }
.details th, .details td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.details th { color: var(--muted); font-weight: 650; font-size: 14px; width: 34%; }
.details tr:last-child th, .details tr:last-child td { border-bottom: 0; }
pre.report { background: var(--surface-2); padding: 12px; border-radius: var(--r-md); overflow: auto; font-size: var(--fs-xs); }
progress { width: 100%; margin: 6px 0; }

/* -- toast: the short message at the bottom -- */
#toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: fit-content; max-width: min(92vw, 640px); padding: 12px 18px;
  border-radius: var(--r-md); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 550;
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease); pointer-events: none; z-index: 50;
}
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--danger-solid); color: #fff; }

/* -- loading: a small spinner in front of "Loading…" -- */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  main { padding: var(--sp-4) 14px 60px; }
  #nav a span { display: none; }
  .seg { grid-template-columns: 56px 1fr; gap: 10px; }
  .panel { padding: var(--sp-4); }
  :root { --card-pad: 18px; }
}

/* two-way conversation: one pane per person; face to face the other person's pane is upside down */
.talk { display: grid; gap: 14px; margin-bottom: 16px; }
.talk-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-height: 30vh; box-shadow: var(--shadow); }
.talk-pane.flipped { transform: rotate(180deg); }
.talk-pane h2 { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.talk-lines { max-height: 34vh; overflow-y: auto; font-size: 22px; line-height: 1.45; }
.talk-lines p { margin: 0 0 8px; }
.talk-lines .partial { opacity: .65; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .three { grid-template-columns: 1fr; } }

/* installed on a phone: the tab bar sits at the bottom, inside the safe areas of notches and gesture bars */
@media (max-width: 720px) {
  .top { padding-top: calc(10px + env(safe-area-inset-top)); backdrop-filter: none; -webkit-backdrop-filter: none; } /* a backdrop-filter would make the header the box the fixed tab bar is placed in */
  #nav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 20; margin: 0; flex-wrap: nowrap; justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(18, 21, 42, .35);
  }
  #nav a { flex: 1 1 0; min-width: 0; min-height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 11px; text-align: center; border-radius: 14px; }
  #nav a .icon { width: 20px; height: 20px; }
  #nav a span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  button, select, input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
}

/* modes: the chooser, the badge on a meeting, and the outputs a mode makes */
.mode-pick { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--mode) 30%, var(--line)); border-inline-start: 4px solid var(--mode); border-radius: 14px; background: color-mix(in srgb, var(--mode) 6%, var(--surface)); margin-bottom: 16px; }
.mode-pick-head { display: flex; align-items: center; gap: 10px; }
.mode-pick p { margin: 6px 0 0; }
.consent { align-items: flex-start; margin-top: 8px; font-weight: 500; }
.consent input { margin-top: 4px; }
.mode-badge { padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.output { margin-bottom: 18px; }
.out-field h3 { margin: 14px 0 6px; }
.out-field ul { margin: 0; padding-inline-start: 1.2em; }
.table-scroll { overflow-x: auto; }
.out-table th { width: auto; }

/* courses and classes (university mode): the video with the text beside it, not on top of it */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip.main { background: var(--accent-soft); color: var(--accent); }
.course-box { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 12px; }
code.invite { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); word-break: break-all; direction: ltr; text-align: left; margin: 8px 0; }
.list .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.list a.item:hover { border-color: var(--accent); }
.item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.class-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.class-media video, .class-media audio { width: 100%; border-radius: var(--radius); background: #000; }
.class-media audio { background: transparent; }
.class-text { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--surface); }
.class-text .seg { cursor: pointer; }
.class-text .seg:hover { background: var(--surface-2); }
.toolbar.wrap { flex-wrap: wrap; }
video.class-video { width: 100%; max-height: 70vh; border-radius: var(--radius); background: #000; margin-bottom: 12px; }
@media (max-width: 900px) { .class-view { grid-template-columns: minmax(0, 1fr); } .class-text { max-height: 40vh; } }

@media (max-width: 720px) {
  .top { gap: 10px; padding-inline: 14px; }
  .modebar { padding-inline-start: 10px; }
  .modebar select { max-width: 48vw; }
  h1 { font-size: 24px; }
  .list.cards { grid-template-columns: 1fr; }
}

/* layout fixes seen on the screenshots: fields start at the top of their row, a checkbox line stands alone,
   course cards stack their parts, and the menu stays on one line on a laptop */
.card label.inline, form label.inline { display: flex; margin: 6px 0 14px; }
.list.cards .item { flex-direction: column; align-items: flex-start; }

/* the phone's bottom bar keeps the mode's pages and Settings; Help and Account are on the Settings page */
.phone-only { display: none; }
@media (max-width: 720px) {
  #nav a.nav-extra { display: none; }
  .phone-only { display: flex; }
  .toolbar > .button, .toolbar > button { flex: 1 1 calc(50% - 10px); }
  .toolbar > .search { flex-basis: 100%; }
}

/* slides of a course: the original page and, beside it, its text in the chosen language */
.slide-view { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.slide-image { margin: 0; }
.slide-image img, .present-image { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.slide-image figcaption { margin-top: 6px; }
.slide-text { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; max-height: 70vh; overflow: auto; }
.slide-text h3 { margin-top: 0; }
.slide-words, .slide-first { white-space: pre-wrap; font: inherit; margin: 0; line-height: 1.7; }
.present-stage { display: grid; place-items: center; margin-bottom: 12px; }
.present-stage .present-image { max-height: 72vh; width: auto; max-width: 100%; }
.present-controls { justify-content: center; }
@media (max-width: 900px) { .slide-view { grid-template-columns: minmax(0, 1fr); } }
/* the teacher's own translated slides: the translated picture beside the original (a switch for one of them alone) */
.slide-view.slide-versions { display: block; }
.slide-show { margin-bottom: 12px; }
.slide-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.slide-pair[data-show="original"] .fig-translated, .slide-pair[data-show="translated"] .fig-original { display: none; }
.slide-pair[data-show="original"], .slide-pair[data-show="translated"] { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .slide-pair { grid-template-columns: minmax(0, 1fr); } }
.slide-text-fold { margin-top: 12px; }
.versions-card h2 { margin-top: 0; }
.version-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.version-row progress { width: 100%; }
.own-slides { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin: 12px 0; }
.own-slides legend { padding: 0 6px; }
.chip.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); border-color: transparent; }

/* asking the course: an answer with its citations and sources, general knowledge apart; the teacher's inbox */
.course-body { margin-top: 16px; }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); margin: 8px 0; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.answer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.answer-text { white-space: pre-wrap; line-height: 1.75; margin: 0 0 8px; }
a.cite { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 6px; margin: 0 2px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); text-decoration: none; vertical-align: 2px; }
a.cite:hover { background: var(--accent); color: var(--accent-text); }
.answer h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
ol.sources { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
ol.sources li a { font-weight: 600; }
ol.sources q { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; quotes: none; }
.general { margin-top: 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.general strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.general p { margin: 6px 0 0; }
.question .item-main { gap: 4px; }
.teacher-answer { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.chip.open { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.answered { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip.dismissed { opacity: .7; }
.qgroup.open { border-inline-start: 4px solid var(--warn); }
.qgroup.answered { border-inline-start: 4px solid var(--ok); }
.qhead { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.qhead .chips { margin: 0; }
.qgroup textarea { width: 100%; margin-top: 10px; }
ul.asked { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.faq-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.faq-row .field { flex: 1 1 260px; margin: 0; }
.faq details.card { margin-bottom: 10px; }
.faq details.card p { margin: 10px 0 0; white-space: pre-wrap; line-height: 1.7; }
.class-text .seg { grid-template-columns: 64px minmax(0, 1fr) auto; }
.explain-btn { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-weight: 700; opacity: .45; align-self: start; }
.class-text .seg:hover .explain-btn, .explain-btn:focus-visible { opacity: 1; }
.card.explain blockquote { margin: 6px 0 0; padding: 8px 12px; border-inline-start: 3px solid var(--mode); background: var(--surface-2); border-radius: 8px; }
.card.explain .qhead h3 { margin: 0; }
@media (max-width: 640px) { .explain-btn { opacity: .8; } .class-text .seg { grid-template-columns: 52px minmax(0, 1fr) auto; } }

/* questions during a live class: the one being answered, the composer, "+1" */
.live-questions { margin-top: 16px; }
.live-questions .qhead h2 { margin: 0; }
.class-voice .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.class-voice .row h2 { margin: 0; }
.class-voice .captions { max-height: 30vh; margin-top: 12px; }
.chip.on-air { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.live-now { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--mode) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mode) 35%, transparent); }
.live-now .live-text { font-size: 18px; font-weight: 650; margin: 4px 0 8px; line-height: 1.6; }
.live-ask { margin: 10px 0 14px; }
.live-ask textarea { width: 100%; }
.live-q-item .item-main span[dir] { line-height: 1.6; }
button.vote { min-width: 72px; border-radius: 999px; font-weight: 700; }
button.vote.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
button.vote[disabled] { opacity: .55; cursor: default; }
#live-speak.recording { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); border-color: var(--danger); }
@media (max-width: 640px) { .live-q-item { flex-wrap: wrap; } .live-q-item .toolbar { width: 100%; } }

/* practice questions and learning feedback */
.quiz-card { margin-bottom: 12px; }
.quiz-card.right { border-inline-start: 4px solid var(--ok); }
.quiz-card.partly { border-inline-start: 4px solid var(--warn); }
.quiz-card.wrong { border-inline-start: 4px solid var(--danger); }
.quiz-body { font-size: 17px; font-weight: 600; line-height: 1.7; margin: 8px 0 12px; }
.quiz-card textarea { width: 100%; }
ol.options { margin: 8px 0; padding-inline-start: 24px; display: grid; gap: 4px; }
ol.options li.right, ul.points li.right { color: var(--ok); font-weight: 600; }
ul.points { margin: 6px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.choices { display: grid; gap: 8px; }
button.choice { text-align: start; justify-content: flex-start; padding: 10px 14px; border-radius: 12px; line-height: 1.6; white-space: normal; }
button.choice.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
button.choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--fg, inherit); }
button.choice.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.verdict { display: flex; gap: 6px; align-items: baseline; font-size: 18px; margin: 12px 0 4px; }
.feedback { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 10px 0; }
.feedback .chip { cursor: pointer; }
#practice-result details { margin: 8px 0; }
#practice-result details textarea { width: 100%; margin: 6px 0; }
.mastery { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 6px 0; min-width: 120px; }
.mastery span { display: block; height: 100%; background: var(--ok); }
.mastery.weak span { background: var(--danger); }
.mastery.growing span { background: var(--warn); }
.card.topic.weak { border-inline-start: 4px solid var(--danger); }
.card.topic.growing { border-inline-start: 4px solid var(--warn); }
.card.topic.solid { border-inline-start: 4px solid var(--ok); }
.chip.weak { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.chip.growing { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.solid { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.topic-row .item-main { min-width: 0; flex: 1; }
.contest { margin-bottom: 12px; border-inline-start: 4px solid var(--warn); }
.quiz-editor { display: grid; gap: 8px; margin-top: 8px; }
.quiz-editor textarea, .quiz-editor input[type=text] { width: 100%; }
.filters { margin: 12px 0; }
.filters button.chip { cursor: pointer; border: 1px solid var(--line); }
#lost-now { margin-top: 16px; }

/* the small gaps: text size, quick explain buttons, notes, corrections */
.seg-actions { display: flex; gap: 4px; align-self: start; }
.class-text .seg:hover .note-btn, .note-btn:focus-visible { opacity: 1; }
.seg p.edited::after { content: " ✎"; color: var(--muted); font-size: .8em; }
.class-view[data-size=large] .class-text .seg p { font-size: 1.25em; line-height: 1.7; }
.class-view[data-size=huge] .class-text .seg p { font-size: 1.6em; line-height: 1.7; }
video[data-size=large]::cue { font-size: 150%; }
video[data-size=huge]::cue { font-size: 200%; }
.explain-actions { margin-top: 10px; }
.explain-actions .chip { cursor: pointer; border: 1px solid var(--line); }
.explain-actions .chip:disabled { opacity: .5; cursor: default; }
.card.note blockquote { margin: 0 0 8px; padding: 6px 12px; border-inline-start: 3px solid var(--mode); background: var(--surface-2); border-radius: 8px; }
.card.note textarea { width: 100%; margin: 8px 0; }
#notes-search { width: 100%; }
#notes-new { width: 100%; }

/* ---- the outputs of the professional modes (web/js/outputs.js) -------------------------------------------------------
   Status is always a word plus an icon, never colour alone; every control is at least 40px (44px on touch). */
.output { padding: 0; }
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.out-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.out-head select { width: auto; }
.out-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.out-actions button { min-height: 40px; }
.output-body { margin-bottom: 8px; }
.output + .output { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px; }
.review { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; font-size: 14px; }
.review .icon { flex: none; }
.review.draft { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--warn); }
.review.approved { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.out-disclaimer { margin: 0 0 16px; padding: 8px 12px; border-inline-start: 3px solid var(--line); color: var(--muted); font-size: 13.5px; }
.out-lead { font-size: 17px; line-height: 1.55; margin: 0 0 14px; font-weight: 500; }
.out-text { margin: 0; }
.out-field { margin: 0 0 18px; }
.out-field > h3, .tile h3, .callout h3 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html:is([lang="fa"], [lang="ar"]) .out-field > h3, html:is([lang="fa"], [lang="ar"]) .tile h3, html:is([lang="fa"], [lang="ar"]) .callout h3 { letter-spacing: 0; text-transform: none; font-size: 14px; }
.out-lines { margin: 0; padding-inline-start: 1.15em; }
.out-lines li { margin: 5px 0; }
.out-lines .time, .out-card .time, .out-table .time { margin-inline-start: 8px; }
.when { margin-inline-start: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.out-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); min-width: 0; }
.tile header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tile header h3 { margin: 0; }
.badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--mode); color: var(--accent-text); font-weight: 800; font-size: 14px; }
.callout { display: flex; gap: 12px; padding: 12px 16px; border-radius: 14px; margin: 0 0 18px; background: color-mix(in srgb, var(--warn) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); }
.callout > .icon { flex: none; color: var(--warn); margin-top: 2px; }
.callout > div { min-width: 0; flex: 1; }
.out-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.out-card { border: 1px solid var(--line); border-inline-start: 4px solid var(--mode); border-radius: 12px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.out-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.out-card-head strong { flex: 1 1 100%; font-size: 15px; line-height: 1.4; }
.out-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 13.5px; }
.out-card dt { color: var(--muted); }
.out-card dd { margin: 0; }
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 650; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag-high, .tag-urgent, .tag-fault, .tag-absent { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.tag-attention, .tag-soon, .tag-unclear, .tag-negotiation { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.tag-ok, .tag-present, .tag-closed { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.out-audit { margin-top: 14px; font-size: 13px; color: var(--muted); }
.out-audit summary { cursor: pointer; min-height: 28px; }
.out-audit ul { margin: 6px 0 0; padding-inline-start: 1.2em; }
.mode-notice { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--warn); }
.mode-notice .icon { flex: none; margin-top: 2px; }

/* the editor */
.out-edit { display: grid; gap: 16px; margin-bottom: 14px; }
.edit-field { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.edit-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.edit-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.edit-cell { display: grid; gap: 3px; flex: 2 1 180px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.edit-cell.short { flex: 0 1 90px; }
.edit-cell input, .edit-cell select, .edit-cell textarea { color: var(--text); font-weight: 400; }
.edit-row .link { min-height: 40px; }

@media (max-width: 720px) {
  .out-grid { grid-template-columns: minmax(0, 1fr); }
  .output-body { padding: 16px; }
}
@media (pointer: coarse) {
  .out-actions button, .out-edit button { min-height: 44px; }
  .out-lines .time, .out-card .time { min-height: 36px; padding: 6px 12px; }
}
@media print {
  .top, #nav, .tabs, .toolbar, .out-actions, .action, .back, #steps, video, audio, .out-head select, .head .chip, .out-audit { display: none !important; }
  body { background: #fff; color: #000; }
  .output-body { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .out-card, .tile, .callout { break-inside: avoid; }
  .time { border: none; background: none; color: #000; }
}

/* ---- the list, the meeting page and the examples (1.11) -------------------------------------------------------------- */
.mode-tile { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--mode) 13%, var(--surface)); color: var(--mode); }
.mode-tile .icon { width: 21px; height: 21px; }
.meeting { display: flex; gap: 14px; align-items: flex-start; }
.meeting-body { flex: 1; min-width: 0; }
.meeting .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mode-intro { display: flex; gap: 14px; align-items: center; margin: -6px 0 18px; padding: 12px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--mode) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mode) 22%, var(--line)); }
.mode-intro strong { display: block; color: var(--mode); font-size: 14px; }
.mode-intro p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.list-foot { text-align: center; margin: 22px 0 0; font-size: 14px; }
.list-foot a, .example-note a { display: inline-flex; align-items: center; gap: 6px; color: var(--mode); font-weight: 600; text-decoration: none; }
.list-foot a:hover, .example-note a:hover { text-decoration: underline; }
.list-foot .icon { width: 16px; height: 16px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.mode-badge.example { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.example-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px;
  background: color-mix(in srgb, var(--mode) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--mode) 40%, var(--line)); }
.example-note > .icon { color: var(--mode); flex: none; }
.example-note span { flex: 1 1 260px; }
.steps-done { min-height: 30px; padding: 3px 12px; font-size: 12.5px; font-weight: 600; border-radius: 999px; gap: 6px;
  background: color-mix(in srgb, var(--ok) 11%, transparent); color: var(--ok); border-color: transparent; }
.steps-done:hover { background: color-mix(in srgb, var(--ok) 18%, transparent); border-color: transparent; }
.steps-done .icon { width: 15px; height: 15px; }
.link.small { font-size: 12.5px; min-height: 28px; }
.seg.focus { background: color-mix(in srgb, var(--mode) 14%, transparent); box-shadow: inset 3px 0 0 var(--mode); }
html[dir="rtl"] .seg.focus { box-shadow: inset -3px 0 0 var(--mode); }

.nav-short { display: none; }
@media (max-width: 720px) {
  #nav a .nav-full { display: none; }
  #nav a .nav-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mode-intro { align-items: flex-start; }
  .meeting .mode-tile { width: 36px; height: 36px; }
  .mode-intro p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  /* the bottom bar already has every page: keep only the main action beside the search */
  .list-tools > .button:not(.primary) { display: none; }
  .list-tools > .button.primary { flex: 1 1 100%; }
}
.out-nothing { margin: 4px 0 8px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }

/* the examples */
.scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.scenario { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.scenario::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--mode); }
.scenario header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.scenario h2 { margin: 2px 0 0; font-size: 17px; line-height: 1.35; letter-spacing: -.01em; }
.scenario-mode { font-size: 12px; font-weight: 700; color: var(--mode); text-transform: uppercase; letter-spacing: .06em; }
html:is([lang="fa"], [lang="ar"]) .scenario-mode { text-transform: none; letter-spacing: 0; font-size: 13px; }
.scenario-who { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.scenario-who .icon { width: 16px; height: 16px; flex: none; }
.scenario-story { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }
.scenario h3 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html:is([lang="fa"], [lang="ar"]) .scenario h3 { letter-spacing: 0; text-transform: none; font-size: 14px; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks .icon { width: 17px; height: 17px; flex: none; margin-top: 3px; color: var(--mode); }
.scenario-how { margin: 0 0 14px; font-size: 14px; }
.scenario-how summary { cursor: pointer; font-weight: 600; color: var(--mode); min-height: 32px; display: flex; align-items: center; }
.scenario-how ol { margin: 6px 0 0; padding-inline-start: 1.3em; display: grid; gap: 4px; }
.scenario footer { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.scenario footer .plan { margin-inline-start: auto; }
@media (max-width: 720px) { .scenarios { grid-template-columns: minmax(0, 1fr); } .scenario footer .plan { margin-inline-start: 0; } }

/* delete a meeting from the list */
.meeting-delete { flex: none; align-self: center; border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 10px; cursor: pointer; }
.meeting-delete:hover { color: #c0392b; background: color-mix(in srgb, #c0392b 10%, transparent); }
.meeting-delete .icon { width: 18px; height: 18px; }

/* ==== Calm (1.17): the same cleaner pass as the site: flat, hairline borders, one solid main colour ======================== */
:root { --grad: var(--accent); --shadow-xs: none; --shadow-sm: none; --shadow: none; --card-r: 14px; }
.top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
.top::after { display: none; }
.brand img { box-shadow: none; border-radius: 8px; }
.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; box-shadow: none; }
.primary:hover, .button.primary:hover { background: var(--accent); color: var(--accent-text); filter: none; opacity: .9; box-shadow: none; }
.primary:active, .button.primary:active { filter: none; opacity: .82; box-shadow: none; }
.card, .meeting, .scenario, .out-card { box-shadow: none; }
.meeting:hover, .card.meeting:hover { box-shadow: none; transform: none; border-color: var(--line-strong); }
.tabs button.active::after { background: var(--text); }

/* -- the modes of an account: the list, the editor (fields, document, trial) -- */
.cm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.cm-mode { display: grid; gap: var(--sp-2); align-content: start; margin-bottom: 0; }
.cm-mode h3 { margin: 0; color: var(--text); font-size: var(--fs-md, 16px); }
.cm-mode .toolbar { margin-bottom: 0; }
.cm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
a.button.disabled { opacity: .55; pointer-events: none; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.segmented button { border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--muted); min-height: 36px; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.cm-head { display: grid; gap: var(--sp-3); }
.cm-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-swatch { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.cm-swatch.on { box-shadow: 0 0 0 2px var(--text); }
.cm-toolbar { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); }
.cm-rows { display: grid; gap: var(--sp-2); }
.cm-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2); background: var(--surface); display: grid; gap: var(--sp-2); }
.cm-row-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(130px, .8fr) minmax(0, 1.6fr) auto; gap: var(--sp-2); align-items: center; }
.cm-row-tools { display: flex; gap: 2px; }
.cm-sub { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.cm-cols { display: grid; gap: 6px; }
.cm-col { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 6px; align-items: center; }
.cm-json, .cm-source { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; }
.cm-other { margin-top: var(--sp-4); }
.cm-other summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.cm-help { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0; }
.cm-doc { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); margin-top: var(--sp-3); }
.cm-palette { display: grid; gap: 6px; align-content: start; }
.cm-chip { justify-self: start; min-height: 0; padding: 2px 10px; border-radius: var(--r-full); font-size: var(--fs-xs); background: var(--surface-2); text-align: start; }
.cm-chip:disabled { opacity: .5; }
.cm-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); min-height: 200px; overflow: auto; }
.cm-preview h1 { font-size: 20px; margin: 0 0 6px; } .cm-preview h2 { font-size: 16px; margin: 14px 0 4px; } .cm-preview h3 { font-size: 14px; margin: 10px 0 2px; }
.cm-preview table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); } .cm-preview th, .cm-preview td { border: 1px solid var(--line); padding: 4px 8px; text-align: start; }
.cm-preview th { background: var(--surface-2); }
.cm-pre { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-3); overflow: auto; font-size: 12.5px; direction: ltr; text-align: left; white-space: pre-wrap; }
.cm-settings { display: grid; gap: var(--sp-3); }
.cm-savebar { position: sticky; bottom: 0; background: var(--bg); padding-block: var(--sp-3); margin: 0; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .cm-doc { grid-template-columns: minmax(0, 1fr); }
  .cm-row-main { grid-template-columns: minmax(0, 1fr) auto; }
  .cm-col { grid-template-columns: minmax(0, 1fr) auto; }
  .cm-col select { grid-column: 1; }
}

/* ==== University mode, review 6 (phase A): the role, the slides tab, the teacher beside the assistant ==== */
.rolebar:empty { display: none; }
.rolebar .segmented { background: var(--surface); }
.rolebar { margin-inline-start: -4px; }
.rolebar .segmented button { min-height: 36px; padding: 0 10px; font-weight: 600; font-size: 13.5px; }
.rolebar .segmented button[aria-pressed="true"] { background: var(--mode); color: var(--accent-text); }
.consent-known { margin: 8px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); color: var(--text); }

.upload-slides h2 { margin-top: 0; }
.upload-slides input[type="file"] { width: 100%; }
.slides-bar { align-items: flex-end; flex-wrap: wrap; gap: var(--sp-3); }
.slides-bar label.field { min-width: 160px; margin: 0; }
.slides-bar button, .slides-bar a.button { margin: 0; }
.edited-chip { display: inline-flex; margin: var(--sp-3) 0 var(--sp-2); background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.slide-edit { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }
.slide-edit textarea { width: 100%; min-height: 200px; font: inherit; line-height: 1.6; }

.ways { margin-bottom: var(--sp-3); }
.ways button { min-height: 40px; padding: 0 18px; }
.ways button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* "still not clear?": the teacher, a person, right under the assistant's answer */
.handover { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  margin-top: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--mode) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mode) 28%, var(--line)); border-inline-start: 4px solid var(--mode); }
.handover-text { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
.handover .icon { width: 18px; height: 18px; margin-inline-end: 6px; vertical-align: -3px; }
.handover > .icon { color: var(--ok); }

/* ==== University mode, phase C: My study (plan, week, notebook, exam preparation, about me) ==== */
.study-nav { display: flex; max-width: 100%; overflow-x: auto; margin: var(--sp-4) 0; scrollbar-width: none; }
.study-nav::-webkit-scrollbar { display: none; }
.study-nav button { white-space: nowrap; min-height: 40px; padding: 0 18px; }
.study-nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.plan h2 { margin-top: 0; }
.plan-step { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-4) 0; border-top: 1px solid var(--line); }
.plan-step:first-of-type { border-top: 0; padding-top: 0; }
.plan-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); }
.plan-step.mistakes .plan-icon { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.plan-step.study .plan-icon { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.plan-icon .icon { width: 20px; height: 20px; }
.plan-main { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
.plan-step .toolbar { margin: 0; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-3); align-items: end; height: 150px; margin-top: var(--sp-3); }
.week-day { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; }
.week-bar { width: 100%; max-width: 38px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; }
.week-bar span { display: block; width: 100%; background: var(--accent); border-radius: var(--r-sm); min-height: 0; }
.week-n { font-weight: 650; font-size: var(--fs-sm); }
.big-number { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; line-height: 1.1; }
.exam-countdown h2, .exam-report h2 { margin-top: 0; }
.exam-bar { position: sticky; top: calc(var(--header-h) + 4px); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: 10px var(--sp-4); margin-bottom: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: var(--fs-xl); }
.exam-timer.low { color: var(--danger); }
fieldset.exam-q { border: 1px solid var(--line); }
fieldset.exam-q legend { font-weight: 700; padding: 0 8px; color: var(--muted); }
.exam-report .topic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--sp-3); align-items: center; padding: 8px 0; }
.exam-report .topic-row .mastery { grid-column: 1 / -1; }
.mistake .your-answer { color: var(--danger); }
.mistake .right-answer { color: var(--ok); }
.chip.personal { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.ask-teacher-box { margin-top: var(--sp-3); }
.handover-form { display: grid; gap: var(--sp-2); padding-top: var(--sp-2); }
.handover-form textarea { width: 100%; }
.quiz-make { display: grid; gap: var(--sp-2); }
@media (max-width: 720px) { .week { gap: var(--sp-2); height: 130px; } .plan-step { align-items: flex-start; } }

.card.topic > .toolbar { margin-top: var(--sp-3); }

/* ==== University mode, phase B: assignments ==== */
.assignment .qhead { align-items: flex-start; }
.link-card { cursor: pointer; text-align: start; display: block; width: 100%; }
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.link-card:focus-visible, .item.submission:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.item.submission { cursor: pointer; }
.item.submission:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.asg-description { white-space: pre-wrap; line-height: 1.7; margin: var(--sp-3) 0; }
.asg-questions { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0; max-height: 420px; overflow: auto; padding: 2px; }
.asg-q { display: grid; grid-template-columns: auto minmax(0, 1fr) 72px; gap: var(--sp-3); align-items: start; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); margin: 0; }
.asg-q:has(input[type="checkbox"]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.asg-q-main { display: grid; gap: 6px; min-width: 0; }
.asg-points { width: 72px; min-height: 36px; text-align: center; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.file-link .icon { width: 16px; height: 16px; }
.mark-row { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0 0; font-weight: 600; }
.mark-row .mark-input, .mark-input { width: 96px; flex: none; min-height: 40px; text-align: center; }
.mark-row > span:first-child { white-space: nowrap; }
.student-text { white-space: pre-wrap; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); margin: var(--sp-2) 0; line-height: 1.7; }
label.choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
label.choice.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }

/* ==== review cards ==== */
.review-card { text-align: center; padding: var(--sp-8) var(--card-pad); }
.review-card .qhead { text-align: start; }
.card-front { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.4; margin: var(--sp-6) 0; }
.card-back { padding: var(--sp-4); margin: 0 0 var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); line-height: 1.7; text-align: start; }
.card-back p { margin: 0; white-space: pre-wrap; }
.review-card .toolbar { justify-content: center; }
.flash .qhead strong { font-size: var(--fs-md); }
button.make-card { display: inline-flex; align-items: center; gap: 6px; }
.big-number .muted { margin-inline-start: 10px; font-weight: 500; letter-spacing: 0; }

/* ==== the demo ==== */
.demo-card.on { border-color: color-mix(in srgb, var(--mode) 40%, var(--line)); background: color-mix(in srgb, var(--mode) 5%, var(--surface)); }
.demo-card h2 { margin-top: 0; }
.demo-chip { margin-inline: var(--sp-2); }
.demo-note { display: flex; align-items: center; gap: 8px; border: 1px dashed color-mix(in srgb, var(--mode) 45%, var(--line)); background: color-mix(in srgb, var(--mode) 6%, var(--surface)); }
.guide-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.guide-link .icon { width: 16px; height: 16px; }

/* the teaching console and the "on air now" banner of a student */
.teach-status .teach-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.teach-status .teach-head h2 { margin: 0; }
.teach-status .teach-setup { margin: 12px 0; }
.teach-status fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin: 10px 0; }
.teach-stage { margin-top: 16px; }
.teach-stage h2 { margin-top: 0; }
#teach-warning { margin: 12px 0; }
.live-now { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.live-now .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* the virtual whiteboard (web/js/board.js): a blank page or a layer over a slide's picture */
.slide-box { position: relative; }
.board-layer { position: absolute; inset: 0; }
.board-layer:not(.drawing) { pointer-events: none; }
.board-layer canvas { display: block; width: 100%; height: 100%; }
.board-layer.drawing canvas { cursor: crosshair; touch-action: none; }
.board-page { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc(70vh * 16 / 9)); margin-inline: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.board-slide { max-width: 100%; }
.board-text { position: absolute; min-width: 8em; max-width: 60%; padding: 2px 6px; border: 1px dashed var(--accent); border-radius: 6px; background: rgba(255, 255, 255, 0.92);
  font: inherit; font-weight: 600; resize: none; outline: none; z-index: 2; }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0 12px; }
.board-colors { display: inline-flex; gap: 6px; }
.swatch { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line-strong); box-shadow: none; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.teach-stage .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#teach-draw[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.board-box { margin-top: 16px; }

/* the teacher's shared screen: pictures */
.screen-img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.screen-img:fullscreen { object-fit: contain; border: 0; border-radius: 0; }
.screen-preview { display: block; max-width: 320px; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }

/* a conversation after an answer */
.follow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.follow h3 { margin: 0 0 4px; }
.follow-log { display: grid; gap: 10px; margin: 10px 0; }
.follow-log .turn.you { padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); }
.follow-log .answer-turn { padding: 4px 0 8px 12px; border-inline-start: 3px solid var(--line-strong); }
.follow textarea { width: 100%; }

/* syllabus (teacher) and learning path (student) */
#syllabus textarea { width: 100%; }
.unit-edit { margin: 10px 0; }
.unit-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 8px; }
.unit-head input { flex: 1; min-width: 0; }
.unit-n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 600; }
.card.path-unit { border-inline-start: 4px solid var(--line); margin: 12px 0; }
.card.path-unit.weak { border-inline-start-color: var(--danger); }
.card.path-unit.growing { border-inline-start-color: var(--warn); }
.card.path-unit.solid { border-inline-start-color: var(--ok); }
.card.path-unit.next { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #4f46e5) 45%, transparent); }
.card.path-next { display: grid; gap: 4px; margin: 12px 0; }
.path-unit .goals { margin: 6px 0; padding-inline-start: 20px; color: var(--muted); }
.path-sources { margin: 8px 0; }

/* the shared screen: the teacher's preview and the students' picture, with the drawings laid over them */
.screen-stage { max-width: 320px; margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.screen-stage.big { max-width: min(100%, 900px); }
.screen-stage .screen-preview { max-width: 100%; margin: 0; border: 0; border-radius: 0; }
.screen-wrap { overflow: hidden; border-radius: 12px; background: #000; }
.screen-wrap:fullscreen { display: flex; align-items: center; justify-content: center; border-radius: 0; }
.screen-wrap:fullscreen .screen-fit { display: inline-block; }
.screen-wrap:fullscreen .screen-img { width: auto; height: auto; max-width: 100vw; max-height: 100vh; }
.screen-wrap .screen-img { border: 0; border-radius: 0; }
.board-slide img.replay-screen, .board-slide img { display: block; width: 100%; height: auto; }

/* the way into a live class: the list on the Courses page, the notice when it ends */
.live-now-list .live-now-row { align-items: center; gap: 12px; margin: 8px 0; flex-wrap: wrap; }
.class-ended { border-inline-start: 4px solid var(--warn); }

/* the students in the class now (the teaching console) and the attendance of a class */
.class-people { margin-top: 8px; }
.people-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.people-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.attendance h3 { margin: 14px 0 6px; font-size: 15px; }

/* a message in the middle of the page (the "coming soon" modes ask for an access code here) */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 18, 32, .55); }
.modal { width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal .controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.modal input[type=password] { width: 100%; }

/* ==== the new design: one menu, one red record button, the rest behind accordions ========================================== */
:root { --record: #e11d48; --record-ring: #ffe4ea; }
@media (prefers-color-scheme: dark) { :root { --record-ring: #4a1d2d; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the header outside the university mode: brand, mode, menu button; the menu drops down under it */
#menu-button { margin-inline-start: auto; width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; inset-inline-start: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.top.compact #nav { display: none; }
.top.compact.menu-open #nav {
  display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; position: absolute; inset-inline: auto var(--sp-6); top: calc(100% + 6px); bottom: auto; z-index: 30;
  width: min(280px, calc(100vw - 32px)); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.top.compact.menu-open #nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 42px; padding: 0 12px; font-size: 14px; text-align: start; border-radius: 9px; }
.top.compact.menu-open #nav a.nav-extra { display: flex; padding: 0 12px; }
.top.compact.menu-open #nav a .nav-full { display: inline; }
.top.compact.menu-open #nav a .nav-short { display: none; }
#tabbar { display: none; }

/* the buttons that record are red; everything else is not */
.button.record-cta { background: var(--record); border-color: transparent; color: #fff; min-height: 52px; padding: 0 24px; border-radius: 14px; font-size: var(--fs-md); }
.button.record-cta:hover { background: var(--record); color: #fff; filter: brightness(1.08); border-color: transparent; }
.record-cta .dot { width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.list-tools .button { min-height: 52px; border-radius: 14px; }
.list-tools .search { min-height: 52px; border-radius: 14px; }
.record-area { display: flex; justify-content: center; margin: var(--sp-5) 0; }
button.record-big, button.record-big:hover { width: auto; background: none; border: 0; box-shadow: none; filter: none; color: var(--text); flex-direction: column; gap: 16px; padding: 8px 20px; font-size: var(--fs-md); }
.record-big .disc { width: 108px; height: 108px; border-radius: 50%; background: var(--record); box-shadow: 0 0 0 8px var(--record-ring); display: grid; place-items: center; transition: transform var(--dur-1); }
.record-big .disc::after { content: ""; width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.record-big:hover .disc { transform: scale(1.04); }
.record-big:focus-visible { outline: none; }
.record-big:focus-visible .disc { outline: 3px solid var(--focus); outline-offset: 10px; }

/* the forms of record, upload and the interpreter */
.plain-form { max-width: 640px; margin-inline: auto; }
main:has(.plain-form) > h1 { max-width: 640px; margin-inline: auto; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
button.preset { flex-direction: column; align-items: flex-start; text-align: start; gap: 4px; padding: 14px 16px; border-width: 2px; border-color: var(--line); border-radius: 14px; }
button.preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.field-label { font-weight: 650; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 6px; }
details.group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: var(--sp-3); }
details.group > summary { cursor: pointer; font-weight: 700; padding: 14px 16px; }
details.group > .group-body { padding: 4px 16px 8px; border-top: 1px solid var(--line); }
details.group > .group-body > :first-child { margin-top: var(--sp-3); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; padding: 20px; margin-bottom: var(--sp-4); text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: 18px; background: var(--surface); }
.dropzone .icon { width: 34px; height: 34px; color: var(--accent); }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }

/* the first steps */
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); background: var(--accent-soft); border-radius: 16px; padding: 14px 16px; margin-bottom: var(--sp-4); font-size: 14px; }
.setup .done { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 650; }
.setup button.link { margin-inline-start: auto; }

/* one meeting: three views in front, the rest in a small menu beside them */
.tabrow { position: relative; display: flex; align-items: flex-end; gap: 6px; margin-top: var(--sp-5); border-bottom: 1px solid var(--line); }
.tabrow .tabs { flex: 1 1 auto; min-width: 0; margin: 0; border-bottom: 0; }
button.more-button { min-width: 44px; min-height: 40px; padding: 0; margin-bottom: 4px; font-size: 18px; }
.more-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; display: grid; gap: 2px; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.more-menu button { justify-content: flex-start; border: 0; box-shadow: none; }
.head .download-meeting { flex: none; }

@media (max-width: 720px) {
  .top.compact.menu-open #nav { inset-inline: auto 12px; }
  #menu-button { margin-inline-start: auto; }
  body.has-tabbar #tabbar {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 20; justify-content: space-around; align-items: flex-end;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  }
  #tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 72px; min-height: 52px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
  #tabbar a[aria-current="page"] { color: var(--accent); }
  #tabbar .icon { width: 22px; height: 22px; }
  #tabbar a.tab-record { color: var(--text); }
  #tabbar .disc { width: 62px; height: 62px; border-radius: 50%; background: var(--record); box-shadow: 0 0 0 6px var(--record-ring); display: grid; place-items: center; margin-top: -22px; }
  #tabbar .disc::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
  body.has-tabbar main { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  body:not(.has-tabbar) .top.compact ~ main { padding-bottom: var(--sp-7); }
  body.has-tabbar .list-tools .record-cta, body.has-tabbar .list-tools .button[href="#/upload"], body.has-tabbar .list-tools .button[href="#/talk"] { display: none; }  /* the bar at the bottom has them */
  .list-tools .search { flex-basis: 100%; }
  .head { flex-wrap: wrap; }
}
.plain-form .upload-start { width: 100%; min-height: 52px; margin: var(--sp-2) 0 var(--sp-4); border-radius: 14px; font-size: var(--fs-md); }
.plain-form > .small { text-align: center; }
@media (max-width: 720px) {
  /* the header stays one line: the mode gives way, the menu button stays */
  .top.compact { flex-wrap: nowrap; gap: 8px; }
  .top.compact .brand { flex: none; }
  .top.compact .modebar { flex: 0 1 auto; min-width: 0; }
  .top.compact .modebar select { min-width: 0; width: 100%; text-overflow: ellipsis; }
  .top.compact #menu-button { flex: none; }
  /* the record page: short choices, so that the red button is seen without scrolling */
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  button.preset { align-items: center; text-align: center; padding: 10px 8px; }
  button.preset .small { display: none; }
  .plain-form .choices { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .plain-form .choice { padding: 8px 12px; font-size: 13.5px; line-height: 1.5; }
  .record-area { margin: var(--sp-3) 0; }
  .record-big .disc { width: 88px; height: 88px; }
  .record-big .disc::after { width: 30px; height: 30px; }
}
@media print { .tabrow, #tabbar { display: none !important; } }
/* on the record page itself the bar's button is "you are here", not a second red button */
#tabbar a.tab-record[aria-current="page"] .disc { background: var(--line-strong); box-shadow: 0 0 0 6px var(--surface-2); }
