/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../node_modules/.pnpm/next@14.2.35_@babel+core@7.29.0_@opentelemetry+api@1.9.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../node_modules/.pnpm/next@14.2.35_@babel+core@7.29.0_@opentelemetry+api@1.9.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

*, ::before, ::after{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop{
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

/*
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
*/

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/

dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/

:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.visible{
  visibility: visible;
}
.fixed{
  position: fixed;
}
.absolute{
  position: absolute;
}
.relative{
  position: relative;
}
.block{
  display: block;
}
.inline-block{
  display: inline-block;
}
.flex{
  display: flex;
}
.inline-flex{
  display: inline-flex;
}
.grid{
  display: grid;
}
.hidden{
  display: none;
}
.transform{
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.border{
  border-width: 1px;
}
.uppercase{
  text-transform: uppercase;
}
.italic{
  font-style: italic;
}
.tabular-nums{
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.underline{
  text-decoration-line: underline;
}
.outline{
  outline-style: solid;
}
.blur{
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.filter{
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition{
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.ease-in-out{
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Olimpio design tokens ──────────────────────────────────── */
:root {
  --olimpio-red:        rgb(179, 27, 37);
  --bg:                 rgb(241, 241, 239);
  --bg-sunken:          rgb(240, 241, 239);
  --surface:            rgb(255, 255, 255);
  --fg1:                rgb(0, 0, 0);
  --fg2:                rgb(45, 47, 46);
  --fg3:                rgb(63, 63, 63);
  --fg-muted:           rgb(90, 92, 90);
  --fg-hint:            rgb(93, 93, 93);
  --border:             rgb(232, 232, 230);
  --subj-math:             rgb(68, 131, 97);
  --subj-biology:          rgb(159, 107, 83);
  --subj-python:           rgb(51, 126, 169);
  --subj-physics:          rgb(212, 76, 71);
  --subj-chemistry:        rgb(193, 76, 138);
  --subj-ai-ml:            rgb(144, 101, 176);
  --subj-algorithms:       rgb(216, 118, 32);
  --subj-clay:             rgb(139, 100, 72);
  --subj-turquoise:        rgb(55, 132, 128);
  --subj-ocean:            rgb(47, 102, 140);
  --subj-navy:             rgb(59, 79, 138);
  --subj-indigo:           rgb(88, 82, 163);
  --subj-plum:             rgb(126, 82, 142);
  --subj-lavender:         rgb(145, 103, 156);
  --subj-burgundy:         rgb(135, 58, 76);
  --subj-brick:            rgb(173, 91, 67);
  --subj-amber:            rgb(194, 127, 42);
  --subj-olive-gold:       rgb(142, 128, 54);
  --subj-olive:            rgb(104, 123, 61);
  --subj-forest:           rgb(58, 108, 74);
  --subj-sage:             rgb(96, 138, 115);
  --subj-steel:            rgb(87, 116, 136);
  --subj-graphite-violet:  rgb(92, 86, 112);
  --status-urgent:      rgb(179, 27, 37);
  --status-warning:     rgb(255, 106, 0);
  --status-ok:          rgb(68, 131, 97);
  --shadow-card:        2px 4px 15px 0px rgba(0,0,0,0.2);
  --shadow-soft:        0px 1px 2px 0px rgba(0,0,0,0.05);
  --shadow-deep:        2px 4px 15px 0px rgba(0,0,0,0.3);
  --r-chip:             6px;
  --r-card:             12px;
  --r-card-lg:          16px;
  --r-bento:            24px;
  --r-pill:             9999px;
  --font-display:       "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body:          "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */
/* App-wide horizontal-overflow guard: no route should scroll sideways on
   small viewports. `clip` (not `hidden`) avoids creating a scroll container,
   so it does not break the sticky `.eh-top` header. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}
body {
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ── App shell — top nav ─────────────────────────────────────── */
.eh-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; gap: 24px;
  border-bottom: 1px solid var(--border); background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.eh-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.8px;
  text-decoration: none; color: var(--fg1);
}
.eh-nav { display: inline-flex; gap: 4px; }
.eh-nav a {
  font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -0.2px;
  color: var(--fg-muted); text-decoration: none;
  padding: 8px 14px; border-radius: var(--r-pill);
  transition: background 120ms ease, color 120ms ease;
}
.eh-nav a:hover { color: var(--fg1); background: rgba(0,0,0,0.04); }
.eh-nav a[aria-current="page"] { color: #fff; background: var(--fg3); }
.eh-top-right { display: inline-flex; align-items: center; gap: 12px; }
.eh-ai-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer;
  background: var(--fg1); color: #fff;
  border: 0; border-radius: var(--r-pill);
  padding: 8px 14px 8px 10px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; letter-spacing: -0.1px;
  box-shadow: var(--shadow-soft);
  transition: transform 80ms ease, background 120ms ease;
  font-family: var(--font-body);
}
.eh-ai-btn:hover { background: #1d1d1d; }
.eh-ai-btn:active { transform: scale(0.98); }
.eh-ai-btn .spark {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #f5e6c8 0%, #b3946d 100%);
  display: inline-flex; align-items: center; justify-content: center;
}
.eh-ai-btn .spark svg { width: 12px; height: 12px; color: #1d1d1d; }
.eh-ai-btn[aria-expanded="true"] { background: var(--olimpio-red); }
.eh-user {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; background: var(--surface);
  border: 1px solid var(--surface); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--fg2);
  text-decoration: none; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.eh-user:hover {
  background: var(--bg-sunken);
  border-color: var(--border);
}
.eh-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--subj-python); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.eh-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.eh-user-meta small { font-size: 10.5px; color: var(--fg-muted); font-weight: 500; }

/* ── Page layout ─────────────────────────────────────────────── */
.eh-page { max-width: 1280px; margin: 0 auto; padding: 24px 32px 80px; }
.eh-greet {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.eh-greet h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  letter-spacing: -0.7px; margin: 0;
}
.eh-greet h1 small {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  color: var(--fg-muted); display: block; margin-top: 4px; letter-spacing: 0;
}
.eh-grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 16px;
}
@media (max-width: 880px) { .eh-grid { grid-template-columns: 1fr; } }

/* ── Bottom nav ──────────────────────────────────────────────── */
/* Exactly one nav is visible at a time: header nav on desktop, bottom nav on mobile */
.eh-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}
.eh-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 8px 4px;
  min-height: 56px; text-decoration: none;
  color: var(--fg3); font-size: 11px; font-weight: 500;
  transition: color 120ms ease;
}
.eh-bottom-nav a[aria-current="page"] { color: var(--fg1); }
.eh-bottom-nav a svg { width: 22px; height: 22px; flex-shrink: 0; }

/* desktop: top nav on, bottom nav off */
@media (min-width: 721px) {
  .eh-nav { display: flex; }
  .eh-bottom-nav { display: none; }
}

/* mobile: top nav off, bottom nav on */
@media (max-width: 720px) {
  .eh-page { padding: 16px; }
  .eh-top { padding: 14px 16px; }
  .eh-greet h1 { font-size: 26px; }
  .eh-nav { display: none; }
  .eh-bottom-nav { display: flex; justify-content: space-around; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .eh-ai-btn span:not(.spark) { display: none; }
  .eh-ai-btn { padding: 6px; border: 1.5px solid rgba(255,255,255,0.18); border-radius: 50%; }
  .eh-user-meta { display: none; }
  .eh-user { padding: 4px; border-radius: 50%; }
}

/* ── Widget chrome ───────────────────────────────────────────── */
.eh-widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 18px 18px 14px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 10px; min-height: 280px;
}
.eh-w-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 0 4px 12px;
  border-bottom: 1px solid var(--border);
}
.eh-w-title-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eh-w-title {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: -0.3px; color: var(--fg1);
  display: inline-flex; align-items: center; gap: 8px;
}
.eh-w-stale {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--status-warning); background: rgba(255,106,0,0.1);
  padding: 2px 7px; border-radius: 999px;
}
.eh-w-sub { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.eh-w-link {
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  color: var(--fg-muted); text-decoration: none;
  padding: 4px 8px; border-radius: 6px; margin: -4px -4px 0 0;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 120ms ease, color 120ms ease;
}
.eh-w-link:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-w-link svg { width: 11px; height: 11px; }
.eh-w-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.eh-w-error {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 14px;
}
.eh-w-error-glyph {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(179,27,37,0.10); color: var(--olimpio-red);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.eh-w-error h4 { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin: 0; color: var(--fg1); }
.eh-w-error p { margin: 0; font-size: 12px; color: var(--fg-muted); max-width: 32ch; }
.eh-w-retry {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer;
  background: var(--fg1); color: #fff; border: 0;
  padding: 6px 14px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 12px; font-family: var(--font-body);
}
.eh-w-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--fg-muted); padding: 14px; text-align: center;
}
.skel {
  background: linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.10), rgba(0,0,0,0.04));
  background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; border-radius: 8px;
}
@keyframes skel { 0% { background-position: 0 0; } 100% { background-position: -200% 0; } }
.skel-row { display: flex; align-items: center; gap: 10px; padding: 8px; }
.skel-block { height: 14px; border-radius: 6px; }

/* ── Lessons widget ──────────────────────────────────────────── */
.eh-lesson {
  display: grid;
  grid-template-columns: minmax(0, auto) 12px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: background 120ms ease;
}
.eh-lesson:hover { background: var(--bg-sunken); }
.eh-lesson + .eh-lesson { border-top: 1px solid var(--border); border-radius: 0; padding-top: 14px; padding-bottom: 14px; }
.eh-lesson + .eh-lesson:hover { border-radius: 0; }
.eh-l-time { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; font-variant-numeric: tabular-nums; min-width: 0; }
.eh-l-time b { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--fg1); letter-spacing: -0.2px; }
.eh-l-time small { font-size: 10.5px; color: var(--fg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }
.eh-l-cta {
  font-size: 11px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.eh-l-color {
  width: 4px;
  border-radius: 3px;
  background: var(--course-color, var(--fg3));
  align-self: stretch;
  min-height: 2.75rem;
}
.eh-l-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; align-self: start; padding-top: 1px; }
.eh-l-cta-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}
.eh-l-name { font-weight: 600; font-size: 13.5px; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.eh-l-sub { font-size: 11.5px; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
.eh-l-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-hint); }
.eh-l-now {
  align-self: flex-start; font-size: 9.5px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: var(--olimpio-red); color: #fff; margin-top: 2px;
}
.eh-join {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer;
  background: var(--fg1); color: #fff; border: 0;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 12px; letter-spacing: -0.1px;
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body);
}
.eh-join:hover { background: #1d1d1d; }
.eh-join svg { width: 10px; height: 10px; }

/* ── Tasks widget ────────────────────────────────────────────── */
.eh-task {
  display: grid; grid-template-columns: 4px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 8px 8px 8px 0; border-radius: 12px;
  cursor: pointer; min-width: 0; text-decoration: none; color: inherit;
}
.eh-task + .eh-task { border-top: 1px solid var(--border); }
.eh-task:hover { background: var(--bg-sunken); }
.eh-task-bar { width: 4px; align-self: stretch; min-height: 36px; border-radius: 3px; background: var(--urg-color, var(--fg3)); margin-left: 4px; }
.eh-task-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eh-task-name { font-weight: 600; font-size: 13.5px; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-task-sub { font-size: 11.5px; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 6px; }
.eh-task-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-hint); }
.eh-due { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: var(--urg-color, var(--fg2)); background: var(--urg-bg, rgba(0,0,0,0.04)); white-space: nowrap; }
.eh-archive {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 4px 10px; font-size: 11.5px; font-weight: 600; color: var(--fg-muted);
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body);
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.eh-archive:hover { color: var(--fg1); border-color: var(--fg-muted); background: var(--surface); }
.eh-archive svg { width: 11px; height: 11px; }

/* ── Grades widget ───────────────────────────────────────────── */
.eh-grade-row {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 12px; align-items: center;
  padding: 8px; border-radius: 12px;
  cursor: pointer; text-decoration: none; color: inherit;
  transition: background 120ms ease;
}
.eh-grade-row + .eh-grade-row { border-top: 1px solid var(--border); border-radius: 0; }
.eh-grade-row:hover { background: var(--bg-sunken); }
.eh-mark-pill {
  min-width: 36px; height: 36px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: #fff; background: var(--mark-color, var(--fg3));
  font-variant-numeric: tabular-nums; letter-spacing: -0.3px;
}
.mark--6 { --mark-color: rgb(46, 130, 90); }
.mark--5 { --mark-color: rgb(68, 131, 97); }
.mark--4 { --mark-color: rgb(51, 126, 169); }
.mark--3 { --mark-color: rgb(216, 118, 32); }
.mark--2 { --mark-color: rgb(193, 76, 88); }
.mark--1 { --mark-color: rgb(179, 27, 37); }
.mark--np { --mark-color: rgb(125, 132, 141); }
.eh-grade-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eh-grade-subj { font-weight: 600; font-size: 13.5px; color: var(--fg1); display: inline-flex; align-items: center; gap: 6px; }
.eh-grade-subj .ccolor { width: 6px; height: 6px; border-radius: 50%; background: var(--course-color, var(--fg-muted)); }
.eh-grade-cat { font-size: 11.5px; color: var(--fg-muted); }
.eh-grade-date { font-size: 11.5px; color: var(--fg-muted); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.eh-grade-date b { color: var(--fg2); font-weight: 600; }

/* ── Courses widget ───────────────────────────────────────────── */
.eh-course-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 8px;
  border-radius: 12px;
}
.eh-course-row + .eh-course-row { border-top: 1px solid var(--border); border-radius: 0; }
.eh-course-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--course-color, var(--fg3));
}
.eh-course-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eh-course-name {
  font-weight: 600; font-size: 13.5px; color: var(--fg1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eh-course-section {
  font-size: 11.5px; color: var(--fg-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eh-course-link {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg-muted); text-decoration: none;
  flex-shrink: 0;
}
.eh-course-link:hover { background: var(--bg-sunken); color: var(--fg1); }

/* ── Avg widget ──────────────────────────────────────────────── */
.eh-avg-card { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.eh-avg-foot { display: flex; align-items: baseline; gap: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.eh-avg-big {
  font-family: var(--font-display); font-weight: 700;
  font-size: 64px; letter-spacing: -2px; line-height: 1;
  color: var(--mark-color, var(--fg1)); font-variant-numeric: tabular-nums;
}
.eh-avg-big small { font-size: 20px; color: var(--fg-muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.eh-avg-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.eh-avg-delta .glyph { font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.eh-avg-delta.up { color: var(--status-ok); }
.eh-avg-delta.down { color: var(--olimpio-red); }
.eh-avg-delta.same { color: var(--fg-muted); }
.eh-avg-delta-sub { font-size: 11px; color: var(--fg-muted); font-weight: 500; }
.eh-avg-context { font-size: 12px; color: var(--fg-muted); }

/* ── AI side panel ───────────────────────────────────────────── */
/* Stacking ladder: sticky header 5 · bottom nav 100 · floating bars (bulk,
   toasts) 110 · full-screen overlays (AI panel, modals) 200+. Full-screen
   overlays sit above the bottom nav so it can't cover their content. */
.eh-ai-overlay {
  position: fixed; inset: 0; background: rgba(13,15,14,0.32);
  backdrop-filter: blur(2px); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 200ms ease;
}
.eh-ai-overlay[data-open="true"] { opacity: 1; pointer-events: auto; }
.eh-ai-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw); background: var(--surface);
  box-shadow: var(--shadow-deep); z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1);
}
.eh-ai-panel[data-open="true"] { transform: translateX(0); }
.eh-ai-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.eh-ai-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}
.eh-ai-title .ai-name { display: block; }
.eh-ai-title small { display: block; font-weight: 500; font-size: 11px; color: var(--fg-muted); margin-top: 1px; letter-spacing: 0; }
.eh-ai-close {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer; background: transparent;
  border: 0; padding: 6px; border-radius: 50%; color: var(--fg-muted);
}
.eh-ai-close:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-ai-close svg { width: 18px; height: 18px; display: block; }
.eh-ai-context {
  padding: 10px 18px; background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--fg-muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.eh-ai-context b { color: var(--fg2); font-weight: 700; }
.ctx-pill {
  padding: 1px 7px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); font-weight: 600; font-size: 10.5px; color: var(--fg2);
}
.eh-ai-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.eh-ai-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 22px;
  text-align: left;
  padding-top: 4px;
  min-height: min(60vh, 420px);
}
.eh-ai-empty-hero {
  display: block;
}
.eh-ai-empty-copy { min-width: 0; flex: 1; }
.eh-ai-empty h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.35px;
  margin: 0 0 6px;
  color: var(--fg1);
  line-height: 1.25;
}
.eh-ai-empty p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0;
  max-width: none;
}
.eh-ai-empty-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.eh-ai-suggestions-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eh-ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.eh-ai-sugg {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  cursor: pointer;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg1);
  font-weight: 500;
  font-family: var(--font-body);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.eh-ai-sugg:hover {
  border-color: var(--fg-muted);
  background: var(--bg-sunken);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.eh-ai-sugg:focus-visible {
  outline: 2px solid var(--fg3);
  outline-offset: 2px;
}
.eh-msg { display: flex; flex-direction: column; max-width: 88%; gap: 4px; min-width: 0; }
.eh-msg.user { align-self: flex-end; }
.eh-msg.assistant { align-self: flex-start; }
.eh-msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.eh-msg.user .eh-msg-bubble { background: var(--fg1); color: #fff; border-bottom-right-radius: 6px; }
.eh-msg.assistant .eh-msg-bubble { background: var(--bg-sunken); color: var(--fg1); border-bottom-left-radius: 6px; }
.eh-msg.assistant.error .eh-msg-bubble { background: rgba(179,27,37,0.08); color: var(--olimpio-red); }
.eh-msg-meta { font-size: 10.5px; color: var(--fg-muted); padding: 0 4px; }
.eh-msg.user .eh-msg-meta { text-align: right; }
.eh-md { display: flex; flex-direction: column; gap: 8px; }
.eh-md p,
.eh-md h2,
.eh-md h3,
.eh-md ul,
.eh-md ol,
.eh-md blockquote,
.eh-md pre { margin: 0; }
.eh-md h2 { font-family: var(--font-display); font-size: 15px; line-height: 1.25; font-weight: 800; }
.eh-md h3 { font-family: var(--font-display); font-size: 13.5px; line-height: 1.3; font-weight: 800; }
.eh-md p { color: inherit; }
.eh-md ul,
.eh-md ol { list-style: none; padding: 0; }
.eh-md li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  padding: 2px 0;
}
.eh-md-bullet,
.eh-md-num { color: var(--fg-muted); font-weight: 700; }
.eh-md-content { min-width: 0; }
.eh-md-task-btn {
  width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-muted); border: 1px solid var(--border); text-decoration: none;
}
.eh-md-task-btn:hover { color: var(--fg1); background: var(--surface); }
.eh-md blockquote {
  border-left: 3px solid var(--border);
  padding-left: 10px;
  color: var(--fg2);
}
.eh-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 5px;
  padding: 1px 4px;
}
.eh-md pre {
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
}
.eh-md pre code { background: transparent; padding: 0; }
.eh-md hr { border: 0; border-top: 1px solid var(--border); width: 100%; }
.eh-typing {
  display: inline-flex; gap: 4px; padding: 12px 14px;
  background: var(--bg-sunken); border-radius: 18px; border-bottom-left-radius: 6px;
  align-self: flex-start;
}
.eh-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); animation: bounce 1.2s infinite ease-in-out; }
.eh-typing span:nth-child(2) { animation-delay: 0.15s; }
.eh-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-3px); opacity: 1; } }
.eh-ai-input {
  padding: 12px 18px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.eh-ai-input textarea {
  flex: 1; resize: none; -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 18px; padding: 10px 14px;
  font-family: var(--font-body); font-size: 13px; line-height: 1.4; color: var(--fg1);
  max-height: 120px; min-height: 38px;
}
.eh-ai-input textarea:focus { outline: none; border-color: var(--fg-muted); background: var(--surface); }
.eh-ai-send {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--fg1);
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.eh-ai-send:hover:not(:disabled) {
  background: var(--bg-sunken);
  border-color: var(--border);
  color: var(--fg1);
}
.eh-ai-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--fg-muted);
}
.eh-ai-send svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* ── Tasks page ──────────────────────────────────────────────── */
.eh-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 16px; flex-wrap: wrap;
}
.eh-page-title-row { display: inline-flex; align-items: center; gap: 12px; }
.eh-page-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 30px; letter-spacing: -0.6px;
  margin: 0; color: var(--fg1);
}
.eh-sync-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--fg2);
  cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none;
  transition: background 120ms ease, color 120ms ease;
}
.eh-sync-btn:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-sync-btn svg { width: 14px; height: 14px; }
.eh-sync-btn.is-busy svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eh-meta-tag {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600; color: var(--fg-muted);
  padding: 5px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  white-space: nowrap;
}

/* ── Filter bar ──────────────────────────────────────────────── */
.eh-filters {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}
.eh-filter-label {
  font-family: var(--font-body);
  font-weight: 600; font-size: 11.5px; letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0 4px 0 8px;
}
.eh-seg {
  display: inline-flex; padding: 3px;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}
.eh-seg button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0; background: transparent;
  font-family: var(--font-body);
  font-weight: 600; font-size: 13px;
  color: var(--fg-muted); padding: 6px 14px;
  border-radius: var(--r-pill); cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.eh-seg button[aria-pressed="true"] { background: var(--fg3); color: #fff; }
.eh-seg button:not([aria-pressed="true"]):hover { color: var(--fg1); }
.eh-select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  font-family: var(--font-body);
  font-weight: 600; font-size: 13px;
  color: var(--fg1);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  padding: 7px 30px 7px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5 6 7.5 9 4.5' stroke='%2363635F' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}
.eh-select:hover { border-color: var(--fg-muted); }
.eh-clear {
  margin-left: auto;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0; background: transparent;
  font-family: var(--font-body);
  font-weight: 600; font-size: 12.5px;
  color: var(--olimpio-red);
  padding: 6px 12px; border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.eh-clear:hover { background: rgba(179,27,37,0.08); }
.eh-clear svg { width: 11px; height: 11px; }

/* Mobile: stack the page-level filter toolbar vertically (each label above its
   full-width control) with a normal card radius — the pill radius looked wrong
   on the wrapped multi-row box. Scoped to `.eh-page > .eh-filters` so it does
   NOT touch the grades-history panel (nested under `.eh-history-layout`). */
@media (max-width: 720px) {
  .eh-page > .eh-filters {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--r-card);
  }
  .eh-page > .eh-filters .eh-seg { width: 100%; }
  .eh-page > .eh-filters .eh-seg button { flex: 1; }
  .eh-page > .eh-filters .eh-select { width: 100%; }
  .eh-page > .eh-filters .eh-clear { margin-left: 0; }
}

/* ── Task list (full page) ───────────────────────────────────── */
.eh-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-bento);
  overflow: hidden;
}
.eh-task-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center; gap: 16px;
  padding: 14px 18px 14px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 100ms ease;
  position: relative;
}
.eh-task-row:first-child { border-top: 0; }
.eh-task-row:hover { background: var(--bg-sunken); }
.eh-task-row::before {
  content: ""; position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 0; border-radius: 0 3px 3px 0;
  background: var(--urg-accent, transparent);
  transition: width 120ms ease;
}
.eh-task-row[data-urg="overdue"]::before,
.eh-task-row[data-urg="today"]::before,
.eh-task-row[data-urg="tomorrow"]::before { width: 3px; }
.eh-task-row[data-urg="overdue"]  { --urg-accent: var(--olimpio-red); }
.eh-task-row[data-urg="today"]    { --urg-accent: var(--status-warning); }
.eh-task-row[data-urg="tomorrow"] { --urg-accent: rgb(234, 179, 8); }
.eh-task-row.is-selected { background: rgba(51, 126, 169, 0.08); }
.eh-task-row.is-selected:hover { background: rgba(51, 126, 169, 0.12); }
.eh-check-slot {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 100ms ease;
}
.eh-task-row:hover .eh-check-slot,
.eh-task-row:focus-within .eh-check-slot,
.eh-list[data-bulk="true"] .eh-check-slot,
.eh-task-row.is-selected .eh-check-slot { opacity: 1; }
.eh-check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--fg-muted);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.eh-check.is-on { background: var(--fg1); border-color: var(--fg1); }
.eh-check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.eh-check.is-on svg { opacity: 1; }
.eh-task-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; letter-spacing: -0.2px;
  color: var(--fg1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eh-task-course {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg2); font-weight: 600;
}
.eh-task-course-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--course-color, var(--fg3));
}
.eh-task-due { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--fg-muted); font-weight: 500; }

/* Urgency chips */
.eh-urg {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.eh-urg-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.urg--today    { background: rgba(255,106,0,0.12); color: rgb(180, 75, 0); }
.urg--tomorrow { background: rgba(234, 179, 8, 0.14); color: rgb(133, 93, 6); }
.urg--overdue  { background: rgba(179,27,37,0.10); color: var(--olimpio-red); }
.urg--soon     { background: var(--bg-sunken); color: var(--fg2); }
.urg--ok       { background: rgba(68,131,97,0.10); color: var(--status-ok); }
.eh-archive-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--fg-muted);
  border-radius: 50%; cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.eh-task-row:hover .eh-archive-btn { color: var(--fg2); }
.eh-archive-btn:hover { background: rgba(0,0,0,0.06); color: var(--fg1); }
.eh-archive-btn svg { width: 14px; height: 14px; }

/* Task state / loading */
.eh-state {
  padding: 56px 28px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.eh-state h3 {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px; letter-spacing: -0.3px;
  margin: 0; color: var(--fg1);
}
.eh-state p { margin: 0; font-size: 13px; color: var(--fg-muted); max-width: 38ch; }
.eh-load-more {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px;
  color: var(--fg-muted); font-size: 12.5px; font-weight: 600;
}
.eh-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: var(--fg1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Floating bulk bar */
.eh-bulk {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 18px;
  background: var(--fg1);
  color: #fff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-deep);
  z-index: 110;
  animation: bulkIn 220ms cubic-bezier(.2,.8,.2,1);
}
@keyframes bulkIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.eh-bulk-count { font-family: var(--font-body); font-weight: 600; font-size: 13.5px; letter-spacing: -0.1px; }
.eh-bulk button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0; cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600; font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
}
.eh-bulk-archive { background: #fff; color: var(--fg1); }
.eh-bulk-archive:hover { background: var(--bg-sunken); }
.eh-bulk-cancel { background: transparent; color: rgba(255,255,255,0.7); }
.eh-bulk-cancel:hover { color: #fff; }

/* Toast stack */
.eh-toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 110;
}
.eh-toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-warning);
  box-shadow: var(--shadow-card);
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 320px;
  font-size: 13px;
  color: var(--fg1);
  animation: toastIn 220ms cubic-bezier(.2,.8,.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.eh-toast strong { display: block; margin-bottom: 2px; font-weight: 700; }

@media (max-width: 720px) {
  .eh-task-row { grid-template-columns: 24px 1fr auto; gap: 10px; }
  .eh-archive-btn { display: none; }
  /* Float the bulk bar and toasts above the fixed bottom nav (not behind it). */
  .eh-bulk { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px); }
  .eh-toast-stack { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px); }
}

/* ── Task detail page ────────────────────────────────────────── */

/* 1.1 — Breadcrumb + prev/next */
.eh-topnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.eh-crumbs {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 13px; color: var(--fg-muted);
  min-width: 0;
}
.eh-crumbs a {
  color: var(--fg-muted); text-decoration: none; font-weight: 600;
  padding: 4px 8px; margin: -4px 0 -4px -8px; border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.eh-crumbs a:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-crumbs .sep { color: var(--fg-hint); }
.eh-crumbs .cur {
  color: var(--fg1); font-weight: 600;
  max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eh-prevnext { display: inline-flex; gap: 6px; }
.eh-arrow {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer; color: var(--fg2); -webkit-appearance: none; -moz-appearance: none; appearance: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.eh-arrow:hover:not(:disabled) { background: var(--bg-sunken); border-color: var(--fg-muted); }
.eh-arrow:disabled { opacity: 0.4; cursor: not-allowed; }
.eh-arrow svg { width: 14px; height: 14px; }

/* 1.2 — Main card */
.eh-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); box-shadow: var(--shadow-soft);
  padding: 28px 32px;
  position: relative;
}
.eh-card[data-urg="overdue"]::before,
.eh-card[data-urg="today"]::before,
.eh-card[data-urg="tomorrow"]::before {
  content: ""; position: absolute; top: 24px; bottom: 24px; left: 0;
  width: 4px; border-radius: 0 4px 4px 0;
  background: var(--card-accent, var(--fg3));
}
.eh-card[data-urg="overdue"]  { --card-accent: var(--olimpio-red); }
.eh-card[data-urg="today"]    { --card-accent: var(--status-warning); }
.eh-card[data-urg="tomorrow"] { --card-accent: rgb(234, 179, 8); }

/* 1.3 — Status badge */
.eh-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.3px; text-transform: uppercase;
  margin-bottom: 14px;
}
.eh-status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--unsubmitted { background: rgba(179,27,37,0.10); color: var(--olimpio-red); }
.status--submitted   { background: rgba(51,126,169,0.12); color: rgb(35, 88, 122); }
.status--graded      { background: rgba(68,131,97,0.14); color: var(--status-ok); }
.status--unknown     { background: var(--bg-sunken); color: var(--fg-muted); }

/* 1.4 — Detail title & meta */
.eh-detail-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 28px; letter-spacing: -0.6px;
  margin: 0 0 12px;
  color: var(--fg1);
}
.eh-detail-meta {
  display: flex; flex-wrap: wrap; gap: 16px; row-gap: 8px;
  align-items: center;
  font-family: var(--font-body); font-size: 13px; color: var(--fg-muted);
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.eh-detail-meta strong { color: var(--fg1); font-weight: 600; }
.eh-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.eh-meta-item .label { color: var(--fg-muted); font-weight: 500; }
.eh-meta-course-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--course-color, var(--fg3)); }

/* 1.5 — Section heading & description */
.eh-section-h {
  font-family: var(--font-display);
  font-weight: 700; font-size: 13px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--fg-muted);
  margin: 22px 0 10px;
}
.eh-desc {
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.55;
  color: var(--fg1);
}
.eh-desc p { margin: 0 0 10px; }
.eh-desc ul { padding-left: 20px; margin: 6px 0 12px; }
.eh-desc li { margin: 3px 0; }
.eh-desc a { color: var(--olimpio-red); }
.eh-desc code { background: var(--bg-sunken); border-radius: 4px; padding: 1px 5px; font-size: 13px; }

/* 1.6 — Files grid */
.eh-files { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .eh-files { grid-template-columns: 1fr; } }
.eh-file {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-sunken);
  text-decoration: none; color: var(--fg1);
  transition: background 120ms ease, border-color 120ms ease;
}
.eh-file:hover { background: var(--surface); border-color: var(--fg-muted); }
.eh-file-ico {
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 700; font-size: 10.5px; letter-spacing: 0.2px;
  color: #fff;
}
.ico-pdf   { background: rgb(193, 76, 88); }
.ico-doc   { background: rgb(51, 126, 169); }
.ico-sheet { background: rgb(68, 131, 97); }
.ico-link  { background: var(--fg3); }
.ico-img   { background: rgb(144, 101, 176); }
.eh-file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.eh-file-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-file-sub  { font-size: 11.5px; color: var(--fg-muted); font-weight: 500; }

/* 1.7 — Action buttons */
.eh-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.eh-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0;
  font-family: var(--font-body);
  font-weight: 600; font-size: 13.5px;
  padding: 10px 16px; border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 120ms ease;
  text-decoration: none;
}
.eh-btn-primary   { background: var(--fg1); color: #fff; }
.eh-btn-primary:hover   { background: var(--fg3); }
.eh-btn-secondary { background: var(--surface); color: var(--fg1); border: 1px solid var(--border); }
.eh-btn-secondary:hover { background: var(--bg-sunken); }
.eh-btn:disabled  { opacity: 0.55; cursor: not-allowed; }
.eh-btn svg { width: 13px; height: 13px; }

/* 1.8 — Related lesson */
.eh-related-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.eh-related-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card-lg); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; position: relative;
}
.eh-related-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--course-color, var(--fg3));
}
.eh-rel-meta { display: flex; flex-direction: column; gap: 4px; }
.eh-rel-eyebrow {
  font-family: var(--font-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--fg-muted);
}
.eh-rel-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: -0.2px; color: var(--fg1);
}
.eh-rel-sub { font-size: 12px; color: var(--fg-muted); font-weight: 500; }

/* 1.9 — Other tasks rail */
.eh-other-rail {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.eh-other-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card-lg);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: var(--fg1);
  cursor: pointer; position: relative;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.eh-other-card:hover { border-color: var(--fg-muted); box-shadow: var(--shadow-soft); }
.eh-other-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--course-color, var(--fg3));
}
.eh-other-title {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.2px; color: var(--fg1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.3;
}
.eh-other-due {
  font-size: 11.5px; color: var(--fg-muted); font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .eh-card { padding: 22px 18px; }
  .eh-detail-title { font-size: 22px; }
}

/* ── Profile page (/account) ─────────────────────────────────────── */

/* Status badge — profile variants (.ok .warn .bad .muted) */
.eh-status-badge.ok   { background: rgba(68,131,97,0.10);  color: var(--status-ok); }
.eh-status-badge.warn { background: rgba(255,106,0,0.10);  color: var(--status-warning); }
.eh-status-badge.bad  { background: rgba(179,27,37,0.10);  color: var(--olimpio-red); }
.eh-status-badge.muted{ background: var(--bg-sunken);      color: var(--fg-muted); }

/* Section card */
.eh-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 18px 22px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 16px;
}
.eh-section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted);
  margin: 0; padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

/* Profile block */
.eh-profile { display: flex; align-items: center; gap: 18px; }
.eh-profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--subj-python); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: -0.5px; overflow: hidden; flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.eh-profile-avatar img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.eh-profile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eh-profile-name {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.4px; line-height: 1.15;
  overflow-wrap: break-word;
}
.eh-profile-row {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  flex-wrap: wrap;
  font-size: 13.5px; color: var(--fg-muted); font-weight: 500;
}
/* Long values (e-mail, raw class id) wrap by chunk, never per-character. */
.eh-profile-row > span { min-width: 0; overflow-wrap: break-word; }
.eh-profile-row b { color: var(--fg2); font-weight: 600; }
.eh-profile-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; color: var(--fg2);
  white-space: nowrap; flex: 0 0 auto;
}
.eh-profile-readonly {
  font-size: 11.5px; color: var(--fg-hint); margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.eh-profile-readonly svg { width: 11px; height: 11px; }
.eh-account-footer { overflow-wrap: break-word; }

/* Service rows */
.eh-service {
  display: grid; grid-template-columns: 36px 1fr;
  align-items: flex-start; gap: 14px; padding: 14px 0;
}
.eh-service + .eh-service { border-top: 1px solid var(--border); }
.eh-section-title + .eh-service { padding-top: 0; }
.eh-service-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-sunken); border: 1px solid var(--border);
  margin-top: 2px;
}
.eh-service-icon svg { width: 20px; height: 20px; }
.eh-service-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eh-service-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
}
.eh-service-name {
  font-weight: 600; font-size: 14.5px; color: var(--fg1);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eh-service-role {
  font-size: 12px; color: var(--fg-muted); font-weight: 500;
}
.eh-service-account {
  font-size: 12px; color: var(--fg-hint);
  overflow-wrap: break-word; min-width: 0;
}
.eh-service-status {
  font-size: 12px; color: var(--fg-muted); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap; min-width: 0;
}
.eh-status-meta {
  font-size: 11.5px; color: var(--fg-muted); font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word; min-width: 0;
}
.eh-service-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.eh-service-actions .eh-btn { padding: 6px 14px; font-size: 12.5px; }
.eh-service-header .eh-status-badge { white-space: nowrap; margin-bottom: 0; flex-shrink: 0; }

/* Extra button variants for profile */
.eh-btn-ghost { background: transparent; color: var(--fg-muted); }
.eh-btn-ghost:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-btn-danger { background: transparent; color: var(--olimpio-red); border: 1px solid rgba(179,27,37,0.30); }
.eh-btn-danger:hover { background: rgba(179,27,37,0.07); border-color: var(--olimpio-red); }
.eh-btn-warn { background: var(--status-warning); color: #fff; }
.eh-btn-warn:hover { background: #e25d00; }

/* Settings rows */
.eh-setting {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 14px; padding: 12px 0;
}
.eh-setting + .eh-setting { border-top: 1px solid var(--border); }
.eh-setting-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eh-setting-label { font-weight: 600; font-size: 14px; color: var(--fg1); }
.eh-setting-desc { font-size: 12.5px; color: var(--fg-muted); line-height: 1.4; }
.eh-setting-desc.hint { color: var(--olimpio-red); }
.eh-setting-quota { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.eh-quota-bar {
  flex: 1; height: 8px; min-width: 120px;
  background: var(--bg-sunken); border-radius: 999px; overflow: hidden;
}
.eh-quota-fill {
  height: 100%; border-radius: inherit;
  background: var(--quota-color, var(--fg1));
  transition: width 200ms ease;
}
.eh-quota-text {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.2px; color: var(--fg1);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.eh-quota-text small { font-size: 11px; color: var(--fg-muted); font-weight: 500; margin-left: 4px; }

/* Toggle switch */
.eh-toggle {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer; border: 0;
  width: 38px; height: 22px; padding: 0;
  background: var(--border); border-radius: 999px;
  position: relative; transition: background 160ms ease; flex-shrink: 0;
}
.eh-toggle::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 160ms cubic-bezier(0.32,0.72,0,1);
}
.eh-toggle[aria-checked="true"] { background: var(--fg1); }
.eh-toggle[aria-checked="true"]::before { transform: translateX(16px); }

/* Modal */
.eh-mod-overlay {
  position: fixed; inset: 0;
  background: rgba(13,15,14,0.45); backdrop-filter: blur(2px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 180ms ease;
}
.eh-mod-overlay[data-open="true"] { opacity: 1; pointer-events: auto; }
.eh-mod {
  background: var(--surface); border-radius: var(--r-bento);
  box-shadow: var(--shadow-deep);
  width: 100%; max-width: 440px;
  transform: translateY(8px) scale(0.98);
  transition: transform 200ms cubic-bezier(0.32,0.72,0,1);
  display: flex; flex-direction: column; max-height: 90vh; overflow: hidden;
}
.eh-mod-overlay[data-open="true"] .eh-mod { transform: translateY(0) scale(1); }
.eh-mod-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border);
}
.eh-mod-title-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eh-mod-title {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  letter-spacing: -0.4px; margin: 0;
}
.eh-mod-sub { font-size: 12.5px; color: var(--fg-muted); font-weight: 500; line-height: 1.4; }
.eh-mod-close {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; cursor: pointer; background: transparent;
  border: 0; padding: 4px; border-radius: 50%; color: var(--fg-muted);
}
.eh-mod-close:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-mod-close:disabled { opacity: 0.3; cursor: not-allowed; }
.eh-mod-close svg { width: 18px; height: 18px; }
.eh-mod-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.eh-field { display: flex; flex-direction: column; gap: 6px; }
.eh-field label { font-weight: 600; font-size: 12px; color: var(--fg2); letter-spacing: 0.2px; }
.eh-field input {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; padding: 10px 14px;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font-body); font-size: 13.5px; color: var(--fg1);
  transition: border-color 120ms ease, background 120ms ease;
}
.eh-field input:focus { outline: none; border-color: var(--fg-muted); background: var(--surface); }
.eh-field input[aria-invalid="true"] { border-color: var(--olimpio-red); background: rgba(179,27,37,0.04); }
.eh-field-error {
  font-size: 12px; color: var(--olimpio-red); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.eh-field-error::before {
  content: "!"; width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--olimpio-red); color: #fff;
  border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 10px;
}
.eh-mod-notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 10px; font-size: 12px; color: var(--fg2); line-height: 1.5;
}
.eh-mod-notice .ic {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--fg2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 10px;
  flex: 0 0 auto; margin-top: 1px;
}
.eh-mod-notice b { color: var(--fg1); font-weight: 700; }
.eh-mod-notice a { color: var(--fg1); font-weight: 600; text-decoration: underline; }
.eh-mod-notice a:hover { color: var(--olimpio-red); }
.eh-mod-notice code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11.5px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border); color: var(--fg1);
}
.eh-mod-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px 20px; border-top: 1px solid var(--border);
}
.eh-mod.danger .eh-mod-title { color: var(--olimpio-red); }

/* Modal spinner */
.eh-mod-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (max-width: 720px) {
  /* Stack the profile so the meta column gets full card width and a
     normal-length e-mail fits on one line (reflow blocks, not text). */
  .eh-profile { flex-direction: column; align-items: flex-start; gap: 12px; }
  .eh-profile-avatar { width: 56px; height: 56px; font-size: 20px; }
  .eh-profile-meta { width: 100%; }
  .eh-service { grid-template-columns: 36px 1fr; }
  /* Align the wrapped action button under the row's text (track 2),
     not under the icon, so the left edge stays straight. */
  .eh-service-actions { grid-column: 2 / -1; justify-content: flex-start; padding-top: 4px; }
  /* Stack settings rows: control drops below the label/description at full width. */
  .eh-setting { grid-template-columns: 1fr; justify-items: start; }
  .eh-setting-quota { min-width: 0; flex-wrap: wrap; }
  .eh-quota-bar { min-width: 0; }
}

/* ── Grades page (/grades) ───────────────────────────────────────── */

/* Status strip */
.eh-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 12px 10px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
}
.eh-status[data-tone="stale"]   { border-color: rgba(255,106,0,0.35);  background: rgba(255,106,0,0.05); }
.eh-status[data-tone="offline"] { border-color: rgba(179,27,37,0.35);  background: rgba(179,27,37,0.04); }
.eh-status-left { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.eh-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-ok); box-shadow: 0 0 0 3px rgba(68,131,97,0.18);
  flex: 0 0 auto;
}
.eh-status[data-tone="stale"]   .eh-status-dot { background: var(--status-warning); box-shadow: 0 0 0 3px rgba(255,106,0,0.18); }
.eh-status[data-tone="offline"] .eh-status-dot { background: var(--olimpio-red);    box-shadow: 0 0 0 3px rgba(179,27,37,0.18); }
.eh-status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.eh-status-text b     { font-weight: 700; font-size: 13px; color: var(--fg1); }
.eh-status-text small { font-size: 11.5px; color: var(--fg-muted); font-weight: 500; }
.eh-refresh {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--surface); color: var(--fg1);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  cursor: pointer; transition: background 120ms ease;
}
.eh-refresh:hover:not([disabled]) { background: var(--bg-sunken); }
.eh-refresh[disabled] { opacity: 0.6; cursor: not-allowed; }
.eh-refresh svg { width: 12px; height: 12px; }
.eh-refresh.is-busy svg { animation: spin 0.8s linear infinite; }

/* History link */
.eh-history-link {
  font-weight: 600; font-size: 13px;
  color: var(--fg2); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-pill);
}
.eh-history-link:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-history-link svg { width: 12px; height: 12px; }

/* Summary cards */
.eh-summary {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px; margin-bottom: 22px;
}
.eh-sumcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-soft);
  border-radius: var(--r-bento);
}
.eh-sumcard.best  { background: linear-gradient(180deg, rgba(68,131,97,0.06), var(--surface)); }
.eh-sumcard.alert { background: linear-gradient(180deg, rgba(179,27,37,0.05), var(--surface)); }
.eh-sumcard-eyebrow {
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted);
}
.eh-sumcard-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 36px; letter-spacing: -1.2px; line-height: 1;
}
.eh-sumcard-value small { font-size: 16px; font-weight: 600; color: var(--fg-muted); letter-spacing: 0; margin-left: 4px; }
.eh-sumcard-sub { font-size: 12.5px; font-weight: 500; color: var(--fg-muted); }
.eh-sumcard-sub strong { color: var(--fg1); font-weight: 700; }

/* Subject sections */
.eh-subjects { display: flex; flex-direction: column; gap: 10px; }
.eh-subj {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); overflow: hidden;
  transition: box-shadow 140ms ease;
}
.eh-subj.is-open { box-shadow: var(--shadow-soft); }
.eh-subj-head {
  display: grid; grid-template-columns: auto 1fr 124px 88px 116px auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  cursor: pointer; -webkit-user-select: none; -moz-user-select: none; user-select: none;
  width: 100%; background: transparent; border: 0; text-align: left;
  font-family: var(--font-body);
}
.eh-subj-head:hover { background: var(--bg-sunken); }
.eh-subj-color {
  width: 10px; height: 28px; border-radius: 5px;
  background: var(--course-color, var(--fg3));
}
.eh-subj-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; letter-spacing: -0.3px; color: var(--fg1);
  text-decoration: none; transition: color 120ms ease;
}
.eh-subj-name:hover { color: var(--olimpio-red); }
.eh-subj-count { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.eh-subj-recent { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; width: 100%; }
.eh-recent-mark {
  min-width: 24px; height: 24px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: -0.2px; color: #fff; background: var(--mark-color, var(--fg3));
  font-variant-numeric: tabular-nums;
}
.eh-recent-more {
  font-weight: 700; font-size: 14px;
  color: var(--fg-muted); padding: 0 4px; letter-spacing: 1px;
}
.eh-subj-avg {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 4px;
  justify-self: end;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--avg-color, var(--fg1));
}
.eh-subj-avg small { font-size: 11px; font-weight: 600; color: var(--fg-muted); letter-spacing: 0.2px; }

/* Predicted / final summary chip-pair in the subject header.
   `.is-block` is the larger variant used in the subject detail page rows. */
.eh-subj-summary-pair {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px;
  justify-self: end;
}
.eh-subj-summary-cell {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
}
.eh-subj-summary-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--fg-muted);
}
.eh-subj-summary-chip {
  min-width: 28px; height: 24px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
  letter-spacing: -0.2px; color: #fff; background: var(--mark-color, var(--fg3));
  font-variant-numeric: tabular-nums;
}
.eh-subj-summary-chip.mark--np {
  color: var(--fg-muted); background: var(--bg-sunken);
}
.eh-subj-summary-pair.is-block .eh-subj-summary-chip {
  min-width: 36px; height: 30px; font-size: 14px; border-radius: 9px;
}
.eh-subj-summary-pair.is-block .eh-subj-summary-label {
  font-size: 10.5px;
}

.eh-subj-chev {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-muted); transition: transform 160ms ease;
}
.eh-subj.is-open .eh-subj-chev { transform: rotate(180deg); color: var(--fg1); }
.eh-subj-chev svg { width: 12px; height: 12px; }

/* Grade list */
.eh-grades { border-top: 1px solid var(--border); padding: 6px 8px 10px; }
.eh-grade {
  display: grid; grid-template-columns: 56px 1fr 110px 100px;
  align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 10px;
}
.eh-grade + .eh-grade { border-top: 1px solid var(--border); margin-top: 2px; }
.eh-grade:hover { background: var(--bg-sunken); }
.eh-grade-mark {
  min-width: 44px; height: 44px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  letter-spacing: -0.4px; color: #fff;
  background: var(--mark-color, var(--fg3));
  font-variant-numeric: tabular-nums;
}
.eh-grade-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eh-grade-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.4px; text-transform: uppercase; color: var(--fg-muted);
}
.eh-grade-cat-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.eh-grade-comment {
  font-weight: 500; font-size: 13.5px;
  color: var(--fg1); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eh-grade-comment.empty { color: var(--fg-muted); font-style: italic; font-weight: 400; }
.eh-grade-weight { font-weight: 600; font-size: 12px; color: var(--fg-muted); }
.eh-grade-weight strong { color: var(--fg2); font-weight: 700; }
.eh-grade-date {
  font-weight: 600; font-size: 12px; color: var(--fg-muted);
  font-variant-numeric: tabular-nums; text-align: right;
}

/* Non-counting grade row (countsToAverage === false) — visible but de-emphasised. */
.eh-grade--no-avg .eh-grade-mark { opacity: 0.55; filter: grayscale(0.3); }
.eh-grade--no-avg .eh-grade-meta { opacity: 0.7; }
.eh-grade-no-avg-tag {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: lowercase;
  color: var(--fg-muted);
  background: rgba(127, 127, 127, 0.12);
  border-radius: 4px;
  white-space: nowrap;
}

/* Subject detail page — predicted/final block */
.eh-summary-block {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  background: var(--bg-sunken);
  border-radius: 12px;
  margin-bottom: 20px;
}
.eh-summary-row {
  display: grid; grid-template-columns: 100px 1fr;
  align-items: center; gap: 14px;
}
.eh-summary-row-label {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: -0.2px; color: var(--fg2);
}
.eh-summary-row .eh-subj-summary-pair { justify-self: start; gap: 18px; }

/* Mark color scale */
.mark--6 { --mark-color: rgb(46,130,90); }
.mark--5 { --mark-color: rgb(68,131,97); }
.mark--4 { --mark-color: rgb(51,126,169); }
.mark--3 { --mark-color: rgb(216,118,32); }
.mark--2 { --mark-color: rgb(193,76,88); }
.mark--1 { --mark-color: rgb(179,27,37); }

@media (max-width: 720px) {
  /* Summary cards become a horizontal swipeable carousel (next card peeks). */
  .eh-summary {
    display: flex; grid-template-columns: none;
    overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 12px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .eh-summary::-webkit-scrollbar { display: none; }
  .eh-sumcard { flex: 0 0 78%; scroll-snap-align: start; }

  /* Subject header → two rows (Variant A): name gets the full first row so the
     average pill no longer overlaps it; chips + chevron drop to row 2. */
  .eh-subj-head {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "color name avg"
      "color chips chev";
    row-gap: 8px;
  }
  .eh-subj-color { grid-area: color; align-self: stretch; height: auto; }
  .eh-subj-namecol { grid-area: name; }
  .eh-subj-avg { grid-area: avg; align-self: center; }
  .eh-subj-summary-pair { grid-area: chips; justify-content: flex-start; }
  .eh-subj-chev { grid-area: chev; }
  .eh-subj-recent { display: none; }
  .eh-subj-summary-pair { gap: 6px; }
  .eh-subj-summary-cell { gap: 1px; }
  .eh-subj-summary-chip { min-width: 24px; height: 22px; font-size: 12px; padding: 0 4px; }
  .eh-subj-summary-label { font-size: 9px; }
  .eh-grade { grid-template-columns: 48px 1fr auto; }
  .eh-grade-weight { display: none; }
}

/* ── Grades history page (/grades/history) ───────────────────────── */

.eh-history-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Filter cards */
.eh-history-layout > .eh-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: calc(var(--r-card) + 12px);
  padding: 12px 14px;
  overflow: hidden;
}
.eh-history-layout > .eh-filters > .eh-filter-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  width: 100%;
}
.eh-history-layout .eh-seg {
  display: flex;
  width: 100%;
}
.eh-history-layout .eh-seg button {
  flex: 1 1 0;
  padding: 6px 10px;
  text-align: center;
}
.eh-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eh-filter-label { font-weight: 700; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted); }
.eh-filter-actions { display: inline-flex; gap: 4px; }
.eh-filter-action {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 0; background: transparent;
  font-weight: 600; font-size: 11.5px; color: var(--fg-muted);
  padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.eh-filter-action:hover { background: var(--bg-sunken); color: var(--fg1); }
.eh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eh-chip {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border);
  background: var(--bg-sunken);
  font-weight: 600; font-size: 12px; color: var(--fg-muted);
  padding: 4px 8px 4px 6px; border-radius: var(--r-chip);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.eh-chip:hover { border-color: var(--fg-muted); }
.eh-chip[aria-pressed="true"] {
  background: var(--surface); color: var(--fg1);
  border-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--chip-color, var(--fg3));
}
.eh-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, var(--fg-muted)); opacity: 0.55; }
.eh-chip[aria-pressed="true"] .eh-chip-dot { opacity: 1; }

/* Chart card */
.eh-chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 18px 18px 8px;
  box-shadow: var(--shadow-soft);
  min-height: 480px; display: flex; flex-direction: column;
}
.eh-chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.eh-chart-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.eh-chart-meta { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.eh-chart-area { flex: 1; min-height: 380px; padding: 4px; position: relative; }

/* Chart skeleton */
.skel-chart {
  width: 100%; height: 380px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.10), rgba(0,0,0,0.04));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  position: relative;
}
.skel-chart::after {
  content: ""; position: absolute; inset: 20px 30px 30px 50px;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 24%);
}

/* Empty / error states */
.eh-empty, .eh-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 360px; text-align: center;
}
.eh-empty-glyph, .eh-error-glyph {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.eh-empty-glyph { background: var(--bg-sunken); color: var(--fg-muted); }
.eh-empty-glyph svg { width: 22px; height: 22px; }
.eh-error-glyph {
  background: rgba(179,27,37,0.10); color: var(--olimpio-red);
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
}
.eh-empty h3, .eh-error h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.3px; margin: 0; }
.eh-empty p, .eh-error p { margin: 0; font-size: 13px; color: var(--fg-muted); max-width: 38ch; }

/* Legend */
.eh-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 6px 6px; }
.eh-leg-chip {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600; font-size: 12px; color: var(--fg2);
  padding: 4px 8px 4px 6px; border-radius: var(--r-chip);
  display: inline-flex; align-items: center; gap: 6px;
}
.eh-leg-chip .swatch { width: 14px; height: 4px; border-radius: 2px; background: var(--leg-color, var(--fg-muted)); }
.eh-leg-chip.dashed .swatch {
  background: linear-gradient(to right, var(--leg-color) 0 4px, transparent 4px 7px, var(--leg-color) 7px 11px, transparent 11px 14px);
}

/* Tooltip */
.eh-tt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-card);
  padding: 10px 12px; font-size: 12.5px; color: var(--fg1);
  min-width: 220px;
}
.eh-tt-week {
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
  color: var(--fg-muted); letter-spacing: 0.3px;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.eh-tt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; }
.eh-tt-name { display: inline-flex; align-items: center; gap: 6px; }
.eh-tt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tt-color); }
.eh-tt-name b { font-weight: 600; color: var(--fg1); }
.eh-tt-val { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tt-color); }
.eh-tt-val.carried { opacity: 0.55; }
.eh-tt-val.carried::after { content: " \00b7"; opacity: 0.7; }
.eh-tt-val.gray { color: var(--fg-muted); }
.eh-tt-empty { font-style: italic; color: var(--fg-hint); font-size: 11.5px; }

/* Recharts axis style overrides */
.recharts-cartesian-axis-tick-value { font-family: var(--font-body) !important; font-size: 11.5px !important; fill: var(--fg-muted) !important; }
.recharts-cartesian-grid-horizontal line { stroke: var(--border) !important; }
.recharts-cartesian-grid-vertical line { stroke: transparent !important; }

@media (max-width: 720px) {
  .eh-history-layout { grid-template-columns: 1fr; }
  .eh-chart-area { min-height: 320px; }
}

/* ── Grade subject page (/grades/[subject]) ─────────────────────── */

/* Nav row — breadcrumb + prev/next */
.eh-navrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.eh-nav-prev-next { display: inline-flex; gap: 4px; }
.eh-nav-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border); background: var(--surface);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg2); transition: background 120ms ease;
}
.eh-nav-btn:hover:not(:disabled) { background: var(--bg-sunken); }
.eh-nav-btn:disabled { opacity: 0.35; cursor: default; }
.eh-nav-btn svg { width: 14px; height: 14px; }

/* Subject title */
.eh-subject-title { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.eh-subject-accent {
  width: 5px; border-radius: 3px; align-self: stretch;
  background: var(--course-color, var(--fg3)); flex-shrink: 0;
}
.eh-subject-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 26px; letter-spacing: -0.6px; line-height: 1.1;
}

/* Summary grid — 4 cards */
.eh-summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.eh-sumcard-sm {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-soft);
}
.eh-sumcard-label {
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted);
}
.eh-sumcard-val {
  font-family: var(--font-display); font-weight: 700;
  font-size: 28px; letter-spacing: -0.8px; line-height: 1;
  color: var(--mark-color, var(--fg1));
}
.eh-sumcard-val.plain { color: var(--fg1); }

/* Category breakdown */
.eh-breakdown {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 16px 18px;
  box-shadow: var(--shadow-soft); margin-bottom: 16px;
}
.eh-breakdown-title {
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted);
  margin-bottom: 12px;
}
.eh-bk-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.eh-bk-label { font-size: 13px; font-weight: 600; color: var(--fg2); min-width: 130px; }
.eh-bk-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-sunken); overflow: hidden; }
.eh-bk-fill {
  height: 100%; border-radius: 3px;
  background: var(--course-color, var(--fg3));
  transition: width 400ms ease;
}
.eh-bk-count { font-size: 12px; font-weight: 600; color: var(--fg-muted); min-width: 28px; text-align: right; }

/* What-if panel */
.eh-whatif {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 16px 18px;
  box-shadow: var(--shadow-soft); margin-bottom: 20px;
}
.eh-whatif-title {
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--fg-muted);
  margin-bottom: 14px;
}
.eh-whatif-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.eh-whatif-group { display: flex; flex-direction: column; gap: 8px; }
.eh-whatif-sublabel { font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.eh-grade-picker { display: inline-flex; gap: 4px; }
.eh-gp-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border); background: var(--bg-sunken);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--fg2); transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.eh-gp-btn:hover { border-color: var(--fg-muted); }
.eh-gp-btn[aria-pressed="true"] { background: var(--fg3); color: #fff; border-color: transparent; }
.eh-weight-stepper { display: inline-flex; align-items: center; gap: 8px; }
.eh-ws-btn {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border); background: var(--bg-sunken);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 18px; color: var(--fg2); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 100ms ease;
}
.eh-ws-btn:hover:not(:disabled) { background: var(--border); }
.eh-ws-btn:disabled { opacity: 0.35; cursor: default; }
.eh-ws-val { font-family: var(--font-display); font-weight: 700; font-size: 18px; min-width: 20px; text-align: center; }
.eh-wi-result {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--border);
}
.eh-wi-avg { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.5px; }
.eh-wi-delta { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.eh-wi-delta.up { color: rgb(46, 130, 90); }
.eh-wi-delta.down { color: rgb(179, 27, 37); }
.eh-wi-delta.flat { color: var(--fg-muted); }

/* Category filter row */
.eh-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.eh-cat {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none; border: 1px solid var(--border); background: var(--bg-sunken);
  font-weight: 600; font-size: 12.5px; color: var(--fg-muted);
  padding: 6px 12px; border-radius: var(--r-pill);
  cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.eh-cat:hover { border-color: var(--fg-muted); }
.eh-cat[aria-pressed="true"] {
  background: var(--surface); color: var(--fg1); border-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fg3);
}

/* Grade list for subject page */
.gs-grade-list { display: flex; flex-direction: column; gap: 8px; }
.gs-grade-row {
  display: grid; grid-template-columns: 44px 1fr auto auto;
  align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-bento); padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 720px) {
  .eh-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .gs-grade-row { grid-template-columns: 44px 1fr; }
}

/* ── Courses page ──────────────────────────────────────────────── */
.eh-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  min-width: 0;
}

/* New card design — equal height, footer pinned to bottom */
.eh-course-card2 {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 180ms ease, transform 180ms ease;
  min-width: 0;
  min-height: 232px;
}
.eh-course-card2:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  transform: translateY(-2px);
}
.eh-cc-accent {
  height: 4px;
  background: var(--accent, #4f7cff);
  flex-shrink: 0;
}
.eh-cc-main-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 0 18px;
  flex: 1 1 auto;
  min-height: 0;
}
.eh-course-card2 > .eh-cc-foot {
  padding-left: 0;
  padding-right: 0;
}
.eh-cc-avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 14px;
  text-transform: uppercase;
}
.eh-cc-body {
  flex: 1; min-width: 0;
  padding-top: 14px; padding-bottom: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.eh-cc-name {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--fg1); letter-spacing: -0.25px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.eh-cc-section {
  font-size: 12px; color: var(--fg-muted); font-weight: 500;
  line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eh-cc-foot {
  padding-top: 0;
  padding-bottom: 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
  min-width: 0;
}
.eh-cc-foot-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px 16px;
  min-width: 0;
}
/* All course-card actions on one horizontal row; wrap if width runs out. */
.eh-cc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.eh-cc-status {
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}
.eh-cc-status--muted {
  color: var(--fg-muted);
  font-weight: 500;
}
.eh-cc-status--ok {
  display: inline;
  color: var(--fg2);
  font-weight: 500;
}
.eh-cc-status-mark {
  color: var(--green, #27c483);
  font-weight: 700;
  margin-right: 4px;
}
.eh-cc-connect {
  flex-shrink: 0;
  white-space: nowrap;
}
/* Push archive/activate to the right end of the actions row. */
.eh-cc-archive,
.eh-cc-actions > .eh-btn-primary {
  margin-left: auto;
}
.eh-cc-classroom-btn {
  max-width: 100%;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--fg1);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 120ms ease, box-shadow 160ms ease;
}
.eh-cc-classroom-btn:hover {
  background: var(--fg3);
  color: #fff;
}
.eh-cc-archive {
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.eh-cc-archive:hover:not(:disabled) {
  color: var(--fg2);
  background: var(--bg-sunken);
}
.eh-cc-archive:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.eh-btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--fg2);
}
.eh-btn-ghost:hover:not(:disabled) { background: var(--bg-sunken); }
.eh-btn-sm { font-size: 12px; padding: 5px 12px; border-radius: var(--r-pill); }

/* Clickable link wrapper inside card */
.eh-cc-clickable {
  display: contents;
}
.eh-course-card2:has(.eh-cc-clickable:hover) {
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  transform: translateY(-2px);
}

/* Skeleton variant */
.eh-course-card2--skel { pointer-events: none; }

@media (max-width: 640px) {
  .eh-courses-grid { grid-template-columns: 1fr; }
  /* Course actions stay on one horizontal row; they wrap (not stack full-width). */
  .eh-cc-classroom-btn { flex-shrink: 1; min-width: 0; }
  /* Course filter tabs (Aktywne/Wszystkie/Archiwalne counts): even, full-width,
     so they line up and don't overflow on a phone. Scoped to the courses tablist
     (direct child of .eh-page) so it doesn't affect the tasks/history segments. */
  .eh-page > .eh-seg { display: flex; width: 100%; }
  .eh-page > .eh-seg button { flex: 1; min-width: 0; text-align: center; padding-left: 6px; padding-right: 6px; }
  /* Courses header: drop the count pill onto its own line, left-aligned under
     the title, instead of floating to the right and wrapping awkwardly. */
  .eh-page-head--stack { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Course detail page ──────────────────────────────────────────── */
.eh-cd-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.eh-cd-accent-bar {
  height: 5px;
  background: var(--accent, #4f7cff);
}
.eh-cd-header-body {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px 20px;
  flex-wrap: wrap;
}
.eh-cd-avatar {
  flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  letter-spacing: -0.5px;
}
.eh-cd-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.eh-cd-title {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: -0.4px; color: var(--fg1); margin: 0;
}
.eh-cd-section {
  font-size: 13px; color: var(--fg-muted); font-weight: 500;
}
.eh-cd-header-actions {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.eh-cd-task {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); margin-bottom: 6px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 150ms, transform 150ms;
  cursor: pointer;
}
.eh-cd-task:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.eh-cd-task-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.eh-cd-task-title {
  font-weight: 600; font-size: 14px; color: var(--fg1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eh-cd-task-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
@media (max-width: 640px) {
  .eh-cd-header-body { gap: 12px; }
  .eh-cd-header-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}

/* ── Schedule page ───────────────────────────────────────────── */
.sch-main { padding: 24px 32px 64px; }

/* Desktop: sch-controls is the visible pill; sch-ctrl-bar is transparent flex */
.sch-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 12px;
  background: rgb(255,255,255); border: 1px solid rgb(232,232,230);
  border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .sch-main { padding: 12px 12px 80px; }
  .sch-header { padding: 12px 16px; }
  .sch-header-nav { display: none; }
  .sch-header-user { display: none; }

  /* Mobile: sch-controls becomes transparent block; toggle sits above bar naturally */
  .sch-controls {
    display: block; background: transparent; border: none;
    box-shadow: none; padding: 0; margin-bottom: 10px; border-radius: 0;
    text-align: right;
  }

  /* Mobile: sch-ctrl-bar becomes the visible pill, sized to its content */
  .sch-ctrl-bar {
    display: inline-flex !important; align-items: center;
    gap: 8px; padding: 8px 10px; margin-top: 10px; margin-bottom: 20px;
    background: rgb(255,255,255); border: 1px solid rgb(232,232,230);
    border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }

  /* Mobile: lesson subject text wraps instead of truncating */
  .sch-lesson-subj {
    white-space: normal !important; overflow: visible !important;
    text-overflow: unset !important;
    overflow-wrap: break-word; hyphens: auto;
  }

  /* Mobile: lesson row switches to 2-column grid; action wraps below */
  .sch-lesson-row {
    grid-template-columns: 92px 1fr !important;
  }
  .sch-lesson-row > div:last-child { grid-column: 1 / -1; }
}

.focus-visible\:outline-none:focus-visible{
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-visible\:ring-2:focus-visible{
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.focus-visible\:ring-\[rgb\(37\2c 99\2c 235\)\]:focus-visible{
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity, 1));
}

.focus-visible\:ring-offset-2:focus-visible{
  --tw-ring-offset-width: 2px;
}

