
:root {
  --invela-deep-blue: #4166f5;
  --invela-light-blue: #ecf2fd;
  --invela-white: #ffffff;
  --invela-dark: #0f172a;
  --fg: var(--invela-dark);
  --fg-muted: #586273;
  --accent: var(--invela-deep-blue);
  --accent-hover: #3550d4;
  --accent-bg: var(--invela-light-blue);
  --bg: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  /* Blue focus ring — the unified focus/active treatment for fields + buttons.
     Mirrors @bluebox/brand --ring. */
  --ring: 0 0 0 3px rgba(65, 102, 245, 0.16);
  /* Neutral selection ring — slate, NOT brand. Marks a selected/emphasised
     launcher tile (white kept) without claiming the blue "active" treatment
     reserved for genuinely active controls. Mirrors @bluebox/brand --ring-neutral. */
  --ring-neutral: 0 0 0 3px rgba(100, 116, 139, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
  --font: 'Inter', -apple-system, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--fg); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar: 3-zone layout [left: brand+tools | center: app nav | right: account] ── */
.navbar { background: var(--invela-white); border-bottom: 1px solid var(--border); padding: 0 20px; height: 56px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100; }
.nav-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding-right: 16px; border-right: 1px solid var(--border); margin-right: 16px; }
.nav-brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.nav-brand svg { height: 28px; width: auto; }
.nav-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.nav-app-name { font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.nav-center { display: flex; align-items: center; justify-content: center; gap: 2px; flex: 1; overflow-x: auto; }
.nav-center a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--fg-muted); text-decoration: none; white-space: nowrap; transition: background 100ms, color 100ms; }
.nav-center a svg { width: 14px; height: 14px; }
.nav-center a:hover { background: var(--accent-bg); color: var(--accent); text-decoration: none; }
.nav-center a.active { background: var(--accent-bg); color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-left: 16px; border-left: 1px solid var(--border); margin-left: 16px; }

/* ── Dropdown base (shared by Tools + Account) ──────────────────── */
.dd { position: relative; flex-shrink: 0; }
.dd summary { list-style: none; cursor: pointer; }
.dd summary::-webkit-details-marker { display: none; }
.dd-panel { position: absolute; top: calc(100% + 6px); background: var(--invela-white); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 200; overflow: hidden; animation: ddIn 100ms ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }

/* ── Filter dropdown (changelog, reusable) ────────────────────── */
.filter-dd summary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--fg); background: var(--invela-white); user-select: none; transition: border-color 120ms; }
.filter-dd summary:hover { border-color: var(--accent); }
.dd[open].filter-dd summary { border-color: var(--accent); }
.filter-dd .chev { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; transition: transform 150ms; }
.dd[open].filter-dd .chev { transform: rotate(180deg); }
.filter-dd .dd-panel { left: 0; min-width: 100%; padding: 6px; }
.filter-dd .dd-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); border: none; background: none; font-size: 13px; font-weight: 500; color: var(--fg); cursor: pointer; text-align: left; font-family: inherit; transition: background 80ms, color 80ms; }
.filter-dd .dd-item:hover { background: var(--bg); color: var(--accent); }
.filter-dd .dd-item.selected { background: var(--accent-bg); color: var(--accent); }
.filter-dd .dd-item .check { width: 14px; height: 14px; flex-shrink: 0; margin-left: auto; }

/* ── Tools pill button ──────────────────────────────────────────── */
.tools-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--fg-muted); background: transparent; border: 1px solid var(--border); transition: all 100ms; user-select: none; }
.tools-btn svg { width: 15px; height: 15px; }
.tools-btn .chev { width: 12px; height: 12px; transition: transform 150ms; }
.tools-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.dd[open] .tools-btn { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.dd[open] .tools-btn .chev { transform: rotate(180deg); }
.tools-panel { left: 0; width: 300px; padding: 6px; }
.tools-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--fg); transition: background 80ms; }
.tools-link:hover { background: var(--accent-bg); text-decoration: none; }
.tools-link.current { background: var(--accent-bg); }
.tools-home { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tools-subhead { padding: 10px 12px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); }
.tools-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tools-icon svg { width: 16px; height: 16px; }
.tools-name { font-size: 13px; font-weight: 600; }
.tools-desc { font-size: 11px; color: var(--fg-muted); line-height: 1.3; }

/* ── Account pill button ────────────────────────────────────────── */
.acct-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--fg-muted); user-select: none; border: 1px solid var(--border); transition: all 100ms; }
.acct-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.dd[open] .acct-btn { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.acct-name { white-space: nowrap; }
.acct-btn .chev { width: 12px; height: 12px; color: var(--fg-muted); transition: transform 150ms; }
.dd[open] .acct-btn .chev { transform: rotate(180deg); }
.acct-panel { right: 0; width: 220px; }
.acct-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.acct-header-name { font-size: 14px; font-weight: 600; }
.acct-header-email { font-size: 12px; color: var(--fg-muted); word-break: break-all; }
.acct-actions { padding: 6px; }
.acct-action { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--fg); font-size: 13px; font-weight: 500; transition: background 80ms; width: 100%; }
.acct-action svg { width: 16px; height: 16px; color: var(--fg-muted); }
.acct-action:hover { background: var(--accent-bg); text-decoration: none; }

/* ── Login page ─────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card {
  background: var(--invela-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md); text-align: left; max-width: 920px; width: 100%;
  display: grid; grid-template-columns: 1fr;
}
/* Uniform vertical rhythm: pad-top == gap(logo->text) == gap(text->button) == pad-bottom == 34px. */
.login-left { display: flex; flex-direction: column; padding: 34px 48px; }
.login-h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 6px; color: var(--fg); }
.login-sub { color: var(--fg-muted); font-size: 14px; margin-bottom: 34px; line-height: 1.5; }
.login-right { display: none; padding: 12px; }
/* The hero is an absolutely-positioned follower so the card height is driven by
   the left panel (no dead space); a low min-height is just a safety floor. */
.login-hero-wrap { position: relative; height: 100%; min-height: 220px; border-radius: 12px; overflow: hidden; }
.login-hero { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 900px) {
  .login-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); }
  .login-right { display: block; }
}
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 24px; background: #f1f5f9; color: #0f172a;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all 120ms; width: 100%;
}
.login-btn:hover { background: #e2e8f0; border-color: #cbd5e1; text-decoration: none; }
.login-btn svg { width: 16px; height: 16px; }
/* Trailing CTA: a right chevron that becomes an arrow + nudges right on hover. */
.login-cta { position: relative; display: inline-flex; width: 15px; height: 15px; margin-left: -2px; transition: transform 160ms ease; }
.login-cta svg { position: absolute; left: 0; top: 0; width: 15px; height: 15px; transition: opacity 160ms ease; }
.login-cta .cta-arrow { opacity: 0; }
.login-btn:hover .login-cta { transform: translateX(4px); }
.login-btn:hover .cta-chev { opacity: 0; }
.login-btn:hover .cta-arrow { opacity: 1; }

/* ── Launcher ───────────────────────────────────────────────────── */
.launcher { max-width: 1080px; margin: 56px auto; padding: 0 24px; }
.launcher h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.launcher .sub { color: var(--fg-muted); font-size: 14px; margin-bottom: 32px; }
/* 3-col grid groups apps by category. Each column is its own flex
   stack so cards inside fill available height equally and the column
   widths stay even regardless of card count. */
.tools-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tools-col { display: flex; flex-direction: column; gap: 12px; }
.tools-col-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-muted); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.app-grid { display: flex; flex-direction: column; gap: 12px; }
.app-new-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 6px; border-radius: 9999px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; }
.app-card {
  /* min-height locks every card to a 2-line-description footprint so
     short taglines (e.g. "Conference booth lead generation quiz") pad
     up to match longer ones. Card height ≈ 20px padding + 17px h2 +
     2 × 16px description + 20px padding = 88px. */
  min-height: 88px; box-sizing: border-box;
  background: var(--invela-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--fg);
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  transition: box-shadow 150ms, border-color 150ms;
}
/* The slim "old lady" agent strip — a full-width row that wraps below the
   icon/text/arrow line (flex-basis:100% forces the wrap). Face is proxied from
   the agents worker; full details live in the strip's title tooltip. */
.app-card-agent { position: relative; flex-basis: 100%; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 10px; background: #f1f5f9; border: 1px solid var(--border); border-radius: var(--radius-md); transition: background 110ms, border-color 110ms; }
.app-card:hover .app-card-agent { background: var(--invela-white); }
.app-card-agent:hover { border-color: var(--border-strong); }
.app-card-agent-face { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; flex-shrink: 0; box-shadow: 0 1px 2px rgba(24,24,24,0.14); background: var(--invela-white); }
.app-card-agent-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-card-agent-name { font-size: 13px; font-weight: 700; color: var(--fg); line-height: 1.2; }
.app-card-agent-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* our OWN tooltip (not native title) — clean card, fades in above the chip on hover */
.app-card-agent-tip { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; background: var(--invela-white); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 130ms ease, transform 130ms ease, visibility 130ms; pointer-events: none; z-index: 60; }
.app-card-agent:hover .app-card-agent-tip { opacity: 1; visibility: visible; transform: translateY(0); }
.acat-head { font-size: 13px; font-weight: 700; color: var(--fg); }
.acat-role { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.acat-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.45; margin-top: 3px; }
.acat-row { font-size: 12px; color: var(--fg); line-height: 1.5; }
.app-card-agent .pod-avatars { flex-shrink: 0; }
.app-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
/* Selected / emphasised tile — WHITE kept, neutral (slate) emphasis only:
   darker-gray border + a soft neutral ring. NOT a blue fill — blue stays
   reserved for genuinely active controls (triggers, active list rows/tabs). */
.app-card.selected,
.app-card[aria-current="page"] { border-color: var(--border-strong); box-shadow: var(--ring-neutral); }
.app-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-card-icon svg { width: 18px; height: 18px; }
.app-card-text { min-width: 0; flex: 1; }
.app-card-text h2 { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.app-card-text p {
  font-size: 12px; color: var(--fg-muted); margin: 0;
  /* Cap descriptions at 2 lines so a long tagline (e.g. Internal
     Surveys) does not push that card taller than its column-mates.
     Full text remains on hover via the title attribute below. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card-arrow { margin-left: auto; color: var(--fg-muted); flex-shrink: 0; align-self: center; }
.app-card-arrow svg { width: 16px; height: 16px; }
/* Pod card — a variant of the app card. Icon matches the app cards (light tint
   + dark glyph); the tagline slot holds the stacked agent avatars instead. */
.pod-card { cursor: pointer; }
.pod-desc { font-size: 12px; color: var(--fg-muted); margin: 0 0 8px; }
.pod-avatars { display: flex; align-items: center; margin-top: 0; }
.pod-avatar { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--invela-white);
  margin-left: -8px; box-shadow: 0 1px 2px rgba(24,24,24,0.14); flex-shrink: 0;
  object-fit: cover; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; }
.pod-avatar:first-child { margin-left: 0; }
.pod-avatar:first-child { margin-left: 0; }
.pod-avatar-more { background: var(--accent-bg); color: var(--accent); font-size: 10px; font-weight: 700; }
.pod-empty { font-size: 12px; color: var(--fg-muted); font-style: italic; }
.app-card:hover .app-card-arrow { color: var(--fg); }

/* ── Page shell — shared across every gateway-rendered page ─────── */
/* Single source of truth for top spacing + horizontal padding +
   header treatment. Applied to glossary, sitemap, and any future
   gateway-side page. The Changelog (rendered by @bluebox/changelog-html)
   uses a matching margin 40px-auto inline-style; visual parity
   without cross-package class dependency. */
.gw-page { margin: 40px auto 72px; padding: 0 24px; }
.gw-page > h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.gw-page > .sub { color: var(--fg-muted); font-size: 14px; margin: 0 0 32px; }

/* ── Glossary ───────────────────────────────────────────────────── */
.glossary { max-width: 640px; }
.glossary-list { display: flex; flex-direction: column; gap: 12px; }
.glossary-card {
  background: var(--invela-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.glossary-card h2 {
  font-size: 14px; font-weight: 700; color: var(--fg);
  margin: 0 0 6px; display: flex; align-items: baseline; gap: 8px;
}
.glossary-card .aliases {
  font-size: 11px; font-weight: 500; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.glossary-card p {
  font-size: 13px; line-height: 1.55; color: var(--fg); margin: 0;
}
.glossary-card p strong { color: var(--fg); font-weight: 600; }

/* ── Settings / Profile ─────────────────────────────────────────── */
/* The navbar (rendered by html()) is sticky at top:0, height 56px. Both the
   settings page-header and the side-nav stick BELOW it, so every sticky offset
   below is measured from --nav-h (56px). The scroll anchors get the same offset
   via scroll-margin-top so a smooth-scrolled section never tucks under the
   sticky chrome. */
.settings-shell { --nav-h: 56px; --sticky-head-h: 92px; max-width: 1040px; margin: 0 auto; padding: 0 24px 96px; }

/* Sticky page header — title + subtitle, sits directly under the navbar. */
.settings-header {
  position: sticky; top: var(--nav-h); z-index: 40;
  background: var(--bg); padding: 28px 0 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.settings-header h1 { font-size: 24px; font-weight: 700; margin: 0 0 2px; text-wrap: balance; }
.settings-header .sub { color: var(--fg-muted); font-size: 14px; margin: 0; text-wrap: balance; }

/* Two-column body: sticky side-nav (anchor links) + the scrolling sections. */
.settings-body { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }

.settings-nav { position: sticky; top: calc(var(--nav-h) + var(--sticky-head-h)); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  color: var(--fg-muted); text-decoration: none; border-left: 2px solid transparent;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.settings-nav a:hover { background: var(--accent-bg); color: var(--accent); text-decoration: none; }
.settings-nav a.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent); }
.settings-nav a .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.45; flex-shrink: 0; }
.settings-nav a.active .dot { opacity: 1; }

.settings-sections { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.settings-section { scroll-margin-top: calc(var(--nav-h) + var(--sticky-head-h) + 16px); margin: 0; }
.settings-section-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); margin: 0 0 12px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border); text-wrap: balance;
}
.settings-card {
  background: var(--invela-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Profile card = avatar block + form, side by side then stacking narrow. */
.settings-profile { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }

/* Avatar: circular, hover reveals a bottom-right "Randomize" affordance. */
.settings-avatar-block { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.settings-avatar {
  position: relative; width: 96px; height: 96px; border-radius: 999px;
  border: 2px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: #fff; font-size: 30px; font-weight: 700; user-select: none;
}
.settings-avatar-initials { position: relative; z-index: 1; letter-spacing: 0.02em; }
.settings-avatar-randomize {
  position: absolute; right: -2px; bottom: -2px; z-index: 2;
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--invela-white); color: var(--accent);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(0.85); transition: opacity 140ms ease, transform 140ms ease;
}
.settings-avatar-randomize svg { width: 15px; height: 15px; }
.settings-avatar:hover .settings-avatar-randomize,
.settings-avatar:focus-within .settings-avatar-randomize { opacity: 1; transform: scale(1); }
.settings-avatar-randomize:hover { background: var(--accent-bg); border-color: var(--accent); }
.settings-avatar-caption { font-size: 11px; color: var(--fg-muted); text-align: center; }

/* Form: label-over-input fields. */
.settings-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Shared field primitives (.settings-fieldgroup/.settings-field-label/.settings-input)
   now live in @bluebox/navbar-html NAVBAR_STYLES (loaded in <head>) so the feedback
   popover styles on every app (#169). Only the settings-PAGE layout stays local. */
/* Locked (read-only) field — muted, non-interactive, clearly not editable. */
.settings-locked {
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); word-break: break-word; cursor: default;
}
.settings-note { font-size: 12px; color: var(--fg-muted); margin: 0; line-height: 1.5; }
.settings-placeholder { font-size: 13px; color: var(--fg-muted); margin: 0; line-height: 1.55; }

/* Dirty footer — hidden until an editable field or the avatar changes. */
.settings-dirtybar {
  position: sticky; bottom: 0; z-index: 30; margin-top: 8px;
  display: none; align-items: center; gap: 12px;
  padding: 14px 20px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--invela-white); box-shadow: var(--shadow-md);
}
.settings-dirtybar[data-dirty="true"] { display: flex; }
.settings-dirtybar .dirty-msg { font-size: 13px; font-weight: 500; color: var(--fg); margin-right: auto; }
/* .settings-btn/.settings-btn-primary/.settings-btn-ghost moved to navbar-html (see above). */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settings-avatar-randomize { transition: none; }
}
@media (max-width: 860px) {
  .settings-body { grid-template-columns: 1fr; gap: 24px; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings-nav a { border-left: none; border-bottom: 2px solid transparent; }
  .settings-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .settings-profile { grid-template-columns: 1fr; justify-items: start; }
  .settings-form-row { grid-template-columns: 1fr; }
}

/* ── Sitemap viewer ─────────────────────────────────────────────── */
.sitemap-page { max-width: 880px; }
.sitemap-page > .sub { margin-bottom: 16px; }
.sitemap-controls { display: flex; gap: 8px; margin-bottom: 24px; }
.sitemap-controls button {
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--invela-white); color: var(--fg);
  border: 1px solid var(--border); cursor: pointer;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.sitemap-controls button:hover { border-color: var(--accent); color: var(--accent); }
.sitemap-list { display: flex; flex-direction: column; gap: 12px; }

.sitemap-surface {
  background: var(--invela-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sitemap-surface > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 14px 18px; display: flex; align-items: center; gap: 10px;
}
.sitemap-surface > summary::-webkit-details-marker { display: none; }
.sitemap-surface > summary::before {
  content: ''; width: 10px; height: 10px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M3 2l4 4-4 4" stroke="currentColor" fill="none" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M3 2l4 4-4 4" stroke="currentColor" fill="none" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
  color: var(--fg-muted); transition: transform 120ms;
}
.sitemap-surface[open] > summary::before { transform: rotate(90deg); }
.sitemap-surface .surface-name { font-size: 14px; font-weight: 700; color: var(--fg); }
.sitemap-surface .surface-mount { font-size: 12px; color: var(--fg-muted); font-family: var(--font-mono, ui-monospace, monospace); }
.sitemap-surface .surface-meta { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.sitemap-surface .pill {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-alt, #ecf2fd); color: var(--accent);
}
.sitemap-surface .pill.warn { background: #FEF3C7; color: #92400E; }
.sitemap-surface .pill.muted { background: #f1f5f9; color: var(--fg-muted); }

.sitemap-surface .surface-body {
  border-top: 1px solid var(--border);
  padding: 16px 18px;
}
.sitemap-routes {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
  margin-bottom: 16px;
  font-size: 12px;
}
.sitemap-routes .route-path {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--fg);
}
.sitemap-routes .route-meta {
  font-size: 10px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; gap: 6px; align-items: center; justify-content: flex-end;
}
.sitemap-routes .route-meta .route-tag {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sitemap-routes .route-meta .route-tag.internal {
  background: #FEF3C7; color: #92400E;
}
.sitemap-routes .route-meta .route-tag.dynamic {
  background: #ecf2fd; color: var(--accent);
}
.sitemap-head { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 14px; border-top: 1px dashed var(--border); }
.sitemap-head .head-pill {
  font-size: 11px; padding: 3px 8px; border-radius: var(--radius-sm);
  background: #f1f5f9; color: var(--fg-muted);
}
.sitemap-head .head-pill.ok { background: #DCFCE7; color: #166534; }
.sitemap-head .head-pill.miss { background: #FEE2E2; color: #991B1B; }

/* ── 404 ────────────────────────────────────────────────────────── */
.not-found { text-align: center; margin: 120px auto; padding: 0 24px; }
.not-found h1 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.not-found p { color: var(--fg-muted); font-size: 14px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; }
  .nav-left { gap: 8px; padding-right: 12px; margin-right: 12px; }
  .nav-brand svg { height: 18px; }
  .nav-app-name { font-size: 13px; }
  .nav-center a { padding: 6px 8px; font-size: 12px; }
  .nav-right { padding-left: 12px; margin-left: 12px; gap: 8px; }
  .acct-name { display: none; }
  .launcher { margin: 40px auto; }
  .login-left { padding: 36px 28px; }
  /* Stack columns at narrow widths so cards stay legible. */
  .tools-columns { grid-template-columns: 1fr; gap: 32px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .tools-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .nav-left { border-right: none; margin-right: 8px; padding-right: 8px; }
  .nav-sep { display: none; }
  .nav-app-name { display: none; }
  .tools-btn span:not(.chev):not(:first-child) { display: none; }
  .tools-panel { left: -8px; width: calc(100vw - 24px); }
  .nav-right { border-left: none; margin-left: 8px; padding-left: 8px; }
  .acct-panel { right: -8px; }
  .launcher h1 { font-size: 20px; }
}

/* ── Formerly inline style= attributes (#1766). Each rule carries the declarations the attribute did,
   last in the sheet so no earlier rule outranks it. Login: the morph webm is absolutely positioned and
   scaled to CROP to the logo region of its 1200x400 stage (offsets in the asset README); the page JS
   reveals the static SVG by setting opacity through the CSSOM, which still wins over these rules. */
.login-logo { position: relative; width: 190px; max-width: 60vw; margin: 0 0 34px; overflow: hidden; }
.login-static-svg { width: 100%; height: auto; display: block; }
#login-static { opacity: 0; transition: opacity .3s ease; }
#login-anim { position: absolute; left: -4.546%; top: -26.34%; width: 109.091%; height: 152.672%; transition: opacity .3s ease; }
.app-card-icon { background: #EEF2FF; }
.app-ext-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 9999px; background: #f1f5f9; color: #586273; margin-left: 8px; vertical-align: middle; }
/* The pod's stacked avatars: the first sits on top. */
.pod-avatar.pod-z-1 { z-index: 1; }
.pod-avatar.pod-z-2 { z-index: 2; }
.pod-avatar.pod-z-3 { z-index: 3; }
.pod-avatar.pod-z-4 { z-index: 4; }
.notif-empty { margin-top: 26px; border: 1px solid var(--line, #e3e8f0); border-radius: 16px; background: #fff; padding: 72px 24px; text-align: center; }
.notif-empty-icon { color: #94a3b8; display: flex; justify-content: center; margin-bottom: 14px; }
.notif-empty-title { font-size: 18px; font-weight: 700; color: #0f172a; }
.notif-empty-copy { margin: 6px auto 0; max-width: 420px; font-size: 14px; color: #64748b; line-height: 1.5; }
