/* Math tools hub — navy and teal, matching SAT Math 800 and Math Path */
:root {
  --bg: #f3f6f9; --card: #fff; --ink: #10243a; --ink-2: #51637a; --line: #dbe3ec;
  --navy: #0f2a44; --navy-2: #173d63; --teal: #297b7e; --teal-l: #e3f2f2; --sky: #83b7e6; --gold: #f2b705;
  --danger: #c8402f; --focus: #1f6fd1;
  --shadow: 0 1px 2px rgba(16, 36, 58, .06), 0 8px 24px rgba(16, 36, 58, .08);
  --shadow-up: 0 2px 4px rgba(16, 36, 58, .08), 0 16px 36px rgba(16, 36, 58, .14);
  --r: 22px;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1622; --card: #13212f; --ink: #e8f0f7; --ink-2: #a3b5c7; --line: #26384a;
    --teal-l: #173436; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); --shadow-up: 0 16px 36px rgba(0,0,0,.45);
    --focus: #8ab4f8; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1622; --card: #13212f; --ink: #e8f0f7; --ink-2: #a3b5c7; --line: #26384a;
  --teal-l: #173436; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); --shadow-up: 0 16px 36px rgba(0,0,0,.45);
  --focus: #8ab4f8; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--font); -webkit-tap-highlight-color: transparent; }
html.modal-open, html.modal-open body { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--card); padding: 10px 16px; border-radius: 10px; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-2); }

/* loading */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--teal); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; line-height: 1.2; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover:not(:disabled) { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #22686b; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 54px; padding: 12px 22px; font-size: 1.02rem; border-radius: 16px; }
.btn.small { min-height: 42px; padding: 8px 14px; font-size: .9rem; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ibtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); flex: none; }
.ibtn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.bar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.bar-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; }
.bar-brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.bar-brand b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-brand small { color: var(--ink-2); font-size: .78rem; }
.bar-actions { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .92rem; }
.pill.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill.on { background: var(--gold); border-color: var(--gold); color: #2b2100; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.primary { background: var(--teal); border-color: var(--teal); } }

main { max-width: 1120px; margin: 0 auto; padding: 16px 16px 120px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 28px; color: #fff; padding: 36px 28px; margin-top: 6px;
  background: radial-gradient(120% 140% at 100% 0%, #2a8c8f 0%, transparent 52%), radial-gradient(90% 120% at 0% 100%, #1f4f80 0%, transparent 60%), linear-gradient(150deg, #0f2a44, #10304e 60%, #0d2238);
  box-shadow: var(--shadow-up); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 28px 28px;
  mask-image: linear-gradient(120deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(120deg, #000, transparent 70%); }
.hero-in { position: relative; z-index: 1; display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .hero { padding: 56px 56px; } .hero-in { grid-template-columns: auto minmax(0, 1fr); gap: 52px; } }
.photo { justify-self: center; width: 176px; height: 176px; border-radius: 50%; padding: 5px; background: conic-gradient(from 210deg, #f2b705, #83b7e6, #3fb5b8, #f2b705); box-shadow: 0 18px 40px rgba(0,0,0,.35); animation: float 6s ease-in-out infinite; }
.photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; border: 4px solid #0f2a44; display: block; }
@media (min-width: 820px) { .photo { width: 220px; height: 220px; } }
@keyframes float { 50% { transform: translateY(-6px); } }
.hero-text { text-align: center; }
@media (min-width: 820px) { .hero-text { text-align: left; } }
.hello { margin: 0 0 4px; color: #a9d6d8; font-weight: 500; letter-spacing: .02em; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 700; }
.role { margin: 8px 0 0; color: #d6e4f2; font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; }
@media (min-width: 820px) { .role { justify-content: flex-start; } }
.role .dot { opacity: .6; }
.bio { margin: 16px auto 0; max-width: 60ch; color: #e8f0f7; font-size: 1.05rem; font-weight: 300; }
@media (min-width: 820px) { .bio { margin-left: 0; } }
.chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (min-width: 820px) { .chips { justify-content: flex-start; } }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-size: .88rem; }
.chips .ic { width: 16px; height: 16px; color: #7fe0c4; stroke-width: 2.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
@media (min-width: 820px) { .hero-cta { justify-content: flex-start; } }
.hero .btn.primary { background: var(--gold); border-color: var(--gold); color: #2b2100; }
.hero .btn.primary:hover { background: #ffc61f; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
@media (max-width: 520px) { .hero { padding: 30px 18px; border-radius: 24px; } .hero-cta .btn { width: 100%; } }

/* tools */
.tools { margin-top: 40px; outline: none; }
.sec-head { margin: 0 4px 18px; }
.sec-head h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
.sec-head p { margin: 6px 0 0; color: var(--ink-2); }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.tool { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; overflow: hidden; }
.tool::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--tc); }
.tool:has(a.t-main:hover) { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.tool:has(a.t-main:active) { transform: scale(.985); }
.t-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px 16px; padding: 26px 20px 20px; text-decoration: none; color: inherit; flex: 1; align-content: start; }
.t-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff; overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tc) 78%, #fff), var(--tc)); box-shadow: 0 8px 18px color-mix(in srgb, var(--tc) 40%, transparent); }
.t-icon .ic { width: 30px; height: 30px; stroke-width: 1.8; }
.t-icon img { width: 100%; height: 100%; object-fit: cover; }
.t-title { font-size: 1.25rem; font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-right: 40px; }
.badge { font-style: normal; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 14%, var(--card)); color: color-mix(in srgb, var(--tc) 80%, var(--ink)); }
.t-desc { grid-column: 1 / -1; color: var(--ink-2); font-size: .97rem; }
.t-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.t-tags span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.t-go { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-weight: 650; color: color-mix(in srgb, var(--tc) 85%, var(--ink)); }
.t-go:empty { display: none; }
.t-go .ic { transition: transform .18s; }
.tool:has(a.t-main:hover) .t-go .ic { transform: translateX(4px); }
.t-share { position: absolute; top: 24px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--ink-2); }
.t-share:hover { background: var(--bg); color: var(--teal); }
.empty { padding: 30px; text-align: center; color: var(--ink-2); border: 2px dashed var(--line); border-radius: var(--r); }

/* share section */
.share { margin-top: 44px; display: grid; gap: 18px; padding: 28px 22px; border-radius: 28px; background: linear-gradient(140deg, var(--teal-l), color-mix(in srgb, var(--sky) 18%, var(--card))); border: 1px solid var(--line); }
@media (min-width: 820px) { .share { grid-template-columns: auto minmax(0, 1fr); padding: 34px 40px; column-gap: 26px; } .share .share-row { grid-column: 1 / -1; } }
.share-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: #fff; color: #e2466b; box-shadow: var(--shadow); }
.share-art .ic { width: 32px; height: 32px; fill: #ffd5df; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.15); } }
.share h2 { font-size: clamp(1.35rem, 4vw, 1.75rem); }
.share p { margin: 6px 0 0; color: var(--ink-2); max-width: 62ch; }
.share-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sbtn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .94rem; text-align: left; transition: transform .12s, border-color .15s; }
.sbtn:active { transform: scale(.97); }
.sbtn:hover { border-color: currentColor; }
.sbtn .ic { width: 24px; height: 24px; }
.sbtn.wa .ic { color: #25d366; } .sbtn.tg .ic { color: #2aa3df; } .sbtn.fb .ic { color: #1877f2; } .sbtn.in .ic { color: #0a66c2; }
.sbtn.ml .ic, .sbtn.qr .ic, .sbtn.cp .ic { color: var(--teal); }
.sbtn.wa { border-color: color-mix(in srgb, #25d366 45%, var(--line)); }

/* footer */
.foot { max-width: 1120px; margin: 0 auto; padding: 24px 16px calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--ink-2); font-size: .88rem; }
.foot p { margin: 0; }
.foot .ats { height: 56px; width: auto; background: #fff; border-radius: 12px; padding: 6px 10px; }
.admin-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font-size: .85rem; opacity: .75; }
.admin-link .ic { width: 16px; height: 16px; }
.admin-link:hover { opacity: 1; color: var(--teal); }

/* floating share button */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font-weight: 650; box-shadow: 0 10px 28px rgba(15, 42, 68, .4); animation: fab-in .5s 1.2s both cubic-bezier(.2, .8, .2, 1.2); }
.fab::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(41, 123, 126, .6); animation: ping 2.6s 2.2s 3; }
.fab:active { transform: scale(.96); }
@keyframes fab-in { from { opacity: 0; transform: translateY(30px) scale(.8); } }
@keyframes ping { 70% { box-shadow: 0 0 0 16px rgba(41, 123, 126, 0); } 100% { box-shadow: 0 0 0 0 rgba(41, 123, 126, 0); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fab { background: var(--teal); } }

/* modal, sheet and toast */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 32, .55); backdrop-filter: blur(3px); animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--card); border-radius: 24px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: rise .25s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { max-width: 640px; }
.modal.narrow { max-width: 400px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.modal h2 { font-size: 1.35rem; }
.modal > p { margin: 10px 0 0; }
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.mfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .overlay { place-items: end center; padding: 0; }
  .modal { max-width: none !important; border-radius: 24px 24px 0 0; max-height: 92dvh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -8px auto 12px; }
  .mfoot .btn { flex: 1; }
  @keyframes up { from { transform: translateY(100%); } }
}
.sheet .share-row { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet .btn.wide { margin-top: 10px; }
.linkbox { display: flex; gap: 8px; margin-top: 16px; padding: 6px 6px 6px 14px; border: 1.5px solid var(--line); border-radius: 14px; align-items: center; }
.linkbox input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink-2); font-size: .92rem; }
.qrbox { display: grid; justify-items: center; gap: 12px; margin-top: 16px; min-height: 200px; place-content: center; }
.qrbox img { width: 260px; height: 260px; border-radius: 12px; border: 1px solid var(--line); image-rendering: pixelated; }
.qr-url { margin: 0; font-size: .85rem; color: var(--ink-2); word-break: break-all; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 10px 28px rgba(0,0,0,.25); text-align: center; animation: rise .25s; transition: opacity .5s; }
.toast.go { opacity: 0; }

/* forms */
.lbl { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .94rem; }
.lbl small { font-weight: 400; color: var(--ink-2); }
.inp { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16px; }
textarea.inp { resize: vertical; line-height: 1.5; }
.inp:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent); }
.hint { margin: 6px 0 0; font-size: .84rem; color: var(--ink-2); }
.err { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); font-weight: 600; }
#signin .btn { margin-top: 18px; }
.two { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.sub { margin: 24px 0 0; font-size: 1.05rem; padding-top: 18px; border-top: 1px solid var(--line); }
.photo-edit { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.photo-edit img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); background: #fff; }
.photo-edit > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pick { border: 0; padding: 0; margin: 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.icon-grid label, .color-grid label { position: relative; }
.icon-grid input, .color-grid input[type=radio] { position: absolute; opacity: 0; inset: 0; }
.icon-grid span { display: grid; place-items: center; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; }
.icon-grid input:checked + span { border-color: var(--teal); background: var(--teal-l); color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
.icon-grid input:focus-visible + span, .color-grid input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.own-img { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.t-icon.preview { width: 52px; height: 52px; border-radius: 16px; }
.color-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.color-grid span { display: block; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.color-grid input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.color-grid .custom input { width: 44px; height: 44px; border: 0; border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-top: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); }

/* admin editing */
.editing .hero { outline: 3px dashed rgba(242, 183, 5, .7); outline-offset: 4px; }
.edit-fab { position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--gold); color: #2b2100; font-weight: 650; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.tool.is-hidden { opacity: .55; }
.t-admin { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 16px 16px; border-top: 1px dashed var(--line); background: color-mix(in srgb, var(--gold) 6%, var(--card)); }
.hidden-note { margin-right: auto; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.add-tool { width: 100%; margin-top: 16px; min-height: 84px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: var(--r); border: 2.5px dashed color-mix(in srgb, var(--teal) 50%, var(--line)); background: color-mix(in srgb, var(--teal) 5%, transparent); color: var(--teal); font-weight: 650; font-size: 1.05rem; }
.add-tool:hover { background: var(--teal-l); }
.adminbar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; width: min(960px, calc(100% - 20px)); display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-radius: 20px; background: var(--navy); color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.ab-text { display: flex; flex-direction: column; line-height: 1.3; }
.ab-text span { font-size: .82rem; color: #b9cbe0; }
.ab-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adminbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.adminbar .btn.primary { background: var(--gold); border-color: var(--gold); color: #2b2100; }
@media (max-width: 600px) { .adminbar { border-radius: 18px; } .ab-actions { width: 100%; } .ab-actions .btn { flex: 1; padding: 8px 10px; } .ab-actions .btn span { display: none; } .ab-actions .btn:has(span) { flex: 0 0 auto; } }
.editing ~ .foot { padding-bottom: 180px; }

@media (max-width: 420px) { .bar-brand small { display: none; } .pill { padding: 0 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* one share button at a time: the floating one on phones (easy to reach), the top one on big screens */
@media (max-width: 899px) { .bar .pill.primary { display: none; } }
@media (min-width: 900px) { .fab { display: none; } }

html:has(.adminbar) .toast { bottom: auto; top: calc(76px + env(safe-area-inset-top)); }

/* site admin box (admin only) */
.adminbox { margin-top: 20px; padding: 16px 20px; border: 2px dashed color-mix(in srgb, var(--gold) 70%, var(--line)); border-radius: var(--r); background: var(--card); }
.adminbox h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.adminbox p { margin: 4px 0 12px; }
.ab-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* "Are you a teacher?" section (same look as the share section) */
.teach { margin-top: 22px; background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 16%, var(--card)), var(--card)); }
.teach-art { color: var(--teal); }
.teach-art .ic { fill: none; animation: none; }
.teach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
@media (min-width: 820px) { .teach .teach-actions { grid-column: 1 / -1; } }
.row2 { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }

/* home page polish: grade filter, even cards, clear Open buttons */
.grade-bar { display: flex; gap: 8px; margin: -4px 4px 20px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.grade-bar::-webkit-scrollbar { display: none; }
.gchip { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: .92rem; transition: background .15s, border-color .15s, color .15s; }
.gchip:hover { border-color: var(--teal); color: var(--teal); }
.gchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gchip.on { background: var(--teal); border-color: var(--teal); } }
:root[data-theme="dark"] .gchip.on { background: var(--teal); border-color: var(--teal); }
@media (min-width: 1000px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.t-main { grid-template-rows: auto 1fr auto auto; }
.t-desc { align-self: start; }
.t-go { margin-top: 6px; }
.t-open { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px 0 18px; border-radius: 999px; color: #fff; background: var(--tc); box-shadow: 0 6px 14px color-mix(in srgb, var(--tc) 30%, transparent); }
.t-open .ic { width: 18px; height: 18px; transition: transform .18s; }
.tool:has(a.t-main:hover) .t-open .ic { transform: translateX(4px); }
.tool { animation: card-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .tool, .photo, .fab, .share-art .ic { animation: none !important; } .tool:has(a.t-main:hover) { transform: none; } }

/* teacher "My classes" */
.ctable { overflow-x: auto; margin: 12px 0 18px; }
.ctable table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ctable th, .ctable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ccode { font-size: 1.1rem; letter-spacing: .06em; color: var(--teal); }
.ccode.big { font-size: 1.6rem; }
#newclass h3 { margin: 18px 0 4px; }
.ctable .c-act { white-space: nowrap; }
.ctable .c-act .btn { margin-right: 8px; }
.ctable .c-act .ibtn { vertical-align: middle; }
.modal .muted.small { font-size: .9rem; }
.cqr { min-height: 240px; margin-top: 10px; }
.cqr img { width: 240px; height: 240px; }
.cfoot { margin-top: 16px; }
.modal.board { max-width: 920px; text-align: center; }
.board-qr { display: grid; place-items: center; min-height: 260px; margin-top: 8px; }
.board-qr img { width: min(62vh, 82vw, 560px); height: auto; aspect-ratio: 1; border-radius: 12px; image-rendering: pixelated; }
.board-code { margin: 14px 0 0; }
.board-code .ccode { font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: .08em; }
.board-how { color: var(--ink-2); }
.board .cfoot { justify-content: center; }
@media (max-width: 600px) {   /* My classes on a phone: one card per class instead of a wide table */
  .ctable thead { display: none; }
  .ctable table, .ctable tbody { display: block; }
  .ctable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name code" "sub prog" "act act"; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ctable td { display: block; padding: 2px 0; border: 0; }
  .ctable .c-name { grid-area: name; font-weight: 700; } .ctable .c-code { grid-area: code; text-align: right; }
  .ctable .c-sub { grid-area: sub; color: var(--ink-2); font-size: .88rem; } .ctable .c-prog { grid-area: prog; text-align: right; }
  .ctable .c-act { grid-area: act; display: flex; gap: 8px; margin-top: 6px; } .ctable .c-act .btn { flex: 1; margin: 0; }
}

/* Math Path chooser page */
.chooser-hero .hero-text { text-align: left; max-width: 640px; }
.codebox { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.codebox .inp { flex: 1 1 220px; min-height: 54px; font-size: 1.1rem; letter-spacing: .04em; text-transform: uppercase; }
.chooser-hero .err { color: #ffd2cb; margin: 10px 0 0; }
.grade-h { margin: 22px 4px 12px; font-size: 1.15rem; color: var(--ink-2); }
.t-code { font-size: .95rem; letter-spacing: .02em; }
.t-code.long { font-size: .74rem; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* the RiseToExcel brand (docs/BRAND.md) */
.rte-mark { width: 40px; height: 40px; flex: none; display: block; }
.bar-brand .rte-mark { border-radius: 11px; box-shadow: 0 2px 8px rgba(15,42,68,.18); }
.brandline { margin: 0 0 10px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; font-size: 1.15rem; color: #fff; }
.brandline .rte-mark { width: 34px; height: 34px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); border-radius: 10px; }
.founder { margin: 10px 0 0; font-size: 1.12rem; font-weight: 600; color: #f6d26b; letter-spacing: .01em; }
.founder-card { margin: 0; display: grid; justify-items: center; gap: 12px; }
.founder-card figcaption { font-size: .95rem; font-weight: 600; color: #fff; text-align: center; max-width: 220px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: .95rem; }
.foot-brand .rte-mark { width: 28px; height: 28px; }

/* Mr. Khaled's YouTube channel (1 Nov 2026): the band on the main page; the Videos page adds videos/videos.css */
:root { --yt: #e0352b; }
.btn.ytbtn { background: var(--yt); border-color: var(--yt); color: #fff; }
.btn.ytbtn:hover:not(:disabled) { background: #c22a21; border-color: #c22a21; }
.pill.yt { background: var(--yt); border-color: var(--yt); color: #fff; text-decoration: none; }
.pill.yt:hover { background: #c22a21; }
.ytband { margin-top: 44px; display: grid; gap: 22px; align-items: center; padding: 28px 22px; border-radius: 28px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(110% 140% at 100% 0%, rgba(224, 53, 43, .45) 0%, transparent 55%), linear-gradient(150deg, #0f2a44, #13324f 60%, #0d2238); box-shadow: var(--shadow-up); }
@media (min-width: 900px) { .ytband { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); padding: 36px 40px; } }
.yt-kicker { margin: 0 0 8px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #ffd9d6; font-size: .92rem; }
.yt-kicker .ic { width: 28px; height: 28px; color: #ff4e45; }
.ytband h2 { font-size: clamp(1.45rem, 4vw, 2rem); }
.yt-text > p:not(.yt-kicker) { margin: 8px 0 0; color: #d6e4f2; max-width: 52ch; }
.yt-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ytband .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.ytband .btn.ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.ytband .btn .ic { width: 22px; height: 22px; }
.yt-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yt-strip a { display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; text-decoration: none; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); transition: transform .16s, background .16s; }
.yt-strip a:hover { transform: translateY(-3px); background: rgba(255,255,255,.14); }
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0b1d30; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; display: grid; place-items: center; background: rgba(224, 53, 43, .92); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.yt-play .ic { width: 20px; height: 20px; margin-left: 2px; }
.yt-cap { display: grid; gap: 2px; padding: 9px 11px 11px; font-size: .88rem; font-weight: 600; line-height: 1.3; }
.yt-cap small { color: #ffb4ae; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 700px) { .yt-strip { grid-template-columns: repeat(3, minmax(150px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; } .yt-strip li { scroll-snap-align: start; } }
@media (max-width: 520px) { .ytband { padding: 24px 16px; border-radius: 24px; } .yt-cta .btn { width: 100%; } }
.foot-yt { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.foot-yt a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-weight: 600; }
.foot-yt .ic { width: 22px; height: 22px; color: var(--yt); }

/* Phase 1 (1 Nov 2026): Start here, How it works, Questions, the YouTube QR code, How to use, footer links */
.start, .how, .faq, .guides { margin-top: 40px; }
.start-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.scard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.scard h3 { font-size: 1.3rem; }
.scard p { margin: 0; color: var(--ink-2); flex: 1; }
.scard .st-go { align-self: flex-start; margin-top: 6px; }
.s-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--teal-l); color: var(--teal); }
.s-ic .ic { width: 28px; height: 28px; }
.st-student { background: var(--navy); border-color: var(--navy); color: #fff; }
.st-student p { color: #d6e2ee; }
.st-student .s-ic { background: rgba(255,255,255,.1); color: var(--gold); }
.st-student .st-go { background: var(--gold); border-color: var(--gold); color: #2b2100; }
.st-student .st-go:hover:not(:disabled) { background: #ffc61f; border-color: #ffc61f; }
.st-student .st-go[aria-expanded="true"] .ic { transform: rotate(180deg); }
.st-try { border: 2px solid var(--teal); }
.st-try .st-go { border-color: var(--teal); color: var(--teal); }
.s-tag { position: absolute; top: 20px; right: 18px; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--teal); color: #fff; }
.st-panel { margin-top: 14px; padding: 20px; border-radius: var(--r); background: var(--card); border: 2px solid var(--gold); box-shadow: var(--shadow); }
.st-h { margin: 0 4px 12px; font-weight: 650; }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.st-list a { display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 56px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); text-decoration: none; background: var(--bg); }
.st-list a:hover { border-color: var(--teal); }
.st-list b { font-size: 1.05rem; }
.st-list span { color: var(--ink-2); font-size: .92rem; }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.how-list li { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.how-list h3 { font-size: 1.1rem; }
.how-list p { margin: 6px 0 0; color: var(--ink-2); font-size: .96rem; }
.how-n { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold); font-weight: 700; font-size: 1.2rem; }
.faq-list { display: grid; gap: 10px; max-width: 860px; }
.faq details { border-radius: 18px; background: var(--card); border: 1px solid var(--line); padding: 4px 20px; }
.faq summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 650; font-size: 1.05rem; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }
.faq details a { color: var(--teal); font-weight: 600; }
.yt-qr { margin: 20px 0 0; display: flex; align-items: center; gap: 14px; }
.yt-qr img { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 6px; flex: none; }
.yt-qr figcaption { color: #d6e4f2; font-size: .9rem; max-width: 22ch; }
.gd-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.gd-col { padding: 22px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.gd-col ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.gd-col a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); text-decoration: none; font-weight: 600; }
.gd-col a .ic { color: var(--yt); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
.foot-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }
.foot-links.legal a { font-weight: 600; }

/* the page before the script draws it (and with JavaScript off): readable content for visitors and search engines */
.pre { max-width: 1120px; margin: 0 auto; padding: 16px 16px 60px; }
.pre-bar { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.pre-bar span { display: flex; flex-direction: column; line-height: 1.15; }
.pre-bar small { color: var(--ink-2); font-size: .78rem; }
.pre-hero { display: grid; gap: 22px; align-items: center; padding: 32px 26px; border-radius: 28px; color: #fff; background: linear-gradient(150deg, #0f2a44, #10304e 60%, #0d2238); }
@media (min-width: 820px) { .pre-hero { grid-template-columns: auto minmax(0, 1fr); padding: 48px 52px; gap: 44px; } }
.pre-hero img { width: 176px; height: 176px; border-radius: 50%; object-fit: cover; border: 5px solid #f2b705; justify-self: center; background: #fff; }
.pre-hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-top: 6px; }
.pre-hero .founder { margin-top: 8px; }
.pre-hero p { margin: 8px 0 0; color: #e8f0f7; }
.pre h2 { margin: 32px 4px 12px; font-size: 1.4rem; }
.pre ul { margin: 0; padding-left: 22px; }
.pre li { margin: 4px 0; }
.pre a { color: var(--teal); font-weight: 600; }
.pre .boot-line { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin: 18px 4px 0; }
.pre .boot-line .spinner { width: 20px; height: 20px; border-width: 2px; }
.pre .boot-line.nojs { display: block; color: var(--ink); font-weight: 600; }
