/* Shared dark/lime visual contract. Component refinements stay in this file. */
:root{
 --bg:#0a0b0d;--surface:#1b1c20;--surface-2:#25262b;--text:#f8f8f4;
 --muted:#b3b3a9;--line:#363631;--brand:#d7ff3f;--accent:#c1de78;--accent-2:#c1de78;--selected:#303825;
 --nav:#1b1c20;--nav-text:#f8f8f4;--on-accent:#171b10;
 --radius-control:14px;--radius-card:20px;--radius-dialog:26px;
 --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;
 --shadow:0 16px 40px #0004;
}
#app{max-width:620px;--nav-clearance:calc(100px + max(env(safe-area-inset-bottom,0px),var(--tt-safe-bottom,0px)));padding-bottom:var(--nav-clearance)}
body>footer{padding-bottom:calc(112px + max(env(safe-area-inset-bottom,0px),var(--tt-safe-bottom,0px)))!important}
html{scroll-padding-bottom:calc(112px + max(env(safe-area-inset-bottom,0px),var(--tt-safe-bottom,0px)))}
#app :is(h1,h2){color:var(--text)}
#app h1{line-height:1.06;letter-spacing:-1.6px}
.kicker{text-transform:uppercase;color:var(--accent);font-size:11px;letter-spacing:1.8px;line-height:1.5}
#app :is(.primary-btn,.primary-link,.generate-cta:not(:disabled):not(.is-blocked)){
 background:var(--brand)!important;color:var(--on-accent);border-radius:var(--radius-control);min-height:48px;box-shadow:none;
}
#app :is(.primary-btn,.generate-cta) :is(strong,small){color:inherit}
#app :is(.secondary-btn,.ghost-btn,.back-link){min-height:44px;border-radius:var(--radius-control)}
#app :is(.create-tool,.profile-card,.settings-card,.composer-card,.topup-plan,.empty){border-radius:var(--radius-card)}
#app :is(.catalog-search,input:not([type=file]):not([type=range]):not([type=checkbox]),textarea,select){border-radius:var(--radius-control)}
#app :is(input,textarea,select){accent-color:var(--accent)}
#app :is(.catalog-search input,textarea,select){font-size:16px}
#app :is(.categories,.history-filter) button{min-height:44px}
#app :is(.categories,.history-filter) button[aria-pressed=true]{background:var(--selected);color:var(--accent)}
#app :is(.brand,.avatar,.credit-pill,.shelf-title button){min-height:44px}
#app .avatar{min-width:44px}
#app .bottom-nav button{min-height:48px;opacity:1;color:var(--muted)}
#app .bottom-nav button[aria-current=page]{color:var(--accent);background:#292d25}
#app .profile-avatar{background:var(--brand)!important;color:var(--on-accent);box-shadow:none}
#app .bottom-nav{bottom:calc(10px + max(env(safe-area-inset-bottom,0px),var(--tt-safe-bottom,0px)))}
#app .bottom-nav button{justify-content:center;gap:4px;font-size:10px}
#app .bottom-nav button b,#app .bottom-nav .nav-create b{display:grid;place-items:center;width:26px;height:26px;margin:0;border-radius:0;background:transparent!important;color:inherit;box-shadow:none}
.ui-icon{display:block;width:24px;height:24px;flex:none}
#app .pro-banner{background:var(--surface-2);border:1px solid var(--line)}
#app .topup-plan-featured .topup-plan-badge{color:var(--on-accent)}
#app :focus-visible,dialog :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#app :is(.hint,.notice,.empty p){line-height:1.6}
/* Dialog-specific adaptation also applies when WAN's CSS is loaded on demand. */
dialog.wan-beta-sheet{background:var(--bg);color:var(--text);border-color:var(--line);padding-bottom:calc(24px + max(env(safe-area-inset-bottom,0px),var(--tt-safe-bottom,0px)));max-height:calc(min(92dvh,var(--tt-visible-height,92dvh)) - var(--tt-safe-top,0px))}
dialog.wan-beta-sheet :is(select,textarea,.wb-media article,.ss-slot){background:var(--surface);border-color:var(--line)}
dialog.wan-beta-sheet :is(.wb-intro,.wb-hint,.wb-label span,.wb-footer small,.ss-example figcaption,.ss-slot small){color:var(--muted)}
dialog.wan-beta-sheet .ss-empty{background:var(--surface-2)}
dialog.wan-beta-sheet .ss-upload:focus-within{outline:2px solid var(--accent);outline-offset:3px}
dialog.wan-beta-sheet .ss-slot>strong{min-height:36px;line-height:1.4}
@media(prefers-reduced-motion:reduce){#app *,#app *::before,#app *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Home rhythm, horizontal filters, and tool cards. */
#app .home{padding-top:10px}
#app .compact-hero{padding-top:2px}
#app .compact-hero h1{margin-bottom:8px}
#app .catalog-search{margin:12px 0}
#app .home-quick-row{margin:8px 0 16px}
#app .catalog-shelf{margin-top:18px}
#app .shelf-title{align-items:center;margin-bottom:10px}
#app .categories{margin:14px 0 10px;padding:0 0 4px;max-width:100%;scroll-padding-inline:4px;overscroll-behavior-x:contain}
#app .categories button{scroll-margin-inline:4px;min-height:44px}
#app .create-tool-grid{gap:12px}
#app .create-tool{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:10px;padding:16px;min-height:166px;border:1px solid var(--line);box-shadow:none}
#app .create-tool>b{display:grid;place-items:center;width:40px;height:40px;margin:0;background:var(--surface-2);color:var(--accent);border-radius:12px}
#app .create-tool strong{font-size:15px;line-height:1.35;margin:0;min-height:2.7em}
#app .create-tool span{font-size:12px;line-height:1.5;margin:0;min-height:3em;color:var(--muted)}
#app .create-tool[data-create-wan-beta=prime]>b{background:color-mix(in srgb,var(--accent) 14%,var(--surface))}
#app .create-tool[data-create-wan-beta=standard]>b{color:var(--text)}
#app .create-tool.media-tool{align-items:center;min-height:120px;text-align:center}
#app .create-tool.media-tool strong,#app .create-tool.media-tool span{min-height:0}
/* History states come only from returned server records; no simulated progress/refunds. */
.history-activity{display:grid;gap:10px;margin:16px 0 22px}
.history-status{display:flex;align-items:flex-start;gap:12px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface)}
.history-status>b{color:var(--accent);flex:none}
.history-status>div{min-width:0}
.history-status strong,.history-status span,.history-status small{display:block;overflow-wrap:anywhere}
.history-status strong{font-size:14px;line-height:1.4}
.history-status span{font-size:13px;margin-top:4px;color:var(--text);line-height:1.5}
.history-status small{font-size:11px;color:var(--muted);margin-top:6px;line-height:1.5}
.history-status.is-error{border-style:dashed}
.history-status.is-error>b{color:var(--muted)}
/* Keep existing form behavior; unify native controls and existing modal surfaces. */
#app :is(.video-segment,.nano-modes) button{border-radius:var(--radius-control);min-height:44px}
#app :is(.history-filter,.library-filter){gap:8px;flex-wrap:wrap}
#app .library-card-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#app .library-card-actions button{min-height:44px;min-width:0;font-size:12px}
#app .library-card-actions button:first-child{grid-column:1/-1}
#app .library-card-copy strong{white-space:normal;overflow-wrap:anywhere;line-height:1.4}
#app .pending-job .spinner{font-size:18px;flex:none}
dialog :is(input,textarea,select){accent-color:var(--accent)}
dialog.wan-beta-sheet :is(button,.wb-upload label){background:var(--surface-2);border-color:var(--line)}
dialog.wan-beta-sheet :is(.wb-segment,.wb-duration-presets) [aria-pressed=true]{background:var(--selected);border-color:var(--accent);color:var(--text)}
dialog.wan-beta-sheet .wb-footer button[type=submit]{background:var(--brand);border-color:var(--brand);color:var(--on-accent);min-height:48px;border-radius:var(--radius-control);box-shadow:none}
dialog.wan-beta-sheet :is(.wb-eyebrow,.wb-duration-readout strong,.ss-empty){color:var(--accent)}
dialog.wan-beta-sheet input[data-seconds]{accent-color:var(--accent)}
/* Consent behavior and legal wording are untouched; only its existing inline colors are adapted. */
dialog[aria-labelledby=documents-title]{background:var(--surface);color:var(--text)!important;border:1px solid var(--line)!important;border-radius:var(--radius-dialog)!important}
dialog[aria-labelledby=documents-title] form>p:not([data-error]){color:var(--muted)!important}
dialog[aria-labelledby=documents-title] a{color:var(--accent)}
dialog[aria-labelledby=documents-title] [data-error]{color:var(--text)!important}
dialog[aria-labelledby=documents-title] button[type=submit]{min-height:48px;background:var(--brand)!important;color:var(--on-accent)!important}

.history-load-error{padding:20px;background:var(--surface);border:1px dashed var(--line);border-radius:var(--radius-card);margin:16px 0}
.history-load-error .hint{margin:8px 0}

/* Calm secondary actions; brand lime is reserved for the main CTA and mark. */
#app .bottom-nav{background:var(--nav)}
#app :is(.categories,.history-filter,.library-filter) button{background:var(--surface);color:var(--muted)}
#app :is(.categories,.history-filter,.library-filter,.nano-modes,.video-segment,.video-choice-grid,.duration-presets) button[aria-pressed=true],
.choice-sheet-list>button[aria-pressed=true],.video-model-sheet .video-model-card[aria-pressed=true]{background:var(--selected);color:var(--text);border-color:var(--accent);box-shadow:none}
#app :is(.secondary-btn,.ghost-btn){background:var(--surface-2);color:var(--text);box-shadow:none}
#app .upload-icon{background:var(--surface-2);color:var(--accent)}
.selection-check{background:var(--selected);color:var(--text)}
#app .brand-mark{object-fit:contain;filter:none}

/* Model picker: separate readable copy, specs and a stable price column. */
.video-model-sheet .video-model-card{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:16px;align-items:start;padding:16px;text-align:left}
.video-model-sheet .video-model-card .model-copy{display:flex;flex-direction:column;gap:8px;min-width:0}
.video-model-sheet .model-name{display:block;font-size:16px;line-height:1.35;font-weight:700;overflow-wrap:normal}
.video-model-sheet .model-description{display:block;font-size:13px;line-height:1.5;color:var(--muted)}
.video-model-sheet .video-model-card .model-details{display:flex;flex-direction:column;align-items:flex-end;gap:12px;min-width:0;text-align:right}
.video-model-sheet .model-specs{display:block;font-size:11px;line-height:1.5;font-style:normal;color:var(--muted);overflow-wrap:anywhere}
.video-model-sheet .model-price{display:flex;flex-direction:column;align-items:flex-end;gap:5px;font-size:15px;line-height:1.3;white-space:nowrap}
.video-model-sheet .model-price small{display:block;font-size:11px;line-height:1.4;color:var(--muted)}
.video-model-sheet .video-model-list{gap:10px}
@media(max-width:374px){.video-model-sheet{padding-left:12px;padding-right:12px}.video-model-sheet .video-model-card{grid-template-columns:minmax(0,1fr) 88px;gap:12px;padding:12px}.video-model-sheet .model-name{font-size:15px}}
