/* La Carte Eternelle — canonical visual system v1
   One palette, one typography, one radius language across the whole product.
   Media/photos keep their own imagery; UI chrome is neutral black/white/gray. */

:root,
html[data-lce-theme="light"]{
  --lce-ui-bg:#f5f5f7;
  --lce-ui-surface:#ffffff;
  --lce-ui-surface-2:#f2f2f4;
  --lce-ui-surface-3:#e9e9ed;
  --lce-ui-text:#050505;
  --lce-ui-muted:#6e6e73;
  --lce-ui-faint:#8e8e93;
  --lce-ui-line:rgba(0,0,0,.12);
  --lce-ui-line-strong:rgba(0,0,0,.22);
  --lce-ui-shadow:0 16px 45px rgba(0,0,0,.07);
  --lce-ui-blue:#0a84ff;
  --lce-ui-card-radius:22px;
  --lce-ui-modal-radius:26px;
  --lce-ui-control-radius:14px;
  --lce-ui-pill-radius:999px;
  color-scheme:light;

  /* aliases used by older/current modules */
  --v9-bg:var(--lce-ui-bg);
  --v9-surface:var(--lce-ui-surface);
  --v9-surface-2:var(--lce-ui-surface-2);
  --v9-ink:var(--lce-ui-text);
  --v9-muted:var(--lce-ui-muted);
  --v9-faint:var(--lce-ui-faint);
  --v9-line:var(--lce-ui-line);
  --v9-shadow:var(--lce-ui-shadow);
  --bg:var(--lce-ui-bg);
  --paper:var(--lce-ui-surface);
  --ink:var(--lce-ui-text);
  --mut:var(--lce-ui-muted);
  --line:var(--lce-ui-line);
  --green:var(--lce-ui-text);
  --green2:var(--lce-ui-text);
  --rose:var(--lce-ui-text);
  --s2-ink:var(--lce-ui-text);
  --s2-ink2:var(--lce-ui-text);
  --s2-wine:var(--lce-ui-text);
  --s2-cream:var(--lce-ui-surface);
  --s2-gold:var(--lce-ui-muted);
  --s2-line:var(--lce-ui-line);
  --s2-soft:var(--lce-ui-surface-2);
}

html[data-lce-theme="dark"]{
  --lce-ui-bg:#000000;
  --lce-ui-surface:#0b0b0c;
  --lce-ui-surface-2:#151517;
  --lce-ui-surface-3:#232326;
  --lce-ui-text:#ffffff;
  --lce-ui-muted:#a1a1a6;
  --lce-ui-faint:#8e8e93;
  --lce-ui-line:rgba(255,255,255,.22);
  --lce-ui-line-strong:rgba(255,255,255,.42);
  --lce-ui-shadow:0 18px 55px rgba(0,0,0,.58);
  --lce-ui-blue:#0a84ff;
  color-scheme:dark;

  --v9-bg:var(--lce-ui-bg);
  --v9-surface:var(--lce-ui-surface);
  --v9-surface-2:var(--lce-ui-surface-2);
  --v9-ink:var(--lce-ui-text);
  --v9-muted:var(--lce-ui-muted);
  --v9-faint:var(--lce-ui-faint);
  --v9-line:var(--lce-ui-line);
  --v9-shadow:var(--lce-ui-shadow);
  --bg:var(--lce-ui-bg);
  --paper:var(--lce-ui-surface);
  --ink:var(--lce-ui-text);
  --mut:var(--lce-ui-muted);
  --line:var(--lce-ui-line);
  --green:var(--lce-ui-text);
  --green2:var(--lce-ui-text);
  --rose:var(--lce-ui-text);
  --s2-ink:var(--lce-ui-text);
  --s2-ink2:var(--lce-ui-text);
  --s2-wine:var(--lce-ui-text);
  --s2-cream:var(--lce-ui-bg);
  --s2-gold:var(--lce-ui-muted);
  --s2-line:var(--lce-ui-line);
  --s2-soft:var(--lce-ui-surface-2);
}

/* Typography */
html body,
html body *:not(svg):not(path):not(g):not(code):not(pre){
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{
  color:var(--lce-ui-text)!important;
  font-style:normal!important;
}
html body .mut,html body [class*="muted"],html body small,
html body .hero p,html body .lce-v9-desc,html body .lce-v9-sub{
  color:var(--lce-ui-muted)!important;
}
html body .kicker,html body .lce-v9-eyebrow{
  color:var(--lce-ui-faint)!important;
}

/* App shell */
html,html body,html body .app,html body main,
html body .page,html body #lce-v10-journey{
  background-color:var(--lce-ui-bg)!important;
  color:var(--lce-ui-text)!important;
}
html body .sidebar{
  background:var(--lce-ui-surface)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  box-shadow:none!important;
}
html body .sidebar-foot{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-muted)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-control-radius)!important;
}
html body #nav button{
  color:var(--lce-ui-muted)!important;
  border-radius:var(--lce-ui-control-radius)!important;
}
html body #nav button:hover,html body #nav button.active,html body #nav button.lce-v10-current{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  transform:none!important;
}

/* Common cards and structural surfaces. Visual/photo containers are intentionally excluded. */
html body .lce-v9-hero,
html body .panel,html body .card,html body .stat,html body .event,html body .place,html body .mini,
html body .lce-entry,html body .lce-empty,html body .quick button,
html body .mem-final-card,html body .mem-final-stat,html body .people-final-stat,
html body .people-upcoming,html body .people-search,
html body .legacy-hero-v2,html body .legacy-progress-card-v2,html body .legacy-card-v2,html body .legacy-note-v2,
html body .journal-prompts-v3,html body .journal-card-v2,html body .journal-media-v1,html body .journal-media-row-v1,
html body .sp2-summary-card,html body .sp2-card,
html body #tv .fc1,html body #tv .fc1-card,html body #tv .rt4-note,
html body #tv #rt-room-active,html body #tv #rt-workspace,html body #tv #rt-workspace>.panel{
  background-color:var(--lce-ui-surface)!important;
  background-image:none!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  box-shadow:var(--lce-ui-shadow)!important;
  border-radius:var(--lce-ui-card-radius)!important;
}
html[data-lce-theme="dark"] body .lce-v9-hero,
html[data-lce-theme="dark"] body .panel,html[data-lce-theme="dark"] body .card,
html[data-lce-theme="dark"] body .stat,html[data-lce-theme="dark"] body .event,
html[data-lce-theme="dark"] body .place,html[data-lce-theme="dark"] body .mini,
html[data-lce-theme="dark"] body .lce-entry,
html[data-lce-theme="dark"] body .sp2-summary-card,html[data-lce-theme="dark"] body .sp2-card{
  box-shadow:none!important;
}

/* Buttons */
html body button,html body [role="button"],html body .primary,html body .soft,html body .lce-mini,
html body .sp2-btn,html body .lce-section-create-btn{
  border-radius:var(--lce-ui-pill-radius)!important;
  box-shadow:none!important;
  font-weight:600!important;
}
html[data-lce-theme="light"] body .primary,
html[data-lce-theme="light"] body button.primary,
html[data-lce-theme="light"] body .lce-section-create-btn,
html[data-lce-theme="light"] body .people-complete-submit,
html[data-lce-theme="light"] body .sp2-btn.primary{
  background:#050505!important;color:#fff!important;border-color:#050505!important;
}
html[data-lce-theme="dark"] body .primary,
html[data-lce-theme="dark"] body button.primary,
html[data-lce-theme="dark"] body .lce-section-create-btn,
html[data-lce-theme="dark"] body .people-complete-submit,
html[data-lce-theme="dark"] body .sp2-btn.primary{
  background:#fff!important;color:#050505!important;border-color:#fff!important;
}
html body .soft,html body button.soft,html body .lce-mini,
html body .sp2-btn:not(.primary),html body .people-complete-photo-actions button,
html body .lce-modal button:not(.primary),html body .caps-seal-confirm button:not(.primary){
  background:var(--lce-ui-surface)!important;
  color:var(--lce-ui-text)!important;
  border:1px solid var(--lce-ui-line)!important;
}
html body .soft:hover,html body button.soft:hover,html body .lce-mini:hover,
html body .sp2-btn:not(.primary):hover{
  background:var(--lce-ui-surface-2)!important;
  border-color:var(--lce-ui-line-strong)!important;
  transform:none!important;
}

/* Fields */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html body textarea,html body select,html body .field,html body .search,
html body .sp2-input,html body .sp2-select,html body .ai-p1-input{
  background:var(--lce-ui-surface)!important;
  background-image:none!important;
  color:var(--lce-ui-text)!important;
  border:1px solid var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-control-radius)!important;
  box-shadow:none!important;
}
html body textarea{border-radius:18px!important}
html body input::placeholder,html body textarea::placeholder{
  color:var(--lce-ui-faint)!important;opacity:1!important;
}
html body input:focus,html body textarea:focus,html body select:focus,
html body .sp2-input:focus,html body .sp2-select:focus{
  outline:none!important;
  border-color:var(--lce-ui-line-strong)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--lce-ui-text) 8%,transparent)!important;
}

/* Chips / tabs / filters */
html body .chip,html body [class*="-chip"],html body .mem-emotion,
html body .mem-final-filter,html body .mem-final-year,html body .people-filter,
html body #moi .moi-tabs,html body #moi .moi-tabs button,
html body #tv .fc1-tab,html body .sp2-badge{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  box-shadow:none!important;
}
html body .chip,html body [class*="-chip"],html body .mem-emotion,
html body .mem-final-filter,html body .mem-final-year,html body .people-filter,
html body #tv .fc1-tab,html body .sp2-badge{
  border-radius:var(--lce-ui-pill-radius)!important;
}
html body .mem-final-filter.active,html body .mem-final-year.active,
html body .people-filter.active,html body #moi .moi-tabs button.active,
html body #tv .fc1-tab.on{
  background:var(--lce-ui-text)!important;
  color:var(--lce-ui-bg)!important;
  border-color:var(--lce-ui-text)!important;
}

/* Drawers and modals */
html body #drawer,html body .drawerhead,
html body .lce-modal,html body .caps-seal-confirm,html body .people-complete-modal,
html body .heritage-modal-v2,html body .sp1-modal,html body .sp2-modal,
html body .ai-v4-modal,html body .ai-v6-modal,
html body dialog,html body [role="dialog"][aria-modal="true"]{
  background:var(--lce-ui-surface)!important;
  background-image:none!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-modal-radius)!important;
  box-shadow:0 28px 90px rgba(0,0,0,.22)!important;
}
html[data-lce-theme="dark"] body #drawer,
html[data-lce-theme="dark"] body .lce-modal,
html[data-lce-theme="dark"] body .caps-seal-confirm,
html[data-lce-theme="dark"] body .people-complete-modal,
html[data-lce-theme="dark"] body .heritage-modal-v2,
html[data-lce-theme="dark"] body dialog,
html[data-lce-theme="dark"] body [role="dialog"][aria-modal="true"]{
  box-shadow:0 28px 90px rgba(0,0,0,.64)!important;
}
html body .lce-modalback,html body .caps-seal-confirmback,html body .people-complete-back,
html body .heritage-modalback-v2,html body [class*="modalback"],html body [class*="-backdrop"]{
  background:rgba(0,0,0,.62)!important;
  -webkit-backdrop-filter:blur(16px)!important;
  backdrop-filter:blur(16px)!important;
}
html body .lce-modalhead,html body .drawerhead,html body .people-complete-head{
  border-color:var(--lce-ui-line)!important;
}

/* People form */
html body .people-complete-section{
  background:transparent!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:18px!important;
}
html body .people-complete-photo,html body .people-complete-photo-preview{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:18px!important;
}

/* Settings: remove remaining green/gold styling. */
html body #settings .sp2-nav{
  background:var(--lce-ui-surface)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-card-radius)!important;
  box-shadow:none!important;
}
html body #settings .sp2-nav button{
  color:var(--lce-ui-muted)!important;
  background:transparent!important;
}
html body #settings .sp2-nav button:hover,html body #settings .sp2-nav button.active{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
}
html body #settings .sp2-nav i,
html body #settings .sp2-choice,html body #settings .sp2-status,html body #settings .sp2-warning{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}
html body #settings .sp2-choice{border-radius:var(--lce-ui-control-radius)!important}
html body #settings .sp2-choice.active{
  background:var(--lce-ui-surface-3)!important;
  border-color:var(--lce-ui-line-strong)!important;
}
html body #settings .sp2-switch span{background:var(--lce-ui-surface-3)!important;border-color:var(--lce-ui-line)!important}
html body #settings .sp2-switch input:checked+span{background:var(--lce-ui-text)!important;border-color:var(--lce-ui-text)!important}
html body #settings .sp2-switch input:checked+span:after{background:var(--lce-ui-bg)!important}
html body #settings .sp2-meter{background:var(--lce-ui-surface-3)!important}
html body #settings .sp2-meter>i{background:var(--lce-ui-text)!important}
html body #settings .sp2-avatar{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}
html body #settings .sp2-accentdot{background:var(--lce-ui-text)!important}

/* Mon Univers: neutral chrome while keeping the user's photos/media. */
html body #moi>.hero{
  background:var(--lce-ui-surface)!important;
  background-image:none!important;
  color:var(--lce-ui-text)!important;
  border:1px solid var(--lce-ui-line)!important;
  box-shadow:var(--lce-ui-shadow)!important;
}
html body #moi>.hero:before,html body #moi>.hero:after{display:none!important}
html body #moi>.hero h1{color:var(--lce-ui-text)!important}
html body #moi>.hero p{color:var(--lce-ui-muted)!important}
html body #moi>.hero .kicker{color:var(--lce-ui-faint)!important}
html body #moi .u3-favorites,
html body #moi .moi-empty,
html body #moi #univers-overview-v1,
html body #moi #univers-like-tools-v1{
  background:var(--lce-ui-surface)!important;
  background-image:none!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  box-shadow:none!important;
}
html body #moi #univers-overview-v1 .univers-stat-v1{
  background:var(--lce-ui-surface)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}
html body #moi .u3-fav-item{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}
html body #moi .u4-board-label,html body #moi .u3-cover-cat,
html body #moi .u3-cover-platform,html body #moi .u4-goal .eyebrow{
  background:rgba(0,0,0,.68)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.22)!important;
}

/* Journal + Heritage */
html body #journal #depth-journal-prompts.journal-prompts-v3,
html body #legacy .legacy-overview-v2{
  background:var(--lce-ui-bg)!important;
  color:var(--lce-ui-text)!important;
}
html body #journal .journal-prompt-v3,html body #journal .journal-prompt-count-v3,
html body #legacy .legacy-card-stats-v2 span,html body #legacy .legacy-state-v2,html body #legacy .legacy-icon-v2{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-control-radius)!important;
}
html body #legacy .legacy-progress-track-v2{background:var(--lce-ui-surface-3)!important}
html body #legacy .legacy-progress-fill-v2{background:var(--lce-ui-text)!important}

/* Salon */
html body #tv,html body #tv.salon-premium-v1{
  background:var(--lce-ui-bg)!important;
  color:var(--lce-ui-text)!important;
}
html body #tv .fc1-tabs,html body #tv .fc1-search,html body #tv #rt-chat,
html body #tv .lce-chatmsg,html body #tv .rt4-provider{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}

/* AI: keep the user's canonical blue bubble; assistant follows the global theme. */
html body #ai,html body #ai .ai-p1-layout,html body #ai .ai-p1-main,
html body #ai .ai-p1-side,html body #ai .ai-p1-chatcard,
html body #ai .ai-p1-chathead,html body #ai .ai-p1-chat,html body #ai .ai-p1-compose{
  background:var(--lce-ui-bg)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
}
html body #ai .ai-p1-message.me .ai-p1-bubble,
html body #ai .bubble.me{
  background:#0a84ff!important;
  color:#fff!important;
  border-color:#0a84ff!important;
  border-radius:18px 18px 6px 18px!important;
  box-shadow:none!important;
}
html body #ai .ai-p1-message.ai .ai-p1-bubble,
html body #ai .bubble.ai{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border:1px solid var(--lce-ui-line)!important;
  border-radius:18px 18px 18px 6px!important;
  box-shadow:none!important;
}
html body #ai .ai-p1-source,html body #ai .ai-p1-stat,html body #ai .ai-p1-note,
html body #ai .ai-p1-iconbtn,html body #ai .ai-v3-block,html body #ai .ai-v3-conv{
  background:var(--lce-ui-surface-2)!important;
  color:var(--lce-ui-text)!important;
  border-color:var(--lce-ui-line)!important;
  border-radius:var(--lce-ui-control-radius)!important;
}

/* Keep visual language consistent on mobile without changing the responsive layout. */
@media(max-width:820px){
  html body .lce-v9-hero,html body .card,html body .panel,
  html body .people-complete-modal,html body .lce-modal,
  html body .legacy-card-v2,html body .legacy-hero-v2,
  html body #ai .ai-p1-chatcard{
    border-radius:20px!important;
  }
  html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  html body textarea,html body select{border-radius:13px!important}
}
