/* Owner App Style: re-tints the Eclipse look with CSS variables only (Settings > Appearance > Style).
   data-style="eclipse" (default) has no rules here, so Eclipse is exactly what it was. Nebula and Ember only change colours:
   no layout, size or type changes. Values come from ui_concepts/style.css (.concept.nebula / .concept.ember). */
:root[data-style="nebula"] {
  --acc: #7fb0ff; --acc2: #b08cff; --glow: #4a6dff; --orb1: #33449a; --orb2: #05060e; --hz: #7d9cff;
  --btnbg: linear-gradient(#4472f0, #2d5bd6); --btnfg: #ffffff;
  --acc-rgb: 127,176,255; --acc2-rgb: 176,140,255; --glow-rgb: 74,109,255; --hz-rgb: 125,156,255;
  --warn-s: #e0b36a;
}
:root[data-style="ember"] {
  --acc: #ffb35c; --acc2: #ff7a59; --glow: #ff8a3d; --orb1: #6a3a1c; --orb2: #080504; --hz: #ffa45c;
  --btnbg: linear-gradient(#ffc27a, #f08a3a); --btnfg: #1b0e03;
  --acc-rgb: 255,179,92; --acc2-rgb: 255,122,89; --glow-rgb: 255,138,61; --hz-rgb: 255,164,92;
  --warn-s: #ff9a80;
}
/* P = :root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) {
  --blue: var(--acc); --blue-bright: var(--acc); --focus: var(--acc); --ecl-blue: var(--glow); --ecl-blue-soft: var(--acc);
  --warn-text: var(--warn-s); --warning: var(--warn-s);
}
/* focus ring, input focus */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) :focus-visible { outline-color: var(--acc); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .searchbar:focus-within,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) input:focus-visible { box-shadow: 0 0 0 2px rgba(var(--acc-rgb), .35); border-color: rgba(var(--acc-rgb), .5); }
/* links inside running text and section headers */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) :is(.link, p a, .small a, .section-head a) { color: var(--acc); }
/* tile warn */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .stat .sub.tone-warn { color: var(--warn-s); }
/* active nav bar */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .bottom-nav a[aria-current="page"]::before { background: var(--acc); box-shadow: 0 0 10px rgba(var(--acc-rgb), .5); }
/* primary buttons */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.primary,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.accent,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.truth-cta {
  background: var(--btnbg); border: 1px solid rgba(255,255,255,.22); color: var(--btnfg); text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 16px -6px rgba(var(--glow-rgb), .65), 0 8px 20px -14px rgba(0,0,0,.9); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.primary svg,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.accent svg,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.truth-cta svg { color: var(--btnfg); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.primary:hover,
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .btn.accent:hover { background: var(--btnbg); filter: brightness(1.08); }
/* agent ring + avatar glow */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .avatar::after { background: conic-gradient(from 200deg, var(--acc), #ffffff10 40%, var(--acc2) 70%, var(--acc)); border-color: rgba(var(--acc-rgb), .36); box-shadow: none; }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .avatar { filter: drop-shadow(0 0 8px rgba(var(--glow-rgb), .35)); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .avatar::before { background: radial-gradient(circle, rgba(var(--acc-rgb), .20), rgba(var(--acc-rgb), 0) 68%); }
/* Director halo */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .director-page.is-idle .director-hero::before {
  background: radial-gradient(circle, rgba(var(--glow-rgb), .30) 0%, rgba(var(--glow-rgb), .14) 52%, rgba(var(--glow-rgb), 0) 74%);
  border-color: rgba(var(--acc-rgb), .40); box-shadow: 0 0 40px 4px rgba(var(--glow-rgb), .26), inset 0 0 40px rgba(var(--glow-rgb), .18); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .director-page.is-idle .director-hero .av-stage { filter: drop-shadow(0 0 16px rgba(var(--glow-rgb), .55)) !important; }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .director-page.is-idle .director-greet { border-color: rgba(var(--acc-rgb), .24); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .director-page.has-msgs .director-hero::before {
  border-color: rgba(var(--acc-rgb), .42); background: radial-gradient(circle, rgba(var(--glow-rgb), .22), rgba(var(--glow-rgb), 0) 70%); box-shadow: 0 0 12px 1px rgba(var(--glow-rgb), .30); }
/* Home orb + horizon glow (no thin line) */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) body:has(.home-page) .shell.earth-app::before {
  background-image:
    radial-gradient(ellipse 85% 150px at 50% 150px, rgba(var(--hz-rgb), .10), transparent 72%),
    radial-gradient(circle 210px at 50% 30px, color-mix(in srgb, var(--orb1) 80%, #000) 0%, color-mix(in srgb, var(--orb1) 38%, var(--orb2)) 45%, color-mix(in srgb, var(--orb1) 12%, var(--orb2)) 68%, rgba(6,7,10,0) 76%),
    linear-gradient(180deg, #0a0b0f 0%, #06070a 60%); }
@media (min-width: 1024px) {
  :root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) body:has(.home-page) .shell.earth-app::before {
    background-image:
      radial-gradient(ellipse 60% 150px at 46% 150px, rgba(var(--hz-rgb), .10), transparent 72%),
      radial-gradient(circle 300px at 46% 0px, color-mix(in srgb, var(--orb1) 80%, #000) 0%, color-mix(in srgb, var(--orb1) 38%, var(--orb2)) 45%, color-mix(in srgb, var(--orb1) 12%, var(--orb2)) 68%, rgba(6,7,10,0) 76%),
      linear-gradient(180deg, #0a0b0f 0%, #06070a 60%); }
}
/* More moon hero */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .moon-hero .orb {
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--orb1) 70%, #000) 0%, var(--orb2) 68%);
  box-shadow: 0 -6px 90px -10px rgba(var(--glow-rgb), .5), inset 0 2px 0 rgba(var(--hz-rgb), .35); }
/* other orb surfaces (mk) */
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .mk-orb { background: radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--orb1) 60%, #000), var(--orb2) 62%); box-shadow: 0 0 80px -14px rgba(var(--glow-rgb), .4); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .mk-orb.big { box-shadow: 0 0 110px -10px rgba(var(--glow-rgb), .5); }
:root[data-theme="eclipse"][data-bright]:is([data-style="nebula"], [data-style="ember"]) .mk-ring { background: conic-gradient(from 200deg, var(--acc), #ffffff10 40%, var(--acc2) 70%, var(--acc)); box-shadow: 0 0 16px -8px var(--glow); }

/* ---------- interaction audit 2026-10-12: one shared dialog/sheet fix ----------
   Sheets are drawn in their own host under <body> (ui.js Sheet) and sit above the top bar, bottom nav, banners and the
   pull-to-refresh pill. Solid scrim (nothing bleeds through), full-height inner scrolling, background scroll locked. */
html .sheet-host { position: relative; z-index: 300; }
html .scrim, html:root[data-theme] .scrim {
  position: fixed; inset: 0; z-index: 300; background: rgba(2, 3, 5, .93);
  backdrop-filter: none; -webkit-backdrop-filter: none; display: flex; align-items: flex-end; justify-content: center;
  overscroll-behavior: contain; padding: var(--safe-t, 0px) 0 0;
}
html .sheet, html:root[data-theme] .sheet {
  width: 100%; max-width: 640px; box-sizing: border-box; min-height: 0; height: auto;
  max-height: calc(100dvh - var(--safe-t, 0px) - 6px); display: flex; flex-direction: column;
  padding: 8px 16px calc(14px + var(--safe-b, 0px)); border-radius: 22px 22px 0 0; background: #0b0c0e;
  border: 1px solid rgba(210, 213, 216, .17); border-bottom: 0; overflow: hidden;
}
html .sheet .sheet-head { display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 -6px 6px 0; flex: none; }
html .sheet .sheet-head .h-sec { flex: 1; min-width: 0; margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
html .sheet .sheet-close { flex: none; width: 44px; height: 44px; }
html .sheet .sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
html .sheet .sheet-body .btn, html .sheet .sheet-body button.btn { min-height: 48px; height: auto; white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }
html .sheet input:not([type=checkbox]):not([type=radio]), html .sheet textarea, html .sheet select, html .sheet .auth-input, html .sheet .cn-login .auth-input { font-size: 16px; min-height: 48px; }
html .sheet textarea { min-height: 150px; padding: 12px 14px; line-height: 1.4; resize: vertical; width: 100%; box-sizing: border-box; border-radius: var(--r-md, 14px);
  border: 1px solid rgba(206, 208, 212, .18); background: rgba(17, 18, 20, .92); color: inherit; outline: 0; }
html .sheet textarea.secret-text { -webkit-text-security: disc; }
html .sheet .auth-field span { overflow-wrap: anywhere; line-height: 1.35; }
html.has-sheet, html.has-sheet body { overflow: hidden; overscroll-behavior: none; }
@media (min-width: 1024px) { html .scrim { align-items: center; padding: 0; } html .sheet { border-radius: 18px; max-height: 80vh; border-bottom: 1px solid rgba(210, 213, 216, .17); } }
details.ia-more { margin-top: 6px; } details.ia-more > summary { min-height: 44px; display: flex; align-items: center; color: var(--text-2); cursor: pointer; }
html .sheet .composer textarea { min-height: 110px; font-size: 16px; }
html .sheet textarea.auth-input { height: auto; min-height: 150px; }
html:root[data-theme] .sheet .composer textarea { min-height: 110px; font-size: 16px; padding: 10px 6px; }
html:root[data-theme="classic"] .sheet { background: #090e15; border-color: rgba(175, 205, 240, .17); }
html:root[data-theme="classic"] .scrim { background: rgba(0, 3, 7, .93); }

/* Owner screens share the same title family. The Eclipse artwork and color tokens stay in their theme. */
html:root[data-theme="eclipse"] .page h1:is(.display, .h-title),
html:root[data-theme="eclipse"] .director-page .director-id h1.display {
  --font-display: var(--font-ui);
  font-family: var(--font-ui);
  font-weight: 650;
  letter-spacing: -.025em;
  text-wrap: balance;
}
html:root[data-theme="eclipse"] .home-greet h1.display.xl { font-size: clamp(28px, 4vw, 40px); line-height: 1.14; }
html[data-theme="eclipse"] .director-page.has-msgs .director-id h1.display { font-size: 18px; line-height: 1.2; }

.home-priority {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 16px 18px;
  background: var(--surface-1); margin-block: 2px;
}
.home-priority-copy { min-width: 0; display: grid; gap: 5px; }
.home-priority-label { font: 600 13px/1.3 var(--font-ui); color: var(--text-2); }
.home-priority h2 { margin: 0; color: var(--text-1); font: 600 19px/1.3 var(--font-ui); overflow-wrap: anywhere; }
html[data-theme] .home-priority .home-priority-button.btn { min-height: 48px; max-inline-size: 18rem; text-align: center; white-space: normal; }
.home-loading { color: var(--text-2); }
.home-loading-link.btn { min-height: 44px; width: fit-content; }
@media (min-width: 1280px) {
  .home-sky > .home-priority { grid-column: 1 / -1; grid-row: 2; }
  .home-sky:has(> .home-priority) > .home-stats { grid-row: 3; }
}
@media (min-width: 1024px) {
  .home-page .home-rail .home-agents { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; }
  .home-rail .home-agents .agent-tile .faint { display: none; }
}
html[data-mk="home"] .home-priority { background: #0e1118d0; border-color: var(--mk-line); box-shadow: inset 0 0 32px -24px var(--glow); }
html[data-mk="home"] .home-priority .home-priority-button.btn {
  background: var(--btnbg); color: var(--btnfg); font: 600 15px/1.3 var(--mk-sans);
}
@media (max-width: 640px) {
  .home-priority { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
  html[data-theme] .home-priority .home-priority-button.btn { width: 100%; max-inline-size: none; }
  .home-priority h2 { font-size: 17px; }
}
@media (max-width: 350px) {
  html[data-mk] .topbar .mobile-only .wordmark { display: none; }
}

.hero.intel, .hero.more-header { min-height: 0; }
@media (max-width: 1023px) {
  html[data-theme="eclipse"] .director-page .director-id h1.display { font-size: 18px; line-height: 1.2; }

  html[data-theme] .director-compose .composer textarea { font-size: max(16px, var(--fs-md)); }
  body.kb-open .director-compose .composer textarea { max-height: clamp(40px, calc(var(--vvh, 100dvh) - 200px), 120px); }
  .director-head .icon-btn { width: 44px; height: 44px; }
  .director-welcome.mobile-only { display: grid; justify-items: center; padding: 8px 0; }
  .director-welcome img { display: block; width: 112px; height: 112px; object-fit: contain; border-radius: 50%; box-shadow: 0 0 34px rgba(79,139,255,.22); }
  body.kb-open .director-welcome { display: none; }
  .director-page .msg .bubble { overflow-wrap: anywhere; }
}
