/* ============ Tokens ============ */
:root {
  --teal-950: #03282c;
  --teal-900: #063b40;
  --teal: #004c51;
  --teal-600: #0a7077;
  --gold: #f5aa02;
  --gold-soft: #fde9b3;
  --ghost: #F6F7FF; /* "ghost white" replaces pure white everywhere */

  --bg: #EDEFF8;
  --surface: #F6F7FF;
  --surface-2: #E9ECF8;
  --ink: #0e2a2c;
  --muted: #566d6f;
  --line: #D8DDEE;
  --brand: #004c51;
  --on-brand: var(--ghost);
  --accent: #f5aa02;
  --on-accent: #2b1d00;
  --link: #00676e;
  --focus: #0a8f98;
  --danger: #b3261e;
  --ok: #1f7a4d;
  --heart: #f43f5e;
  --shadow: 0 1px 2px rgba(3, 40, 44, .06), 0 8px 24px rgba(3, 40, 44, .07);
  --shadow-lg: 0 24px 60px rgba(3, 40, 44, .22);
  --scrim: rgba(3, 30, 33, .55);
  --sk: #DCE0EF;
  --sk-hi: #E8EBF7;

  /* Baloo Bhaijaan 2: friendly display (titles, big numbers). Alexandria: interface + body.
     Aref Ruqaa Ink: handwritten accents. Amiri: poems and stories. */
  --f-display: "Baloo Bhaijaan 2", "Alexandria", system-ui, sans-serif;
  --f-body: "Alexandria", system-ui, "Segoe UI", sans-serif;
  --f-accent: "Cairo", "Alexandria", system-ui, sans-serif;
  --f-text: "Amiri", "Alexandria", serif;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --side: 84px;
  --gap: 24px;
}

:root[data-theme="dark"] {
  --bg: #081a1c;
  --surface: #0f2528;
  --surface-2: #143034;
  --ink: #e9f1ef;
  --muted: #9fb8b6;
  --line: #214549;
  --brand: #f5aa02;
  --on-brand: #2b1d00;
  --link: #6fd0d6;
  --focus: #6fd0d6;
  --danger: #ff8a80;
  --ok: #6fd3a2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --scrim: rgba(0, 10, 12, .72);
  --sk: #163538;
  --sk-hi: #1c4246;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081a1c;
    --surface: #0f2528;
    --surface-2: #143034;
    --ink: #e9f1ef;
    --muted: #9fb8b6;
    --line: #214549;
    --brand: #f5aa02;
    --on-brand: #2b1d00;
    --link: #6fd0d6;
    --focus: #6fd0d6;
    --danger: #ff8a80;
    --ok: #6fd3a2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --scrim: rgba(0, 10, 12, .72);
    --sk: #163538;
    --sk-hi: #1c4246;
    color-scheme: dark;
  }
}

/* ============ Base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--f-body); background: var(--bg); color: var(--ink); line-height: 1.75; font-size: 16px; min-height: 100vh; transition: background-color .25s, color .25s; }
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: 0; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 1.2rem + 2.8vw, 3.2rem); }
h2 { font-weight: 700; font-size: clamp(1.2rem, 1.05rem + .8vw, 1.65rem); }
h3 { font-weight: 700; font-size: 1.08rem; }
p { color: var(--muted); }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* ============ Buttons / fields ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .72rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .95rem; background: var(--brand); color: var(--on-brand); border: 2px solid var(--brand); transition: transform .15s, background-color .2s, color .2s, border-color .2s; min-height: 46px; text-decoration: none; }
.btn:hover { background: var(--teal-900); border-color: var(--teal-900); color: var(--ghost); }
:root[data-theme="dark"] .btn:hover { background: #ffbf33; border-color: #ffbf33; color: #2b1d00; }
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.gold:hover { background: #ffc233; border-color: #ffc233; color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.btn.sm { padding: .4rem .9rem; min-height: 38px; font-size: .86rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--ghost); border-color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); background: var(--surface); transition: background-color .2s, border-color .2s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--muted); }
.linkbtn { color: var(--link); text-decoration: underline; text-underline-offset: 4px; font-weight: 500; }

.field { display: grid; gap: .4rem; }
.field > label, .legend { font-weight: 600; font-size: .9rem; color: var(--ink); }
.input, select.input, textarea.input { width: 100%; padding: .75rem 1rem; border-radius: var(--r-sm); background: var(--surface); border: 1.5px solid var(--line); min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
textarea.input { min-height: 110px; resize: vertical; }
.field .hint, .hint { font-size: .8rem; color: var(--muted); }
.field .err, .err { font-size: .85rem; color: var(--danger); font-weight: 500; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.form { display: grid; gap: 1.1rem; }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 500; color: var(--ink); }
.chip.gold { background: var(--gold-soft); border-color: transparent; color: #4a3300; }
.chip.warn { background: #fff1d6; border-color: transparent; color: #6b4600; }
.chip.ok { background: #dff3e8; color: #14573a; border-color: transparent; }
:root[data-theme="dark"] .chip.gold, :root[data-theme="dark"] .chip.warn { background: #3a2e0a; color: #ffd978; }
:root[data-theme="dark"] .chip.ok { background: #123525; color: #8fe0b6; }
.chip button { display: grid; place-items: center; color: var(--muted); }
button.chip { cursor: pointer; transition: background-color .2s, color .2s; }
button.chip:hover { background: var(--line); }
button.chip[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--ghost); font-family: var(--f-display); font-weight: 700; overflow: hidden; flex: none; font-size: 1.1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; }
.avatar.sm { width: 34px; height: 34px; font-size: .95rem; }
.avatar.c1, .fc-init.c1 { background: #004c51; } .avatar.c2, .fc-init.c2 { background: #8a5a00; } .avatar.c3, .fc-init.c3 { background: #3c5d3a; } .avatar.c4, .fc-init.c4 { background: #7a3b2e; } .avatar.c5, .fc-init.c5 { background: #33506f; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.notice { padding: .9rem 1.1rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.notice b { color: var(--ink); }
.notice.warn { background: #fff4dc; border-color: #f0d28a; color: #5a3d00; }

/* ---- rubber segment (sliding thumb) ---- */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; isolation: isolate; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; z-index: 1; text-align: center; padding: .55rem .6rem; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .9rem; transition: color .2s; white-space: nowrap; }
.seg input:checked + label { color: var(--on-brand); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 9px; background: var(--brand); }

/* ---- code slots ---- */
.slots { display: flex; gap: 8px; direction: ltr; }
.slot { width: 44px; height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: center; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; caret-color: var(--accent); transition: border-color .2s, box-shadow .2s, background-color .2s; min-width: 0; }
.slot:hover { border-color: var(--muted); }
.slot:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.slots[data-status="error"] .slot { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.slots[data-status="success"] .slot { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
@media (max-width: 420px) { .slot { width: 38px; height: 46px; } .slots { gap: 6px; } }

/* ---- glide select ---- */
.gs { position: relative; }
.gs-btn { width: 100%; min-height: 48px; padding: .6rem 1rem; border-radius: var(--r-sm); background: var(--surface); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: start; transition: border-color .2s, box-shadow .2s; }
.gs-btn:hover { border-color: var(--muted); }
.gs-btn:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.gs-val.is-ph { color: var(--muted); opacity: .85; }
.gs-chev { transition: transform .2s; color: var(--muted); }
.gs-btn[aria-expanded="true"] .gs-chev { transform: rotate(180deg); }
.gs-menu { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 272px; overflow: auto; }
.gs.up .gs-menu { top: auto; bottom: calc(100% + 6px); }
.gs-hl { position: absolute; inset-inline: 4px; top: 0; height: 0; border-radius: 10px; background: var(--surface-2); transition: transform .22s cubic-bezier(.3, 1, .3, 1), height .22s; pointer-events: none; z-index: 0; }
.gs-opt { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 10px; cursor: pointer; min-height: 44px; }
.gs-opt small { color: var(--muted); font-size: .76rem; }
.gs-opt[aria-selected="true"] { font-weight: 700; color: var(--link); }

/* ---- password field ---- */
.pw { position: relative; }
.pw .input { padding-inline-end: 3rem; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.pw-eye:hover { background: var(--surface-2); color: var(--ink); }
.meter-pw { display: flex; gap: 4px; }
.meter-pw i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s; }
.meter-pw i.on:nth-child(1) { background: var(--danger); } .meter-pw i.on:nth-child(2) { background: var(--accent); } .meter-pw i.on:nth-child(3) { background: var(--ok); }
form[data-mode="login"] .meter-pw { display: none; }

/* ---- pulse heart (favourites) ---- */
.ph { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .55rem .2rem .85rem; min-height: 44px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .9rem; transition: background-color .2s, border-color .2s; }
.ph:hover { background: var(--surface-2); }
.ph.sm { min-height: 36px; padding: .1rem .45rem .1rem .7rem; font-size: .8rem; }
.ph-ic { position: relative; display: grid; place-items: center; width: 24px; height: 24px; }
.ph-ic .icon { width: 22px; height: 22px; stroke: var(--muted); fill: none; stroke-width: 2; transition: stroke .2s, fill .2s; }
.ph[aria-pressed="true"] .ph-ic .icon { stroke: var(--heart); fill: var(--heart); }
.ph[aria-pressed="true"] { border-color: color-mix(in srgb, var(--heart) 45%, var(--line)); }
.ph-dots { position: absolute; inset: 0; pointer-events: none; }
.ph-dots i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--heart); }
.ph-count { position: relative; display: inline-block; overflow: hidden; min-width: 1.2em; height: 1.5em; line-height: 1.5em; text-align: center; }
.ph-roll { display: block; }
.ph-roll + .ph-roll { position: absolute; inset: 0; }
.hearts { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.hsw { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1px var(--line); transition: box-shadow .2s, transform .15s; }
.hsw:hover { transform: scale(1.08); }
.hsw[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 3px var(--ink); }
.hsw.custom { background: conic-gradient(#f43f5e, #f5aa02, #10b981, #0ea5e9, #ec4899, #f43f5e); display: grid; place-items: center; color: var(--ghost); overflow: hidden; cursor: pointer; }
.hsw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.hsw.custom .icon { width: 16px; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .5)); }

/* ---- thought line ---- */
.tl { justify-self: start; max-width: 92%; margin-block: .1rem; }
.tl-head { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem; padding: .2rem .1rem; text-align: start; }
.tl-head:disabled { cursor: default; }
.tl-glyph .icon { color: var(--accent); }
.tl[data-state="working"] .tl-glyph, .tl[data-state="working"] .tl-label { animation: breath 1.6s ease-in-out infinite; }
@keyframes breath { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.tl-time { font-size: .78rem; opacity: .8; }
.tl-chev { width: 1em; transition: transform .2s; }
.tl.open .tl-chev { transform: rotate(180deg); }
.tl[data-state="working"] .tl-chev { display: none; }
.tl-steps { list-style: none; display: grid; gap: .25rem; margin: .2rem 0 .4rem; color: var(--muted); font-size: .85rem; }
.tl-steps .icon { color: var(--ok); width: 1em; display: inline-block; vertical-align: -.15em; margin-inline-end: .4rem; }

/* ---- stepper ---- */
.stp-ind { list-style: none; display: flex; margin-bottom: 1.4rem; }
.stp-ind li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; position: relative; text-align: center; font-size: .8rem; color: var(--muted); }
.stp-ind li::before { content: ""; position: absolute; top: 17px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--line); }
.stp-ind li:last-child::before { display: none; }
.stp-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); transition: background-color .25s, border-color .25s, color .25s; }
.stp-dot .icon { width: 1em; }
li[data-state="now"] { color: var(--ink); font-weight: 600; }
li[data-state="now"] .stp-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
li[data-state="done"] .stp-dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
li[data-state="done"]::before { background: var(--brand); }
.stp-body { position: relative; min-height: 230px; }
.stp-pane { display: grid; gap: 1rem; align-content: start; }
.stp-err { min-height: 1.4em; margin-top: .6rem; }
.stp-foot { display: flex; justify-content: space-between; gap: .6rem; margin-top: .6rem; }
.stp-foot [data-next] { margin-inline-start: auto; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.catopt input { position: absolute; opacity: 0; pointer-events: none; }
.catopt span { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .9rem .4rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s; }
.catopt span:hover { border-color: var(--muted); }
.catopt input:checked + span { border-color: var(--accent); background: var(--gold-soft); color: #3a2600; }
:root[data-theme="dark"] .catopt input:checked + span { background: #2c2509; color: #ffd978; }
.catopt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.review { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: start; }
.th.big { width: 120px; height: 120px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.th.big img, .th.big svg { width: 100%; height: 100%; object-fit: cover; }
.review dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; } .review dt { color: var(--muted); } .review dd { font-weight: 600; }

/* ---- toast (swipe to dismiss, fuse timer) ---- */
#toasts { position: fixed; inset-block-start: 14px; inset-inline: 0; z-index: 200; display: grid; justify-items: center; gap: .5rem; pointer-events: none; padding-inline: 1rem; }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: 1rem; background: var(--ink); color: var(--bg); padding: .8rem 1.1rem; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(356px, 100%); touch-action: pan-y; user-select: none; }
.toast.err { background: var(--danger); color: var(--ghost); }
.toast .tx { flex: 1; display: grid; line-height: 1.5; } .toast .tx b { font-weight: 600; } .toast .tx span { font-size: .84rem; opacity: .8; }
.tbtn { font-weight: 700; color: var(--accent); padding: .3rem .7rem; border-radius: 8px; flex: none; }
:root[data-theme="dark"] .tbtn { color: #8a5a00; }
.fuse { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--accent); transform-origin: right; animation: fuse var(--d) linear forwards; }
.toast.paused .fuse { animation-play-state: paused; }
@keyframes fuse { to { transform: scaleX(0); } }

/* ============ Splash ============ */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--teal-950); display: grid; place-items: center; overflow: hidden; }
#splash .glow { position: absolute; width: 70vmin; height: 70vmin; border-radius: 50%; background: radial-gradient(circle, rgba(10, 112, 119, .55), transparent 68%); opacity: 0; }
#splash .mark { width: min(190px, 40vw); opacity: 0; position: relative; filter: drop-shadow(0 0 1.5px var(--ghost)) drop-shadow(0 0 28px rgba(10, 160, 170, .55)); }
#splash .brandline { position: absolute; bottom: 14vh; color: #cfe3e1; font-family: var(--f-accent); font-size: 1.2rem; font-weight: 600; opacity: 0; }
#splash .spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0; }
#splash .bar { position: absolute; bottom: 8vh; width: 140px; height: 3px; background: rgba(255, 255, 255, .14); border-radius: 3px; overflow: hidden; }
#splash .bar i { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: right; }
.layer { position: fixed; inset: 0; z-index: 101; overflow: auto; background: var(--bg); }

/* ============ Sign-in: folders ============ */
.auth2 { position: relative; min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); isolation: isolate; }
:root[data-theme="dark"] .auth2 { background: var(--teal-950); }
.auth-bg { position: absolute; inset: 0; z-index: 0; }
.auth-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 1.1rem clamp(1rem, 4vw, 2.5rem); }
.auth-brand { display: flex; align-items: center; gap: .8rem; }
.auth-brand img { width: 56px; height: auto; }
.auth-brand b { font-family: var(--f-display); font-size: 1.2rem; display: block; line-height: 1.2; }
.auth-brand span { font-size: .8rem; color: var(--muted); }
.auth-stage { position: relative; z-index: 1; display: grid; place-items: center; padding: 1rem clamp(1rem, 4vw, 2rem) 3rem; }
.auth-stage > * { grid-area: 1 / 1; }
.pick { display: grid; gap: 1.8rem; justify-items: center; width: 100%; }
.pick-head { text-align: center; }
.pick-head p { font-family: var(--f-accent); font-size: 1.08rem; font-weight: 500; color: var(--muted); margin-top: .3rem; }

/* three equal folders; every measurement scales with the folder's own width (container query units) */
.folders { --fw: clamp(190px, 21vw, 280px); display: grid; grid-template-columns: repeat(3, var(--fw)); gap: clamp(1.4rem, 3.6vw, 3.2rem); justify-content: center; padding-top: 2rem; }
.fold { container-type: inline-size; width: 100%; display: block; padding: 0; text-align: center; border-radius: 18px; transition: opacity .35s, filter .35s, transform .35s; }
.fold:focus-visible { outline: 3px solid var(--focus); outline-offset: 8px; }
.fold-scene { position: relative; display: block; width: 100%; aspect-ratio: 25 / 19; perspective: 120cqw; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.fold-back { position: absolute; inset: 9cqw 0 0 0; background: var(--fb); border-radius: 4.6cqw 5.6cqw 5.6cqw 5.6cqw; box-shadow: 0 7cqw 12cqw rgba(3, 40, 44, .26); }
.fold-tab { position: absolute; top: -6.8cqw; inset-inline-start: 0; width: 38cqw; height: 7.6cqw; background: var(--fb); border-radius: 4.6cqw 4.6cqw 0 0; }
.fold-paper { position: absolute; inset-inline: 10cqw; top: 13cqw; height: 34cqw; background: var(--ghost); border-radius: 2.4cqw; box-shadow: 0 .4cqw 2cqw rgba(0, 0, 0, .22); padding: 3cqw 3.4cqw; text-align: start; overflow: hidden; transform: translateY(4cqw) translateX(var(--x, 0cqw)) rotate(var(--r, 0deg)); transition: transform .6s cubic-bezier(.34, 1.56, .64, 1); }
.fold-paper b { display: block; font-family: var(--f-accent); font-size: 5.6cqw; font-weight: 700; color: #14464b; line-height: 1.4; }
.fold-paper i { display: block; height: 2.2cqw; border-radius: 1.2cqw; background: #d8dcec; margin-top: 2.4cqw; }
.fold-paper i + i { width: 62%; }
.fold-paper.p1 { --r: -2.4deg; --x: -1.4cqw; top: 11cqw; z-index: 1; } .fold-paper.p2 { --r: 1.8deg; --x: 1.2cqw; top: 13.5cqw; z-index: 2; } .fold-paper.p3 { --r: -.8deg; top: 16cqw; z-index: 3; }
.fold-front { position: absolute; inset: auto 0 0 0; height: 56cqw; background: var(--fc); border-radius: 3.2cqw 5.6cqw 5.6cqw 5.6cqw; transform-origin: bottom center; transition: transform .6s cubic-bezier(.34, 1.56, .64, 1); z-index: 5; box-shadow: inset 0 .5cqw 0 rgba(255, 255, 255, .25); display: grid; place-items: end center; padding-bottom: 7.4cqw; }
.fold-label { color: var(--ft); display: grid; gap: .4cqw; padding-inline: 3cqw; }
.fold-label b { font-family: var(--f-display); font-size: 11.6cqw; line-height: 1.15; }
.fold-label small { font-size: 4.9cqw; opacity: .88; line-height: 1.5; }
.fold-check { position: absolute; z-index: 6; top: 3.4cqw; inset-inline-end: 3.4cqw; width: 10cqw; height: 10cqw; border-radius: 50%; background: var(--gold); color: #2b1d00; display: grid; place-items: center; transform: scale(0); }
.fold-check .icon { width: 6cqw; height: 6cqw; stroke-width: 2.6; }
.fold:hover .fold-scene, .fold:focus-visible .fold-scene { transform: translateY(-2.2cqw); }
.fold:hover .fold-front, .fold:focus-visible .fold-front { transform: rotateX(-14deg); }
.fold:hover .fold-paper, .fold:focus-visible .fold-paper { transform: translateY(1cqw) translateX(var(--x, 0cqw)) rotate(var(--r, 0deg)); }
/* chosen: lifted, flap half open, a tick appears */
.fold.sel .fold-scene { transform: translateY(-3.4cqw) scale(1.03); }
.fold.sel .fold-front { transform: rotateX(-32deg); }
.fold.sel .fold-paper { transform: translateY(-3cqw) translateX(var(--x, 0cqw)) rotate(var(--r, 0deg)); }
.fold.sel .fold-check { transform: scale(1); }
.folders[data-sel] .fold:not(.sel) { opacity: .5; filter: saturate(.55); transform: scale(.96); }
/* confirmed: flap wide open, papers fan out before they fly to the middle */
.fold.open .fold-front { transform: rotateX(-66deg); }
.fold.open .fold-paper.p1 { transform: translate(-8cqw, -26cqw) rotate(-10deg); }
.fold.open .fold-paper.p2 { transform: translateY(-31cqw) rotate(0deg); }
.fold.open .fold-paper.p3 { transform: translate(8cqw, -26cqw) rotate(10deg); }
.fold.open .fold-check { transform: scale(0); }

.pick.leaving .pick-head, .pick.leaving .confirm, .pick.leaving .demo, .pick.leaving .fold:not(.sel) { opacity: 0; filter: blur(6px); transition: opacity .4s, filter .4s; }
.confirm { min-height: 60px; display: grid; place-items: center; }
.confirm-hint { color: var(--muted); font-size: .92rem; }
.confirm-pick { display: flex; align-items: center; gap: 1.2rem; padding: .45rem 1.1rem .45rem .5rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fly-sheet { position: fixed; z-index: 110; background: var(--ghost); border: 1px solid var(--line); box-shadow: 0 14px 44px rgba(3, 40, 44, .28); pointer-events: none; }
@media (max-width: 860px) { .folders { grid-template-columns: 1fr; --fw: min(300px, 80vw); justify-items: center; gap: 2.4rem; } .fold { width: var(--fw); } }

.auth-card { width: min(540px, 100%); display: grid; gap: 1.2rem; position: relative; isolation: isolate; }
.auth-card.stacked::before, .auth-card.stacked::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card.stacked::before { transform: translateX(-10px) translateY(6px) rotate(-2.2deg); }
.auth-card.stacked::after { transform: translateX(10px) translateY(4px) rotate(1.8deg); }
.auth-title h2 { margin-top: .5rem; }
.back { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-weight: 500; justify-self: start; }
.back:hover { color: var(--ink); }
.back .icon { transform: scaleX(-1); } /* the arrow icon points left; in a right-to-left page "back" points right */
.special { display: grid; gap: 1rem; padding: 1.1rem; border-radius: var(--r); background: var(--surface-2); border: 1.5px dashed var(--muted); }
.sp-head { display: flex; gap: .8rem; align-items: center; }
.sp-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--teal); color: var(--ghost); display: grid; place-items: center; flex: none; }
.sp-head b { display: block; font-size: 1.1rem; line-height: 1.3; } .sp-head small { color: var(--muted); }
.parent-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.parent-pick input { position: absolute; opacity: 0; pointer-events: none; }
.parent-pick label { display: grid; justify-items: center; gap: .3rem; padding: 1rem .5rem; border-radius: var(--r); cursor: pointer; background: var(--surface); border: 2px solid var(--line); font-family: var(--f-display); font-size: 1.3rem; text-align: center; transition: border-color .2s, background-color .2s; }
.parent-pick .icon { width: 34px; height: 34px; color: var(--teal-600); }
.parent-pick input:checked + label { border-color: var(--gold); background: var(--gold-soft); color: #3a2600; }
.parent-pick input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="dark"] .parent-pick .icon { color: #6fd0d6; }
:root[data-theme="dark"] .parent-pick input:checked + label { background: #2c2509; color: #ffd978; }
.avatar-pick { display: flex; align-items: center; gap: 1rem; }
.demo { font-size: .85rem; max-width: 560px; width: 100%; }
.demo summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.demo dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin-top: .6rem; }
.demo dt { color: var(--muted); } .demo dd { font-size: .8rem; }
.pending-box { text-align: center; display: grid; gap: 1rem; justify-items: center; padding: 1rem 0; }
.pending-box .ring { width: 84px; height: 84px; border-radius: 50%; background: var(--gold-soft); color: #7a5200; display: grid; place-items: center; }
.pending-box .ring .icon { width: 38px; height: 38px; }

/* ============ Shell ============ */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px; margin-inline-end: 0; background: var(--teal-950); border-radius: 28px; display: flex; flex-direction: column; align-items: center; padding: 18px 0; gap: 8px; z-index: 20; }
:root[data-theme="dark"] .side { background: #0c2a2d; border: 1px solid var(--line); }
.side .logo { width: 48px; margin-bottom: 14px; }
.side nav { display: flex; flex-direction: column; gap: 6px; align-items: center; flex: 1; }
.nav-i { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #9fc2bf; transition: background-color .2s, color .2s; }
.nav-i:hover { background: rgba(255, 255, 255, .08); color: var(--ghost); }
.nav-i[aria-current="page"] { background: var(--gold); color: #2b1d00; }
.nav-i .tip { position: absolute; inset-inline-start: calc(100% + 12px); background: var(--ink); color: var(--bg); padding: .25rem .7rem; border-radius: 8px; font-size: .82rem; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(6px); transition: opacity .15s, transform .15s; }
.nav-i:hover .tip, .nav-i:focus-visible .tip { opacity: 1; transform: none; }
.nav-i .dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: var(--ghost); font-size: .7rem; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.nav-i.bot { color: var(--gold); }
.main { min-width: 0; padding: 14px 28px 40px; }
.top { display: flex; align-items: center; gap: 1rem; padding: .4rem 0 1.4rem; }
.top .tbrand { display: grid; line-height: 1.25; }
.top .tbrand b { font-family: var(--f-display); font-size: 1.15rem; }
.top .tbrand span { font-size: .76rem; color: var(--muted); }
.search { flex: 1; max-width: 460px; position: relative; }
.search .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 1.1em; }
.search input { padding-inline-start: 2.6rem; border-radius: 999px; }
.theme-toggle { position: relative; width: 78px; height: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 11px; color: var(--muted); flex: none; }
.theme-toggle .icon { width: 19px; height: 19px; position: relative; z-index: 1; transition: color .25s; }
.theme-toggle::before { content: ""; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); inset-inline-start: 4px; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.theme-toggle[aria-pressed="true"]::before { transform: translateX(-36px); }
.theme-toggle .sun { color: #2b1d00; }
.theme-toggle[aria-pressed="true"] .sun { color: var(--muted); }
.theme-toggle[aria-pressed="true"] .moon { color: #2b1d00; }
.me { display: flex; align-items: center; gap: .7rem; padding: .25rem .4rem .25rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.me .meta { display: grid; line-height: 1.2; text-align: start; }
.me .meta b { font-size: .88rem; } .me .meta span { font-size: .74rem; color: var(--muted); }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: .4rem; min-width: 230px; z-index: 40; }
.menu-i, .menu button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .8rem; border-radius: 10px; text-align: start; cursor: pointer; color: var(--ink); text-decoration: none; font-size: .92rem; }
.menu-i:hover, .menu button:hover { background: var(--surface-2); }
#view { min-height: 60vh; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 10px 10px 10px; top: auto; height: 68px; margin: 0; flex-direction: row; padding: 0 10px; border-radius: 24px; justify-content: center; }
  .side .logo { display: none; }
  .side nav { flex-direction: row; justify-content: space-around; width: 100%; flex: none; gap: 2px; }
  .nav-i { width: 46px; height: 48px; }
  .nav-i .tip { display: none; }
  .main { padding: 10px 16px 110px; }
  .search, .me .meta, .top .tbrand span { display: none; }
  .top .tbrand { margin-inline-end: auto; }
  .me { padding: .2rem; }
  .top { padding-bottom: 1rem; }
}

/* ============ Page parts ============ */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { margin-top: .3rem; }
.seg-form .seg { min-width: 220px; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.4rem; align-items: center; }
.gal-note { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .9rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); display: grid; gap: .8rem; justify-items: center; }
.empty .icon { width: 44px; height: 44px; }

.hero { background: var(--teal); color: #e6f0ee; border-radius: 28px; padding: clamp(1.4rem, 3.5vw, 2.4rem); position: relative; overflow: hidden; }
:root[data-theme="dark"] .hero { background: #0b3a3e; border: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; width: 50%; aspect-ratio: 1; inset-inline-end: -10%; top: -60%; border-radius: 50%; background: radial-gradient(circle, rgba(245, 170, 2, .18), transparent 65%); }
.hero > * { position: relative; }
.hero .eyebrow { color: var(--gold); font-family: var(--f-accent); font-size: 1.05rem; font-weight: 600; }
.hero h1 { color: var(--ghost); margin: .2rem 0 .6rem; }
.hero h1 .w { display: inline-block; }
.hero p { color: #b6d0cd; max-width: 56ch; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.3rem; }
.hero .btn.ghost { color: var(--ghost); border-color: rgba(255, 255, 255, .35); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: var(--ghost); border-color: var(--ghost); }

/* scroll-expand intro */
.sx { position: relative; height: 260vh; margin-bottom: 1.6rem; }
.sx-stick { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.sx-frame { position: relative; width: 42%; height: 58vh; border-radius: 24px; overflow: hidden; display: grid; place-items: center; background: var(--teal-900); }
.sx-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.sx-scrim { position: absolute; inset: 0; background: #021a1d; opacity: .45; }
.sx-title { position: relative; z-index: 2; display: flex; gap: .35em; font-family: var(--f-display); font-size: clamp(1.45rem, 3.6vw, 3.1rem); color: var(--ghost); white-space: nowrap; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.sx-title span { display: inline-block; }
.sx-hint { position: absolute; bottom: 5vh; inset-inline: 0; text-align: center; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: .4rem; font-family: var(--f-accent); font-size: 1.02rem; font-weight: 500; }
.sx-body { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; text-align: center; gap: 1rem; padding: 2rem; opacity: 0; pointer-events: none; }
.sx-body h2 { color: var(--ghost); font-family: var(--f-display); font-size: clamp(1.9rem, 4vw, 3rem); }
.sx-body p { color: #e6f0ee; max-width: 58ch; font-size: 1.08rem; line-height: 2; }
.sx-body .btn.ghost { color: var(--ghost); border-color: rgba(255, 255, 255, .5); }
.sx-body .btn.ghost:hover { background: rgba(255, 255, 255, .14); color: var(--ghost); border-color: var(--ghost); }
.sx-static { height: auto; }
.sx-static .sx-stick { position: relative; height: auto; }
.sx-static .sx-frame { width: 100%; height: 70vh; }
.sx-static .sx-body { opacity: 1; pointer-events: auto; }
.sx-static .sx-hint, .sx-static .sx-title { display: none; }

/* bento */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 200px; grid-auto-flow: dense; gap: 12px; margin-top: 1rem; }
.bt { --mx: 50%; --my: 50%; --glow: 0; --spot: 0; position: relative; overflow: hidden; isolation: isolate; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; min-height: 0; text-decoration: none; color: var(--ink); }
.bt::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: var(--spot); background: radial-gradient(300px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%); transition: opacity .25s; }
.bt::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: var(--glow); background: radial-gradient(240px circle at var(--mx) var(--my), var(--accent), transparent 65%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); transition: opacity .25s; }
.bt > * { position: relative; z-index: 1; }
.bt.w2 { grid-column: span 2; } .bt.h2 { grid-row: span 2; }
.bt-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; font-size: .88rem; }
.bt p { font-size: .88rem; }
.big { font-family: var(--f-display); font-size: clamp(2.6rem, 5vw, 3.8rem); line-height: 1; color: var(--brand); font-weight: 700; }
.bt .rip { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--accent), transparent 70%); }
.cta-bt { background: var(--accent); border-color: transparent; justify-content: space-between; color: var(--on-accent); }
.cta-bt .bt-h, .cta-bt p { color: var(--on-accent); }
.cta-bt .bt-h span { font-family: var(--f-display); font-size: 1.4rem; }
.bars { display: grid; gap: .5rem; margin-top: auto; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: .7rem; font-size: .85rem; }
.bar-row .track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar-row .fill { height: 100%; background: var(--teal-600); border-radius: 5px; width: 0; }
:root[data-theme="dark"] .bar-row .fill { background: var(--gold); }
.timer { display: flex; gap: .45rem; margin-top: auto; }
.timer div { flex: 1; text-align: center; background: var(--surface-2); border-radius: 12px; padding: .45rem 0; }
.timer b { display: block; font-family: var(--f-display); font-size: 1.5rem; line-height: 1.2; }
.timer span { font-size: .7rem; color: var(--muted); }
.rank { display: grid; gap: .1rem; }
.rank-i { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: .7rem; padding: .35rem .3rem; border-radius: 10px; text-align: start; width: 100%; transition: background-color .2s; }
.rank-i:hover { background: var(--surface-2); }
.rank-i .n { font-family: var(--f-display); font-size: 1.3rem; text-align: center; color: #a87000; }
:root[data-theme="dark"] .rank-i .n { color: var(--gold); }
.rank-i b { display: block; line-height: 1.3; font-size: .92rem; } .rank-i small { color: var(--muted); }
.heart-n { font-weight: 600; font-size: .88rem; color: var(--muted); }
.cats { display: grid; }
.cat-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: .7rem; padding: .4rem .1rem; border-bottom: 1px solid var(--line); text-align: start; width: 100%; font-size: .9rem; transition: padding .2s; }
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { padding-inline-start: .5rem; }
.cat-row span { color: var(--muted); font-size: .85rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: auto; padding-bottom: .4rem; }
.steps li { list-style: none; position: relative; padding-top: 1.9rem; padding-inline-end: .6rem; }
.steps li::before { content: ""; position: absolute; top: 9px; inset-inline: 0; height: 2px; background: var(--line); }
.steps li::after { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.steps li.done::after { background: var(--brand); border-color: var(--brand); }
.steps li.now::after { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent); }
.steps b { display: block; font-size: .85rem; line-height: 1.4; } .steps span { font-size: .76rem; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; flex: 1; min-height: 0; }
.thumb { display: grid; grid-template-rows: 1fr auto; gap: .3rem; text-align: start; min-width: 0; min-height: 0; }
.thumb .th { border-radius: 12px; overflow: hidden; background: var(--surface-2); min-height: 0; }
.thumb .th > * { width: 100%; height: 100%; object-fit: cover; }
.thumb .th .textcard { aspect-ratio: auto !important; }
.thumb b { font-size: .76rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-weight: 600; }
@media (max-width: 1100px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .bento { grid-auto-rows: minmax(190px, auto); } .bt.w2 { grid-column: span 2; } .thumbs { grid-template-columns: repeat(2, 1fr); } .bt.h2 { grid-row: span 2; } }

/* participants */
.print-only { display: none; }
.grade-block { margin-bottom: 1.8rem; }
.grade-head { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.1rem; border-radius: 16px 16px 0 0; background: var(--teal); color: var(--ghost); }
:root[data-theme="dark"] .grade-head { background: #0b3a3e; border: 1px solid var(--line); border-bottom: 0; }
.grade-head h3 { color: var(--ghost); font-family: var(--f-display); font-size: 1.3rem; }
.grade-head .chip { margin-inline-start: auto; background: rgba(255, 255, 255, .14); color: var(--ghost); border: 0; }
.orn { width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); flex: none; }
.t-wrap { overflow-x: auto; }
.grade-block .t-wrap { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; background: var(--surface); }
.ptable { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ptable th { text-align: start; padding: .75rem 1rem; background: var(--gold-soft); color: #3a2600; font-weight: 700; border-bottom: 2.5px solid var(--gold); font-size: .85rem; }
:root[data-theme="dark"] .ptable th { background: var(--surface-2); color: var(--ink); }
.ptable td { padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tbody tr:nth-child(odd) { background: var(--surface-2); }
.ptable tbody tr:hover { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable .c { text-align: center; width: 64px; color: var(--muted); font-weight: 700; }
.pname { display: inline-flex; align-items: center; gap: .7rem; text-align: start; }
.pname b { font-weight: 600; } .pname:hover b { text-decoration: underline; text-underline-offset: 4px; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; margin-top: 2rem; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 28px; background: var(--teal-950); color: #e6f0ee; }
:root[data-theme="dark"] .summary { background: #0b3a3e; border: 1px solid var(--line); }
.sum-n { display: grid; text-align: center; padding-inline: 1.4rem; }
.sum-n b { font-family: var(--f-display); font-size: clamp(3.4rem, 8vw, 5.6rem); line-height: 1; color: var(--gold); }
.sum-n span { color: #b6d0cd; }
.sum-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.sum-chips .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: var(--ghost); padding: .4rem 1rem; }
.sum-chips .chip b { background: var(--gold); color: #2b1d00; border-radius: 10px; padding: 0 .5rem; margin-inline-start: .2rem; }
@media (max-width: 700px) { .summary { grid-template-columns: 1fr; } }

/* gallery */
.sphere-wrap { position: relative; height: clamp(420px, 72vh, 680px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.masonry { column-count: 4; column-gap: 22px; padding-top: 14px; }
@media (max-width: 1280px) { .masonry { column-count: 3; } }
@media (max-width: 900px) { .masonry { column-count: 2; column-gap: 14px; } }
@media (max-width: 440px) { .masonry { column-count: 1; } }
.tile { break-inside: avoid; margin-bottom: 26px; position: relative; will-change: transform; }
.tile .who { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; padding-inline: .3rem; font-weight: 600; font-size: .9rem; }
.tile .who small { color: var(--muted); font-weight: 400; margin-inline-start: auto; }
.frame { position: relative; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s; }
.tile:hover .frame { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.frame .open { display: block; position: relative; width: 100%; text-align: start; }
.frame .open:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.frame .media { aspect-ratio: var(--ar, 1); width: 100%; display: block; }
.frame .media svg, .frame .media img { width: 100%; height: 100%; object-fit: cover; }
.frame .scrim { position: absolute; inset: auto 0 0 0; padding: 2.4rem .8rem .7rem; background: linear-gradient(to top, rgba(2, 24, 27, .8), transparent); color: var(--ghost); display: flex; align-items: flex-end; gap: .6rem; }
.frame .scrim .t { font-weight: 600; font-size: .9rem; flex: 1; line-height: 1.35; }
.frame .scrim .lk { font-size: .76rem; opacity: .9; white-space: nowrap; }
.fav-slot { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; }
.fav-slot .ph { background: rgba(255, 255, 255, .94); border-color: transparent; color: #10282a; }
.fav-slot .ph:hover { background: var(--ghost); }
.fav-slot .ph-ic .icon { stroke: #6b7f81; }
.textcard { aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; padding: 1.2rem; gap: .6rem; background: var(--teal); color: var(--ghost); align-content: center; }
.textcard .icon { width: 38px; height: 38px; color: var(--gold); }
.textcard b { font-family: var(--f-display); font-size: 1.4rem; line-height: 1.3; }
.textcard small { color: #b6d0cd; }
.textcard.t1 { background: #004c51; } .textcard.t2 { background: #6b4a00; } .textcard.t3 { background: #2f5a3b; } .textcard.t4 { background: #5b3a2e; } .textcard.t5 { background: #2d4b66; }
.textcard .excerpt { color: #e6f0ee; font-family: var(--f-text); font-size: 1.05rem; line-height: 1.9; max-width: 26ch; }
.heart-set { display: grid; gap: .3rem; }
.fav-empty .big-heart { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--heart) 14%, var(--surface)); }
.fav-empty .big-heart .icon { width: 42px; height: 42px; stroke: var(--heart); fill: var(--heart); }

/* modal / entry sheet */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 1rem; }
.modal .bd { position: absolute; inset: 0; background: var(--scrim); }
.sheet { position: relative; background: var(--surface); border-radius: 28px; width: min(980px, 100%); max-height: calc(100vh - 2rem); overflow: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.sheet.narrow { grid-template-columns: 1fr; width: min(560px, 100%); padding: 1.6rem; }
.sheet .pic { background: var(--surface-2); display: grid; place-items: center; min-height: 320px; }
.sheet .pic svg, .sheet .pic img { width: 100%; height: auto; max-height: calc(100vh - 2rem); object-fit: contain; }
.sheet .info { padding: 1.8rem; display: grid; gap: 1.1rem; align-content: start; }
.sheet .close { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3; background: var(--surface); }
.byline { display: flex; align-items: center; gap: .8rem; }
.byline b { display: block; line-height: 1.3; } .byline small { color: var(--muted); }
.desc { color: var(--ink); white-space: pre-line; }
.poem { background: var(--surface-2); border-radius: var(--r); padding: 1rem 1.2rem; white-space: pre-line; font-family: var(--f-text); font-size: 1.25rem; line-height: 2.1; color: var(--ink); }
.likebox { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-radius: var(--r); background: var(--teal); color: var(--ghost); }
:root[data-theme="dark"] .likebox { background: #0b3a3e; border: 1px solid var(--line); }
.likebtn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 2px solid var(--ghost); color: var(--ghost); transition: transform .15s, background-color .2s; flex: none; }
.likebtn .icon { width: 26px; height: 26px; stroke: var(--ghost); fill: none; stroke-width: 2; }
.likebtn.on .icon { fill: var(--ghost); }
.likebtn:hover { background: rgba(255, 255, 255, .16); }
.likebtn:active { transform: scale(.9); }
.likebtn[disabled] { opacity: .55; }
.meter { display: flex; gap: 5px; margin-top: .35rem; }
.meter i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.meter i.on { background: var(--gold); }
.likebox small { color: #b6d0cd; display: block; } .likebox b { font-size: 1rem; }
.likebox .total { margin-inline-start: auto; text-align: center; font-family: var(--f-display); font-size: 1.7rem; line-height: 1; }
.likebox .total small { font-family: var(--f-body); font-size: .72rem; }
.fav-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; } .fav-row small { color: var(--muted); }
.reacts { display: flex; flex-wrap: wrap; gap: .5rem; }
.react { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.05rem; transition: transform .15s, border-color .2s, background-color .2s; min-height: 40px; }
.react span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.react:hover { border-color: var(--muted); background: var(--surface-2); }
.react[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.react[aria-pressed="true"] span { color: #5a3d00; }
:root[data-theme="dark"] .react[aria-pressed="true"] { background: #2c2509; } :root[data-theme="dark"] .react[aria-pressed="true"] span { color: #ffd978; }
.who-list { max-height: 200px; overflow: auto; display: grid; gap: .3rem; font-size: .88rem; }
.who-list div { display: flex; gap: .6rem; padding: .3rem .6rem; background: var(--surface-2); border-radius: 8px; }
.who-list em { font-style: normal; color: var(--muted); margin-inline-start: auto; }
@media (max-width: 760px) { .sheet { grid-template-columns: 1fr; } .sheet .pic { min-height: 0; } }

/* forms / my entries / judging / admin / settings */
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 960px) { .two { grid-template-columns: 1fr !important; } }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 1.4rem; text-align: center; display: grid; gap: .5rem; justify-items: center; color: var(--muted); cursor: pointer; transition: border-color .2s, background-color .2s; }
.drop:hover, .drop:focus-within { border-color: var(--brand); background: var(--surface-2); }
.drop img { max-height: 200px; border-radius: 12px; }
.my-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.my-row:last-child { border-bottom: 0; }
.my-row .th { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.th svg, .th img { width: 100%; height: 100%; object-fit: cover; }
.my-row b { display: block; }
.score-grid { display: grid; gap: .9rem; }
.slider { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: .8rem; }
.slider input[type=range] { width: 100%; accent-color: var(--teal-600); height: 28px; }
:root[data-theme="dark"] .slider input[type=range] { accent-color: var(--gold); }
.slider output { font-family: var(--f-display); font-size: 1.2rem; text-align: center; }
.j-list { display: grid; gap: .3rem; max-height: 68vh; overflow: auto; padding-inline-end: .3rem; }
.j-item { display: grid; grid-template-columns: 52px 1fr auto; gap: .8rem; align-items: center; padding: .55rem; border-radius: 12px; border: 1.5px solid transparent; text-align: start; width: 100%; }
.j-item:hover { background: var(--surface-2); }
.j-item[aria-current="true"] { border-color: var(--brand); background: var(--surface-2); }
.j-item .th { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.tab { padding: .7rem 1rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: .5rem; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--gold); }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.t th { text-align: start; font-weight: 600; color: var(--muted); padding: .6rem .8rem; border-bottom: 2px solid var(--line); font-size: .84rem; }
table.t td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--surface-2); }
.acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
@media (max-width: 800px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { padding: 1rem 1.2rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.kpi b { font-family: var(--f-display); font-size: 2rem; display: block; line-height: 1.1; } .kpi span { color: var(--muted); font-size: .88rem; }
.mem { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.mem-ph { cursor: pointer; } .mem-f { display: grid; gap: .4rem; }
.mem textarea.input { min-height: 64px; }
.thumb-prev { width: 120px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.thumb-prev img { width: 100%; height: 100%; object-fit: cover; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.set { display: grid; gap: .8rem; align-content: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; } .kv dt { color: var(--muted); } .kv dd { font-weight: 600; }
.inline { display: flex; gap: .5rem; }

/* team carousel */
.team { margin-top: 4rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.team-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.flexc-track { display: flex; gap: 12px; height: clamp(320px, 46vh, 420px); }
.fc-card { position: relative; flex: 1 1 0; min-width: 0; border-radius: 22px; overflow: hidden; background: var(--teal); cursor: pointer; transition: flex-grow .6s cubic-bezier(.3, 1, .3, 1); outline-offset: 3px; }
.fc-card.on { flex-grow: 4.4; cursor: default; }
.fc-media { position: absolute; inset: 0; transition: filter .4s; }
.fc-media img { width: 100%; height: 100%; object-fit: cover; }
.fc-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2, 24, 27, .85), transparent 60%); }
.fc-card:not(.on) .fc-media { filter: saturate(.55) brightness(.82); }
.fc-init { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--f-display); font-size: 5rem; color: rgba(255, 255, 255, .92); }
.fc-side { position: absolute; inset: 0; display: grid; place-items: center; writing-mode: vertical-rl; color: var(--ghost); font-weight: 700; font-size: .95rem; transition: opacity .3s; }
.fc-card.on .fc-side { opacity: 0; }
.fc-cap { position: absolute; inset: auto 0 0; padding: 1.4rem; color: var(--ghost); opacity: 0; transform: translateY(12px); transition: opacity .4s .15s, transform .4s .15s; }
.fc-card.on .fc-cap { opacity: 1; transform: none; }
.fc-cap b { font-family: var(--f-display); font-size: 1.7rem; display: block; line-height: 1.3; }
.fc-cap span { color: var(--gold); font-weight: 600; }
.fc-cap p { color: #d6e6e4; font-size: .92rem; max-width: 44ch; margin-top: .3rem; }
.fc-ctrl { display: flex; gap: .5rem; margin-top: .8rem; justify-content: flex-end; }
@media (max-width: 700px) {
  .flexc-track { flex-direction: column; height: auto; }
  .fc-card { flex: none; height: 72px; transition: height .5s cubic-bezier(.3, 1, .3, 1); }
  .fc-card.on { height: 320px; }
  .fc-side { writing-mode: horizontal-tb; place-items: center start; padding-inline: 1.2rem; }
}
.foot { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }

/* assistant */
.fab { position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 50; display: flex; align-items: center; gap: .7rem; padding: .5rem 1.2rem .5rem .55rem; border-radius: 999px; background: var(--gold); color: var(--on-accent); font-weight: 700; box-shadow: var(--shadow-lg); transition: transform .2s; }
:root[dir="rtl"] .fab { padding: .5rem .55rem .5rem 1.2rem; }
.fab:hover { transform: translateY(-3px); }
.fab .orb { width: 40px; height: 40px; border-radius: 50%; background: var(--teal); color: var(--ghost); display: grid; place-items: center; }
@media (max-width: 860px) { .fab { inset-block-end: 92px; } .fab .nm { display: none; } .fab { padding: .45rem; } }
.chat { position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 60; width: min(430px, calc(100vw - 24px)); height: min(660px, calc(100vh - 44px)); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 860px) { .chat { inset: 8px; width: auto; height: auto; } }
.chat-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; background: var(--teal); color: var(--ghost); flex: none; }
:root[data-theme="dark"] .chat-head { background: #0b3a3e; border-bottom: 1px solid var(--line); }
.chat-head .orb { width: 42px; height: 42px; border-radius: 50%; background: var(--gold); color: #2b1d00; display: grid; place-items: center; }
.chat-head b { display: block; line-height: 1.2; font-family: var(--f-display); font-size: 1.15rem; }
.chat-head small { color: #b6d0cd; }
.chat-head .sp { flex: 1; }
.chat-head .icon-btn { background: transparent; color: var(--ghost); border-color: rgba(255, 255, 255, .25); width: 38px; height: 38px; }
.chat-head .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; display: grid; gap: .7rem; align-content: start; background: var(--bg); }
.msg { max-width: 88%; padding: .7rem 1rem; border-radius: 18px; line-height: 1.75; font-size: .95rem; white-space: pre-line; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 4px; justify-self: start; color: var(--ink); }
.msg.me { background: var(--teal); color: var(--ghost); border-end-end-radius: 4px; justify-self: end; }
:root[data-theme="dark"] .msg.me { background: var(--gold); color: #2b1d00; }
.msg a { color: var(--link); font-weight: 600; }
.cards { display: grid; gap: .5rem; max-width: 100%; justify-self: start; width: min(340px, 100%); }
.mini { display: grid; grid-template-columns: 52px 1fr; gap: .7rem; align-items: center; padding: .5rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: start; width: 100%; }
button.mini:hover { border-color: var(--muted); }
.mini .th { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.mini b { display: block; line-height: 1.3; font-size: .92rem; } .mini small { color: var(--muted); }
.suggest { display: flex; gap: .4rem; padding: .6rem 1rem 0; overflow-x: auto; background: var(--bg); flex: none; }
.suggest .chip { white-space: nowrap; }
.rename { display: flex; gap: .5rem; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); flex: none; }
.pbar { position: relative; padding: .7rem .9rem .9rem; background: var(--bg); flex: none; }
.pb-row { display: flex; align-items: flex-end; gap: .35rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: .3rem; transition: border-color .2s, box-shadow .2s; }
.pb-row:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.pb-field { position: relative; flex: 1; min-width: 0; }
.pb-field textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; padding: .55rem .4rem; line-height: 24px; height: 40px; max-height: 100px; font: inherit; color: var(--ink); overflow-y: auto; display: block; }
.pb-ph { position: absolute; inset-inline: .4rem; top: .5rem; line-height: 28px; color: var(--muted); pointer-events: none; font-family: var(--f-accent); font-size: 1rem; white-space: nowrap; overflow: hidden; }
.pb-cmd, .pb-mic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 1.15rem; flex: none; transition: background-color .2s, color .2s; }
.pb-cmd:hover, .pb-mic:hover { background: var(--surface-2); color: var(--ink); }
.pb-mic[aria-pressed="true"] { background: var(--danger); color: var(--ghost); }
.pb-send { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: none; transition: transform .15s, border-radius .24s, background-color .2s; }
.pb-send:active { transform: scale(.94); }
.pb-send .i-send .icon { transform: scaleX(-1); } /* the plane points left, the reading direction */
.pb-send .i-send, .pb-send .i-stop { display: grid; }
.pb-send .i-stop, .pbar.busy .i-send { display: none; }
.pbar.busy .i-stop { display: grid; }
.pbar.busy .pb-send { border-radius: 12px; background: var(--danger); color: var(--ghost); }
.pb-menu { position: absolute; inset-inline: .9rem; bottom: calc(100% - .4rem); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .3rem; z-index: 5; display: grid; }
.pb-menu button { display: flex; gap: .8rem; align-items: baseline; padding: .5rem .8rem; border-radius: 10px; text-align: start; }
.pb-menu button:hover { background: var(--surface-2); }
.pb-menu b { color: var(--link); font-size: .88rem; } .pb-menu span { color: var(--muted); font-size: .85rem; }
.spark-d { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--accent); pointer-events: none; z-index: 9; }

.confirm-dlg { display: grid; gap: 1.2rem; text-align: center; padding: .6rem .2rem .2rem; }
.confirm-dlg .acts { justify-content: center; }

/* ---- every kind of entry: badges, audio cards, players, committee votes, recorder ---- */
.kbadge { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #2b1d00; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none; }
.kbadge .icon { width: 17px; height: 17px; }
.kbadge.k-video { top: 50%; inset-inline-start: 50%; transform: translate(50%, -50%); width: 52px; height: 52px; background: rgba(8, 26, 28, .72); color: var(--ghost); }
:root[dir="rtl"] .kbadge.k-video { transform: translate(50%, -50%); }
.kbadge.k-video .icon { width: 22px; height: 22px; fill: currentColor; }
.audiocard { display: grid; align-content: center; justify-items: center; gap: .9rem; padding: 1.2rem; background: var(--teal); color: var(--ghost); text-align: center; }
.audiocard.t2 { background: #6b4a00; } .audiocard.t3 { background: #2f5a3b; } .audiocard.t4 { background: #5b3a2e; } .audiocard.t5 { background: #2d4b66; }
.wave { width: 86%; height: 44px; color: var(--accent); } .wave.big { height: 96px; width: 90%; }
.a-t b { display: block; font-family: var(--f-display); font-size: 1.3rem; line-height: 1.3; } .a-t small { color: #cfe3e1; }
.player { width: 100%; display: grid; place-items: center; }
.player video { width: 100%; max-height: calc(100vh - 2rem); background: #021a1d; display: block; }
.player > img, .player > .textcard { width: 100%; }
.player-msg { display: grid; justify-items: center; gap: .6rem; padding: 3rem 1rem; color: var(--muted); text-align: center; }
.player-msg .icon { width: 38px; height: 38px; }
.audiobox { width: 100%; display: grid; gap: 1.2rem; padding: 1.6rem; }
.a-wave { display: grid; place-items: center; padding: 1.4rem; border-radius: var(--r); background: var(--teal); }
.a-wave.t2 { background: #6b4a00; } .a-wave.t3 { background: #2f5a3b; } .a-wave.t4 { background: #5b3a2e; } .a-wave.t5 { background: #2d4b66; }
.audiobox audio { width: 100%; }
.jmedia { border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.jmedia .player img { max-height: 340px; object-fit: contain; } .jmedia .player video { max-height: 340px; }
.votebox { display: grid; gap: .5rem; justify-items: start; padding: .9rem 1rem; border-radius: var(--r); background: var(--gold-soft); color: #3a2600; }
.votebox small { color: #6a4c0b; }
:root[data-theme="dark"] .votebox { background: #2c2509; color: #ffd978; } :root[data-theme="dark"] .votebox small { color: #d9bf78; }
.j-marks { display: flex; gap: .3rem; align-items: center; }
.kpane { display: grid; gap: .6rem; }
.kpane .drop img { max-height: 160px; }
.kpane audio { width: 100%; }
.rec { display: flex; align-items: center; gap: 1rem; }
.rec .btn.on { background: var(--danger); border-color: var(--danger); color: var(--ghost); }
.rec-t { font-weight: 700; color: var(--danger); }
.gal-sec { margin-top: 1.6rem; }
.sec-h { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.sec-h p { margin-top: .2rem; font-size: .9rem; }
.chip .icon { width: 1em; height: 1em; }

/* skeleton */
.sk { background: var(--sk); border-radius: 12px; position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--sk-hi), transparent); transform: translateX(100%); animation: sheen 1.4s infinite; }
@keyframes sheen { to { transform: translateX(-100%); } }
.sk-hero { height: 300px; border-radius: 28px; }
.sk-line { height: 14px; margin: .5rem 0; } .sk-line.s { width: 40%; }
.sk-grid { display: grid; gap: var(--gap); grid-template-columns: 1.5fr 1fr; margin-top: var(--gap); }
.sk-masonry { columns: 4; column-gap: 22px; }
.sk-masonry .sk { margin-bottom: 22px; border-radius: 18px; }
@media (max-width: 900px) { .sk-grid { grid-template-columns: 1fr; } .sk-masonry { columns: 2; } }

/* print: the participants list doubles as a printed sheet */
@media print {
  @page { margin: 14mm; }
  body { background: var(--ghost); color: #000; }
  .side, .top, .fab, .chat, #toasts, .toolbar, .page-head .btn, .team, .foot, .sx { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  .print-only { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; } .print-only img { width: 54px; } .print-only b { display: block; font-family: var(--f-display); font-size: 1.3rem; } .print-only span { color: #555; }
  .grade-block, .summary { break-inside: avoid; }
  .grade-head, .summary, .ptable th, .chip, .orn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ v5: elastic slider, 3D sphere (InfiniteMenu), gallery, participants panel, account menu, owner control page ============ */

/* ElasticSlider */
.es { display: flex; align-items: center; gap: .8rem; width: 100%; direction: ltr; color: var(--muted); }
.es-i { display: grid; place-items: center; flex: none; color: var(--muted); }
.es-i .icon { width: 20px; height: 20px; }
.es-wrap { position: relative; flex: 1; height: 44px; display: flex; align-items: center; }
.es-track { position: relative; width: 100%; height: var(--es-t, 6px); border-radius: 999px; background: var(--line); cursor: grab; touch-action: none; transition: height .25s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; opacity: var(--es-o, .7); outline: none; }
.es:hover .es-track, .es.on .es-track, .es-track:focus-visible { height: var(--es-a, 12px); opacity: 1; }
.es.on .es-track { cursor: grabbing; }
.es-track:focus-visible { box-shadow: 0 0 0 3px var(--focus); }
.es-fill { height: 100%; width: 0; border-radius: inherit; background: var(--gold); }
.es-val { position: absolute; top: -4px; transform: translateX(-50%); font-family: var(--f-display); font-size: 1.05rem; line-height: 1; color: var(--ink); pointer-events: none; }
.slider { grid-template-columns: 92px 1fr; }
.slider .legend { font-weight: 600; color: var(--ink); }

/* InfiniteMenu (WebGL2 sphere) */
.sphere-wrap { height: clamp(440px, 74vh, 700px); background: radial-gradient(120% 90% at 50% 0%, var(--surface), var(--surface-2)); box-shadow: var(--shadow); }
.infinite-menu { position: absolute; inset: 0; outline: none; --infinite-menu-tile: 120px; }
.infinite-menu__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.infinite-menu__canvas:active { cursor: grabbing; }
.infinite-menu:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); border-radius: inherit; }
.infinite-menu__info { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
.infinite-menu__title, .infinite-menu__description { position: absolute; margin: 0; max-width: min(24ch, 28vw); opacity: 0; transition: opacity .35s ease, transform .5s cubic-bezier(.2, .8, .2, 1); }
.infinite-menu__title { font-family: var(--f-display); font-size: clamp(1.5rem, 3.2vw, 2.7rem); line-height: 1.2; inset-inline-start: clamp(1rem, 4vw, 3.6rem); top: 50%; transform: translate(-1.5rem, -50%); }
.infinite-menu__description { font-size: clamp(.86rem, 1.2vw, 1.05rem); line-height: 1.7; color: var(--muted); inset-inline-end: clamp(1rem, 4vw, 3.6rem); top: 50%; transform: translate(1.5rem, -50%); text-align: end; }
:root[dir="rtl"] .infinite-menu__title { transform: translate(1.5rem, -50%); } :root[dir="rtl"] .infinite-menu__description { transform: translate(-1.5rem, -50%); }
.infinite-menu__action { position: absolute; inset-inline: 0; margin-inline: auto; bottom: clamp(1rem, 4vh, 2.4rem); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-accent); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(20px) scale(.8); transition: opacity .35s ease .08s, transform .5s cubic-bezier(.2, 1.2, .3, 1) .08s; pointer-events: none; cursor: pointer; }
.infinite-menu__action .icon { width: 26px; height: 26px; transform: scaleX(-1); }
:root[dir="rtl"] .infinite-menu__action .icon { transform: none; }
.infinite-menu__info[data-moving="false"] .infinite-menu__title, .infinite-menu__info[data-moving="false"] .infinite-menu__description { opacity: 1; transform: translate(0, -50%); }
.infinite-menu__info[data-moving="false"] .infinite-menu__action { opacity: 1; transform: none; pointer-events: auto; }
.infinite-menu__info[data-moving="false"] .infinite-menu__title:not([hidden]) { pointer-events: none; }
.infinite-menu__info[data-layout="stacked"] .infinite-menu__title, .infinite-menu__info[data-layout="stacked"] .infinite-menu__description { inset-inline: 1.2rem; max-width: none; text-align: center; top: auto; transform: translateY(14px); }
.infinite-menu__info[data-layout="stacked"] .infinite-menu__title { bottom: 8.6rem; font-size: 1.5rem; }
.infinite-menu__info[data-layout="stacked"] .infinite-menu__description { bottom: 5.2rem; text-align: center; }
.infinite-menu__info[data-layout="stacked"][data-moving="false"] .infinite-menu__title, .infinite-menu__info[data-layout="stacked"][data-moving="false"] .infinite-menu__description { transform: none; }
.infinite-menu__action[hidden], .infinite-menu__title[hidden], .infinite-menu__description[hidden] { display: none; }

/* gallery header, filters, showcase */
.gal-hero { display: flex; justify-content: space-between; align-items: end; gap: 1.2rem 2rem; flex-wrap: wrap; padding: 1.6rem 1.8rem; border-radius: 28px; background: linear-gradient(135deg, var(--teal), var(--teal-600)); color: var(--ghost); position: relative; overflow: hidden; margin-bottom: 1.2rem; }
.gal-hero::after { content: ""; position: absolute; inset-inline-start: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 170, 2, .35), transparent 70%); pointer-events: none; }
.gal-hero h1, .gal-hero p { color: var(--ghost); } .gal-hero p { opacity: .86; max-width: 52ch; margin-top: .3rem; }
.gal-hero .eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.gh-side { display: grid; gap: .8rem; justify-items: end; position: relative; z-index: 1; }
.gh-stats { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.gh-s { display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem .85rem; border-radius: 999px; background: rgba(246, 247, 255, .14); border: 1px solid rgba(246, 247, 255, .22); font-size: .85rem; }
.gh-s b { font-family: var(--f-display); font-size: 1.15rem; color: var(--gold); }
.gh-acts { display: flex; gap: .5rem; }
.gal-filters { display: grid; gap: .3rem; padding: 1rem 1.2rem .2rem; margin-bottom: .6rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gal-filters .toolbar { margin-bottom: .8rem; }
.sc-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 1rem; overflow-x: auto; padding: .3rem .2rem 1rem; scroll-snap-type: x proximity; }
.sc-card { scroll-snap-align: start; display: grid; text-align: start; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.sc-card:hover, .sc-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.sc-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sc-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); } .sc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; } .sc-card:hover .sc-img img { transform: scale(1.05); }
.sc-t { display: grid; gap: .2rem; padding: .8rem 1rem 1rem; } .sc-t b { font-family: var(--f-accent); font-size: 1rem; } .sc-t small { color: var(--muted); line-height: 1.6; }
.sc-form { gap: 1rem; } .sc-form .drop { min-height: 150px; align-content: center; }
.tile .frame { border-radius: 20px; }
.tile:hover .frame { transform: translateY(-5px); }

/* participants: name opens a panel of thumbnails */
.pname { display: inline-flex; align-items: center; gap: .6rem; padding: .25rem .5rem; border-radius: 12px; text-align: start; transition: background-color .2s; }
.pname:hover, .pname[aria-expanded="true"] { background: var(--surface-2); }
.pname:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pname .pn-n { min-width: 1.6rem; height: 1.6rem; padding-inline: .4rem; border-radius: 999px; background: var(--gold-soft); color: #4a3300; font-size: .76rem; font-weight: 700; display: inline-grid; place-items: center; }
.pname .pn-c { width: 16px; height: 16px; color: var(--muted); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.pname[aria-expanded="true"] .pn-c { transform: rotate(180deg); }
.xrow > td { padding: 0 !important; background: var(--surface-2); }
.xpanel { overflow: hidden; height: 0; transition: height .3s cubic-bezier(.3, .9, .3, 1); }
.xin { padding: 1rem 1.2rem 1.2rem; }
.xgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .9rem; }
.xth { display: grid; gap: .3rem; text-align: start; border-radius: 14px; padding: .4rem; transition: background-color .2s, transform .2s; }
.xth:hover { background: var(--surface); transform: translateY(-2px); } .xth:focus-visible { outline: 3px solid var(--focus); }
.xth .th { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: block; }
.xth .th img, .xth .th svg, .xth .th .textcard { width: 100%; height: 100%; object-fit: cover; }
.xth b { font-size: .84rem; line-height: 1.35; } .xth small { color: var(--muted); font-size: .74rem; }
.xfoot { margin-top: .9rem; } .xempty { display: flex; gap: .6rem; align-items: center; color: var(--muted); padding: .4rem .2rem; }
.xempty .icon { width: 22px; height: 22px; }
@media print { .xrow { display: none !important; } }

/* first-visit save colour prompt */
.scp { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1rem; background: var(--scrim); }
.scp-card { width: min(420px, 100%); display: grid; gap: .9rem; justify-items: center; text-align: center; padding: 1.8rem 1.6rem 1.5rem; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.scp-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--heart) 16%, var(--surface)); }
.scp-ic .icon { width: 30px; height: 30px; stroke: var(--heart); fill: var(--heart); transition: stroke .2s, fill .2s; }
.scp-card h3 { font-family: var(--f-display); font-size: 1.5rem; } .scp-card p { color: var(--muted); font-size: .92rem; }
.scp-card .hearts { justify-content: center; } .save-demo { display: inline-flex; align-items: center; gap: .5rem; margin-top: .8rem; color: var(--muted); font-size: .88rem; }
.save-demo .icon { width: 22px; height: 22px; stroke: var(--heart); fill: var(--heart); }

/* account menu */
.me .me-c { width: 14px; height: 14px; color: var(--muted); transition: transform .25s; } .me[aria-expanded="true"] .me-c { transform: rotate(180deg); }
.menu.acct { min-width: 270px; max-width: calc(100vw - 24px); padding: .5rem; transform-origin: top end; inset-inline-end: 0; top: calc(100% + 8px); }
.acct-head { display: flex; align-items: center; gap: .8rem; padding: .7rem .7rem .9rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }
.acct-head b { display: block; font-family: var(--f-accent); font-size: 1rem; } .acct-head span:not(.avatar) { color: var(--muted); font-size: .8rem; }
.menu.acct .menu-i { transition: background-color .2s, transform .2s; } .menu.acct .menu-i:hover { transform: translateX(-3px); }
.menu.acct .menu-i em { margin-inline-start: auto; font-style: normal; min-width: 1.6rem; height: 1.6rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--gold-soft); color: #4a3300; font-size: .76rem; font-weight: 700; }
.menu.acct .menu-i.out { color: var(--danger); margin-top: .2rem; }
.menu.acct .menu-i .icon { width: 20px; height: 20px; }

/* owner-only who-reacted panel inside the entry sheet */
.who-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); padding: .9rem 1rem; display: grid; gap: .6rem; }
.who-panel h3 { display: flex; align-items: center; gap: .5rem; font-size: .98rem; } .who-panel h3 small { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-size: .74rem; }
.who-panel .who-list { max-height: 260px; display: grid; gap: .35rem; font-size: .84rem; } .who-panel .who-list > .who-r { flex: none; }
.who-panel .who-list > .who-r { display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: "ic n w" "ic n t"; align-items: center; gap: 0 .7rem; padding: .45rem .6rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; }
.who-ic { grid-area: ic; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); } .who-ic .icon { width: 17px; height: 17px; } .who-e { font-size: 1.1rem; }
.who-n { grid-area: n; display: grid; line-height: 1.3; } .who-n small { color: var(--muted); font-size: .74rem; } .who-w { grid-area: w; text-align: end; font-weight: 600; } .who-t { grid-area: t; text-align: end; color: var(--muted); font-size: .74rem; }

/* closed door */
.door { display: flex; gap: 1.4rem; align-items: center; max-width: 720px; }
.door-ic { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: #4a3300; } .door-ic .icon { width: 34px; height: 34px; }
.door h2 { margin-bottom: .3rem; } .door p { color: var(--muted); line-height: 1.8; } .door .acts { margin-top: 1rem; }
@media (max-width: 560px) { .door { flex-direction: column; text-align: center; } }

/* owner control page */
.tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; } .tab { white-space: nowrap; }
.ov { margin-bottom: 1.2rem; }
.ov-door { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; } .ov-door .acts { grid-column: 1 / -1; }
.ov-door .door-ic { width: 60px; height: 60px; } .ov-door.is-open .door-ic { background: #dff3e8; color: #14573a; }
.ov-door h2 { font-size: 1.2rem; } .ov-door p { color: var(--muted); font-size: .9rem; }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.ov-l { display: grid; grid-template-columns: 28px 1fr; grid-template-areas: "i b" "i s"; gap: 0 .6rem; text-align: start; padding: .8rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .2s, background-color .2s; }
.ov-l:hover { transform: translateY(-2px); background: var(--gold-soft); } .ov-l .icon { grid-area: i; width: 24px; height: 24px; color: var(--teal-600); } .ov-l b { grid-area: b; } .ov-l small { grid-area: s; color: var(--muted); }
.kpi small { display: block; color: var(--muted); font-size: .76rem; margin-top: .2rem; }
.log-r { display: grid; grid-template-columns: 150px auto 1fr auto; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.log-r:last-child { border-bottom: 0; } .log-r time { color: var(--muted); font-size: .78rem; } .log-r small { color: var(--muted); }
.ov .log-r { grid-template-columns: 130px 1fr auto; } .ov .log-r .chip { display: none; }
@media (max-width: 720px) { .log-r, .ov .log-r { grid-template-columns: 1fr; gap: .2rem; } }
.g-stage { margin-bottom: 1.2rem; } .g-stage h3 { font-size: .95rem; color: var(--muted); margin-bottom: .5rem; }
.g-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .8rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 14px; margin-bottom: .45rem; background: var(--surface); transition: opacity .2s, background-color .2s; }
.g-row.off { opacity: .6; background: var(--surface-2); } .g-n { display: grid; line-height: 1.3; } .g-n small { color: var(--muted); }
@media (max-width: 640px) { .g-row { grid-template-columns: 1fr auto; } .g-row .acts { grid-column: 1 / -1; } }
.sc-r .th img { width: 100%; height: 100%; object-fit: cover; } .rowth { display: inline-flex; align-items: center; gap: .6rem; text-align: start; } .rowth .th { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; }
.rowth .th img, .rowth .th svg, .rowth .th .textcard { width: 100%; height: 100%; object-fit: cover; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); display: grid; gap: .8rem; justify-items: start; } .danger-zone h2 { color: var(--danger); } .danger-zone p { color: var(--muted); max-width: 70ch; }
.chart { width: 100%; height: auto; display: block; margin-top: .6rem; direction: ltr; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 5; } .chart rect.on { fill: var(--teal-600); } .chart rect.off { fill: var(--line); }
:root[data-theme="dark"] .chart rect.on { fill: var(--gold); }
.chart text { fill: var(--muted); font-family: var(--f-body); } .chart .val { fill: var(--ink); font-size: 11px; font-weight: 700; } .chart .day { font-size: 11px; }
.bar-row.rep, .card .bar-row { grid-template-columns: minmax(90px, 1.1fr) 1.6fr 34px auto; }
.mbar { display: block; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; } .mbar i { display: block; height: 100%; background: var(--teal-600); border-radius: 5px; }
:root[data-theme="dark"] .mbar i { background: var(--gold); }
.bar-row small { color: var(--muted); white-space: nowrap; } .mini-wrap { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; min-width: 180px; }
hr.sp { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; } .t small.sub { display: block; color: var(--muted); font-size: .76rem; }
.set-me .avatar-pick { margin-top: .6rem; }
@media (max-width: 860px) { .gal-hero { padding: 1.2rem; } .gh-side { justify-items: start; } .gh-stats { justify-content: flex-start; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============ v6: minimal home, about the contest (four branches), calm gallery, ranking ============ */
:root { --f-about-h: "El Messiri", "Alexandria", system-ui, sans-serif; --f-about: "Tajawal", "Alexandria", system-ui, sans-serif; }

/* home */
.hero-min { min-height: 0; padding: clamp(1.8rem, 4vw, 3rem); }
.today { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0 1.2rem; font-size: .95rem; opacity: .92; }
.today .icon { width: 18px; height: 18px; }
.today i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }
.team { margin-top: 2.4rem; }

/* about the contest */
.about { margin-top: 3.2rem; font-family: var(--f-about); }
.about-head { max-width: 62ch; margin-bottom: 1.6rem; }
.about-eyebrow { display: inline-block; font-family: var(--f-about-h); font-size: .95rem; font-weight: 600; color: var(--link); letter-spacing: .02em; }
.about-head h2 { font-family: var(--f-about-h); font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 700; line-height: 1.25; margin: .2rem 0 .6rem; }
.about-head p { font-size: 1.08rem; line-height: 2; color: var(--muted); }
.branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.branch { position: relative; display: grid; gap: .5rem; align-content: start; padding: 1.5rem 1.6rem 1.4rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold); box-shadow: var(--shadow); overflow: hidden; }
.b-no { position: absolute; inset-inline-end: 1.2rem; top: .4rem; font-family: var(--f-about-h); font-size: 4.6rem; font-weight: 700; line-height: 1; color: var(--surface-2); user-select: none; }
.b-ic { position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: #4a3300; }
.b-ic .icon { width: 24px; height: 24px; }
.branch h3 { position: relative; font-family: var(--f-about-h); font-size: 1.45rem; font-weight: 700; line-height: 1.35; margin-top: .3rem; }
.branch p { position: relative; font-size: 1rem; line-height: 1.9; color: var(--muted); }
.branch ul { position: relative; list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; }
.branch li { padding: .25rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; }
.about-note { display: flex; align-items: center; gap: .6rem; margin-top: 1.2rem; color: var(--muted); font-size: .96rem; }
.about-note .icon { width: 20px; height: 20px; flex: none; color: var(--link); }
:root[data-theme="dark"] .b-ic { background: #3a2e0a; color: #ffd978; } :root[data-theme="dark"] .branch li { background: var(--surface-2); }
@media (max-width: 760px) { .branches { grid-template-columns: 1fr; } .b-no { font-size: 3.6rem; } }

/* gallery: calm, no colour wash */
.gal-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.gal-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); } .gal-head p { color: var(--muted); margin-top: .2rem; }
.gh-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.gal-filters { display: grid; gap: .7rem; margin-bottom: 1rem; }
.gf-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.gf { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem; transition: background-color .2s, border-color .2s, transform .15s; }
.gf .icon { width: 18px; height: 18px; color: var(--muted); }
.gf:hover { border-color: var(--ink); }
.gf[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.gf[aria-pressed="true"] .icon { color: var(--gold); }
.sphere-wrap { background: var(--surface-2); box-shadow: none; border-radius: 24px; }
.sphere-sec .sec-h h2, .gal-sec .sec-h h2 { font-size: 1.3rem; }
.gal-sec { margin-top: 1.8rem; }
.catgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catopt span { white-space: normal; text-align: start; line-height: 1.5; }

/* ranking */
.rk { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.rk.top { background: var(--gold); color: var(--on-accent); }

/* ============ v7: masked CodeSlots, audio player, team looks, contact footer ============ */

/* CodeSlots: dots instead of digits, blinking caret, bounce */
.slot-w { position: relative; display: block; }
.slot { font-size: 1.15rem; letter-spacing: 0; padding: 0; }
.slot-w.filled .slot { border-color: var(--ink); }
.slot-caret { position: absolute; inset-inline: 0; top: 50%; margin: -11px auto 0; width: 2px; height: 22px; border-radius: 2px; background: var(--accent); pointer-events: none; opacity: 0; }
.slot-w:focus-within:not(.filled) .slot-caret { opacity: 1; animation: slot-blink 1s steps(1) infinite; }
@keyframes slot-blink { 50% { opacity: 0; } }
.slots[data-status="success"] .slot-w.filled .slot { border-color: var(--ok); }
.slots[data-status="error"] .slot-w .slot { border-color: var(--danger); }
.slot::selection { background: transparent; }

/* audio player */
.audiobox { display: grid; gap: 1rem; padding: 1.4rem; width: 100%; align-content: center; }
.aplayer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; direction: ltr; }
.ap-play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-accent); box-shadow: var(--shadow); transition: transform .15s; }
.ap-play:hover { transform: scale(1.06); } .ap-play:active { transform: scale(.94); } .ap-play:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ap-play .icon { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.ap-time { font-size: .84rem; color: var(--muted); min-width: 5.6rem; text-align: end; }
.ap-vol { max-width: 340px; width: 100%; margin-inline: auto; }
.a-wave.playing .wave { animation: wave-pulse 1.1s ease-in-out infinite; transform-origin: center; }
@keyframes wave-pulse { 50% { transform: scaleY(.82); } }

/* the two team pickers and the branch editor in the owner page */
.ts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.ts { position: relative; display: block; cursor: pointer; }
.ts input { position: absolute; opacity: 0; inset: 0; }
.ts span { display: grid; gap: .25rem; padding: .9rem 1rem; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .2s, background-color .2s, box-shadow .2s; }
.ts small { color: var(--muted); line-height: 1.6; }
.ts input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: #3a2900; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.ts input:checked + span small { color: #5a4300; }
.ts input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="dark"] .ts input:checked + span { background: #3a2e0a; color: #ffd978; } :root[data-theme="dark"] .ts input:checked + span small { color: #d9bf78; }
.br-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.br-ed { border: 1px solid var(--line); border-radius: 18px; padding: 1rem; display: grid; gap: .7rem; min-width: 0; }
.br-ed legend { padding-inline: .5rem; font-weight: 700; }
@media (max-width: 760px) { .ts-grid, .br-grid { grid-template-columns: 1fr; } }

/* team looks */
.team-head { margin-bottom: 1rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.4rem; }
.t-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.t-card { display: grid; justify-items: center; text-align: center; gap: .4rem; padding: 1.4rem 1.1rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.t-card b { font-family: var(--f-accent); font-size: 1.1rem; margin-top: .4rem; } .t-role { color: var(--link); font-size: .88rem; font-weight: 600; } .t-card p { color: var(--muted); font-size: .9rem; line-height: 1.8; }
.t-list { display: grid; gap: .6rem; }
.t-row { display: grid; grid-template-columns: auto minmax(0, 220px) 1fr; align-items: center; gap: 1rem; padding: .8rem 1.1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.t-row b { display: block; font-family: var(--f-accent); } .t-row p { color: var(--muted); font-size: .9rem; line-height: 1.7; }
@media (max-width: 700px) { .t-row { grid-template-columns: auto 1fr; } .t-row p { grid-column: 1 / -1; } }
.t-gl { position: relative; width: 100%; height: clamp(400px, 60vw, 560px); border-radius: 26px; background: var(--surface-2); overflow: hidden; }

/* FlexCarousel (component stylesheet) */
.flex-carousel { position: relative; width: 100%; height: 100%; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; outline: none; color: var(--ink); }
.flex-carousel[data-hover="open"] { cursor: zoom-in; } .flex-carousel[data-hover="close"] { cursor: zoom-out; } .flex-carousel[data-dragging] { cursor: grabbing; }
.flex-carousel:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.flex-carousel__caption { position: absolute; left: 0; right: 0; top: calc(50% + var(--flex-carousel-half) * var(--flex-carousel-lift, 1) + 22px); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px; pointer-events: none; text-align: center; animation: flex-carousel-reveal 900ms ease both; }
.flex-carousel__title { display: flex; flex-direction: column; align-items: center; max-width: 100%; font-size: 16px; font-weight: 600; line-height: 1.4; animation: flex-carousel-title 520ms cubic-bezier(.22, 1, .36, 1); }
.flex-carousel__subtitle { font-weight: 400; opacity: .6; font-size: 14px; }
.flex-carousel__count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; opacity: .5; transition: opacity 400ms ease; }
.flex-carousel__count[data-hidden] { opacity: 0; }
.flex-carousel__digits { display: inline-flex; } .flex-carousel__digit { display: inline-block; height: 1em; overflow: hidden; }
.flex-carousel__reel { display: flex; flex-direction: column; transition: transform 600ms cubic-bezier(.22, 1, .36, 1); } .flex-carousel__reel span { height: 1em; }
.flex-carousel__slash { opacity: .6; }
.flex-carousel__live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes flex-carousel-title { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flex-carousel-reveal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flex-carousel__caption, .flex-carousel__title { animation: none; } .flex-carousel__reel { transition: none; } }

/* the contact line ends every page, apart from everything above it */
.main { display: flex; flex-direction: column; }
.main > #view { flex: 1 0 auto; }
.foot { display: block; margin-top: 3rem; padding: 1.4rem 1rem 1.8rem; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .92rem; }
.foot a { color: var(--link); font-weight: 700; text-decoration: none; } .foot a:hover { text-decoration: underline; }
.sheet .pic .audiobox svg.icon { width: 20px; height: 20px; max-height: none; }
.sheet .pic .audiobox .ap-play svg.icon { width: 22px; height: 22px; }
.audiobox .ap-vol { padding-inline: .4rem; }

/* v9: vote button and count beside each name in the participants list (committee) */
.pn-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.vote-cell { display: inline-flex; align-items: center; gap: .45rem; margin-inline-start: auto; }
.vbtn { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .84rem; transition: background-color .2s, border-color .2s, color .2s; }
.vbtn .icon { width: 16px; height: 16px; }
.vbtn:hover { border-color: var(--gold); background: var(--gold-soft); color: #3a2900; }
.vbtn.on { background: var(--gold); border-color: var(--gold); color: var(--on-accent); }
.vbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.vcount { min-width: 2rem; height: 2rem; padding-inline: .5rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }

/* v10: committee lists page and the owner's list editor */
.t .c, .ctable .c { width: 4.5rem; }
.ct-row { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.ct { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); padding: 0; transition: transform .15s, box-shadow .15s; }
.ct:hover { transform: translateY(-2px); box-shadow: var(--shadow); } .ct:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ct img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct.more { display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--ink); }
.muted { color: var(--muted); }
.clist .sec-h { margin-bottom: .8rem; }
.lb img { max-height: calc(100vh - 3rem); object-fit: contain; }
.lb-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; }
.lb-t { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); }
.lb-t.on { border-color: var(--gold); } .lb-t:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lb-t img { width: 64px; height: 64px; max-height: none; object-fit: cover; }
.lst { margin-top: 1.2rem; display: grid; gap: 1rem; }
.lst-h { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lst-h .input { flex: 1 1 220px; max-width: 360px; font-weight: 700; }
.inline { display: flex; gap: .6rem; flex-wrap: wrap; } .inline .input { flex: 1 1 240px; max-width: 420px; }
.add-item { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding-top: .4rem; border-top: 1px dashed var(--line); }
.add-item .input { flex: 1 1 200px; max-width: 280px; }
.imgs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; min-width: 140px; }
.img-t { position: relative; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.img-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-x { position: absolute; top: 2px; inset-inline-end: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; padding: 0; }
.img-x .icon { width: 12px; height: 12px; }
.add-img { cursor: pointer; } .add-img:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.part-in { min-width: 150px; min-height: 38px; }

/* v11: videos and texts for a participant, and the panel that drops down under a row */
.ct.vid, .img-t.vid { position: relative; }
.vplay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .32); color: #fff; font-style: normal; pointer-events: none; }
.vplay .icon { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
.ct.txt { display: grid; place-items: center; color: var(--link); background: var(--gold-soft); } .ct.txt .icon { width: 22px; height: 22px; }
.txt-t { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; max-width: 190px; }
.txt-e { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; font-size: .82rem; font-weight: 600; min-width: 0; } .txt-e .icon { width: 14px; height: 14px; flex: none; } .txt-e span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txt-x { padding: .3rem .5rem; color: var(--muted); } .txt-x:hover { color: var(--danger); } .txt-x .icon { width: 12px; height: 12px; }
.xtexts { display: grid; gap: .8rem; margin-bottom: 1rem; }
.xtext { padding: 1rem 1.2rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.xtext h4 { font-family: var(--f-accent); font-size: 1.05rem; margin-bottom: .4rem; }
.xtext p { white-space: pre-wrap; line-height: 2; font-family: var(--f-text); font-size: 1.12rem; }
.xvids { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.xvid video { width: 100%; max-height: 420px; border-radius: 16px; background: #000; display: block; } .xvid figcaption { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.xphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.xph { aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--surface-2); } .xph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; } .xph:hover img { transform: scale(1.05); }
.ctable .pname b { font-size: 1rem; }

/* v12: CassettePlayer */
.cs { display: grid; gap: .9rem; width: 100%; max-width: 460px; margin-inline: auto; outline: none; }
.cs-deck { position: relative; aspect-ratio: 420 / 270; filter: drop-shadow(0 10px 18px rgba(3, 40, 44, .28)); }
.cs-svg { display: block; width: 100%; height: 100%; max-height: none; }
.cs-body { fill: var(--teal-900); stroke: rgba(246, 247, 255, .16); stroke-width: 1.5; }
.cs-labelbg { fill: var(--ghost); } .cs-stripe { fill: var(--gold); }
.cs-win { fill: #031d20; stroke: rgba(246, 247, 255, .3); stroke-width: 2; }
.cs-tape { fill: #3b2a1a; transition: r .3s linear; }
.cs-hub { fill: var(--ghost); } .cs-tooth { fill: #031d20; } .cs-pin { fill: var(--gold); }
.cs-line { fill: none; stroke: #3b2a1a; stroke-width: 3; stroke-linecap: round; }
.cs-foot { fill: #0a2a2e; stroke: rgba(246, 247, 255, .2); stroke-width: 1.5; } .cs-hole { fill: #031d20; } .cs-screw { fill: #b6d0cd; opacity: .8; }
.cs-spin { transform-box: fill-box; transform-origin: center; animation: cs-rot 2.2s linear infinite; animation-play-state: paused; }
.cs[data-playing="true"] .cs-spin { animation-play-state: running; }
.cs-reel.r .cs-spin { animation-duration: 2.8s; }
@keyframes cs-rot { to { transform: rotate(360deg); } }
.cs-label { position: absolute; inset-inline: 7%; top: 9.5%; height: 33%; display: grid; align-content: center; justify-items: center; text-align: center; gap: .15rem; color: #14464b; pointer-events: none; }
.cs-label b { font-family: var(--f-display); font-size: clamp(1.05rem, 3.6vw, 1.5rem); line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-label span { font-size: .78rem; color: #6a7f81; letter-spacing: .02em; }
.cs-ctrl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; direction: ltr; }
.cs-play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-accent); box-shadow: var(--shadow); transition: transform .15s; }
.cs-play:hover { transform: scale(1.06); } .cs-play:active { transform: scale(.94); } .cs-play:focus-visible, .cs-cc:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.cs-time { font-size: .84rem; color: var(--muted); min-width: 5.6rem; text-align: end; }
.cs-opts { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.cs-vol { flex: 1 1 220px; max-width: 340px; padding-inline: .4rem; }
.cs-cc { padding: .4rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .84rem; }
.cs-cc[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-accent); }
.cs-cap { min-height: 2.6em; padding: .6rem 1rem; border-radius: 14px; background: rgba(0, 0, 0, .55); color: #fff; text-align: center; line-height: 1.7; font-size: 1.02rem; }
.sheet .pic .cs svg.icon, .cs svg.icon { width: 20px; height: 20px; max-height: none; }
.sheet .pic .cs .cs-play svg.icon { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.sheet .pic .cs .cs-svg { width: 100%; height: 100%; max-height: none; }
.kpane .cs { margin-top: .6rem; }
@media (prefers-reduced-motion: reduce) { .cs-spin { animation: none; } .cs-tape { transition: none; } }

/* v13: the cassette is also the picture of an audio entry (grid, thumbnails, sphere); its label scales with the cassette */
.cs-deck { container-type: inline-size; }
.cs-label b { font-size: clamp(.7rem, 6.8cqw, 1.7rem); }
.cs-label span { font-size: clamp(.55rem, 3.6cqw, .9rem); }
.cs-thumb { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.cs-thumb .cs-deck { width: 100%; }
.frame .media .cs-deck, .frame .media .cs-deck .cs-svg { width: 100%; height: auto; }
.tile:hover .cs-spin, .xth:hover .cs-spin, .sc-card:hover .cs-spin { animation-play-state: running; }
.cas-ed { display: grid; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); } .cas-ed h3 { font-size: .98rem; }
.tile[data-kind="audio"] .scrim { display: none; }

/* v14: list participants with sex, branch and titles */
.lst .lt { min-width: 1180px; }
.lst .lt .input { min-height: 40px; padding-block: .3rem; font-size: .88rem; min-width: 110px; }
.lst .lt td { vertical-align: middle; }
.add-item .input { flex: 1 1 160px; max-width: 240px; }
.ctitles { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; } .ctitles .chip { font-size: .76rem; padding: .1rem .6rem; }

/* v15: the owner's participants list */
.r-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) minmax(200px, 1.6fr); gap: .8rem; align-items: end; }
@media (max-width: 720px) { .r-row { grid-template-columns: 1fr; } }
.rost { margin-top: 1rem; display: grid; gap: .8rem; }
.rost .rt { min-width: 760px; } .rost .rt .input { min-height: 40px; padding-block: .3rem; font-size: .9rem; }

/* ---------- v16: the owner adds, edits and deletes participants and grades right on the participants page ---------- */
.grade-head { flex-wrap: wrap; row-gap: .5rem; }
.grade-head .gh-tools { display: flex; gap: .4rem; flex-wrap: wrap; margin-inline-start: .3rem; }
.grade-head .gh-tools .btn { min-height: 34px; padding: .25rem .75rem; font-size: .82rem; box-shadow: none; }
.grade-head .gh-tools .btn:not(.danger):not(.ghost) { background: var(--gold); color: #2b1d00; border-color: transparent; }
.grade-head .gh-tools .btn.ghost { background: rgba(255, 255, 255, .12); color: var(--ghost); border-color: rgba(255, 255, 255, .38); }
.grade-head .gh-tools .btn.danger { background: #b4232c; color: #fff; border-color: transparent; }
.grade-head .chip.hid { margin-inline-start: 0; background: rgba(0, 0, 0, .28); }
.p-actc { width: 1%; white-space: nowrap; }
.p-act { display: flex; gap: .3rem; justify-content: flex-end; }
.p-act .btn { min-height: 34px; padding: .2rem .6rem; }
.ptable .xempty, .grade-block .t-wrap > .xempty { padding: 1rem 1.2rem; }
.sheet.narrow { padding-top: 3.6rem; }
.r-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.rform select.input, .rform textarea.input { width: 100%; }
@media (max-width: 560px) { .r-row2 { grid-template-columns: 1fr; } .grade-head .gh-tools { width: 100%; margin-inline-start: 0; } }
/* ---------- v17: online mode (connection light, first-run setup, warnings) ---------- */
:root[data-theme="dark"] .notice.warn { background: #3a2e0a; border-color: #6b5415; color: #ffd978; }
.setup-card { width: min(560px, 100%); }
.cloud-st { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.sync-b { display: inline-flex; align-items: center; gap: .4rem; margin-inline-start: .9rem; font-size: .8rem; color: var(--muted); }
.sync-b::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #c9d1d1; }
.sync-b.online::before { background: #1f9d55; } .sync-b.syncing::before { background: var(--gold); } .sync-b.offline::before, .sync-b.error::before { background: #d6453d; }
.dev-only { margin-bottom: 1rem; line-height: 1.8; }
/* v18: the grade a name was just added to flashes once */
.grade-block.just-added .grade-head { animation: gb-flash 1.8s ease-out 1; }
@keyframes gb-flash { 0%, 55% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .grade-block.just-added .grade-head { animation: none; box-shadow: 0 0 0 3px var(--gold); } }
