/* A&M Challenge — calm night-slate learning system: soft contrast, quiet surfaces, gentle motion */
:root {
  color-scheme: dark;
  --ink-950: oklch(0.2 0.03 278);
  --ink-900: oklch(0.245 0.03 278);
  --ink-850: oklch(0.29 0.03 278);
  --ink-800: oklch(0.34 0.03 278);
  --fern-700: #4d4a8a;
  --mint-400: oklch(0.87 0.06 285);
  --mint-500: oklch(0.77 0.095 285);
  --paper-100: oklch(0.94 0.01 285);
  --paper-300: oklch(0.8 0.016 285);
  --paper-500: oklch(0.66 0.02 285);
  --purple-400: oklch(0.76 0.075 295);
  --red-400: oklch(0.75 0.095 25);
  --amber-400: oklch(0.83 0.085 80);

  --bg: var(--ink-950);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-solid: color-mix(in oklch, var(--ink-900) 94%, transparent);
  --surface-2: rgba(255, 255, 255, 0.06);
  --field: rgba(0, 0, 0, 0.2);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: var(--paper-100);
  --muted: var(--paper-300);
  --dim: var(--paper-500);
  --brand: var(--mint-500);
  --brand-bright: var(--mint-400);
  --on-brand: oklch(0.2 0.06 280);
  --ok: oklch(0.8 0.1 162);
  --ok-soft: rgba(120, 210, 165, 0.12);
  --brand-soft: rgba(150, 140, 225, 0.11);
  --brand-glow: rgba(150, 140, 225, 0.16);
  --dev: var(--purple-400);
  --dev-soft: color-mix(in oklch, var(--purple-400) 13%, transparent);
  --red: var(--red-400);
  --red-soft: color-mix(in oklch, var(--red-400) 11%, transparent);
  --amber: var(--amber-400);
  --amber-soft: color-mix(in oklch, var(--amber-400) 11%, transparent);

  --font: 'Tajawal', 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-latin: 'Hanken Grotesk', 'Tajawal', sans-serif;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.25, 0.8, 0.3, 1);
  --shadow: 0 14px 38px -26px rgba(0, 0, 0, 0.55);
  --glass-blur: blur(10px);
  --surface-pop: rgba(27, 27, 53, 0.97);

  /* soft atmosphere */
  --bg-1: rgba(105, 92, 190, 0.2);
  --bg-2: rgba(60, 60, 140, 0.16);
  --amb-1: rgba(120, 105, 200, 0.1);
  --amb-2: rgba(90, 90, 170, 0.08);
  --glow-opacity: 0.55;
}


*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate;
  font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text);
  background:
    radial-gradient(ellipse 80% 55% at 88% -10%, var(--bg-1), transparent 70%),
    radial-gradient(ellipse 64% 50% at -10% 38%, var(--bg-2), transparent 74%),
    linear-gradient(160deg, #181833 0%, #141429 55%, #101021 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { content: none; }
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient::before, .ambient::after { content: ''; position: absolute; border-radius: 50%; filter: blur(110px); opacity: var(--glow-opacity); transition: opacity 0.6s ease, background 0.8s ease; }
.ambient::before { width: min(46vw, 680px); aspect-ratio: 1; inset-inline-start: -16vw; top: 16vh; background: var(--amb-1); }
.ambient::after { width: min(36vw, 520px); aspect-ratio: 1; inset-inline-end: -10vw; bottom: -12vh; background: var(--amb-2); }
@keyframes ambient-drift { to { transform: translate3d(4vw, -3vh, 0) scale(1.08); } }
.shell, .footer { position: relative; z-index: 1; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { line-height: 1.28; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1rem; }
p { max-width: 70ch; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 3px; }
::selection { color: var(--on-brand); background: var(--brand); }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.live-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand-glow); }
.eyebrow, .secure-label { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-family: var(--font-latin); font-size: 0.72rem; line-height: 1.4; font-weight: 700; letter-spacing: 0.13em; direction: ltr; }
.secure-label { color: var(--muted); font-size: 0.65rem; white-space: nowrap; }

.shell { flex: 1; width: 100%; max-width: 1440px; margin-inline: auto; padding: 42px clamp(20px, 4vw, 64px) 64px; }
.screen { animation: screen-in 0.22s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px) scale(0.995); } to { opacity: 1; transform: none; } }
.panel {
  position: relative; padding: clamp(20px, 2.5vw, 32px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.page-head > div:first-child { display: grid; gap: 10px; }
.page-head h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
.page-head p { color: var(--muted); font-size: 1rem; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-title > div { display: grid; gap: 5px; }
.section-title span { color: var(--brand); font: 700 0.66rem/1.4 var(--font-latin); letter-spacing: 0.12em; direction: ltr; }
.section-title small { color: var(--dim); max-width: 32ch; text-align: end; }

.topbar { position: sticky; top: 0; z-index: 40; background: rgba(21, 21, 42, 0.8); border-bottom: 1px solid var(--line); box-shadow: 0 12px 40px -28px rgba(0, 0, 0, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.018); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.topbar__inner { max-width: 1536px; min-height: 78px; margin-inline: auto; padding: 10px clamp(16px, 3vw, 44px); display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); direction: ltr; flex: 0 0 auto; }
.brand__mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px; background: linear-gradient(145deg, var(--brand-bright), color-mix(in oklch, var(--brand) 76%, var(--fern-700))); color: var(--on-brand); font: 800 0.82rem/1 var(--font-latin); letter-spacing: -0.04em; box-shadow: 0 0 30px rgba(150, 140, 225, 0.105), inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.brand__copy { display: grid; line-height: 1.1; }
.brand__copy b { font: 700 1.04rem/1.2 var(--font-latin); }
.brand__copy small { margin-top: 4px; color: var(--dim); font: 600 0.48rem/1 var(--font-latin); letter-spacing: 0.12em; }
.brand--lg .brand__mark { width: 52px; height: 52px; font-size: 0.95rem; border-radius: 16px; }
.brand--lg .brand__copy b { font-size: 1.25rem; }
.mainnav { display: flex; align-items: center; gap: 4px; margin-inline-end: auto; }
.mainnav a { position: relative; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 10px; color: var(--muted); font-size: 0.9rem; font-weight: 600; transition: color 0.18s, background 0.18s; }
.mainnav a:hover, .mainnav a.is-active { color: var(--text); background: var(--brand-soft); }
.mainnav a.is-active::after { content: ''; position: absolute; inset-inline: 14px; bottom: -17px; height: 2px; background: var(--brand); }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.meter { display: grid; gap: 7px; min-width: 134px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); transition: border-color 0.18s, background 0.18s; }
.meter:hover { border-color: color-mix(in oklch, var(--brand) 45%, transparent); }
.meter__top { display: flex; align-items: center; gap: 7px; font-size: 0.77rem; font-weight: 600; white-space: nowrap; }
.meter__bar { height: 3px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter__bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.25s var(--ease); }
.meter.is-low .meter__bar i { background: var(--amber); }
.meter.is-empty { border-color: color-mix(in oklch, var(--red) 45%, transparent); }
.meter.is-empty .meter__bar i { background: var(--red); }
.meter.is-dev .meter__bar i { background: var(--dev); }
.xp { display: inline-flex; align-items: baseline; gap: 5px; direction: ltr; white-space: nowrap; }
.xp b { font: 700 1rem/1 var(--font-latin); }
.xp small { color: var(--brand); font: 700 0.65rem/1 var(--font-latin); }
.xp.bump { animation: bump 0.25s var(--ease); }
@keyframes bump { 50% { transform: scale(1.12); } }
.user { position: relative; }
.user__btn { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color 0.18s, background 0.18s; }
.user__btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font: 700 0.9rem/1 var(--font-latin); overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user__name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; font-weight: 600; }
.user--dev .avatar { color: var(--dev); background: var(--dev-soft); }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: min(280px, calc(100vw - 32px)); padding: 7px; z-index: 50; background: var(--surface-pop); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: 0 24px 80px -20px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); animation: screen-in 0.16s var(--ease); }
.menu__head { display: grid; gap: 3px; padding: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; justify-items: start; }
.menu__head small { color: var(--muted); }
.menu__item { display: flex; align-items: center; width: 100%; min-height: 44px; text-align: start; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--text); font-size: 0.92rem; }
.menu__item:hover { background: var(--surface-2); }
.menu__item--danger { color: var(--red); }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 7px; font-size: 0.72rem; background: var(--surface-2); color: var(--muted); }
.badge--paid { background: var(--brand-soft); color: var(--brand); }
.badge--dev, .pill--dev, .pill--developer { background: var(--dev-soft); color: var(--dev); }
.mobile-nav { display: none; }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 0.92rem; line-height: 1.3; transition: background 0.2s, color 0.2s, transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s, opacity 0.18s; }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.43; }
.btn--primary { background: linear-gradient(135deg, var(--brand-bright), var(--brand) 58%, color-mix(in oklch, var(--brand) 78%, var(--fern-700))); border-color: rgba(255, 255, 255, 0.14); color: var(--on-brand); box-shadow: 0 12px 34px -14px var(--brand-glow), 0 0 22px rgba(150, 140, 225, 0.044), inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); background: linear-gradient(135deg, color-mix(in oklch, var(--brand-bright) 90%, white), var(--brand-bright)); box-shadow: 0 18px 42px -15px var(--brand-glow), 0 0 30px rgba(150, 140, 225, 0.077), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn--ghost { background: rgba(255, 255, 255, 0.045); border-color: var(--line-strong); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--ghost:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255, 255, 255, 0.06); border-color: color-mix(in oklch, var(--brand) 38%, transparent); box-shadow: 0 10px 26px -20px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.btn--danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in oklch, var(--red) 22%, transparent); }
.btn--danger:hover:not(:disabled) { background: color-mix(in oklch, var(--red) 20%, transparent); }
.btn--lg { min-height: 54px; padding-inline: 26px; font-size: 1rem; }
.btn--block { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin 0.7s linear infinite; }
.btn.is-busy .spinner { display: inline-block; }
.btn.is-busy .btn__label { opacity: 0.65; }
@keyframes spin { to { transform: rotate(360deg); } }

.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.input { display: grid; gap: 7px; min-width: 0; font-size: 0.85rem; font-weight: 600; }
.input > span:first-child { color: var(--muted); }
.input input, .input select, .admin__field { width: 100%; min-height: 50px; min-width: 0; padding: 11px 14px; border-radius: 14px; font-weight: 500; border: 1px solid var(--line); background: var(--field); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025); caret-color: var(--brand-bright); transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
.input select { appearance: auto; }
.input input::placeholder { color: var(--dim); opacity: 0.72; }
.input input:hover:not(:disabled), .input select:hover:not(:disabled), .admin__field:hover:not(:disabled) { border-color: var(--line-strong); }
.input input:focus, .input select:focus, .admin__field:focus { outline: none; border-color: color-mix(in oklch, var(--brand) 72%, transparent); background: rgba(21, 21, 42, 0.6); box-shadow: 0 0 0 3px var(--brand-soft), 0 0 24px -12px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.input input[aria-invalid='true'] { border-color: var(--red); }
.input__hint { color: var(--dim); font-size: 0.72rem; font-weight: 400; line-height: 1.55; }
.input__box { position: relative; display: block; }
.input__box input { padding-inline-end: 68px; }
.input__eye { position: absolute; inset-inline-end: 4px; top: 50%; translate: 0 -50%; min-width: 56px; min-height: 44px; padding: 6px; border: 0; border-radius: 9px; background: transparent; color: var(--brand); font-size: 0.75rem; }
.input__err { color: var(--red); font-size: 0.76rem; font-weight: 500; }
.input__err:empty { display: none; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength i { height: 3px; border-radius: 4px; background: var(--surface-2); }
.strength[data-score='1'] i:nth-child(-n+1) { background: var(--red); }
.strength[data-score='2'] i:nth-child(-n+2) { background: var(--amber); }
.strength[data-score='3'] i:nth-child(-n+3), .strength[data-score='4'] i:nth-child(-n+4) { background: var(--brand); }
.notice { padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; font-size: 0.87rem; line-height: 1.6; }
.notice--bad { color: var(--red); border-color: color-mix(in oklch, var(--red) 25%, transparent); background: var(--red-soft); }
.notice--info { color: var(--muted); background: var(--brand-soft); border-color: color-mix(in oklch, var(--brand) 16%, transparent); }
.notice--warn { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in oklch, var(--amber) 22%, transparent); }
.notice--dev { color: var(--dev); background: var(--dev-soft); border-color: color-mix(in oklch, var(--dev) 24%, transparent); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 13px; overflow-x: auto; scrollbar-width: none; }
.tabs__tab { flex: 1 0 auto; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); font-size: 0.85rem; transition: background 0.18s, color 0.18s; }
.tabs__tab[aria-selected='true'] { background: var(--surface-2); color: var(--brand); box-shadow: inset 0 0 0 1px var(--line); }

.auth { max-width: 1320px; margin-inline: auto; }
.auth__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr); gap: clamp(44px, 7vw, 100px); align-items: center; min-height: calc(100dvh - 190px); }
.auth__story { display: grid; gap: clamp(30px, 4vw, 50px); }
.auth__headline { display: grid; gap: 20px; }
.auth__headline h1 { max-width: 15ch; font-size: clamp(2.8rem, 5.1vw, 5rem); line-height: 1.16; }
.auth__headline h1 em { color: var(--brand); font-style: normal; }
.auth__headline p { color: var(--muted); max-width: 54ch; font-size: 1.05rem; }
.auth__proof { display: flex; gap: 0; border-block: 1px solid var(--line); max-width: 610px; }
.auth__proof > div { flex: 1; display: grid; gap: 2px; padding: 18px 22px; border-inline-start: 1px solid var(--line); }
.auth__proof > div:first-child { border: 0; padding-inline-start: 0; }
.auth__proof b { color: var(--text); font: 700 1.45rem/1.2 var(--font-latin); direction: ltr; }
.auth__proof span { color: var(--dim); font-size: 0.75rem; }
.auth__terminal { max-width: 610px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(0, 0, 0, 0.2)); overflow: hidden; box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.terminal__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); direction: ltr; font-family: var(--font-latin); }
.terminal__top > span { display: flex; gap: 5px; }
.terminal__top i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.terminal__top small { color: var(--dim); font-size: 0.58rem; letter-spacing: 0.1em; }
.terminal__top b { color: var(--brand); font-size: 0.58rem; }
.terminal__body { padding: 24px; }
.terminal__meta { display: flex; justify-content: space-between; gap: 12px; color: var(--brand); font-size: 0.72rem; }
.terminal__meta small { color: var(--dim); font-family: var(--font-latin); direction: ltr; }
.terminal__body > p { margin-block: 20px; font-size: 1.02rem; font-weight: 600; }
.terminal__answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.terminal__answers > span { display: flex; justify-content: center; align-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.terminal__answers .is-correct { justify-content: space-around; color: var(--ok); border-color: color-mix(in oklch, var(--ok) 40%, transparent); background: var(--ok-soft); }
.terminal__progress { height: 3px; margin-block: 22px 14px; background: var(--surface-2); }
.terminal__progress i { display: block; width: 63%; height: 100%; background: var(--brand); }
.terminal__foot { display: flex; justify-content: space-between; color: var(--dim); font-size: 0.72rem; }
.terminal__foot b, .terminal__foot > span:last-child { color: var(--brand); }
.auth__card { padding: clamp(24px, 3vw, 36px); border-radius: var(--r-xl); }
.auth__card-head { display: grid; gap: 8px; margin-bottom: 26px; }
.auth__card-head h2 { font-size: 1.8rem; }
.auth__card-head p { color: var(--muted); font-size: 0.9rem; }
.auth__card .tabs { margin-bottom: 24px; }
.auth__privacy { margin-top: 22px; color: var(--dim); font-size: 0.7rem; line-height: 1.7; text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { position: relative; display: grid; gap: 5px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 18px 45px -36px rgba(0, 0, 0, 0.8); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); overflow: hidden; }
.stat-card > span { color: var(--muted); font-size: 0.76rem; }
.stat-card strong { font: 700 clamp(1.35rem, 2vw, 1.8rem)/1.25 var(--font); }
.stat-card small { color: var(--dim); font-size: 0.72rem; }
.stat-card--accent { border-color: color-mix(in oklch, var(--brand) 20%, transparent); background: linear-gradient(120deg, var(--brand-soft), var(--surface)); }
.stat-card--accent strong { color: var(--brand); }
.setup__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.setup__panel { min-width: 0; }
.field { border: 0; margin-bottom: 24px; min-width: 0; }
.field legend { margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); color: var(--muted); font-size: 0.82rem; font-weight: 600; transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.15s; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-checked='true'] { border-color: color-mix(in oklch, var(--brand) 48%, transparent); background: var(--brand-soft); color: var(--brand); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; border-radius: 13px; background: var(--field); border: 1px solid var(--line); }
.segmented button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; }
.segmented button:has(.seg__meta) { display: grid; align-content: center; justify-items: center; gap: 2px; padding-block: 8px; }
.seg__meta { font-size: 0.68rem; font-weight: 600; opacity: 0.78; white-space: nowrap; }
.ring.is-clock .ring__num { font-size: 0.92rem; }
.segmented button[aria-checked='true'] { color: var(--brand); background: var(--surface-2); }
.setup__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.setup__foot p { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 0.7rem; }
.focus-card { position: sticky; top: 100px; overflow: hidden; }
.focus-card::after { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: var(--brand-soft); filter: blur(35px); inset-inline-end: -80px; bottom: -70px; pointer-events: none; }
.focus-card h2 { margin-block: 14px; font-size: 1.65rem; }
.focus-card > p { color: var(--muted); font-size: 0.85rem; }
.focus-card__ring { position: relative; width: 150px; height: 150px; margin: 24px auto; }
.focus-card__ring svg { width: 100%; transform: rotate(-90deg); }
.focus-card__ring circle { fill: none; stroke: var(--surface-2); stroke-width: 5; }
.focus-card__ring .ring-accent { stroke: var(--brand); stroke-dasharray: 314; stroke-dashoffset: 72; stroke-linecap: round; }
.focus-card__ring > div { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.focus-card__ring b { color: var(--brand); font: 800 2.2rem/1 var(--font-latin); }
.focus-card__ring span { color: var(--muted); font-size: 0.68rem; }

.quiz-layout { max-width: 1080px; margin-inline: auto; }
.quiz { padding: clamp(22px, 4vw, 44px); }
.quiz__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.quiz__top > div:first-child { display: grid; gap: 12px; }
.quiz__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: 0.73rem; font-weight: 600; }
.quiz__stats { font-size: 0.78rem; direction: ltr; }
.ring { position: relative; flex: 0 0 auto; width: 64px; height: 64px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring__bg { stroke: var(--surface-2); }
.ring__fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 138.23; transition: stroke-dashoffset 0.1s linear, stroke 0.18s; }
.ring__num { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); font: 700 1.15rem/1 var(--font-latin); }
.ring.is-warn .ring__fg, .ring.is-warn .ring__num { stroke: var(--amber); color: var(--amber); }
.ring.is-danger .ring__fg, .ring.is-danger .ring__num { stroke: var(--red); color: var(--red); }
.quiz__q { margin-block: clamp(28px, 4vw, 42px); font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.65; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; text-align: start; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--text); transition: border-color 0.18s, background 0.18s, transform 0.15s, opacity 0.18s; }
.option:hover:not(:disabled) { border-color: color-mix(in oklch, var(--brand) 40%, transparent); background: var(--brand-soft); transform: translateY(-1px); }
.option__key { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted); font-weight: 700; }
.option.is-picked { border-color: var(--brand); }
.option.is-correct { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 55%, transparent); background: var(--ok-soft); }
.option.is-correct .option__key { color: oklch(0.2 0.05 160); background: var(--ok); border-color: var(--ok); }
.option.is-wrong { color: var(--red); border-color: color-mix(in oklch, var(--red) 50%, transparent); background: var(--red-soft); }
.option.is-dim { opacity: 0.42; }
.feedback { margin-top: 20px; padding: 16px 18px; border-radius: 13px; border: 1px solid var(--line); }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback p { font-size: 0.9rem; color: var(--muted); }
.feedback.is-ok { background: var(--brand-soft); border-color: color-mix(in oklch, var(--brand) 25%, transparent); }
.feedback.is-ok strong { color: var(--brand); }
.feedback.is-bad, .feedback.is-time { background: var(--red-soft); border-color: color-mix(in oklch, var(--red) 25%, transparent); }
.feedback.is-bad strong, .feedback.is-time strong { color: var(--red); }
.quiz__actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; }
.quiz-side { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; color: var(--dim); font-size: 0.7rem; }
.quiz-side > span { font: 600 0.6rem/1 var(--font-latin); letter-spacing: 0.1em; }
.quiz-side > div { display: flex; gap: 4px; }
kbd { min-width: 24px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font: 600 0.68rem/1.3 var(--font-latin); text-align: center; }

.board { max-width: 1080px; margin-inline: auto; }
.board__me { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; border-color: color-mix(in oklch, var(--brand) 24%, transparent); }
.board__me-rank, .board__me-score { display: grid; gap: 3px; }
.board__me-rank b { color: var(--brand); font: 800 2rem/1 var(--font-latin); }
.board__me-info { flex: 1; display: grid; gap: 4px; }
.board__me-score { text-align: end; }
.board__me-score b { font: 700 1.8rem/1 var(--font-latin); }
.board__me small { color: var(--dim); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.podium__item { display: grid; justify-items: center; gap: 8px; padding: 26px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: center; }
.podium__item--1 { border-color: color-mix(in oklch, var(--brand) 35%, transparent); background: linear-gradient(145deg, var(--brand-soft), var(--surface)); }
.podium__medal { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--brand); font: 700 0.9rem/1 var(--font-latin); }
.podium__name { font-weight: 700; max-width: 100%; overflow-wrap: anywhere; }
.podium__score { color: var(--brand); font-size: 0.9rem; }
.pill { display: inline-flex; padding: 2px 8px; border-radius: 6px; color: var(--brand); background: var(--brand-soft); font-size: 0.66rem; }
.pill--admin { color: var(--amber); background: var(--amber-soft); }
.board__list { padding: 8px 20px; }
.board__rows { display: grid; }
.board__row { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.board__row:last-child { border: 0; }
.board__row.is-me { background: linear-gradient(90deg, transparent, var(--brand-soft), transparent); }
.board__rank { width: 30px; color: var(--dim); font: 600 0.85rem/1 var(--font-latin); text-align: center; }
.board__who { flex: 1; min-width: 0; }
.board__name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-weight: 700; }
.board__who small { color: var(--dim); font-size: 0.72rem; }
.board__score { display: grid; text-align: end; }
.board__score b { font: 700 1.1rem/1.3 var(--font-latin); }
.board__score small { color: var(--dim); font-size: 0.65rem; }
.board__empty { margin-block: 20px; }
.board .row { justify-content: center; margin-top: 24px; }

.pricing-head { align-items: center; }
.pricing-notices { display: grid; gap: 10px; margin-bottom: 20px; }
.pricing-notices:empty { display: none; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 26px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 24px 55px -44px rgba(0, 0, 0, 0.38); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s; }
.plan:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 60px -40px rgba(0, 0, 0, 0.9); }
.plan--featured { border-color: color-mix(in oklch, var(--brand) 40%, transparent); background: linear-gradient(155deg, rgba(150, 140, 225, 0.061), rgba(255, 255, 255, 0.035) 58%); box-shadow: 0 24px 60px -40px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.plan--current { box-shadow: inset 0 0 0 1px var(--brand); }
.plan__flag { position: absolute; top: 16px; inset-inline-end: 16px; color: var(--brand); font-size: 0.66rem; font-weight: 700; }
.plan__name { color: var(--muted); font-size: 0.95rem; }
.plan__price { display: flex; align-items: baseline; gap: 7px; margin-block: 20px 16px; direction: ltr; justify-content: flex-end; }
.plan__price b { font: 800 clamp(2.1rem, 3vw, 2.8rem)/1 var(--font-latin); letter-spacing: -0.05em; }
.plan__price span { color: var(--dim); font-size: 0.68rem; }
.plan__quota { min-height: 54px; padding-block: 14px; border-block: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; }
.plan__features { display: grid; gap: 10px; margin-block: 18px 24px; color: var(--muted); font-size: 0.78rem; }
.plan__features li { display: flex; gap: 8px; align-items: flex-start; }
.plan__features li::before { content: '✓'; color: var(--brand); font-weight: 700; }
.plan .btn { width: 100%; margin-top: auto; }
.billing-bottom { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: center; margin-top: 24px; }
.redeem { display: grid; grid-template-columns: 1fr minmax(210px, 0.8fr) auto; align-items: end; gap: 18px; }
.redeem h2 { margin-block: 5px; font-size: 1.2rem; }
.redeem p { color: var(--dim); font-size: 0.76rem; }
.payment-assurance { display: grid; gap: 10px; color: var(--muted); font-size: 0.8rem; }
.payment-assurance span::first-letter { color: var(--brand); }

.share-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.share-main { display: grid; gap: 18px; min-width: 0; }
.share__received { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: color-mix(in oklch, var(--brand) 28%, transparent); }
.share__received-text { display: grid; gap: 8px; }
.share__received-text strong { font-size: 1.15rem; }
.share__meter { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.share__meter > div { display: grid; gap: 5px; }
.share__meter b { font: 800 2rem/1.2 var(--font-latin); }
.share__slots { display: flex; gap: 6px; direction: ltr; }
.share__slots i { width: 34px; height: 7px; border-radius: 6px; background: var(--surface-2); }
.share__slots i.is-used { background: var(--brand); }
.share__form { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.share__form .btn { justify-self: start; }
.share-connections { margin-top: 24px; }
.share-connections h3 { margin-bottom: 12px; color: var(--muted); }
.empty-line { padding: 18px 0; color: var(--dim); font-size: 0.82rem; }
.share__pin { position: sticky; top: 100px; }
.share__pin h2 { margin-block: 12px; }
.share__pin > p { color: var(--muted); font-size: 0.85rem; }
.share__pin-out { display: grid; gap: 12px; margin-block: 22px; }
.share__pin-value { display: block; padding: 18px 10px; border: 1px dashed color-mix(in oklch, var(--brand) 45%, transparent); border-radius: 12px; background: var(--brand-soft); color: var(--brand); font: 700 clamp(1.1rem, 2.2vw, 1.45rem)/1 var(--font-latin); letter-spacing: 0.09em; text-align: center; }
.share__pin-out small { font-size: 0.7rem; }
.share__pin > .muted { margin-block: 20px; font-size: 0.78rem; }
.pin-security { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.7rem; }
.pin-security span::before { content: '·'; color: var(--brand); margin-inline-end: 7px; }

.admin__tabs { margin-bottom: 24px; }
.admin__tabs .tabs__tab { flex: 1; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.admin-metrics article { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.admin-metrics span { color: var(--muted); font-size: 0.72rem; }
.admin-metrics b { color: var(--brand); font: 700 1.7rem/1.2 var(--font-latin); }
.admin-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.admin-search { width: min(420px, 100%); }
.admin__count { margin-block: 16px; font-size: 0.78rem; }
.admin-table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.admin-table-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.5fr) minmax(310px, 0.9fr); gap: 16px; padding: 12px 18px; color: var(--dim); background: var(--field); border-bottom: 1px solid var(--line); font-size: 0.68rem; }
.admin__list { display: grid; gap: 10px; }
.admin-table-wrap .admin__list { gap: 0; }
.admin__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.admin-table-wrap .admin__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(130px, 0.5fr) minmax(310px, 0.9fr); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.admin-table-wrap .admin__row:last-child { border: 0; }
.admin__row.is-used { opacity: 0.6; }
.admin__row.is-dev { border-color: color-mix(in oklch, var(--dev) 28%, transparent); }
.admin__main { display: grid; gap: 3px; min-width: 0; }
.admin__main strong { overflow-wrap: anywhere; }
.admin__main small { color: var(--dim); font-size: 0.7rem; overflow-wrap: anywhere; }
.admin__code { font-family: var(--font-latin); direction: ltr; text-align: start; }
.admin__usage { color: var(--muted); font-size: 0.75rem; }
.admin__actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; min-width: 0; }
.admin__actions .btn { min-height: 44px; padding: 8px 12px; font-size: 0.75rem; }
.admin__field { min-height: 44px; width: 116px; padding: 7px 9px; font-size: 0.75rem; }
.admin__field--days { width: 70px; }
.admin__form { display: grid; gap: 18px; margin-bottom: 22px; }
.admin__form .btn { justify-self: start; }
.plan-admin-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; align-items: center; }
.plan-admin-row > span { color: var(--muted); font-size: 0.8rem; }
.settings-form { display: grid; gap: 20px; }
.settings-form .btn { justify-self: start; }
.files-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.file-list { display: grid; gap: 8px; margin-bottom: 20px; }
.file-list button { display: grid; gap: 3px; width: 100%; min-height: 58px; padding: 10px 12px; text-align: start; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.file-list button.is-active { border-color: var(--brand); background: var(--brand-soft); }
.file-list button small { color: var(--dim); direction: ltr; text-align: start; }
.file-list-panel > p { font-size: 0.72rem; }
.file-editor { min-width: 0; }
#file-content { width: 100%; min-height: 480px; resize: vertical; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--paper-300); font: 500 0.76rem/1.6 monospace; tab-size: 2; }
.file-editor .btn { margin-top: 16px; }
.file-editor .notice { margin-top: 12px; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; max-width: 1536px; width: 100%; margin-inline: auto; padding: 20px clamp(20px, 4vw, 64px) calc(20px + env(safe-area-inset-bottom)); color: var(--dim); border-top: 1px solid var(--line); font-size: 0.7rem; }
.footer__credit { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.footer__credit a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; justify-content: center; }
.footer__status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-latin); direction: ltr; }

/* Account, avatar and recovery */
.text-button { min-height: 44px; padding: 6px 10px; border: 0; background: transparent; color: var(--brand); font-weight: 700; justify-self: center; }
.text-button:hover { color: var(--brand-bright); text-decoration: underline; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--text); font-size: 1.4rem; }
.icon-button:hover { background: var(--surface-2); }
.account-grid { display: grid; grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr); gap: 24px; align-items: start; }
.avatar-panel { display: grid; gap: 20px; justify-items: stretch; }
.avatar--profile { width: 112px; height: 112px; border-radius: 28px; font-size: 2.7rem; justify-self: center; border: 1px solid var(--line-strong); }
.avatar-panel__copy { text-align: center; display: grid; gap: 7px; }
.avatar-panel__copy p { color: var(--muted); font-size: 0.88rem; }
.account-forms { display: grid; gap: 24px; }
.input input[type='file'] { padding: 8px; min-height: 54px; }
.input input[type='file']::file-selector-button { min-height: 38px; margin-inline-end: 12px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.account-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: clamp(20px, 3vw, 32px); overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface-pop); color: var(--text); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.075); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.account-dialog::backdrop { background: rgba(10, 13, 15, 0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.admin-avatar-editor { display: flex; align-items: center; gap: 18px; }
.admin-avatar-editor > div { display: grid; gap: 4px; }
.admin-avatar-editor .avatar--profile { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; }
.password-reset { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; padding: 18px; border: 1px solid color-mix(in oklch, var(--amber) 22%, transparent); border-radius: var(--r-md); background: linear-gradient(135deg, var(--amber-soft), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.password-reset .btn { margin-bottom: 1px; white-space: nowrap; }

/* Direct email support — no mail server required */
.support__layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr); gap: clamp(36px, 7vw, 96px); align-items: center; min-height: calc(100dvh - 230px); max-width: 1240px; margin-inline: auto; }
.support__intro { display: grid; justify-items: start; gap: 24px; }
.support__intro h1 { max-width: 12ch; font-size: clamp(2.8rem, 5.4vw, 5.2rem); line-height: 1.12; }
.support__intro > p { max-width: 52ch; color: var(--muted); font-size: 1.05rem; }
.support__email { display: inline-block; max-width: 100%; padding-block: 4px; color: var(--brand-bright); font: 700 clamp(1.05rem, 2.4vw, 1.45rem)/1.4 var(--font-latin); overflow-wrap: anywhere; }
.support__email:hover { text-decoration: underline; text-underline-offset: 6px; }
.support__guide { overflow: hidden; }
.support__guide::after { content: ''; position: absolute; width: 210px; height: 210px; inset-inline-end: -110px; top: -120px; border-radius: 50%; background: rgba(150, 140, 225, 0.05); filter: blur(46px); pointer-events: none; }
.support__steps { display: grid; margin-block: 4px 24px; }
.support__steps li { display: flex; align-items: flex-start; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.support__steps li:first-child { padding-top: 4px; }
.support__steps li:last-child { border-bottom: 0; }
.support__steps li > b { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--brand-soft); color: var(--brand); font: 700 0.75rem/1 var(--font-latin); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.support__steps li > div { display: grid; gap: 5px; }
.support__steps p { color: var(--muted); font-size: 0.84rem; }
.footer__support { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 600; }
.footer__support:hover { color: var(--brand-bright); }
.podium__item, .admin-metrics article { border-radius: var(--r-lg); background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.admin-table-wrap { background: rgba(255, 255, 255, 0.025); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }

/* Linked developer profile */
.dev { width: min(100%, 680px); margin: clamp(12px, 5vh, 64px) auto 0; text-align: center; }
.dev__card { display: grid; justify-items: center; gap: 20px; padding: clamp(28px, 5vw, 52px); border-color: color-mix(in oklch, var(--dev) 24%, transparent); background: radial-gradient(circle at 50% 0%, var(--dev-soft), transparent 46%), var(--surface); }
.dev__photo { width: 120px; height: 120px; object-fit: cover; border-radius: 28px; border: 1px solid color-mix(in oklch, var(--dev) 55%, transparent); box-shadow: 0 0 0 7px var(--dev-soft), 0 22px 50px -28px var(--dev); }
.dev__name { font: 800 clamp(2.5rem, 8vw, 4rem)/1 var(--font-latin); letter-spacing: -0.055em; }
.dev__badge { min-height: 34px; color: var(--dev); background: var(--dev-soft); border: 1px solid color-mix(in oklch, var(--dev) 24%, transparent); font-family: var(--font-latin); direction: ltr; }
.dev__skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 10px; text-align: start; }
.dev__skills li { display: flex; align-items: center; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in oklch, var(--bg) 46%, transparent); color: var(--muted); font-size: 0.88rem; }
.dev__skills li::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; margin-inline-end: 10px; border-radius: 50%; background: var(--dev); box-shadow: 0 0 10px var(--dev-soft); }
.dev > .btn { margin-top: 18px; min-width: 190px; }
.toasts { position: fixed; z-index: 100; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-pop); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.065); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); animation: toast-in 0.2s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.toast.is-leaving { opacity: 0; transform: translateY(5px); transition: opacity 0.16s, transform 0.16s; }
.toast__icon { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.toast--error .toast__icon { color: var(--red); background: var(--red-soft); }
.toast__msg { flex: 1; font-size: 0.84rem; }
.toast__x { min-width: 44px; min-height: 44px; margin: -10px -10px -10px 0; border: 0; background: transparent; color: var(--dim); font-size: 1.2rem; }
.error-card { max-width: 520px; margin: 15vh auto 0; display: grid; justify-items: center; gap: 18px; }

@media (max-width: 1180px) {
  .mainnav { display: none; }
  .topbar__actions { margin-inline-start: auto; }
  .auth__grid { grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.8fr); gap: 38px; }
  .auth__headline h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .admin-table-head { display: none; }
  .admin-table-wrap .admin__row { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-table-wrap .admin__row .admin__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .shell { padding-top: 28px; }
  .auth__grid { grid-template-columns: 1fr; min-height: 0; }
  .auth__story { gap: 28px; }
  .auth__terminal { display: none; }
  .auth__headline h1 { max-width: 18ch; }
  .auth__card { max-width: 560px; width: 100%; margin-inline: auto; }
  .setup__layout { grid-template-columns: 1fr; }
  .focus-card { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .share-dashboard { grid-template-columns: 1fr; }
  .share__pin { position: static; grid-row: 1; }
  .billing-bottom { grid-template-columns: 1fr; }
  .redeem { grid-template-columns: 1fr 1fr; }
  .redeem > div { grid-column: 1 / -1; }
  .files-layout { grid-template-columns: 1fr; }
  .file-list { grid-template-columns: repeat(3, 1fr); }
  .file-list-panel .section-title { margin-bottom: 16px; }
  .support__layout { grid-template-columns: 1fr; min-height: 0; gap: 34px; }
  .support__intro h1 { max-width: 15ch; }
  .support__guide { max-width: 620px; width: 100%; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  body::before { background-size: 40px 40px; }
  .shell { padding: 24px 14px 108px; }
  .topbar__inner { min-height: 66px; padding: 8px 12px; gap: 10px; }
  .brand__mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand__copy small { display: none; }
  .brand__copy b { font-size: 0.92rem; }
  .topbar__actions { gap: 7px; }
  .meter { min-width: 92px; padding: 7px 9px; }
  .meter__top { font-size: 0.68rem; }
  .xp { display: none; }
  .user__btn { min-height: 44px; padding: 3px; border: 0; background: transparent; }
  .user__btn > svg, .user__name { display: none; }
  .avatar { width: 38px; height: 38px; }
  .avatar--profile { width: 88px; height: 88px; border-radius: 22px; font-size: 2rem; }
  .admin-avatar-editor .avatar--profile { width: 64px; height: 64px; font-size: 1.6rem; }
  .mobile-nav { position: fixed; display: flex; z-index: 45; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 66px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface-pop); box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.065); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
  .mobile-nav a { flex: 1; min-width: 0; min-height: 52px; display: grid; place-content: center; justify-items: center; gap: 2px; border-radius: 12px; color: var(--dim); font-size: 0.62rem; font-weight: 600; }
  .mobile-nav a span { font: 700 1rem/1 var(--font-latin); }
  .mobile-nav a.is-active { color: var(--brand); background: var(--brand-soft); }
  .footer { flex-wrap: wrap; justify-content: center; padding-bottom: 100px; }
  .footer__status { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .page-head h1 { font-size: 2rem; }
  .page-head .btn { width: 100%; }
  .panel { padding: 18px; border-radius: var(--r-lg); }
  .section-title { flex-direction: column; margin-bottom: 22px; }
  .section-title small { text-align: start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-card:first-child { grid-column: 1 / -1; }
  .stat-card strong { font-size: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .setup__foot { flex-direction: column; align-items: stretch; }
  .setup__foot p { justify-content: center; }
  .setup__foot .btn { width: 100%; }
  .chips { gap: 7px; }
  .chip { padding-inline: 12px; font-size: 0.77rem; }
  .auth__headline h1 { font-size: clamp(2.35rem, 11vw, 3.2rem); }
  .auth__headline p { font-size: 0.95rem; }
  .auth__proof > div { padding: 14px 12px; }
  .auth__proof b { font-size: 1.2rem; }
  .auth__proof span { font-size: 0.64rem; }
  .auth__card { padding: 22px 18px; }
  .options { grid-template-columns: 1fr; }
  .option { min-height: 60px; }
  .quiz { padding: 20px 16px; }
  .quiz__q { font-size: 1.25rem; }
  .quiz__actions .btn { flex: 1; padding-inline: 12px; }
  .quiz-side { display: none; }
  .podium { gap: 8px; }
  .podium__item { padding: 18px 8px; }
  .podium__name { font-size: 0.8rem; }
  .board__me { gap: 14px; padding: 16px; }
  .board__me-info small { font-size: 0.67rem; }
  .board__row { gap: 9px; }
  .board__row .avatar { display: none; }
  .board__who small { font-size: 0.65rem; }
  .plans { grid-template-columns: 1fr; }
  .plan { padding: 24px 20px; }
  .plan__quota { min-height: 0; }
  .dev { margin-top: 0; }
  .dev__card { gap: 17px; }
  .dev__skills { grid-template-columns: 1fr; }
  .dev > .btn { width: 100%; }
  .redeem { grid-template-columns: 1fr; }
  .redeem > div { grid-column: auto; }
  .payment-assurance { padding: 4px 8px; }
  .share__received { align-items: stretch; flex-direction: column; }
  .share__meter { align-items: flex-start; flex-direction: column; }
  .share__form .btn { width: 100%; }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .admin-metrics article { padding: 14px; }
  .admin__tabs { margin-inline: -14px; border-inline: 0; border-radius: 0; padding-inline: 14px; }
  .admin__tabs .tabs__tab { flex: 0 0 auto; }
  .admin-toolbar { align-items: stretch; flex-direction: column; gap: 6px; }
  .admin-search { width: 100%; }
  .admin__row, .admin-table-wrap .admin__row { display: flex; align-items: stretch; flex-direction: column; gap: 12px; }
  .admin__actions { justify-content: flex-start; }
  .admin__field { flex: 1; width: auto; min-width: 100px; }
  .admin__field--days { flex: 0 0 72px; min-width: 72px; }
  .plan-admin-row { grid-template-columns: repeat(2, 1fr); }
  .file-list { grid-template-columns: 1fr; }
  #file-content { min-height: 380px; font-size: 0.7rem; }
  .password-reset { grid-template-columns: 1fr; padding: 15px; }
  .password-reset .btn { width: 100%; }
  .support__intro { gap: 18px; }
  .support__intro h1 { font-size: clamp(2.35rem, 11vw, 3.2rem); }
  .support__intro > p { font-size: 0.95rem; }
  .support__intro .row, .support__intro .btn { width: 100%; }
  .support__steps li { gap: 12px; }
  .support__steps li > b { width: 38px; height: 38px; }
  .toasts { inset-inline: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* ---------------------------------------------------------------- admin: activity + analytics */
.pill--bad { color: var(--red); background: var(--red-soft); }
.activity-chart-panel, .activity-chart-panel + .panel { margin-bottom: 16px; }
.activity-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; height: 170px; padding: 8px 2px 0; direction: ltr; }
.activity-chart__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.activity-chart__bar { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand-bright), color-mix(in oklch, var(--brand) 40%, transparent)); box-shadow: 0 0 22px -6px var(--brand-glow); transition: height 0.5s var(--ease); }
.activity-chart__n { font-size: 0.66rem; color: var(--muted); min-height: 1em; }
.activity-chart__d { font-size: 0.62rem; color: var(--dim); font-family: var(--font-latin); }
.activity-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.activity-legend .pill { font-size: 0.72rem; padding: 4px 10px; }
.activity-tools { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.activity-filter { min-width: 200px; }
.activity-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.activity-row.is-bad { border-inline-start: 3px solid var(--red); }
.activity-row__time { flex: none; font-size: 0.74rem; color: var(--dim); font-family: var(--font-latin); white-space: nowrap; }
.admin-metrics article small { font-size: 0.72rem; }
@media (max-width: 640px) {
  .activity-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .activity-chart { gap: 3px; height: 140px; }
  .activity-chart__d { display: none; }
  .activity-chart__col:nth-child(odd) .activity-chart__d { display: block; }
}

@media (prefers-reduced-motion: reduce) { .activity-chart__bar { transition: none; } }

/* ---------------------------------------------------------------- question issue reporting */
.input textarea { width: 100%; min-width: 0; min-height: 84px; padding: 11px 14px; border-radius: 14px; font: inherit; font-weight: 500; color: var(--text); border: 1px solid var(--line); background: var(--field); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025); caret-color: var(--brand-bright); resize: vertical; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
.input textarea::placeholder { color: var(--dim); opacity: 0.72; }
.input textarea:hover:not(:disabled) { border-color: var(--line-strong); }
.input textarea:focus { outline: none; border-color: color-mix(in oklch, var(--brand) 72%, transparent); background: rgba(21, 21, 42, 0.6); box-shadow: 0 0 0 3px var(--brand-soft), 0 0 24px -12px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.report-preview { margin: 0; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--dim); font-size: 0.9rem; line-height: 1.7; max-height: 120px; overflow: auto; }
.quiz__report { color: var(--dim); }
.quiz__report:hover { color: var(--text); }
@media (max-width: 640px) {
  .quiz__actions { flex-wrap: wrap; }
  .quiz__report { order: 3; width: 100%; justify-content: center; }
}

.support__report { display: grid; gap: 14px; width: 100%; padding: 22px; border-color: color-mix(in oklch, var(--brand) 30%, transparent); background: var(--brand-soft); }
.support__report h2 { font-size: 1.3rem; }
.support__report .row { align-items: center; gap: 10px; flex-wrap: wrap; }
.support__report-id { padding: 8px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font: 700 1.05rem/1.4 var(--font-latin); letter-spacing: 0.04em; overflow-wrap: anywhere; user-select: all; }
.support__report-steps { display: grid; gap: 8px; padding-inline-start: 1.2em; list-style: decimal; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }


/* ---------------------------------------------------------------- skeleton screens (startup + question preparation) */
/* Placeholders that mirror the real layout. A light sweep runs over every block and a soft glow follows the pointer
   (--mx / --my are set from JS). prefers-reduced-motion freezes the sweep through the global rule above. */
.skeleton-host { position: relative; --mx: 50%; --my: 28%; }
.skeleton-host::before { content: ''; position: absolute; inset: -24px; z-index: 0; pointer-events: none; background: radial-gradient(320px circle at var(--mx) var(--my), var(--brand-soft), transparent 70%); }
.skeleton-host > *, .skeleton-host .panel > * { position: relative; z-index: 1; }

.sk { display: block; position: relative; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 11%, transparent), transparent); animation: sk-sweep 1.5s ease-in-out infinite; }
[dir='rtl'] .sk::after { transform: translateX(100%); animation-name: sk-sweep-rtl; }
@keyframes sk-sweep { to { transform: translateX(100%); } }
@keyframes sk-sweep-rtl { to { transform: translateX(-100%); } }

.sk-bar { position: relative; height: 3px; margin-bottom: 26px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.sk-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 38%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: sk-bar 1.25s var(--ease) infinite; }
@keyframes sk-bar { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
[dir='rtl'] .sk-bar i { animation-name: sk-bar-rtl; }
@keyframes sk-bar-rtl { from { transform: translateX(110%); } to { transform: translateX(-290%); } }

.sk-page { display: grid; gap: 26px; }
.sk-top { display: flex; align-items: center; gap: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sk--logo { width: 150px; height: 40px; border-radius: 12px; }
.sk--avatar { width: 44px; height: 44px; border-radius: 50%; margin-inline-start: auto; }
.sk-nav { display: flex; gap: 10px; }
.sk-nav .sk { width: 64px; height: 18px; border-radius: 8px; }
.sk-head { display: grid; gap: 12px; }
.sk--eyebrow { width: 110px; height: 12px; border-radius: 6px; }
.sk--title { width: min(340px, 70%); height: 38px; border-radius: 12px; }
.sk--line { height: 14px; width: 100%; border-radius: 7px; }
.sk--w60 { width: 60%; }
.sk--num { width: 72px; height: 30px; border-radius: 9px; }
.sk--heading { width: 180px; height: 26px; border-radius: 9px; }
.sk--button { width: 170px; height: 52px; border-radius: 14px; margin-inline-start: auto; }
.sk-page .stat-grid { margin-bottom: 0; }
.sk-panel { display: grid; gap: 20px; }
.sk-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sk-chips .sk { width: 112px; height: 44px; border-radius: 11px; }
.sk-segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sk-segments .sk { height: 52px; border-radius: 12px; }

.sk-caption { display: grid; justify-items: center; gap: 6px; margin-top: 26px; text-align: center; font-size: 0.9rem; }
.sk-caption strong { font-size: 1.15rem; }

.sk-quiz { display: grid; gap: 22px; margin-top: 8px; }
.sk-quiz__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.sk-quiz__tags { display: grid; gap: 12px; width: min(260px, 60%); }
.sk--ring { width: 64px; height: 64px; border-radius: 50%; }
.sk--question { width: 100%; height: 30px; border-radius: 10px; }
.sk-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.sk-options .sk { height: 64px; border-radius: 14px; }

@media (max-width: 900px) { .sk-nav { display: none; } }
@media (max-width: 640px) {
  .sk-options, .sk-segments { grid-template-columns: 1fr; }
  .sk-chips .sk { width: calc(50% - 5px); }
}

/* ---- AI chat (المساعد الذكي) ---- */
.chat-head { align-items: flex-end; flex-wrap: wrap; }
.chat-meter { display: grid; gap: 8px; min-width: 220px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.chat-meter__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chat-meter__top b { font-size: 0.95rem; }
.chat-meter__top small { color: var(--dim); font-size: 0.74rem; }
.chat-meter__bar { display: block; height: 6px; border-radius: 99px; background: var(--field); overflow: hidden; }
.chat-meter__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); transition: width 0.4s var(--ease); }
.chat-meter.is-empty .chat-meter__bar i { background: var(--red); }
.chat-skeleton { display: grid; gap: 14px; }

.chat-paywall { display: grid; gap: 22px; }
.chat-paywall__intro { display: grid; gap: 10px; max-width: 760px; }
.chat-paywall__intro p { color: var(--muted); line-height: 1.8; }
.chat-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.chat-paywall__foot { display: flex; justify-content: center; }

.chat-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.chat-history { display: flex; flex-direction: column; gap: 14px; padding: 18px; max-height: min(72vh, 720px); }
.chat-history__title { font-size: 0.82rem; color: var(--dim); font-weight: 700; letter-spacing: 0.02em; }
.chat-history__empty { font-size: 0.85rem; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-y: auto; min-height: 0; }
.chat-list__item { display: flex; align-items: center; gap: 4px; border-radius: 12px; border: 1px solid transparent; transition: background 0.18s, border-color 0.18s; }
.chat-list__item:hover { background: var(--brand-soft); }
.chat-list__item.is-active { background: var(--brand-soft); border-color: color-mix(in oklch, var(--brand) 30%, transparent); }
.chat-list__open { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: start; padding: 10px 12px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.chat-list__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.chat-list__open small { font-size: 0.72rem; }
.chat-list__del { width: 34px; height: 34px; margin-inline-end: 6px; border-radius: 10px; border: 0; background: none; color: var(--dim); font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 0.18s, color 0.18s, background 0.18s; }
.chat-list__item:hover .chat-list__del, .chat-list__del:focus-visible { opacity: 1; }
.chat-list__del:hover { color: var(--red); background: var(--red-soft); }

.chat-main { display: flex; flex-direction: column; gap: 14px; padding: 18px; height: min(72vh, 720px); min-width: 0; }
.chat-main__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-main__bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; scroll-behavior: smooth; }
.chat-empty { margin: auto; display: grid; gap: 8px; text-align: center; max-width: 34ch; }
.chat-msg { display: flex; }
.chat-msg--user { justify-content: flex-start; }
.chat-msg--assistant { justify-content: flex-end; }
.chat-msg__bubble { max-width: min(78%, 640px); padding: 11px 15px; border-radius: 16px; line-height: 1.8; font-size: 0.95rem; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); }
.chat-msg--user .chat-msg__bubble { background: linear-gradient(135deg, var(--brand-bright), var(--brand)); color: var(--on-brand); border-color: transparent; border-end-start-radius: 4px; font-weight: 600; }
.chat-msg--assistant .chat-msg__bubble { background: var(--surface-2); border-end-end-radius: 4px; }
.chat-msg.is-pending .chat-msg__bubble { color: var(--dim); animation: chat-pulse 1.1s ease-in-out infinite; }
@keyframes chat-pulse { 50% { opacity: 0.45; } }
.chat-form { display: grid; gap: 10px; }
/* One glass box: textarea on top, controls bar underneath (attach · year · subject · send) */
.chat-box { display: grid; gap: 4px; padding: 8px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--field); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); transition: border-color 0.18s, box-shadow 0.18s; }
.chat-box:focus-within { border-color: color-mix(in oklch, var(--brand) 72%, transparent); box-shadow: 0 0 0 3px var(--brand-soft); }
.chat-box textarea { width: 100%; min-width: 0; resize: none; min-height: 46px; max-height: 180px; padding: 10px 10px 6px; border: 0; background: transparent; font: inherit; line-height: 1.6; color: inherit; caret-color: var(--brand-bright); }
.chat-box textarea:focus { outline: none; }
.chat-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-send { margin-inline-start: auto; min-height: 40px; padding-inline: 20px; }
.chat-tool { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: color 0.18s, background 0.18s, border-color 0.18s; }
.chat-tool:hover, .chat-tool:focus-visible { color: var(--brand-bright); background: var(--brand-soft); border-color: color-mix(in oklch, var(--brand) 40%, transparent); outline: none; }
.chat-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 40px; padding-inline: 12px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: border-color 0.18s, background 0.18s; }
.chat-pill:hover, .chat-pill:focus-within { border-color: color-mix(in oklch, var(--brand) 45%, transparent); background: var(--brand-soft); }
.chat-pill__label { font-size: 0.72rem; color: var(--dim); font-weight: 700; white-space: nowrap; }
.chat-pill select { appearance: none; -webkit-appearance: none; min-width: 0; max-width: 170px; padding: 0 4px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.86rem; font-weight: 600; text-overflow: ellipsis; cursor: pointer; }
.chat-pill select:focus { outline: none; }
.chat-pill select option { background: var(--ink-900); color: var(--text); }
.chat-pill.is-set { border-color: color-mix(in oklch, var(--brand) 40%, transparent); background: var(--brand-soft); }
.chat-attach { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); width: fit-content; max-width: 100%; }
.chat-attach__thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.chat-attach__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em; }
.chat-attach__meta { display: grid; gap: 2px; min-width: 0; }
.chat-attach__meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; font-size: 0.88rem; }
.chat-attach__meta small { color: var(--dim); font-size: 0.74rem; }
.chat-attach__remove { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--field); color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: color 0.18s, background 0.18s; }
.chat-attach__remove:hover, .chat-attach__remove:focus-visible { color: var(--red); background: var(--red-soft); outline: none; }
.chat-msg__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chat-msg__tag { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in oklch, var(--on-brand) 18%, transparent); }
.chat-msg__img { display: block; max-width: min(100%, 260px); max-height: 200px; border-radius: 10px; margin-bottom: 8px; }

@media (max-width: 900px) {
  .chat-plans { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-history { max-height: 220px; }
  .chat-main { height: 68vh; }
  .chat-msg__bubble { max-width: 90%; }
  .chat-list__del { opacity: 1; }
}
@media (max-width: 760px) {
  .chat-meter { width: 100%; }
  .chat-pill { flex: 1 1 130px; }
  .chat-pill select { flex: 1; max-width: none; }
  .chat-send { flex: 1 1 100%; margin-inline-start: 0; }
}


/* ================================================================ calm refinements
   One quiet layer on top of the base styles: flat soft surfaces, no glow or lift, slow gentle transitions. */
body { letter-spacing: 0.003em; }
.screen { animation: screen-in 0.34s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bump { 50% { transform: scale(1.03); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.panel { background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.03)); border-color: var(--line); box-shadow: var(--shadow); }
.plan { background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)); box-shadow: var(--shadow); }
.plan:hover, .option:hover:not(:disabled), .btn--ghost:hover:not(:disabled), .btn--primary:hover:not(:disabled) { transform: none; }
.plan--featured { background: linear-gradient(180deg, var(--brand-soft), rgba(255, 255, 255, 0.03) 60%); box-shadow: var(--shadow); }
.topbar { box-shadow: none; }
.menu, .toast, .account-dialog, .mobile-nav { box-shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.5); }

/* buttons: flat, soft fill; colour change instead of movement */
.btn { transition: background 0.28s ease, color 0.28s ease, border-color 0.28s ease, opacity 0.28s ease; }
.btn--primary { background: var(--brand); border-color: transparent; box-shadow: none; }
.btn--primary:hover:not(:disabled) { background: var(--brand-bright); box-shadow: none; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); border-color: color-mix(in oklch, var(--brand) 32%, transparent); box-shadow: none; }

/* brand mark: tinted tile instead of a glowing gradient */
.brand__mark { background: var(--brand-soft); color: var(--brand-bright); border-color: var(--line-strong); box-shadow: none; }

/* inputs and tiles */
.input input, .input select, .admin__field, .input textarea { box-shadow: none; background: var(--field); transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease; }
.input input:focus, .input select:focus, .admin__field:focus, .input textarea:focus { box-shadow: 0 0 0 3px var(--brand-soft); }
.option { transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, opacity 0.25s ease; }
.live-dot { box-shadow: none; opacity: 0.85; }
.activity-chart__bar { box-shadow: none; }

/* skeletons breathe slowly */
.sk::after { animation-duration: 2.4s; }
.sk-bar i { animation-duration: 2.2s; }

/* ================================================================ language switcher */
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); direction: ltr; flex: 0 0 auto; }
.lang__btn { min-width: 38px; min-height: 36px; padding: 4px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 0.74rem/1 var(--font-latin); letter-spacing: 0.06em; transition: background 0.25s ease, color 0.25s ease; }
.lang__btn:hover { color: var(--text); background: var(--surface-2); }
.lang__btn[aria-pressed='true'] { color: var(--brand-bright); background: var(--brand-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--brand) 28%, transparent); }
.lang__btn:focus-visible { outline-offset: 1px; }
.lang--float { position: fixed; top: 14px; inset-inline-end: 14px; z-index: 60; background: var(--surface-pop); box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.5); }
body:has(#topbar:not([hidden])) .lang--float { display: none; }
/* soft cross-fade when the language changes */
html.lang-soft .shell, html.lang-soft .topbar, html.lang-soft .footer, html.lang-soft .mobile-nav { animation: lang-soft 0.3s ease both; }
@keyframes lang-soft { from { opacity: 0.35; } to { opacity: 1; } }

/* ================================================================ LTR (English / French) adjustments */
[dir='ltr'] .plan__price { justify-content: flex-start; }
/* password reveal button sits on the physical left in RTL pages (inputs there are forced LTR) */
[dir='rtl'] .input__box input { padding-inline-end: 14px; padding-left: 68px; }
[dir='ltr'] body { font-family: var(--font-latin); }
[dir='ltr'] h1 { letter-spacing: -0.025em; }
[dir='ltr'] .brand__copy small, [dir='ltr'] .eyebrow { letter-spacing: 0.1em; }

@media (max-width: 640px) {
  .lang { padding: 2px; border-radius: 10px; }
  .lang__btn { min-width: 32px; min-height: 36px; padding-inline: 6px; font-size: 0.7rem; }
  .lang--float { top: 10px; inset-inline-end: 10px; }
}
@media (max-width: 420px) {
  .topbar__actions .meter { min-width: 0; }
  .topbar .brand__copy { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, html.lang-soft .shell, html.lang-soft .topbar, html.lang-soft .footer, html.lang-soft .mobile-nav { animation: none; }
}

/* top bar stays on one line with the logo + language switcher */
.mainnav a { white-space: nowrap; }
@media (max-width: 1400px) { .topbar .brand__copy small { display: none; } .mainnav a { padding-inline: 11px; } }
@media (max-width: 1180px) { .topbar .brand__copy { display: none; } }
.topbar__inner { gap: clamp(12px, 2vw, 32px); }
.topbar__actions { gap: 8px; flex: 0 0 auto; }
@media (max-width: 1500px) { .topbar .user__name { display: none; } }
@media (max-width: 1320px) { .topbar .xp { display: none; } }
@media (max-width: 1400px) {
  .topbar .brand__copy { display: none; }
  .mainnav a { padding-inline: 9px; font-size: 0.86rem; }
  .mainnav { gap: 2px; }
}
@media (max-width: 640px) {
  .topbar__inner { gap: 8px; padding-inline: 12px; }
  .topbar__actions { gap: 6px; margin-inline-start: auto; }
  .lang__btn { min-width: 28px; padding-inline: 4px; }
  .topbar .meter { min-width: 0; padding-inline: 8px; }
  .topbar .meter .live-dot { display: none; }
  .topbar .user__btn svg { display: none; }
  .topbar .user__btn { padding-inline: 4px; }
}
@media (max-width: 1320px) { .mainnav a { padding-inline: 7px; font-size: 0.84rem; } }
.mobile-nav a { min-width: 0; }
.mobile-nav a span:last-child, .mobile-nav a small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.62rem; }

/* ================================================================ logo (AM.png / AM-icon.png)
   The wordmark is 792x220 (3.6:1). It lives on a soft light tile whose height is fixed and whose width follows the
   image's own aspect ratio, so it is never stretched or cropped: the tile is only a frame (equal padding all round). */
.brand { gap: 12px; }
.brand__mark--logo {
  width: auto; height: 38px; min-width: 0; padding: 5px 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #f4f3fb; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 11px; overflow: hidden;
  box-shadow: 0 6px 18px -14px rgba(0, 0, 0, 0.6);
}
.brand__logo { display: block; height: 100%; width: auto; aspect-ratio: 792 / 220; object-fit: contain; object-position: center; }
.brand .brand__mark--logo, .brand--lg .brand__mark--logo { width: auto; }
.brand--lg .brand__mark--logo { height: 46px; padding: 6px 14px; border-radius: 13px; }
@media (max-width: 640px) {
  .brand .brand__mark--logo { width: auto; height: 32px; padding: 4px 9px; border-radius: 9px; }
  .brand--lg .brand__mark--logo { width: auto; height: 40px; padding: 5px 12px; }
}

/* ---------------------------------------------------------------- privacy policy, cookie consent, account deletion */
.footer__btn { background: none; border: 0; padding: 0; font: inherit; font-size: inherit; cursor: pointer; }
.footer__btn:hover { color: var(--brand-bright); }
.footer__support { padding-inline: 4px; }
.auth__privacy a, .deletion__link, .legal__mail, .consent__more { color: var(--brand-bright); text-decoration: underline; text-underline-offset: 3px; }
.auth__privacy--consent { margin-top: 6px; }

.legal { max-width: 860px; margin-inline: auto; }
.legal__panel { display: grid; gap: 14px; padding: clamp(20px, 4vw, 40px); line-height: 1.85; }
.legal__panel h1 { margin: 6px 0 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.legal__back { justify-self: start; }
.legal__lead { margin: 0; color: var(--muted); font-size: 1.02rem; }
.legal__updated { margin: 0; color: var(--dim); font-size: 0.8rem; }
.legal__sec { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal__sec h2 { margin: 0; font-size: 1.12rem; }
.legal__sec p { margin: 0; color: var(--muted); }
.legal__sec ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; color: var(--muted); }
.legal__table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.legal__table table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 560px; }
.legal__table th, .legal__table td { padding: 10px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal__table th { color: var(--text); background: var(--surface-2); font-weight: 700; }
.legal__table tr:last-child td { border-bottom: 0; }
.legal__table code { direction: ltr; unicode-bidi: isolate; font-family: var(--font-latin); color: var(--brand-bright); }

.consent { position: fixed; z-index: 55; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px; width: min(620px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-pop); box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.45); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); animation: consent-in 0.35s ease both; }
.consent__text { flex: 1; margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.65; }
.consent__actions { display: flex; flex: 0 0 auto; gap: 8px; }
.consent__btn { min-height: 40px; padding: 8px 14px; font-size: 0.8rem; white-space: nowrap; }
@keyframes consent-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.danger-zone { display: grid; gap: 14px; border-color: color-mix(in oklch, var(--red) 22%, var(--line)); }
.danger-zone .btn { justify-self: start; }
.danger-zone p { margin: 0; }
.account-dialog--sm { width: min(520px, calc(100vw - 32px)); }
.delete-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
#delete-form > p { margin: 0; }

.deletion { display: grid; place-items: center; }
.deletion__card { display: grid; gap: 16px; width: min(560px, 100%); padding: clamp(22px, 4vw, 36px); text-align: center; justify-items: center; }
.deletion__card h1, .deletion__card p { margin: 0; }
.deletion__count { display: grid; gap: 2px; justify-items: center; padding: 16px 34px; border-radius: 18px; background: var(--amber-soft); color: var(--amber); }
.deletion__count strong { font: 800 3.2rem/1 var(--font-latin); }
.deletion__date { color: var(--muted); font-size: 0.9rem; }
.deletion__card .row { justify-content: center; }

@media (max-width: 760px) {
  .consent { inset-inline: 12px; width: auto; flex-direction: column; align-items: stretch; gap: 10px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(#topbar[hidden]) .consent { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .consent__actions { justify-content: stretch; }
  .consent__btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } }
.legal__sec ul, .delete-list { list-style: disc; }
.legal__sec li::marker, .delete-list li::marker { color: var(--brand-bright); }

/* ---------------------------------------------------------------- credits: 6ze4 avatar + parent company */
.footer { flex-wrap: wrap; row-gap: 6px; }
.credit__person { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-weight: 700; }
.credit__person b { font-family: var(--font-latin); }
.credit__person:hover { color: var(--brand-bright); }
.credit__avatar { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--brand-soft); }
.credit__avatar img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; display: block; }
.credit__avatar.is-fallback::before { content: attr(data-initial); color: var(--brand-bright); font: 800 0.62rem/1 var(--font-latin); letter-spacing: 0.02em; }
.credit__avatar--lg { width: 36px; height: 36px; }
.credit__avatar--lg.is-fallback::before { font-size: 0.74rem; }
.footer__parent { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
.footer__parent b { color: var(--text); font-family: var(--font-latin); }
.parent__logo { width: 28px; height: 28px; flex: 0 0 auto; padding: 2px; border-radius: 8px; background: #fff; object-fit: contain; }
.parent__logo--lg { width: 44px; height: 44px; padding: 3px; border-radius: 11px; }
.legal__credits { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.legal__parent, .legal__made { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.legal__parent b { color: var(--text); font-family: var(--font-latin); }

/* ---------------------------------------------------------------- subscription plans locked: yellow "coming soon" cover */
.plans-area { position: relative; }
.plans-area.is-locked .plans-area__content { pointer-events: none; user-select: none; opacity: 0.55; filter: saturate(0.8); }
.plans-lock { position: absolute; inset: -6px; z-index: 20; display: grid; place-items: start center; padding: clamp(36px, 14vh, 160px) 16px 24px; border-radius: var(--r-lg); background: color-mix(in oklch, var(--amber-400) 22%, transparent); border: 1px solid color-mix(in oklch, var(--amber-400) 45%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.plans-lock[hidden] { display: none; }
.plans-lock__card { position: sticky; top: calc(50vh - 70px); display: grid; gap: 6px; justify-items: center; max-width: 420px; padding: 22px 34px; border-radius: 20px; text-align: center; background: oklch(0.9 0.15 95); color: oklch(0.28 0.05 80); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.plans-lock__card strong { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.2; font-weight: 800; }
.plans-lock__card span { font-size: 0.9rem; line-height: 1.6; opacity: 0.85; }
