/* ══════════════════════════════════════════════════════════════════════════
   DotBlazer — dedicated phone UI (≤ 760px)
   Loaded LAST so it wins the cascade. The landing page's Bolt-style blue stage
   (deep-blue gradient, dark glass cards, white type, blue primary buttons) is the
   visual system for every phone surface here: workbench, build strip, Mira chat,
   plan/blueprint window, credits & notifications, pricing, preferences, menus.
   Desktop is untouched: everything is scoped to the phone media query.
   ══════════════════════════════════════════════════════════════════════════ */
.dns-gen-pill { display: none; }
.dns-mobile-home { display: none; }
@media (max-width: 760px) {
  .dns-gen-pill { display: flex; }
  .dns-mobile-home {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 1200;
    width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--m-line-2);
    background: linear-gradient(135deg, var(--m-blue), var(--m-blue-2)); color: #fff;
    box-shadow: 0 10px 24px -8px rgba(124,58,237,.6);
  }
  .dns-mobile-home:active { transform: scale(.95); }
  /* Phone surfaces read the SAME theme tokens as desktop (app.css :root / html.light-theme), so
     dark = neutral navy/indigo and light = paper. The old Bolt-style saturated-blue stage is gone. */
  :root {
    --m-stage: var(--dns-bg-stream);
    --m-stage-glow: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--dns-bg-stream-glow-1) 70%, transparent), transparent 65%), radial-gradient(70% 50% at 50% 100%, color-mix(in srgb, var(--dns-bg-stream-glow-2) 80%, transparent), transparent 70%);
    --m-bg: var(--dns-bg-app);
    --m-glass: color-mix(in srgb, var(--dns-bg-surface) 94%, transparent);
    --m-glass-2: rgba(255,255,255,.06);
    --m-glass-3: rgba(255,255,255,.1);
    --m-line: var(--dns-border);
    --m-line-2: var(--dns-border-strong);
    --m-text: var(--dns-text);
    --m-text-2: var(--dns-text-muted);
    --m-text-3: var(--dns-text-subtle);
    --m-blue: var(--dns-accent);
    --m-blue-2: var(--dns-accent-2);
    --m-sky: var(--dnsc-brand-2);
    --m-ok: #34d399;
    --m-danger: #f87171;
    --m-radius: 22px;
    --m-tap: 46px;
    --m-safe-b: env(safe-area-inset-bottom, 0px);
    --m-safe-t: env(safe-area-inset-top, 0px);
    --m-shadow: 0 30px 70px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
    --m-bar: color-mix(in srgb, var(--dns-bg-app) 82%, transparent);
    --m-bar-2: color-mix(in srgb, var(--dns-bg-surface-2) 92%, transparent);
    --m-accent-soft: color-mix(in srgb, var(--dns-accent) 22%, transparent);
    --m-accent-line: color-mix(in srgb, var(--dns-accent) 45%, transparent);
    --m-accent-text: #ddd6fe;
  }
  html.light-theme {
    --m-glass: #ffffff; --m-glass-2: #eef2fb; --m-glass-3: #e2e8f5;
    --m-ok: #059669; --m-danger: #dc2626;
    --m-shadow: 0 30px 70px -30px rgba(16,24,40,.35), inset 0 1px 0 #fff;
    --m-bar: rgba(255,255,255,.86); --m-bar-2: rgba(243,247,255,.94);
    --m-accent-soft: #eef2ff; --m-accent-line: #c7d2fe; --m-accent-text: #4338ca;
  }

  /* ─────────────────────────── Shared phone primitives ─────────────────────────── */
  .m-sheet-base, .dns-popover, .dns-ledger-modal, .dns-prefs-sheet, .dns-modal, .dns-layout-popup, .dnsc-composer-modal,
  .dns-project-menu-panel.dns-tb-more-panel, .dns-project-menu-panel.dns-tb-project-panel {
    color: var(--m-text);
    font-size: 15px;
  }
  .m-btn-primary, .dnsc-send:not(.ghost), .bpx-btn.primary, .dns-prefs-foot .dns-btn-primary, .pr-card .pub-btn-primary, .dns-tb-btn-run, .dns-ms-btn.dns-ms-run.on {
    background: linear-gradient(135deg, var(--m-blue), var(--m-blue-2)) !important;
    color: #fff !important; border: 0 !important;
    box-shadow: 0 10px 24px -8px rgba(124,58,237,.55) !important;
  }

  /* ═══════════════════════════ 1. Workbench shell ═══════════════════════════ */
  .dns-workspace-shell {
    height: 100dvh !important; min-height: 100dvh; display: flex; flex-direction: column;
    background: var(--m-stage-glow), var(--m-stage) !important; color: var(--m-text);
    isolation: isolate;
  }
  html.light-theme .dns-workspace-shell { background: var(--m-stage-glow), var(--m-stage) !important; }

  /* Header: compact glass bar with logo · title · status · credits. Desktop clusters hidden. */
  .dns-workspace-shell .dns-workspace-toolbar.dns-toolbar-modern {
    position: sticky; top: 0; z-index: 30; order: 0;
    display: grid !important; grid-template-columns: auto auto minmax(0, 1fr) auto auto; grid-auto-rows: auto;
    align-items: center; gap: 8px; flex-wrap: nowrap; overflow: visible;
    min-height: calc(56px + var(--m-safe-t)); padding: calc(8px + var(--m-safe-t)) 10px 8px 6px;
    background: var(--m-bar) !important; border-bottom: 1px solid var(--m-line) !important;
    backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 10px 30px -18px rgba(0,0,0,.6) !important;
  }
  .dns-workspace-toolbar .dns-view-switch, .dns-workspace-toolbar .dns-tb-group, .dns-workspace-toolbar .dns-tb-divider,
  .dns-workspace-toolbar .dns-tb-secondary, .dns-workspace-toolbar .dns-tb-more, .dns-workspace-toolbar .dns-tb-spacer,
  .dns-workspace-toolbar .dns-tb-diag, .dns-workspace-toolbar > .theme-toggle, .dns-workspace-toolbar > div[style*="flex:1"],
  .dns-workspace-toolbar > .dns-tb-btn:not(.dns-tb-back) { display: none !important; }
  .dns-workspace-toolbar .dns-logo-link { display: inline-flex; align-items: center; justify-content: center; height: 40px; width: 40px; padding: 0; border-radius: 12px; }
  .dns-workspace-toolbar .dns-logo.dns-logo-sm, .dns-workspace-toolbar .dns-logo.dns-logo-mark { height: 28px; width: 28px; }
  html.light-theme .dns-workspace-toolbar .dns-logo-mark { background-image: url('../img/dotblazer-mark.svg'); filter: none; opacity: 1; }
  .dns-workspace-toolbar .dns-tb-btn.dns-tb-back {
    display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0 !important;
    border-radius: 12px; background: var(--m-glass-2) !important; border: 1px solid var(--m-line) !important; color: var(--m-text) !important; font-size: 1.1rem;
  }
  .dns-workspace-toolbar .dns-tb-back .dns-tb-label { display: none; }
  .dns-workspace-toolbar .dns-project-menu, .dns-workspace-toolbar > .dns-tb-title { min-width: 0; }
  .dns-workspace-toolbar .dns-project-menu-trigger {
    display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; height: 40px; padding: 0 10px;
    border-radius: 12px; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text);
  }
  .dns-workspace-toolbar .dns-tb-title { color: var(--m-text) !important; font-size: .92rem; font-weight: 700; max-width: none !important; flex: 1 1 auto; }
  .dns-workspace-toolbar .dns-caret { color: var(--m-text-3); }
  .dns-workspace-toolbar .dns-tb-statuswrap { max-width: 34vw; min-width: 0; }
  .dns-workspace-toolbar .dns-tb-status {
    display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 999px; font-size: .72rem; font-weight: 700;
    background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text-2); max-width: 100% !important;
  }
  .dns-workspace-toolbar .dns-account-bar.compact { gap: 6px; }
  .dns-workspace-toolbar .dns-plan-chip { height: 34px; border-radius: 999px; padding: 0 10px; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text); }
  .dns-workspace-toolbar .dns-plan-chip-name { display: none; }
  .dns-workspace-toolbar .dns-plan-chip-credits { font-size: .78rem; font-weight: 800; color: var(--m-sky); }
  .dns-workspace-toolbar .dns-bell { width: 34px; height: 34px; border-radius: 50%; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text); }

  /* Content: build surface / editor / preview fill the screen above the tab bar. */
  .dns-workspace-shell #workspace-container { flex: 1 1 auto; min-height: 0; display: flex !important; flex-direction: column !important; overflow: hidden; order: 1; }
  .dns-workspace-shell #panel-editor { flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; min-height: 0; }
  .dns-explorer-panel:not(.dns-explorer-mobile-open), #divider-1, #divider-2 { display: none !important; }
  .dns-gen-surface { background: transparent !important; overflow-y: auto !important; }
  .dns-gen-surface-inner { padding: 16px 14px calc(24px + var(--m-safe-b)); max-width: 100% !important; box-sizing: border-box; }
  .dns-gen-surface-title, .dns-gen-surface-sub { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; padding: 0 6px; }
  .dns-gen-surface-title { font-size: 1.05rem; line-height: 1.3; color: #fff !important; }
  .dns-gen-surface-sub { font-size: .86rem; color: var(--m-text-2) !important; line-height: 1.5; }
  .dns-gen-filelist { max-height: 38dvh; width: 100%; box-sizing: border-box; background: var(--m-glass-2) !important; border-color: var(--m-line) !important; }
  .dns-gen-filerow > span:last-child { white-space: normal !important; overflow-wrap: anywhere; }
  .dns-blueprint-drafting { padding: 22px 18px; border-radius: var(--m-radius); background: var(--m-glass); border: 1px solid var(--m-line); box-shadow: var(--m-shadow); color: var(--m-text); }
  .dns-blueprint-drafting h2 { font-size: 1.5rem; color: #fff; letter-spacing: -.02em; }
  .dns-blueprint-drafting p, .dns-blueprint-drafting small { color: var(--m-text-2); }
  .dns-blueprint-drafting blockquote { margin: 12px 0; padding: 12px 14px; border-left: 3px solid var(--m-blue); background: var(--m-glass-2); border-radius: 0 12px 12px 0; color: var(--m-text); }
  .dns-draft-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .dns-draft-grid article { padding: 14px; border-radius: 16px; background: var(--m-glass-2); border: 1px solid var(--m-line); }
  .dns-draft-grid article span { color: var(--m-sky); font-size: .68rem; letter-spacing: .1em; }
  .dns-draft-grid article h3 { color: #fff; margin: 4px 0; font-size: 1rem; }
  .dns-draft-grid article p { color: var(--m-text-2); font-size: .86rem; }

  /* Phones show ONE surface at a time. .m-view-chat → Mira full-screen (generation, planning);
     .m-view-stage → preview/code full-screen. The bottom tab bar switches between them. */
  .dns-workspace-shell .dns-right-panel {
    display: flex !important; flex-direction: column; order: 1;
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    flex: 1 1 auto !important; min-height: 0; border-left: 0 !important; border-top: 0;
    border-radius: 0; overflow: hidden;
    background: transparent !important;
    box-shadow: none;
  }
  .dns-workspace-shell.m-view-chat #panel-editor { display: none !important; }
  .dns-workspace-shell.m-view-stage .dns-right-panel { display: none !important; }
  .dns-workspace-shell.m-view-stage #panel-editor { display: flex !important; width: 100% !important; min-width: 0 !important; flex: 1 1 auto !important; }
  .dns-workspace-shell #workspace-container { flex-direction: column !important; }
  .dns-right-panel .ai-chat-header { padding: 6px 14px 8px; border-bottom: 1px solid var(--m-line); background: transparent; }
  .dns-right-panel .ai-chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
  .dns-right-panel .ai-chat-brand { color: #fff; font-weight: 800; font-size: .9rem; flex: 0 0 auto; }
  /* Progress lives beside the panel title on phones; the tall progress dock is hidden so the
     transcript gains that space. */
  .dns-right-panel .ai-chat-progress { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
  .dns-right-panel .ai-chat-progress-meta { display: inline-flex; gap: 6px; flex: 0 0 auto; font-size: .7rem; font-weight: 700; color: var(--m-text-2); font-variant-numeric: tabular-nums; }
  .dns-right-panel .ai-chat-progress-pct { color: var(--m-sky); }
  .dns-right-panel .ai-chat-progress .dnsc-progress-track { display: block; flex: 1 1 auto; min-width: 40px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; position: relative; }
  .dns-right-panel .ai-chat-progress .dnsc-progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--m-blue), var(--m-sky)); transition: width .3s ease; }
  .dns-right-panel .ai-chat-header-running .ai-chat-meter { display: none; }
  .dns-right-panel .dnsc-chat > .dnsc-progress-dock { display: none !important; }
  /* Build output dock: only in the Preview/Code view, never under the Mira chat; theme-aware surface. */
  .dns-workspace-shell.m-view-chat .dns-build-dock { display: none !important; }
  .dns-workspace-shell .dns-build-dock { background: var(--m-bar-2) !important; border-color: var(--m-line) !important; color: var(--m-text); }
  .dns-right-panel .ai-chat-meter { background: var(--m-glass-2) !important; border-color: var(--m-line) !important; color: var(--m-text-2) !important; }
  .dns-right-panel .ai-panel-toggle-button { width: 36px; height: 36px; border-radius: 10px; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text); }
  .dns-right-panel .ai-panel-collapsed-rail { display: none; }
  .dns-right-panel .dnsc-chat { background: transparent; }
  .dns-right-panel .dnsc-scroll { padding: 10px 12px; -webkit-overflow-scrolling: touch; }
  .dns-right-panel .dnsc-dock { padding: 8px 10px calc(10px + var(--m-safe-b)); background: linear-gradient(to top, var(--m-bg) 70%, transparent); }
  .dns-right-panel .dnsc-composer { border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--m-line-2); box-shadow: none; }
  .dns-right-panel .dnsc-composer:focus-within { border-color: var(--m-accent-line); box-shadow: 0 0 0 3px var(--m-accent-soft); }
  .dns-right-panel .dnsc-composer textarea { font-size: 16px; color: var(--m-text); min-height: 56px; padding: 12px 40px 6px 14px; }
  .dns-right-panel .dnsc-composer textarea::placeholder { color: var(--m-text-3); }
  .dns-right-panel .dnsc-bar { padding: 6px 8px 8px; gap: 6px; }
  .dns-right-panel .dnsc-icon-btn, .dns-right-panel .dnsc-tool { min-height: 40px; min-width: 40px; border-radius: 12px; color: var(--m-text-2); background: var(--m-glass-2); border: 1px solid var(--m-line); }
  .dns-right-panel .dnsc-tool { padding: 0 12px; font-size: .78rem; }
  .dns-right-panel .dnsc-tool.active { background: var(--m-accent-soft); border-color: var(--m-accent-line); color: var(--m-accent-text); }
  .dns-right-panel .dnsc-send { height: 42px; padding: 0 16px; border-radius: 999px; font-size: .84rem; }
  .dns-right-panel .dnsc-send.ghost { background: var(--m-glass-2) !important; border: 1px solid var(--m-line-2) !important; color: var(--m-text) !important; box-shadow: none !important; }
  .dns-right-panel .dnsc-stop { width: 42px; height: 42px; border-radius: 50%; background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.4); }
  .dns-right-panel .dnsc-progress-dock { margin: 8px 12px 0; padding: 10px 12px; border-radius: 14px; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text); }
  .dns-right-panel .dnsc-progress-track { background: rgba(255,255,255,.1); }
  .dns-right-panel .dnsc-progress-fill { background: linear-gradient(90deg, var(--m-blue), var(--m-sky)); }
  .dns-right-panel .ai-chat-header .ai-panel-toggle-button { display: none; }
  .dns-workspace-shell.m-view-chat .dns-right-panel .ai-panel-collapsed-rail { display: none !important; }

  /* Light theme on phones now follows the SAME light palette as desktop (paper surfaces, slate
     text): the --m-* tokens above resolve from html.light-theme in app.css, so nothing here needs
     to re-point the ramp. Only a few neutral tweaks remain. */
  html.light-theme .dns-workspace-shell { color-scheme: light; }
  html.light-theme .dns-workspace-shell .dns-right-panel { background: transparent !important; box-shadow: none; }
  html.light-theme .dns-workspace-shell .dns-right-panel .ai-chat-header { background: var(--m-bar) !important; border-bottom-color: var(--m-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  html.light-theme .dns-workspace-shell .dns-right-panel .dnsc-composer { background: #fff; border-color: var(--m-line-2); }
  html.light-theme .dns-workspace-shell .dns-right-panel .dnsc-dock { background: linear-gradient(to top, var(--m-bg) 70%, transparent); }
  html.light-theme .dns-workspace-shell .dnsc-progress-track, html.light-theme .dns-workspace-shell .ai-chat-progress .dnsc-progress-track { background: #e2e8f5 !important; }
  html.light-theme .dns-workspace-shell .dnsc-progress-fill { background: linear-gradient(90deg, var(--dns-accent-2), var(--dns-accent)) !important; box-shadow: none; }
  html.light-theme .dns-workspace-shell .dnsc-progress-dock { background: #fff !important; border-color: var(--m-line) !important; }
  html.light-theme .dns-workspace-shell .cpt-file { color: #4338ca !important; }
  /* Dark theme progress bar: indigo to cyan on the neutral navy stage. */
  html:not(.light-theme) .dns-workspace-shell .dnsc-progress-track, html:not(.light-theme) .dns-workspace-shell .ai-chat-progress .dnsc-progress-track { background: rgba(2,6,23,.45) !important; }
  html:not(.light-theme) .dns-workspace-shell .dnsc-progress-fill { background: linear-gradient(90deg, var(--dnsc-brand), var(--dnsc-brand-3)) !important; box-shadow: 0 0 10px rgba(56,220,240,.45); }
  html:not(.light-theme) .dns-workspace-shell .ai-chat-progress-pct, html:not(.light-theme) .dns-workspace-shell .dnsc-progress-pct { color: var(--dnsc-brand-3) !important; }
  /* Passive history should still be readable on a phone: lift the muted ramp a notch for both themes. */
  .dns-workspace-shell .cpt-turn .cpt-text, .dns-workspace-shell .cpt-act-sub, .dns-workspace-shell .cpt-act-note,
  .dns-workspace-shell .cpt-live.cpt-live-attached .cpt-live-text { color: var(--m-text-2); }
  /* Stream narration bubbles and the user's own prompt bubble: full-strength text in both themes. */
  .dns-workspace-shell .cpt-turn.narration .cpt-text, .dns-workspace-shell .cpt-turn.intro .cpt-text,
  .dns-workspace-shell .cpt-turn.status .cpt-text, .dns-workspace-shell .cpt-turn.thought .cpt-text,
  .dns-workspace-shell .dnsc-bubble.dnsc-prose, .dns-workspace-shell .dnsc-bubble.dnsc-prose .cpt-prose,
  .dns-workspace-shell .dnsc-turn.user .dnsc-bubble, .dns-workspace-shell .cpt-user-bubble { color: var(--m-text) !important; }
  .dns-workspace-shell .dnsc-turn.user .dnsc-bubble, .dns-workspace-shell .cpt-user-bubble {
    background: var(--m-accent-soft) !important; border-color: var(--m-accent-line) !important;
  }

  /* While a plan/build runs the composer is a one-line strip: the stream + narration get the screen.
     The expand (⤢) button opens the full-height popup for multi-line editing. */
  .dns-right-panel .dnsc-composer.dnsc-composer-compact textarea {
    min-height: 40px; max-height: 40px; height: 40px !important; padding: 10px 40px 8px 14px; font-size: 14px; line-height: 20px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dns-right-panel .dnsc-composer-compact .dnsc-bar-primary-running { padding: 0 8px 6px; min-height: 0; }
  .dns-right-panel .dnsc-composer-compact .dnsc-stop { width: 34px; height: 34px; min-height: 34px; min-width: 34px; }
  /* On phones the compact composer hides its Stop/Pause: the floating controls over the transcript
     are the always-reachable way to pause (resume later) or stop the run. */
  .dns-right-panel .dnsc-composer-compact .dnsc-stop,
  .dns-right-panel .dnsc-composer-compact .dnsc-pause { display: none; }
  .dns-right-panel .dnsc-run-fab {
    display: flex; flex-direction: row; align-items: center; gap: 8px;
    position: absolute; right: 12px; bottom: 14px; z-index: 40;
  }
  /* While a run is in progress nobody types a prompt: drop the composer so the transcript gets the full panel. It returns when the run ends. */
  .dns-right-panel .dnsc-dock.dnsc-dock-running { display: none !important; }
  /* Home lives beside Pause/Stop during a run; the global bottom-left Home would sit on the Preview tab. */
  body:has(.dns-workspace-shell.m-view-chat .dnsc-run-fab) .dns-mobile-home { display: none; }
  .dns-right-panel .dnsc-run-fab .dnsc-fab { width: 36px; height: 36px; }
  /* Build output on a phone is a one-line notification strip (status + last message), never the
     tall resizable dock that got cut in half under the tab bar. */
  .dns-workspace-shell .dns-build-dock { height: 34px !important; min-height: 34px; max-height: 34px; overflow: hidden; flex: 0 0 auto; }
  .dns-workspace-shell .dns-build-dock .dns-build-dock-header { height: 34px; padding: 0 10px; font-size: .72rem; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .dns-workspace-shell .dns-build-dock .dns-build-dock-header > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dns-workspace-shell .dns-build-dock .dns-build-dock-body, .dns-workspace-shell .dns-build-dock .dns-build-dock-resize,
  .dns-workspace-shell .dns-build-dock .dns-build-dock-header .ai-panel-toggle-button { display: none !important; }
  .dns-workspace-shell .dns-build-dock .dns-build-dock-mobile-hint { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: var(--m-sky); background: var(--m-accent-soft); border: 1px solid var(--m-accent-line); flex: 0 0 auto; }
  /* Build details bottom sheet (opened by tapping the strip). */
  .dns-build-sheet-backdrop { z-index: 6590 !important; }
  .dns-build-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6600; display: flex; flex-direction: column;
    max-height: 82dvh; border-radius: 24px 24px 0 0; background: var(--m-glass); border: 1px solid var(--m-line-2); border-bottom: 0;
    color: var(--m-text); box-shadow: 0 -24px 60px -24px rgba(0,0,0,.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    animation: mSheetUp .26s cubic-bezier(.32,.72,0,1) both;
  }
  .dns-build-sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--m-line-2); margin: 10px auto 0; }
  .dns-build-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 8px; border-bottom: 1px solid var(--m-line); }
  .dns-build-sheet-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: .95rem; }
  .dns-build-sheet-title strong { color: var(--m-text); }
  .dns-build-sheet-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--m-line); background: var(--m-glass-2); color: var(--m-text); font-size: 1.4rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .dns-build-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px calc(16px + var(--m-safe-b)); }
  .dns-build-sheet-body .dns-build-log { max-height: none !important; font-size: .74rem !important; overflow-wrap: anywhere; word-break: break-word; }
  .dns-build-sheet-body .dns-build-log > div { white-space: pre-wrap; }
  .dns-right-panel .dnsc-composer-zoom { top: 6px; right: 6px; opacity: .9; min-width: 30px; min-height: 30px; width: 30px; height: 30px; background: var(--m-glass-3); }
  .dns-right-panel .dnsc-composer-zoom svg { width: 15px; height: 15px; }
  .dns-right-panel .dnsc-dock:has(.dnsc-composer-compact) { padding: 4px 10px calc(6px + var(--m-safe-b)); }
  .dns-right-panel .dnsc-progress-dock { flex: 0 0 auto; margin: 6px 12px 0; padding: 8px 12px; }
  /* The transcript must always keep the majority of the screen: never let it shrink to a sliver. */
  .dns-right-panel .dnsc-chat { min-height: 0; }
  .dns-right-panel .dnsc-scroll { flex: 1 1 0 !important; min-height: 40dvh; overscroll-behavior: contain; scroll-behavior: auto; }
  .dns-right-panel .dnsc-dock { flex: 0 0 auto; max-height: 48dvh; overflow-y: auto; }

  /* Bottom tab bar: the phone's primary controls (Preview · Code · Files · Run · Open · Publish · History · Mira · More) */
  .dns-workspace-shell .dns-mobile-strip {
    display: flex !important; order: 3; align-items: stretch; gap: 4px;
    padding: 5px 8px calc(5px + var(--m-safe-b)); position: relative; bottom: auto; z-index: 31;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    background: var(--m-bar-2) !important; border-top: 1px solid var(--m-line-2) !important;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .dns-workspace-shell .dns-mobile-strip::-webkit-scrollbar { display: none; }
  .dns-ms-btn {
    flex: 0 0 auto; min-width: 62px; height: 50px; scroll-snap-align: center;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 4px 8px; border-radius: 14px; border: 1px solid transparent; background: transparent;
    color: var(--m-text-2) !important; font-family: inherit; -webkit-tap-highlight-color: transparent;
    transition: background .15s, color .15s, transform .1s;
  }
  .dns-ms-btn:active { transform: scale(.96); }
  .dns-ms-btn span { font-size: 1.08rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; height: 22px; }
  .dns-ms-ico { width: 22px; height: 22px; display: block; }
  .dns-ms-btn small { font-size: .62rem; font-weight: 700; letter-spacing: .02em; }
  .dns-ms-btn.on { color: var(--m-text) !important; background: var(--m-accent-soft) !important; border-color: var(--m-accent-line); }
  .dns-ms-btn.dns-ms-run { color: #bbf7d0 !important; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); }
  .dns-ms-btn.dns-ms-run:not(:disabled) { color: #052e16 !important; background: linear-gradient(135deg, #34d399, #22c55e); border-color: transparent; box-shadow: 0 10px 22px -10px rgba(52,211,153,.8); }
  .dns-ms-btn:disabled { opacity: .4; }

  /* Floating "generation in progress" pill: stays above Preview/Code/Files/Explorer while the
     agent is working so the user can get back to the live run with a single tap. */
  .dns-gen-pill {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(66px + var(--m-safe-b)); z-index: 4500;
    display: flex; align-items: center; gap: 10px; width: min(92vw, 420px);
    padding: 9px 14px 11px; border-radius: 999px; border: 1px solid var(--m-accent-line);
    background: var(--dns-bg-elevated); color: var(--m-text); text-align: left; font-family: inherit;
    box-shadow: 0 14px 34px -10px rgba(0,0,0,.7), 0 0 0 1px var(--m-accent-soft);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    -webkit-tap-highlight-color: transparent; overflow: hidden; cursor: pointer;
    animation: dns-gen-pill-in .25s ease-out;
  }
  .dns-gen-pill:active { transform: translateX(-50%) scale(.98); }
  .dns-gen-pill-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: dns-gen-pill-pulse 1.4s infinite; }
  .dns-gen-pill-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .dns-gen-pill-text strong { font-size: .84rem; font-weight: 800; }
  .dns-gen-pill-text small { font-size: .68rem; color: #bfdbfe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dns-gen-pill-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.1); }
  .dns-gen-pill-fill { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #34d399); transition: width .4s ease; }
  .dns-gen-pill-fill.indeterminate { width: 35%; animation: dns-gen-pill-slide 1.3s ease-in-out infinite; }
  @keyframes dns-gen-pill-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
  @keyframes dns-gen-pill-pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
  @keyframes dns-gen-pill-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

  /* Explorer drawer in Code view: glass panel from the left. */
  .dns-explorer-panel.dns-explorer-mobile-open {
    display: flex !important; position: fixed; top: 0; bottom: 0; left: 0; z-index: 6550;
    width: min(86vw, 340px) !important; max-width: none !important; min-width: 0 !important; height: 100dvh;
    background: var(--m-glass) !important; border-right: 1px solid var(--m-line-2) !important; box-shadow: 24px 0 60px rgba(0,0,0,.55);
    overflow-y: auto; overscroll-behavior: contain; padding-top: var(--m-safe-t); padding-bottom: var(--m-safe-b);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--m-text);
  }
  /* The drawer is always expanded on phones: no vertical "EXPLORER" rail, no collapse arrows. */
  .dns-explorer-panel.dns-explorer-mobile-open .ai-panel-collapsed-rail,
  .dns-explorer-panel.dns-explorer-mobile-open .ai-panel-toggle-button { display: none !important; }
  .dns-explorer-panel.dns-explorer-mobile-open > div { background: transparent !important; border-color: var(--m-line) !important; }
  .dns-explorer-panel.dns-explorer-mobile-open input { min-height: 42px; font-size: 16px !important; border-radius: 12px !important; background: rgba(255,255,255,.06) !important; border-color: var(--m-line-2) !important; color: #fff !important; }

  /* Code editor on phones: file path strip + scrollable toolbar + Monaco filling the rest. */
  .dns-workspace-shell #panel-editor { width: 100% !important; min-width: 0 !important; background: var(--dns-bg-inset) !important; }
  .dns-workspace-shell #panel-editor > div[style*="padding-top:10px"] { display: none !important; } /* collapsed EDITOR rail */
  .dns-workspace-shell #panel-editor > div[style*="font-family:monospace"] { background: var(--m-bar-2) !important; color: var(--m-text-2) !important; padding: 8px 14px !important; font-size: .74rem !important; border-bottom-color: var(--m-line) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dns-workspace-shell #panel-editor > div[style*="padding:6px 8px"] { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; background: var(--m-bar-2) !important; border-bottom-color: var(--m-line) !important; padding: 6px 10px !important; gap: 6px !important; }
  .dns-workspace-shell #panel-editor > div[style*="padding:6px 8px"]::-webkit-scrollbar { display: none; }
  .dns-workspace-shell #panel-editor > div[style*="padding:6px 8px"] .dns-btn { flex: 0 0 auto; min-height: 38px; padding: 0 12px !important; font-size: .78rem !important; border-radius: 10px; white-space: nowrap; }
  .dns-workspace-shell #panel-editor > div[style*="padding:6px 8px"] .ai-panel-toggle-button { display: none !important; }
  .dns-workspace-shell #panel-editor > div[style*="position:relative"] { flex: 1 1 auto !important; min-height: 0 !important; }
  .dns-workspace-shell #monaco-editor-container { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; }
  .dns-workspace-shell #monaco-editor-container .monaco-editor, .dns-workspace-shell #monaco-editor-container .overflow-guard { width: 100% !important; height: 100% !important; }
  .dns-workspace-shell .dns-preview-header { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding: 8px 10px; background: var(--dns-bg-elevated, rgba(8,16,40,.6)); border-bottom: 1px solid var(--dns-border, var(--m-line)); }
  .dns-workspace-shell .dns-preview-header::-webkit-scrollbar { display: none; }
  .dns-workspace-shell .dns-preview-hint { display: none; }
  .dns-workspace-shell .dns-preview-actions { flex-wrap: nowrap; gap: 8px; }
  .dns-workspace-shell .dns-preview-btn, .dns-workspace-shell .dns-vp-btn { flex: 0 0 auto; height: 40px; min-height: 40px; width: 40px; min-width: 40px; padding: 0; border-radius: 12px; }
  .dns-workspace-shell .dns-preview-btn .dns-pv-label, .dns-workspace-shell .dns-preview-title .dns-pv-label, .dns-workspace-shell .dns-preview-sep { display: none; }
  .dns-workspace-shell .dns-preview-btn { background: var(--dns-bg-surface, rgba(255,255,255,.06)); border: 1px solid var(--dns-border, var(--m-line)); color: var(--dns-text, var(--m-text)); box-shadow: none; }
  .dns-workspace-shell .dns-viewport-switch { gap: 4px; padding: 3px; border-radius: 14px; background: var(--dns-bg-surface, rgba(255,255,255,.06)); border-color: var(--dns-border, var(--m-line)); }
  .dns-workspace-shell .dns-vp-btn { height: 34px; min-height: 34px; width: 34px; min-width: 34px; border-radius: 10px; color: var(--dns-text-muted, var(--m-text-2)); }
  .dns-workspace-shell .dns-vp-btn.active { background: var(--m-blue); color: #fff; }
  .dns-workspace-shell .dns-pv-ico { width: 20px; height: 20px; }
  .dns-workspace-shell .dns-preview-title .dns-pv-ico { width: 22px; height: 22px; }
  .dns-project-menu-panel.dns-tb-more-panel, .dns-project-menu-panel.dns-tb-project-panel {
    position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important; max-height: 78dvh !important;
    border-radius: 24px 24px 0 0 !important; padding: 10px 10px calc(14px + var(--m-safe-b)) !important;
    background: var(--m-glass) !important; border: 1px solid var(--m-line-2) !important; border-bottom: 0 !important;
    box-shadow: 0 -24px 60px -24px rgba(0,0,0,.8) !important; overflow-y: auto; -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 6600 !important;
    animation: mSheetUp .26s cubic-bezier(.32,.72,0,1) both;
  }
  .dns-project-menu-panel.dns-tb-more-panel::before, .dns-project-menu-panel.dns-tb-project-panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--m-line-2); margin: 0 auto 10px; }
  .dns-project-menu-panel button, .dns-project-menu-panel a, .dns-project-menu-panel .dns-tb-btn, .dns-project-menu-panel .dns-menu-item {
    display: flex !important; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px !important;
    border-radius: 14px; background: transparent !important; border: 0 !important; color: var(--m-text) !important; font-size: .95rem !important; font-weight: 600; text-align: left;
  }
  .dns-project-menu-panel .dns-tb-label { display: inline !important; }
  .dns-project-menu-panel button:active, .dns-project-menu-panel a:active { background: var(--m-glass-2) !important; }
  .dns-project-menu-panel hr, .dns-project-menu-panel .dns-menu-sep { border-color: var(--m-line); margin: 6px 0; }
  .dns-menu-backdrop { z-index: 6500; background: rgba(2,6,23,.55); backdrop-filter: blur(2px); }
  @keyframes mSheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* ═══════════════════════════ 2. Credits · notifications ═══════════════════════════ */
  /* The sidebar drawer is transformed + overflow:auto, which turns position:fixed children into clipped
     descendants. While a popover is open, lift those constraints so the sheet escapes the drawer. */
  .landing-root .dns-sidebar:has(.dns-popover, .dns-ledger-modal),
  .landing-root .landing-body-full.nav-open .dns-sidebar:has(.dns-popover, .dns-ledger-modal) {
    transform: none !important; overflow: visible !important; transition: none !important;
  }
  .landing-root .dns-sidebar:has(.dns-popover, .dns-ledger-modal) .dns-account-bar { position: static; }
  /* The workbench toolbar's backdrop-filter makes it the containing block for position:fixed descendants, so the
     credits/bell sheet was laid out inside the 56px bar: header (and its ✕) clipped, backdrop covering only the bar,
     so nothing could close it. While a sheet is open, drop the filter so the sheet spans the viewport again. */
  .dns-workspace-shell .dns-workspace-toolbar.dns-toolbar-modern:has(.dns-popover, .dns-ledger-modal, .dns-notif-modal) {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none !important;
    background: rgba(8,16,40,.96) !important;
  }
  .dns-popover .dns-popover-head > span { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
  .dns-popover .dns-popover-head .dns-popover-close { width: 36px; height: 36px; padding: 0; border-radius: 50%; color: #fff !important; font-size: .95rem !important; }
  .dns-account-bar .dns-popover, .dns-account-bar:not(.compact) .dns-popover,
  .dns-account-bar:not(.compact) .dns-popover.dns-ledger-panel, .dns-popover.dns-ledger-panel, .dns-ledger-modal {
    position: fixed !important; left: 50% !important; right: auto !important; top: 50% !important; bottom: auto !important;
    transform: translate(-50%, -50%) !important; width: min(92vw, 420px) !important; max-width: none !important; max-height: 86dvh !important;
    display: flex; flex-direction: column; overflow: hidden !important;
    border-radius: 22px !important; border: 1px solid var(--m-line-2) !important;
    background: var(--m-glass) !important; color: var(--m-text) !important; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9) !important;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 6600 !important;
    font-size: .92rem !important; animation: mModalIn .22s cubic-bezier(.32,.72,0,1) both;
  }
  @keyframes mModalIn { from { transform: translate(-50%, -46%) scale(.97); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
  .dns-popover::before { display: none; }
  .dns-popover .dns-popover-head, .dns-ledger-modal .dns-popover-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 12px 18px; border-bottom: 1px solid var(--m-line) !important; }
  .dns-popover .dns-popover-head strong, .dns-ledger-modal .dns-popover-head strong { font-size: 1rem; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dns-popover .dns-link-btn, .dns-ledger-modal .dns-link-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-sky) !important; font-size: .78rem !important; }
  .dns-ledger-modal .dns-popover-head .dns-link-btn { flex: 0 0 auto; width: 36px; padding: 0; font-size: .9rem !important; color: #fff !important; }
  .dns-ledger-modal .dns-ledger-sub { flex: 0 0 auto; font-size: .78rem; color: var(--m-text-2); padding: 10px 18px 8px !important; }
  .dns-ledger-modal .dns-ledger-list-full { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .dns-ledger-modal .dns-ledger-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when credits" "desc credits" "tokens credits"; gap: 2px 12px; padding: 12px 18px; border-bottom: 1px solid var(--m-line); }
  .dns-ledger-modal .dns-ledger-when { grid-area: when; font-size: .7rem; color: var(--m-text-3); }
  .dns-ledger-modal .dns-ledger-desc { grid-area: desc; white-space: normal; overflow: visible; color: var(--m-text); font-weight: 600; line-height: 1.3; }
  .dns-ledger-modal .dns-ledger-tokens { grid-area: tokens; font-size: .74rem; color: var(--m-text-3); }
  .dns-ledger-modal .dns-ledger-credits { grid-area: credits; font-size: 1.05rem; align-self: center; }
  .dns-ledger-modal-backdrop { position: fixed; inset: 0; z-index: 6590; background: rgba(2,6,23,.55); }
  .dns-credit-alert { z-index: 6600; width: min(340px, calc(100vw - 28px)); padding: 26px 20px 14px; }
  .dns-popover .dns-ledger-balance { flex: 0 0 auto; padding: 16px 18px 12px; }
  .dns-popover .dns-ledger-num { font-size: 2rem; color: #fff; letter-spacing: -.02em; }
  .dns-popover .dns-ledger-num small { font-size: .85rem; color: var(--m-text-2); }
  .dns-popover .dns-ledger-bar { height: 8px; background: rgba(255,255,255,.1); }
  .dns-popover .dns-ledger-bar span { background: linear-gradient(90deg, var(--m-blue), var(--m-sky)); }
  .dns-popover .dns-ledger-sub { font-size: .78rem; color: var(--m-text-2); }
  .dns-popover .dns-ledger-list-head { flex: 0 0 auto; padding: 8px 18px; font-size: .68rem; color: var(--m-text-3); border-top: 1px solid var(--m-line); }
  .dns-popover .dns-ledger-list, .dns-popover .dns-notif-list { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .dns-popover.dns-notif-panel { overflow-y: auto !important; }
  .dns-popover .dns-ledger-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "desc credits" "tokens credits";
    gap: 2px 12px; padding: 12px 18px; border-bottom: 1px solid var(--m-line);
  }
  .dns-popover .dns-ledger-desc { grid-area: desc; white-space: normal; overflow: visible; color: var(--m-text); font-weight: 600; line-height: 1.3; }
  .dns-popover .dns-ledger-tokens { grid-area: tokens; font-size: .74rem; color: var(--m-text-3); }
  .dns-popover .dns-ledger-credits { grid-area: credits; font-size: 1.05rem; align-self: center; }
  .dns-popover .dns-popover-foot { flex: 0 0 auto; padding: 12px 18px; border-top: 1px solid var(--m-line); text-align: center; }
  .dns-popover .dns-popover-foot .dns-link-btn { width: 100%; justify-content: center; min-height: 44px; }
  .dns-popover .dns-popover-empty { padding: 28px 18px; color: var(--m-text-2); }
  .dns-popover .dns-notif { padding: 14px 18px; gap: 12px; border-bottom: 1px solid var(--m-line); }
  .dns-popover .dns-notif-title { color: #fff; font-size: .95rem; }
  .dns-popover .dns-notif-msg { color: var(--m-text-2); }
  .dns-popover .dns-notif-dismiss, .dns-notif-modal .dns-notif-dismiss { width: 36px; height: 36px; border-radius: 50%; background: var(--m-glass-2); color: var(--m-text-2); font-size: .85rem; flex: 0 0 auto; }
  .dns-popover .dns-popover-close { width: 36px; padding: 0; color: #fff !important; font-size: .9rem !important; }
  .dns-notif-modal .dns-notif { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--m-line); }
  .dns-notif-modal .dns-notif-title { color: #fff; font-size: .95rem; }
  .dns-notif-modal .dns-notif-msg { color: var(--m-text-2); }
  .dns-notif-modal .dns-popover-head .dns-link-btn { width: auto; padding: 0 12px; }

  /* Full credit history: full-screen sheet, rows wrap, list scrolls. */
  .dns-ledger-modal {
    position: fixed !important; left: 50% !important; right: auto !important; top: 50% !important; bottom: auto !important; transform: translate(-50%, -50%) !important;
    width: min(94vw, 460px) !important; max-height: 88dvh !important; border-radius: 22px !important; display: flex; flex-direction: column; overflow: hidden;
    background: var(--m-glass) !important; border: 1px solid var(--m-line-2) !important; color: var(--m-text) !important;
    font-size: .92rem !important; z-index: 6601 !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    animation: mModalIn .22s cubic-bezier(.32,.72,0,1) both;
  }
  .dns-ledger-modal .dns-ledger-list-full { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .dns-ledger-modal .dns-popover-head { padding: 16px 18px 12px; border-bottom-color: var(--m-line) !important; }
  .dns-ledger-modal .dns-popover-head strong { font-size: 1rem; color: #fff; }
  .dns-ledger-modal .dns-popover-head .dns-link-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--m-glass-2); color: var(--m-text) !important; font-size: 1rem !important; }
  .dns-ledger-modal > .dns-ledger-sub { padding: 0 18px 10px !important; color: var(--m-text-2); font-size: .78rem; }
  .dns-ledger-modal .dns-ledger-list-full { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .dns-ledger-modal .dns-ledger-list-full .dns-ledger-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when credits" "desc credits" "tokens credits";
    gap: 2px 12px; padding: 12px 18px; border-bottom: 1px solid var(--m-line);
  }
  .dns-ledger-modal .dns-ledger-when { grid-area: when; color: var(--m-sky); font-size: .72rem; }
  .dns-ledger-modal .dns-ledger-desc { grid-area: desc; white-space: normal; overflow: visible; color: var(--m-text); font-weight: 600; }
  .dns-ledger-modal .dns-ledger-tokens { grid-area: tokens; color: var(--m-text-3); }
  .dns-ledger-modal .dns-ledger-credits { grid-area: credits; align-self: center; font-size: 1.05rem; }
  .dns-ledger-modal-backdrop { z-index: 6500 !important; }

  /* ═══════════════════════════ 3. Build preferences (Customize ribbon + sheet) ═══════════════════════════ */
  /* Ribbon: visible again on the phone composer as a swipeable chip row. */
  .landing-root .landing-chat-card .dns-prefs-bar.in-card,
  :is(html, html.light-theme) .landing-root .landing-chat-card .dns-prefs-bar.in-card {
    display: flex !important; flex-wrap: nowrap; align-items: center; gap: 6px;
    margin: 0 -12px 6px -14px; padding: 2px 14px 6px; max-width: none;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    font-size: .76rem; mask-image: linear-gradient(90deg, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .landing-root .dns-prefs-bar.in-card::-webkit-scrollbar { display: none; }
  .landing-root .dns-prefs-bar.in-card .dns-prefs-bar-label { display: none; }
  .landing-root .dns-prefs-bar.in-card .dns-prefs-bar-spacer { display: none !important; flex: 0 0 0 !important; width: 0 !important; }
  .landing-root .dns-prefs-bar.in-card .dns-pref-chip, .landing-root .dns-prefs-bar.in-card .dns-prefs-edit {
    flex: 0 0 auto; height: 34px; padding: 0 12px; margin: 0 !important; border-radius: 999px; scroll-snap-align: start; white-space: nowrap;
    background: rgba(255,255,255,.07) !important; border: 1px solid rgba(255,255,255,.12) !important; color: #e2e8f0 !important; font-size: .76rem; font-weight: 600;
  }
  /* Customize leads the ribbon and stays pinned while the chips scroll underneath, so it is
     always reachable without swiping (it used to sit after the 4th chip, off-screen). */
  .landing-root .dns-prefs-bar.in-card .dns-prefs-edit:not(.dns-prefs-bar-reset) {
    order: -1; position: sticky; left: 0; z-index: 2;
    margin-left: 0 !important;
    background: linear-gradient(135deg, var(--m-blue), var(--m-blue-2)) !important; border-color: var(--m-accent-line) !important; color: #fff !important;
    box-shadow: 6px 0 12px -4px rgba(0,0,0,.5);
  }
  .landing-root .dns-prefs-bar.in-card .dns-prefs-bar-reset { order: 0; }
  .landing-root .landing-chat-card .dns-prefs-bar.in-card { mask-image: none; -webkit-mask-image: none; }
  .landing-root .dns-prefs-bar.in-card .dns-pref-chip svg,
  .landing-root .dns-prefs-bar.in-card .dns-prefs-edit svg { flex: 0 0 auto; width: 16px !important; height: 16px !important; opacity: 1 !important; stroke-width: 2; color: inherit; }
  .landing-root .dns-prefs-bar.in-card .dns-pref-chip .dns-pref-swatch { width: 14px; height: 14px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
  .landing-root .dns-prefs-bar.in-card .dns-prefs-edit { gap: 7px; padding: 0 14px 0 12px; }

  /* Composer tool buttons: real SVG icons, never empty circles. */
  .landing-root .landing-chat-footer .btn-upload.dns-tool-icon,
  .landing-root .landing-chat-footer .dns-agent-btn.dns-tool-icon { display: inline-flex !important; align-items: center; justify-content: center; overflow: visible; }
  .landing-root .landing-chat-footer .dns-tool-icon .dns-btn-ico,
  .landing-root .landing-chat-footer .dns-tool-icon .dns-tool-glyph svg { display: block !important; width: 18px !important; height: 18px !important; opacity: 1 !important; color: inherit; stroke: currentColor; }
  .landing-root .landing-chat-footer .dns-tool-icon .dns-tool-glyph { display: inline-flex !important; align-items: center; justify-content: center; font-size: 0 !important; line-height: 1; }
  .landing-root .landing-chat-footer .dns-agent-btn .dns-agent-ico { display: block !important; width: 18px !important; height: 18px !important; color: #c7d2fe; }
  .landing-root .landing-chat-footer .dns-agent-btn.opening .dns-agent-ico { animation: dnsPulse 1s ease-in-out infinite; }
  .landing-root .landing-chat-footer .dns-tool-icon:disabled .dns-btn-ico,
  .landing-root .landing-chat-footer .dns-tool-icon:disabled .dns-agent-ico { opacity: .55 !important; }

  /* Sheet: full-height bottom sheet, one column, touch-sized controls. */
  .dns-prefs-overlay { padding: 0 !important; place-items: end center !important; align-items: end; }
  .dns-prefs-sheet {
    width: 100% !important; max-width: none !important; max-height: 94dvh !important; height: 94dvh;
    border-radius: 24px 24px 0 0 !important; border: 1px solid var(--m-line-2) !important; border-bottom: 0 !important;
    background: var(--m-stage-glow), var(--m-stage) !important; color: var(--m-text); box-shadow: 0 -24px 60px -24px rgba(0,0,0,.85) !important;
    animation: mSheetUp .28s cubic-bezier(.32,.72,0,1) both !important;
  }
  .dns-prefs-sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--m-line-2); margin: 10px auto 0; }
  .dns-prefs-head { padding: 10px 18px 14px !important; border-bottom-color: var(--m-line) !important; align-items: center !important; }
  .dns-prefs-head h3 { color: #fff !important; font-size: 1.2rem !important; }
  .dns-prefs-head p { color: var(--m-text-2) !important; font-size: .82rem !important; }
  .dns-prefs-close { display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; flex: 0 0 auto; width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px; border-radius: 50% !important; background: var(--m-glass-2) !important; border: 1px solid var(--m-line) !important; color: #fff !important; font-size: 1.4rem !important; line-height: 1 !important; }
  .dns-prefs-body { padding: 4px 16px 24px !important; gap: 18px !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .dns-prefs-section { padding-top: 12px !important; gap: 12px !important; }
  .dns-prefs-section h4 { color: var(--m-sky) !important; font-size: .72rem !important; }
  .dns-prefs-section h4 small { color: var(--m-text-3) !important; }
  .dns-ptype-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .dns-ptype { min-height: 60px; padding: 12px 14px !important; border-radius: 16px !important; background: var(--m-glass-2) !important; border: 1px solid var(--m-line) !important; color: var(--m-text) !important; }
  .dns-ptype.selected { border-color: var(--m-accent-line) !important; background: var(--m-accent-soft) !important; box-shadow: none !important; }
  .dns-ptype-text b { color: #fff !important; } .dns-ptype-text small { color: var(--m-text-2) !important; }
  .dns-ptype-check { background: var(--m-blue) !important; color: #fff !important; }
  .dns-prefs-notice { background: rgba(251,191,36,.12) !important; border-color: rgba(251,191,36,.35) !important; color: #fde68a !important; }
  .dns-prefs-row, .dns-prefs-row.three { grid-template-columns: 1fr !important; gap: 12px !important; }
  .dns-prefs-row label, .dns-prefs-guidance { color: var(--m-text-2) !important; font-size: .8rem !important; }
  .dns-prefs-row select, .dns-prefs-guidance textarea {
    min-height: 46px; font-size: 16px !important; border-radius: 14px !important; padding: 10px 14px !important;
    background: var(--dns-bg-inset) !important; color: var(--m-text) !important; border: 1px solid var(--m-line-2) !important;
  }
  .dns-prefs-row select:focus, .dns-prefs-guidance textarea:focus { border-color: var(--m-accent-line) !important; box-shadow: 0 0 0 3px var(--m-accent-soft) !important; }
  .dns-swatches { gap: 12px !important; flex-wrap: wrap; padding-top: 8px !important; }
  .dns-swatch { width: 36px !important; height: 36px !important; }
  .dns-swatch.selected { box-shadow: 0 0 0 2px var(--m-bg), 0 0 0 4px var(--m-sky) !important; }
  .dns-layout-gallery { border-top-color: var(--m-line) !important; }
  .dns-layout-gallery-head h5 { color: #fff !important; } .dns-layout-gallery-head h5 small { color: var(--m-text-3) !important; }
  .dns-layout-tabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; width: 100%; padding-bottom: 4px; }
  .dns-layout-tabs::-webkit-scrollbar { display: none; }
  .dns-layout-tabs button { flex: 0 0 auto; height: 36px; padding: 0 14px !important; background: var(--m-glass-2) !important; border-color: var(--m-line) !important; color: var(--m-text-2) !important; }
  .dns-layout-tabs button.on { background: var(--m-blue) !important; border-color: var(--m-blue) !important; color: #fff !important; }
  .dns-layout-grid { display: flex !important; gap: 12px !important; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 4px 16px 8px; }
  .dns-layout-grid::-webkit-scrollbar { display: none; }
  .dns-layout-card { flex: 0 0 72vw; max-width: 300px; scroll-snap-align: center; padding: 10px !important; border-radius: 18px !important; background: var(--m-glass) !important; border: 1px solid var(--m-line) !important; }
  .dns-layout-card.selected { border-color: var(--m-accent-line) !important; box-shadow: 0 0 0 3px var(--m-accent-soft) !important; }
  .dns-layout-card b { color: #fff !important; font-size: .88rem !important; } .dns-layout-card small { color: var(--m-text-2) !important; font-size: .74rem !important; }
  .dns-layout-card .dns-layout-thumb, .dns-layout-grid button.dns-layout-thumb {
    display: block !important; width: 100% !important; height: auto !important; min-height: 120px; aspect-ratio: 16 / 10;
    padding: 0 !important; margin-bottom: 8px; border-radius: 12px !important; overflow: hidden; background: #f8fafc !important; border: 1px solid var(--m-line-2) !important;
  }
  .dns-layout-card .dns-layout-thumb svg { display: block !important; width: 100% !important; height: 100% !important; visibility: visible !important; opacity: 1 !important; }
  .dns-layout-card .dns-layout-thumb-auto { display: flex !important; min-height: 120px; }
  .dns-layout-use { min-height: 40px; border-radius: 12px !important; font-size: .8rem !important; color: var(--m-text) !important; border-color: var(--m-line-2) !important; }
  .dns-layout-card.selected .dns-layout-use, .dns-layout-use.primary { background: var(--m-blue) !important; border-color: var(--m-blue) !important; }
  .dns-prefs-toggles { grid-template-columns: 1fr !important; gap: 4px !important; }
  .dns-toggle { min-height: 48px; padding: 0 4px; color: var(--m-text) !important; font-size: .92rem !important; border-bottom: 1px solid var(--m-line); }
  .dns-toggle:last-child { border-bottom: 0; }
  .dns-toggle-ui { width: 46px !important; height: 28px !important; background: rgba(255,255,255,.12) !important; border-color: var(--m-line-2) !important; margin-left: auto; order: 2; }
  .dns-toggle-ui::after { width: 22px !important; height: 22px !important; background: #fff !important; }
  .dns-toggle input:checked + .dns-toggle-ui { background: var(--m-blue) !important; border-color: var(--m-blue) !important; }
  .dns-toggle input:checked + .dns-toggle-ui::after { transform: translateX(18px) !important; }
  .dns-prefs-foot { position: sticky; bottom: 0; padding: 12px 16px calc(12px + var(--m-safe-b)) !important; gap: 10px !important; flex-wrap: wrap; background: var(--m-bar) !important; border-top: 1px solid var(--m-line) !important; backdrop-filter: blur(12px); }
  .dns-prefs-foot .dns-prefs-reset { flex-basis: 100%; order: 2; min-height: 40px; text-align: center; color: var(--m-text-3) !important; font-size: .78rem; }
  .dns-prefs-actions { display: flex; width: 100%; gap: 10px; }
  .dns-prefs-actions .dns-btn { flex: 1 1 0; min-height: 48px; border-radius: 999px; font-size: .9rem; font-weight: 700; justify-content: center; }
  .dns-prefs-actions .dns-btn-ghost { background: var(--m-glass-2) !important; border: 1px solid var(--m-line-2) !important; color: var(--m-text) !important; }
  .dns-prefs-actions .dns-btn:not(.dns-btn-ghost) { background: linear-gradient(135deg, var(--m-blue), var(--m-blue-2)) !important; border: 0 !important; color: #fff !important; box-shadow: 0 10px 24px -8px rgba(124,58,237,.55); }

  /* Light theme: the Build-preferences sheet follows the light landing page instead of the
     dark-blue stage. The sheet reads the --m-* tokens, so re-point them to a light ramp here
     and neutralise the few hard-coded white/dark values above. */
  html.light-theme .dns-prefs-sheet, html.light-theme .dns-layout-popup {
    --m-stage: var(--dns-bg-stream);
    --m-stage-glow: radial-gradient(90% 50% at 50% 0%, rgba(99,102,241,.10), transparent 70%);
    --m-bg: var(--dns-bg-app);
    --m-glass: #ffffff; --m-glass-2: #eef2fb; --m-glass-3: #e2e8f5;
    --m-line: var(--dns-border); --m-line-2: var(--dns-border-strong);
    --m-text: var(--dns-text); --m-text-2: var(--dns-text-muted); --m-text-3: var(--dns-text-subtle);
    --m-sky: var(--dns-accent-2);
    color: var(--m-text) !important;
    border-color: var(--m-line-2) !important;
    box-shadow: 0 -24px 60px -24px rgba(16,24,40,.35) !important;
    color-scheme: light;
  }
  html.light-theme .dns-prefs-head h3, html.light-theme .dns-ptype-text b, html.light-theme .dns-layout-gallery-head h5,
  html.light-theme .dns-layout-card b, html.light-theme .dns-layout-popup h3 { color: var(--m-text) !important; }
  html.light-theme .dns-prefs-close { color: var(--m-text) !important; }
  html.light-theme .dns-prefs-row select, html.light-theme .dns-prefs-guidance textarea, html.light-theme .dns-layout-card { background: #ffffff !important; color: var(--m-text) !important; }
  html.light-theme .dns-ptype.selected { background: #eef2ff !important; border-color: #a5b4fc !important; }
  html.light-theme .dns-prefs-notice { background: #fff7ed !important; border-color: #fed7aa !important; color: #9a3412 !important; }
  html.light-theme .dns-toggle-ui { background: #d7deee !important; }
  html.light-theme .dns-swatch.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--m-blue) !important; }
  html.light-theme .dns-prefs-foot { background: rgba(255,255,255,.94) !important; }
  html.light-theme .dns-prefs-foot .dns-prefs-reset { color: var(--m-text-2) !important; }

  /* Layout preview popup → bottom sheet */
  .dns-layout-popup-overlay { padding: 0 !important; align-items: flex-end !important; }
  .dns-layout-popup { width: 100% !important; max-height: 90dvh !important; border-radius: 24px 24px 0 0 !important; padding: 16px 16px calc(16px + var(--m-safe-b)) !important; background: var(--m-glass) !important; color: var(--m-text) !important; border: 1px solid var(--m-line-2) !important; border-bottom: 0 !important; }
  .dns-layout-popup-head h3 { color: #fff; } .dns-layout-popup-head p { color: var(--m-text-2) !important; }
  .dns-layout-cat { color: var(--m-sky) !important; }
  .dns-layout-spec { grid-template-columns: 1fr !important; }
  .dns-layout-spec dt { color: var(--m-sky) !important; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
  .dns-layout-spec dd { color: var(--m-text) !important; margin-bottom: 6px !important; }
  .dns-layout-popup-actions .dns-layout-use { min-height: 46px; width: 100%; justify-content: center; }

  /* ═══════════════════════════ 4. Plan / blueprint window ═══════════════════════════ */
  .bpx-window, .bpx-window.max {
    width: 100vw !important; height: 100dvh !important; border-radius: 0 !important; left: 0 !important; top: 0 !important; transform: none !important;
    background: var(--m-stage-glow), var(--m-stage) !important; border: 0 !important; color: var(--m-text) !important; font-size: 15px;
    animation: mSheetUp .3s cubic-bezier(.32,.72,0,1) both !important;
  }
  .bpx-head { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id ctl" "stats stats"; gap: 10px 12px; padding: calc(12px + var(--m-safe-t)) 16px 12px !important; background: var(--m-bar-2) !important; border-bottom: 1px solid var(--m-line) !important; backdrop-filter: blur(12px); }
  .bpx-head-id { grid-area: id; flex: none; }
  .bpx-winctl { grid-area: ctl; margin: 0 !important; gap: 8px; align-self: start; }
  .bpx-winctl button { width: 40px !important; height: 40px !important; border-radius: 50% !important; background: var(--m-glass-2) !important; border-color: var(--m-line) !important; color: #fff !important; }
  .bpx-winctl button:first-child { display: none; } /* dock-to-corner is a desktop affordance */
  .bpx-badge { background: var(--m-accent-soft) !important; border-color: var(--m-accent-line) !important; color: var(--m-accent-text) !important; }
  .bpx-title { font-size: 1.4rem !important; color: #fff; margin-top: 8px !important; }
  .bpx-tagline { color: var(--m-text-2) !important; font-size: .92rem !important; }
  .bpx-head-stats { grid-area: stats; width: auto !important; order: 0 !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 2px 16px; }
  .bpx-head-stats::-webkit-scrollbar { display: none; }
  .bpx-head-stats span { flex: 0 0 auto !important; min-width: 84px !important; background: var(--m-glass-2) !important; border-color: var(--m-line) !important; color: var(--m-text-2) !important; border-radius: 16px !important; }
  .bpx-head-stats b { color: #fff !important; font-size: 1.25rem !important; }
  .bpx-body { padding: 16px 16px 24px !important; gap: 16px !important; -webkit-overflow-scrolling: touch; }
  .bpx-hero { grid-template-columns: 1fr !important; gap: 14px !important; }
  .bpx-card { background: var(--m-glass) !important; border: 1px solid var(--m-line) !important; border-radius: 20px !important; padding: 16px !important; box-shadow: var(--m-shadow); }
  .bpx-card h3, .bpx-h { color: var(--m-sky) !important; }
  .bpx-card h3 em, .bpx-lead, .bpx-kv-row { color: var(--m-text) !important; }
  .bpx-kv-k { color: var(--m-text-3) !important; }
  .bpx-count { background: var(--m-accent-soft) !important; color: var(--m-accent-text) !important; }
  .bpx-preview { border-radius: 20px !important; border-color: var(--m-line-2) !important; }
  .bpx-preview-glance { display: grid !important; grid-template-columns: 1fr !important; }
  .bpx-tags span, .bpx-tags.sm span { background: var(--m-glass-2); border: 1px solid var(--m-line); color: var(--m-text); border-radius: 999px; padding: 4px 10px; }
  .bpx-features, .bpx-two { grid-template-columns: 1fr !important; }
  .bpx-prompt pre { color: var(--m-text-2) !important; }
  .bpx-foot { position: sticky; bottom: 0; flex-direction: row; flex-wrap: wrap; gap: 10px !important; padding: 12px 16px calc(12px + var(--m-safe-b)) !important; background: var(--m-bar-2) !important; border-top: 1px solid var(--m-line-2) !important; backdrop-filter: blur(16px); }
  .bpx-note { order: -1; text-align: center; color: var(--m-text-3) !important; font-size: .76rem !important; }
  .bpx-spacer { display: none; }
  .bpx-dl { width: 100%; justify-content: center; background: var(--m-glass-2) !important; border-color: var(--m-line) !important; }
  .bpx-dl button { min-height: 40px; flex: 1 1 auto; color: var(--m-text) !important; }
  .bpx-btn { flex: 1 1 calc(50% - 5px); justify-content: center; min-height: 48px; border-radius: 999px !important; font-size: .9rem !important; }
  .bpx-btn.ghost { background: var(--m-glass-2) !important; border-color: var(--m-line-2) !important; color: var(--m-text) !important; }
  .bpx-nady { flex: 1 1 100%; width: 100%; justify-content: center; margin: 0 !important; border-radius: 999px; background: linear-gradient(135deg, rgba(15,23,42,.95), rgba(23,37,84,.95)) !important; border-color: rgba(147,197,253,.4) !important; }
  .bpx-nady.dns-home-nady { position: fixed; width: auto; flex: none; right: 14px !important; bottom: calc(14px + var(--m-safe-b)) !important; }
  .bpx-nady-text small { color: var(--m-sky) !important; }
  .bpx-dock { right: 12px; bottom: calc(12px + var(--m-safe-b)); max-width: calc(100vw - 24px); background: var(--m-glass) !important; border-color: var(--m-line-2) !important; }

  /* Light theme: the blueprint window follows the desktop light palette (paper surfaces, ink text)
     instead of the phone's dark-blue stage used by the rest of the workbench. */
  html.light-theme .bpx-window, html.light-theme .bpx-window.max {
    --m-text: #0f172a; --m-text-2: #475569; --m-text-3: #64748b; --m-line: #e2e8f0; --m-line-2: #cbd5e1;
    --m-glass: #ffffff; --m-glass-2: #f1f5f9; --m-sky: #2563eb; --m-shadow: 0 10px 30px -18px rgba(15,23,42,.25);
    background: linear-gradient(180deg, #f8fafc, #eef2ff) !important; color: #0f172a !important; color-scheme: light;
  }
  html.light-theme .bpx-head { background: rgba(255,255,255,.85) !important; border-bottom-color: #e2e8f0 !important; }
  html.light-theme .bpx-winctl button { color: #334155 !important; background: #f1f5f9 !important; border-color: #e2e8f0 !important; }
  html.light-theme .bpx-badge { background: rgba(37,99,235,.1) !important; border-color: rgba(37,99,235,.3) !important; color: #1d4ed8 !important; }
  html.light-theme .bpx-title, html.light-theme .bpx-head-stats b { color: #0f172a !important; }
  html.light-theme .bpx-count { background: rgba(37,99,235,.12) !important; color: #1d4ed8 !important; }
  html.light-theme .bpx-foot { background: rgba(255,255,255,.94) !important; border-top-color: #e2e8f0 !important; }
  html.light-theme .bpx-nady:not(.dns-home-nady) { background: linear-gradient(135deg, #1e3a8a, #2563eb) !important; border-color: rgba(37,99,235,.4) !important; }
  html.light-theme .bpx-nady:not(.dns-home-nady) .bpx-nady-text small { color: #bfdbfe !important; }
  /* Floating landing launcher: orb only, so the pill itself stays transparent (no blue halo in light theme). */
  html.light-theme .bpx-nady.dns-home-nady { background: transparent !important; border-color: transparent !important; box-shadow: none !important; animation: none; }
  html.light-theme .bpx-prompt pre { color: #334155 !important; }
  html.light-theme .bpx-dock { background: #ffffff !important; border-color: #e2e8f0 !important; color: #0f172a; }

  /* ═══════════════════════════ 5. Pricing ═══════════════════════════ */
  .pub-main { padding: 24px 16px calc(64px + var(--m-safe-b)) !important; }
  .pub-eyebrow { font-size: 11px; padding: 7px 12px; }
  .pub-hero p { font-size: 15px; }
  .pub-welcome { flex-direction: column; align-items: flex-start; padding: 14px 16px; border-radius: 18px; }
  .pr-toggle { display: flex; width: 100%; margin-top: 22px; padding: 5px; background: var(--dns-bg-inset) !important; border: 1px solid var(--dns-border-strong) !important; }
  .pr-toggle button { flex: 1 1 0; justify-content: center; min-height: 44px; padding: 0 10px; font-size: 14px; color: var(--dns-text-muted) !important; background: transparent !important; box-shadow: none !important; }
  .pr-toggle button.on { background: linear-gradient(135deg, var(--m-blue), var(--m-blue-2)) !important; color: #fff !important; box-shadow: 0 6px 16px -6px rgba(124,58,237,.55) !important; }
  .pr-toggle button.on * { color: #fff !important; }
  .pr-grid { grid-template-columns: 1fr !important; gap: 16px !important; margin-top: 28px !important; padding: 0 !important; }
  .pr-card { padding: 22px 18px 20px; border-radius: 22px; gap: 14px; }
  .pr-card .pub-btn, .pr-card button { width: 100%; min-height: 48px; justify-content: center; border-radius: 999px; font-size: 15px; }
  .pr-features li { padding: 6px 0; font-size: 14px; line-height: 1.45; }
  .pr-features { padding-left: 0; }
  .pr-vs { grid-template-columns: 1fr !important; gap: 10px; padding: 18px 16px; border-radius: 20px; }
  .pr-compare { margin-top: 36px; min-width: 0; max-width: 100%; overflow: visible; }
  .pr-section-title { font-size: 22px; }
  .pr-section-sub { font-size: 14px; margin-bottom: 14px; }
  /* Comparison table: a real horizontal scroller with a pinned feature column and a visible edge hint. */
  .pub-main, .pub-shell { min-width: 0; max-width: 100vw; }
  .pr-table-scroll {
    position: relative; display: block; width: 100vw; max-width: 100vw; margin: 0 calc(50% - 50vw); padding: 0 16px 8px; box-sizing: border-box;
    overflow-x: auto !important; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.5) transparent;
  }
  .pr-table-scroll::-webkit-scrollbar { height: 6px; }
  .pr-table-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.5); border-radius: 999px; }
  .pr-table-scroll::after { content: "Swipe to compare all plans →"; display: block; margin-top: 8px; text-align: center; font-size: 12px; color: var(--dns-text-subtle); position: sticky; left: 16px; width: calc(100vw - 32px); }
  .pr-table { display: table !important; width: max-content !important; min-width: calc(100vw - 32px); max-width: none !important; overflow: visible !important; border-collapse: separate; font-size: 13px; border-radius: 16px; table-layout: auto; }
  .pr-table thead th { position: sticky; top: 0; z-index: 2; }
  .pr-table th, .pr-table td { padding: 12px 12px; min-width: 104px; white-space: nowrap; }
  .pr-table th:first-child, .pr-table td:first-child {
    position: sticky; left: 0; z-index: 3; min-width: 140px; max-width: 150px; white-space: normal;
    background: var(--dns-bg-surface); box-shadow: 8px 0 12px -10px rgba(0,0,0,.55);
  }
  .pr-table th:last-child, .pr-table td:last-child { padding-right: 20px; }
  .pr-table th:first-child { z-index: 4; background: var(--dns-bg-surface-2); }
  .pr-table tr.group td { position: sticky; left: 0; z-index: 3; white-space: normal; max-width: none; background: var(--dns-bg-inset); }
  .pr-table td.hl, .pr-table th.hl { background: var(--m-accent-soft); }
  .pr-table td.hl:first-child { background: var(--dns-bg-surface); }
  .pr-table td.yes { font-size: 15px; }
  .pr-faq, .faq-grid, .help-grid { grid-template-columns: 1fr !important; }

  /* ═══════════════════════════ 6. Generic dialogs → bottom sheets ═══════════════════════════ */
  .dns-modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .dns-modal, .dnsc-composer-modal {
    max-width: none !important; width: 100% !important; border-radius: 24px 24px 0 0 !important;
    background: var(--m-glass) !important; border: 1px solid var(--m-line-2) !important; border-bottom: 0 !important; color: var(--m-text);
    padding-bottom: var(--m-safe-b); animation: mSheetUp .26s cubic-bezier(.32,.72,0,1) both !important;
  }
  .dns-modal-title { color: #fff !important; font-size: 1.1rem !important; }
  .dns-modal-text { color: var(--m-text-2) !important; font-size: .92rem !important; }
  .dns-modal-text strong { color: #fff !important; }
  .dns-modal-actions { display: flex; gap: 10px; padding: 8px 16px 16px; }
  .dns-modal-actions button, .dns-modal-actions .dns-btn { flex: 1 1 0; min-height: 48px; border-radius: 999px; font-size: .92rem; font-weight: 700; }
  .dnsc-composer-modal-text { min-height: 50dvh !important; font-size: 16px !important; color: var(--m-text) !important; border-color: var(--m-line) !important; }
  .dnsc-composer-modal-title { color: #fff !important; }
  .dnsc-composer-modal-count { color: var(--m-text-3) !important; }

  /* Buttons everywhere on the phone: comfortable targets. */
  .dns-btn, .pub-btn, .rf-btn, .dns-tb-btn, .dns-prefs-edit, .dns-pref-chip, .dns-link-btn, .bpx-btn, .dnsc-send { -webkit-tap-highlight-color: transparent; }
  .dns-btn, .pub-btn, .rf-btn { min-height: 44px; border-radius: 999px; }

  @media (prefers-reduced-motion: reduce) {
    .dns-popover, .dns-ledger-modal, .dns-prefs-sheet, .dns-modal, .bpx-window, .dns-project-menu-panel { animation: none !important; }
  }

  /* ═══════════════════════════ 7. Light theme on the phone ═══════════════════════════
     The phone workbench previously kept the dark-blue stage in BOTH themes, so a light-theme user
     opening a project saw a dark UI. Re-point every --m-* token at the desktop light palette and
     override the hard-coded navy surfaces so the whole workbench follows the chosen theme. */
  html.light-theme .dns-workspace-shell, html.light-theme .dns-build-sheet, html.light-theme .dns-explorer-panel.dns-explorer-mobile-open,
  html.light-theme .dns-project-menu-panel.dns-tb-more-panel, html.light-theme .dns-project-menu-panel.dns-tb-project-panel {
    --m-stage: var(--dns-bg-stream);
    --m-stage-glow: radial-gradient(90% 60% at 50% 0%, rgba(99,102,241,.14), transparent 65%);
    --m-bg: var(--dns-bg-app); --m-glass: #ffffff; --m-glass-2: #f1f5f9; --m-glass-3: #e2e8f0;
    --m-line: var(--dns-border); --m-line-2: var(--dns-border-strong);
    --m-text: var(--dns-text); --m-text-2: var(--dns-text-muted); --m-text-3: var(--dns-text-subtle); --m-sky: var(--dns-accent-2);
    --m-shadow: 0 10px 30px -18px rgba(15,23,42,.25);
    color-scheme: light;
  }
  html.light-theme .dns-workspace-shell {
    --dns-bg: #f8fafc; --dns-bg-app: #f8fafc; --dns-bg-surface: #ffffff; --dns-bg-surface-2: #f1f5f9;
    --dns-bg-elevated: #ffffff; --dns-bg-inset: #e8eeff;
    --dns-border: #e2e9f8; --dns-border-strong: #cbd5e1;
    --dns-text: #0f172a; --dns-text-muted: #3b4760; --dns-text-subtle: #64748b; --dns-text-strong: #0f172a;
    --dns-surface: #ffffff; --dns-surface-2: #f1f5f9; --dns-muted: #3b4760;
    --dnsc-text: #0f172a; --dnsc-muted: #3b4760; --dnsc-border: #e2e9f8; --dnsc-user-bg: rgba(37,99,235,.1);
    --dnsc-card: #ffffff; --dnsc-card-strong: #f1f5f9; --dnsc-card-border: #e2e9f8; --dnsc-brand: #2563eb;
    --dns-scrollbar-thumb: rgba(100,116,139,.45); --dns-scrollbar-thumb-hover: rgba(100,116,139,.7);
    color: #0f172a;
  }
  html.light-theme .dns-workspace-shell .dns-workspace-toolbar.dns-toolbar-modern { background: rgba(255,255,255,.88) !important; border-bottom-color: #e2e9f8 !important; box-shadow: 0 10px 30px -22px rgba(15,23,42,.35) !important; }
  html.light-theme .dns-workspace-shell .dns-mobile-strip { background: rgba(255,255,255,.94) !important; border-top-color: #e2e9f8 !important; }
  html.light-theme .dns-ms-btn.on { color: var(--m-accent-text) !important; background: var(--m-accent-soft) !important; border-color: var(--m-accent-line); }
  html.light-theme .dns-workspace-shell .dns-build-dock { background: #ffffff !important; border-color: #e2e9f8 !important; color: #0f172a; }
  html.light-theme .dns-workspace-shell .dns-build-dock, html.light-theme .dns-workspace-shell .dns-build-dock-header,
  html.light-theme .dns-workspace-shell .dns-gen-surface-title, html.light-theme .dns-workspace-shell .dns-right-panel .ai-chat-brand,
  html.light-theme .dns-workspace-shell .dns-blueprint-drafting h2, html.light-theme .dns-workspace-shell .dns-draft-grid article h3 { color: #0f172a !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel { background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important; box-shadow: none; }
  html.light-theme .dns-workspace-shell .dns-right-panel .ai-chat-header { background: rgba(255,255,255,.85) !important; border-bottom-color: #e2e9f8; }
  html.light-theme .dns-workspace-shell .dns-right-panel .dnsc-dock { background: linear-gradient(to top, #f1f5f9 70%, transparent); }
  html.light-theme .dns-workspace-shell .dns-right-panel .dnsc-composer { background: #ffffff; border-color: #cbd5e1; }
  html.light-theme .dns-workspace-shell .dnsc-select { background: #ffffff; border-color: #cbd5e1; }
  html.light-theme .dns-workspace-shell .dnsc-progress-track, html.light-theme .dns-workspace-shell .ai-chat-progress .dnsc-progress-track { background: #e2e8f0 !important; }
  html.light-theme .dns-workspace-shell .dnsc-progress-fill { background: linear-gradient(90deg, var(--dns-accent-2), var(--dns-accent)) !important; box-shadow: none; }
  html.light-theme .dns-workspace-shell .dnsc-progress-dock { background: #ffffff !important; border-color: #e2e9f8 !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#fff"], html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#ffffff"],
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#f1f5f9"], html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#e2e8f0"],
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#cbd5e1"], html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#f8fafc"] { color: #0f172a !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#94a3b8"], html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#64748b"],
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#475569"], html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#d1d5db"] { color: #3b4760 !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#fbbf24"] { color: #b45309 !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#fca5a5"] { color: #b91c1c !important; }
  html.light-theme .dns-workspace-shell .dns-right-panel [style*="color:#86efac"] { color: #15803d !important; }
  html.light-theme .dns-workspace-shell ::placeholder { color: #64748b !important; }
  html.light-theme .dns-workspace-shell #panel-editor > div[style*="font-family:monospace"],
  html.light-theme .dns-workspace-shell #panel-editor > div[style*="padding:6px 8px"] { background: #ffffff !important; color: #3b4760 !important; border-bottom-color: #e2e9f8 !important; }
  html.light-theme .dns-workspace-shell .dns-preview-header { background: #ffffff; border-bottom-color: #e2e9f8; }
  html.light-theme .dns-workspace-shell .dns-preview-btn { background: #ffffff; border-color: #e2e9f8; color: #334155; }
  html.light-theme .dns-workspace-shell .dns-viewport-switch { background: #f1f5f9; border-color: #e2e9f8; }
  html.light-theme .dns-workspace-shell .dns-vp-btn { color: #475569; }
  html.light-theme .dns-workspace-shell .dns-vp-btn.active { background: var(--dns-accent); color: #fff; }
  html.light-theme .dns-workspace-shell .dns-preview-stage { background: #e8eeff; }
  html.light-theme .dns-gen-pill { background: #ffffff; color: #0f172a; border-color: var(--m-accent-line); box-shadow: 0 14px 34px -10px rgba(15,23,42,.35); }
  html.light-theme .dns-gen-pill-text small { color: #3b4760; }
  html.light-theme .dns-explorer-panel.dns-explorer-mobile-open input { background: #ffffff !important; color: #0f172a !important; }
  html.light-theme .dns-build-sheet-close, html.light-theme .dns-build-sheet-title strong { color: #0f172a; }
  html.light-theme .dns-workspace-shell .dns-build-dock .dns-build-dock-mobile-hint { color: #1d4ed8; background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.3); }
  html.light-theme .dns-workspace-shell .cpt-turn .cpt-text, html.light-theme .dns-workspace-shell .cpt-panel-title,
  html.light-theme .dns-workspace-shell .cpt-act-sub, html.light-theme .dns-workspace-shell .cpt-act-note,
  html.light-theme .dns-workspace-shell .cpt-actions-title, html.light-theme .dns-workspace-shell .cpt-thinking-text,
  html.light-theme .dns-workspace-shell .cpt-panel-meta { color: #0f172a !important; }
}

/* Short landscape phones: Mira sheet takes more height so the composer stays reachable. */
@media (max-width: 760px) and (orientation: landscape) and (max-height: 480px) {
  .dns-workspace-shell .dns-right-panel { flex-basis: 60dvh; }
  .dns-workspace-shell .dns-mobile-strip .dns-ms-btn { height: 48px; }
}
