/* =============================================================
   Achieva Compass — Person-Centered Planning Portal
   Built on the Achieva Design System tokens (colors_and_type.css).
   Theme modes via data attributes on .compass-root:
     data-theme   = "warm" | "professional"
     data-contrast= "normal" | "high"
     data-textsize= "normal" | "large"
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-sans); color: var(--gray-900); -webkit-font-smoothing: antialiased; }

/* ---- Theme scaffolding ------------------------------------- */
.compass-root {
  /* defaults (warm) */
  --c-page:        #fbf7f1;
  --c-surface:     #ffffff;
  --c-surface-2:   #fcf9f4;
  --c-ink:         #233038;
  --c-ink-2:       #5c6b73;
  --c-accent:      var(--teal);
  --c-accent-ink:  var(--teal-dark);
  --c-warm:        #e98b2a;          /* warm coral-gold for friendly accents */
  --c-border:      #ece4d8;
  --c-border-soft: #f1ebe1;
  --c-head-font:   var(--font-display);
  --c-radius-card: 18px;
  --c-radius-ctl:  11px;
  --c-shadow-card: 0 1px 3px rgba(60,40,10,.06), 0 6px 22px rgba(120,90,40,.06);
  --c-shadow-lift: 0 10px 30px rgba(120,90,40,.12);
  --c-base-size:   15px;
  font-size: var(--c-base-size);
  color: var(--c-ink);
  background: var(--c-page);
}
.compass-root[data-theme="professional"] {
  --c-page:        #eef1f4;
  --c-surface:     #ffffff;
  --c-surface-2:   #f7f9fa;
  --c-ink:         #1c2b33;
  --c-ink-2:       #647582;
  --c-accent:      var(--teal);
  --c-accent-ink:  var(--teal-dark);
  --c-warm:        var(--teal);
  --c-border:      #e0e6eb;
  --c-border-soft: #eceff2;
  --c-head-font:   var(--font-sans);
  --c-radius-card: 10px;
  --c-radius-ctl:  7px;
  --c-shadow-card: 0 1px 4px rgba(0,0,0,.07);
  --c-shadow-lift: 0 2px 14px rgba(0,98,105,.12);
}
.compass-root[data-contrast="high"] {
  --c-page:        #ffffff;
  --c-surface:     #ffffff;
  --c-surface-2:   #ffffff;
  --c-ink:         #06181d;
  --c-ink-2:       #2c3c44;
  --c-accent:      #00474c;
  --c-accent-ink:  #002b2f;
  --c-border:      #1c2b33;
  --c-border-soft: #5c6b73;
  --c-shadow-card: 0 0 0 1px #1c2b33;
  --c-shadow-lift: 0 0 0 2px #06181d;
}
.compass-root[data-textsize="large"] { --c-base-size: 17.5px; }
html:has(.compass-root[data-textsize="large"]) { font-size: 18.5px; }
.compass-root[data-density="compact"] { --c-radius-card: 12px; }
.compass-root[data-density="compact"] .cx-page { padding: 22px 26px; }
.compass-root[data-density="compact"] .cx-plan-grid,
.compass-root[data-density="compact"] .cx-tmpl-grid { gap: 14px; }
.compass-root[data-density="compact"] .cx-section { padding-top: 56px; padding-bottom: 56px; }

.compass-root, .compass-root button, .compass-root input,
.compass-root textarea, .compass-root select { font-family: var(--font-sans); }

/* ---- Generic helpers --------------------------------------- */
.cx-screen { min-height: 100vh; background: var(--c-page); }
.cx-muted  { color: var(--c-ink-2); }
.cx-head   { font-family: var(--c-head-font); }
.cx-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--c-accent);
}
[data-theme="warm"] .cx-eyebrow { color: var(--c-warm); }

/* ---- Buttons ----------------------------------------------- */
.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--c-radius-ctl);
  font-size: .9rem; font-weight: 600; line-height: 1;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: all var(--duration-2) var(--ease); text-decoration: none;
}
.cx-btn svg { width: 17px; height: 17px; }
/* Anchor variant fix: design_system.css's `a:hover { color: var(--teal-dark);
   text-decoration: underline }` was bleeding onto <a class="cx-btn"> on hover,
   making the label match the dark hover background (invisible) and underlined. */
a.cx-btn, a.cx-btn:hover { text-decoration: none; }
.cx-btn-primary,        a.cx-btn-primary:hover         { color: #fff; }
.cx-btn-warm,           a.cx-btn-warm:hover            { color: #3a2c00; }
.cx-btn-ghost                                           { color: var(--c-ink); }
a.cx-btn-ghost:hover                                    { color: var(--c-accent-ink); }
.cx-btn-quiet                                           { color: var(--c-ink-2); }
a.cx-btn-quiet:hover                                    { color: var(--c-ink); }
.cx-btn-danger                                          { color: var(--red); }
a.cx-btn-danger:hover                                   { color: var(--red); }
.cx-btn-primary { background: var(--c-accent); }
.cx-btn-primary:hover { background: var(--c-accent-ink); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,98,105,.28); }
.cx-btn-warm { background: var(--gold); }
.cx-btn-warm:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,184,28,.4); }
.cx-btn-ghost { background: var(--c-surface); border-color: var(--c-border); }
.cx-btn-ghost:hover { background: var(--c-surface-2); border-color: var(--c-accent); color: var(--c-accent-ink); }
.cx-btn-quiet { background: transparent; border-color: transparent; }
.cx-btn-quiet:hover { background: rgba(0,0,0,.05); color: var(--c-ink); }
.cx-btn-danger { background: transparent; border-color: var(--c-border); }
.cx-btn-danger:hover { background: #fde8ec; border-color: var(--red); }
.cx-btn-lg { padding: 14px 26px; font-size: 1rem; border-radius: calc(var(--c-radius-ctl) + 3px); }
.cx-btn-sm { padding: 7px 13px; font-size: .8rem; }
.cx-btn-block { width: 100%; }
.cx-btn:disabled { opacity: .5; cursor: not-allowed; }

/* focus-visible for keyboard users */
.compass-root :focus-visible {
  outline: 3px solid var(--soft-teal);
  outline-offset: 2px;
  border-radius: 4px;
}
[data-contrast="high"] .compass-root :focus-visible { outline-color: var(--gold); }

/* ---- Cards ------------------------------------------------- */
.cx-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius-card);
  box-shadow: var(--c-shadow-card);
}

/* ---- Badges / pills ---------------------------------------- */
.cx-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap;
}
.cx-pill svg { width: 13px; height: 13px; }
.cx-pill-teal   { background: #e2f0f0; color: var(--teal-dark); }
.cx-pill-gold   { background: #fff3d6; color: #8a6300; }
.cx-pill-green  { background: #eef4d9; color: #54690a; }
.cx-pill-purple { background: #f1e6f0; color: var(--purple); }
.cx-pill-red    { background: #fde8ec; color: var(--red); }
.cx-pill-gray   { background: #eceef0; color: var(--gray-600); }

/* ---- Forms ------------------------------------------------- */
.cx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cx-label { font-size: .8rem; font-weight: 600; color: var(--c-ink); }
.cx-input, .cx-textarea, .cx-select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius-ctl);
  font-size: .92rem; font-family: inherit; color: var(--c-ink);
  background: var(--c-surface); outline: none;
  transition: border-color var(--duration-2) var(--ease), box-shadow var(--duration-2) var(--ease);
}
.cx-textarea { resize: vertical; line-height: 1.55; min-height: 84px; }
.cx-input::placeholder, .cx-textarea::placeholder { color: #aeb6bb; }
.cx-input:focus, .cx-textarea:focus, .cx-select:focus {
  border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(0,98,105,.13);
}
.cx-hint { font-size: .78rem; color: var(--c-ink-2); line-height: 1.45; }

/* ---- App shell --------------------------------------------- */
.cx-app { display: flex; min-height: 100vh; background: var(--c-page); }
.cx-sidebar {
  width: 264px; flex-shrink: 0; background: var(--teal);
  color: #fff; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  box-shadow: 2px 0 14px rgba(0,40,43,.18); z-index: 30;
}
[data-theme="warm"] .cx-sidebar {
  background: linear-gradient(186deg, #00666d 0%, #00565c 100%);
}
.cx-sidebar-logo { padding: 20px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.cx-sidebar-logo .cx-wordmark { display: flex; align-items: center; gap: 10px; }
.cx-sidebar-logo .cx-wordmark img { height: 30px; }
.cx-sidebar-logo .cx-product {
  font-family: var(--c-head-font); font-weight: 700; font-size: 1.05rem; color: #fff;
  letter-spacing: .01em;
}
.cx-sidebar-logo .cx-product-sub { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: 2px; }
.cx-nav { flex: 1; overflow-y: auto; padding: 14px 0; }
.cx-nav-label { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.45); padding: 16px 22px 7px; }
.cx-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px; color: rgba(255,255,255,.82);
  font-size: .9rem; font-weight: 500; cursor: pointer;
  border-left: 3px solid transparent; background: none; width: 100%; text-align: left;
  transition: all var(--duration-2) var(--ease); font-family: inherit;
}
.cx-nav-item svg { width: 19px; height: 19px; opacity: .9; flex-shrink: 0; }
.cx-nav-item span { white-space: nowrap; }
.cx-nav-item:hover { background: rgba(255,255,255,.10); color: #fff; border-left-color: rgba(255,255,255,.3); }
.cx-nav-item.active { background: rgba(255,255,255,.16); color: #fff; border-left-color: var(--gold); font-weight: 600; }
.cx-nav-item .cx-nav-count { margin-left: auto; font-size: .7rem; background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 999px; }
.cx-sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .7rem; color: rgba(255,255,255,.55); line-height: 1.5; }

.cx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-topbar {
  height: 64px; background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.cx-topbar-title { font-family: var(--c-head-font); font-weight: 700; font-size: 1.15rem; color: var(--c-ink); }
.cx-topbar-spacer { flex: 1; }
.cx-iconbtn {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-ink-2); cursor: pointer; position: relative; transition: all var(--duration-2) var(--ease);
}
.cx-iconbtn svg { width: 20px; height: 20px; }
.cx-iconbtn:hover { background: var(--c-surface-2); color: var(--c-accent); }
.cx-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
}
.cx-page { padding: 30px 34px; max-width: 1320px; width: 100%; }

/* ---- A11y toolbar ------------------------------------------ */
.cx-a11y-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 280px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 14px; box-shadow: var(--shadow-md); padding: 16px; z-index: 60;
}
.cx-a11y-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--c-border-soft); }
.cx-a11y-row:last-child { border-bottom: none; }
.cx-seg { display: inline-flex; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 9px; overflow: hidden; }
.cx-seg button { border: none; background: none; padding: 6px 12px; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--c-ink-2); font-family: inherit; }
.cx-seg button.on { background: var(--c-accent); color: #fff; }
.cx-a11y-select {
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: 9px; padding: 6px 10px; font-size: .82rem; font-weight: 600;
  color: var(--c-ink); font-family: inherit; cursor: pointer;
}

/* ---- Toggle switch ----------------------------------------- */
.cx-switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; cursor: pointer; }
.cx-switch input { opacity: 0; width: 0; height: 0; }
.cx-switch-track { position: absolute; inset: 0; background: var(--soft-gray); border-radius: 999px; transition: background var(--duration-2) var(--ease); }
.cx-switch-thumb { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--duration-2) var(--ease); }
.cx-switch input:checked + .cx-switch-track { background: var(--green); }
.cx-switch input:checked + .cx-switch-track .cx-switch-thumb { transform: translateX(19px); }

/* ---- Avatar stack ------------------------------------------ */
.cx-avatars { display: flex; align-items: center; }
.cx-avatars .cx-avatar { border: 2.5px solid var(--c-surface); margin-left: -9px; }
.cx-avatars .cx-avatar:first-child { margin-left: 0; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.cx-landing { background: var(--c-surface); color: var(--c-ink); }
.cx-landing-nav {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 40px; position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border-soft);
}
.cx-landing-nav img { height: 30px; }
.cx-brandlock { display: flex; align-items: center; gap: 11px; }
.cx-brandlock .cx-product { font-family: var(--c-head-font); font-weight: 700; font-size: 1.1rem; color: var(--teal-dark); }
.cx-landing-links { display: flex; align-items: center; gap: 26px; margin-left: 28px; }
.cx-landing-links a { color: var(--c-ink-2); font-size: .9rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.cx-landing-links a:hover { color: var(--teal); }

.cx-hero {
  position: relative; overflow: hidden;
  padding: 86px 40px 96px;
  background:
     radial-gradient(120% 120% at 88% -10%, #e7f3f2 0%, rgba(231,243,242,0) 55%),
     linear-gradient(180deg, #fbf7f1 0%, #ffffff 100%);
}
[data-theme="professional"] .cx-hero { background: linear-gradient(180deg, #eef1f4 0%, #ffffff 100%); }
.cx-hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.cx-hero h1 { font-family: var(--c-head-font); font-weight: 800; font-size: clamp(2.4rem, 4.4vw, 3.7rem); line-height: 1.04; letter-spacing: -.02em; color: var(--teal-dark); margin: 16px 0 0; }
.cx-hero h1 em { font-style: normal; color: var(--c-warm); }
.cx-hero p.lead { font-size: 1.18rem; line-height: 1.6; color: var(--c-ink-2); margin: 22px 0 30px; max-width: 30em; }
.cx-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cx-hero-note { font-size: .82rem; color: var(--c-ink-2); margin-top: 18px; display: flex; align-items: center; gap: 7px; }

.cx-section { padding: 76px 40px; }
.cx-section-inner { max-width: 1120px; margin: 0 auto; }
.cx-section h2 { font-family: var(--c-head-font); font-weight: 800; font-size: clamp(1.9rem, 3vw, 2.6rem); letter-spacing: -.01em; color: var(--teal-dark); margin: 10px 0 0; line-height: 1.1; }
.cx-section .section-lead { font-size: 1.08rem; color: var(--c-ink-2); max-width: 42em; margin: 16px auto 0; line-height: 1.6; }
.cx-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 46px; }
.cx-feature { padding: 28px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--c-shadow-card); }
.cx-feature-ic { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.cx-feature-ic svg { width: 25px; height: 25px; color: #fff; }
.cx-feature h3 { font-size: 1.18rem; font-weight: 700; margin: 0 0 8px; color: var(--c-ink); }
.cx-feature p { font-size: .95rem; line-height: 1.6; color: var(--c-ink-2); margin: 0; }

.cx-cta-band { background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 52%, #007a82 100%); color: #fff; border-radius: 26px; padding: 56px; text-align: center; position: relative; overflow: hidden; }
.cx-cta-band h2 { color: #fff; font-family: var(--c-head-font); font-weight: 800; font-size: clamp(1.8rem,3vw,2.5rem); margin: 0 0 12px; }
.cx-cta-band p { color: rgba(255,255,255,.86); font-size: 1.05rem; max-width: 34em; margin: 0 auto 26px; }

.cx-footer { background: #052e31; color: rgba(255,255,255,.7); padding: 44px 40px; }
.cx-footer-inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.cx-footer a { color: rgba(255,255,255,.7); text-decoration: none; display: block; padding: 4px 0; font-size: .88rem; }
.cx-footer a:hover { color: #fff; }

/* ---- Star hero illustration tokens ------------------------- */
.cx-starwrap { position: relative; aspect-ratio: 1; }

/* ============================================================
   AUTH
   ============================================================ */
.cx-auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--c-surface); }
.cx-auth-aside { position: relative; overflow: hidden; padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--teal-dark) 0%, var(--teal) 55%, #007a82 100%); }
.cx-auth-aside h2 { font-family: var(--c-head-font); font-weight: 800; font-size: 2.2rem; line-height: 1.12; margin: 0 0 14px; color: #fff; }
.cx-auth-aside p { font-size: 1.05rem; color: rgba(255,255,255,.85); line-height: 1.6; max-width: 30em; }
.cx-auth-main { display: flex; align-items: center; justify-content: center; padding: 48px; }
.cx-auth-card { width: 100%; max-width: 420px; }
.cx-auth-card h1 { font-family: var(--c-head-font); font-weight: 800; font-size: 1.9rem; color: var(--teal-dark); margin: 18px 0 6px; }
.cx-divider { display: flex; align-items: center; gap: 14px; color: var(--c-ink-2); font-size: .8rem; margin: 22px 0; }
.cx-divider::before, .cx-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.cx-invite-banner { background: #eef4d9; border: 1px solid #cfe08f; border-radius: 14px; padding: 16px 18px; display: flex; gap: 13px; margin-bottom: 22px; }
.cx-invite-banner .cx-avatar { width: 42px; height: 42px; font-size: .95rem; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.cx-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.cx-page-title { font-family: var(--c-head-font); font-weight: 800; font-size: 1.85rem; color: var(--teal-dark); margin: 0; line-height: 1.1; }
.cx-page-sub { font-size: .95rem; color: var(--c-ink-2); margin: 6px 0 0; }

.cx-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.cx-plan-card { display: flex; flex-direction: column; cursor: pointer; transition: all var(--duration-2) var(--ease); overflow: hidden; }
.cx-plan-card:hover { transform: translateY(-3px); box-shadow: var(--c-shadow-lift); border-color: var(--soft-teal); }
.cx-plan-cap { height: 92px; position: relative; display: flex; align-items: center; padding: 0 20px; }
.cx-plan-cap .cx-tmpl-glyph { width: 52px; height: 52px; }
.cx-plan-body { padding: 16px 20px 18px; flex: 1; display: flex; flex-direction: column; }
.cx-plan-body h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 3px; color: var(--c-ink); }
.cx-plan-meta { font-size: .78rem; color: var(--c-ink-2); margin-bottom: 14px; }
.cx-plan-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cx-progress { height: 7px; border-radius: 999px; background: var(--c-border-soft); overflow: hidden; flex: 1; }
.cx-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--green); }

.cx-tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.cx-tmpl-card { padding: 22px; cursor: pointer; transition: all var(--duration-2) var(--ease); text-align: left; }
.cx-tmpl-card:hover { transform: translateY(-3px); box-shadow: var(--c-shadow-lift); border-color: var(--soft-teal); }
.cx-tmpl-card .cx-tmpl-glyph { width: 56px; height: 56px; margin-bottom: 14px; }
.cx-tmpl-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; color: var(--c-ink); }
.cx-tmpl-card p { font-size: .85rem; color: var(--c-ink-2); line-height: 1.5; margin: 0; }

/* ============================================================
   STAR EDITOR
   ============================================================ */
.cx-editor { display: flex; flex-direction: column; min-height: 100vh; background: var(--c-page); }
/* When the editor has a docked side panel (star editor), pin the whole editor
   to the viewport so the side panel's footer ("Share with Achieva" switch)
   stays anchored at the bottom and only the canvas / side-scroll regions
   scroll. Without this the panel grows with the tall canvas row and the
   footer falls below the fold. */
.cx-editor:has(.cx-editor-body) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.cx-editor-bar {
  height: 60px; background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 25;
}
.cx-doc-title { font-family: var(--c-head-font); font-weight: 700; font-size: 1.05rem; color: var(--c-ink); border: 1.5px solid transparent; border-radius: 8px; padding: 4px 9px; background: none; min-width: 320px; }
.cx-doc-title:hover { border-color: var(--c-border); }
.cx-doc-title:focus { border-color: var(--c-accent); outline: none; background: var(--c-surface); }
.cx-savechip { font-size: .76rem; color: var(--c-ink-2); display: inline-flex; align-items: center; gap: 6px; }
.cx-savechip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.cx-editor-body { display: grid; grid-template-columns: 1fr 412px; flex: 1; min-height: 0; }
.cx-canvas-wrap { padding: 34px; display: flex; align-items: center; justify-content: center; overflow: auto; position: relative; }
.cx-side { border-left: 1px solid var(--c-border); background: var(--c-surface); display: flex; flex-direction: column; min-height: 0; }
.cx-side-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--c-border-soft); }
.cx-side-scroll { overflow-y: auto; padding: 6px 22px 30px; flex: 1; }

.cx-point-section { border-bottom: 1px solid var(--c-border-soft); padding: 18px 0; }
.cx-point-section:last-child { border-bottom: none; }
.cx-point-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; cursor: pointer; }
.cx-point-dot { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cx-point-dot svg { width: 17px; height: 17px; color: #fff; }
.cx-point-title { font-weight: 700; font-size: .98rem; line-height: 1.25; color: var(--c-ink); min-width: 0; flex: 1; }
.cx-prompt { font-size: .82rem; color: var(--c-ink-2); font-style: italic; line-height: 1.5; margin: 4px 0 12px; padding-left: 41px; }

.cx-chip-input { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 10px; border: 1.5px solid var(--c-border); border-radius: var(--c-radius-ctl); background: var(--c-surface); }
.cx-chip-input:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(0,98,105,.12); }
.cx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; font-size: .82rem; font-weight: 500; }
.cx-chip button { background: none; border: none; cursor: pointer; color: inherit; opacity: .65; display: flex; padding: 0; }
.cx-chip button:hover { opacity: 1; }
.cx-chip-input input { border: none; outline: none; flex: 1; min-width: 90px; font-size: .85rem; font-family: inherit; background: none; color: var(--c-ink); padding: 4px 2px; }

/* SVG star canvas */
.cx-star-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 22px; box-shadow: var(--c-shadow-card); padding: 26px; width: 100%; max-width: 880px; }
.cx-star-svg { width: 100%; height: auto; display: block; }
.cx-star-leaf { cursor: pointer; transition: opacity var(--duration-2) var(--ease); }
.cx-star-leaf:hover { opacity: .9; }
.cx-star-leaf.dim { opacity: .4; }

/* presence bar in editor */
.cx-presence { display: flex; align-items: center; gap: 4px; }

/* comment thread */
.cx-comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--c-border-soft); }
.cx-comment .cx-avatar { width: 30px; height: 30px; font-size: .72rem; }
.cx-comment-body { font-size: .85rem; line-height: 1.5; }
.cx-comment-meta { font-size: .72rem; color: var(--c-ink-2); margin-bottom: 2px; }

/* ============================================================
   MODAL
   ============================================================ */
.cx-overlay { position: fixed; inset: 0; background: rgba(10,15,25,.5); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; animation: cxFade .2s ease; }
@keyframes cxFade { from { opacity: 0; } }
.cx-modal { background: var(--c-surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; animation: cxRise .22s var(--ease); }
@keyframes cxRise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.cx-modal-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--c-border-soft); display: flex; align-items: center; justify-content: space-between; }
.cx-modal-head h3 { font-family: var(--c-head-font); font-weight: 700; font-size: 1.2rem; margin: 0; color: var(--c-ink); }
.cx-modal-body { padding: 22px 24px; overflow-y: auto; }
.cx-modal-foot { padding: 16px 24px; border-top: 1px solid var(--c-border-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* collaborator row */
.cx-collab-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.cx-collab-row .cx-avatar { width: 38px; height: 38px; }
.cx-collab-name { font-weight: 600; font-size: .9rem; color: var(--c-ink); }
.cx-collab-email { font-size: .78rem; color: var(--c-ink-2); }

/* share-with-achieva callout */
.cx-achieva-optin { border: 1.5px solid var(--soft-teal); background: #eef7f7; border-radius: 16px; padding: 18px 20px; display: flex; gap: 14px; }
[data-contrast="high"] .cx-achieva-optin { background: #fff; }
.cx-achieva-optin .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cx-achieva-optin .ic svg { width: 22px; height: 22px; color: #fff; }

/* ============================================================
   ADMIN
   ============================================================ */
.cx-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.cx-stat { padding: 20px 22px; }
.cx-stat .v { font-size: 2.1rem; font-weight: 800; line-height: 1; font-family: var(--c-head-font); }
.cx-stat .l { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c-ink-2); margin-top: 7px; }
.cx-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cx-table th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c-ink-2); padding: 13px 16px; border-bottom: 1px solid var(--c-border); background: var(--c-surface-2); }
.cx-table td { padding: 14px 16px; border-bottom: 1px solid var(--c-border-soft); color: var(--c-ink); vertical-align: middle; }
.cx-table tbody tr { cursor: pointer; transition: background var(--duration-1) var(--ease); }
.cx-table tbody tr:hover { background: rgba(0,98,105,.04); }
.cx-table tbody tr:last-child td { border-bottom: none; }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 1080px) {
  .cx-hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .cx-starwrap { max-width: 460px; margin: 0 auto; }
  .cx-feature-grid { grid-template-columns: 1fr 1fr; }
  .cx-editor-body { grid-template-columns: 1fr; }
  .cx-side { border-left: none; border-top: 1px solid var(--c-border); }
  .cx-auth { grid-template-columns: 1fr; }
  .cx-auth-aside { display: none; }
  .cx-stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .cx-sidebar { display: none; }
  .cx-feature-grid { grid-template-columns: 1fr; }
  .cx-landing-links { display: none; }
  .cx-hero, .cx-section { padding-left: 22px; padding-right: 22px; }
  .cx-page { padding: 22px 18px; }
}

