/* App interiors only. Shell geometry, wallpaper and first-run setup are independent. */
html[data-theme] .os-window {
  --content-paper:#f0f0e6; --content-card:#e3e5dc; --content-soft:#daddd6;
  --content-ink:#182033; --content-muted:#465064; --content-line:#8b9295;
  --content-accent:#002ea5; --content-hover:#00257f; --content-tint:#e3eafa;
  --content-dark:#071e59; --content-dark-ink:#ffffff; --content-dark-muted:#d0dcf5;
  --content-result:#173776; --content-result-ink:#ffffff; --content-result-muted:#d0dcf5;
  --content-radius:0px; --content-control-radius:0px;
  --content-process:#11172e; --content-process-ink:#ffffff; --content-process-muted:#d4d9ed;
}
html[data-theme=macos] .os-window {
  --content-paper:#faf9fb; --content-card:#ffffff; --content-soft:#eeebf1;
  --content-ink:#302c38; --content-muted:#635d6d; --content-line:#d3ceda;
  --content-accent:#315fa6; --content-hover:#244a85; --content-tint:#eae6f3;
  --content-dark:#302d3e; --content-dark-ink:#fcfaff; --content-dark-muted:#dcd5e8;
  --content-result:#494259; --content-result-ink:#ffffff; --content-result-muted:#ebe4f5;
  --content-radius:14px; --content-control-radius:9px;
  --content-process:var(--content-paper); --content-process-ink:var(--content-ink); --content-process-muted:var(--content-muted);
}
html[data-theme=modern] .os-window {
  --content-paper:#f7faff; --content-card:#ffffff; --content-soft:#eaf1f9;
  --content-ink:#20354c; --content-muted:#50677f; --content-line:#c8d8e8;
  --content-accent:#075fa8; --content-hover:#064a83; --content-tint:#e3f0fd;
  --content-dark:#143552; --content-dark-ink:#ffffff; --content-dark-muted:#d1e5f7;
  --content-result:#244f75; --content-result-ink:#ffffff; --content-result-muted:#e0effd;
  --content-radius:8px; --content-control-radius:6px;
  --content-process:var(--content-paper); --content-process-ink:var(--content-ink); --content-process-muted:var(--content-muted);
}
/* Phone personalities keep every reading, form and feedback surface in their palette. */
@media (max-width:600px), (max-width:1000px) and (max-height:600px) and (pointer:coarse) {
  html[data-theme=retro] .os-window {
    --content-paper:#e6ecd6; --content-card:#f1f4e6; --content-soft:#d2ddbc;
    --content-ink:#293523; --content-muted:#49583e; --content-line:#82946b;
    --content-accent:#334b29; --content-hover:#24371c; --content-tint:#d5e0bd;
    --content-dark:#d2ddbc; --content-dark-ink:#293523; --content-dark-muted:#49583e;
    --content-result:#bacba1; --content-result-ink:#25301f; --content-result-muted:#35452b;
    --content-radius:2px; --content-control-radius:2px;
    --content-process:var(--content-paper); --content-process-ink:var(--content-ink); --content-process-muted:var(--content-muted);
  }
  html[data-theme=modern] .os-window {
    --content-paper:#fafbf4; --content-card:#ffffff; --content-soft:#edf1e4;
    --content-ink:#283c2e; --content-muted:#53654f; --content-line:#c6d1bd;
    --content-accent:#386641; --content-hover:#284d30; --content-tint:#dfebd6;
    --content-dark:#293e30; --content-dark-ink:#fbfff5; --content-dark-muted:#d4e4ca;
    --content-result:#415c43; --content-result-ink:#ffffff; --content-result-muted:#e0edd5;
    --content-radius:20px; --content-control-radius:14px;
  }
}
/* Assign legacy variables inside the content, never to titlebars or window controls. */
html[data-theme] .os-window .window-content {
  --blue:var(--content-accent); --blue-hover:var(--content-hover); --navy:var(--content-accent);
  --paper:var(--content-paper); --ink:var(--content-ink); --silver:var(--content-soft);
  --blue-edge:var(--content-line); --blue-shadow:var(--content-ink); --blue-text:var(--content-dark-muted);
  color:var(--content-ink); background:var(--content-paper);
}
html[data-theme] .os-window .window-content :is(.hero-grid,.section-content,.theme-settings,.project-wizard,.wizard-main) { background:var(--content-paper); color:var(--content-ink); }
html[data-theme] .os-window .window-content :is(h1,h2,h3) { color:var(--content-ink); overflow-wrap:break-word; }
html[data-theme] .os-window .window-content :is(.eyebrow,.service-label,.signature,.about-stamp,.legal-details dt,.wizard-badge,.wizard-summary dt,.wizard-main .eyebrow) { color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.hero-secondary,.theme-description,.theme-settings>p,.service .example-label,.about-stamp span,.contact-placeholder>span,.contact-placeholder small,.wizard-intro,.wizard-field>span,.project-wizard legend span,.wizard-privacy,.wizard-header>span) { color:var(--content-muted); }
html[data-theme] .os-window .window-content :is(.legal-content a,.wizard-privacy a,.wizard-privacy summary,.theme-settings #theme-feedback) { color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.button,.example-tabs button) { background:var(--content-card); color:var(--content-ink); border-color:var(--content-line); border-radius:var(--content-control-radius); }
html[data-theme] .os-window .window-content :is(.button,.example-tabs button):hover { background:var(--content-tint); color:var(--content-ink); }
html[data-theme] .os-window .window-content :is(.button.primary,.example-tabs button[aria-pressed=true]) { background:var(--content-accent); color:#fff; border-color:var(--content-accent); }
html[data-theme] .os-window .window-content .button.primary:hover { background:var(--content-hover); color:#fff; }
html[data-theme] .os-window .window-content :is(a,button,input,textarea,select):focus-visible { outline-color:var(--content-accent); }
/* A complete foreground/background pair for the dark demonstration panel. */
html[data-theme] .os-window .window-content .terminal-window { background:var(--content-soft); border-color:var(--content-line); }
html[data-theme] .os-window .window-content :is(.terminal-title,.terminal-status,.example-tabs) { background:var(--content-soft); color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] .os-window .window-content .terminal-body { background:var(--content-dark); color:var(--content-dark-ink); }
html[data-theme] .os-window .window-content .flow-step strong { color:var(--content-dark-ink); }
html[data-theme] .os-window .window-content :is(.terminal-prompt,.terminal-note,.flow-connector,.flow-step span) { color:var(--content-dark-muted); }
html[data-theme] .os-window .window-content .flow-result { background:var(--content-result); color:var(--content-result-ink); border-color:var(--content-dark-muted); }
html[data-theme] .os-window .window-content .flow-result strong { color:var(--content-result-ink); }
html[data-theme] .os-window .window-content .flow-result span { color:var(--content-result-muted); }
html[data-theme] .os-window .window-content :is(.service,.theme-option,.wizard-summary,.contact-placeholder) { background:var(--content-card); color:var(--content-ink); border-color:var(--content-line); border-radius:var(--content-radius); }
html[data-theme] .os-window .window-content :is(.info-strip,.about-stamp,.wizard-tip) { background:var(--content-tint); color:var(--content-ink); border-color:var(--content-line); border-radius:var(--content-radius); }
html[data-theme] .os-window .window-content .info-strip>span { color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.service .example-label,.signature,.legal-details>div) { border-color:var(--content-line); }
html[data-theme] .os-window.process .window-content .section-content { background:var(--content-process); color:var(--content-process-ink); }
html[data-theme] .os-window.process .window-content :is(h2,h3) { color:var(--content-process-ink); }
html[data-theme] .os-window.process .window-content :is(article p,.eyebrow,.step-number) { color:var(--content-process-muted); }
html[data-theme] .os-window.process .window-content .step-number { border-color:var(--content-line); }
html[data-theme] .os-window .window-content .conversation { background:var(--content-soft); color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] .os-window .window-content .dialog-label { background:var(--content-tint); color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] .os-window .window-content .conversation li { color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] .os-window .window-content .conversation li span { color:var(--content-accent); }
html[data-theme] .os-window .window-content .window-status { background:var(--content-soft); color:var(--content-muted); border-color:var(--content-line); }
/* The wizard keeps its existing flex scroll region and stationary footer. */
html[data-theme] .os-window .window-content :is(.wizard-header,footer.wizard-footer,.wizard-sidebar) { background:var(--content-soft); color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] .os-window .window-content :is(.wizard-header strong,.wizard-field,.theme-option strong) { color:var(--content-ink); }
html[data-theme] .os-window .window-content :is(.wizard-side-note,.wizard-sidebar>p:first-child) { color:var(--content-muted); }
html[data-theme] .os-window .window-content .wizard-sidebar button { color:var(--content-ink); border-radius:var(--content-control-radius); }
html[data-theme] .os-window .window-content .wizard-sidebar button>span { background:var(--content-card); color:var(--content-muted); border-color:var(--content-line); }
html[data-theme] .os-window .window-content .wizard-sidebar button[aria-current=step] { background:var(--content-tint); color:var(--content-accent); border-color:var(--content-accent); }
html[data-theme] .os-window .window-content .wizard-sidebar button[aria-current=step]:before { background:var(--content-accent); }
html[data-theme] .os-window .window-content .wizard-sidebar :is(button[aria-current=step],button.is-complete)>span { background:var(--content-accent); color:#fff; border-color:var(--content-accent); }
html[data-theme] .os-window .window-content .wizard-choice { background:var(--content-card); color:var(--content-ink); border-color:var(--content-line); border-radius:var(--content-control-radius); }
html[data-theme] .os-window .window-content :is(.wizard-choice:hover,.theme-option:hover) { background:var(--content-tint); border-color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.wizard-choice,.theme-option):has(input:checked) { background:var(--content-tint); border-color:var(--content-accent); outline-color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.wizard-choice,.theme-option):focus-within { outline-color:var(--content-accent); }
html[data-theme] .os-window .window-content :is(.wizard-choice input,.theme-option input) { accent-color:var(--content-accent); }
html[data-theme] .os-window .window-content .wizard-field :is(input,textarea,select) { background:var(--content-card); color:var(--content-ink); border-color:var(--content-line); border-radius:var(--content-control-radius); }
html[data-theme] .os-window .window-content .wizard-field :is(input,textarea,select):focus { outline-color:var(--content-accent); border-color:var(--content-accent); box-shadow:none; }
html[data-theme] .os-window .window-content .wizard-field :is(input,textarea)::placeholder { color:var(--content-muted); opacity:1; }
html[data-theme] .os-window .window-content .wizard-success-icon { background:var(--content-accent); color:#fff; border-radius:var(--content-radius); }
html[data-theme] .os-window .window-content .wizard-error { background:#fff0eb; color:#792517; border-color:#aa3020; border-radius:var(--content-control-radius); }
/* Knowledge variables must be set on its ID, which owns the reading defaults. */
html[data-theme] #wissen.os-window {
  --knowledge-paper:var(--content-paper); --knowledge-surface:var(--content-soft); --knowledge-line:var(--content-line);
  --knowledge-ink:var(--content-ink); --knowledge-muted:var(--content-muted); --knowledge-accent:var(--content-accent); --knowledge-radius:var(--content-radius);
}
html[data-theme] #wissen .window-content .knowledge-card { background:var(--content-card); color:var(--content-ink); }
html[data-theme] #wissen .window-content :is(.knowledge-note,.knowledge-card:hover) { background:var(--content-tint); color:var(--content-ink); border-color:var(--content-accent); }
html[data-theme] #wissen .window-content .knowledge-search input[type=search] { background:var(--content-card); color:var(--content-ink); border-color:var(--content-line); }
html[data-theme] #wissen .window-content .knowledge-search input::placeholder { color:var(--content-muted); opacity:1; }
html[data-theme] #wissen .window-content :is(button:not(:disabled):hover,.knowledge-article-actions a:hover) { background:var(--content-tint); color:var(--content-ink); border-color:var(--content-accent); }
html[data-theme] #wissen .window-content .knowledge-topics :is([aria-pressed=true],[aria-current=true],.is-active) { background:var(--content-accent); color:#fff; border-color:var(--content-accent); }
/* Modern interiors use restrained application sizing based on their window, not the desktop. */
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content h1 { font-size:clamp(30px,5cqi,44px); line-height:1.12; letter-spacing:-.035em; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content h2 { font-size:clamp(26px,4cqi,34px); line-height:1.18; letter-spacing:-.025em; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content h3 { font-size:21px; line-height:1.3; letter-spacing:-.015em; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.hero-grid,.section-content) { padding:28px; gap:28px; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.hero-intro,.section-intro,.about-copy .lead) { font-size:15px; line-height:1.75; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.service>p,.process-grid article p,.about-copy p,.contact-grid>div>p) { font-size:14px; line-height:1.75; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.service,.conversation,.theme-option,.wizard-summary,.terminal-window) { border-radius:var(--content-radius); box-shadow:0 2px 8px #20203008; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .process-grid { gap:16px; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .process-grid article { padding:20px; border:1px solid var(--content-line); background:var(--content-card); color:var(--content-ink); border-radius:var(--content-radius); }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .step-number { color:var(--content-accent); font-size:28px; padding-bottom:14px; margin-bottom:18px; border-bottom-style:solid; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .conversation ol { display:grid; gap:8px; padding:8px 14px; }
html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .conversation li { padding:12px; background:var(--content-card); border:1px solid var(--content-line); border-radius:var(--content-control-radius); }
html[data-theme=macos] .os-window .window-content .conversation li:nth-child(even) { background:var(--content-tint); margin-left:16px; }
html[data-theme=macos] .os-window .window-content .about-stamp { border-left:3px solid #9d8db1; }
html[data-theme=modern] .os-window .window-content .service { border-top:3px solid var(--content-accent); }
html[data-theme] #wissen .window-content .knowledge-card h2 { font-size:19px; line-height:1.35; }
html[data-theme] #wissen .window-content .knowledge-article h2 { font-size:23px; line-height:1.35; }
html[data-theme] #wissen .window-content .knowledge-article h3 { font-size:18px; line-height:1.4; }
html[data-theme=retro] #wissen .window-content :is(h1,h2,h3) { font-family:var(--pixel); font-weight:400; letter-spacing:0; }
html[data-theme=retro] #wissen .window-content h1 { font-size:38px; line-height:1.1; }
html[data-theme=retro] #wissen .window-content .knowledge-card h2 { font-size:27px; line-height:1.1; }
html[data-theme=retro] #wissen .window-content .knowledge-article h2 { font-size:30px; line-height:1.15; }
@container (max-width:650px) {
  html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.hero-grid,.section-content) { padding:24px 20px; gap:24px; }
  html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content .process-grid { grid-template-columns:1fr; }
  html[data-theme] .os-window .window-content .legal-details>div { grid-template-columns:1fr; gap:5px; }
}
@media (max-width:600px), (max-width:1000px) and (max-height:600px) and (pointer:coarse) {
  html[data-theme] .os-window .window-content :is(.button,.example-tabs button) { min-height:44px; }
  html[data-theme] .os-window .window-content .wizard-field :is(input,textarea,select) { font-size:16px; }
  html[data-theme=modern] .os-window .window-content :is(.button,.example-tabs button) { border-radius:24px; }
  html[data-theme=modern] .os-window .window-content .service { border-top-width:1px; }
  html[data-theme=modern] .os-window .window-content .conversation li { border-radius:16px 16px 16px 4px; }
  html[data-theme=modern] .os-window .window-content .conversation li:nth-child(even) { margin-left:16px; background:var(--content-tint); border-radius:16px 16px 4px 16px; }
  html[data-theme=retro] .os-window .window-content :is(.terminal-window,.service,.conversation,.contact-placeholder,.theme-option,.wizard-field input,.wizard-field textarea,.wizard-field select) { box-shadow:inset 1px 1px #ffffff99,inset -1px -1px #82946b; }
  html[data-theme=retro] .os-window .window-content .terminal-body { background-image:repeating-linear-gradient(0deg,#29352305 0,#29352305 1px,transparent 1px,transparent 4px); }
  html[data-theme=retro] .os-window .window-content .flow-result { box-shadow:none; border-color:var(--content-line); }
  html[data-theme=retro] .os-window .window-content .wizard-sidebar button { font-family:Tahoma,Arial,sans-serif; }
  html[data-theme=retro] #wissen .window-content .knowledge-card { box-shadow:1px 1px #82946b; }
  html[data-theme=retro] .os-window .window-content { scrollbar-color:#82946b #e6ecd6; }
  html[data-theme=retro] .os-window .window-content::-webkit-scrollbar-track { background:#e6ecd6; }
  html[data-theme=retro] .os-window .window-content::-webkit-scrollbar-thumb { background:#bacba1; border-color:#e6ecd6; }
  html[data-theme=modern] .os-window .window-content { scrollbar-color:#a6b79b #fafbf4; }
  html[data-theme=modern] .os-window .window-content::-webkit-scrollbar-track { background:#fafbf4; }
  html[data-theme=modern] .os-window .window-content::-webkit-scrollbar-thumb { background:#a6b79b; border-color:#fafbf4; }
}

html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.wizard-main,.theme-settings) h2 { font-size:26px; line-height:1.2; }
@media (max-width:600px), (max-width:1000px) and (max-height:600px) and (pointer:coarse) {
  html:is([data-theme=macos],[data-theme=modern]) .os-window .window-content :is(.wizard-main,.theme-settings) h2 { font-size:24px; }
  html[data-theme=retro] .os-window .window-content .button.primary { box-shadow:inset 1px 1px #82946b,inset -1px -1px #24371c; }
}
