/*
 * MAAI interface polish layer
 * Keeps responsive and accessibility refinements separate from the single-file app.
 */

:root {
  --control-height: 42px;
  --content-max: 1480px;
  --focus-ring: 0 0 0 3px var(--accent-glow-strong);
}

html {
  min-width: 320px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* --------------------------------------------------------------------------
   Landing-page art direction
   Airy agency-style editorial composition, using MAAI's evergreen + spark magenta.
   -------------------------------------------------------------------------- */
.lp-page {
  --lp-bg: #F7F7F2;
  --lp-alt: #f1f1ec;
  --lp-stage: #ededE6;
  --lp-ink: #0E2A1E;
  --lp-muted: #8f948c;
  --lp-panel: #ffffff;
  --lp-line: #DDE0D5;
  --lp-signal: #E62E6B;
  --lp-signal-hover: #FF7BA3;
  --lp-signal-ink: #ffffff;
  --lp-shadow: 0 24px 70px rgba(14, 42, 30, 0.08);
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: "Inter", "Segoe UI Variable Text", "Aptos", sans-serif;
}

.lp-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background: radial-gradient(720px 480px at 50% 12%, rgba(230, 46, 107, 0.1), transparent 70%);
}

.lp-page .lp-wrap,
.lp-page .lp-nav-inner { max-width: 1320px; }

.lp-page .lp-nav {
  background: color-mix(in srgb, var(--lp-bg) 88%, transparent);
  border-bottom-color: var(--lp-line);
  backdrop-filter: blur(20px) saturate(140%);
  transition: background .32s ease, border-color .32s ease, box-shadow .32s ease, padding .32s ease;
}

/* Scrolled state — the flat top bar detaches into a floating dark bar
   with softly rounded corners and margin around it. Toggled by JS on scroll. */
.lp-page .lp-nav.lp-nav-scrolled {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 12px 20px 0;
}
.lp-page .lp-nav.lp-nav-scrolled .lp-nav-inner {
  background: rgba(10, 32, 22, 0.82);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(247, 247, 242, 0.1);
  border-radius: 16px;
  padding: 12px 16px 12px 24px;
  box-shadow: 0 16px 40px rgba(10, 32, 22, 0.28);
}
/* Inside the floating bar everything reads light-on-dark regardless of page theme. */
.lp-page .lp-nav.lp-nav-scrolled .lp-brand-word,
.lp-page .lp-nav.lp-nav-scrolled .lp-nav-links a { color: #F7F7F2; }
.lp-page .lp-nav.lp-nav-scrolled .lp-nav-links a:hover { color: #FF7BA3; }
.lp-page .lp-nav.lp-nav-scrolled .lp-theme-toggle { color: rgba(247,247,242,0.75); }
.lp-page .lp-nav.lp-nav-scrolled .lp-theme-toggle:hover { color: #FF7BA3; }
.lp-page .lp-nav.lp-nav-scrolled .lp-lang-select { background: rgba(247,247,242,0.08); color: #F7F7F2; border-color: rgba(247,247,242,0.18); }
.lp-page .lp-nav.lp-nav-scrolled .lp-btn-ghost { color: #F7F7F2; border-color: rgba(247,247,242,0.35); background: transparent; }
.lp-page .lp-nav.lp-nav-scrolled .lp-btn-ghost:hover { background: rgba(247,247,242,0.12); border-color: rgba(247,247,242,0.6); }
@media (prefers-reduced-motion: reduce) {
  .lp-page .lp-nav { transition: none; }
}

.lp-page .lp-h1,
.lp-page .lp-h2,
.lp-page .lp-card h3,
.lp-page .lp-step-row h3,
.lp-page .lp-checkline { color: var(--lp-ink); }

/* The nav-bar "maai" wordmark follows the page theme (dark ink on a light
   page, light ink on a dark page). The FOOTER wordmark is intentionally
   NOT included here — it sits on the footer's own always-dark background,
   so it must stay white regardless of site theme (see
   .lp-footer .lp-brand-word{color:#fff} in index.html, which this must not
   fight with an equal-specificity, later-loaded rule). */
.lp-page .lp-nav .lp-brand-word { color: var(--lp-ink); }

.lp-page .lp-brand-word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.lp-page .lp-nav-links { gap: 28px; }
.lp-page .lp-nav-links a { color: var(--lp-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.015em; }
.lp-page .lp-nav-links a:hover { color: var(--lp-signal); }
.lp-page .lp-lang-select { background: var(--lp-panel); color: var(--lp-ink); border-color: var(--lp-line); }
.lp-page .lp-theme-toggle { color: var(--lp-muted); }
.lp-page .lp-theme-toggle:hover { color: var(--lp-signal); }

.lp-page .lp-btn { border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.015em; }
.lp-page .lp-btn-primary { background: var(--lp-signal); color: var(--lp-signal-ink); box-shadow: 0 10px 26px rgba(230,46,107,.24); }
.lp-page .lp-btn-primary:hover { background: var(--lp-signal-hover); color: var(--lp-signal-ink); }
.lp-page .lp-btn-ghost { color: var(--lp-ink); border-color: var(--lp-line); }
.lp-page .lp-btn-ghost:hover { background: rgba(230, 46, 107,0.12); color: var(--lp-signal); border-color: var(--lp-signal); }

.lp-page .lp-hero-full {
  background: linear-gradient(160deg, #0E2A1E 0%, #12291D 55%, #0A2016 100%);
}
.lp-page .lp-eyebrow { display:inline-flex; color: var(--lp-signal); background:transparent; border:0; border-left:2px solid var(--lp-signal); border-radius:0; padding:2px 0 2px 10px; font-size:9px; font-weight:700; letter-spacing:.08em; word-spacing:.18em; text-transform:uppercase; }
.lp-page .lp-h1 { max-width: 860px; font-size: clamp(52px, 5.9vw, 82px); font-weight: 600; line-height: 0.93; letter-spacing: -0.06em; }
/* The "hm" line — Fraunces italic answers where the Inter heading states. Rationed: one such line per section. */
.lp-page .lp-h1 em, .lp-page .lp-h2 em { font-family: "Fraunces", serif; font-style: italic; font-weight: 400; color: var(--lp-signal); }
.lp-page .lp-lead { color: var(--lp-muted); max-width: 520px; font-size: 14px; line-height: 1.72; }

/* Restore the landing entrance with a measured editorial cadence. The existing
   script supplies the reveal state and splits copy into words; these rules keep
   the motion calm instead of the previous abrupt/no-motion treatment. */
.lp-page.lp-motion-ready .lp-reveal {
  opacity:0;
  transform:translateY(22px);
  transition:opacity 1.05s cubic-bezier(.22,.8,.2,1), transform 1.05s cubic-bezier(.22,.8,.2,1);
  transition-delay:var(--lp-delay, 0ms);
  will-change:opacity, transform;
}
.lp-page.lp-motion-ready .lp-reveal.lp-revealed { opacity:1; transform:translateY(0); }
.lp-page.lp-motion-ready .lp-split-text .lp-split-word {
  display:inline-block;
  opacity:0;
  transform:translateY(.58em);
  transition:opacity .9s cubic-bezier(.22,.8,.2,1), transform .9s cubic-bezier(.22,.8,.2,1);
  transition-delay:calc(var(--lp-delay, 0ms) + var(--word-delay, 0ms));
  will-change:opacity, transform;
}
.lp-page.lp-motion-ready .lp-split-text .lp-split-word + .lp-split-word { margin-left:.28em; }
.lp-page.lp-motion-ready .lp-split-text.lp-revealed .lp-split-word { opacity:1; transform:translateY(0); }

.lp-page .lp-section { padding: 124px 0; }
.lp-page .lp-section.alt { background: var(--lp-alt); border-color: var(--lp-line); }
.lp-page .lp-workflows { background: var(--lp-bg); border-color: var(--lp-line); }
.lp-page .lp-workflows::after { display:none; }
.lp-page .lp-workflows-waves { display:none; }
.lp-page .lp-section-head { max-width: 820px; margin-inline: auto; }
.lp-page .lp-h2 { margin-bottom:20px; font-size: clamp(38px, 4.8vw, 64px); font-weight: 600; line-height:1; letter-spacing: -0.055em; }
.lp-page .lp-sub, .lp-page .lp-card p, .lp-page .lp-step-row p { color: var(--lp-muted); }
.lp-page .lp-steps-list, .lp-page .lp-card, .lp-page .lp-table-wrap, .lp-page .lp-quote, .lp-page .lp-faq-item { background: var(--lp-panel); border-color: var(--lp-line); border-radius: 12px; }
.lp-page .lp-card { min-height:210px; padding:30px; box-shadow:0 12px 38px rgba(28,35,61,.045); }
.lp-page .lp-card:hover { border-color: rgba(230, 46, 107,0.58); background: var(--lp-panel); box-shadow:0 22px 52px rgba(58,73,130,.11); transform:translateY(-4px); }
.lp-page .lp-card-ico, .lp-page .lp-check { background: rgba(230, 46, 107,0.11); color: var(--lp-signal); border-radius: 8px; }
.lp-page .lp-steps-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0; overflow:hidden; box-shadow:var(--lp-shadow); }
.lp-page .lp-step-row { min-height:190px; align-content:start; padding:34px; border-right:1px solid var(--lp-line); }
.lp-page .lp-step-row:nth-child(even) { border-right:0; }
.lp-page .lp-step-row { border-bottom-color: var(--lp-line); }
.lp-page .lp-step-num { color: var(--lp-signal); }
.lp-page .lp-workflows .lp-wrap { display:grid; grid-template-columns:minmax(260px,.78fr) minmax(0,1.22fr); gap:80px; align-items:start; }
.lp-page .lp-workflows .lp-section-head { position:sticky; top:112px; margin:0; text-align:left; }
.lp-page .lp-workflows .lp-grid-3 { grid-template-columns:1fr; gap:18px; }
.lp-page .lp-workflows .lp-card { min-height:230px; padding:34px; }
.lp-page .lp-table thead th { background: rgba(230, 46, 107,0.07); color: var(--lp-ink); }
.lp-page .lp-table th, .lp-page .lp-table td { border-bottom-color: var(--lp-line); color: var(--lp-muted); }
.lp-page .lp-table td:first-child { color: var(--lp-ink); }
.lp-page .lp-col-hl { background: rgba(230, 46, 107,0.07); }
.lp-page .lp-yes { color: var(--lp-signal); }
.lp-page .lp-quote { border-radius: 18px; padding:clamp(34px,5vw,72px); box-shadow:var(--lp-shadow); }
.lp-page .lp-quote p { color: var(--lp-ink); }
.lp-page .lp-faq-q { color: var(--lp-ink); }
.lp-page .lp-faq-q::after { color: var(--lp-signal); }
.lp-page .lp-faq-a { color: var(--lp-muted); }
.lp-page #lp-faq .lp-wrap { display:grid; grid-template-columns:minmax(240px,.72fr) minmax(0,1.28fr); gap:76px; align-items:start; }
.lp-page #lp-faq .lp-section-head { margin:0; text-align:left; }
.lp-page #lp-faq .lp-faq { max-width:none; }
.lp-page #lp-faq .lp-faq-item { margin-bottom:10px; box-shadow:none; }

.lp-trusted-tools { position: relative; padding: 84px 0 96px; overflow: hidden; border-top: 0; border-bottom: 1px solid var(--lp-line); background: var(--lp-bg); }
.lp-trusted-tools::before { content: ""; position: absolute; width: 520px; height: 520px; left: -260px; top: -330px; border-radius: 50%; background: rgba(230, 46, 107,0.12); filter: blur(18px); pointer-events: none; }
.lp-tools-intro { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 32px; align-items:end; margin-bottom: 46px; }
.lp-tools-intro .lp-eyebrow { grid-column: 1 / -1; margin-bottom: 0; justify-self:start; }
.lp-tools-intro .lp-h2 { margin:0; }
.lp-tools-intro .lp-sub { margin:0; }
.lp-tools-viewport { position:relative; width:100%; overflow:hidden; padding:8px 0; mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent); }
.lp-tools-track { display:flex; width:max-content; will-change:transform; animation:lp-tools-loop 28s linear infinite; }
.lp-tools-group { display:flex; gap:18px; padding-right:18px; }
.lp-tools-viewport:hover .lp-tools-track { animation-play-state:paused; }
.lp-tool { min-width:220px; min-height:104px; display:flex; align-items:center; justify-content:center; gap:11px; padding:22px 26px; border:1px solid var(--lp-line); border-radius:14px; color:var(--lp-ink); background:var(--lp-panel); box-shadow:0 12px 30px rgba(29,35,59,.04); font-size:14px; transition:background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease; }
.lp-tool:hover { background:color-mix(in srgb,var(--lp-panel) 88%,var(--lp-signal)); color:var(--lp-signal); border-color:rgba(230, 46, 107,.35); transform:translateY(-3px); }
.lp-tool-logo img { max-width:150px; max-height:40px; object-fit:contain; opacity:.92; }
.lp-tool-mark { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; border:1px solid currentColor; color:var(--lp-signal); font-size:9px; font-weight:800; letter-spacing:.04em; }
@keyframes lp-tools-loop { to { transform:translateX(-50%); } }

/* The final CTA band now sits inside a full-bleed image section (.lp-cta-full),
   which owns the background; so the band itself stays transparent there. This
   rule only styles any OTHER standalone use of .lp-cta-band. */
.lp-page .lp-cta-full .lp-cta-band { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.lp-page .lp-cta-full .lp-cta-band .lp-btn { background: #fff; color: var(--accent); }
.lp-page .lp-cta-full .lp-cta-band .lp-btn-ghost { background: transparent; color: #fff; }
.lp-page .lp-footer { --lp-footer-bg: #0A2016; background: var(--lp-footer-bg); border-top: 1px solid var(--lp-line); }
.lp-page .lp-footer a:hover { color: var(--lp-signal); }
/* The footer's newsletter button pairs with a 15px input, so it opts out of the
   global 11px/pill .lp-btn treatment and matches the input's radius instead. */
.lp-page .lp-footer-signup-row .lp-btn { border-radius: 10px; padding: 11px 20px; font-size: 15px; }
.lp-page .lp-footer h5 { color: #fff; }

body:not(.light) .lp-page { --lp-bg:#0A2016; --lp-alt:#0E241A; --lp-stage:#12291D; --lp-ink:#F7F7F2; --lp-muted:#a9b0a5; --lp-panel:#12291D; --lp-line:rgba(247,247,242,.11); --lp-shadow:0 24px 70px rgba(0,0,0,.24); }
body:not(.light) .lp-page .lp-tool-logo img { filter:brightness(0) invert(1) grayscale(1) contrast(1.1); }
body:not(.light) .lp-page .lp-footer { --lp-footer-bg:#081A12; }

@media (max-width: 860px) {
  .lp-page .lp-nav-links { display:none; }
  .lp-tools-intro { grid-template-columns:1fr; gap:14px; }
  .lp-page .lp-workflows .lp-wrap, .lp-page #lp-faq .lp-wrap { grid-template-columns:1fr; gap:42px; }
  .lp-page .lp-workflows .lp-section-head { position:static; }
  .lp-page .lp-steps-list { grid-template-columns:1fr; }
  .lp-page .lp-step-row { border-right:0; }
}

@media (max-width: 520px) {
  .lp-page .lp-nav-inner { gap:10px; }
  .lp-page .lp-nav-inner > div:last-child { gap:8px !important; }
  .lp-page .lp-lang-select { display:none; }
  .lp-page .lp-nav .lp-btn { padding-inline:15px; }
  .lp-page .lp-h1 { font-size:clamp(38px, 11vw, 48px); letter-spacing:-.05em; }
  .lp-page .lp-section { padding:72px 0; }
  .lp-trusted-tools { padding:56px 0; }
  .lp-tool { min-width:185px; min-height:88px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-tools-track { animation-play-state:paused; }
}

button,
[onclick] {
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
canvas {
  max-width: 100%;
}

.main,
.page,
.card,
.top-header-row,
.results-card-header,
.results-actions,
.toolbar,
.lp-wrap,
.lp-hero-grid > *,
.lp-grid-2 > *,
.lp-grid-3 > *,
.lp-grid-4 > * {
  min-width: 0;
}

h1,
h2,
h3,
h4,
.page-head-title,
.card-title,
.auth-title,
.lp-h1,
.lp-h2 {
  text-wrap: balance;
}

p,
.page-head-sub,
.card-subtitle,
.upload-mode-desc,
.gsc-pull-note,
.alert,
.toast-message {
  overflow-wrap: anywhere;
}

:where(button, [role="button"], input, select, textarea, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.main {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  scrollbar-gutter: stable;
}

#appRoot .page > h1,
#appRoot .page > div > h1 {
  font-size: clamp(23px, 2.1vw, 28px) !important;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

#appRoot .page > p,
#appRoot .page > div > p {
  max-width: 760px;
  line-height: 1.6;
}

.top-header {
  isolation: isolate;
}

.top-nav-item,
.nav-item,
.upload-mode-btn,
.btn,
.btn-glass,
.lp-btn,
.auth-role,
.auth-submit {
  min-height: var(--control-height);
  line-height: 1.2;
}

.btn,
.btn-glass,
.lp-btn,
.auth-submit {
  justify-content: center;
}

.btn:active,
.btn-glass:active,
.lp-btn:active,
.top-nav-item:active,
.upload-mode-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled,
.btn[aria-disabled="true"],
.upload-mode-btn:disabled,
.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

input,
select {
  min-height: 44px;
}

textarea {
  min-height: 96px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 82%, transparent);
  opacity: 1;
}

.card {
  padding: clamp(20px, 2.2vw, 28px);
}

.card-title {
  line-height: 1.3;
}

.upload-mode-toggle {
  max-width: 100%;
}

.upload-mode-btn {
  min-width: 0;
}

#uploadModeLogo {
  display: block;
  max-width: min(100%, 290px) !important;
}

.upload-zone {
  width: 100%;
}

.upload-text,
.upload-hint {
  max-width: 680px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lottie-loader-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border: 0;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.loading.active {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 6vw, 52px);
  overflow: hidden;
  border: 1px solid rgba(79, 178, 134, 0.42) !important;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 38%, rgba(79, 178, 134, 0.16), transparent 34%),
    linear-gradient(155deg, #12291D 0%, #0E2A1E 54%, #0A2016 100%);
  box-shadow:
    inset 0 1px 0 rgba(247, 247, 242, 0.06),
    0 18px 45px rgba(10, 32, 22, 0.18);
}

.loading.active .loading-text {
  position: relative;
  z-index: 1;
  color: #F7F7F2;
}

.maai-lottie-holder {
  /* The supplied loader animation is blue. Shift only that reusable loader
     artwork into the existing MAAI green family; white facial details remain
     neutral while the blue body/highlights become #4FB286-style greens. */
  filter: hue-rotate(-80deg) saturate(0.78) brightness(0.98);
}

.lottie-loader-frame-analysis {
  width: clamp(140px, 18vw, 176px);
  height: clamp(140px, 18vw, 176px);
}

.loading-inline .lottie-loader-frame {
  width: 148px;
  height: 148px;
}

.table-wrap {
  overscroll-behavior: contain;
}

.table-wrap td,
.table-wrap th {
  max-width: 340px;
  overflow-wrap: anywhere;
}

.table-wrap td:last-child {
  white-space: normal;
}

.table-wrap td:last-child .btn {
  margin: 2px;
}

.admin-subscription-control {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 270px;
}

.admin-subscription-control select {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.table-wrap td:last-child .admin-subscription-save {
  width: auto;
  min-width: 72px;
  min-height: 44px;
  margin: 0;
  padding-inline: 16px;
  justify-content: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
}

.modal-overlay {
  padding: 16px;
  overscroll-behavior: contain;
}

/* Per-dialog width comes from --modal-w so no modal needs an inline width that
   would then have to be fought with !important. */
.modal {
  width: 100% !important;
  max-width: min(var(--modal-w, 520px), 100%) !important;
  max-height: calc(100dvh - 32px);
  padding: clamp(20px, 4vw, 24px);
  scrollbar-gutter: stable;
}

.modal.workspace-modal {
  --modal-w: 940px;
}

.workspace-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.workspace-form-field-full {
  grid-column: 1 / -1;
}

.folder-color-picker {
  position: relative;
  min-width: 0;
}

.folder-color-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.folder-color-trigger:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.folder-color-trigger-caret {
  display: inline-flex;
  margin-left: auto;
  color: var(--text-muted);
}

.folder-color-trigger-caret .icon { width: 15px; height: 15px; }

.folder-color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--workspace-folder-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.folder-color-swatch .icon { width: 13px; height: 13px; }

.folder-color-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.folder-color-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.folder-color-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.folder-color-option:hover { background: var(--surface2); color: var(--text); }
.folder-color-option[aria-selected="true"] { background: var(--accent-subtle); color: var(--text); }

.folder-color-check { margin-left: auto; width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

.folder-color-menu-divider { height: 1px; margin: 6px 2px; background: var(--border); }

.folder-color-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 4px;
}

.folder-color-custom-picker-wrap {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
}

.folder-color-custom-picker-wrap input[type="color"] {
  width: 40px;
  height: 40px;
  margin: -5px;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.folder-color-custom-hex {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.folder-color-custom-error {
  margin: 2px 8px 0;
  color: var(--red, #e5484d);
  font-size: 11px;
}

.folder-color-trigger:focus-visible,
.folder-color-option:focus-visible,
.folder-color-custom-hex:focus-visible,
.folder-color-custom-picker-wrap input[type="color"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toast-region {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* The command menu's search sits flush in its own bordered row, so it opts out
   of the global input chrome (border, radius, padding, focus ring). */
.cmdk-search input,
.cmdk-search input:focus {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#draft-reader > div {
  width: min(100%, 824px);
}

.lp-page,
.auth-page {
  overscroll-behavior-y: contain;
}

.lp-nav-inner,
.lp-wrap {
  width: 100%;
}

.lp-hero-visual {
  overflow: visible;
}

.lp-hero-lottie {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: block;
  width: clamp(520px, 46vw, 680px);
  height: auto;
  max-width: none;
  aspect-ratio: 1072 / 574;
  transform: translateX(clamp(0px, 1.2vw, 18px));
  transform-origin: center;
  filter: drop-shadow(0 20px 28px rgba(10, 14, 40, 0.22));
}

.lp-card,
.lp-step-row,
.lp-faq-item,
.lp-quote,
.lp-cta-band {
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .main {
    max-width: none;
  }

  .sidebar {
    overscroll-behavior: contain;
  }

  .top-header {
    box-shadow: 0 1px 0 var(--border), 0 10px 28px rgba(15, 17, 21, 0.08);
  }

  .top-nav-item {
    min-height: 38px;
  }

  #appRoot .page [style*="grid-template-columns:repeat(auto-fit"],
  #appRoot .page [style*="grid-template-columns: repeat(auto-fit"],
  #appRoot .page [style*="grid-template-columns:repeat(auto-fill"],
  #appRoot .page [style*="grid-template-columns: repeat(auto-fill"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #appRoot .page [style*="align-items:end"] {
    align-items: stretch !important;
  }

  .opp-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .opp-keyword {
    flex-basis: calc(100% - 52px);
    overflow-wrap: anywhere;
  }

  .opp-meta,
  .opp-badges,
  .opp-right {
    flex-wrap: wrap;
  }

  .lp-hero-lottie {
    width: clamp(360px, 50vw, 500px);
    transform: translateX(clamp(0px, 1vw, 8px));
  }
}

@media (max-width: 640px) {
  :root {
    --control-height: 40px;
  }

  .main {
    padding: 14px 14px 30px;
  }

  .top-header {
    gap: 12px;
    margin-bottom: 22px;
    padding-block: 12px 14px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }

  .top-nav-item {
    min-width: 0;
    width: 100%;
    padding: 9px 5px;
    font-size: 11.5px;
    white-space: normal;
  }

  .top-nav-item:last-child {
    grid-column: span 2;
  }

  .page-head-title,
  #appRoot .page > h1,
  #appRoot .page > div > h1 {
    font-size: 22px !important;
  }

  .card {
    padding: 16px;
    border-radius: 10px;
  }

  #upload-card > div:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: start !important;
    gap: 12px !important;
  }

  .upload-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-bottom: 0;
  }

  .upload-mode-btn {
    padding: 9px 8px;
    font-size: 11.5px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #uploadModeLogo {
    justify-self: start;
    width: auto;
    height: 24px !important;
    margin-top: 2px;
  }

  .upload-mode-desc {
    margin: 0 0 16px;
  }

  .upload-zone {
    min-height: 188px;
    padding: 24px 16px;
  }

  .upload-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .upload-actions .btn,
  .results-actions .btn,
  .modal-actions .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    padding: 16px 10px;
  }

  .stat-value {
    font-size: 24px;
  }

  .topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topic-card,
  .funnel-head,
  .decision-card {
    padding: 16px;
  }

  .topic-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .opp-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .opp-filters .flt,
  .opp-filters select,
  .opp-filters input,
  .opp-filters input.flt-num {
    width: 100%;
    min-width: 0;
  }

  .opp-filters .flt-count {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal {
    width: 100% !important;
    max-height: calc(100dvh - 20px);
    border-radius: 14px 14px 10px 10px;
  }

  .workspace-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-form-field-full {
    grid-column: auto;
  }

  .modal [style*="grid-template-columns:1fr 1fr"],
  .modal [style*="grid-template-columns: 1fr 1fr"],
  .modal [style*="grid-template-columns:repeat(2"],
  .modal [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* display is restated so it also beats the :has(3+ actions) flex row. */
  .modal-actions:not(.modal-actions--split) {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-actions:not(.modal-actions--split) .btn {
    width: 100%;
  }

  #draft-reader > div {
    padding: 24px 18px 56px !important;
  }

  #draft-reader > div > div:first-child {
    gap: 12px;
    align-items: flex-start !important;
  }

  .toast-region {
    max-height: calc(100dvh - 20px);
  }

  .toast {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .lp-nav-inner,
  .lp-wrap {
    padding-inline: 18px;
  }

  .lp-nav-inner {
    gap: 12px;
  }

  .lp-logo {
    height: 24px;
  }

  .lp-nav-inner > div:last-child {
    gap: 8px !important;
  }

  .lp-theme-toggle {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .lp-nav .lp-btn {
    min-height: 38px;
    padding: 9px 17px;
  }

  .lp-hero {
    height: auto;
    min-height: calc(100svh - 67px);
    padding: 48px 0 38px;
    align-items: flex-start;
  }

  .lp-hero-grid {
    gap: 22px;
  }

  .lp-hero .lp-h1 {
    font-size: clamp(29px, 8.2vw, 34px);
    line-height: 1.07;
  }

  .lp-hero .lp-lead {
    line-height: 1.55;
  }

  .lp-hero-visual {
    height: clamp(230px, 38svh, 330px);
  }

  .lp-hero-lottie {
    width: min(92vw, 520px);
    transform: none;
  }

  .lp-section {
    padding: 52px 0;
  }

  .lp-section-head {
    margin-bottom: 28px;
  }

  .lp-step-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 18px;
  }

  .lp-card {
    padding: 21px;
  }

  .lp-quote {
    padding: 34px 22px;
    border-radius: 18px;
  }

  .lp-footer {
    padding: 46px 0 28px;
  }

  .auth-page {
    overflow-y: auto;
  }

  .auth-right {
    height: 100dvh;
    min-height: 0;
    padding: 56px 24px 18px;
    overflow-y: auto;
  }

  .auth-form-wrap {
    max-width: 420px;
    margin: auto 0;
  }
}

@media (max-width: 380px) {
  .top-header-name {
    font-size: 13px;
  }

  .top-nav-item {
    font-size: 11px;
  }

  .upload-mode-toggle,
  .stats-grid,
  .opp-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .opp-filters .flt-count {
    grid-column: auto;
  }

  .lp-cta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-cta-row .lp-btn {
    width: 100%;
  }

  .auth-roles {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #silk-bg,
  #workflows-waves-bg,
  #workspaceGradientWaves,
  #magicRingsCanvas,
  .lottie-loader-frame {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Auth direction: one credentials path, with an animated Log in / Sign up
   switch. Admin access is resolved by the server after authentication.
   -------------------------------------------------------------------------- */
.lp-nav-magnet {
  display: inline-grid;
  gap: 1px;
  min-height: 44px;
  padding: 6px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--text);
  font: inherit;
  line-height: 1.05;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lp-nav-magnet:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.lp-nav-magnet span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.lp-nav-magnet small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.auth-page .auth-left {
  width: 58%;
  align-items: center;
  padding: 48px clamp(34px, 5vw, 82px) 0;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}

.auth-page .auth-intro {
  position: relative;
  z-index: 3;
  max-width: 610px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-kicker {
  display: inline-flex;
  margin: 0 0 12px;
  color: #E62E6B;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-page .auth-desc-title {
  max-width: 580px;
  margin-bottom: 14px;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.auth-page .auth-desc {
  max-width: 570px;
  font-size: clamp(13px, 1.05vw, 15px);
}

/* Illustration sits directly under the centered heading block, not
   absolutely positioned/bleeding off-canvas — the animation is the visual
   anchor beneath the copy, matching how the eyebrow/title/lede above it
   are laid out. */
.auth-page .auth-illustration {
  position: absolute;
  z-index: 1;
  left: 50%;
  /* Keep the supplied sign-in illustration anchored to the page edge. */
  bottom: -50px;
  width: min(620px, 106%);
  height: min(55vh, 520px);
  max-width: none;
  max-height: none;
  margin: 0;
  background: url('/static/Illustrations/auth/login-illustration.svg') center bottom / contain no-repeat;
  border: none;
  box-shadow: none;
  filter: none;
  pointer-events: none;
  transform: translateX(-50%);
}

.auth-page .auth-illustration svg {
  display: none !important;
}

.auth-page .auth-right {
  width: 49%;
  padding-left: 12%;
}

.auth-page .auth-form-wrap {
  max-width: 390px;
}

.auth-mode-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: rgba(19, 35, 105, 0.15);
  isolation: isolate;
}

.auth-mode-tabs::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 32, 82, 0.2);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-mode-tabs[data-mode="signup"]::before {
  transform: translateX(100%);
}

.auth-mode-tab {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.25s ease;
}

.auth-mode-tab.active {
  color: #E62E6B;
}

.auth-form-stage {
  will-change: transform, opacity;
}

.auth-form-stage.auth-slide-forward {
  animation: authSlideForward 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-form-stage.auth-slide-back {
  animation: authSlideBack 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authSlideForward {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes authSlideBack {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

body:not(.light) .auth-kicker {
  color: #FF7BA3;
}

/* --------------------------------------------------------------------------
   Workspace: interactive #E62E6B dot field plus an asymmetric command layout.
   -------------------------------------------------------------------------- */
.workspace-dot-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

body.workspace-mode .workspace-dot-grid {
  display: block;
}

body.workspace-mode :is(#workspaceRoot, #appRoot) {
  position: relative;
  z-index: 1;
  background: transparent;
}

body.workspace-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 6%, rgba(230, 46, 107, 0.16), transparent 30%),
    radial-gradient(circle at 10% 92%, rgba(230, 46, 107, 0.09), transparent 34%),
    var(--bg);
}

body.workspace-mode .workspace-shell-sidebar,
body.workspace-mode #appRoot .sidebar,
body.workspace-mode #appRoot .top-header {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

body.workspace-mode .workspace-shell-main,
body.workspace-mode #appRoot .main {
  background: transparent;
}

.workspace-shell-header {
  margin-bottom: 22px;
  border-bottom: 0;
}

.workspace-board {
  display: grid;
  gap: 24px;
}

.workspace-command-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
  min-height: 320px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 32px 12px 32px 12px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--surface) 94%, var(--accent) 6%), color-mix(in srgb, var(--surface) 76%, transparent)),
    var(--surface);
  box-shadow: 0 28px 70px rgba(23, 34, 82, 0.12);
}

.workspace-command-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--workspace-hero-rule, rgba(230, 46, 107, 0.18)) 1px, transparent 1px);
  background-size: 78px 100%;
  mask-image: linear-gradient(90deg, transparent 28%, #000);
  pointer-events: none;
}

.workspace-command-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: clamp(34px, 5vw, 68px);
}

.workspace-command-kicker,
.workspace-section-kicker,
.workspace-rail-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.workspace-command-copy h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(34px, 4.1vw, 66px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.workspace-command-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

.workspace-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.workspace-command-visual {
  position: relative;
  min-height: 300px;
}

.workspace-command-core {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 46% 54% 50% 50%;
  background: linear-gradient(145deg, #E62E6B, #C4225A);
  color: #fff;
  box-shadow: 0 24px 54px rgba(230, 46, 107, 0.36);
  transform: translate(-50%, -50%) rotate(8deg);
  text-align: center;
}

.workspace-command-core > * {
  transform: rotate(-8deg);
}

.workspace-command-core .icon { width: 28px; height: 28px; margin-bottom: 2px; }
.workspace-command-core strong { font-size: 38px; line-height: 0.8; }
.workspace-command-core small { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.workspace-orbit {
  position: absolute;
  top: 50%;
  left: 48%;
  border: 1px solid rgba(230, 46, 107, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.workspace-orbit-one { width: 230px; height: 230px; }
.workspace-orbit-two { width: 330px; height: 330px; border-style: dashed; opacity: 0.6; }

.workspace-signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--border);
}

.workspace-signal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  min-height: 88px;
  padding: 18px 24px;
  border-right: 1px solid var(--border);
}

.workspace-signal:last-child { border-right: 0; }
.workspace-signal span { color: var(--text-muted); font-size: 11px; font-weight: 750; }
.workspace-signal strong { grid-row: 1 / span 2; grid-column: 2; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.05em; text-transform: capitalize; }
.workspace-signal button { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }

.workspace-overview-layout {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
  gap: 24px;
}

.workspace-library { min-width: 0; }

.workspace-main-head {
  align-items: end;
  margin: 10px 0 18px;
}

.workspace-main-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.04em;
}

.workspace-main-head > span {
  color: var(--text-muted);
  font-size: 12px;
}

.workspace-toolbar {
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.workspace-search,
.workspace-sort {
  border: 0;
  background: transparent;
}

.workspace-search:focus,
.workspace-sort:focus {
  box-shadow: none;
}

.workspace-growth-rail {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 30px;
  border-radius: 12px 30px 12px 30px;
  background: #151821;
  color: #fff;
  box-shadow: 0 24px 54px rgba(11, 14, 25, 0.2);
}

.workspace-growth-rail::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(230, 46, 107, 0.24);
  filter: blur(2px);
}

.workspace-growth-rail > * { position: relative; z-index: 1; }
.workspace-growth-rail h3 { margin: 0; font-size: 25px; line-height: 1.08; letter-spacing: -0.04em; }
.workspace-growth-rail > p { margin: 14px 0 22px; color: rgba(255, 255, 255, 0.65); font-size: 13px; line-height: 1.6; }
.workspace-rail-kicker { color: #FF7BA3; }

.workspace-rail-steps {
  display: grid;
  gap: 0;
  margin-bottom: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.workspace-rail-steps span {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.workspace-rail-steps b { color: #FF7BA3; font-size: 10px; }
.workspace-growth-rail .btn { width: 100%; }

.workspace-rail-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.workspace-rail-status span { display: inline-flex; gap: 6px; align-items: center; }
.workspace-rail-status .icon { width: 13px; height: 13px; }
.workspace-rail-status strong { color: #FF7BA3; }

.workspace-grid {
  gap: 16px;
}

.workspace-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--workspace-folder-color) 25%, var(--border));
  border-top: 4px solid var(--workspace-folder-color);
  border-radius: 10px 24px 24px 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.workspace-card::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -54px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--workspace-folder-color) 12%, transparent);
  pointer-events: none;
}

.workspace-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--workspace-folder-color) 58%, var(--border));
  box-shadow: 0 20px 46px rgba(23, 29, 57, 0.12);
}

.workspace-grid.grid .workspace-card:first-child {
  grid-column: 1 / -1;
  min-height: 260px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 28px 10px 28px 28px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--workspace-folder-color) 13%, var(--surface)), color-mix(in srgb, var(--surface) 88%, transparent));
}

.workspace-card h3 { font-size: 19px; }
.workspace-card p { max-width: 560px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.workspace-card-status {
  width: auto;
  height: 30px;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--workspace-folder-color) 28%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--workspace-folder-color) 9%, var(--surface));
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}

.workspace-card-status .icon { width: 13px; height: 13px; }
.workspace-repo-pill { max-width: 100%; background: transparent; padding-inline: 0; color: var(--text-secondary); }
.workspace-date-line { justify-content: space-between; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.workspace-actions { position: relative; z-index: 2; margin-top: 18px; }
.workspace-actions .btn-danger { margin-left: auto; opacity: 0.72; }

.admin-customer-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 12px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle, var(--bg));
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

/* Team invitation history keeps readable columns and scrolls as a table on
   narrow screens instead of forcing email addresses into vertical fragments. */
.team-invitations-card { min-width: 0; }
.team-invitations-wrap { max-height: none; }
.team-invitations-table { min-width: 900px; table-layout: auto; }
.team-invitations-table .team-invite-email { width: 25%; min-width: 220px; overflow-wrap: anywhere; line-height: 1.45; }
.team-invitations-table .team-invite-role { min-width: 100px; white-space: nowrap; }
.team-invitations-table .team-invite-status { min-width: 130px; white-space: nowrap; }
.team-invitations-table .team-invite-delivery { width: 42%; min-width: 330px; white-space: normal; }
.team-invitations-table .team-invite-actions { min-width: 110px; text-align: right; white-space: nowrap !important; }

/* Integration cards are real buttons, with consistent logo containment and a
   status row anchored to the bottom for clean mixed-content card heights. */
.integration-card {
  width: 100%;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.integration-card:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.integration-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.integration-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.integration-card-head > div { min-width: 0; }
.integration-card-status { margin-top: auto; font-size: 12px; color: var(--text-muted); }
.int-logo img.int-logo-square { width: 32px; height: 32px; max-width: 32px; object-fit: contain; }

.integration-detail-copy { margin-bottom: 16px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.outreach-tracker-card { max-width: 1040px; }
.outreach-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 10px; margin: 16px 0; }
.outreach-stat { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); }
.outreach-stat strong { display: block; font-size: 22px; line-height: 1.1; }
.outreach-stat span { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; text-transform: capitalize; }
.outreach-form { margin: 18px 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface2); }
.outreach-form h3 { margin: 0; font-size: 16px; }
.outreach-form > div:first-child > p { margin: 4px 0 14px; color: var(--text-muted); font-size: 13px; }
.outreach-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.outreach-form-grid label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.outreach-form-grid input,
.outreach-form-grid select,
.outreach-form-grid textarea { width: 100%; }
.outreach-notes { grid-column: 1 / -1; }
#outreach-result:not(:empty) { margin: 12px 0; }
.outreach-table-wrap { margin: 18px 0; }
.outreach-table-wrap table { min-width: 800px; }
.outreach-url { max-width: 280px; margin-top: 4px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.outreach-empty { display: flex; align-items: center; gap: 12px; margin: 18px 0; padding: 20px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted); }
.outreach-empty > span { display: inline-flex; color: var(--accent); }
.outreach-empty .icon { width: 24px; height: 24px; }
.outreach-empty strong { color: var(--text); }
.outreach-empty p { margin: 4px 0 0; font-size: 13px; }

@media (max-width: 700px) {
  .team-invitations-table { min-width: 820px; }
  .outreach-stat-grid { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
  .outreach-form-grid { grid-template-columns: 1fr; }
  .outreach-notes { grid-column: auto; }
}

.admin-customer-select-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.admin-customer-select-cell input[type="checkbox"] {
  display: block;
  margin: 0 auto;
  cursor: pointer;
}
.workspace-card.is-selected::before { content: "Current"; position: absolute; right: 20px; bottom: 18px; color: var(--workspace-folder-color); font-size: 9px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }

.workspace-grid.list .workspace-card {
  grid-template-columns: minmax(280px, 1fr) auto;
  min-height: 0;
  border-top-width: 1px;
  border-left: 4px solid var(--workspace-folder-color);
  border-radius: 10px 20px 20px 10px;
}

.workspace-grid.list .workspace-date-line,
.workspace-grid.list .workspace-repo-pill { display: none; }
.workspace-grid.list .workspace-actions { margin: 0; align-items: center; }
.workspace-grid.details .workspace-card { border-radius: 18px; }

.workspace-empty {
  padding: 70px 26px;
  border-radius: 28px 10px 28px 10px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.workspace-empty h2 { margin: 0 0 9px; font-size: 24px; }
.workspace-empty p { max-width: 590px; margin: 0 auto 22px; color: var(--text-muted); line-height: 1.65; }

/* Give the selected workspace its own editorial rhythm instead of repeating
   the exact same card treatment on every feature page. */
body.workspace-mode #appRoot .page > .card {
  box-shadow: none;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.workspace-mode #appRoot .page > .card:first-of-type {
  border-radius: 26px 10px 26px 26px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), color-mix(in srgb, var(--surface) 82%, transparent));
}

body.workspace-mode #appRoot .page > .card:nth-of-type(even) {
  border-left: 3px solid color-mix(in srgb, var(--accent) 62%, var(--border));
  border-radius: 10px 20px 20px 10px;
}

@media (max-width: 1100px) {
  .auth-page .auth-desc-title { font-size: 35px; }
  .auth-page .auth-illustration { bottom:-42px; width: min(520px, 104%); height: min(50vh, 460px); }
  .workspace-command-hero { grid-template-columns: minmax(0, 1fr) 260px; }
  .workspace-overview-layout { grid-template-columns: 1fr; }
  .workspace-growth-rail { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr); gap: 12px 28px; }
  .workspace-growth-rail > p { grid-column: 1; }
  .workspace-rail-steps { grid-column: 2; grid-row: 1 / span 3; }
  .workspace-growth-rail > .btn { width: max-content; }
  .workspace-rail-status { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .lp-nav-magnet small { display: none; }
  .lp-nav-magnet { display: inline-flex; align-items: center; padding-inline: 10px; }
  .auth-page { overflow-y: auto; }
  .auth-page .auth-right { width: 100%; padding-left: 24px; overflow-y: auto; }
  .workspace-command-hero { grid-template-columns: 1fr; min-height: 0; }
  .workspace-command-visual { display: none; }
  .workspace-command-copy { padding: 34px 26px; }
  .workspace-command-copy h2 { font-size: clamp(34px, 10vw, 52px); }
  .workspace-signal-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-signal:nth-child(2) { border-right: 0; }
  .workspace-signal:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .workspace-growth-rail { display: block; }
  .workspace-growth-rail > .btn { width: 100%; }
}

@media (max-width: 620px) {
  .lp-nav-magnet { display: none; }
  .workspace-command-hero { border-radius: 22px 8px 22px 8px; }
  .workspace-command-copy { padding: 28px 21px; }
  .workspace-command-copy p { font-size: 13px; }
  .workspace-command-actions { display: grid; }
  .workspace-signal { min-height: 76px; padding: 14px; }
  .workspace-signal strong { font-size: 22px; }
  .workspace-toolbar-right { display: grid; grid-template-columns: 1fr auto; }
  .workspace-card { padding: 18px; }
  .workspace-card-head { display: grid; }
  .workspace-card-status { justify-self: start; }
  .workspace-actions .btn-danger { margin-left: 0; }
  .workspace-grid.grid .workspace-card:first-child { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-dot-grid { opacity: 0.72; }
  .auth-form-stage { animation: none !important; }
}

/* --------------------------------------------------------------------------
   Workspace hub: compact operations layout with a fixed rail, top context,
   intent field, quick actions, and a four-column library.
   -------------------------------------------------------------------------- */
body.workspace-mode .workspace-dot-grid { display:block; opacity:.68; }
body.workspace-mode::before { background:var(--bg); }
body.workspace-mode .workspace-shell { grid-template-columns:218px minmax(0,1fr); background:transparent; }
body.workspace-mode .workspace-shell-sidebar { padding:12px 10px; border-right:1px solid var(--border); background:var(--surface); backdrop-filter:none; }
body.workspace-mode .workspace-shell-brand { min-height:46px; margin:0 4px 12px; padding:0 6px 12px; }
body.workspace-mode .workspace-shell-brand-mark { width:27px; height:27px; }
body.workspace-mode .workspace-shell-brand-copy strong { font-size:17px; }
body.workspace-mode .workspace-shell-brand-copy > span { font-size:9px; }
body.workspace-mode .workspace-shell-nav { gap:3px; }
body.workspace-mode .workspace-nav-group { display:grid; gap:3px; padding:8px 0; border-bottom:1px solid var(--border); }
body.workspace-mode .workspace-nav-group:last-child { border-bottom:0; }
body.workspace-mode .workspace-nav-group-label { padding:0 10px 3px; color:var(--text-muted); font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
body.workspace-mode .workspace-shell-nav a { min-height:36px; padding:0 10px; border-radius:6px; font-size:12px; font-weight:650; }
body.workspace-mode .workspace-shell-nav a.active { box-shadow:none; }
body.workspace-mode .workspace-shell-sidebar-foot { padding:10px 4px 0; }
body.workspace-mode .workspace-shell-main { position:relative; isolation:isolate; padding:0 28px 42px; background:#000; }
body.workspace-mode .workspace-gradient-waves { position:absolute; top:0; right:0; bottom:auto; left:0; z-index:-1; display:block; width:100%; min-height:100%; height:100%; pointer-events:none; }
body.workspace-mode .workspace-gradient-waves--fallback { background:radial-gradient(ellipse 72% 58% at 56% 76%,rgba(230,46,107,.72),rgba(230,46,107,.14) 48%,transparent 72%),#000; }
body.workspace-mode .workspace-shell-header,
body.workspace-mode .workspace-shell-content { position:relative; z-index:1; }
body.light.workspace-mode .workspace-shell-main { background:var(--bg); }
body.light.workspace-mode .workspace-gradient-waves { opacity:.18; }
body.workspace-mode .workspace-shell-header { min-height:58px; margin:0 -28px 24px; padding:0 28px; border-bottom:1px solid var(--border); background:var(--surface); }
body.workspace-mode .workspace-shell-header h1 { font-size:15px; font-weight:750; }
body.workspace-mode .workspace-shell-header p { display:none; }
body.workspace-mode .workspace-shell-header-actions .btn { min-height:32px; padding:6px 11px; font-size:12px; }
body.workspace-mode .workspace-shell-header-actions .workspace-logout-btn .icon { color:var(--red); }

/* Keep the in-workspace app rail as compact as the workspace-home rail. */
body.workspace-mode #appRoot .sidebar { width:218px; padding:12px 0; border-right-color:var(--border); background:var(--surface); backdrop-filter:none; -webkit-backdrop-filter:none; }
body.workspace-mode #appRoot .sidebar.collapsed { width:60px; }
body.workspace-mode #appRoot .sidebar-logo { min-height:58px; margin-bottom:10px; padding:4px 12px 12px; }
body.workspace-mode #appRoot .sidebar-logo-lockup { gap:8px; }
body.workspace-mode #appRoot .sidebar-logo-lockup > .maai-wordmark { font-size:17px; }
body.workspace-mode #appRoot .sidebar-toggle { top:10px; right:10px; width:24px; height:24px; }
body.workspace-mode #appRoot .sidebar-feature-tools { padding:0 8px 8px; }
body.workspace-mode #appRoot .sidebar-feature-search { min-height:34px; padding:0 8px; border-radius:7px; }
body.workspace-mode #appRoot .sidebar-groups { padding-bottom:8px; }
body.workspace-mode #appRoot .sidebar-groups .nav-group { margin-bottom:5px; }
body.workspace-mode #appRoot .sidebar-groups .nav-group-header { padding-top:6px; padding-bottom:4px; }
body.workspace-mode #appRoot .sidebar-groups .nav-group--flat { margin:0; padding:3px 0; }
body.workspace-mode #appRoot .sidebar-groups .nav-group--flat + .nav-group--flat { border-top:1px solid var(--border); }
body.workspace-mode #appRoot .sidebar-groups .nav-group--flat .nav-group-body-inner { display:grid; gap:1px; }
body.workspace-mode #appRoot .nav-item { min-height:36px; padding:8px 10px; margin:1px 8px; gap:10px; border-radius:6px; font-size:12px; }
body.workspace-mode #appRoot .nav-icon { width:18px; }
body.workspace-mode #appRoot .nav-icon .icon { width:17px; height:17px; }
body.workspace-mode #appRoot .sidebar.collapsed .sidebar-logo { min-height:58px; padding:6px 4px 12px; }
body.workspace-mode #appRoot .sidebar.collapsed .nav-item { justify-content:center; gap:0; padding:8px 0; margin:1px 8px; }
body.workspace-mode #appRoot .sidebar.collapsed .nav-icon { width:100%; }
body.workspace-mode #appRoot .sidebar-footer { padding:9px 8px; }
body.workspace-mode #appRoot .sidebar-profile { padding:6px 8px; border-radius:8px; }
body.workspace-mode #appRoot .sidebar-profile-avatar { width:29px; height:29px; font-size:11px; }
body.workspace-mode #appRoot .sidebar-profile-name { font-size:12px; }
body.workspace-mode #appRoot .sidebar-profile-sub { font-size:10px; }
body.workspace-mode .workspace-shell-content { max-width:1280px; }

.workspace-reference-hub { display:grid; gap:24px; padding-bottom:28px; }

.workspace-context-bar { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:94px; padding:18px 26px; border:1px solid var(--border); border-radius:18px; background:var(--surface); }
.workspace-context-main, .workspace-context-stats { display:flex; align-items:center; min-width:0; }
.workspace-context-main { gap:14px; }
.workspace-context-mark { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:10px; background:var(--accent-subtle); color:var(--accent); }
.workspace-context-mark > .icon { width:21px; height:21px; }
.workspace-context-mark .workspace-icon { width:38px; height:38px; border-radius:10px; }
.workspace-context-main > div { min-width:0; display:grid; gap:3px; }
.workspace-context-main strong { overflow:hidden; color:var(--text); font-size:15px; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.workspace-context-main > div > span { overflow:hidden; color:var(--text-muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.workspace-context-switch { display:inline-flex; align-items:center; gap:5px; margin-left:8px; padding:7px 4px; border:0; background:transparent; color:var(--text-muted); font:inherit; font-size:11px; cursor:pointer; white-space:nowrap; }
.workspace-context-switch:hover { color:var(--accent); }
.workspace-context-switch .icon { width:13px; height:13px; }
.workspace-context-stats { justify-content:flex-end; gap:18px; color:var(--text-muted); font-size:11px; white-space:nowrap; }
.workspace-context-stats b { color:var(--text); font-size:12px; }
.workspace-context-profile { display:flex; align-items:center; gap:9px; min-height:46px; padding:5px 12px 5px 6px; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:inherit; font:inherit; cursor:pointer; }
.workspace-context-profile:hover, .workspace-context-plan:hover { border-color:var(--accent); }
.workspace-context-avatar { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; overflow:hidden; border-radius:50%; background:var(--accent-subtle); color:var(--accent); font-size:11px; font-weight:800; }
.workspace-context-avatar img { width:100%; height:100%; object-fit:cover; }
.workspace-context-greeting-copy { display:grid; gap:1px; text-align:left; }
.workspace-context-greeting-copy strong { color:var(--text); font-size:11px; font-weight:800; }
.workspace-context-greeting-copy small { color:var(--text-muted); font-size:9px; }
.workspace-context-plan { min-height:36px; padding:7px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text-secondary); font:inherit; font-size:11px; cursor:pointer; white-space:nowrap; }

.workspace-intent-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(310px,.9fr); align-items:center; gap:22px; padding:20px 24px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.workspace-intent-panel > div { display:grid; gap:4px; }
.workspace-intent-panel strong { font-size:14px; letter-spacing:-.015em; }
.workspace-intent-panel > div > span { color:var(--text-muted); font-size:12px; line-height:1.45; }
.workspace-intent-entry { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:42px; padding:0 12px 0 14px; border:1px solid var(--border); border-radius:7px; background:var(--surface2); color:var(--text-muted); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.workspace-intent-entry:hover { border-color:var(--accent); color:var(--text-secondary); }
.workspace-intent-entry .icon { width:17px; height:17px; color:var(--accent); }

.workspace-reference-section-head { display:flex; align-items:end; justify-content:space-between; gap:16px; margin:0 0 12px; }
.workspace-reference-section-head > div { display:grid; gap:4px; }
.workspace-reference-section-head > div > span { color:var(--text-muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.workspace-reference-section-head h2 { margin:0; font-size:17px; letter-spacing:-.025em; }
.workspace-reference-section-head > span { color:var(--text-muted); font-size:11px; }
/* ── Workflow story carousel ("Quick start", compact — Overview/Dashboard) ──
   Deliberately small and secondary: 160-200px tall, illustration ~38%, never
   the dominant element on the page. See PRD v2 "Workspace Home + Compact
   Carousel". Image centering uses the standalone `translate`/`scale`
   properties (not `transform`) so the constant centering offset and the
   crossfade scale animation don't fight over the same property. */
.workflow-carousel { position:relative; min-height:180px; max-height:200px; display:grid; grid-template-columns:minmax(0,.38fr) minmax(0,.62fr); overflow:hidden; border:1px solid var(--border); border-radius:9px; background:var(--surface); }
.workflow-carousel-art { position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; background:var(--surface); padding:10px; }
.workflow-carousel-bg-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.workflow-carousel-img { position:absolute; z-index:1; top:50%; left:50%; translate:-50% -50%; max-width:90%; max-height:90%; width:auto; height:auto; object-fit:contain; object-position:center; opacity:0; scale:0.98; transition:opacity .9s ease, scale .9s ease; pointer-events:none; }
.workflow-carousel-img.is-active { opacity:1; scale:1; }
.workflow-carousel-copy { position:relative; padding:16px 20px; }
.workflow-carousel-slide { position:absolute; top:16px; left:20px; right:20px; bottom:38px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; opacity:0; transition:opacity .9s ease; pointer-events:none; }
.workflow-carousel-slide.is-active { opacity:1; pointer-events:auto; }
.workflow-carousel-eyebrow { font-size:9px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; color:var(--accent); }
.workflow-carousel-slide h3 { margin:5px 0 4px; font-size:16px; line-height:1.2; letter-spacing:-.02em; color:var(--text); }
.workflow-carousel-slide p { margin:0 0 10px; color:var(--text-muted); font-size:12px; line-height:1.4; max-width:440px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }
.workflow-carousel-meta { position:absolute; left:20px; right:20px; bottom:14px; display:flex; align-items:center; gap:10px; }
.workflow-carousel-counter { font-size:11px; font-weight:700; color:var(--text-muted); font-variant-numeric:tabular-nums; flex-shrink:0; }
.workflow-carousel-progress { position:relative; flex:1; height:2px; border-radius:2px; background:var(--border); overflow:hidden; }
.workflow-carousel-progress-fill { position:absolute; inset:0; width:0%; background:var(--accent); border-radius:2px; }
@media (max-width:1100px) {
  .workflow-carousel { grid-template-columns:minmax(0,.32fr) minmax(0,.68fr); }
}
@media (max-width:620px) {
  .workflow-carousel { grid-template-columns:1fr; min-height:0; max-height:none; }
  .workflow-carousel-art { min-height:96px; padding:8px; }
  .workflow-carousel-copy { min-height:158px; padding:14px 16px; }
  .workflow-carousel-slide { top:14px; left:16px; right:16px; bottom:34px; }
  .workflow-carousel-slide p { -webkit-line-clamp:2; }
  .workflow-carousel-meta { left:16px; right:16px; bottom:12px; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-carousel-img, .workflow-carousel-slide { transition:opacity .2s linear; scale:1 !important; }
}

.workspace-reference-library { min-width:0; overflow:visible; }
.workspace-personal-greeting { min-height:48px; margin:0 0 18px; }
.workspace-personal-greeting h2 { margin:0; color:var(--text); font-size:18px; font-weight:750; line-height:1.3; letter-spacing:-.02em; }
.workspace-personal-greeting p { margin:4px 0 0; color:var(--text-muted); font-size:12px; line-height:1.45; }
.workspace-personal-greeting.is-loading { display:grid; align-content:center; gap:7px; }
.workspace-personal-greeting.is-loading span,
.workspace-personal-greeting.is-loading small { display:block; border-radius:999px; background:var(--surface2); }
.workspace-personal-greeting.is-loading span { width:min(220px,62vw); height:16px; }
.workspace-personal-greeting.is-loading small { width:min(300px,76vw); height:10px; }
.workspace-library-head { margin-bottom:12px; }
.workspace-reference-toolbar { position:relative; z-index:30; min-height:44px; margin-bottom:14px; padding:4px 7px 4px 12px; overflow:visible; border-radius:8px; background:var(--surface); }
.workspace-reference-toolbar .workspace-layout-menu { z-index:31; }
.workspace-reference-toolbar .workspace-layout-popover { top:calc(100% + 8px); z-index:40; width:180px; }
.workspace-reference-toolbar .workspace-search { min-height:34px; font-size:12px; }
.workspace-reference-toolbar .workspace-sort { min-height:34px; font-size:12px; }
#workspaceGridHost { position:relative; z-index:1; }
.workspace-reference-hub .workspace-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.workspace-reference-hub .workspace-grid.grid .workspace-card:first-child { grid-column:auto; min-height:0; padding:104px 16px 16px; border-radius:9px; background:var(--surface); }
.workspace-reference-hub .workspace-card { min-height:0; padding:104px 16px 16px; border:1px solid var(--border); border-top:0; border-radius:9px; background:var(--surface); box-shadow:none; }
.workspace-reference-hub .workspace-card::after { top:0; right:0; bottom:auto; left:0; z-index:0; width:auto; height:88px; border-radius:0; background:linear-gradient(125deg,color-mix(in srgb,var(--workspace-folder-color) 36%,var(--surface2)),color-mix(in srgb,var(--workspace-folder-color) 8%,var(--surface))); }
.workspace-reference-hub .workspace-card-gradient-art { position:absolute !important; z-index:1 !important; top:0; left:0; width:100%; height:88px; opacity:.04; object-fit:cover; object-position:center; pointer-events:none; mix-blend-mode:screen; }
.workspace-reference-hub .workspace-card > * { position:relative; z-index:2; }
.workspace-reference-hub .workspace-card:hover { transform:translateY(-2px); border-color:color-mix(in srgb,var(--workspace-folder-color) 52%,var(--border)); box-shadow:0 12px 26px rgba(0,0,0,.12); }
.workspace-reference-hub .workspace-card-head { display:block; }
.workspace-reference-hub .workspace-card-main { display:block; }
.workspace-reference-hub .workspace-card-main .workspace-icon { position:absolute; top:-87px; left:0; width:33px; height:33px; border-radius:8px; background:rgba(255,255,255,.76); color:var(--workspace-folder-color); box-shadow:0 8px 20px rgba(0,0,0,.1); }
.workspace-reference-hub .workspace-card h3 { font-size:14px; }
.workspace-reference-hub .workspace-card p { margin-top:5px; font-size:11px; -webkit-line-clamp:2; }
.workspace-reference-hub .workspace-card-head > div:last-child { position:absolute; top:-90px; right:0; }
.workspace-reference-hub .workspace-pin-button { display:inline-grid; justify-items:center; align-items:end; width:36px; height:36px; padding:0 0 4px; border:1px solid rgba(255,255,255,.72); border-radius:8px; background:rgba(255,255,255,.76); color:var(--workspace-folder-color); cursor:pointer; }
.workspace-reference-hub .workspace-pin-button .icon { width:16px; height:16px; transform:rotate(35deg); transition:transform .16s ease; }
.workspace-reference-hub .workspace-pin-button.is-pinned .icon { transform:rotate(0deg); }
.workspace-reference-hub .workspace-pin-button:hover { border-color:var(--workspace-folder-color); background:#fff; }
.workspace-reference-hub .workspace-pin-button:focus-visible { outline:3px solid color-mix(in srgb,var(--workspace-folder-color) 42%,transparent); outline-offset:2px; }
.workspace-reference-hub .workspace-pin-button:disabled { cursor:wait; opacity:.62; }
.workspace-reference-hub .workspace-card-status { width:24px; height:24px; padding:0; overflow:hidden; color:var(--workspace-folder-color); background:rgba(255,255,255,.75); border:0; font-size:0; }
.workspace-reference-hub .workspace-card-status .icon { width:13px; height:13px; }
.workspace-reference-hub .workspace-card-menu { display:none; }
.workspace-reference-hub .workspace-repo-pill { margin-top:12px; font-size:10px; }
.workspace-reference-hub .workspace-date-line { display:grid; gap:3px; margin-top:11px; padding-top:10px; font-size:10px; }
.workspace-reference-hub .workspace-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:12px; }
.workspace-reference-hub .workspace-actions .btn { min-height:26px; padding:4px 7px; font-size:10px; }
.workspace-reference-hub .workspace-actions .btn-danger { margin-left:0; }
.workspace-reference-hub .workspace-card.is-selected::before { top:9px; right:9px; bottom:auto; z-index:2; padding:3px 5px; border-radius:4px; background:rgba(255,255,255,.78); font-size:8px; }

/* Compact full-width rows for users who prefer a table-like workspace view. */
.workspace-reference-hub .workspace-grid.table { grid-template-columns:1fr; gap:8px; }
.workspace-reference-hub .workspace-grid.table .workspace-card {
  display:grid;
  grid-template-columns:minmax(220px,1.35fr) minmax(130px,.75fr) minmax(130px,.7fr) auto;
  align-items:center;
  gap:14px;
  min-height:0;
  padding:11px 13px;
  border-top:1px solid var(--border);
  border-left:4px solid var(--workspace-folder-color);
  border-radius:8px;
}
.workspace-reference-hub .workspace-grid.table .workspace-card::after,
.workspace-reference-hub .workspace-grid.table .workspace-card-gradient-art { display:none; }
.workspace-reference-hub .workspace-grid.table .workspace-card:hover { transform:translateX(2px); }
.workspace-reference-hub .workspace-grid.table .workspace-card-head,
.workspace-reference-hub .workspace-grid.table .workspace-card-main { display:flex; align-items:center; min-width:0; }
.workspace-reference-hub .workspace-grid.table .workspace-card-main { gap:10px; }
.workspace-reference-hub .workspace-grid.table .workspace-card-main .workspace-icon { position:static; flex:0 0 auto; width:34px; height:34px; }
.workspace-reference-hub .workspace-grid.table .workspace-card-main > div { min-width:0; }
.workspace-reference-hub .workspace-grid.table .workspace-card h3,
.workspace-reference-hub .workspace-grid.table .workspace-card p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-reference-hub .workspace-grid.table .workspace-card-head > div:last-child { position:static; flex:0 0 auto; margin-left:auto; }
.workspace-reference-hub .workspace-grid.table .workspace-repo-pill,
.workspace-reference-hub .workspace-grid.table .workspace-date-line,
.workspace-reference-hub .workspace-grid.table .workspace-actions { margin:0; }
.workspace-reference-hub .workspace-grid.table .workspace-date-line { gap:2px; padding:0; border:0; white-space:nowrap; }
.workspace-reference-hub .workspace-grid.table .workspace-actions { justify-content:flex-end; flex-wrap:nowrap; }
.workspace-reference-hub .workspace-grid.table .workspace-card.is-selected::before { display:none; }

@media (max-width:1100px) {
  .workspace-context-bar { align-items:flex-start; flex-direction:column; gap:14px; }
  .workspace-context-stats { width:100%; justify-content:flex-start; flex-wrap:wrap; }
  .workspace-reference-hub .workspace-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .workspace-reference-hub .workspace-grid.table { grid-template-columns:1fr; }
  .workspace-reference-hub .workspace-grid.table .workspace-card { grid-template-columns:minmax(200px,1fr) minmax(120px,.6fr) auto; }
  .workspace-reference-hub .workspace-grid.table .workspace-date-line { display:none; }
}
@media (max-width:920px) {
  body.workspace-mode .workspace-shell { display:block; }
  body.workspace-mode .workspace-shell-sidebar { position:sticky; top:0; z-index:45; }
  body.workspace-mode #appRoot .sidebar,
  body.workspace-mode #appRoot .sidebar.collapsed { width:min(84vw,320px); }
  body.workspace-mode .workspace-shell-nav { flex:1; display:flex; justify-content:flex-end; overflow-x:auto; }
  body.workspace-mode .workspace-nav-group { display:contents; }
  body.workspace-mode .workspace-nav-group-label { display:none; }
  body.workspace-mode .workspace-shell-main { padding:0 16px 30px; }
  body.workspace-mode .workspace-shell-header { margin:0 -16px 20px; padding:0 16px; }
  .workspace-intent-panel { grid-template-columns:1fr; gap:12px; }
  .workspace-reference-hub .workspace-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-reference-hub .workspace-grid.table { grid-template-columns:1fr; }
}
@media (max-width:620px) {
  .workspace-reference-hub .workspace-pin-button { width:44px; height:44px; }
  .workspace-context-bar { padding:16px; border-radius:14px; }
  .workspace-context-main { width:100%; flex-wrap:wrap; }
  .workspace-context-main > div { flex:1; }
  .workspace-context-switch { margin-left:52px; }
  .workspace-context-stats { gap:10px; }
  .workspace-context-profile { order:3; width:100%; }
  .workspace-reference-hub .workspace-grid { grid-template-columns:1fr; }
  .workspace-reference-hub .workspace-grid.table .workspace-card { grid-template-columns:1fr; align-items:start; }
  .workspace-reference-hub .workspace-grid.table .workspace-actions { justify-content:flex-start; flex-wrap:wrap; }
  .workspace-reference-toolbar { align-items:center; }
}

/* Dashboard: dense three-card work area with a dedicated activity rail. */
.dashboard-reference-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:20px; align-items:start; }
.dashboard-reference-main { display:grid; grid-template-columns:minmax(0,1.25fr) repeat(2,minmax(210px,.875fr)); gap:16px; min-width:0; }
.dashboard-reference-main > .dashboard-hero-card,
.dashboard-reference-main > .kpi-grid,
.dashboard-reference-main > #seoTrendCard,
.dashboard-reference-main > .dashboard-full-row { grid-column:1 / -1; margin:0; }
.dashboard-reference-main > .card { margin:0; }
.dashboard-choice-tile { display:flex; align-items:center; gap:12px; width:100%; padding:14px 16px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; text-align:left; cursor:pointer; font:inherit; color:inherit; box-sizing:border-box; transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.dashboard-choice-tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--accent); }
.dashboard-choice-tile-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.dashboard-choice-tile-text strong { font-size:13px; font-weight:700; color:var(--text); }
.dashboard-choice-tile-text small { font-size:11.5px; color:var(--text-muted); font-weight:500; }
.dashboard-choice-tile-arrow { flex:none; color:var(--text-muted); font-size:18px; line-height:1; }
.dashboard-reference-main > .kpi-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:12px !important; }
.dashboard-reference-main > .kpi-grid .kpi-card { min-height:116px; padding:16px !important; }
.dashboard-reference-main > .kpi-grid .kpi-icon { width:52px !important; height:52px !important; display:grid !important; place-items:center; flex-shrink:0; background:transparent !important; border-radius:0 !important; }
.dashboard-reference-main > .kpi-grid .kpi-metric-image { display:block; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 7px 10px rgba(34, 20, 96, .16)); }
.dashboard-reference-main > .kpi-grid .stat-value { font-size:27px !important; }
.dashboard-reference-main #dashboardStatusPieCard,
.dashboard-reference-main .dashboard-contribution-card,
.dashboard-reference-main .dashboard-queue-card,
.dashboard-reference-main .dashboard-ai-recs-card,
.dashboard-reference-main .dashboard-activity-card { grid-column:1 / -1; }
.dashboard-reference-main .dashboard-queue-card > div:first-child { align-items:flex-start !important; }
.dashboard-reference-main .dashboard-queue-card > div:first-child > div:last-child { flex-wrap:wrap; }
.dashboard-reference-main .dashboard-matched-chart-card { box-sizing:border-box; height:274px; }
.dashboard-reference-main .dashboard-contribution-card { overflow:hidden; }
.dashboard-reference-rail { position:static; display:grid; gap:16px; min-width:0; align-content:start; }
.dashboard-reference-rail > .card { margin:0; padding:18px !important; overflow:visible; }
.dashboard-reference-rail > .card > div[style*="grid-template-columns:repeat(auto-fit"] { grid-template-columns:1fr !important; }
/* A single short empty-state line inside a full-width card (e.g. AI
   Recommendations before any analysis has run) reads as "mostly blank" when
   left-aligned across the whole card width — center and cap it instead. */
.dashboard-empty-note { padding:28px 12px; color:var(--text-muted); font-size:13px; text-align:center; max-width:480px; margin:0 auto; }
.dashboard-health-card { display:flex; flex-direction:column; min-width:0; }
.dashboard-health-list { display:grid; gap:9px; }
.dashboard-health-item { display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.dashboard-health-item:last-child { border-bottom:0; }
.dashboard-health-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:var(--accent); background:var(--accent-subtle); }
.dashboard-health-icon.is-ready { color:var(--green); background:var(--green-glow); }
.dashboard-health-icon.is-action { color:var(--accent); background:var(--accent-subtle); }
.dashboard-health-icon .icon { width:15px; height:15px; }
.dashboard-health-item strong,
.dashboard-health-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-health-item strong { color:var(--text); font-size:12px; }
.dashboard-health-item small { margin-top:2px; color:var(--text-muted); font-size:10.5px; }
.dashboard-health-state { color:var(--text-muted); font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.dashboard-health-state.is-ready { color:var(--green); }
.dashboard-health-state.is-action { color:var(--accent); }
.dashboard-health-action { width:100%; margin-top:auto; padding-top:9px !important; padding-bottom:9px !important; }
.dashboard-priority-card { min-width:0; }
.dashboard-priority-card .card-title { margin-bottom:16px; }
.dashboard-priority-body { display:flex; flex:1; flex-direction:column; align-items:flex-start; }
.dashboard-priority-icon { display:grid; place-items:center; width:38px; height:38px; margin-bottom:15px; border-radius:11px; color:var(--accent); background:var(--accent-subtle); }
.dashboard-priority-icon--ready { color:var(--green); background:var(--green-glow); }
.dashboard-priority-icon .icon { width:18px; height:18px; }
.dashboard-priority-label { margin-bottom:6px; color:var(--accent); font-size:9px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.dashboard-priority-icon--ready + .dashboard-priority-label { color:var(--green); }
.dashboard-priority-body strong { color:var(--text); font-size:15px; line-height:1.25; letter-spacing:-.02em; }
.dashboard-priority-body p { margin:8px 0 16px; color:var(--text-muted); font-size:11.5px; line-height:1.5; }
.dashboard-priority-action { width:100%; margin-top:auto; padding-top:9px !important; padding-bottom:9px !important; }

/* Operations panel below integrations: a single calm, scroll-free right rail. */
.dashboard-rail-operations { display:grid; gap:16px; }
.dashboard-rail-spotlight { position:relative; min-height:148px; padding:16px; overflow:hidden; border:1px solid color-mix(in srgb,var(--accent) 36%,var(--border)); border-radius:12px; background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 28%,var(--surface2)),color-mix(in srgb,var(--accent-hover) 11%,var(--surface))); }
.dashboard-rail-spotlight-copy { position:relative; z-index:1; max-width:154px; display:grid; gap:6px; }
.dashboard-rail-kicker { color:var(--accent-hover); font-size:9px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.dashboard-rail-spotlight-copy strong { color:var(--text); font-size:15px; line-height:1.2; }
.dashboard-rail-spotlight-copy p { margin:0; color:var(--text-secondary); font-size:11px; line-height:1.45; }
.dashboard-rail-spotlight-action { display:inline-flex; align-items:center; justify-content:center; gap:5px; width:max-content; min-height:28px; margin-top:3px; padding:5px 9px; border:0; border-radius:7px; background:var(--accent); color:#fff; font:inherit; font-size:10px; font-weight:800; cursor:pointer; }
.dashboard-rail-spotlight-action:hover { background:var(--accent-hover); }
.dashboard-rail-spotlight-art { position:absolute; right:-12px; bottom:-17px; width:140px; height:154px; opacity:1; pointer-events:none; background:url('/static/Illustrations/dashboard/workspace-focus-laptop.png') right bottom / contain no-repeat; filter:drop-shadow(0 12px 14px rgba(15,17,21,.2)); }
.dashboard-rail-spotlight-art img { display:none; }
.dashboard-rail-calendar { padding:2px 2px 0; }
.dashboard-rail-section-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; color:var(--text); font-size:12px; }
.dashboard-rail-section-head > span { display:flex; color:var(--accent); }
.dashboard-rail-section-head .icon { width:15px; height:15px; }
.dashboard-rail-section-head button { width:20px; height:20px; padding:0; border:0; border-radius:50%; background:var(--accent-subtle); color:var(--accent); font-size:18px; line-height:1; cursor:pointer; }
.dashboard-rail-calendar-weekdays,
.dashboard-rail-calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; }
.dashboard-rail-calendar-weekdays { margin-bottom:4px; color:var(--text-muted); font-size:8px; font-weight:800; }
.dashboard-rail-calendar-days { row-gap:3px; }
.dashboard-rail-calendar-day { display:grid; place-items:center; width:23px; height:23px; margin:auto; border-radius:50%; color:var(--text-secondary); font-size:9px; font-variant-numeric:tabular-nums; }
.dashboard-rail-calendar-day.is-outside { color:color-mix(in srgb,var(--text-muted) 35%,transparent); }
.dashboard-rail-calendar-day.is-today { background:var(--accent); color:#fff; font-weight:800; box-shadow:0 4px 10px var(--accent-glow-strong); }
.dashboard-rail-work { padding-top:14px; border-top:1px solid var(--border); }
.dashboard-rail-work-list { display:grid; gap:7px; }
.dashboard-rail-work-item { display:grid; grid-template-columns:29px minmax(0,1fr) auto; align-items:center; gap:9px; width:100%; padding:8px; border:1px solid transparent; border-radius:9px; background:var(--surface2); color:var(--text); text-align:left; cursor:pointer; }
.dashboard-rail-work-item:hover { border-color:var(--accent); background:var(--accent-subtle); }
.dashboard-rail-work-icon { display:grid; place-items:center; width:29px; height:29px; border-radius:8px; color:var(--accent); background:var(--accent-subtle); }
.dashboard-rail-work-icon--ready { color:var(--green); background:var(--green-glow); }
.dashboard-rail-work-icon .icon { width:14px; height:14px; }
.dashboard-rail-work-item strong,
.dashboard-rail-work-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-rail-work-item strong { font-size:10.5px; line-height:1.25; }
.dashboard-rail-work-item small { margin-top:2px; color:var(--text-muted); font-size:9px; line-height:1.2; }
.dashboard-rail-work-arrow { color:var(--text-muted); font-size:18px; line-height:1; }

.dashboard-reference-main .dashboard-hero-card { min-height:252px; padding:22px 24px; border-radius:12px; }
.dashboard-reference-main .dashboard-hero-top { grid-template-columns:190px minmax(0,1fr); gap:20px; min-height:166px; margin-bottom:16px; }
.dashboard-reference-main .dashboard-hero-art { align-self:end; height:198px; justify-content:flex-start; overflow:hidden; }
.dashboard-reference-main .dashboard-hero-art::before { width:180px; height:180px; left:0; bottom:-16px; background:rgba(255,255,255,.12); }
.dashboard-reference-main .dashboard-hero-img { align-self:end; width:188px; height:198px; max-width:none; max-height:none; border-radius:0; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 16px 18px rgba(20,24,44,.22)); }
.dashboard-reference-main .dashboard-hero-copy { align-self:center; padding:6px 8px 0 0; }
.dashboard-reference-main .dashboard-hero-title { font-size:27px; }
.dashboard-reference-main .dashboard-hero-text { max-width:520px; font-size:13px; }
.dashboard-reference-main .dashboard-hero-status { margin-top:10px; padding:7px 11px; font-size:12px; }
.dashboard-reference-main .dashboard-hero-action { margin-top:12px; padding:9px 15px !important; }
.dashboard-reference-main .dashboard-hero-stats { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding-top:12px; }
.dashboard-reference-main .dashboard-hero-stats > div:last-child { grid-column:1 / -1; }
.dashboard-reference-main .dashboard-hero-stats > div > div:nth-child(2) { font-size:16px !important; }
.dashboard-reference-main .dashboard-hero-stats > div:last-child > div:nth-child(2) { font-size:12px !important; }
body.light .dashboard-reference-main .dashboard-hero-art::before { background:rgba(230, 46, 107,.1); }

@media (max-width:1360px) {
  .dashboard-reference-layout { grid-template-columns:1fr; }
  .dashboard-reference-main { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-reference-rail { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .dashboard-reference-main { grid-template-columns:1fr; }
  .dashboard-reference-main > .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .dashboard-reference-main .dashboard-queue-card,
  .dashboard-reference-main .dashboard-contribution-card,
  .dashboard-reference-main #dashboardStatusPieCard { grid-column:auto; }
  .dashboard-reference-main .dashboard-matched-chart-card { height:auto; }
  .dashboard-reference-rail { grid-template-columns:1fr; }
  .dashboard-reference-main .dashboard-hero-card { padding:18px; }
  .dashboard-reference-main .dashboard-hero-top { grid-template-columns:120px minmax(0,1fr); gap:8px; min-height:156px; }
  .dashboard-reference-main .dashboard-hero-art { height:164px; }
  .dashboard-reference-main .dashboard-hero-art::before { width:132px; height:132px; bottom:2px; }
  .dashboard-reference-main .dashboard-hero-img { width:130px; height:164px; }
  .dashboard-reference-main .dashboard-hero-title { font-size:22px; }
  .dashboard-reference-main .dashboard-hero-text { font-size:12px; line-height:1.45; }
  .dashboard-reference-main .dashboard-hero-status { display:none; }
  .dashboard-reference-main .dashboard-hero-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* --------------------------------------------------------------------------
   Auth page on short mobile viewports: the stacked sign-in/sign-up form was
   taller than common phone viewports (e.g. 375x667), forcing a scroll to
   reach the submit button and footer links. Compact the vertical rhythm so
   the whole form fits without scrolling; .auth-right keeps overflow-y:auto
   as a safety net for anything shorter still. Placed last so it wins over
   the base .auth-* rules above without needing !important.
   -------------------------------------------------------------------------- */
@media (max-height: 860px) and (max-width: 920px) {
  .auth-right { height: 100dvh; min-height: 0; padding: 40px 24px 12px; overflow-y: auto; }
  .auth-form-wrap { margin: auto 0; }
  .lp-back { margin-bottom: 8px; }
  .auth-title { font-size: 21px; margin-bottom: 2px; }
  .auth-sub { font-size: 12px; margin-bottom: 10px; }
  .auth-mode-tabs { margin-bottom: 10px; }
  .auth-mode-tab { min-height: 32px; }
  .auth-google-btn { padding: 8px 14px; }
  .auth-or { margin: 8px 0; }
  .auth-field { margin-bottom: 8px; }
  .auth-field label { margin-bottom: 2px; }
  .auth-submit { padding: 10px; min-height: 0; }
  .auth-foot { margin-top: 6px; font-size: 10.5px; }
}

/* Very short viewports (older/small phones, e.g. 320x568): the compact pass
   above still doesn't leave room for the secondary "sign in with an email
   code" link, so drop it here — password sign-in and the legal footer stay,
   the OTP path is still reachable once signed in via other entry points. */
@media (max-height: 600px) and (max-width: 920px) {
  .auth-right { padding: 28px 24px 10px; }
  .auth-title { font-size: 19px; }
  .auth-sub { font-size: 11.5px; margin-bottom: 8px; }
  #otpToggle { display: none; }
}

/* ============================================================================
   Everlab-inspired landing page redesign — new sections
   ========================================================================= */

.lp-hero-microcopy { margin-top: 14px; font-size: 12.5px; color: var(--lp-muted); }

/* ── 2. Trust strip ── */
.lp-trust-strip { padding: 56px 0; border-bottom: 1px solid var(--lp-line); }
.lp-trust-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.lp-trust-headline { font-weight: 600; font-size: clamp(18px, 2.2vw, 22px); letter-spacing: -0.02em; color: var(--lp-ink); max-width: 360px; }
.lp-trust-items { display: flex; gap: 40px; flex-wrap: wrap; }
.lp-trust-item { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.lp-trust-label { font-family: "Space Mono", monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lp-signal); }
.lp-trust-desc { font-size: 13px; color: var(--lp-muted); }
@media (max-width: 720px) { .lp-trust-strip-inner { flex-direction: column; align-items: flex-start; } }

/* ── 3. Lead benefit split ── */
.lp-benefit-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.lp-benefit-text .lp-sub { margin-bottom: 24px; }
.lp-benefit-visual { display: flex; justify-content: center; }
.lp-result-card { width: 100%; max-width: 420px; background: var(--lp-panel); border: 1px solid var(--lp-line); border-radius: 18px; padding: 26px; box-shadow: var(--lp-shadow); }
.lp-result-card-label { font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lp-muted); margin-bottom: 16px; }
.lp-result-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lp-line); font-size: 13.5px; }
.lp-result-row:last-child { border-bottom: none; }
.lp-result-row span { color: var(--lp-muted); }
.lp-result-row b { color: var(--lp-ink); text-align: right; font-weight: 600; }
.lp-result-reason { flex-direction: column; align-items: flex-start; gap: 6px; }
.lp-result-reason p { margin: 0; font-size: 12.5px; color: var(--lp-muted); line-height: 1.5; }
@media (max-width: 860px) { .lp-benefit-split { grid-template-columns: 1fr; gap: 36px; } }

/* ── 4. Capability marquee ── */
.lp-cap-marquee { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.lp-cap-row { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.lp-cap-track { display: flex; gap: 12px; width: max-content; animation: lp-cap-scroll 40s linear infinite; }
.lp-cap-row-2 .lp-cap-track { animation-name: lp-cap-scroll-reverse; animation-duration: 48s; }
.lp-cap-row:hover .lp-cap-track, .lp-cap-row:focus-within .lp-cap-track { animation-play-state: paused; }
@keyframes lp-cap-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes lp-cap-scroll-reverse { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.lp-chip { flex-shrink: 0; display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 999px; background: var(--lp-alt); border: 1px solid var(--lp-line); color: var(--lp-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .lp-cap-track { animation: none; flex-wrap: wrap; width: auto; }
  .lp-cap-row { overflow: visible; -webkit-mask-image: none; mask-image: none; }
}

/* ── 5. Outcome stats ── */
.lp-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.lp-stat-card { background: var(--lp-panel); border: 1px solid var(--lp-line); border-radius: 18px; padding: 32px 28px; }
.lp-stat-value { font-family: "Space Mono", monospace; font-size: 40px; font-weight: 700; color: var(--lp-signal); letter-spacing: -0.02em; line-height: 1; }
.lp-stat-label { margin-top: 12px; font-weight: 600; font-size: 15px; color: var(--lp-ink); }
.lp-stat-card p { margin-top: 6px; font-size: 13px; color: var(--lp-muted); }
@media (max-width: 760px) { .lp-stats-grid { grid-template-columns: 1fr; } }

/* ── 6. Three-step ── */
.lp-three-step { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; position: relative; }
.lp-three-step::before { content: ""; position: absolute; top: 16px; left: 8%; right: 8%; height: 1px; background: var(--lp-line); z-index: 0; }
.lp-three-step-row { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.lp-three-step-row .lp-step-num { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(230, 46, 107, 0.11); font-size: 17px; }
.lp-three-step-row h3 { font-size: 17px; font-weight: 600; color: var(--lp-ink); }
.lp-three-step-row p { font-size: 13.5px; color: var(--lp-muted); line-height: 1.6; }
@media (max-width: 780px) { .lp-three-step { grid-template-columns: 1fr; gap: 24px; } .lp-three-step::before { display: none; } }

/* MAAI-styled Hero Video Dialog: a lightweight vanilla adaptation of the
   thumbnail-to-centered-dialog interaction, using the supplied SEO preview. */
.lp-how-video { max-width: 780px; margin: 44px auto 0; }
.lp-how-video-trigger { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid color-mix(in srgb, var(--lp-signal) 58%, var(--lp-line)); border-radius: 22px; padding: 0; background: #0E2A1E; cursor: pointer; box-shadow: 0 28px 72px rgba(14, 42, 30, .2); isolation: isolate; }
.lp-how-video-trigger img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .55s cubic-bezier(.2,.75,.25,1), filter .35s ease; filter: saturate(.82) contrast(1.05); }
.lp-how-video-wash { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(14,42,30,.68) 0%, rgba(14,42,30,.12) 46%, rgba(230,46,107,.32) 100%); z-index: 1; transition: opacity .3s ease; }
.lp-how-video-play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--lp-signal); border: 8px solid rgba(255,255,255,.19); box-shadow: 0 0 0 0 rgba(230,46,107,.46), 0 16px 34px rgba(14,42,30,.3); transform: translate(-50%, -50%); transition: transform .3s ease, box-shadow .3s ease, background .2s ease; }
.lp-how-video-play svg { width: 30px; height: 30px; margin-left: 3px; }
.lp-how-video-label { position: absolute; z-index: 2; left: 24px; right: 24px; bottom: 22px; display: flex; flex-direction: column; gap: 3px; text-align: left; color: #fff; text-shadow: 0 2px 18px rgba(14,42,30,.72); }
.lp-how-video-label > span { font-size: clamp(17px, 2vw, 23px); font-weight: 650; letter-spacing: -.03em; }
.lp-how-video-label small { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.86); }
.lp-how-video-trigger:hover img { transform: scale(1.045); filter: saturate(1) contrast(1.04); }
.lp-how-video-trigger:hover .lp-how-video-wash { opacity: .8; }
.lp-how-video-trigger:hover .lp-how-video-play { background: #ff5f94; transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 14px rgba(230,46,107,.13), 0 18px 38px rgba(14,42,30,.36); }
.lp-how-video-trigger:focus-visible, .lp-video-dialog-close:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

body.lp-video-dialog-open { overflow: hidden; }
.lp-video-dialog[hidden] { display: none; }
.lp-video-dialog { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: clamp(16px, 4vw, 56px); background: rgba(4, 18, 12, .84); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transition: opacity .22s ease; }
.lp-video-dialog.is-open { opacity: 1; }
.lp-video-dialog-panel { position: relative; width: min(880px, 100%); max-height: min(78vh, 560px); border: 1px solid color-mix(in srgb, var(--lp-signal) 58%, #fff); border-radius: 18px; overflow: hidden; background: #0E2A1E; box-shadow: 0 28px 76px rgba(0,0,0,.5); transform: scale(.92); transition: transform .28s cubic-bezier(.2,.75,.25,1); }
.lp-video-dialog.is-open .lp-video-dialog-panel { transform: scale(1); }
.lp-video-dialog-media { display: block; width: 100%; max-height: min(78vh, 560px); background: #07140e; object-fit: contain; }
.lp-video-dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: rgba(14,42,30,.84); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.lp-video-dialog-close svg { width: 20px; height: 20px; }
.lp-video-dialog-close:hover { background: var(--lp-signal); transform: scale(1.06); }
@media (max-width: 640px) { .lp-how-video { margin-top: 36px; } .lp-how-video-trigger { border-radius: 16px; } .lp-how-video-play { width: 60px; height: 60px; border-width: 6px; } .lp-how-video-play svg { width: 25px; height: 25px; } .lp-how-video-label { left: 16px; right: 16px; bottom: 15px; } .lp-how-video-label small { font-size: 11.5px; } .lp-video-dialog { padding: 12px; } .lp-video-dialog-panel { border-radius: 14px; } .lp-video-dialog-close { top: 8px; right: 8px; width: 38px; height: 38px; } }
@media (prefers-reduced-motion: reduce) { .lp-how-video-trigger img, .lp-how-video-wash, .lp-how-video-play, .lp-video-dialog, .lp-video-dialog-panel, .lp-video-dialog-close { transition: none; } .lp-how-video-trigger:hover img { transform: none; } .lp-how-video-trigger:hover .lp-how-video-play { transform: translate(-50%, -50%); } }

/* ── 7. Sticky product story ── */
.lp-story-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; margin-top: 48px; align-items: start; }
.lp-story-steps { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 100px; }
.lp-story-step { padding: 22px 24px; border-radius: 14px; opacity: 0.45; transition: opacity .4s ease, background .4s ease; cursor: pointer; }
.lp-story-step.active { opacity: 1; background: var(--lp-panel); border: 1px solid var(--lp-line); box-shadow: var(--lp-shadow); }
.lp-story-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--lp-alt); font-family: "Space Mono", monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lp-signal); }
.lp-story-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lp-signal); flex-shrink: 0; }
.lp-story-step h3 { margin-top: 8px; font-size: 18px; font-weight: 600; color: var(--lp-ink); }
.lp-story-step p { margin-top: 8px; font-size: 13.5px; color: var(--lp-muted); line-height: 1.6; }
.lp-story-visual { position: sticky; top: 100px; min-height: 340px; }
.lp-story-frame { display: none; background: var(--lp-panel); border: 1px solid var(--lp-line); border-radius: 18px; padding: 28px; box-shadow: var(--lp-shadow); opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease; }
.lp-story-frame.active { display: block; opacity: 1; transform: translateY(0); }
.lp-mini-table, .lp-mini-panel, .lp-mini-queue { display: flex; flex-direction: column; gap: 2px; }
.lp-mini-table-head { display: grid; grid-template-columns: 1.6fr 0.7fr 0.7fr; font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lp-muted); padding: 0 12px 10px; }
.lp-mini-table-row { display: grid; grid-template-columns: 1.6fr 0.7fr 0.7fr; padding: 12px; border-radius: 8px; font-size: 13px; color: var(--lp-ink); background: var(--lp-alt); margin-bottom: 6px; }
.lp-mini-panel-row { padding: 10px 0; border-bottom: 1px solid var(--lp-line); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; }
.lp-mini-panel-row:last-child { border-bottom: none; }
.lp-mini-panel-row span { color: var(--lp-muted); flex-shrink: 0; }
.lp-mini-panel-row b { color: var(--lp-ink); text-align: right; }
.lp-mini-panel-row p { margin: 0; font-size: 12.5px; color: var(--lp-muted); text-align: right; max-width: 60%; }
.lp-mini-queue-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-radius: 8px; background: var(--lp-alt); margin-bottom: 6px; font-size: 13px; color: var(--lp-ink); }
.lp-badge-approved, .lp-badge-review { font-family: "Space Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.lp-badge-approved { background: rgba(79,178,134,0.14); color: #2E6B3F; }
.lp-badge-review { background: rgba(230,46,107,0.12); color: var(--lp-signal); }
@media (max-width: 900px) {
  .lp-story-grid { grid-template-columns: 1fr; gap: 20px; }
  .lp-story-steps, .lp-story-visual { position: static; }
  .lp-story-step { opacity: 1; background: var(--lp-panel); border: 1px solid var(--lp-line); margin-bottom: 12px; }
  .lp-story-frame { display: block; opacity: 1; transform: none; margin-bottom: 16px; }
}

/* ── 8. Dark "make sense of the signals" section — see index.html for the
   signal-wheel (OptionWheel) styles; these are theme-colour reinforcements. ── */
.lp-dark-orbit { color: #F7F7F2; }
.lp-orbit-copy .lp-h2 { color: #F7F7F2; }

/* ── 9. Feature mosaic ── */
.lp-mosaic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.lp-mosaic-wide { grid-column: span 3; }
@media (max-width: 900px) { .lp-mosaic-grid { grid-template-columns: 1fr 1fr; } .lp-mosaic-wide { grid-column: span 2; } }
@media (max-width: 620px) { .lp-mosaic-grid { grid-template-columns: 1fr; } .lp-mosaic-wide { grid-column: span 1; } }

/* ── 10. Lead magnet — free SEO snapshot ── */
.lp-snapshot-banner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: start; background: var(--lp-alt); border: 1px solid var(--lp-line); border-radius: 28px; padding: 48px; }
.lp-snapshot-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.lp-snapshot-form.hidden { display: none; }
.lp-snapshot-field { display: flex; flex-direction: column; gap: 6px; }
.lp-snapshot-field label { font-family: "Space Mono", monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lp-muted); }
.lp-snapshot-field input { padding: 13px 16px; border-radius: 10px; border: 1px solid var(--lp-line); background: var(--lp-panel); color: var(--lp-ink); font-size: 14px; }
.lp-snapshot-field input:focus { outline: none; border-color: var(--lp-signal); box-shadow: 0 0 0 3px rgba(230,46,107,0.14); }
.lp-snapshot-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--lp-muted); line-height: 1.5; }
.lp-snapshot-consent input { margin-top: 3px; flex-shrink: 0; }
.lp-snapshot-error { color: var(--lp-signal); font-size: 12.5px; font-weight: 600; min-height: 16px; }
.lp-snapshot-processing { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--lp-panel); border: 1px solid var(--lp-line); }
.lp-snapshot-processing.hidden { display: none; }
.lp-snapshot-processing p { margin: 0; font-size: 13px; color: var(--lp-muted); }
.lp-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--lp-line); border-top-color: var(--lp-signal); animation: lp-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes lp-spin { to { transform: rotate(360deg); } }
.lp-privacy-line { margin-top: 18px; font-size: 11.5px; color: var(--lp-muted); }
.lp-snapshot-visual { display: flex; justify-content: center; }
.lp-report-card { width: 100%; max-width: 380px; background: var(--lp-panel); border: 1px solid var(--lp-line); border-radius: 18px; padding: 26px; box-shadow: var(--lp-shadow); }
.lp-report-card-title { font-weight: 600; font-size: 15px; color: var(--lp-ink); }
.lp-report-card-label { margin: 4px 0 18px; font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lp-muted); }
.lp-report-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--lp-line); font-size: 13px; color: var(--lp-ink); }
.lp-report-row:last-child { border-bottom: none; }
.lp-priority-critical { color: var(--lp-signal); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.lp-priority-high { color: #b8722f; font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.lp-priority-medium { color: var(--lp-muted); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 900px) {
  .lp-snapshot-banner { grid-template-columns: 1fr; padding: 32px 24px; border-radius: 20px; }
  .lp-snapshot-visual { order: -1; }
}

/* ── 12. Before / after proof ── */
.lp-proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.lp-proof-card { border-radius: 18px; padding: 28px; border: 1px solid var(--lp-line); }
.lp-proof-before { background: var(--lp-alt); }
.lp-proof-after { background: var(--evergreen, #0E2A1E); border-color: transparent; }
.lp-proof-label { font-family: "Space Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 18px; color: var(--lp-muted); }
.lp-proof-after .lp-proof-label { color: #FF7BA3; }
.lp-proof-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--lp-line); font-size: 13.5px; }
.lp-proof-before .lp-proof-row { border-bottom-color: var(--lp-line); }
.lp-proof-after .lp-proof-row { border-bottom-color: rgba(247,247,242,0.14); }
.lp-proof-row:last-child { border-bottom: none; }
.lp-proof-row span { color: var(--lp-muted); }
.lp-proof-after .lp-proof-row span { color: rgba(247,247,242,0.6); }
.lp-proof-row b { color: var(--lp-ink); font-weight: 600; text-align: right; }
.lp-proof-after .lp-proof-row b { color: #F7F7F2; }
.lp-proof-after .lp-priority-critical { color: #FF7BA3; }
.lp-proof-reason { flex-direction: column; align-items: flex-start; gap: 6px; }
.lp-proof-reason p { margin: 0; font-size: 12.5px; color: var(--lp-muted); line-height: 1.5; text-align: left; }
.lp-proof-after .lp-proof-reason p { color: rgba(247,247,242,0.72); }
.lp-disclaimer { margin-top: 20px; font-size: 11.5px; color: var(--lp-muted); text-align: center; }
@media (max-width: 780px) { .lp-proof-grid { grid-template-columns: 1fr; } }

/* Shared mono utility for numeric/data values across new sections */
.mono { font-family: "Space Mono", monospace; }

/* ── 13. Product summary — real screenshot frame ── */
.lp-product-frame { margin-top: 48px; border-radius: 24px; overflow: hidden; box-shadow: var(--lp-shadow); }
.lp-product-frame img { display: block; width: 100%; height: auto; }

/* ── Carousel — "What a clear next move looks like" (Everlab-style slider) ── */
.lp-carousel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.lp-carousel-head .lp-sub { margin-top: 12px; max-width: 560px; }
.lp-carousel-controls { display: flex; gap: 10px; flex-shrink: 0; }
.lp-carousel-arrow { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--lp-line); background: var(--lp-panel); color: var(--lp-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .18s, color .18s, border-color .18s, opacity .18s; }
.lp-carousel-arrow:hover { background: var(--lp-signal); color: #fff; border-color: var(--lp-signal); }
.lp-carousel-arrow:disabled { opacity: 0.35; cursor: default; }
.lp-carousel-arrow:disabled:hover { background: var(--lp-panel); color: var(--lp-ink); border-color: var(--lp-line); }
.lp-carousel { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; margin: 0 -4px; padding: 4px; }
.lp-carousel::-webkit-scrollbar { display: none; }
.lp-carousel:focus-visible { outline: 2px solid var(--lp-signal); outline-offset: 4px; border-radius: 18px; }
.lp-carousel-track { display: flex; gap: 20px; }
.lp-slide { flex: 0 0 clamp(300px, 42%, 460px); scroll-snap-align: start; display: flex; flex-direction: column; background: var(--lp-panel); border: 1px solid var(--lp-line); border-radius: 20px; overflow: hidden; box-shadow: var(--lp-shadow); }
.lp-slide-visual { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg, #0E2A1E, #12291D); }
.lp-slide-badge { position: absolute; top: 16px; left: 16px; font-family: "Space Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; background: rgba(247,247,242,0.14); color: #fff; }
.lp-slide-badge.lp-priority-critical { background: var(--lp-signal); color: #fff; }
.lp-slide-badge.lp-priority-high { background: #b8722f; color: #fff; }
.lp-slide-badge.lp-priority-medium { background: rgba(247,247,242,0.2); color: #fff; }
.lp-slide-badge-neutral { background: rgba(247,247,242,0.14); color: rgba(247,247,242,0.85); }
.lp-slide-metric { text-align: center; color: #fff; }
.lp-slide-metric span { font-family: "Space Mono", monospace; font-size: 42px; font-weight: 700; line-height: 1; color: #FF7BA3; }
.lp-slide-metric small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247,247,242,0.6); }
.lp-slide-body { padding: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lp-slide-label { font-family: "Space Mono", monospace; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lp-signal); }
.lp-slide-body h3 { font-size: 18px; font-weight: 600; color: var(--lp-ink); }
.lp-slide-body p { font-size: 13.5px; color: var(--lp-muted); line-height: 1.6; flex: 1; }
.lp-slide-foot { display: flex; gap: 20px; padding-top: 12px; border-top: 1px solid var(--lp-line); font-size: 12px; color: var(--lp-muted); }
.lp-slide-foot b { color: var(--lp-ink); font-weight: 600; }
.lp-carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.lp-carousel-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--lp-line); cursor: pointer; transition: background .2s, width .2s; }
.lp-carousel-dot.active { background: var(--lp-signal); width: 22px; border-radius: 999px; }
.lp-carousel-section .lp-disclaimer { margin-top: 22px; }
@media (max-width: 640px) {
  .lp-carousel-head { flex-direction: column; align-items: flex-start; }
  .lp-carousel-controls { display: none; }
  .lp-slide { flex-basis: 82%; }
}

/* ── Scroll stack — real product screens pin & stack on scroll (reactbits style) ── */
.lp-stack-section { overflow: visible; }
/* Each card is roughly one viewport tall of scroll apart, so the next card
   travels up and pins on top of the previous one — true "scroll stack".
   Cards pin at a slightly increasing top offset (via --stack-i) so the ones
   underneath peek out as a stacked deck rather than hiding completely. */
/* Cards are held to ~half their natural size and centred, so a pinned card
   never fills the viewport — you can see the next one climbing up behind it
   and the deck stacking. */
.lp-stack { position: relative; margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 34vh; padding-bottom: 12vh; }
.lp-stack-card {
  position: sticky;
  top: calc(88px + var(--stack-i, 0) * 18px);
  width: min(680px, 100%);
  transform-origin: 50% 0%;
  will-change: transform;
  background: var(--lp-panel);
  border: 1px solid var(--lp-line);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(14,42,30,0.16);
  overflow: hidden;
}
.lp-stack-cap { display: flex; align-items: center; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--lp-line); }
.lp-stack-step { font-size: 13px; font-weight: 700; color: var(--lp-signal); flex-shrink: 0; }
.lp-stack-cap h3 { font-size: 17px; font-weight: 600; color: var(--lp-ink); }
.lp-stack-cap p { font-size: 13px; color: var(--lp-muted); margin-top: 2px; }
.lp-stack-shot { background: var(--lp-alt); }
.lp-stack-shot img { display: block; width: 100%; height: 300px; object-fit: cover; object-position: top center; }

/* When scroll-stack is active, JS toggles this and drives per-card transforms.
   Fallback (no JS / reduced motion): cards simply stack in normal flow. */
@media (prefers-reduced-motion: reduce) {
  .lp-stack { gap: 28px; padding-bottom: 0; }
  .lp-stack-card { position: relative; top: 0; }
}
@media (max-width: 640px) {
  .lp-stack { gap: 24px; padding-bottom: 0; }
  .lp-stack-card { position: relative; top: 0; transform: none !important; }
  .lp-stack-cap { padding: 16px 18px; }
}

/* ── GSC connect integration UI ── */
.gsc-status-row { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.gsc-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.gsc-status-dot.gsc-dot-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.gsc-detail-grid { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface2); }
.gsc-detail-grid > div { display: flex; flex-direction: column; gap: 3px; }
.gsc-detail-grid span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.gsc-detail-grid b { font-size: 13.5px; color: var(--text); font-weight: 600; word-break: break-all; }
.btn-gsc-connect { display: inline-flex; align-items: center; }
.gsc-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 11px; letter-spacing: .1em; }
.gsc-or::before, .gsc-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.gsc-prop-list { display: flex; flex-direction: column; gap: 8px; }
.gsc-prop-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface2); cursor: pointer; transition: border-color .15s, background .15s; }
.gsc-prop-item:hover { border-color: var(--accent-glow-strong); }
.gsc-prop-item:has(input:checked) { border-color: var(--accent); background: var(--accent-subtle); }
.gsc-prop-item input { flex-shrink: 0; accent-color: var(--accent); }
.gsc-prop-url { flex: 1; font-size: 13.5px; color: var(--text); word-break: break-all; }
.gsc-prop-perm { font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); flex-shrink: 0; }

/* Website Analysis sidebar flyout: extends the existing rail without changing its width. */
.sidebar-parent-shell {
  position: relative;
  margin: 2px 12px;
}
.sidebar-parent-shell > .nav-item,
body.workspace-mode #appRoot .sidebar-parent-shell > .nav-item {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-right: 40px;
  border: 0;
  text-align: left;
  font-family: inherit;
}
.sidebar-child-trigger {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.sidebar-child-trigger .icon { width: 15px; height: 15px; }
.sidebar-parent-shell:hover .sidebar-child-trigger,
.sidebar-child-trigger:hover,
.sidebar-child-trigger[aria-expanded="true"] {
  color: var(--text);
  background: var(--accent-subtle);
}
.sidebar-child-trigger[aria-expanded="true"] { transform: translateY(-50%) translateX(1px); }
.sidebar-parent-main.active + .sidebar-child-trigger { color: #fff; }
.sidebar-child-trigger:focus-visible,
.sidebar-parent-main:focus-visible,
.sidebar-flyout-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sidebar-flyout {
  position: fixed;
  z-index: 130;
  display: grid;
  gap: 3px;
  min-width: 210px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-5px) scale(.98);
  transform-origin: left top;
  transition: opacity .17s ease, transform .17s ease, visibility 0s linear .17s;
}
.sidebar-flyout.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  transition-delay: 0s;
}
.sidebar-flyout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sidebar-flyout-item .nav-icon { width: 18px; }
.sidebar-flyout-item .icon { width: 17px; height: 17px; color: currentColor; }
.sidebar-flyout-item:hover { background: var(--accent-subtle); color: var(--text); }
.sidebar-flyout-item.active,
.sidebar-flyout-item.active:hover { background: var(--accent); color: #fff; }
.sidebar.collapsed .sidebar-parent-shell { margin: 1px 8px; }
.sidebar.collapsed .sidebar-parent-shell > .nav-item,
body.workspace-mode #appRoot .sidebar.collapsed .sidebar-parent-shell > .nav-item {
  justify-content: center;
  padding: 8px 0;
}
.sidebar.collapsed .sidebar-child-trigger {
  right: 0;
  top: auto;
  bottom: -1px;
  width: 18px;
  height: 18px;
  transform: none;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.sidebar.collapsed .sidebar-child-trigger .icon { width: 11px; height: 11px; }
@media (max-width: 920px) {
  #appRoot .top-header-row { position: relative; z-index: 3; }
  #appRoot .mobile-nav-toggle { position: relative; z-index: 4; }
  .sidebar-parent-shell { margin: 2px 14px; }
  .sidebar.collapsed .sidebar-parent-shell { margin: 2px 14px; }
  .sidebar.collapsed .sidebar-parent-shell > .nav-item,
  body.workspace-mode #appRoot .sidebar.collapsed .sidebar-parent-shell > .nav-item {
    justify-content: flex-start;
    padding: 11px 42px 11px 16px;
  }
  .sidebar.collapsed .sidebar-child-trigger {
    top: 50%;
    right: 8px;
    bottom: auto;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    transform: translateY(-50%);
  }
  .sidebar-flyout { transform-origin: top center; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-flyout,
  .sidebar-child-trigger { transition: none; }
}

/* Small inline loading spinner (Uiverse.io by catraco), recolored to a
   magenta/blue pairing for this component only — this app's palette has no
   blue elsewhere, so it isn't promoted to a --var, just used here. Reuses
   the app's existing `spin` keyframe, only `spinner-bounce` is new. Default
   size matches the original. .spinner-sm is the compact variant for sitting
   next to inline "Loading…" text. */
.spinner {
  --size: 30px;
  --first: var(--accent);
  --second: #3E7BFA;
  width: 50px;
  height: 50px;
  position: relative;
  display: inline-block;
  animation: spin 2s linear infinite;
}
.spinner::before,
.spinner::after {
  content: "";
  width: var(--size);
  height: var(--size);
  background: var(--first);
  border-radius: 100%;
  position: absolute;
  top: 10%;
  transform: translateY(-50%);
  animation: spinner-bounce 1s ease-in-out alternate infinite;
}
.spinner::after {
  background: var(--second);
  animation: spinner-bounce 1s 0.5s ease-in-out alternate infinite;
}
.spinner-sm {
  --size: 6px;
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
@keyframes spinner-bounce {
  50% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner,
  .spinner::before,
  .spinner::after { animation: none; }
}
/* UIRD alignment: trustworthy state, workflow context, and keyboard access. */
.workflow-stepper {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:0 0 18px;
}
.workflow-stepper span {
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--text-muted);
  background:var(--surface);
  font-size:12px;
  font-weight:750;
  text-align:center;
}
.workflow-stepper span.complete::before { content:'✓'; margin-right:6px; color:var(--green); }
.workflow-stepper span.current { border-color:var(--accent); color:var(--text); background:var(--accent-subtle); }
.publish-readiness { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.publish-readiness > div { display:grid; gap:4px; min-width:0; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface2); }
.publish-readiness span { color:var(--text-muted); font-size:11px; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
.publish-readiness strong { color:var(--text); font-size:12.5px; overflow-wrap:anywhere; }
.publish-readiness .is-ready { border-color:color-mix(in srgb,var(--green) 45%,var(--border)); }
.publish-readiness .is-blocked { border-color:color-mix(in srgb,var(--red) 35%,var(--border)); }

@media (max-width: 900px) {
  .publish-readiness { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .workflow-stepper { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .publish-readiness { grid-template-columns:1fr; }
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease-out;
}

.skip-link:focus { transform: translateY(0); }

.workspace-context-button {
  display: inline-flex;
  min-height: 44px;
  max-width: 220px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease-out, background-color 180ms ease-out;
}

.workspace-context-button:hover { border-color: var(--accent); background: var(--surface2); }
.workspace-context-label { color: var(--text-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-context-button .workspace-context-name { max-width: 195px; }

.ui-state-panel {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.ui-state-panel strong { display: block; margin-bottom: 5px; font-size: 15px; }
.ui-state-panel p { max-width: 520px; margin: 0 auto 14px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.ui-state-error { border-color: color-mix(in srgb, var(--red, #c83f49) 45%, var(--border)); }
.ui-state-spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: uird-spin 800ms linear infinite; }
@keyframes uird-spin { to { transform: rotate(360deg); } }

.draft-time-metric { min-width: 145px; text-align: left; }
.draft-time-metric .tmetric-value { font-size: 11.5px; line-height: 1.35; white-space: normal; }
.draft-save-status { min-height: 20px; color: var(--text-muted); font-size: 12px; }

.workflow-return-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius-lg, 14px);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.workflow-return-banner > div { display: grid; gap: 3px; }
.workflow-return-banner span { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .48; box-shadow: none; }
.page > h1:focus { outline: none; }

@media (max-width: 760px) {
  .workspace-context-button { max-width: 150px; }
  .workspace-context-button .workspace-context-name { max-width: 125px; }
  .workflow-return-banner { align-items: stretch; flex-direction: column; }
  .workflow-return-banner .btn { width: 100%; }
  .draft-time-metric { min-width: 120px; }
}

@media (max-width: 520px) {
  .workspace-context-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link, .workspace-context-button { transition: none; }
  .ui-state-spinner { animation-duration: 1.6s; }
}

/* Blog Automation featured-image source and resumable image upload. */
.blog-image-source-field { grid-column: 1 / -1; }
.blog-image-source-toggle {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--surface2);
}
.blog-image-source-btn {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}
.blog-image-source-btn:hover { color: var(--text); }
.blog-image-source-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.blog-image-source-btn.active { background: var(--accent); color: #fff; }
.blog-image-source-panel { display: grid; gap: 9px; }
.blog-image-source-panel[hidden] { display: none; }
.blog-image-file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--surface2);
}
.blog-image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.blog-image-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  padding: 8px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--border));
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .16s ease, transform .16s ease;
}
.blog-image-file-button:hover { filter: brightness(1.08); }
.blog-image-file-button:active { transform: translateY(1px); }
.blog-image-file-input:focus-visible + .blog-image-file-button { outline: 2px solid var(--accent); outline-offset: 2px; }
.blog-image-file-input:disabled + .blog-image-file-button { opacity: .7; cursor: wait; }
.blog-image-file-picker[aria-busy="true"] { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.blog-image-file-picker > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blog-image-file-meta, .blog-image-status { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.blog-image-status { min-height: 18px; margin-top: 7px; }
.blog-image-status.is-success { color: var(--green); }
.blog-image-status.is-error { color: var(--red); }
.blog-image-progress { display: grid; grid-template-columns: minmax(140px, 1fr) auto; align-items: center; gap: 10px; }
.blog-image-progress progress { width: 100%; height: 8px; accent-color: var(--accent); }
.blog-image-progress span { color: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.blog-image-preview { width: min(100%, 420px); max-height: 220px; margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; object-fit: cover; background: var(--surface2); }
.blog-result-image { margin: 0 0 14px; }
.blog-result-image img { display: block; width: 100%; max-height: 320px; border: 1px solid var(--border); border-radius: 10px; object-fit: cover; }
.blog-result-image figcaption { margin-top: 7px; color: var(--text-muted); font-size: 11.5px; }

@media (max-width: 560px) {
  .blog-image-source-toggle { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .blog-image-progress { grid-template-columns: 1fr; }
  .blog-image-file-picker { align-items: stretch; flex-direction: column; }
  .blog-image-file-button { min-height: 44px; }
}

/* First-party cookie disclosure — full-width bar floating above the bottom edge. */
.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  border-radius: 14px;
  background: #0b0f0d;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .35);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice-icon { flex-shrink: 0; display: flex; color: var(--accent); }
.cookie-notice-icon .icon { width: 20px; height: 20px; }
.cookie-notice-copy { flex: 1; min-width: 0; }
.cookie-notice-copy strong { color: #fff; font-size: 13.5px; font-weight: 700; margin-right: 6px; }
.cookie-notice-copy p { display: inline; margin: 0; color: rgba(255, 255, 255, .65); font-size: 13px; line-height: 1.5; }
.cookie-notice-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cookie-notice-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cookie-notice-link:hover { color: #fff; }
.cookie-notice-link:focus-visible,
.cookie-notice-dismiss:focus-visible,
.cookie-notice-accept:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cookie-notice-dismiss {
  min-height: 36px;
  padding-inline: 12px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .75);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}
.cookie-notice-dismiss:hover { color: #fff; }
.cookie-notice-accept {
  min-height: 36px;
  padding-inline: 18px;
  border-radius: 999px !important;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cookie-notice { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .cookie-notice-actions { justify-content: flex-end; }
  .cookie-notice-dismiss, .cookie-notice-accept { min-height: 44px; }
}

/* MAAI application sidebar -------------------------------------------------
   This rail intentionally targets #appRoot directly. Earlier compact rules
   depended on body.workspace-mode, but that class is removed when a workspace
   opens, so the production sidebar fell back to the older oversized styling. */
#appRoot .sidebar {
  width: 248px;
  padding: 0;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 8px 0 30px rgba(0,0,0,.05);
}
#appRoot .sidebar.collapsed { width: 72px; }
#appRoot .sidebar-logo {
  min-height: 64px;
  margin: 0 12px;
  padding: 0 42px 0 12px;
  border-bottom: 1px solid var(--border);
  justify-content: flex-start;
}
#appRoot .sidebar-logo-lockup { justify-content: flex-start; }
#appRoot .sidebar-logo-lockup > .maai-wordmark { font-size: 19px; }
#appRoot .sidebar-toggle {
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: transparent;
}
#appRoot .sidebar-toggle:focus-visible,
#appRoot .sidebar-profile:focus-visible,
#appRoot .sidebar-workspace-button:focus-visible,
#appRoot .nav-item:focus-visible,
#appRoot .sidebar-feature-search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#appRoot .sidebar-nav-scroll { padding: 10px 0 8px; }
#appRoot .sidebar-feature-tools { padding: 0 12px 10px; }
#appRoot .sidebar-feature-search {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface2);
}
#appRoot .sidebar-feature-search input { font-size: 12px; }
#appRoot .sidebar-workspace-context.nav-workspace-link {
  margin: 0 12px 10px;
  padding: 0 0 10px;
}
#appRoot .sidebar-workspace-button {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 10px;
  gap: 9px;
  border-radius: 10px;
  background: transparent;
}
#appRoot .sidebar-workspace-button:hover { background: var(--surface2); }
#appRoot .sidebar-workspace-button > [aria-hidden="true"] { margin-left: auto; color: var(--text-muted); }
#appRoot .sidebar-workspace-button > [aria-hidden="true"] .icon { width: 14px; height: 14px; }
#appRoot .sidebar-workspace-copy { gap: 1px; }
#appRoot .sidebar-workspace-copy strong { font-size: 12px; line-height: 1.35; }
#appRoot .sidebar-workspace-copy small { font-size: 9.5px; line-height: 1.35; }
#appRoot .sidebar-groups { padding-bottom: 6px; }
#appRoot .sidebar-groups .nav-group--flat { margin: 0; padding: 5px 0; }
#appRoot .sidebar-groups .nav-group--flat + .nav-group--flat { border-top: 1px solid var(--border); }
#appRoot .sidebar-groups .nav-group-header {
  min-height: 24px;
  padding: 5px 18px 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}
#appRoot .sidebar-groups .nav-group-body-inner { display: grid; gap: 2px; }
#appRoot .nav-item {
  min-height: 40px;
  margin: 0 10px;
  padding: 9px 10px;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 650;
  text-align: left;
  transform: none;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
#appRoot .nav-item:hover { background: var(--surface2); color: var(--text); transform: none; }
#appRoot .nav-item:active { background: var(--surface3); }
#appRoot .nav-item.active,
#appRoot .nav-item.active:hover {
  background: var(--accent-subtle);
  color: var(--text) !important;
  box-shadow: inset 3px 0 0 var(--accent);
}
#appRoot .nav-item.active .nav-icon .icon { color: var(--accent) !important; }
#appRoot .nav-icon { width: 19px; }
#appRoot .nav-icon .icon { width: 18px; height: 18px; color: currentColor; }
#appRoot .nav-item.nav-item-locked { opacity: 1; color: var(--text-muted); }
#appRoot .nav-item.nav-item-locked:hover { color: var(--text-secondary); }
#appRoot .nav-plan-lock {
  min-height: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-color: var(--border-light);
  background: transparent;
  font-size: 8px;
}
#appRoot .sidebar-footer { padding: 10px 12px; background: var(--surface); }
#appRoot .sidebar-profile { min-height: 48px; padding: 6px 8px; border-radius: 9px; }
#appRoot .sidebar-profile-avatar { width: 34px; height: 34px; }
#appRoot .sidebar-profile-name { font-size: 12.5px; }
#appRoot .sidebar-profile-sub { font-size: 10px; }
#appRoot .account-menu { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }

#appRoot .sidebar.collapsed .sidebar-logo {
  min-height: 64px;
  margin: 0 8px;
  padding: 0;
  justify-content: center;
}
#appRoot .sidebar.collapsed .sidebar-logo-lockup { justify-content: center; }
#appRoot .sidebar.collapsed .sidebar-logo-lockup > .maai-wordmark { font-size: 16px; }
#appRoot .sidebar.collapsed .sidebar-feature-tools { display: none; }
#appRoot .sidebar.collapsed .sidebar-workspace-context.nav-workspace-link { margin: 8px 10px 10px; padding-bottom: 10px; }
#appRoot .sidebar.collapsed .sidebar-workspace-button { width: 100%; min-height: 44px; margin: 0; padding: 0; justify-content: center; }
#appRoot .sidebar.collapsed .sidebar-workspace-button > [aria-hidden="true"] { display: none; }
#appRoot .sidebar.collapsed .nav-group-header { display: none; }
#appRoot .sidebar.collapsed .nav-group--flat { padding: 3px 0; border-top: 0; }
#appRoot .sidebar.collapsed .nav-item { min-height: 44px; margin: 2px 10px; padding: 0; justify-content: center; }
#appRoot .sidebar.collapsed .nav-item.active { box-shadow: inset 3px 0 0 var(--accent); }
#appRoot .sidebar.collapsed .sidebar-footer { padding: 10px; }
#appRoot .sidebar.collapsed .sidebar-profile { min-height: 44px; padding: 5px; }

body.app-drawer-open { overflow: hidden; }
@media (max-width: 920px) {
  #appRoot .sidebar,
  #appRoot .sidebar.collapsed {
    width: min(88vw, 320px);
    height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 18px 0 48px rgba(0,0,0,.28);
  }
  #appRoot .sidebar-logo,
  #appRoot .sidebar.collapsed .sidebar-logo {
    min-height: 64px;
    margin: 0 12px;
    padding: 0 48px 0 8px;
    justify-content: flex-start;
  }
  #appRoot .sidebar-logo-lockup,
  #appRoot .sidebar.collapsed .sidebar-logo-lockup { justify-content: flex-start; }
  #appRoot .sidebar-logo-lockup > .maai-wordmark,
  #appRoot .sidebar.collapsed .sidebar-logo-lockup > .maai-wordmark { font-size: 19px; }
  body.app-drawer-open #appRoot .sidebar-toggle {
    display: inline-flex;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    transform: none;
  }
  #appRoot .sidebar-feature-tools,
  #appRoot .sidebar.collapsed .sidebar-feature-tools { display: block; padding: 0 12px 10px; }
  #appRoot .sidebar-feature-search { min-height: 44px; }
  #appRoot .sidebar-feature-search input { display: block; font-size: 16px; }
  #appRoot .sidebar-feature-search kbd { display: inline-flex; }
  #appRoot .sidebar.collapsed .sidebar-search-clear.is-visible { display: inline-flex; }
  #appRoot .sidebar-workspace-context.nav-workspace-link,
  #appRoot .sidebar.collapsed .sidebar-workspace-context.nav-workspace-link { margin: 0 12px 10px; padding-bottom: 10px; }
  #appRoot .sidebar-workspace-button,
  #appRoot .sidebar.collapsed .sidebar-workspace-button { min-height: 64px; padding: 10px; justify-content: flex-start; }
  #appRoot .sidebar.collapsed .sidebar-workspace-copy { display: flex; }
  #appRoot .sidebar-workspace-button > [aria-hidden="true"],
  #appRoot .sidebar.collapsed .sidebar-workspace-button > [aria-hidden="true"] { display: inline-flex; }
  #appRoot .sidebar-groups .nav-group-header,
  #appRoot .sidebar.collapsed .nav-group-header { display: flex; padding: 7px 18px 4px; }
  #appRoot .sidebar-groups .nav-group--flat + .nav-group--flat { border-top: 1px solid var(--border); }
  #appRoot .nav-item,
  #appRoot .sidebar.collapsed .nav-item {
    min-height: 46px;
    margin: 2px 12px;
    padding: 10px 12px;
    justify-content: flex-start;
    gap: 11px;
    font-size: 14px;
  }
  #appRoot .sidebar.collapsed .nav-item-text { display: inline !important; }
  #appRoot .sidebar.collapsed .nav-icon { width: 19px; }
  #appRoot .sidebar.collapsed .nav-plan-lock { display: inline-flex; }
  #appRoot .sidebar-footer,
  #appRoot .sidebar.collapsed .sidebar-footer { padding: 10px 12px; }
  #appRoot .sidebar-profile,
  #appRoot .sidebar.collapsed .sidebar-profile { min-height: 50px; padding: 7px 8px; justify-content: flex-start; }
  #appRoot .sidebar.collapsed .sidebar-profile-meta { display: flex; }
  #appRoot .sidebar.collapsed .sidebar-profile-chevron { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  #appRoot .sidebar,
  #appRoot .nav-item,
  #appRoot .sidebar-toggle,
  #appRoot .app-nav-overlay { transition: none !important; }
}
