/* Wave's shared visual grammar. Functional state and theme tokens remain authoritative. */
:root{--wave-radius:14px;--wave-duration:180ms;--wave-reading:1440px;--wave-header-height:64px}
body{font-family:Inter,'Segoe UI',sans-serif;line-height:1.5}
*,*::before,*::after{box-sizing:border-box}
button,input,select,textarea{font-family:inherit}
button,a,input,select,textarea{touch-action:manipulation}
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--gust-accent,#91daf0)!important;outline-offset:3px}
button:disabled{cursor:not-allowed}
.gust-nav{height:64px!important;min-height:64px!important;position:sticky!important;top:0!important;z-index:70!important;padding:0 clamp(16px,3vw,42px)!important;gap:22px!important;background:var(--gust-base)!important;border-bottom:1px solid var(--gust-border)!important;font-family:Inter,'Segoe UI',sans-serif!important}
.gust-nav .wordmark{order:0!important;margin-right:8px!important}
.gust-nav #gust-command-button{order:2!important;margin-left:auto!important;height:36px!important}
.gust-nav nav{order:1!important;gap:4px!important;min-width:0}
.gust-nav nav a{height:38px!important;min-height:38px!important;padding:9px 13px!important;border-radius:9px!important;font:500 13px Inter,'Segoe UI',sans-serif!important;gap:8px!important}
.gust-nav nav a.active,.gust-nav nav a[aria-current=page]{background:color-mix(in srgb,var(--gust-accent) 10%,transparent)!important;border-color:transparent!important}
.gust-nav #profile-button{order:3!important}.gust-nav #gust-settings-link{order:4!important}
.gust-nav #profile-button,.gust-nav #gust-settings-link{width:36px!important;height:36px!important;border-radius:10px!important;background:transparent!important;border-color:transparent!important}
.gust-nav #profile-button:hover,.gust-nav #gust-settings-link:hover{background:var(--gust-raised)!important}
.layout{min-height:100dvh!important}
body:not([data-page=chat]):not([data-page=view]):not([data-page=watch]) .content main{max-width:var(--wave-reading)!important;padding:44px clamp(20px,4vw,56px) 64px!important;margin:auto!important}
body:not([data-page=chat]) .page-heading h1,body:not([data-page=chat]) .entry-library-header h1,body:not([data-page=chat]) .market-heading h1{font-family:WaveHomeSpace,Inter,sans-serif!important;font-size:clamp(32px,4vw,48px)!important;line-height:1.15!important;letter-spacing:-1.6px!important;font-weight:650!important}
.premium-eyebrow,.library-eyebrow,.market-eyebrow{font-size:10px!important;letter-spacing:1.8px!important;text-transform:uppercase}
.page-heading p,.entry-library-header p,.market-heading p{font-size:14px!important;line-height:1.65!important;margin-top:10px!important;max-width:55ch}
.gust-ambient{opacity:.45;pointer-events:none}
/* Focused launch surface, with room to breathe rather than nested page frames. */
body[data-page=home] .layout .content main:has(#home-panel){padding:0!important;max-width:none!important}
body[data-page=watch] .layout .content main{position:relative!important;inset:auto!important;padding:0!important;height:calc(100dvh - var(--wave-header-height,64px))!important;max-width:none!important}
body[data-page=watch] #watch-frame{position:fixed!important;top:var(--wave-header-height,64px)!important;left:0!important;width:100%!important;height:calc(100dvh - var(--wave-header-height,64px))!important;bottom:0!important;z-index:10!important}
body[data-page=home] #premium-home .hub-hero.wave-original-home{width:100%!important;margin:0!important;min-height:calc(100dvh - 64px)!important;border:0!important;border-radius:0!important;padding:110px 24px 100px!important;background:radial-gradient(ellipse at 50% 28%,color-mix(in srgb,var(--gust-accent) 9%,transparent),transparent 60%),var(--gust-base)!important;overflow:hidden!important}
body[data-page=home] .wave-home-header{top:24px;left:clamp(0px,3vw,40px);right:clamp(0px,3vw,40px);padding:16px 24px;font:500 12px Inter,sans-serif!important;color:var(--gust-secondary);letter-spacing:.02em}
body[data-page=home] .wave-home-time{font-variant-numeric:tabular-nums}
body[data-page=home] .wave-original-home .hub-hero-copy{gap:30px!important}
body[data-page=home] .wave-original-home h1.wave-home-brand{margin:0!important}
body[data-page=home] .wave-home-favorites{gap:14px;margin-top:16px;padding-bottom:24px}
body[data-page=home] .wave-original-home .hub-shortcuts button,body[data-page=home] .wave-original-home .wave-home-add{width:88px;height:88px;min-height:88px!important;border-radius:18px!important;background:color-mix(in srgb,var(--gust-raised) 60%,var(--gust-base))!important;border:1px solid var(--gust-border)!important;transition:transform .18s,background .18s,border-color .18s!important}
body[data-page=home] .wave-original-home .hub-shortcuts button:hover{transform:translateY(-3px)!important;background:var(--gust-raised)!important;border-color:color-mix(in srgb,var(--gust-accent) 45%,var(--gust-border))!important}
body[data-page=home] .wave-home-favorite-label{font:500 12px Inter,sans-serif!important;top:calc(100% + 10px)}
body[data-page=home] .wave-home-wallpaper{left:clamp(20px,4vw,64px);bottom:28px;width:40px;height:40px;padding:9px;border-radius:12px!important;background:transparent!important}
/* Artwork-led collection. Keep all data, launch and pagination behavior. */
body[data-page=library] #library-panel{border:0!important;border-radius:0!important;padding:0!important;background:transparent!important;min-height:0!important}
.entry-library-header{margin-bottom:30px!important;align-items:end!important}
.library-count,#market-total{border-radius:8px!important;font-size:12px!important;padding:7px 12px!important;white-space:nowrap}
.library-section-heading{margin-bottom:16px!important}
.library-section-heading h2,.market-section-heading h2{font-size:20px!important;letter-spacing:-.5px!important}
.featured-titles{gap:20px!important;margin-bottom:36px!important}
body[data-page=library] .entry-card{border-radius:14px!important;overflow:hidden;box-shadow:none!important}
body[data-page=library] .entry-card:hover{transform:translateY(-3px)!important;border-color:color-mix(in srgb,var(--gust-accent) 40%,var(--gust-border))!important}
.featured-titles .entry-card{min-height:260px!important;max-height:340px!important}
.entry-card .entry-art{overflow:hidden}.entry-card img{object-fit:cover;transition:transform .22s ease}
.entry-card:hover img{transform:scale(1.035)}
.entry-name{font-size:14px!important;line-height:1.45!important;font-weight:600!important;letter-spacing:-.15px}
.entry-category{font-size:11px!important;line-height:1.5!important}
.entry-grid{gap:22px 18px!important}
.library-toolbar{gap:14px!important;margin:24px 0!important}
.library-tools{margin:0 0 32px!important;gap:14px!important;scroll-margin-top:84px}
body[data-page=library] .entry-library #library-search{border-radius:12px!important;height:48px!important}
.library-modes button,.library-selects select,.library-pagination button,.library-pagination select{border-radius:9px!important}
.library-pagination{padding-top:24px!important;border-top:1px solid var(--gust-border);margin-top:32px!important;gap:12px!important}
.entry-favorite,.market-favorite{transition:background .18s,transform .18s!important}
.entry-favorite:active,.market-favorite:active{transform:scale(.9)!important}
/* Compact marketplace, with clear separation between featured and the full directory. */
.market-heading{margin-bottom:28px!important}
.market-search{border-radius:12px!important;min-height:48px!important;border-color:var(--gust-border)!important}
.market-search:focus-within{border-color:var(--gust-accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--gust-accent) 9%,transparent)!important}
.market-search input{background:transparent!important;box-shadow:none!important}
#app-categories{gap:6px!important;margin-top:14px!important;margin-bottom:32px!important;overflow:auto;scrollbar-width:thin}
#app-categories button{border-radius:8px!important;padding:9px 14px!important;white-space:nowrap;min-height:40px}
#app-categories button.is-selected{background:color-mix(in srgb,var(--gust-accent) 10%,transparent)!important;color:var(--gust-accent)!important}
.market-section-heading{margin:28px 0 16px!important;gap:12px;align-items:center}
.market-card{border-radius:14px!important;overflow:hidden;min-width:0;background:var(--gust-surface)!important;transition:transform .18s,border-color .18s!important}
.market-card:hover{transform:translateY(-3px)!important;border-color:color-mix(in srgb,var(--gust-accent) 40%,var(--gust-border))!important}
.market-open{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:16px!important;width:100%!important;min-height:132px!important;padding:22px 44px 22px 22px!important;border:0!important;background:transparent!important;text-align:left!important;box-shadow:none!important}
.market-card-copy{min-width:0;flex:1}.market-card-copy h3{font-size:15px!important;font-weight:600!important;line-height:1.4!important;margin:0 0 5px!important}.market-card-copy p{font-size:12px!important;line-height:1.6!important;margin:0 0 8px!important}
.market-icon{width:42px!important;height:42px!important;object-fit:contain;flex-shrink:0;border-radius:9px!important}
.featured-card .market-open{min-height:160px!important;padding-block:30px!important}
.marketplace .featured-card .market-open{flex-direction:row!important;align-items:center!important;text-align:left!important;min-height:160px!important}
.marketplace .featured-card .market-card-copy{text-align:left!important}
.market-tag{font-size:10px!important;border:0!important;padding:0!important;color:var(--gust-secondary)!important;background:transparent!important}
.market-favorite{position:absolute!important;top:10px!important;right:10px!important;width:32px!important;height:32px!important;min-height:32px!important;padding:7px!important;border:0!important;border-radius:8px!important;background:transparent!important}
.market-favorite:hover{background:var(--gust-raised)!important}
.market-arrow{bottom:16px!important;right:16px!important;opacity:.6}
.featured-apps,.app-grid{gap:16px!important}
.market-empty,.library-empty,#favorites-empty{border-radius:14px!important;border:1px dashed var(--gust-border)!important;padding:28px!important;background:transparent!important;color:var(--gust-secondary)!important}
/* One AI workspace, using the same navigation and palette as the rest of Wave. */
body[data-page=chat] main{position:relative!important;inset:auto!important;height:calc(100dvh - 64px)!important;padding:0!important;max-width:none!important;margin:0!important;overflow:hidden!important}
body[data-page=chat] .ai-workspace{--ai-bg:var(--gust-base);--ai-panel:var(--gust-surface);--ai-field:var(--gust-raised);--ai-text:var(--gust-foreground);--ai-muted:var(--gust-secondary);--ai-border:var(--gust-border);--ai-accent:var(--gust-accent);position:fixed!important;inset:var(--wave-header-height,64px) 0 0!important;height:calc(100dvh - var(--wave-header-height,64px))!important;border:0!important;border-radius:0!important}
body[data-page=chat] .ai-workspace[data-chat-theme=light]{--ai-bg:#f7f9fb;--ai-panel:#fff;--ai-field:#eef2f5;--ai-text:#1b2933;--ai-muted:#5e6e7c;--ai-border:#d7e0e7;--ai-accent:#226d87}
.ai-workspace .ai-sidebar{background:var(--ai-panel)!important}
.ai-sidebar-top{height:72px!important;padding:20px!important}.ai-sidebar-brand{font:600 14px Inter,sans-serif!important;letter-spacing:-.2px!important;color:var(--ai-text)!important}
.ai-sidebar-search{margin:0 14px 14px!important;border-radius:10px!important}.ai-sidebar-foot{padding:16px!important;min-height:54px!important;flex-shrink:0!important}.ai-sidebar-foot #ai-save-status{white-space:normal!important;line-height:1.5!important;overflow:visible!important}
.conversation-row{border-radius:9px!important;margin:3px 10px!important}.conversation-row.selected{background:color-mix(in srgb,var(--ai-accent) 10%,transparent)!important}
.ai-header{border-bottom:1px solid var(--ai-border)!important;min-height:64px!important;padding:12px 24px!important;background:var(--ai-bg)!important}
.ai-workspace .ai-welcome{max-width:760px!important;margin:auto!important;padding:36px 0!important;min-height:0!important;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ai-welcome .wave-welcome-label{font-size:11px!important;color:var(--ai-accent)!important;letter-spacing:1.6px;text-transform:uppercase;margin-bottom:18px}
.ai-workspace .ai-welcome h2{font:600 clamp(26px,3vw,38px)/1.22 WaveHomeSpace,Inter,sans-serif!important;letter-spacing:-1.1px!important;color:var(--ai-text)!important;margin:0 0 12px!important;text-align:center}
.ai-welcome>p{font-size:14px;color:var(--ai-muted);line-height:1.7;margin:0 0 28px!important;text-align:center}
.ai-workspace .ai-suggestions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:min(560px,100%)!important;max-width:560px!important;gap:10px!important;overflow:visible!important;flex-shrink:0}
.ai-workspace .ai-suggestions button{display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;grid-template-rows:auto auto!important;align-items:center;gap:4px 12px!important;min-width:0!important;min-height:80px!important;padding:16px!important;border:1px solid var(--ai-border)!important;border-radius:12px!important;text-align:left!important;background:var(--ai-panel)!important;color:var(--ai-text)!important;transition:background .18s,border-color .18s,transform .18s!important}
.ai-suggestions button svg{grid-row:1/3!important;width:19px!important;height:19px!important;color:var(--ai-accent)!important}.ai-suggestions button strong{font-size:12px!important;line-height:1.4!important;font-weight:550!important;white-space:normal!important}.ai-workspace .ai-suggestions button small{display:block!important;font-size:11px!important;line-height:1.5!important;color:var(--ai-muted)!important;white-space:normal!important}
.ai-suggestions button:hover{transform:translateY(-2px)!important;border-color:var(--ai-accent)!important}
.ai-workspace .chat-messages{padding:28px max(24px,calc((100% - 800px)/2))!important;min-height:0!important;scrollbar-gutter:stable}
.ai-workspace .ai-composer-wrap{width:min(800px,calc(100% - 48px))!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important;flex-shrink:0}
.ai-workspace #chat-form{padding:15px 17px 10px!important;background:var(--ai-panel)!important;border:1px solid var(--ai-border)!important;border-radius:20px!important;box-shadow:0 8px 28px #0002!important;transition:border-color .18s,box-shadow .18s!important}
.ai-workspace #chat-form:focus-within{border-color:color-mix(in srgb,var(--ai-accent) 60%,var(--ai-border))!important;box-shadow:0 8px 28px #0002,0 0 0 3px color-mix(in srgb,var(--ai-accent) 6%,transparent)!important}
.ai-workspace #chat-input{background:transparent!important;font-size:15px!important;line-height:1.6!important;min-height:42px!important;padding:0!important;color:var(--ai-text)!important}
.ai-workspace .message-content{line-height:1.8!important}.ai-workspace .message-content pre{max-width:100%;border-radius:12px!important;overflow-x:auto}.ai-message.user{border-radius:16px!important}.ai-model-button{border-radius:9px!important;min-height:36px!important}
/* Settings/account surfaces are grouped without replacing or deleting controls. */
.settings-grid{gap:20px!important}.settings-card,.premium-appearance{border-radius:16px!important;padding:26px!important;box-shadow:none!important}
.settings-card h2{font-size:17px!important;margin-bottom:20px!important}.settings-card label{font-size:12px!important;gap:9px!important}.settings-card select,.settings-card input:not([type=checkbox]):not([type=color]){min-height:44px!important;border-radius:9px!important}.settings-card p{font-size:12px!important;line-height:1.7!important}.theme-choice{border-radius:12px!important}
#profile-menu,dialog,.conversation-menu,.gust-context-menu{border-radius:16px!important;box-shadow:0 20px 60px #0004!important;max-height:calc(100dvh - 32px);overflow:auto}
#profile-menu{padding:22px!important}#profile-menu h2{font-size:18px!important;margin-bottom:12px!important}
#gust-navigation{width:min(380px,calc(100vw - 32px))!important;padding:20px!important;overflow:auto!important}
#gust-navigation nav{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:6px!important;width:100%!important;overflow:visible!important;max-height:none!important}
#gust-navigation nav a,#gust-navigation nav>button{display:flex!important;align-items:center!important;justify-content:flex-start!important;width:100%!important;min-width:0!important;min-height:46px!important;height:auto!important;gap:12px!important;padding:12px 14px!important;border:0!important;border-radius:10px!important;font-size:14px!important;flex:none!important}
#gust-navigation nav a span{display:inline!important;position:static!important;width:auto!important;height:auto!important;opacity:1!important;visibility:visible!important;font-size:14px!important;color:inherit!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important}
#gust-navigation nav svg{display:block!important;width:18px!important;height:18px!important;flex:0 0 18px!important}
dialog::backdrop{background:#05090fb3;backdrop-filter:blur(4px)}
footer{font-size:12px!important;padding:24px clamp(20px,4vw,56px)!important}
@media(min-width:1500px){.featured-titles .entry-card{min-height:300px!important}}
@media(max-width:1000px){.gust-nav{gap:12px!important;padding:0 18px!important}.gust-nav nav a{padding:9px 10px!important;gap:6px!important}.gust-nav #gust-command-button{display:none!important}.gust-nav #profile-button{margin-left:auto!important}.ai-workspace .chat-messages{padding:24px!important}.ai-workspace .ai-composer-wrap{width:calc(100% - 32px)!important}}
@media(max-width:760px){
 .gust-nav{height:calc(64px + env(safe-area-inset-top))!important;padding:env(safe-area-inset-top) 16px 0!important;gap:10px!important}.gust-nav .wordmark{margin-right:auto!important}.gust-nav #profile-button,.gust-nav #gust-menu-button{width:44px!important;height:44px!important;border-radius:12px!important}.gust-nav #gust-menu-button{order:5!important}
 body:not([data-page=chat]):not([data-page=view]):not([data-page=watch]) .content main{padding:28px 18px 40px!important}
 body[data-page=home] .content main{padding:0!important}body[data-page=home] #premium-home .hub-hero.wave-original-home{min-height:calc(100dvh - 64px - env(safe-area-inset-top))!important;padding:110px 20px 100px!important}
 body[data-page=home] .wave-home-header{top:10px;left:0;right:0;padding:16px 20px;font-size:11px!important;gap:12px}
 body[data-page=home] .wave-home-favorites{max-width:320px;gap:14px 16px;row-gap:30px;margin-top:12px}
 .featured-titles{gap:12px!important}.featured-titles .entry-card{min-height:240px!important;max-height:300px!important}.entry-grid{gap:18px 12px!important}.library-pagination{flex-wrap:wrap!important}.library-toolbar{gap:12px!important}
 .market-open{min-height:124px!important;padding:20px 40px 20px 18px!important;gap:14px!important}.featured-card .market-open{min-height:132px!important;padding-block:24px!important}.featured-apps{grid-template-columns:1fr!important}.app-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}.app-grid .market-open{flex-direction:column!important;align-items:flex-start!important;padding:22px 16px 20px!important;min-height:180px!important;gap:14px!important}.app-grid .market-arrow{display:none}.market-section-heading{flex-wrap:wrap}.market-search input{font-size:16px!important}
 body[data-page=chat] main{height:calc(100dvh - 64px - env(safe-area-inset-top))!important}body[data-page=chat] .ai-workspace{top:var(--ai-mobile-top,var(--wave-header-height,64px))!important;bottom:auto!important;height:var(--ai-mobile-height,calc(100dvh - var(--wave-header-height,64px)))!important}.ai-header{padding:10px 12px!important;gap:6px!important}.ai-workspace .chat-messages{padding:20px 16px!important;scrollbar-gutter:auto}.ai-workspace .ai-welcome{padding:12px 0 22px!important;width:100%!important}.ai-workspace .ai-welcome h2{font-size:28px!important}.ai-welcome>p{font-size:12px;margin-bottom:20px!important;max-width:32ch}.ai-workspace .ai-suggestions{gap:8px!important}.ai-workspace .ai-suggestions button{padding:12px!important;min-height:90px!important;grid-template-columns:1fr!important;grid-template-rows:auto auto auto!important;gap:5px!important}.ai-suggestions button svg{grid-row:auto!important}.ai-suggestions button strong{font-size:11px!important}.ai-workspace .ai-suggestions button small{font-size:10px!important}.ai-workspace .ai-composer-wrap{width:calc(100% - 24px)!important;padding-bottom:max(10px,env(safe-area-inset-bottom))!important}.ai-workspace #chat-input{font-size:16px!important}.ai-workspace #chat-form{padding:12px 14px 8px!important}.settings-card,.premium-appearance{padding:20px!important}.settings-grid{gap:16px!important}
}
@media(max-width:760px){.gust-nav #profile-button,.gust-nav #gust-menu-button{flex:0 0 44px!important}.marketplace .featured-card .market-open{min-height:126px!important;padding:24px 42px 24px 22px!important}.marketplace .featured-card .market-card-copy{text-align:left!important}.marketplace .featured-card .market-icon{width:42px!important;height:42px!important}.marketplace #app-categories{scrollbar-width:none}.marketplace #app-categories::-webkit-scrollbar{display:none}}
@media(max-height:700px){.ai-workspace .ai-welcome{padding:14px 0!important}.ai-welcome>p{margin-bottom:14px!important}.ai-workspace .ai-suggestions button{min-height:66px!important;padding:10px!important}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}
html[data-gust-motion=off] *,html[data-gust-motion=off] *::before{animation:none!important;transition:none!important;scroll-behavior:auto!important}
/* Home search uses the existing submit handler and saved engine preference. */
/* Home is the complete browser workspace, including its native new-tab surface. */
body[data-page=home] .layout .content main:has(#home-panel){height:calc(100dvh - var(--wave-header-height,64px))!important;min-height:0!important;overflow:hidden!important}
body[data-page=home] #home-panel,body[data-page=home] footer{display:none!important}
body[data-page=home] #gust-frame:not([hidden]){display:block!important;z-index:10!important}
body[data-page=home] #premium-home .wave-original-home .hub-hero-copy #hub-search{display:flex!important;align-items:center!important;width:min(700px,100%)!important;gap:8px!important;margin:0!important;padding:8px!important;min-height:62px!important;border:1px solid var(--gust-border)!important;border-radius:16px!important;background:var(--gust-surface)!important;box-shadow:0 8px 28px #0001!important;flex-wrap:nowrap!important;transition:border-color .18s,box-shadow .18s}
body[data-page=home] #premium-home #hub-search:focus-within{border-color:var(--gust-accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--gust-accent) 8%,transparent)!important}
body[data-page=home] #premium-home #hub-search #hub-query{height:44px!important;padding:0 10px!important;background:transparent!important;border:0!important;border-radius:8px!important;box-shadow:none!important;font:14px Inter,sans-serif!important;color:var(--gust-foreground)!important}
body[data-page=home] #premium-home #hub-search #wave-home-engine{height:40px!important;min-width:110px;max-width:148px;margin:0!important;background:var(--gust-raised)!important;border:0!important;border-radius:9px!important;font:12px Inter,sans-serif!important;color:var(--gust-secondary)!important}
body[data-page=home] #premium-home #hub-search>button{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;border-radius:11px!important}
@media(max-width:600px){body[data-page=home] #premium-home .wave-original-home .hub-hero-copy #hub-search{gap:4px!important;padding:6px!important;min-height:58px!important}body[data-page=home] #premium-home #hub-search #hub-query{font-size:16px!important;padding:0 6px!important}body[data-page=home] #premium-home #hub-search #wave-home-engine{min-width:0!important;max-width:100px!important;width:100px!important;font-size:11px!important;padding:0 20px 0 8px!important}}
