/* Shared tokens and components; loaded after module styles. */
:root{color-scheme:light;--accent:#1f4fd8;--accent-hover:#173ba5;--on-accent:#ffffff;--accent-soft:#eaf0ff;--secondary:#ffb800;--on-secondary:#182338;
--neutral-0:#ffffff;--neutral-50:#f5f7fb;--neutral-100:#e9eef6;--neutral-300:#bac5d5;--neutral-500:#64748b;--neutral-700:#334155;--neutral-900:#0f1f3d;
--canvas:#f5f7fb;--surface:#ffffff;--surface-alt:#e9eef6;--text:#0f1f3d;--text-muted:#4b5d75;--border:#7b8ba3;
--success:#155d36;--success-bg:#edf8f1;--warning:#725000;--warning-bg:#fff4d6;--danger:#9b2533;--danger-bg:#fff0f1;--focus:#1f4fd8;
--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;--space-8:32px;--space-12:48px;
--radius-sm:8px;--radius-md:12px;--radius-lg:20px;--radius-pill:999px;--shadow-sm:0 2px 8px #0f1f3d0a;--shadow-md:0 12px 32px #0f1f3d12;
--font-sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--text-caption:.875rem;--text-body:1rem;--text-lead:1.125rem;--text-h3:1.25rem;--text-h2:clamp(1.5rem,3vw,2rem);--text-h1:clamp(2rem,4vw,3rem);--motion:180ms;
--navy:var(--text);--blue:var(--accent);--yellow:var(--secondary);--muted:var(--text-muted);--line:var(--border);--paper:var(--surface-alt);--white:var(--surface)}
:root[data-theme=dark]{color-scheme:dark;--canvas:#101827;--surface:#182338;--surface-alt:#202e45;--text:#f1f5fb;--text-muted:#b8c5d9;--border:#52647e;--accent:#aac4ff;--accent-hover:#c3d4ff;--on-accent:#10224b;--accent-soft:#24395e;--secondary:#ffd166;--on-secondary:#241b00;--success:#a3e5bc;--success-bg:#183929;--warning:#ffdb8a;--warning-bg:#443416;--danger:#ffb5b5;--danger-bg:#46252d;--focus:#ffd166;--shadow-sm:0 2px 8px #0003;--shadow-md:0 12px 32px #0004;}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--canvas:#101827;--surface:#182338;--surface-alt:#202e45;--text:#f1f5fb;--text-muted:#b8c5d9;--border:#52647e;--accent:#aac4ff;--accent-hover:#c3d4ff;--on-accent:#10224b;--accent-soft:#24395e;--secondary:#ffd166;--on-secondary:#241b00;--success:#a3e5bc;--success-bg:#183929;--warning:#ffdb8a;--warning-bg:#443416;--danger:#ffb5b5;--danger-bg:#46252d;--focus:#ffd166;--shadow-sm:0 2px 8px #0003;--shadow-md:0 12px 32px #0004;}}
html{font-size:16px;scroll-padding-top:var(--space-6)}body{font-family:var(--font-sans);font-size:var(--text-body);line-height:1.55;background:var(--canvas);color:var(--text)}
h1,h2,h3,h4{line-height:1.4;letter-spacing:-.025em;text-wrap:balance;overflow-wrap:anywhere}h1,.page-heading h1,.practice h1,.auth-intro h1{font-size:var(--text-h1)}h2,.practice h2{font-size:var(--text-h2)}h3{font-size:var(--text-h3)}h4{font-size:var(--text-body)}
.hero h1{font-size:clamp(2.5rem,6vw,4.5rem);line-height:1.15}.lead{line-height:1.6}.feature p,.section-heading>p,.form-card>p,details p,.practice-topic-progress p{font-size:var(--text-body)}
small,.quiet,.feature p,.footer,.link-button{color:var(--text-muted)}small,.eyebrow,.badge,.hero-note,.footer,.form-bottom,.text-link,.form-row{font-size:var(--text-caption)}.eyebrow{letter-spacing:.09em}.feature-number{font-size:var(--text-body)}
a{color:var(--accent);text-underline-offset:3px}main p a:not(.button),.billing-table a{text-decoration:underline}img{max-width:100%}figure{min-width:0}
:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--focus);outline-offset:3px}button,a,input,select,textarea,summary{transition:background-color var(--motion),border-color var(--motion),color var(--motion),box-shadow var(--motion)}
.header{max-width:none;background:var(--surface);padding:var(--space-4) max(var(--space-4),calc((100vw - 1400px)/2));min-height:88px;gap:var(--space-6);flex-wrap:wrap}.brand{flex-shrink:0;background:#fff;border-radius:var(--radius-sm);padding:var(--space-2)}.brand img{width:208px}
.site-menu{border:0;padding:0;margin:0;flex:1;min-width:0}.site-menu>summary{display:none}.header nav{flex-wrap:wrap;justify-content:flex-end;gap:var(--space-3);font-size:var(--text-body)}.header nav>a,.header nav button{min-height:44px;display:inline-flex;align-items:center;padding:var(--space-2);border-radius:var(--radius-sm)}.header nav [aria-current=page]{background:var(--accent-soft);color:var(--accent)!important;text-decoration:underline;font-weight:750}.theme-control{display:flex;align-items:center;gap:var(--space-2);margin:0;font-size:var(--text-caption);font-weight:600}.theme-control select{width:auto;min-height:44px;padding:8px;max-width:140px}
.container{width:100%;max-width:1200px;padding-inline:var(--space-6)}.dashboard{padding-block:var(--space-12)}.actions{gap:var(--space-4);margin-top:var(--space-6)}
.feature,.form-card,.branch-panel,.bank-row,.road-marker,.art-card{background:var(--surface);border-color:var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}.feature,.form-card,.branch-panel{padding:var(--space-6)}.feature-grid,.billing-columns,.account-grid,.practice-modes{gap:var(--space-6)}.feature-grid>*{min-width:0}.hero-art{background:var(--surface-alt)}.road{border-color:#0f1f3d}.road-marker span,.feature-number,.badge{background:var(--accent-soft);color:var(--accent)}.badge.muted{background:var(--surface-alt);color:var(--text-muted)}
.button{background:var(--accent);border:1px solid var(--accent);color:var(--on-accent);border-radius:var(--radius-md);min-height:48px;padding:var(--space-3) var(--space-6);gap:var(--space-3);font-size:var(--text-body);line-height:1.5;box-shadow:none}.button:hover{background:var(--accent-hover);border-color:var(--accent-hover);color:var(--on-accent)}.button-yellow{background:var(--secondary);border-color:var(--secondary);color:var(--on-secondary)}.button-yellow:hover{background:var(--secondary);border-color:var(--text);color:var(--on-secondary)}
.button-secondary,.actions .button:not(:first-child),.feature-grid .feature .button,.branch-gallery .feature .button{background:var(--surface);color:var(--accent);border-color:var(--border)}.button-secondary:hover,.actions .button:not(:first-child):hover,.feature-grid .feature .button:hover{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}.link-button{text-decoration:underline;min-height:44px}.button:disabled,button:disabled,input:disabled,select:disabled,textarea:disabled{opacity:1;color:var(--text-muted);background:var(--surface-alt);border-color:var(--border);cursor:not-allowed}.button[aria-disabled=true]{cursor:progress}
label,.branch-form label,.billing-form label{font-size:var(--text-body);line-height:1.5}.branch-panel-heading p,.branch-panel>.quiet,.branch-category-fieldset>.quiet{font-size:var(--text-caption)}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.billing-form input:not([type=checkbox]):not([type=radio]),.billing-form select,.billing-form textarea,.billing-filters input,.billing-filters select{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);min-height:48px;padding:var(--space-3);max-width:100%}
input::placeholder,textarea::placeholder{color:var(--text-muted);opacity:1}input[readonly]{background:var(--surface-alt)!important}input[type=checkbox],input[type=radio]{accent-color:var(--accent);flex-shrink:0}.billing-check,.checkbox{font-size:var(--text-body);line-height:1.5}input[type=file]::file-selector-button{font:inherit;background:var(--surface-alt);color:var(--text);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px;margin-right:12px}
fieldset{border:1px solid var(--border);border-radius:var(--radius-md);min-width:0}legend{font-weight:700}.branch-category-fieldset{border:0}.branch-category span{background:var(--surface-alt);border-color:var(--border);color:var(--text);font-size:var(--text-body)}.branch-category span::before{background:var(--surface);border-color:var(--border)}.branch-category input:checked+span{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.branch-category input:checked+span::before{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.branch-category input:focus-visible+span{outline-color:var(--focus)}.branch-save-bar{background:var(--surface);border-color:var(--border)}
.notice,.error-box,.notice-warning{font-size:var(--text-body);border:1px solid currentColor;border-radius:var(--radius-md);padding:var(--space-4) var(--space-6)}.notice{background:var(--success-bg);color:var(--success)}.notice p,.notice h2,.notice h3{color:inherit}.error-box{background:var(--danger-bg);color:var(--danger)}.notice-warning{background:var(--warning-bg);color:var(--warning)}.field-error{color:var(--danger);font-size:var(--text-caption);line-height:1.5;display:block;margin-block:var(--space-1) var(--space-2)}[aria-invalid=true]{border-color:var(--danger)!important;outline-color:var(--danger)!important}.form-state{font-size:var(--text-caption);color:var(--text-muted);margin:var(--space-2) 0}.form-state:empty{display:none}.is-submitting{cursor:progress}.is-submitting button[type=submit]::after{content:"";width:1em;height:1em;display:inline-block;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ui-spin 800ms linear infinite;margin-left:8px}.skeleton{background:var(--surface-alt);border-radius:var(--radius-sm);min-height:1em;animation:ui-pulse 1.5s ease-in-out infinite}
.billing-table{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);max-width:100%;overscroll-behavior-inline:contain}.billing-table th{background:var(--surface-alt);color:var(--text)}.billing-table td,.billing-table th{border-color:var(--border);font-size:var(--text-body)}.billing-table td{overflow-wrap:anywhere}.billing-price{color:var(--text)}.billing-filters{padding:var(--space-4);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}
.welcome-panel,.practice-exam{background:#152b50;color:#f1f5fb}.welcome-panel h2,.practice-exam h2,.practice-exam p,.practice-exam li{color:#f1f5fb}.welcome-panel .quiet,.practice-exam .quiet,.practice-exam .eyebrow{color:#cad8ef}.practice-exam .notice{background:var(--success-bg);color:var(--success)}.practice-stats article,.practice-explanation{background:var(--surface);border:1px solid var(--border)}.practice-navigation a{min-width:44px;min-height:44px;color:var(--text)}.practice-navigation .answered{background:var(--accent-soft);border-color:var(--accent)}.practice-option{font-size:var(--text-body)}label.practice-option:has(input:checked){background:var(--accent-soft);border-color:var(--accent)}.option-correct,.answer-preview .correct{background:var(--success-bg);border-color:var(--success)}.option-wrong{background:var(--danger-bg);border-color:var(--danger)}.practice-verdict.correct,.answer-preview strong{color:var(--success)}.practice-verdict.incorrect{color:var(--danger)}.practice-image,.question-image,.ket-sign-images img,.ket-diagram{background:#fff;border-radius:var(--radius-sm);padding:var(--space-2)}
.skip{z-index:100;background:var(--accent);color:var(--on-accent)}.footer{font-size:var(--text-caption);gap:var(--space-6)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}[hidden]{display:none!important}
@keyframes ui-spin{to{transform:rotate(360deg)}}@keyframes ui-pulse{50%{opacity:.55}}
@media(max-width:1100px){.header{gap:var(--space-3)}.site-menu{flex-basis:100%}.header nav{justify-content:flex-start}.site-menu>summary{display:list-item;min-height:44px;padding:var(--space-2);font-size:var(--text-body)}.header nav{padding-top:var(--space-3)}.header form{margin-left:0}}
@media(max-width:760px){.container{padding-inline:var(--space-4)}.dashboard{padding-block:var(--space-8)}.feature,.form-card,.branch-panel{padding:var(--space-4)}.feature-grid,.billing-columns,.account-grid,.practice-modes,.auth-layout{grid-template-columns:1fr}.header nav{gap:var(--space-2);align-items:flex-start}.theme-control{flex-wrap:wrap}.page-heading{align-items:flex-start}.branch-save-bar{position:static}.branch-save-actions{flex-wrap:wrap}.bank-filters{grid-template-columns:1fr}.hero h1{font-size:clamp(2.2rem,9vw,3.5rem)}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
