/* ==========================================================================
   StenoAbhyas — brand, redesign layer, scanner studio & motion
   ========================================================================== */

:root {
  --steno-bg: #F8FAFC;
  --steno-card-bg: #FFFFFF;
  --steno-border: #E2E8F0;
  --steno-text-primary: #0F172A;
  --steno-accent-primary: #2563EB;
  --steno-accent-secondary: #0D9488;
  --sa-grad: linear-gradient(135deg, #2563EB 0%, #0D9488 100%);
  --sa-glow: 0 0 0 1px rgba(37, 99, 235, .14), 0 12px 32px -14px rgba(37, 99, 235, .35);
  --sa-ease: cubic-bezier(.22, 1, .36, 1);
  --sa-green: #16A34A;
  --sa-blue: #2563EB;
  --sa-amber: #D97706;
  --steno-radius-lg: 16px;
}
[data-theme="dark"] {
  --steno-bg: #0B1120;
  --steno-card-bg: #111A2E;
  --steno-card-bg-subtle: #172338;
  --steno-border: #22314B;
  --steno-text-primary: #F1F5F9;
  --sa-glow: 0 0 0 1px rgba(96, 165, 250, .22), 0 12px 32px -14px rgba(13, 148, 136, .45);
}
body.steno-body { background: var(--steno-bg); }
.steno-hindi, [lang="hi"] { font-family: 'Noto Sans Devanagari', var(--steno-font-sans); }

/* ---------- Brand lockup ---------- */
.sa-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; white-space: nowrap; }
.sa-emblem { flex: none; display: block; filter: drop-shadow(0 4px 10px rgba(37, 99, 235, .28)); transition: transform .35s var(--sa-ease); }
a:hover > .sa-logo .sa-emblem, .sa-logo:hover .sa-emblem { transform: rotate(-6deg) scale(1.05); }
.sa-word { font-family: 'Inter', var(--steno-font-sans); font-weight: 800; font-size: 20px; letter-spacing: -.025em; }
.sa-steno { color: #0F172A; }
.sa-abhyas { color: #2563EB; }
[data-theme="dark"] .sa-steno { color: #FFFFFF; }
[data-theme="dark"] .sa-abhyas { color: #60A5FA; }
.sa-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: rgba(13, 148, 136, .1); color: #0D9488; border: 1px solid rgba(13, 148, 136, .25); }
.sa-tag-hi { font-family: 'Noto Sans Devanagari', sans-serif; font-weight: 600; font-size: 11.5px; }
.sa-tag-pro { background: var(--sa-grad); color: #fff; border: 0; }
.steno-sidebar-brand .sa-word { font-size: 18px; }
.steno-brand, .steno-sidebar-brand { text-decoration: none !important; }
.steno-footer .sa-word { font-size: 18px; }
.sa-auth-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.sa-auth-brand .sa-word { font-size: 24px; }
.sa-wave { stroke-dasharray: 80; stroke-dashoffset: 0; }
.sa-logo:hover .sa-wave { animation: saDraw 1.1s var(--sa-ease); }
@keyframes saDraw { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }

/* ---------- Cards / surfaces ---------- */
.steno-card, .steno-metric-card, .steno-feature-card, .steno-stat-box, .steno-recommend-card, .steno-auth-card {
  background: var(--steno-card-bg);
  border: 1px solid var(--steno-border);
  border-radius: var(--steno-radius-lg);
  transition: box-shadow .3s var(--sa-ease), transform .3s var(--sa-ease), border-color .3s var(--sa-ease);
}
.steno-card:hover, .steno-metric-card:hover, .steno-feature-card:hover, .steno-stat-box:hover { box-shadow: var(--sa-glow); border-color: rgba(37, 99, 235, .28); }
.steno-metric-card:hover, .steno-feature-card:hover, .steno-stat-box:hover { transform: translateY(-2px); }
.steno-btn-primary { background: var(--sa-grad) !important; border: 0 !important; color: #fff !important; box-shadow: 0 6px 18px -8px rgba(37, 99, 235, .6); transition: transform .2s var(--sa-ease), box-shadow .2s var(--sa-ease), filter .2s; }
.steno-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(37, 99, 235, .65); filter: saturate(1.1); }
.steno-btn:focus-visible, .sa-tool:focus-visible, .sa-seg-btn:focus-visible, .sa-nb-dropzone:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.steno-sidebar { background: var(--steno-card-bg); }
.steno-tab-link.active { background: linear-gradient(90deg, rgba(37, 99, 235, .12), rgba(13, 148, 136, .06)) !important; color: #2563EB !important; box-shadow: inset 3px 0 0 #2563EB; }
.steno-topbar { backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--steno-card-bg) 86%, transparent) !important; z-index: 40; }
.steno-navbar { z-index: 90; }
#steno-topbar-streak-chip { transition: transform .3s var(--sa-ease); }
#steno-topbar-streak-chip.sa-bump { animation: saBump .6s var(--sa-ease); }
@keyframes saBump { 40% { transform: scale(1.12); } }
[data-theme="dark"] #steno-topbar-streak-chip { background: rgba(234, 88, 12, .14) !important; border-color: rgba(234, 88, 12, .3) !important; color: #FDBA74 !important; }

/* ---------- Motion ---------- */
@keyframes fadeSlideUp { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.steno-tab-pane.active.sa-enter > * { animation: fadeSlideUp .5s var(--sa-ease) both; }
.steno-tab-pane.active.sa-enter > *:nth-child(2) { animation-delay: .06s; }
.steno-tab-pane.active.sa-enter > *:nth-child(3) { animation-delay: .12s; }
.steno-tab-pane.active.sa-enter > *:nth-child(4) { animation-delay: .18s; }
.steno-tab-pane.active.sa-enter > *:nth-child(n+5) { animation-delay: .24s; }
.steno-tab-pane.active.sa-enter .steno-metric-card { animation: fadeSlideUp .5s var(--sa-ease) both; }
.steno-tab-pane.active.sa-enter .steno-metric-card:nth-child(2) { animation-delay: .05s; }
.steno-tab-pane.active.sa-enter .steno-metric-card:nth-child(3) { animation-delay: .1s; }
.steno-tab-pane.active.sa-enter .steno-metric-card:nth-child(4) { animation-delay: .15s; }
.steno-tab-pane.active.sa-enter .steno-metric-card:nth-child(5) { animation-delay: .2s; }
.steno-tab-pane.active.sa-enter .steno-metric-card:nth-child(6) { animation-delay: .25s; }
.sa-reveal { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity .6s var(--sa-ease), transform .6s var(--sa-ease); }
.sa-reveal.sa-in { opacity: 1; transform: none; }
.sa-skeleton { display: inline-block; min-width: 120px; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--steno-card-bg-subtle) 0%, var(--steno-border) 50%, var(--steno-card-bg-subtle) 100%); background-size: 200% 100%; animation: saShimmer 1.2s linear infinite; }
@keyframes saShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sa-error-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--steno-error-light, #FEF2F2); color: #B91C1C; font-size: 13px; }

/* ---------- Charts ---------- */
.sa-chart { position: relative; width: 100%; height: 100%; }
.sa-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sa-chart .sa-grid line { stroke: var(--steno-border); stroke-dasharray: 3 4; }
.sa-chart .sa-axis text { fill: var(--steno-text-secondary); font-size: 10px; font-family: Inter, sans-serif; }
.sa-chart .sa-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sa-chart .sa-line.anim { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: saLine 1.2s var(--sa-ease) forwards; }
@keyframes saLine { to { stroke-dashoffset: 0; } }
.sa-chart .sa-area { opacity: 0; animation: saFade .9s .4s var(--sa-ease) forwards; }
@keyframes saFade { to { opacity: 1; } }
.sa-chart .sa-pt { transition: r .15s; cursor: pointer; }
.sa-chart .sa-pt:hover { r: 6; }
.sa-chart .sa-bar { transform-origin: center bottom; transform-box: fill-box; animation: saGrow .8s var(--sa-ease) both; cursor: pointer; transition: filter .15s; }
.sa-chart .sa-bar:hover { filter: brightness(1.12); }
@keyframes saGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.sa-tip { position: absolute; pointer-events: none; z-index: 5; background: #0F172A; color: #fff; font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.sa-tip.show { opacity: 1; }
.sa-legend { display: flex; gap: 14px; font-size: 12px; color: var(--steno-text-secondary); margin-top: 8px; }
.sa-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sa-chart-empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--steno-text-secondary); font-size: 13px; text-align: center; padding: 12px; }

/* ---------- Equalizer ---------- */
.sa-eq { display: flex; align-items: flex-end; gap: 3px; height: 46px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(37, 99, 235, .06), rgba(13, 148, 136, .06)); border: 1px solid var(--steno-border); margin: 12px 0; }
.sa-eq i { flex: 1; min-width: 2px; height: 12%; border-radius: 3px; background: var(--sa-grad); transform-origin: bottom; transition: height .09s linear; opacity: .55; }
.sa-eq.is-live i { opacity: 1; }
.sa-eq-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--steno-text-secondary); }
.sa-eq-dot { width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; }
.sa-eq-wrap.is-live .sa-eq-dot { background: #16A34A; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: saPulse 1.4s infinite; }
@keyframes saPulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ---------- Notebook Scanner Studio ---------- */
.sa-nb-studio { display: flex; flex-direction: column; gap: 18px; }
.sa-nb-selectors { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.sa-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--steno-text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.sa-field select { text-transform: none; letter-spacing: 0; font-weight: 500; }
.sa-seg { display: inline-flex; padding: 4px; border-radius: 10px; background: var(--steno-card-bg-subtle); border: 1px solid var(--steno-border); }
.sa-seg-btn { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; font: 600 13px Inter, sans-serif; color: var(--steno-text-secondary); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.sa-seg-btn.is-active { background: var(--steno-card-bg); color: #2563EB; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.sa-nb-dropzone { position: relative; border: 2px dashed var(--steno-border); border-radius: 16px; padding: 36px 20px; text-align: center; background: var(--steno-card-bg-subtle); transition: border-color .2s, background .2s, transform .2s var(--sa-ease); cursor: pointer; }
.sa-nb-dropzone.is-over { border-color: #2563EB; background: rgba(37, 99, 235, .06); transform: scale(1.01); }
.sa-nb-dropzone.is-busy { pointer-events: none; opacity: .7; }
.sa-nb-drop-icon { color: #2563EB; margin-bottom: 8px; display: flex; justify-content: center; }
.sa-nb-dropzone h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--steno-text-primary); }
.sa-nb-dropzone p { font-size: 13px; color: var(--steno-text-secondary); margin-bottom: 14px; }
.sa-nb-drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sa-nb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--steno-border); border-radius: 12px; background: var(--steno-card-bg-subtle); margin-bottom: 12px; }
.sa-tool { border: 1px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-primary); padding: 7px 11px; border-radius: 8px; font: 600 12.5px Inter, sans-serif; cursor: pointer; transition: border-color .2s, background .2s; }
.sa-tool:hover { border-color: #2563EB; }
.sa-tool[aria-pressed="true"] { background: rgba(37, 99, 235, .1); border-color: #2563EB; color: #2563EB; }
.sa-tool-sep { width: 1px; height: 22px; background: var(--steno-border); margin: 0 2px; }
.sa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid; }
.sa-chip input { accent-color: currentColor; margin: 0; }
.sa-chip-green { color: #15803D; border-color: rgba(22, 163, 74, .35); background: rgba(22, 163, 74, .08); }
.sa-chip-blue { color: #1D4ED8; border-color: rgba(37, 99, 235, .35); background: rgba(37, 99, 235, .08); }
.sa-chip-amber { color: #B45309; border-color: rgba(217, 119, 6, .35); background: rgba(217, 119, 6, .08); }
.sa-chip-line { color: #0F766E; border-color: rgba(13, 148, 136, .35); background: rgba(13, 148, 136, .08); }
.sa-nb-stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sa-nb-canvas-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #0F172A; border: 1px solid var(--steno-border); min-height: 220px; touch-action: none; }
.sa-nb-canvas-wrap canvas { display: block; width: 100%; height: auto; }
#sa-nb-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.sa-nb-canvas-wrap.is-cropping { cursor: crosshair; }
.sa-crop-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, .85); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; }
.sa-scan { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(37, 99, 235, .06), rgba(13, 148, 136, .1)); }
.sa-scan-beam { position: absolute; left: 0; right: 0; height: 3px; top: 0; background: linear-gradient(90deg, transparent, #22D3EE 20%, #fff 50%, #22D3EE 80%, transparent); box-shadow: 0 0 18px 6px rgba(34, 211, 238, .55), 0 -40px 60px 10px rgba(37, 99, 235, .18); animation: saSweep 1.6s ease-in-out infinite alternate; }
@keyframes saSweep { from { transform: translateY(0); } to { transform: translateY(var(--scan-h, 400px)); } }
.sa-nb-metrics { border: 1px solid var(--steno-border); border-radius: 12px; padding: 14px; background: var(--steno-card-bg); display: flex; flex-direction: column; gap: 14px; }
.sa-nb-status { font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 8px; background: var(--steno-card-bg-subtle); color: var(--steno-text-secondary); }
.sa-nb-status.ok { background: rgba(22, 163, 74, .1); color: #15803D; }
.sa-nb-status.warn { background: rgba(217, 119, 6, .1); color: #B45309; }
.sa-nb-status.err { background: rgba(220, 38, 38, .1); color: #B91C1C; }
.sa-nb-status.busy { background: rgba(37, 99, 235, .1); color: #1D4ED8; }
.sa-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sa-m { padding: 10px; border-radius: 10px; background: var(--steno-card-bg-subtle); display: flex; flex-direction: column; gap: 2px; }
.sa-m span { font-size: 11px; color: var(--steno-text-secondary); font-weight: 600; }
.sa-m strong { font-size: 20px; font-weight: 800; color: var(--steno-text-primary); font-variant-numeric: tabular-nums; }
.sa-bar-group { display: flex; flex-direction: column; gap: 5px; }
.sa-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--steno-text-secondary); }
.sa-bar-label b { color: var(--steno-text-primary); font-variant-numeric: tabular-nums; }
.sa-bar { height: 8px; border-radius: 6px; background: var(--steno-card-bg-subtle); overflow: hidden; }
.sa-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: #2563EB; transition: width .9s var(--sa-ease); }
.sa-bar i.sa-teal { background: #0D9488; }
.sa-note { font-size: 11.5px; line-height: 1.5; color: var(--steno-text-secondary); margin: 0; }
.sa-nb-history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sa-nb-history-head h4 { font-size: 15px; font-weight: 700; margin: 0; }
.sa-nb-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.sa-hist { border: 1px solid var(--steno-border); border-radius: 12px; overflow: hidden; background: var(--steno-card-bg); cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; transition: box-shadow .25s var(--sa-ease), transform .25s var(--sa-ease); animation: fadeSlideUp .45s var(--sa-ease) both; }
.sa-hist:hover { box-shadow: var(--sa-glow); transform: translateY(-2px); }
.sa-hist-thumb { aspect-ratio: 4 / 3; background: var(--steno-card-bg-subtle) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--steno-text-secondary); }
.sa-hist-body { padding: 10px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sa-hist-body strong { font-size: 13px; }
.sa-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--steno-card-bg-subtle); color: var(--steno-text-secondary); width: fit-content; }
.sa-pill.ok { background: rgba(22, 163, 74, .12); color: #15803D; }
.sa-pill.warn { background: rgba(217, 119, 6, .12); color: #B45309; }
.sa-empty { grid-column: 1 / -1; color: var(--steno-text-secondary); font-size: 13px; padding: 14px; border: 1px dashed var(--steno-border); border-radius: 12px; text-align: center; }

/* ---------- Homepage hero mockup ---------- */
.steno-hero-section { position: relative; overflow: hidden; }
.steno-hero-section::before { content: ""; position: absolute; inset: -30% -10% auto; height: 520px; background: radial-gradient(600px 300px at 20% 30%, rgba(37, 99, 235, .14), transparent 70%), radial-gradient(500px 260px at 80% 20%, rgba(13, 148, 136, .14), transparent 70%); pointer-events: none; z-index: 0; }
.steno-hero-section > .steno-container { position: relative; z-index: 1; }
.sa-hero-mock { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; max-width: 980px; margin: 36px auto 8px; text-align: left; }
.sa-mock-card { position: relative; background: var(--steno-card-bg); border: 1px solid var(--steno-border); border-radius: 18px; padding: 14px 16px 16px; box-shadow: 0 24px 60px -30px rgba(37, 99, 235, .45); overflow: hidden; }
.sa-mock-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--steno-text-secondary); margin-bottom: 8px; }
.sa-mock-head em { font-style: normal; font-weight: 600; margin-left: 4px; }
.sa-dot { width: 9px; height: 9px; border-radius: 50%; }
.sa-dot.r { background: #F87171; } .sa-dot.y { background: #FBBF24; } .sa-dot.g { background: #34D399; }
.sa-mock-acc { margin-left: auto; font-weight: 600; } .sa-mock-acc b { color: #16A34A; }
.sa-mock-strokes { width: 100%; height: auto; background: repeating-linear-gradient(180deg, transparent 0 54px, rgba(37, 99, 235, .0) 54px 55px); }
.sa-ruled line { stroke: rgba(37, 99, 235, .25); stroke-width: 1; }
.sa-ink { fill: none; stroke: var(--steno-text-primary); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: saInk 7s var(--sa-ease) infinite; }
.sa-ink.s2 { animation-delay: .5s; } .sa-ink.s3 { animation-delay: 1s; } .sa-ink.s4 { animation-delay: 1.5s; } .sa-ink.s5 { animation-delay: 2s; }
.sa-ink.s6 { animation-delay: 2.5s; } .sa-ink.s7 { animation-delay: 3s; } .sa-ink.s8 { animation-delay: 3.5s; } .sa-ink.s9 { animation-delay: 4s; }
@keyframes saInk { 0% { stroke-dashoffset: 160; } 14%, 86% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.sa-mock-scan { position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: linear-gradient(90deg, transparent, #22D3EE, transparent); box-shadow: 0 0 14px 4px rgba(34, 211, 238, .45); animation: saMockScan 3.5s ease-in-out infinite; }
@keyframes saMockScan { 0%, 100% { transform: translateY(0); opacity: .2; } 50% { transform: translateY(150px); opacity: 1; } }
.sa-mock-text { font-size: 14px; line-height: 1.9; color: var(--steno-text-primary); margin: 4px 0 10px; }
.sa-mk { border-radius: 5px; padding: 1px 3px; transition: background .4s, color .4s, box-shadow .4s; }
.sa-mk.on.full { background: rgba(220, 38, 38, .12); color: #DC2626; text-decoration: line-through; box-shadow: inset 0 -2px 0 #DC2626; }
.sa-mk.on.half { background: rgba(217, 119, 6, .14); color: #B45309; box-shadow: inset 0 -2px 0 #D97706; }
.sa-mk.on.ok { background: rgba(22, 163, 74, .12); color: #15803D; }
.sa-mock-legend { display: flex; gap: 12px; font-size: 11px; color: var(--steno-text-secondary); }
.sa-mock-legend .lg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.lg.full::before { background: #DC2626; } .lg.half::before { background: #D97706; } .lg.ok::before { background: #16A34A; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .sa-nb-stage { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sa-nb-selectors, .sa-hero-mock { grid-template-columns: 1fr; }
  .sa-word { font-size: 18px; }
  .sa-tag { display: none; }
  .steno-sidebar .sa-tag { display: inline-flex; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .sa-reveal { opacity: 1; transform: none; }
  .sa-ink { animation: none !important; stroke-dashoffset: 0; }
  .sa-scan-beam, .sa-mock-scan { display: none; }
}

/* ==========================================================================
   100% FREE mode: voice panel, live words, Hindi keyboard, quizzes, toast
   ========================================================================== */
.sa-free-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--sa-grad); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 6px 16px -8px rgba(13, 148, 136, .7); }
.sa-bilingual { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.sa-bilingual span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-secondary); }
.sa-bilingual span[lang="hi"] { font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-speed-grid { display: flex !important; flex-wrap: wrap; gap: 6px; }
.sa-speed-grid .steno-wpm-pill { min-width: 46px; }
.sa-voice-panel { margin: 14px 0; padding: 14px; border: 1px solid var(--steno-border); border-radius: 14px; background: var(--steno-card-bg-subtle); display: flex; flex-direction: column; gap: 12px; }
.sa-vp-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sa-vp-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: var(--steno-text-secondary); text-transform: uppercase; letter-spacing: .04em; min-width: 140px; }
.sa-vp-field select { font: 500 13px Inter, sans-serif; text-transform: none; letter-spacing: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-primary); }
.sa-vp-wide { flex: 1 1 240px; }
.sa-vp-inline { min-width: 130px; }
.sa-voice-hint { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--steno-text-muted, #94A3B8); }
.sa-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--steno-text-primary); cursor: pointer; }
.sa-switch input { position: absolute; opacity: 0; pointer-events: none; }
.sa-switch span { width: 36px; height: 20px; border-radius: 999px; background: var(--steno-border); position: relative; transition: background .2s; flex: none; }
.sa-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--sa-ease); }
.sa-switch input:checked + span { background: #0D9488; }
.sa-switch input:checked + span::after { transform: translateX(16px); }
.sa-switch input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.sa-live-text { font-size: 18px; line-height: 1.8; padding: 12px 14px; border-radius: 10px; background: var(--steno-card-bg); border: 1px solid var(--steno-border); color: var(--steno-text-secondary); }
.sa-live-text[lang="hi"] { font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-live-text span { transition: color .15s, background .15s; border-radius: 4px; padding: 0 1px; }
.sa-live-text span.done { color: var(--steno-text-primary); }
.sa-live-text span.now { color: #fff; background: #2563EB; }
.sa-live-wpm { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; color: #0D9488; background: rgba(13, 148, 136, .1); padding: 2px 8px; border-radius: 999px; margin-right: 8px; vertical-align: 3px; }
.sa-drill-word { font-size: 28px; font-weight: 800; padding: 2px 10px !important; }
.sa-countdown .sa-cd-title { font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.sa-countdown .sa-cd-sub { font-size: 14px; color: #94A3B8; margin-top: 10px; font-family: 'Noto Sans Devanagari', Inter, sans-serif; }
.sa-cd-num.pop { animation: saPop .5s var(--sa-ease); }
@keyframes saPop { from { transform: scale(1.5); opacity: .3; } to { transform: none; opacity: 1; } }
.sa-hindi-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.sa-hb-label { font-size: 12px; font-weight: 700; color: var(--steno-text-secondary); }
.sa-hb { border: 1px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-primary); border-radius: 999px; padding: 5px 12px; font: 600 12px Inter, 'Noto Sans Devanagari', sans-serif; cursor: pointer; }
.sa-hb.is-active { background: var(--sa-grad); color: #fff; border-color: transparent; }
.sa-hb-hint { flex-basis: 100%; font-size: 11px; color: var(--steno-text-secondary); }
.sa-hindi-input { font-family: 'Noto Sans Devanagari', Mangal, sans-serif !important; }
.sa-device-note { font-size: 12px; color: var(--steno-text-secondary); margin-top: 10px; }
.sa-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: #0F172A; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 99999; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); transition: opacity .3s, transform .3s var(--sa-ease); max-width: calc(100vw - 32px); }
.sa-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Quizzes */
.sa-quiz-wrap { max-width: 820px; margin: 40px auto 64px; padding: 0 16px; }
.sa-quiz-head { text-align: center; margin-bottom: 20px; }
.sa-quiz-head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin: 12px 0 8px; color: var(--steno-text-primary); }
.sa-quiz-head h1 span { font-family: 'Noto Sans Devanagari', sans-serif; color: #0D9488; }
.sa-quiz-head p { color: var(--steno-text-secondary); }
.sa-quiz-modes { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--steno-card-bg-subtle); border: 1px solid var(--steno-border); margin-bottom: 16px; }
.sa-quiz-modes .sa-seg-btn { flex: 1 1 160px; }
.sa-quiz-card { background: var(--steno-card-bg); border: 1px solid var(--steno-border); border-radius: 18px; padding: 24px; box-shadow: 0 24px 60px -36px rgba(37, 99, 235, .5); min-height: 260px; }
.sa-quiz-q { animation: fadeSlideUp .45s var(--sa-ease) both; }
.sa-quiz-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; color: var(--steno-text-secondary); margin-bottom: 10px; }
.sa-quiz-progress { flex: 1; height: 6px; border-radius: 6px; background: var(--steno-card-bg-subtle); overflow: hidden; }
.sa-quiz-progress i { display: block; height: 100%; background: var(--sa-grad); transition: width .5s var(--sa-ease); }
.sa-quiz-q h3 { font-size: 20px; font-weight: 700; margin: 6px 0 16px; color: var(--steno-text-primary); }
.sa-quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sa-quiz-opt { text-align: left; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-primary); font: 600 15px Inter, 'Noto Sans Devanagari', sans-serif; cursor: pointer; transition: transform .2s var(--sa-ease), border-color .2s, background .2s; }
.sa-quiz-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: #2563EB; }
.sa-quiz-opt.ok { border-color: #16A34A; background: rgba(22, 163, 74, .1); color: #15803D; }
.sa-quiz-opt.bad { border-color: #DC2626; background: rgba(220, 38, 38, .08); color: #B91C1C; animation: saShake .4s; }
@keyframes saShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sa-quiz-ex { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--steno-card-bg-subtle); font-size: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sa-quiz-ex p { margin: 0; color: var(--steno-text-secondary); font-size: 13px; }
.sa-quiz-score { text-align: center; margin-top: 12px; font-weight: 700; color: var(--steno-text-secondary); }
.sa-quiz-done { text-align: center; padding: 20px 0; }
.sa-quiz-big { font-size: 48px; font-weight: 800; background: var(--sa-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sa-muted { color: var(--steno-text-secondary); font-size: 13px; margin-bottom: 14px; }
#teacher-subtab-notebooks, #steno-topbar-quota-chip, .steno-sidebar-brand-badge { display: none !important; }
@media (max-width: 600px) { .sa-quiz-opts { grid-template-columns: 1fr; } }
.steno-sidebar-nav .sa-plain-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--steno-radius-md); color: var(--steno-text-secondary); font-size: 14px; font-weight: 500; text-decoration: none; border: 1px solid transparent; transition: var(--steno-transition); }
.steno-sidebar-nav .sa-plain-link:hover { background: var(--steno-card-bg-subtle); color: var(--steno-text-primary); }
.steno-sidebar-nav .sa-plain-link .steno-tab-label { font-family: Inter, 'Noto Sans Devanagari', sans-serif; }

/* ==========================================================================
   Practice Library + Visual Dictionary
   ========================================================================== */
.sa-lib, .sa-vd { margin: 8px 0 32px; }
.sa-lib-head h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; letter-spacing: -.02em; margin: 10px 0 4px; color: var(--steno-text-primary); }
.sa-lib-head h2 span { font-family: 'Noto Sans Devanagari', sans-serif; color: #0D9488; font-weight: 700; }
.sa-lib-sub { color: var(--steno-text-secondary); font-size: 14px; margin: 0 0 14px; }
.sa-lib-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; position: sticky; top: 0; z-index: 5; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--steno-card-bg) 92%, transparent); border: 1px solid var(--steno-border); backdrop-filter: blur(8px); }
body.admin-bar .sa-lib-filters { top: 32px; }
.sa-lib-filters input[type=search] { flex: 1 1 220px; min-width: 0; }
.sa-lib-filters select { flex: 0 1 190px; min-width: 0; }
.sa-lib-series { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sa-series-chip { border: 1px solid var(--steno-border); background: var(--steno-card-bg); color: var(--steno-text-secondary); border-radius: 999px; padding: 6px 12px; font: 600 12px Inter, 'Noto Sans Devanagari', sans-serif; cursor: pointer; transition: all .2s var(--sa-ease); }
.sa-series-chip b { color: #2563EB; margin-left: 4px; }
.sa-series-chip:hover { border-color: #2563EB; color: var(--steno-text-primary); }
.sa-series-chip.is-active { background: var(--sa-grad); color: #fff; border-color: transparent; }
.sa-series-chip.is-active b { color: #fff; }
.sa-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sa-set { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; background: var(--steno-card-bg); border: 1px solid var(--steno-border); animation: fadeSlideUp .45s var(--sa-ease) both; transition: transform .25s var(--sa-ease), box-shadow .25s var(--sa-ease), border-color .25s; }
.sa-set:hover { transform: translateY(-3px); box-shadow: var(--sa-glow); border-color: rgba(37, 99, 235, .3); }
.sa-set[lang="hi"] h3 { font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-set-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sa-set-series { font-size: 11px; font-weight: 700; color: #0D9488; text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-lang { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; flex: none; }
.sa-lang.en { background: rgba(37, 99, 235, .1); color: #2563EB; }
.sa-lang.hi { background: rgba(13, 148, 136, .12); color: #0F766E; font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-set h3 { font-size: 16px; font-weight: 700; line-height: 1.35; margin: 0; color: var(--steno-text-primary); }
.sa-set-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--steno-text-secondary); }
.sa-set-exams { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-set-exams span { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--steno-card-bg-subtle); color: var(--steno-text-secondary); border: 1px solid var(--steno-border); }
.sa-set-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.sa-lib-more { text-align: center; margin-top: 16px; }
.sa-vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.sa-vcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--steno-card-bg); border: 1px solid var(--steno-border); animation: fadeSlideUp .45s var(--sa-ease) both; transition: transform .25s var(--sa-ease), box-shadow .25s var(--sa-ease); }
.sa-vcard:hover { transform: translateY(-3px); box-shadow: var(--sa-glow); }
.sa-vcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sa-vsys { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #fff; background: #2563EB; }
.sa-vsys.s-gregg { background: #7C3AED; } .sa-vsys.s-teeline { background: #DB2777; } .sa-vsys.s-hindi_rishi { background: #0D9488; font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-vtype { font-size: 11px; color: var(--steno-text-secondary); text-transform: capitalize; }
.sa-vpad-wrap { border-radius: 10px; overflow: hidden; border: 1px solid var(--steno-border); }
.sa-pad { display: block; width: 100%; height: auto; background: #fffdf5; }
[data-theme="dark"] .sa-pad { background: #1b2436; }
.sa-pad line.g { stroke: #bfdbfe; stroke-width: .5; }
.sa-pad line.m { stroke: #60a5fa; stroke-width: .8; }
.sa-pad .ink { fill: none; stroke: #0f172a; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .sa-pad .ink { stroke: #f1f5f9; }
.sa-pad .ink.light { stroke-width: 2; } .sa-pad .ink.heavy { stroke-width: 4.4; }
.sa-pad .ph { font: 600 7px Inter, 'Noto Sans Devanagari', sans-serif; fill: #94a3b8; }
.sa-vcard h3 { font-size: 17px; font-weight: 800; margin: 4px 0 0; color: var(--steno-text-primary); }
.sa-vcard h3[lang="hi"], .sa-vhi { font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-ven { font-size: 13px; color: var(--steno-text-primary); margin: 0; }
.sa-vhi { font-size: 13px; color: #0F766E; font-weight: 600; margin: 0; }
.sa-vpos { font-size: 11px; color: #2563EB; font-weight: 700; margin: 0; text-transform: capitalize; }
.sa-vnote { font-size: 12px; color: var(--steno-text-secondary); margin: 0; line-height: 1.45; }
.sa-vactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.sa-vactions .sa-tool { font-size: 11.5px; padding: 6px 9px; }
.sa-vactions .sa-tool:disabled { opacity: .45; cursor: not-allowed; }
.sa-vrec { font-size: 11px; font-weight: 700; color: #2563EB; }
.sa-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: saFade .2s both; }
.sa-modal-card { position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--steno-card-bg); color: var(--steno-text-primary); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: fadeSlideUp .3s var(--sa-ease) both; }
.sa-modal-card h3 { font-size: 20px; font-weight: 800; margin: 0 30px 6px 0; }
.sa-modal-card h3 small { font-size: 12px; color: var(--steno-text-secondary); font-weight: 600; }
.sa-modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--steno-border); background: var(--steno-card-bg); cursor: pointer; font-size: 14px; color: var(--steno-text-primary); }
.sa-trace-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: center; }
canvas.sa-trace { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--steno-border); touch-action: none; cursor: crosshair; background: #fffdf5; }
.sa-trace-result { margin-top: 10px; font-size: 14px; }
.sa-trace-score b { font-size: 32px; font-weight: 800; background: var(--sa-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sa-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.sa-cmp-col { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--steno-border); border-radius: 12px; background: var(--steno-card-bg-subtle); }
.sa-cmp-col strong { font-size: 16px; } .sa-cmp-col strong[lang="hi"] { font-family: 'Noto Sans Devanagari', sans-serif; }
.sa-cmp-col small { color: var(--steno-text-secondary); text-transform: capitalize; }
.sa-cmp-col p { font-size: 12px; color: var(--steno-text-secondary); margin: 0; }
@media (max-width: 600px) { .sa-lib-filters { position: static; } .sa-lib-filters select { flex: 1 1 45%; } }
