:root {
    --black: #000;
    --bg: #050505;
    --surface: #090909;
    --surface-2: #0e0e0e;
    --surface-3: #151515;
    --border: #252525;
    --border-strong: #444;
    --text: #f4f4f4;
    --muted: #a0a0a0;
    --dim: #686868;
    --font-ui: Inter, Arial, sans-serif;
    --font-mono: "Fira Code", "Cascadia Mono", Consolas, monospace;
    --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: #555 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 999px; background: #4a4a4a; }
*::-webkit-scrollbar-thumb:hover { background: #777; }
html { min-width: 320px; background: var(--black); color-scheme: dark; }
body { min-height: 100vh; overflow-x: hidden; background-color: var(--bg); background-image: linear-gradient(rgba(255,255,255,.012) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.012) 1px,transparent 1px); background-size: 48px 48px; color: var(--text); font-family: var(--font-ui); letter-spacing: 0; }
body.modal-open { overflow: hidden; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sr-only { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.ui-icon { display: block; pointer-events: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: 58px minmax(0,1fr) auto; }
.site-header { position: sticky; top: 0; z-index: 100; min-height: 58px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 0 clamp(16px,3vw,40px); border-bottom: 1px solid var(--border); background: rgba(5,5,5,.94); backdrop-filter: blur(14px); }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.brand-icon-crop, .brand-wordmark-crop { position: relative; display: block; flex: 0 0 auto; overflow: hidden; background: #000; }
.brand-icon-crop { width: 29px; height: 29px; }
.brand-icon-crop img { width: 70px; max-width: none; position: absolute; left: -23px; top: -16px; }
.brand-wordmark-crop { width: 110px; height: 20px; }
.brand-wordmark-crop img { width: 207px; max-width: none; position: absolute; left: -48px; top: -132px; }
.beta-badge, .page-badge, .status-badge, .nav-badge { display: inline-flex; align-items: center; min-height: 19px; padding: 2px 7px; border: 1px solid #3b3b3b; border-radius: 999px; color: #bdbdbd; font: 600 .58rem/1 var(--font-ui); text-transform: uppercase; }
.site-nav { height: 100%; display: flex; justify-content: flex-end; align-items: stretch; gap: 24px; }
.site-nav > a { display: flex; align-items: center; position: relative; color: var(--muted); font-size: .75rem; font-weight: 500; }
.site-nav > a:hover { color: #fff; }
.site-nav > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: #fff; opacity: 0; }
.site-nav > a.is-active { color: #fff; }
.site-nav > a.is-active::after { opacity: 1; }
.nav-toggle { display: none !important; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); cursor: pointer; transition: color 160ms ease,border-color 160ms ease,background 160ms ease; }
.icon-button:hover:not(:disabled) { color: #fff; border-color: var(--border-strong); background: var(--surface-2); }
.icon-button:active:not(:disabled), .button:active:not(:disabled), .text-button:active:not(:disabled), .center-settings:active:not(:disabled) { transform: translateY(1px); }
.icon-button:disabled { opacity: .3; cursor: not-allowed; }

.route-view { width: 100%; min-width: 0; opacity: 0; transition: opacity 220ms cubic-bezier(.2,.7,.2,1); }
.route-view.route-enter { opacity: 1; }
.page-section { width: min(1540px,100%); margin: 0 auto; padding: 28px clamp(16px,3vw,40px); }
.content-page { display: grid; align-content: start; gap: 24px; }
.page-heading, .workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.page-heading h1, .workspace-heading h1 { margin-top: 5px; font-size: clamp(1.18rem,2vw,1.55rem); font-weight: 600; }
.page-heading p { max-width: 600px; margin-top: 7px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.eyebrow { color: var(--dim); font: 600 .62rem/1 var(--font-mono); text-transform: uppercase; }
.muted { color: var(--muted); }
.site-footer { min-height: 46px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--dim); font-size: .65rem; }
.site-footer nav { display: flex; gap: 14px; }
.site-footer a:hover { color: #fff; }
.app-shell.is-landing { display: block; }
.app-shell.is-landing .site-header, .app-shell.is-landing .site-footer { display: none; }

.button, .text-button, .center-settings { min-height: 36px; padding: 0 13px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); cursor: pointer; transition: color 180ms ease,border-color 180ms ease,background 180ms ease,transform 100ms ease,box-shadow 180ms ease; }
.button:hover:not(:disabled), .text-button:hover:not(:disabled), .center-settings:hover:not(:disabled) { color: #fff; border-color: var(--border-strong); background: var(--surface-2); }
.button:disabled, .text-button:disabled { opacity: .35; cursor: not-allowed; }
.button-primary { border-color: #ddd; background: #fff; color: #000; }
.button-primary:hover:not(:disabled) { border-color: #fff; background: #d8d8d8; color: #000; }
.text-button { min-height: 30px; padding: 0 8px; background: transparent; }
.text-control { min-width: 0; min-height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; outline: none; background: #070707; color: var(--text); }
.text-control:focus { border-color: var(--border-strong); }

/* Landing */
.boot-page { min-height: 100vh; position: relative; overflow-x: hidden; background: #000; opacity: 1; transition: opacity 320ms ease; isolation: isolate; }
.boot-page::before { content: ''; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(rgba(255,255,255,.014) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.014) 1px,transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(circle at 50% 42%,#000,transparent 72%); pointer-events: none; }
.boot-page.is-leaving { opacity: 0; }
.boot-hero { min-height: 100vh; display: grid; place-items: center; padding: 30px 0; }
.boot-center { width: min(560px,88vw); display: grid; justify-items: center; gap: 18px; }
.boot-logo-frame { width: min(500px,86vw); aspect-ratio: 500 / 290; position: relative; overflow: hidden; isolation: isolate; }
.boot-logo-frame::after { content: ''; position: absolute; z-index: 2; left: 19%; right: 19%; top: 50%; height: 1px; background: rgba(255,255,255,.72); box-shadow: 0 0 14px rgba(255,255,255,.22); opacity: 0; }
.boot-logo { width: 100%; height: auto; display: block; position: absolute; top: -28%; left: 0; opacity: 1; }
.boot-page.is-intro .boot-logo { animation: luavex-reveal 1.35s cubic-bezier(.22,.72,.18,1) both; }
.boot-page.is-intro .boot-logo-frame::after { animation: luavex-scan 1.25s cubic-bezier(.22,.72,.18,1) .08s both; }
.boot-edition { color: #777; font: 500 .58rem/1 var(--font-mono); letter-spacing: .18em; opacity: 0; transition: opacity 320ms ease; }
.boot-page.is-ready .boot-edition { opacity: 1; }
.boot-start { min-width: 156px; min-height: 42px; margin-top: 13px; position: relative; overflow: hidden; border: 1px solid #d6d6d6; border-radius: 3px; background: #000; color: #fff; font: 500 .66rem/1 var(--font-mono); cursor: pointer; opacity: 0; transform: translateY(5px); transition: background 150ms ease,color 150ms ease,opacity 300ms ease,transform 300ms ease; }
.boot-start::after { content: ''; width: 42%; position: absolute; inset: -1px auto -1px -50%; background: linear-gradient(105deg,transparent,rgba(255,255,255,.35),transparent); transform: skewX(-18deg); transition: left 280ms ease; pointer-events: none; }
.boot-page.is-ready .boot-start { opacity: 1; transform: translateY(0); }
.boot-start:hover { background: #fff; color: #000; }
.boot-start:hover::after, .boot-start:focus-visible::after { left: 112%; }
.boot-info-action { border: 0; background: transparent; color: #777; font: 500 .62rem/1.4 var(--font-ui); cursor: pointer; opacity: 0; transform: translateY(3px); transition: color 160ms ease,opacity 300ms ease,transform 300ms ease; }
.boot-page.is-ready .boot-info-action { opacity: 1; transform: translateY(0); }
.boot-info-action:hover { color: #fff; }
.landing-info { min-height: min(58vh,520px); scroll-margin-top: 20px; border-top: 1px solid #151515; background: rgba(3,3,3,.96); }
.landing-info-inner { width: min(620px,calc(100% - 36px)); min-height: 310px; display: grid; align-content: center; gap: 18px; margin: 0 auto; padding: 70px 0; }
.landing-info h2 { font-size: clamp(1rem,2vw,1.3rem); font-weight: 600; }
.landing-info p { max-width: 55ch; min-height: 2.9em; color: var(--muted); font-size: .76rem; line-height: 1.65; }
.landing-info p.is-typing::after { content: ''; width: 1px; height: 1em; display: inline-block; margin-left: 3px; background: #d6d6d6; vertical-align: -.12em; }
.landing-info .landing-info-closing { min-height: 1.7em; color: #e1e1e1; font-family: var(--font-mono); font-size: .7rem; }

/* Workspace */
.dashboard-page { min-height: calc(100vh - 104px); display: grid; grid-template-rows: auto minmax(430px,1fr) auto auto; gap: 16px; }
.dashboard-page.has-developer-tools { grid-template-rows: auto auto minmax(430px,1fr) auto auto; }
.workspace-status { min-width: 84px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: .65rem/1 var(--font-mono); text-align: center; transition: border-color 180ms ease,color 180ms ease,background 180ms ease; }
.workspace-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #696969; box-shadow: 0 0 0 3px rgba(255,255,255,.025); }
.workspace-status.is-processing { border-color: #777; color: #fff; }
.workspace-status.is-processing::before { background: #fff; animation: status-pulse 1.1s ease-in-out infinite; }
.workspace-status.is-completed { border-color: #555; color: #ddd; }
.workspace-status.is-completed::before { background: #bdbdbd; }
.workspace-status.is-error { border-style: dashed; color: #bbb; }
.editor-workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 136px minmax(0,1fr); gap: 14px; }
.editor-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 43px minmax(0,1fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #050505; box-shadow: 0 12px 32px rgba(0,0,0,.18); transition: border-color 200ms ease,box-shadow 200ms ease; }
.editor-panel:focus-within { border-color: #3c3c3c; box-shadow: 0 16px 38px rgba(0,0,0,.26); }
.editor-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px 0 13px; border-bottom: 1px solid var(--border); background: #0b0b0b; color: #ddd; font: 600 .62rem/1 var(--font-mono); }
.editor-panel > header > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.editor-panel > header small { min-width: 0; overflow: hidden; color: var(--dim); font: 400 .58rem/1 var(--font-ui); text-overflow: ellipsis; white-space: nowrap; }
.editor-actions { display: flex; gap: 5px; }
.editor-actions .icon-button { width: 29px; height: 29px; border-color: transparent; background: transparent; }
.editor-host { min-width: 0; min-height: 0; position: relative; overflow: hidden; transform: none; zoom: 1; letter-spacing: normal; }
.editor-stack { min-width: 0; min-height: 0; display: grid; position: relative; }
.editor-stack > .editor-host, .editor-stack > .editor-fallback { grid-area: 1 / 1; }
.editor-empty-state { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 24px; color: #4f4f4f; font: 500 .62rem/1.5 var(--font-mono); letter-spacing: .08em; text-align: center; pointer-events: none; user-select: none; }
/* Monaco owns glyph, cursor and input-layer metrics. Do not override its
   descendants independently of the editor's measured font options. */
.editor-host .monaco-scrollable-element > .scrollbar > .slider { border-radius: 999px !important; background: #555 !important; opacity: .55; }
.editor-fallback { width: 100%; min-height: 0; resize: none; border: 0; outline: 0; background: #050505; color: var(--text); font: 14px/22px var(--font-mono); padding: 14px; }
.build-controls { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(8,8,8,.72); }
.obfuscate-button { width: 58px; height: 58px; display: grid; place-items: center; position: relative; border: 1px solid #e5e5e5; border-radius: 50%; background: #fff; color: #000; box-shadow: 0 0 0 0 rgba(255,255,255,0); cursor: pointer; transition: background 180ms ease,color 180ms ease,transform 150ms ease,box-shadow 180ms ease; }
.obfuscate-button:hover:not(:disabled) { background: #000; color: #fff; transform: translateY(-1px); }
.obfuscate-button:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.obfuscate-button:focus-visible { box-shadow: 0 0 0 4px rgba(255,255,255,.1); }
.obfuscate-button:disabled { cursor: wait; opacity: .7; }
.build-controls small { color: var(--dim); font: .6rem/1 var(--font-mono); }
.quota-state { min-height: 1em; }
.spinner { display: none; width: 20px; height: 20px; border: 2px solid #555; border-top-color: #000; border-radius: 50%; animation: spin .8s linear infinite; }
.obfuscate-button.is-processing .run-icon-slot { display: none; }
.obfuscate-button.is-processing .spinner { display: block; }
.build-summary, .inline-error { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(9,9,9,.94); animation: surface-enter 240ms cubic-bezier(.2,.7,.2,1) both; }
.build-summary h2 { margin-bottom: 10px; font-size: .72rem; }
.summary-grid, .technical-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.summary-grid > div, .technical-grid > div { min-width: 0; }
.summary-grid dt, .technical-grid dt { color: var(--dim); font-size: .58rem; text-transform: uppercase; }
.summary-grid dd, .technical-grid dd { margin-top: 4px; overflow-wrap: anywhere; font: .66rem/1.45 var(--font-mono); }
.technical-details { margin-top: 10px; }
.technical-details summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: .65rem; }
.technical-grid { margin-top: 10px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.inline-error { border-style: dashed; }
.inline-error strong { font-size: .72rem; }
.inline-error pre { max-height: 130px; overflow: auto; margin-top: 7px; color: #c8c8c8; font: .66rem/1.55 var(--font-mono); white-space: pre-wrap; }

/* Build transition */
.build-transition { position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); opacity: 0; pointer-events: all; transition: opacity 220ms ease; }
.build-transition.is-open { opacity: 1; }
.transition-panel { width: min(680px,100%); overflow: hidden; border: 1px solid #3d3d3d; border-radius: 7px; background: #070707; box-shadow: 0 34px 90px rgba(0,0,0,.62); transform: translateY(9px) scale(.992); transition: transform 220ms cubic-bezier(.2,.75,.2,1); }
.build-transition.is-open .transition-panel { transform: translateY(0); }
.transition-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); font: 600 .62rem/1 var(--font-mono); }
.transition-title { display: inline-flex; align-items: center; gap: 8px; }
.transition-title::before { content: ''; width: 6px; height: 6px; border: 1px solid #a0a0a0; transform: rotate(45deg); }
.transition-state { color: #fff; }
.transition-code-frame { min-height: 190px; max-height: 300px; display: grid; grid-template-columns: 44px minmax(0,1fr); overflow: hidden; background: #050505; }
.transition-line-numbers { display: grid; align-content: start; padding: 18px 11px; border-right: 1px solid #181818; color: #4c4c4c; font: 11px/22.1px var(--font-mono); text-align: right; user-select: none; }
.transition-panel pre { min-height: 190px; max-height: 300px; overflow: hidden; padding: 18px; color: #d8d8d8; font: 13px/1.7 var(--font-mono); white-space: pre-wrap; }
.transition-token { display: inline; position: relative; color: inherit; transition: color 45ms linear,opacity 45ms linear,filter 45ms linear; }
.transition-token.token-keyword { color: #b7b7b7; }
.transition-token.token-string, .transition-token.token-number { color: #aaa; }
.transition-token.is-active { color: #fff; opacity: .82; animation: token-distort 72ms steps(2,end) infinite; }
.transition-token.is-transformed { color: #f2f2f2; }
.transition-progress { height: 1px; overflow: hidden; background: #171717; }
.transition-progress > span { width: 0; height: 100%; display: block; background: #e8e8e8; box-shadow: 0 0 8px rgba(255,255,255,.28); transition: width 80ms linear; }
.transition-panel > footer { min-height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #656565; font: 500 .56rem/1 var(--font-mono); }

/* Settings */
.modal-overlay { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.84); backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.settings-modal { width: min(760px,100%); max-height: 80vh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid #3a3a3a; border-radius: 7px; background: rgba(9,9,9,.96); box-shadow: 0 28px 80px rgba(0,0,0,.52); opacity: 0; transform: translateY(9px) scale(.985); transition: opacity 220ms ease,transform 220ms cubic-bezier(.2,.75,.2,1); }
.modal-overlay.is-open .settings-modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-header, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: .94rem; }
.modal-header p { margin-top: 4px; color: var(--dim); font-size: .68rem; }
.modal-body { min-height: 0; overflow: auto; padding: 16px 17px; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.settings-content { display: grid; gap: 22px; }
.settings-section { display: grid; gap: 11px; }
.settings-section h3 { font-size: .72rem; font-weight: 600; }
.section-note { color: var(--dim); font-size: .66rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.profile-card { min-width: 0; min-height: 104px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; position: relative; overflow: hidden; padding: 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); text-align: left; cursor: pointer; isolation: isolate; animation: surface-enter 260ms cubic-bezier(.2,.7,.2,1) both; transition: transform 190ms ease,border-color 190ms ease,background 190ms ease,box-shadow 190ms ease; }
.profile-card::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(115deg,transparent 45%,rgba(255,255,255,.025),transparent 68%); transform: translateX(-70%); transition: transform 360ms ease; }
.profile-card::after { content: ''; position: absolute; z-index: -1; left: 12px; right: 12px; bottom: 0; height: 1px; background: #fff; opacity: var(--profile-line-opacity,.05); }
.profile-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); box-shadow: 0 12px 26px rgba(0,0,0,.24); }
.profile-card:hover:not(:disabled)::before { transform: translateX(65%); }
.profile-card:active:not(:disabled) { transform: translateY(0) scale(.995); }
.profile-card.is-selected { border-color: #ddd; background: linear-gradient(145deg,#151515,#0a0a0a); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04),0 8px 22px rgba(0,0,0,.2); }
.profile-card[data-intensity="1"] { --profile-line-opacity: .05; }
.profile-card[data-intensity="2"] { --profile-line-opacity: .09; }
.profile-card[data-intensity="3"] { --profile-line-opacity: .13; }
.profile-card[data-intensity="4"] { --profile-line-opacity: .18; box-shadow: inset 0 0 24px rgba(255,255,255,.018); }
.profile-card[data-intensity="5"] { --profile-line-opacity: .22; background-image: repeating-linear-gradient(135deg,transparent 0 14px,rgba(255,255,255,.018) 14px 15px); }
.profile-card[data-intensity="6"] { --profile-line-opacity: .27; background-image: linear-gradient(90deg,transparent,rgba(255,255,255,.025),transparent); }
.profile-card[data-intensity="7"] { --profile-line-opacity: .34; background-image: repeating-linear-gradient(90deg,transparent 0 20px,rgba(255,255,255,.02) 20px 21px); }
.profile-card:nth-child(2) { animation-delay: 24ms; }
.profile-card:nth-child(3) { animation-delay: 48ms; }
.profile-card:nth-child(4) { animation-delay: 72ms; }
.profile-card:nth-child(5) { animation-delay: 96ms; }
.profile-card:nth-child(6) { animation-delay: 120ms; }
.profile-card:nth-child(7) { animation-delay: 144ms; }
.profile-card[data-intensity="5"]::before, .profile-card[data-intensity="6"]::before, .profile-card[data-intensity="7"]::before { animation: profile-scan 6s ease-in-out infinite; }
.profile-card:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(1); }
.profile-card-head, .profile-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-title { color: #fff; font-size: .75rem; }
.profile-signal { height: 13px; display: inline-flex; align-items: flex-end; gap: 2px; margin-left: auto; }
.profile-signal i { width: 2px; height: 4px; display: block; background: #8b8b8b; }
.profile-signal i:nth-child(2) { height: 6px; }
.profile-signal i:nth-child(3) { height: 8px; }
.profile-signal i:nth-child(4) { height: 10px; }
.profile-signal i:nth-child(n+5) { height: 12px; background: #c7c7c7; }
.profile-check { opacity: 0; color: #fff; }
.profile-card.is-selected .profile-check { opacity: 1; }
.profile-description { min-height: 2.5em; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.profile-card-meta { justify-content: flex-start; flex-wrap: wrap; color: var(--dim); font: 600 .55rem/1 var(--font-ui); text-transform: uppercase; }
.profile-cost { margin-left: auto; color: #bbb; }
.toggle-grid, .settings-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.toggle-row { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 11px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: .7rem; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-visual { width: 38px; height: 21px; position: relative; flex: 0 0 auto; border: 1px solid #3c3c3c; border-radius: 999px; background: #111; transition: background 160ms ease,border-color 160ms ease; }
.toggle-visual::after { content: ''; width: 15px; height: 15px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #777; transition: transform 160ms ease,background 160ms ease; }
.toggle-row input:checked + .toggle-visual { border-color: #ddd; background: #ddd; }
.toggle-row input:checked + .toggle-visual::after { transform: translateX(17px); background: #000; }
.toggle-row:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
.toggle-row.is-disabled { opacity: .45; cursor: not-allowed; }
.toggle-row.is-disabled .toggle-visual { cursor: not-allowed; }
.dependency-note { padding-left: 2px; }
.v2-backend-status { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font: .62rem/1 var(--font-mono); }
.v2-backend-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #696969; }
.v2-backend-status.is-online { color: #d5d5d5; }
.v2-backend-status.is-online::before { background: #d5d5d5; }
.v2-backend-status.is-offline { color: #999; }
.field-row { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: .67rem; }
.custom-select { min-width: 0; position: relative; }
.custom-select-trigger { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border: 1px solid var(--border); border-radius: 5px; background: #070707; color: var(--text); cursor: pointer; font-size: .68rem; }
.custom-select.is-open .custom-select-trigger { border-color: var(--border-strong); }
.select-arrow { transition: transform 150ms ease; }
.custom-select.is-open .select-arrow { transform: rotate(180deg); }
.custom-select-menu { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; right: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--border-strong); border-radius: 5px; background: #080808; }
.custom-select-option { min-height: 32px; padding: 0 8px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.custom-select-option:hover, .custom-select-option:focus-visible, .custom-select-option[aria-selected="true"] { background: #181818; color: #fff; }

/* Supporting pages */
.history-controls, .history-management, .card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.history-controls > * { flex: 1 1 170px; }
.history-list, .history-group, .changelog-list { display: grid; gap: 16px; }
.history-group h2 { margin-bottom: 10px; font-size: .76rem; }
.history-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.history-card { min-width: 0; display: grid; gap: 13px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); animation: surface-enter 240ms cubic-bezier(.2,.7,.2,1) both; transition: border-color 180ms ease,transform 180ms ease; }
.history-card:hover { border-color: #363636; transform: translateY(-1px); }
.history-card-top { display: flex; justify-content: space-between; gap: 10px; }
.history-card h3 { font-size: .8rem; }
.history-date { color: var(--dim); font-size: .6rem; }
.history-facts, .detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.history-facts dt, .detail-grid dt { color: var(--dim); font-size: .57rem; text-transform: uppercase; }
.history-facts dd, .detail-grid dd { margin-top: 3px; overflow-wrap: anywhere; font: .63rem/1.4 var(--font-mono); }
.detail-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.detail-grid > div { padding: 12px; border: 1px solid var(--border); }
.empty-state, .placeholder-panel { display: grid; justify-items: center; gap: 12px; padding: clamp(38px,8vw,80px) 20px; border: 1px dashed var(--border); text-align: center; }
.empty-state h2, .placeholder-panel h1 { font-size: 1rem; }
.empty-state p, .placeholder-panel p { color: var(--muted); font-size: .72rem; }
.changelog-list { max-width: 820px; }
.changelog-entry { display: grid; gap: 18px; padding: 0 0 28px; border-bottom: 1px solid var(--border); }
.changelog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.changelog-top h2 { font: 600 .9rem/1 var(--font-mono); }
.change-group { display: grid; grid-template-columns: 110px 1fr; gap: 18px; }
.change-group h3 { color: var(--muted); font-size: .66rem; }
.change-group ul { display: grid; gap: 7px; padding-left: 16px; color: #d0d0d0; font-size: .72rem; line-height: 1.5; }
.pricing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.pricing-card, .balance-panel, .plain-section, .safe-error { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--border); background: var(--surface); }
.standalone pre { max-height: 420px; overflow: auto; padding: 12px; border: 1px solid var(--border); background: #050505; font: .65rem/1.5 var(--font-mono); }
.toast-region { position: fixed; z-index: 700; right: 14px; bottom: 14px; width: min(340px,calc(100vw - 28px)); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 5px; background: #0b0b0b; color: var(--text); opacity: 0; transform: translateY(6px); pointer-events: auto; transition: opacity 160ms ease,transform 160ms ease; font-size: .7rem; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes status-pulse { 0%,100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1); } }
@keyframes token-distort { 0% { transform: translateX(0); filter: brightness(1); } 50% { transform: translateX(1px); filter: brightness(1.2); } 100% { transform: translateX(-1px); filter: brightness(.94); } }
@keyframes surface-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes profile-scan { 0%,55% { transform: translateX(-75%); } 78%,100% { transform: translateX(75%); } }
@keyframes luavex-reveal {
    0% { clip-path: inset(52% 12% 48% 12%); opacity: .08; filter: contrast(1.2); }
    58% { clip-path: inset(14% 6% 12% 6%); opacity: .78; }
    100% { clip-path: inset(0); opacity: 1; filter: contrast(1); }
}
@keyframes luavex-scan {
    0% { top: 28%; opacity: 0; }
    18% { opacity: .62; }
    82% { opacity: .28; }
    100% { top: 76%; opacity: 0; }
}

@media (max-width: 1080px) {
    .dashboard-page { min-height: 0; grid-template-rows: auto; }
    .editor-workspace { grid-template-columns: 1fr; }
    .editor-panel { min-height: 390px; }
    .build-controls { flex-direction: row; justify-self: stretch; padding: 9px 12px; }
    .obfuscate-button { width: 50px; height: 50px; }
    .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .app-shell { grid-template-rows: 56px minmax(0,1fr) auto; }
    .site-header { min-height: 56px; grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 14px; }
    .nav-toggle { display: inline-grid !important; justify-self: end; }
    .settings-nav { grid-column: 3; }
    .site-nav { position: absolute; top: 55px; left: 10px; right: 10px; height: auto; display: none; padding: 6px; border: 1px solid var(--border); background: #080808; }
    .site-nav.is-open { display: grid; }
    .site-nav > a { min-height: 40px; padding: 0 10px; }
    .site-nav > a::after { display: none; }
    .page-section { padding: 20px 14px; }
    .page-heading, .workspace-heading { align-items: flex-start; }
    .workspace-heading h1 { font-size: 1.1rem; }
    .editor-panel { min-height: 340px; }
    .summary-grid, .technical-grid, .history-grid, .profile-grid, .toggle-grid, .settings-fields { grid-template-columns: 1fr; }
    .history-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .site-footer { gap: 10px; }
    .site-footer > span:nth-child(3) { display: none; }
    .change-group { grid-template-columns: 1fr; gap: 7px; }
    .modal-overlay { padding: 9px; }
    .settings-modal { max-height: 92vh; }
    .modal-header, .modal-body, .modal-actions { padding-left: 13px; padding-right: 13px; }
}

@media (max-width: 430px) {
    .brand-wordmark-crop { width: 96px; }
    .beta-badge { display: none; }
    .editor-panel { min-height: 310px; }
    .history-facts, .detail-grid { grid-template-columns: 1fr; }
    .workspace-status { min-width: 68px; }
    .build-controls { gap: 9px; padding-inline: 9px; }
    .auth-build-note { max-width: 105px; }
    .transition-panel pre { min-height: 125px; padding: 13px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.animations-off .boot-start::after, .animations-off .landing-info p.is-typing::after { display: none; }
@media (prefers-reduced-motion: reduce) {
    .boot-start::after, .landing-info p.is-typing::after { display: none; }
}
.animations-off *, .animations-off *::before, .animations-off *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }

/* Production account and pipeline polish */
.site-header { grid-template-columns: auto minmax(0,1fr) auto auto; }
.account-slot { min-width: 0; position: relative; }
.account-loading { color: var(--dim); font-size: .65rem; }
.account-connect { min-height: 32px; padding-inline: 11px; color: #eee; font-size: .66rem; }
.account-menu { position: relative; }
.account-trigger { min-width: 0; height: 34px; display: flex; align-items: center; gap: 8px; padding: 3px 9px 3px 4px; border: 1px solid var(--border); border-radius: 5px; background: #090909; color: #ddd; cursor: pointer; }
.account-trigger:hover { border-color: var(--border-strong); background: #101010; }
.account-trigger img, .account-avatar-fallback { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; background: #1b1b1b; color: #fff; object-fit: cover; font: 600 .65rem/1 var(--font-ui); }
.account-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; }
.account-popover { width: 210px; position: absolute; z-index: 130; top: calc(100% + 8px); right: 0; display: grid; gap: 3px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: rgba(8,8,8,.98); box-shadow: 0 18px 48px rgba(0,0,0,.55); animation: account-pop 160ms cubic-bezier(.2,.75,.2,1) both; }
.account-popover strong, .account-popover small { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover strong { font-size: .7rem; }
.account-popover small { padding-top: 0; color: var(--dim); font-size: .6rem; }
.account-action { min-height: 34px; display: flex; align-items: center; padding: 0 7px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; font-size: .66rem; text-align: left; }
.account-action:hover { background: #171717; color: #fff; }
.auth-build-note { max-width: 112px; text-align: center; line-height: 1.35 !important; }
.obfuscate-button:disabled:not(.is-processing) { cursor: not-allowed; background: #202020; border-color: #393939; color: #777; opacity: 1; }

.pipeline-panel { width: min(780px,100%); }
.pipeline-body { display: grid; grid-template-columns: minmax(0,1fr) 210px; min-height: 290px; }
.pipeline-code { min-width: 0; position: relative; overflow: hidden; border-right: 1px solid var(--border); background: #050505; }
.pipeline-code pre { min-height: 290px; display: grid; align-content: center; gap: 2px; padding: 22px 18px; white-space: pre; }
.pipeline-line { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); border-radius: 3px; color: #aaa; font: 12px/25px var(--font-mono); transition: color 160ms ease,background 160ms ease,opacity 160ms ease; }
.pipeline-line i { color: #444; font-style: normal; user-select: none; }
.pipeline-line b { overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-line.is-scanned { background: rgba(255,255,255,.035); color: #fff; }
.pipeline-line.is-awaiting-result { background: rgba(255,255,255,.025); }
.pipeline-line.is-morphed { color: #d8d8d8; opacity: .78; }
.pipeline-scan { width: 100%; height: 30px; position: absolute; left: 0; top: -30px; border-bottom: 1px solid rgba(255,255,255,.38); background: linear-gradient(to bottom,transparent,rgba(255,255,255,.035)); box-shadow: 0 5px 12px rgba(255,255,255,.025); transition: top 260ms cubic-bezier(.3,.1,.35,1),opacity 180ms ease; pointer-events: none; }
.pipeline-scan.is-finished { opacity: 0; }
.pipeline-stages { display: grid; align-content: center; gap: 12px; padding: 24px; list-style: none; }
.pipeline-stages li { display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: center; gap: 10px; color: #565656; font-size: .66rem; transition: color 180ms ease; }
.pipeline-stages li > span { width: 7px; height: 7px; border: 1px solid #444; border-radius: 50%; transition: border-color 180ms ease,background 180ms ease,transform 180ms ease; }
.pipeline-stages li.is-current { color: #fff; }
.pipeline-stages li.is-current > span { border-color: #fff; transform: scale(1.15); animation: status-pulse 1.2s ease-in-out infinite; }
.pipeline-stages li.is-complete { color: #9a9a9a; }
.pipeline-stages li.is-complete > span { border-color: #bdbdbd; background: #bdbdbd; }
.pipeline-panel.is-complete { border-color: #666; }
.profile-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; color: #8c8c8c; font: 500 .56rem/1.3 var(--font-mono); }
.profile-card[data-profile="good"] { border-color: #3e3e3e; }
.profile-card[data-profile="good"] .profile-status { color: #fff; }
.profile-card[data-profile="pro"] { box-shadow: inset 0 0 0 1px rgba(255,255,255,.018),0 12px 30px rgba(0,0,0,.2); }
.profile-card[data-profile="hell"] { background-image: repeating-linear-gradient(135deg,transparent 0 16px,rgba(255,255,255,.02) 16px 17px); }

@keyframes account-pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 820px) {
    .site-header { grid-template-columns: auto 1fr auto auto; }
    .account-name { display: none; }
    .account-trigger { width: 34px; padding: 3px; }
    .pipeline-body { grid-template-columns: 1fr; }
    .pipeline-code { border-right: 0; border-bottom: 1px solid var(--border); }
    .pipeline-code pre { min-height: 210px; }
    .pipeline-stages { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 18px; }
}

@media (max-width: 720px) {
    .site-header { grid-template-columns: auto 1fr auto auto; }
    .nav-toggle { grid-column: 2; }
    .account-slot { grid-column: 3; }
    .settings-nav { grid-column: 4; }
    .editor-workspace { gap: 10px; }
    .build-controls { position: static; width: 100%; justify-self: stretch; background: rgba(7,7,7,.94); }
    .history-controls, .history-management { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .pipeline-stages { grid-template-columns: 1fr; gap: 8px; }
    .pipeline-code pre { min-height: 175px; padding: 14px 11px; }
    .pipeline-line { font-size: 10px; line-height: 22px; }
    .profile-specs { grid-template-columns: 1fr; }
}
