/* English Classroom — one look for the whole site.
   --c1 (main colour) and --bg (background) are set per person in Settings; the rest is derived from them.
   Seasons (teacher only) swap the palette and add falling petals / leaves / snow in #decor (CSS-animated).
   Style: warm paper background, white cards, a soft serif for headings (Fraunces) and a friendly sans for text (Figtree). */

:root {
  --c1: #2f7a55;
  --bg: #f7f5f0;
  --ink: #1f2722;
  --muted: #6b716c;
  --card: #ffffff;
  --on-c1: #ffffff;
  --c1-soft: color-mix(in srgb, var(--c1) 11%, var(--card));
  --c1-tint: color-mix(in srgb, var(--c1) 5%, var(--card));
  --c1-deep: color-mix(in srgb, var(--c1) 78%, #000);
  --line: color-mix(in srgb, var(--ink) 10%, var(--card));
  --line-strong: color-mix(in srgb, var(--ink) 18%, var(--card));
  --hero: color-mix(in srgb, var(--c1) 8%, var(--card));
  --ok: #2f8a57; --ok-soft: #e4f3ea; --ok-ink: #1d5e3a;
  --bad: #c8463d; --bad-soft: #fbe9e7; --bad-ink: #8f2a23;
  --warn: #b7791f; --warn-soft: #fbf0dc; --warn-ink: #7a4f10;
  --info: #3a6ea5; --info-soft: #e6eef8; --info-ink: #24497a;
  --violet-soft: #eeeafb; --violet-ink: #4f3d99;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(40, 32, 20, .05), 0 6px 20px -12px rgba(40, 32, 20, .14);
  --shadow-lg: 0 24px 60px -20px rgba(30, 24, 14, .35);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
:root[data-season="spring"] { --c1: #b8507a; --bg: #fbf5f6; }
:root[data-season="summer"] { --c1: #b8740f; --bg: #fbf7ee; }
:root[data-season="autumn"] { --c1: #a9512b; --bg: #f9f4ee; }
:root[data-season="winter"] { --c1: #2f6690; --bg: #f3f6f9; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overflow-x: clip; }
h1, h2, h3, .t, .cred, p { overflow-wrap: anywhere; }
img, video { max-width: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px;
  min-height: 100vh; -webkit-tap-highlight-color: transparent; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, .display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; font-optical-sizing: auto; }
h3 { font-family: var(--font); font-weight: 650; margin: 0; letter-spacing: -.005em; }
h1 { font-size: 1.85rem; line-height: 1.15; } h2 { font-size: 1.2rem; line-height: 1.25; } h3 { font-size: 1rem; }
a { color: var(--c1-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
/* iPhones zoom into any text field under 16px and stay zoomed in, so form text is never smaller */
input, select, textarea { font-size: max(16px, 1em) !important; }
::selection { background: color-mix(in srgb, var(--c1) 22%, transparent); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-weight: 600; }
#decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; contain: strict; }
#decor .leaf { position: absolute; top: 0; will-change: transform; animation: leaf-fall linear infinite; }
#decor[data-dir="up"] .leaf { animation-direction: reverse; opacity: .7; }
#decor .leaf > span { display: block; opacity: .5; will-change: transform; animation: leaf-sway ease-in-out infinite alternate; }
@keyframes leaf-fall { from { transform: translate3d(0, -12vh, 0); } to { transform: translate3d(0, 112vh, 0); } }
@keyframes leaf-sway { from { transform: translate3d(-18px, 0, 0) rotate(-25deg); } to { transform: translate3d(18px, 0, 0) rotate(25deg); } }
/* The animation sets the position; without motion they simply rest where `top` puts them */
@media (prefers-reduced-motion: no-preference) { #decor .leaf { top: 0 !important; } }
#app { position: relative; z-index: 1; }

/* ---------- icons: <i class="i i-NAME"></i>, drawn in the current text colour ---------- */
.i { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-hangup { transform: rotate(135deg); }
.i-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v10a2 2 0 0 1-2 2h-4v-7H9v7H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.i-calendar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.i-users { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.i-book { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2zM22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.i-sparkles { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8zM19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E"); }
.i-folder { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.i-clipboard { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2M9 12h6M9 16h6'/%3E%3C/svg%3E"); }
.i-settings { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6'/%3E%3C/svg%3E"); }
.i-logout { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
.i-video { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='14' height='12' rx='2'/%3E%3Cpath d='m22 8-6 4 6 4z'/%3E%3C/svg%3E"); }
.i-video-off { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 16v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h2M9.7 6H15a1 1 0 0 1 1 1v3.3l1 1L22 8v8M2 2l20 20'/%3E%3C/svg%3E"); }
.i-mic { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v1a7 7 0 0 1-14 0v-1M12 18v4'/%3E%3C/svg%3E"); }
.i-mic-off { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 9v2a3 3 0 0 0 5.1 2.1M15 9.3V5a3 3 0 0 0-5.9-.8M17 16.9A7 7 0 0 1 5 11v-1M19 10v1a7 7 0 0 1-.1 1.2M12 18v4M2 2l20 20'/%3E%3C/svg%3E"); }
.i-phone { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E"); }
.i-flip { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-3l-2-3H9L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/%3E%3Cpath d='M9 13.5a3 3 0 0 1 5.2-2M15 13.5a3 3 0 0 1-5.2 2M14 9.5v2h-2M10 17.5v-2h2'/%3E%3C/svg%3E"); }
.i-expand { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E"); }
.i-shrink { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7'/%3E%3C/svg%3E"); }
.i-eye { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.i-eye-off { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10 10 0 0 1 12 4c6.5 0 10 8 10 8a17.6 17.6 0 0 1-2.2 3.2M6.6 6.6A17.4 17.4 0 0 0 2 12s3.5 8 10 8a9.7 9.7 0 0 0 5.4-1.6M14.1 14.1a3 3 0 1 1-4.2-4.2M2 2l20 20'/%3E%3C/svg%3E"); }
.i-refresh { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5'/%3E%3C/svg%3E"); }
.i-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-menu { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
.i-left { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.i-right { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
.i-upload { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12'/%3E%3C/svg%3E"); }
.i-download { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }
.i-x { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.i-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.i-pencil { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.8 2.8 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5z'/%3E%3C/svg%3E"); }
.i-trash { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E"); }
.i-card { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); }
.i-key { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6M15.5 7.5l3 3L22 7l-3-3'/%3E%3C/svg%3E"); }
.i-copy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E"); }
.i-scroll { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M19 12l-7 7-7-7'/%3E%3C/svg%3E"); }
.i-hangup { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E"); }
.i-search { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7.5'/%3E%3Cpath d='m20.5 20.5-4.2-4.2'/%3E%3C/svg%3E"); }
.i-clock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E"); }
.i-alert { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5M12 16.2h.01'/%3E%3C/svg%3E"); }
.i-star { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l2.85 5.78 6.37.93-4.61 4.49 1.09 6.35L12 17.35l-5.7 3 1.09-6.35-4.61-4.49 6.37-.93z'/%3E%3C/svg%3E"); }
.i-inbox { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); }
.i-file { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2.5H6.5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2.5V8h5.5'/%3E%3C/svg%3E"); }
.i-file-text { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2.5H6.5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2.5V8h5.5M15.5 13h-7M15.5 17h-7M10.5 9h-2'/%3E%3C/svg%3E"); }
.i-image { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2.5'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E"); }
.i-music { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E"); }
.i-globe { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M2.5 12h19M12 2.5a14.5 14.5 0 0 1 0 19M12 2.5a14.5 14.5 0 0 0 0 19'/%3E%3C/svg%3E"); }
.i-sun { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4'/%3E%3C/svg%3E"); }
.i-repeat { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m17 2 4 4-4 4'/%3E%3Cpath d='M3 11v-1a4 4 0 0 1 4-4h14'/%3E%3Cpath d='m7 22-4-4 4-4'/%3E%3Cpath d='M21 13v1a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.i-message { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M8 8.5h8M8 12.5h5'/%3E%3C/svg%3E"); }
.i-calendar-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M12 13.5v5M9.5 16h5'/%3E%3C/svg%3E"); }
.i-wallet { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5.5' width='19' height='14' rx='2.5'/%3E%3Cpath d='M2.5 9.5h19M16.5 14.5h1.5'/%3E%3C/svg%3E"); }
.i-check-circle { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m8.5 12.3 2.4 2.4 4.6-4.9'/%3E%3C/svg%3E"); }
.i-leaf { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E"); }
.i-flower { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 9.5C10 7.5 10 4.5 12 3c2 1.5 2 4.5 0 6.5zM12 14.5c2 2 2 5 0 6.5-2-1.5-2-4.5 0-6.5zM9.5 12c-2 2-5 2-6.5 0 1.5-2 4.5-2 6.5 0zM14.5 12c2-2 5-2 6.5 0-1.5 2-4.5 2-6.5 0z'/%3E%3C/svg%3E"); }
.i-snowflake { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M20.7 7 3.3 17M9.5 3.5 12 6l2.5-2.5M9.5 20.5 12 18l2.5 2.5M4.2 10.4l3.3-.9-.9-3.3M19.8 13.6l-3.3.9.9 3.3M6.6 17.7l.9-3.3-3.3-.9M17.4 6.3l-.9 3.3 3.3.9'/%3E%3C/svg%3E"); }
.i-sprout { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21v-8'/%3E%3Cpath d='M12 13c0-4-3-6-7.5-6 0 4 3 6 7.5 6z'/%3E%3Cpath d='M12 11c0-4 3-6.5 7.5-6.5 0 4-3 6.5-7.5 6.5z'/%3E%3C/svg%3E"); }
.i-chevron-down { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.i-send { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.i-user { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1'/%3E%3C/svg%3E"); }
.i-arrow { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-more { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.2'/%3E%3Ccircle cx='12' cy='12' r='1.2'/%3E%3Ccircle cx='19' cy='12' r='1.2'/%3E%3C/svg%3E"); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand b { font-family: var(--display); font-size: 1.08rem; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: color-mix(in srgb, var(--ink) 82%, var(--card));
  font-weight: 550; border: 0; background: none; cursor: pointer; width: 100%; text-align: left; position: relative; font-size: .97rem; }
.nav .i { font-size: 1.15rem; color: var(--muted); }
.nav:hover { background: var(--c1-tint); color: var(--ink); }
.nav.on { background: var(--c1-soft); color: var(--c1-deep); font-weight: 650; }
.nav.on .i { color: var(--c1-deep); }
.nav .count { margin-left: auto; background: var(--c1); color: var(--on-c1); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; line-height: 1.45; min-width: 20px; text-align: center; }
.nav-more { display: none; }
.side .spacer { flex: 1; }
.mechip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 4px; margin-top: 8px; border-top: 1px solid var(--line); }
.mechip > div:not(.avatar) { flex: 1; min-width: 0; line-height: 1.25; }
.mechip b { display: block; font-weight: 650; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mechip small { color: var(--muted); font-size: .8rem; }
.mechip .btn.icon { width: 36px; min-height: 36px; }
.main { padding: 30px clamp(16px, 3.2vw, 44px) 64px; max-width: 1200px; width: 100%; min-width: 0; }
.topbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; flex-direction: row; gap: 0;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 96%, transparent); }
  .side .brand, .side .spacer, .side [data-more], .side .mechip { display: none; }
  .nav-more { display: flex; }
  .nav { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; font-size: .7rem; font-weight: 600; padding: 4px 2px; text-align: center; justify-content: center; border-radius: 10px; color: var(--muted); }
  .nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .i { font-size: 1.3rem; width: 52px; height: 28px; padding: 4px 0; box-sizing: border-box; border-radius: 999px; -webkit-mask-size: 1.3rem; mask-size: 1.3rem; }
  .nav:hover { background: none; }
  .nav.on { background: none; color: var(--c1-deep); }
  .nav.on .i { background: var(--c1-deep); box-shadow: none; }
  .nav.on::before { content: ''; position: absolute; top: 4px; left: 50%; width: 52px; height: 28px; transform: translateX(-50%); border-radius: 999px; background: var(--c1-soft); z-index: -1; }
  .nav .count { position: absolute; top: 1px; left: calc(50% + 8px); margin: 0; }
  .main { padding: 14px 16px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 2px; }
  .topbar img { width: 28px; height: 28px; border-radius: 8px; }
  .topbar b { font-family: var(--display); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .avatar { width: 34px; height: 34px; font-size: .8rem; text-decoration: none; }
  .topbar a { text-decoration: none; }
  .nextup { gap: 10px 16px; }
  .nextup .time { font-size: 1.7rem; }
  h1 { font-size: 1.5rem; }
  .pagehead { gap: 8px; }
  .pagehead h1 { flex-basis: 100%; }
  .card { padding: 16px; }
  .hero { padding: 20px; }
}
.sheet-nav { display: grid; gap: 2px; }
.sheet-nav .nav { font-size: 1rem; flex-direction: row; justify-content: flex-start; text-align: left; flex: none; gap: 14px; padding: 13px 12px; border-radius: var(--radius-sm); color: var(--ink); }
.sheet-nav .nav .i { width: 1.15em; height: 1.15em; padding: 0; -webkit-mask-size: contain; mask-size: contain; }
.sheet-nav .nav:hover { background: var(--c1-tint); }
.sheet-nav .nav.on::before { display: none; }
.sheet-nav .nav .count { position: static; margin-left: auto; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flat { box-shadow: none; background: var(--c1-tint); border-color: transparent; }
.card > h2:first-child, .card > .row:first-child > h2 { margin-bottom: 4px; }
.hero { background: var(--hero); border: 1px solid color-mix(in srgb, var(--c1) 12%, var(--line)); border-radius: 18px; padding: 26px 28px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c1) 14%, transparent), transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.quote { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.12rem; color: color-mix(in srgb, var(--ink) 80%, var(--card)); margin: 0; max-width: 640px; line-height: 1.45; }
.chips-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips-sum a, .chips-sum span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none; }
.chips-sum a:hover { border-color: var(--line-strong); }
.chips-sum .i { color: var(--c1-deep); }
.chips-sum .warn .i { color: var(--warn); }
.pagehead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { margin-right: auto; }
.lead { color: var(--muted); margin: -10px 0 18px; max-width: 680px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
@media (max-width: 1000px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.item .grow { min-width: 130px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.bold { font-weight: 600; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; } .mb { margin-bottom: 12px; }
.sechead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sechead h2 { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-weight: 500; }
.empty .e { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--c1-tint); color: var(--c1-deep); font-size: 1.25rem; }
.empty .btn { margin-top: 12px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border-radius: var(--radius-sm); padding: 9px 16px;
  min-height: 42px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, border-color .15s, box-shadow .15s;
  background: var(--c1-soft); color: var(--c1-deep); white-space: nowrap; line-height: 1.15; font-size: .95rem; }
.btn:hover { background: color-mix(in srgb, var(--c1) 16%, var(--card)); }
.btn { max-width: 100%; }
@media (max-width: 640px) { .btn { white-space: normal; text-align: center; } .btn.lg { font-size: .98rem; padding: 10px 12px; min-height: 50px; } }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--c1); color: var(--on-c1); box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: color-mix(in srgb, var(--c1) 88%, #000); }
.btn.ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--c1-tint); border-color: color-mix(in srgb, var(--c1) 30%, var(--line-strong)); }
.btn.danger { background: var(--bad-soft); color: var(--bad-ink); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 18%, var(--card)); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.btn.quiet { background: none; color: var(--muted); padding-left: 10px; padding-right: 10px; }
.btn.quiet:hover { background: var(--c1-tint); color: var(--ink); }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: .875rem; border-radius: 9px; gap: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick .btn.primary { grid-column: 1 / -1; } }
.btn.lg { white-space: normal; text-align: center; min-height: 50px; padding: 12px 22px; font-size: 1.02rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.icon { padding: 0; width: 42px; }
.btn.sm.icon { width: 34px; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; background: color-mix(in srgb, var(--ink) 5%, var(--card)); border-radius: 11px; padding: 3px; gap: 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: none; border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); min-height: 34px; font-size: .9rem; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, var(--card)); font-size: .76rem; }
.seg button.on .n { background: var(--c1-soft); color: var(--c1-deep); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--c1-soft); color: var(--c1-deep); white-space: nowrap; line-height: 1.5; }
.badge.planned { background: var(--info-soft); color: var(--info-ink); }
.badge.done, .badge.checked, .badge.good { background: var(--ok-soft); color: var(--ok-ink); }
.badge.missed, .badge.overdue { background: var(--bad-soft); color: var(--bad-ink); }
.badge.cancelled, .badge.neutral { background: color-mix(in srgb, var(--ink) 7%, var(--card)); color: var(--muted); }
.badge.assigned, .badge.soon { background: var(--warn-soft); color: var(--warn-ink); }
.badge.submitted { background: var(--violet-soft); color: var(--violet-ink); }
.badge.live { background: var(--bad); color: #fff; }
.badge.live::before, .dot-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.stat b { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-weight: 550; font-size: .86rem; }
.stat.ok b { color: var(--ok); } .stat.bad b { color: var(--bad); } .stat.info b { color: var(--info); } .stat.warn b { color: var(--warn); }
.stat.flat { box-shadow: none; background: var(--c1-tint); border-color: transparent; }

/* list rows: divided by a thin inset line, highlighted on hover */
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 10px; border-radius: var(--radius-sm); background: transparent; min-width: 0; position: relative; }
.item + .item::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: 1px; background: var(--line); }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--c1-tint); }
.item.click:hover::before, .item.click:hover + .item::before { opacity: 0; }
.item .when { font-weight: 650; min-width: 60px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.item .when .small { font-weight: 500; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.item .s { color: var(--muted); font-size: .875rem; }
.item .note { flex-basis: 100%; margin: 2px 0 0; padding: 8px 12px; border-radius: 9px; background: var(--c1-tint); font-size: .9rem; white-space: pre-wrap; color: color-mix(in srgb, var(--ink) 85%, var(--card)); }
.card.item, .cards > .item { padding: 18px; background: var(--card); }
.card.item::before, .cards > .item::before { display: none; }
.card.item.click:hover { background: var(--card); border-color: color-mix(in srgb, var(--c1) 35%, var(--line)); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; background: var(--c1-soft); color: var(--c1-deep); flex: none; font-size: .9rem; letter-spacing: .02em; }
.avatar.sq { border-radius: 11px; }
.avatar.sm { width: 32px; height: 32px; font-size: .78rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar .i { font-size: 1.15rem; }

/* "Next up" — the next lesson today, big and obvious */
.nextup { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--c1); }
.nextup .time { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.nextup .info { flex: 1; min-width: min(220px, 100%); }
.nextup .info b { font-size: 1.08rem; }
.nextup.live { border-left-color: var(--bad); }

/* things that need the teacher's attention */
.attn .item .s .i { color: var(--warn); }

/* forms */
/* .f = a labelled form field (label or div) */
.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
label.f > span small, .f > span small { font-weight: 450; color: var(--muted); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--card); min-height: 44px; outline: none; font-weight: 400;
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 18%, transparent); }
.search { position: relative; display: block; min-width: 0; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 550; cursor: pointer; background: var(--card); user-select: none; font-size: .93rem; }
.chk:hover { border-color: color-mix(in srgb, var(--c1) 40%, var(--line-strong)); }
.chk input { accent-color: var(--c1); width: 16px; height: 16px; margin: 0; }
.chk:has(input:checked), .chk.on { border-color: var(--c1); background: var(--c1-soft); color: var(--c1-deep); }
.chk .i { color: var(--muted); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; background: var(--c1-tint); font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop .i { font-size: 1.5rem; color: var(--c1-deep); }
.drop:hover, .drop.over { border-color: var(--c1); color: var(--c1-deep); }
.drop.slim { flex-direction: row; justify-content: center; padding: 12px; }
.drop.slim .i { font-size: 1.1rem; }
.progress { height: 6px; border-radius: 99px; background: var(--c1-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--c1); width: 0; transition: width .2s; }
.cred { background: var(--c1-tint); border: 1px dashed var(--c1); border-radius: 12px; padding: 14px; font-family: ui-monospace, Menlo, monospace; font-size: .92rem; white-space: pre-wrap; }
.hint { font-size: .86rem; color: var(--muted); font-weight: 450; margin: 0; }
.hint b { color: var(--ink); font-weight: 600; }
.saved { font-size: .8rem; color: var(--muted); font-weight: 500; }
.filebadge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 9px; background: var(--c1-tint); border: 1px solid var(--line); font-size: .86rem; font-weight: 550; max-width: 100%; }
.filebadge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebadge button { border: 0; background: none; cursor: pointer; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.filebadge button:hover { background: var(--line); color: var(--ink); }

/* modal */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(940px, calc(100vw - 24px)); }
dialog.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
dialog.modal::backdrop { background: rgba(28, 24, 18, .45); }
.mhead { display: flex; align-items: center; gap: 10px; padding: 20px 22px 8px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.mhead h2 { margin-right: auto; font-size: 1.3rem; }
.mbody { padding: 6px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.mfoot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
.mfoot .left { margin-right: auto; }
.x { border: 0; background: color-mix(in srgb, var(--ink) 6%, var(--card)); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; color: var(--muted); }
.x:hover { background: color-mix(in srgb, var(--ink) 10%, var(--card)); color: var(--ink); }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; background: #23292a; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 550; box-shadow: 0 12px 32px -10px rgba(0,0,0,.45); animation: up .25s; pointer-events: auto; max-width: calc(100vw - 32px); }
.toast .i { flex: none; }
.toast.ok .i { color: #7fd6a2; }
.toast.bad { background: var(--bad-ink); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
@media (max-width: 860px) { #toasts { bottom: calc(92px + env(safe-area-inset-bottom)); } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(420px, 100%); padding: 32px; gap: 14px; }
.login .logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 6px; }
.error { color: var(--bad); font-weight: 600; min-height: 1.2em; font-size: .92rem; }

/* calendar */
.calbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.calbar h2 { min-width: 0; margin-right: auto; padding-left: 4px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month .dow { text-align: center; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 4px 0; letter-spacing: .04em; text-transform: uppercase; }
.cell { min-height: 108px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cell:hover { border-color: color-mix(in srgb, var(--c1) 40%, var(--line)); }
.cell.out { opacity: .45; }
.cell .d { font-weight: 600; font-size: .85rem; display: flex; justify-content: space-between; }
.cell .d span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cell.today .d span { background: var(--c1); color: var(--on-c1); }
.cell .n { display: none; }
.ev { font-size: .76rem; font-weight: 600; padding: 3px 7px; border-radius: 7px; background: var(--c1-soft); color: var(--c1-deep); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c1); }
.ev.planned { background: var(--info-soft); color: var(--info-ink); border-color: var(--info); }
.ev.done { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok); }
.ev.missed { background: var(--bad-soft); color: var(--bad-ink); border-color: var(--bad); }
.ev.cancelled { background: color-mix(in srgb, var(--ink) 6%, var(--card)); color: var(--muted); border-color: var(--line-strong); text-decoration: line-through; }
.ev.live { background: var(--bad); color: #fff; border-color: var(--bad-ink); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; min-height: 220px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wday.today { border-color: var(--c1); box-shadow: 0 0 0 1px var(--c1); }
.wday h3 { font-size: .88rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 0 2px 4px; }
.wday.today h3 > span:first-child { color: var(--c1-deep); }
.wday .ev { white-space: normal; font-size: .8rem; }
@media (max-width: 760px) {
  .cell { min-height: 58px; padding: 4px; }
  .cell .ev { display: none; }
  .cell .n { display: block; margin-top: auto; align-self: center; width: 6px; height: 6px; border-radius: 99px; background: var(--c1); font-size: 0; }
  .week { grid-template-columns: 1fr; }
  .wday { min-height: 0; }
}

/* library cards */
.plan { display: flex; flex-direction: column; gap: 12px; padding: 0; overflow: hidden; }
.plan > :not(.thumb) { padding: 0 18px; }
.plan > :last-child { padding-bottom: 18px; }
.plan .thumb { height: 84px; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 16px; position: relative;
  background: linear-gradient(135deg, hsl(var(--h) 45% 92%), hsl(calc(var(--h) + 30) 50% 88%)); color: hsl(var(--h) 35% 30%); }
.plan .thumb .i { font-size: 1.6rem; opacity: .8; }
.plan .thumb .star { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; background: rgba(255,255,255,.75); padding: 3px 9px; border-radius: 99px; }
.plan h3 { line-height: 1.3; font-size: 1.02rem; }
.score { font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.score.good { color: var(--ok); } .score.meh { color: var(--warn); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.checklist li { font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.checklist li .i { margin-top: .15em; }
.checklist li.pass .i { color: var(--ok); } .checklist li.fail .i { color: var(--warn); }
.steps { counter-reset: s; display: grid; gap: 16px; }
.step-card { position: relative; padding-left: 68px; }
.step-card::before { counter-increment: s; content: counter(s); position: absolute; left: 20px; top: 20px; width: 32px; height: 32px; border-radius: 50%; background: var(--c1-soft); color: var(--c1-deep); display: grid; place-items: center; font-family: var(--display); font-weight: 600; }
@media (max-width: 640px) { .step-card { padding-left: 16px; padding-top: 60px; } .step-card::before { left: 16px; top: 16px; } }
.prompt { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; min-height: 220px; background: var(--c1-tint) !important; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 50px; height: 50px; border-radius: 14px; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.sw.on { box-shadow: 0 0 0 2px var(--c1); }
.seasons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.season { border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px 6px 12px; background: var(--card); cursor: pointer; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .9rem; }
.season .i { font-size: 1.6rem; color: var(--muted); }
.season:hover { border-color: color-mix(in srgb, var(--c1) 40%, var(--line-strong)); }
.season.on { border-color: var(--c1); background: var(--c1-soft); color: var(--c1-deep); }
.season.on .i { color: var(--c1-deep); }
@media (max-width: 560px) { .seasons { grid-template-columns: repeat(3, 1fr); } }
.colorrow { display: flex; align-items: center; gap: 12px; }
.colorrow input[type=color] { width: 54px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; background: var(--card); cursor: pointer; }
table.t { width: 100%; border-collapse: collapse; min-width: 540px; }
table.t th { white-space: nowrap; }
table.t td:first-child { min-width: 170px; }
table.t b, table.t .small { overflow-wrap: normal; }
table.t th, table.t td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: .93rem; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t th { color: var(--muted); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tbody tr:hover td { background: var(--c1-tint); }
.scroll-x { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.only-narrow { display: none; }
@media (max-width: 640px) { .only-wide { display: none; } .only-narrow { display: block; }
  /* phones: lesson rows drop the avatar (the name is right there) so the text has room */
  .item .when + .avatar { display: none; } .item .when { min-width: 54px; } .item { gap: 6px 12px; } }
.only-narrow .item { flex-wrap: nowrap; }
.only-narrow .item .grow { min-width: 0; }
.only-narrow .item .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neg { color: var(--bad); font-weight: 650; }

/* viewer overlay (lesson preview, files) */
.viewer { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.viewer .vbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); }
.viewer .vbar b { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer iframe, .viewer .vcontent { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer .vcontent { display: grid; place-items: center; overflow: auto; padding: 16px; }
.viewer .vcontent img, .viewer .vcontent video { max-width: 100%; max-height: 100%; }

/* live banner on every page */
.livebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.livebar b { flex: 1; min-width: min(220px, 100%); }

/* live lesson room */
.room { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; z-index: 50; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.rbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.rbar .title { flex: 1; min-width: 0; line-height: 1.2; }
.rbar .title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbar .title small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbody { flex: 1; position: relative; min-height: 0; background: #fff; }
/* iPhones grow an iframe to fit its content instead of scrolling it; a scrolling wrapper and width:1px + min-width:100% stop that */
.frame-wrap { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.frame-wrap iframe { display: block; width: 1px; min-width: 100%; height: 100%; border: 0; background: #fff; }
.tile { position: absolute; right: 12px; bottom: 12px; width: 240px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #111816;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.55); z-index: 5; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #111816; pointer-events: none; }
.tile .me { position: absolute; right: 6px; bottom: 6px; width: 32%; height: auto; aspect-ratio: 4 / 3; border-radius: 8px; border: 2px solid rgba(255,255,255,.75); transform: scaleX(-1); }
.tile .me.back { transform: none; }
.tile .wait { position: absolute; inset: 0; display: grid; place-items: center; color: #e3ece7; font-weight: 600; text-align: center; padding: 12px; font-size: .85rem; pointer-events: none; }
.tile.big { left: 12px; top: 12px; right: 12px; bottom: 12px; width: auto; aspect-ratio: auto; cursor: default; }
.tile.big video.them { object-fit: contain; }
.tile.full { inset: 0; width: auto; aspect-ratio: auto; border-radius: 0; cursor: default; }
.tile.full video.them { object-fit: contain; }
.tile.hidden { display: none; }
.soundfix { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: auto; }
.rctrls { flex: none; display: flex; justify-content: center; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #161c1a; z-index: 6; }
.ctrl { flex: 0 1 76px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: #e7efe9; cursor: pointer; padding: 2px; font-size: .72rem; font-weight: 600; }
.ctrl .ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.13); font-size: 1.35rem; }
.ctrl:hover .ring { background: rgba(255,255,255,.2); }
.ctrl.off .ring { background: #fff; color: #161c1a; }
.ctrl.end .ring { background: var(--bad); color: #fff; }
.ctrl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.endsheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-radius: 20px 20px 0 0; padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px -10px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 10px; }
.endsheet[hidden] { display: none; }
.endsheet .btn { width: 100%; min-height: 50px; font-size: 1rem; }
@media (max-width: 640px) {
  .tile { width: 132px; right: 8px; bottom: 8px; border-radius: 12px; }
  .rbar .hide-sm { display: none; }
  .ctrl .ring { width: 46px; height: 46px; }
}
@media (max-width: 360px) { .ctrl .ring { width: 42px; height: 42px; } .ctrl { font-size: .66rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* while the call screen is open the page underneath must not scroll (iPhone) */
html.in-room, html.in-room body { overflow: hidden; height: 100%; }
.rpos { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rbar .btn.on { background: var(--c1-soft); color: var(--c1-deep); border-color: transparent; }

/* ---------- Lesson Builder ---------- */
.bld-head { flex-wrap: nowrap; }
.bld-title { flex: 1; min-width: 0; font-family: var(--display); font-size: 1.5rem !important; font-weight: 600; border: 1px solid transparent !important; background: transparent !important; padding: 4px 8px !important; }
.bld-title:hover { border-color: var(--line) !important; }
.bld-title:focus { border-color: var(--c1) !important; background: var(--card) !important; }
@media (max-width: 860px) { .bld-head { flex-wrap: wrap; } .bld-title { flex-basis: calc(100% - 60px); font-size: 1.25rem !important; } }
.bld { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .bld { grid-template-columns: minmax(0, 1fr); } }
.bld-steps { position: sticky; top: 16px; padding: 14px; }
@media (max-width: 1000px) { .bld-steps { position: static; } }
.bld-step { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.bld-step + .bld-step { margin-top: 2px; }
.bld-step:hover { background: var(--c1-tint); }
.bld-step.on { background: var(--c1-soft); }
.bld-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c1-soft); color: var(--c1-deep); font-weight: 700; font-size: .8rem; flex: none; }
.bld-step.on .n { background: var(--c1); color: var(--on-c1); }
.bld-step .grow { font-weight: 600; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bld-step small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.bld-tools .btn .i-left, .bld-tools .btn .i-right, .blk-head [data-move] .i { transform: rotate(90deg); }
.bld-main { min-width: 0; }
.bld-add { width: 100%; margin-top: 4px; }
.blk { padding: 0; overflow: hidden; margin-bottom: 12px; }
.blk-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.blk.open .blk-head { border-bottom: 1px solid var(--line); background: var(--c1-tint); }
.blk-name { border: 0; background: none; text-align: left; cursor: pointer; padding: 0; min-width: 0; }
.blk-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-name small { color: var(--muted); font-size: .8rem; }
.blk-body { padding: 16px; gap: 14px; }
.rows { display: grid; gap: 10px; }
.irow { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--c1-tint); }
.ino { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font-size: .78rem; font-weight: 700; flex: none; margin-top: 30px; }
.icols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.irow > .btn { margin-top: 26px; }
.opt-row { flex-wrap: nowrap; margin-bottom: 6px; }
.opt-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--ok); flex: none; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.tpl { position: relative; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.tpl:hover { border-color: var(--c1); background: var(--c1-tint); }
.tpl .avatar { grid-row: span 2; }
.tpl b { font-weight: 650; }
.tpl small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.tpl.mine { padding-right: 44px; }
.tpl-del { position: absolute; top: 8px; right: 8px; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* "Create a lesson" start page */
.create-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .create-grid { grid-template-columns: minmax(0, 1fr); } }
.create-main { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; cursor: pointer; padding: 26px; border: 2px solid color-mix(in srgb, var(--c1) 35%, var(--line)); background: var(--hero); font: inherit; color: inherit; }
.create-main:hover { border-color: var(--c1); }
.create-main b { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.create-main small { display: block; color: var(--muted); font-size: .98rem; line-height: 1.5; max-width: 520px; }
.create-main .btn { margin-top: auto; }
.create-side { display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; text-decoration: none; color: inherit; font: inherit; padding: 16px; }
.create-side:hover { border-color: color-mix(in srgb, var(--c1) 40%, var(--line)); }
.create-side > span:nth-child(2) { flex: 1; min-width: 0; }
.create-side b { display: block; font-weight: 650; }
.create-side small { display: block; color: var(--muted); font-size: .86rem; line-height: 1.4; }
/* live preview beside the editor */
.bld.with-preview { grid-template-columns: 240px minmax(0, 1fr) minmax(380px, 40%); }
.bld-preview { position: sticky; top: 16px; padding: 12px; display: flex; flex-direction: column; height: calc(100vh - 32px); }
.bld-preview .sechead { flex-wrap: wrap; gap: 4px 10px; }
.bld-preview iframe { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #f3f9ff; }
.gap-tools { margin-top: -6px; }

/* ---------- motion & hover ----------
   Everything here moves with transform / opacity only, so the browser never has to lay the page out again.
   Lifts and nudges only happen with a real mouse (hover: hover), so phones never get "stuck" hover looks. */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.5, .64, 1); }
.btn { transition: transform .25s var(--spring), background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .25s var(--ease), color .18s var(--ease); }
.btn .i, .nav .i, .tpl .avatar, .create-side .avatar, .season .i { transition: transform .3s var(--spring), color .18s var(--ease); }
.nav, .seg button, .item.click, .bld-step, .chk, table.t tbody tr td { transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease); }
.card.item.click, .create-main, .create-side, .tpl, .season, .cell, .chips-sum a { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease); }
.btn:not([disabled]):active { transform: translateY(0) scale(.96); transition-duration: .08s; }
.card.item.click:active, .create-main:active, .create-side:active, .tpl:active, .season:active { transform: scale(.985); transition-duration: .08s; }

@media (hover: hover) {
  .btn:not([disabled]):hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--c1) 60%, transparent); }
  .btn.primary:not([disabled]):hover, .btn.ok:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--c1) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16); }
  .btn.quiet:hover, .btn.icon.quiet:hover { box-shadow: none; }
  .btn:not([disabled]):hover .i { transform: scale(1.14) rotate(-8deg); }
  .btn:not([disabled]):hover .i-arrow, .btn:not([disabled]):hover .i-chevron-right, .btn:not([disabled]):hover .i-send { transform: translateX(3px); }
  .btn:not([disabled]):hover .i-plus { transform: rotate(90deg) scale(1.1); }
  .btn:active .i { transform: scale(.9); }
  .btn:not([disabled]):hover .i-hangup { transform: rotate(135deg) scale(1.1); }

  .nav:hover .i { transform: translateX(2px) scale(1.1); color: var(--c1-deep); }
  .nav.on:hover .i { transform: scale(1.1); }

  .card.item.click:hover, .create-side:hover, .tpl:hover, .season:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40, 32, 20, .04), 0 16px 30px -16px rgba(40, 32, 20, .3); }
  .create-main:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(40, 32, 20, .04), 0 22px 40px -18px color-mix(in srgb, var(--c1) 45%, transparent); }
  .tpl:hover .avatar, .create-side:hover .avatar, .season:hover .i { transform: scale(1.1) rotate(-6deg); }
  .cell:hover { box-shadow: 0 8px 20px -14px rgba(40, 32, 20, .35); }
  .chips-sum a:hover { transform: translateY(-1px); }
  .item.click:hover .t { color: var(--c1-deep); }
}

/* a new page eases in instead of popping */
.main.enter { animation: page-in .26s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
