/* AtlasONE — shared app chrome: base reset/type, topbar/brand, buttons, the
   gate + native tool-shell (full-bleed iframe wrapper), auth forms/split
   layout, and footer. Loaded by every layout()-rendered page (src/services/
   views.js) on top of tokens.css; nav.css/atlas-ui.css/dashboard.css/
   landing.css layer on for their own pages. Not loaded inside tool iframes —
   those get atlas-ui-scoped tokens via tokens.css + atlas-legacy-shim.css only. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-sans); color: var(--text); background: var(--surface-subdued); line-height: 1.5; }
main { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-6) 48px; }
h1, h2, h3 { line-height: 1.2; }
a { color: var(--interactive); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-subdued); }

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--space-6); background: var(--surface); border-bottom: 1px solid var(--border); }
/* ── ATLAS◯ne wordmark — uppercase ATLAS + Atlas globe as the "O" + lowercase ne.
   Reused on auth, app top bar, and dashboard nav. The globe is the accent that
   reads as the "O"; ATLAS/ne inherit the surrounding text color. ───────────── */
.brand { display: inline-flex; align-items: baseline; gap: 0;
  font-family: var(--font-sans); font-size: 22px; font-weight: 800;
  letter-spacing: -.2px; line-height: 1; color: var(--text-strong); }
.brand:hover { text-decoration: none; }
/* NOT scoped to .brand — the wordmark is emitted by atlasOneMark() into several
   containers (top bar `.brand`, dashboard nav, and the public invite-accept card's
   `.ia-brand`). While these were `.brand`-scoped, the invite page got NO wordmark
   styling at all: the globe rendered at the default replaced-element size instead of
   .9em, and without inline-flex it broke the line, splitting the mark into "Atlas" /
   giant globe / "ne" on three rows. Keep these selectors container-agnostic; put only
   container typography and colour overrides on .brand. */
.wm-atlas { text-transform: uppercase; letter-spacing: .01em; }
.wm-one { display: inline-flex; align-items: baseline; }
.wm-ne { text-transform: lowercase; }
.globe-o { width: .9em; height: .9em; flex: none; align-self: center;
  position: relative; top: .055em; color: var(--atlas-aqua); }
/* legacy Atlas<b>ONE</b> fallback, if any markup still uses it */
.brand strong, .brand b { color: var(--interactive); font-weight: 800; }
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav .who { color: var(--text-subdued); font-size: 14px; }
/* Persistent app nav links (mirror the dashboard nav on tool/gate pages). */
.topnav .navlink { color: var(--text-subdued); font-weight: 600; font-size: 14px; }
.topnav .navlink:hover { color: var(--text); text-decoration: none; }
.topnav .navlink.on { color: var(--interactive); }
.topnav .navgrow { flex: 1 1 auto; }
.tool-bar .crumb-sep { color: var(--text-subdued); font-weight: 400; }
/* On narrow screens keep Dashboard + Search + account; drop the category links. */
@media (max-width: 760px) { .topnav .navlink:not(.on):not(.ts) { display: none; } }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--interactive); cursor: pointer; font: inherit; padding: 0; }

/* buttons */
.btn { display: inline-block; background: var(--interactive); color: var(--text-on-brand); padding: 10px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--interactive); cursor: pointer; font: inherit; }
.btn:hover { background: var(--interactive-hover); text-decoration: none; }
.btn-lg { padding: 14px 22px; font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--interactive); }
.btn-ghost:hover { background: var(--interactive-subdued); }

/* gate + tool shell */
.gate { max-width: 560px; margin: 64px auto; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); }
/* Native tool shell — full-bleed iframe that reads as a built-in page, not a
   bordered "window on the site". Slim back bar on top, edge-to-edge frame below. */
.tool-wrap { display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.tool-bar { display: flex; gap: 14px; align-items: center;
  height: 44px; padding: 0 var(--space-6);
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 14px; flex: none; }
.tool-bar a { font-weight: 600; }
.tool-bar a:hover { text-decoration: none; opacity: .8; }
.tool-bar span { color: var(--text); font-weight: 600; }
.preview-banner { background: var(--honey-bg); color: var(--warning); border: 0;
  border-bottom: 1px solid var(--warning); padding: 8px var(--space-6); font-size: 13px; flex: none; }
.tool-frame { display: block; width: 100%; flex: 1 1 auto;
  /* the dark dash-nav is 60px (see nav.css .dash-nav .row); fill the rest of the
     viewport. The 44px breadcrumb bar this used to subtract was removed 2026-07-21. */
  height: calc(100vh - 60px); min-height: 480px;
  border: 0; border-radius: 0; background: var(--surface-subdued); }
/* Tool pages run edge-to-edge: drop the app's centered max-width gutter. */
body:has(.tool-wrap) main { max-width: none; margin: 0; padding: 0; }

/* auth forms */
.authcard { max-width: 420px; margin: 56px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.authcard h1 { margin-top: 0; }
.field { margin: 14px 0; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; }
.msg { margin: 12px 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; display: none; }
.msg.err { background: var(--critical-bg); color: var(--critical); display: block; }
.msg.ok { background: var(--success-bg); color: var(--success); display: block; }

/* footer */
.foot { text-align: center; color: var(--text-subdued); font-size: 13px; padding: 24px; border-top: 1px solid var(--border); }

/* ── Branded auth split (login / register) ─────────────────────── */
body.auth { background: var(--surface-subdued); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { position: relative; overflow: hidden; color: #eaf2ff; padding: clamp(28px,5vw,56px);
  display: flex; flex-direction: column; justify-content: space-between;
  /* landing-art: intentional — first stop (#0e3aa0) has no token equivalent; the other two are exact */
  background: radial-gradient(900px 600px at 20% 0%, #0e3aa0 0%, var(--atlas-indigo-800) 45%, var(--atlas-charcoal) 100%); }
.auth-aside .brand { font-family: var(--font-sans); font-weight: 800; font-size: 26px; color: var(--text-on-brand); }
.auth-aside .brand b { color: var(--atlas-aqua); }
.auth-aside .pitch { font-family: var(--font-sans); font-weight: 800; font-size: clamp(26px,3vw,40px); line-height: 1.1; letter-spacing: -1px; margin: 24px 0 0; }
.auth-aside .pitch em { font-style: normal; color: var(--atlas-honey); }
.auth-aside .pitch-sub { color: #b9c8ee; font-size: 16px; line-height: 1.5; margin-top: 14px; max-width: 36ch; } /* landing-art: intentional */
.auth-aside .ministats { display: flex; gap: 22px; margin-top: 28px; }
.auth-aside .ministats div { font-size: 13px; color: #b9c8ee; } /* landing-art: intentional */
.auth-aside .ministats b { display: block; font-family: var(--font-sans); font-weight: 800; font-size: 26px; color: var(--text-on-brand); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(24px,5vw,48px); }
.auth-main .authcard { margin: 0; box-shadow: none; border: 0; max-width: 380px; width: 100%; }
.auth-main .authcard h1 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -.5px; }
.field input:focus { outline: none; border-color: var(--interactive); box-shadow: 0 0 0 3px var(--interactive-subdued); }
/* Auth pages don't load atlas-ui.css (which owns .btn radius everywhere else) — keep the
   brand pill radius scoped here so it's obviously auth-only, not a duplicate global rule. */
.auth-shell .btn { border-radius: 999px; }
@media (max-width: 820px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* status badges (gate "Coming soon") */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.badge.soon { color: var(--atlas-violet); border-color: #e3d7f5; background: var(--violet-bg); } /* border: no named token, kept literal */
.badge-soon-gate { margin-bottom: 12px; display: inline-block; }
