:root{color-scheme:light dark;--bg:#f5f7fb;--panel:#fff;--text:#162437;--muted:#536176;--primary:#245bb5;--on-primary:#fff;--line:#cdd6e3;--error:#a52b25;--focus:#245bb5;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:16px;background:var(--bg);color:var(--text)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#111923;--panel:#1b2939;--text:#e8eef7;--muted:#b0bed1;--primary:#abc9ff;--on-primary:#102c54;--line:#3f5066;--error:#ffb4ac;--focus:#abc9ff}}
:root[data-theme=dark]{color-scheme:dark;--bg:#111923;--panel:#1b2939;--text:#e8eef7;--muted:#b0bed1;--primary:#abc9ff;--on-primary:#102c54;--line:#3f5066;--error:#ffb4ac;--focus:#abc9ff}:root[data-theme=light]{color-scheme:light}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--primary);min-height:44px;padding:9px 14px;font-size:.875rem;font-weight:650;transition:background-color .15s ease}button:hover{background:color-mix(in srgb,var(--primary) 12%,var(--panel))}button:active{background:color-mix(in srgb,var(--primary) 20%,var(--panel))}button:disabled{opacity:.55;cursor:wait}button.primary{background:var(--primary);color:var(--on-primary);border-color:var(--primary)}button.primary:hover{filter:brightness(.94)}button.text{border:0;background:transparent;padding:8px 0;text-align:left}button[aria-pressed=true]{background:var(--primary);color:var(--on-primary);border-color:var(--primary)}:focus-visible{outline:3px solid var(--focus);outline-offset:3px}input,select{width:100%;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:6px;padding:10px;background:var(--panel);color:var(--text);caret-color:var(--primary)}input::placeholder{color:var(--muted);opacity:1}input:disabled,select:disabled{opacity:.55}label{display:block;font-size:.8125rem;font-weight:650;margin:0 0 6px}h1,h2,p{margin:0}h1{font-size:1.5rem;line-height:1.25;font-weight:750;overflow-wrap:anywhere}h2{font-size:1.125rem;line-height:1.35;margin-bottom:12px}p{line-height:1.55}p+p{margin-top:10px}.muted{color:var(--muted);font-size:.875rem}.topbar{max-width:1328px;margin:auto;padding:14px 24px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-size:1.125rem;font-weight:750;white-space:nowrap}.brand img{border-radius:8px}.topbar nav{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.theme{margin:0}.theme select{font-size:.8125rem;padding-right:8px;min-height:44px}main{max-width:1160px;margin:0 auto;padding:28px 24px max(20px,env(safe-area-inset-bottom))}.auth{display:grid;grid-template-columns:1fr minmax(280px,390px);gap:64px;max-width:900px;margin:65px auto 90px;align-items:start}.auth-intro{padding-top:30px}.auth-intro h1{font-size:2.5rem;margin-bottom:20px}.auth-intro>p{font-size:1.25rem;line-height:1.5}.auth-intro>p.muted{font-size:.9375rem;margin-top:20px;max-width:32ch}.auth-form{background:var(--panel);padding:26px;border-radius:12px}.auth-form h2{font-size:1.375rem;margin-bottom:8px}.auth-form form{margin-top:24px}.auth-form input{margin-bottom:16px}.auth-links{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-top:12px}.auth-links button{font-weight:500}.wide{width:100%;margin-top:12px}.notice,#notice{border:1px solid var(--line);padding:12px 14px;border-radius:6px;margin-bottom:20px;background:var(--panel);line-height:1.5}#notice.error{color:var(--error)}.help{background:var(--panel);padding:24px;border-radius:12px;margin-bottom:24px;max-width:78ch}.help button{margin-top:16px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.search-form{max-width:580px;display:grid;gap:14px}.vehicle-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions .primary{min-width:140px}.results-head{display:flex;align-items:baseline;gap:16px;margin-top:32px}.results-head h2{margin-bottom:8px}#search-status{color:var(--muted);font-size:.875rem;margin-bottom:16px}#results{border-top:1px solid var(--line)}.result{width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;padding:16px 8px;display:grid;grid-template-columns:1fr auto;gap:6px 24px}.result strong{font-size:1rem;color:var(--text)}.result span{color:var(--muted);font-size:.875rem;line-height:1.45}.result .result-meta{grid-column:2;grid-row:1/3;text-align:right;align-self:center;font-variant-numeric:tabular-nums}#more{margin-top:20px}.back{margin-bottom:18px}.workspace{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:28px;align-items:start}.diagram-pane{position:sticky;top:20px;min-width:0}.diagram{margin-top:12px;border-radius:10px;overflow:hidden;background:#fff;min-height:160px;display:flex;align-items:center;justify-content:center}canvas{display:block;max-width:100%;width:100%;height:auto;touch-action:manipulation}#diagram-empty{color:#536176;padding:24px}#diagram-status{margin:12px 0}.controls-pane{min-width:0}.controls-pane h1{font-size:1.25rem}.controls-pane h2{margin:20px 0 8px}.controls-pane>.muted{margin-top:7px;overflow-wrap:anywhere}.modes{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:20px 0}#lookup-form input{margin-bottom:0}#position-caption{font-size:.875rem;font-weight:650;margin:12px 0}.arrows{display:grid;grid-template-columns:1fr 1fr;gap:8px}.arrows button{font-size:1.5rem;min-height:48px;line-height:1}.keypad{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-top:12px}.keypad button{font-size:1.25rem;min-height:48px;padding:8px 3px}#workspace-status{margin-top:16px;color:var(--muted);font-size:.875rem}output{display:block;font-family:ui-monospace,Consolas,monospace;font-size:1.5rem;font-weight:700;letter-spacing:.06em;overflow-wrap:anywhere;color:var(--primary);white-space:pre-wrap;line-height:1.55;margin-bottom:10px}.hit{display:block;width:100%;text-align:left;margin-top:8px;line-height:1.5;font-variant-numeric:tabular-nums}.tree-branch{border-top:1px solid var(--line);padding:14px 0}.tree-branch summary{cursor:pointer;color:var(--primary);font-weight:650;min-height:32px}.tree-branch .hit{margin-left:8px;width:calc(100% - 8px)}footer{border-top:1px solid var(--line);margin-top:65px;padding-top:18px;color:var(--muted);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:.75rem}::selection{background:var(--primary);color:var(--on-primary)}.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip:focus{display:block;padding:12px;background:var(--panel);color:var(--primary)}[hidden]{display:none!important}
@media(max-width:700px){.topbar{padding:12px 16px;align-items:flex-start;flex-wrap:wrap}.topbar nav{justify-content:flex-start;width:100%}.topbar nav button,.theme select{min-height:40px;padding:8px 10px}.brand{font-size:1.0625rem}.brand img{width:30px;height:30px}main{padding:22px 16px}.auth{display:block;margin:12px auto 38px;max-width:440px}.auth-intro{padding:0;margin-bottom:28px}.auth-intro h1{display:none}.auth-intro>p{font-size:1.25rem}.auth-intro>.muted{display:none}.auth-form{padding:22px}.workspace{display:flex;flex-direction:column;gap:12px}.diagram-pane{position:static;width:100%}.controls-pane{width:100%}.section-head{align-items:flex-start;flex-direction:column;gap:6px;margin-bottom:20px}.result{gap:6px 10px}.result .result-meta{font-size:.75rem}.help{padding:18px}.keypad{grid-template-columns:repeat(6,1fr)}footer{margin-top:45px}}
@media(max-width:359px){.vehicle-grid{grid-template-columns:1fr}.result{grid-template-columns:1fr}.result .result-meta{grid-row:auto;grid-column:1;text-align:left}.keypad{grid-template-columns:repeat(5,1fr)}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
#blanks{margin-top:24px;border-top:1px solid var(--line);padding-top:16px}#blanks summary{cursor:pointer;color:var(--primary);min-height:44px;font-weight:650}#blank-content section+section{margin-top:24px}#blank-content img{display:block;max-width:100%;max-height:210px;width:auto;margin:8px auto;background:#fff;border-radius:6px}table{width:100%;border-collapse:collapse;font-size:.875rem}th,td{text-align:left;padding:9px 8px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}th{font-size:.8125rem;color:var(--muted)}
#blank-content h3{font-size:1rem;line-height:1.4;margin:20px 0 8px}#blank-content h4{font-size:.875rem;margin:16px 0 6px}#blank-content p{font-size:.875rem;overflow-wrap:anywhere}#blank-content details{margin-top:12px}#blank-content details details{padding:8px 0;border-top:1px solid var(--line)}#blank-content summary{overflow-wrap:anywhere;padding:10px 0;line-height:1.45;min-height:48px}#blank-content details p{margin-bottom:8px}

a{color:var(--primary);text-underline-offset:3px}*{scrollbar-color:var(--line) var(--bg)}.download-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:.875rem;font-weight:650;text-decoration:none;line-height:1.4}.download-link:hover{background:color-mix(in srgb,var(--primary) 12%,var(--panel))}.check-label{display:flex;align-items:center;gap:10px;font-size:1rem;min-height:44px;margin:0}.auth-form .check-label input{width:20px;height:20px;min-height:20px;margin:0;accent-color:var(--primary)}#remember-wrap{margin-bottom:8px}#remember-wrap .muted{font-size:.8125rem}.settings-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr);gap:64px}.account-settings,.appearance-settings{min-width:0}.account-settings>.section-head{margin-bottom:14px}.account-settings h2{margin:0}.account-email{font-weight:650;overflow-wrap:anywhere}.account-facts{margin:20px 0 12px}.account-facts>div{display:flex;justify-content:space-between;gap:18px;padding:12px 0;border-bottom:1px solid var(--line);font-size:.875rem}.account-facts dt{color:var(--muted)}.account-facts dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}.account-settings h2.sessions-heading,.sessions-heading{margin:30px 0 12px}.session-row{padding:18px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.session-row>div{min-width:0}.session-row p{overflow-wrap:anywhere}.session-row strong{font-size:.9375rem}.session-row .muted{font-size:.8125rem;margin-top:5px;font-variant-numeric:tabular-nums}.session-row button{flex-shrink:0}.appearance-settings p{margin:12px 0}.appearance-settings .download-link{margin-bottom:12px}.update-ready{display:flex;align-items:center;justify-content:space-between;gap:20px}.update-ready button{flex-shrink:0}dialog{max-width:460px;width:calc(100% - 32px);padding:26px;border:0;border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 16px 60px #0003}dialog::backdrop{background:#11192399}.dialog-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:24px;flex-wrap:wrap}.danger,.inline-error{color:var(--error)}.inline-error{margin-top:14px}.dialog-actions button{min-height:44px}#session-target{font-weight:650;overflow-wrap:anywhere}
@media(min-width:701px){:root[data-diagram-side=right] .workspace{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}:root[data-diagram-side=right] .diagram-pane{grid-column:2;grid-row:1}:root[data-diagram-side=right] .controls-pane{grid-column:1;grid-row:1}}
@media(max-width:700px){.settings-layout{grid-template-columns:1fr;gap:36px}.account-facts>div{flex-wrap:wrap}.account-facts dd{text-align:left}.session-row{flex-wrap:wrap}.account-settings>.section-head{flex-direction:row;align-items:center}.update-ready{align-items:flex-start;flex-direction:column}.topbar nav .download-link{min-height:44px;padding:8px 10px}.dialog-actions button{flex:1}}


/* Header actions stay beside the brand; utility controls wrap below on phones. */
.topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto}
.topbar>.brand{grid-column:1;grid-row:1;min-width:0}
.topbar>nav{grid-column:2;grid-row:1}
.header-actions{grid-column:3;grid-row:1;display:flex;align-items:center;gap:8px}
.topbar .header-actions .icon-action{display:inline-flex;align-items:center;justify-content:center;flex:none;width:48px;height:48px;min-height:48px;padding:12px;border:0;border-radius:50%;background:transparent;color:var(--primary)}
.topbar .header-actions .icon-action:hover{background:color-mix(in srgb,var(--primary) 12%,var(--bg))}
.topbar .header-actions .icon-action:active{background:color-mix(in srgb,var(--primary) 20%,var(--bg))}
@media(max-width:700px){.topbar{grid-template-columns:minmax(0,1fr) auto;align-items:center}.topbar>nav{grid-column:1/-1;grid-row:2;justify-content:flex-start;width:100%}.header-actions{grid-column:2}.topbar>.brand{white-space:normal;overflow-wrap:anywhere}}

#blanks{margin-top:24px;border:0;padding-top:0}#blank-content>.blank-preview{margin:0;padding:20px 0}#blank-content .blank-preview img{max-height:250px;margin:0 auto 12px}#blank-content .blank-preview figcaption{font-size:.875rem;line-height:1.5;overflow-wrap:anywhere}

#series-notes{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}#series-notes h2{margin:0 0 12px}#series-note-content h3{font-size:1rem;margin:18px 0 8px}#series-note-content p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.875rem;line-height:1.6}

.billing-settings{margin:28px 0 32px}.billing-settings h2{margin-bottom:12px}.billing-settings p{margin:12px 0;line-height:1.6}.billing-settings form{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin:18px 0}.billing-settings label{width:100%;margin:0}.billing-settings select{flex:1;min-width:180px;max-width:330px;min-height:48px}.billing-settings button{min-height:48px}.billing-settings a{text-underline-offset:3px}#billing-status{font-variant-numeric:tabular-nums}@media(max-width:420px){.billing-settings select,.billing-settings button{max-width:none;flex-basis:100%}}

.billing-settings #billing-form{display:block;max-width:560px}.billing-plan-group select{width:100%;max-width:none}.billing-settings .billing-promo-group{margin-top:18px}.billing-settings .billing-promo-group label{margin-bottom:10px}.billing-promo-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}.billing-promo-controls input{min-width:0;min-height:48px}.billing-settings #billing-promo-feedback{font-size:.875rem;margin:10px 0}.billing-price-summary{margin:20px 0}.billing-price-summary>div{display:flex;justify-content:space-between;gap:16px;padding:10px 0;font-size:.875rem}.billing-price-summary dt{color:var(--muted)}.billing-price-summary dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}.billing-price-summary .billing-price-total{border-top:1px solid var(--line);padding-top:14px;font-size:1rem;font-weight:650}.billing-price-total dt{color:var(--text)}.billing-settings #billing-pay{min-height:48px}.billing-promo-controls button{min-width:110px;border-color:var(--line)}
@media(max-width:420px){.billing-settings #billing-pay{width:100%}.billing-promo-controls{gap:8px}.billing-promo-controls button{min-width:100px;padding-inline:10px}}

[data-language]{min-height:48px;margin-bottom:16px;max-width:100%;}
.appearance-settings .check-label{min-height:48px;cursor:pointer}.appearance-settings .check-label input{flex:0 0 20px;width:20px;height:20px;min-height:20px;margin:0;accent-color:var(--primary)}
#blank-content .blank-preview{margin:0;padding:20px 0}#blank-content>.blank-variants{margin-top:0}#blank-content>.blank-variants>summary{min-height:48px;padding:14px 0;cursor:pointer}

.vehicle-field{position:relative;min-width:0}.vehicle-field>input{padding-inline-end:48px}.vehicle-toggle{position:absolute;inset-inline-end:1px;top:23px;border:0;background:transparent;min-width:44px;min-height:44px;padding:10px;display:grid;place-items:center}.vehicle-options{position:absolute;top:100%;inset-inline:0;z-index:5;max-height:260px;max-height:min(260px,40dvh);overflow-y:auto;overscroll-behavior:contain;background:var(--panel);border:1px solid var(--line);border-radius:6px;margin-top:4px}.vehicle-options>[role=option]{padding:12px;min-height:48px;line-height:1.4;overflow-wrap:anywhere;cursor:pointer}.vehicle-options>[role=option]:hover,.vehicle-options>[aria-selected=true]{background:var(--primary);color:var(--on-primary)}.vehicle-empty{padding:12px;font-size:.875rem;color:var(--muted)}.wafer-entry{margin-bottom:24px;min-height:48px}.wafer-intro{margin:12px 0 24px;max-width:65ch}.wafer-filters{max-width:580px;margin-bottom:20px}.wafer-variants{display:grid;gap:8px;margin:20px 0;max-width:760px}.wafer-variants button{text-align:left;line-height:1.5;overflow-wrap:anywhere}#wafer-layout{max-width:900px}#wafer-layout h2{margin:28px 0 12px}#wafer-layout h3{font-size:1rem;margin:24px 0 12px}.wafer-axis{margin:16px 0}.wafer-positions{display:grid;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));max-width:760px;list-style:none;padding:0;margin:8px 0;gap:4px}.wafer-positions li{padding:10px 4px;text-align:center;border:1px solid var(--line);background:var(--panel);border-radius:4px}.wafer-positions span{display:block;font-size:.8125rem;color:var(--muted)}.wafer-positions strong{display:block;font-size:1.125rem;margin-top:6px}#wafer-status{max-width:65ch}input[aria-invalid=true]{border-color:var(--error)}
@media(max-width:359px){.search-form>.actions{flex-direction:column}.search-form>.actions button{width:100%}}

/* Search follows the Android screen: one field per row and three-line results. */
#search{max-width:760px;margin-inline:auto}#search .section-head{margin-bottom:12px}#search h1{font-size:1.25rem}#search .wafer-entry{width:100%;margin-bottom:16px}
#search .search-form{max-width:none;display:grid;gap:10px}#search .vehicle-grid{grid-template-columns:minmax(0,1fr);gap:10px}#search label{font-size:.875rem;color:var(--muted);margin-bottom:4px}#search input{min-height:44px;font-size:1rem}#search .vehicle-toggle{top:21px}
#search .actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:0}#search .actions button{width:100%;min-height:48px;font-size:1rem;font-weight:400}#search-status{margin:8px 0;font-size:.875rem;color:var(--muted)}
#search .result{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-height:56px;padding:12px;border:0;border-radius:0;border-bottom:1px solid var(--line);background:var(--panel);text-align:left;width:100%}#search .result strong{font-size:1rem;font-weight:700;line-height:1.3}#search .result>span{font-size:.875rem;font-weight:400;line-height:1.35}#search .result .result-meta{color:var(--primary);text-align:left;white-space:normal;grid-column:auto;grid-row:auto;font-size:.8125rem}#search .result:hover{background:var(--bg)}#search .result:active{background:var(--line)}#search #more{width:100%;margin-top:12px}

/* The search header keeps the Android title and help/settings actions. Full
   account, theme and download controls remain available in Settings. */
body:has(#search:not([hidden])) .topbar nav{display:none}body:has(#search:not([hidden])) .topbar .brand img{display:none}body:has(#search:not([hidden])) .topbar{align-items:center;flex-wrap:nowrap;padding-block:16px}body:has(#search:not([hidden])) .topbar .brand{font-size:1.25rem}#search #account{display:none}

#search .result .result-meta{align-self:stretch;justify-self:start}

#chinese-research-open{width:100%;min-height:48px;margin:8px 0}#chinese-research-list{overflow-wrap:anywhere}.chinese-brand{border-bottom:1px solid var(--line);padding:8px 0}.chinese-brand>summary{cursor:pointer;min-height:48px;padding:12px 4px;line-height:1.5}.chinese-brand h3{font-size:1rem;margin-top:20px}.chinese-brand p{line-height:1.5;white-space:pre-line}.chinese-brand a:focus-visible,.chinese-brand>summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px}

/* Referral account extension, using the existing settings surface and color tokens. */
.referral-terms{margin:1rem 0}.referral-terms>div{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid var(--line)}.referral-terms dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}.referral-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}.referral-actions button{flex:1;min-height:48px}.referral-history{padding-inline-start:1.25rem}.referral-history li{margin:.75rem 0;overflow-wrap:anywhere}#referral-feedback{overflow-wrap:anywhere}#referral-link{width:100%;min-width:0}

#referral-settings .section-head{flex-direction:row;align-items:center;flex-wrap:wrap}
