/* Deux styles, chacun disponible en clair et sombre. Aucune animation ambiante. */
:root{--surface:#fff;--surface-soft:#f0f1e9;--surface-raised:#fafaf6;--button-ink:#fff;--soft-accent:#e5edd8;--tree-dot:#cdd7be;--edge:#b7c7a5;--gold:#a27c44}
html{background-color:var(--bg,#f6f5f0)}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}
:root[data-theme="dark"]{--bg:#151e1a;--ink:#e3ece5;--muted:#b0beb3;--line:#3b4b40;--green:#b4cbaa;--lime:#394b33;--surface:#202c25;--surface-soft:#19251f;--surface-raised:#25352c;--button-ink:#19261c;--soft-accent:#354b37;--tree-dot:#455748;--edge:#89a281;--gold:#d5b779}
:root[data-ui="whimsigoth"]{--bg:#f2ebdf;--ink:#302b38;--muted:#766750;--line:#d7c7ad;--green:#65414b;--lime:#e7d9bf;--surface:#fcf7ec;--surface-soft:#eae0ce;--surface-raised:#f1e6d3;--button-ink:#fff8ec;--soft-accent:#e4d2b3;--tree-dot:#c5b38f;--edge:#9b8059;--gold:#946a33;--radius:28px}
:root[data-ui="whimsigoth"][data-theme="dark"]{--bg:#161923;--ink:#f0e4d3;--muted:#bdb3af;--line:#765947;--green:#c49877;--lime:#422d3b;--surface:#202330;--surface-soft:#191c27;--surface-raised:#292735;--button-ink:#f0e4d3;--soft-accent:#422d3b;--tree-dot:#51414b;--edge:#94705a;--gold:#c49877;--action:#3d293e}
[data-theme="dark"] body,[data-ui="whimsigoth"] body{background:var(--bg);color:var(--ink)}
[data-theme="dark"] :is(.sidebar,.mobile-nav,.budget-card,.original,.current-choices,.capture-parent,.assist-banner),[data-ui="whimsigoth"] :is(.sidebar,.mobile-nav,.budget-card,.original,.current-choices,.capture-parent,.assist-banner){background:var(--surface-soft);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] :is(.capture-box,.task-card,.calm-thought,.thought-choice,.auth-card,dialog,.pearl,.search,.layout-switch,.tree-toolbar select),[data-ui="whimsigoth"] :is(.capture-box,.task-card,.calm-thought,.thought-choice,.auth-card,dialog,.pearl,.search,.layout-switch,.tree-toolbar select){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(input,textarea,select),[data-ui="whimsigoth"] :is(input,textarea,select){color:var(--ink);background:var(--surface-raised);border-color:var(--line)}
[data-theme="dark"] #capture,[data-ui="whimsigoth"] #capture{background:transparent}
[data-theme="dark"] :is(.primary,.nav-item.active,.mobile-add,.check-button.checked),[data-ui="whimsigoth"] :is(.primary,.nav-item.active,.mobile-add,.check-button.checked){background:var(--green);color:var(--button-ink);border-color:var(--green)}
[data-theme="dark"] .primary:hover,[data-ui="whimsigoth"] .primary:hover{background:var(--green);filter:brightness(1.06)}
[data-theme="dark"] :is(.secondary,.calm-bottom .secondary,.tree-controls button,.layout-switch button.active),[data-ui="whimsigoth"] :is(.secondary,.calm-bottom .secondary,.tree-controls button,.layout-switch button.active){background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.calm-density button.active,.voice-button.is-recording,.nav-item:hover:not(.active)),[data-ui="whimsigoth"] :is(.calm-density button.active,.voice-button.is-recording,.nav-item:hover:not(.active)){background:var(--soft-accent);color:var(--ink);border-color:var(--green)}
[data-theme="dark"] :is(.calm-heading p,.calm-date,.calm-context,.calm-thought-top,.world-intro,.world-door>span:last-of-type,.world-door>.icon,.tree-hint,.pearl-caption,.quiet-link,.thought-choice span,.thought-choice small,.thought-options summary,.gentle-pages span,.nav-item,.intro p,.auth p,.eyebrow,.capture-bottom>span,.capture-caption,.task-relations button,.tags,.suggested,.classification-note,.dictation-note,.fine-print,.loading),[data-ui="whimsigoth"] :is(.calm-heading p,.calm-date,.calm-context,.calm-thought-top,.world-intro,.world-door>span:last-of-type,.world-door>.icon,.tree-hint,.pearl-caption,.quiet-link,.thought-choice span,.thought-choice small,.thought-options summary,.gentle-pages span,.nav-item,.intro p,.auth p,.eyebrow,.capture-bottom>span,.capture-caption,.task-relations button,.tags,.suggested,.classification-note,.dictation-note,.fine-print,.loading){color:var(--muted)}
[data-theme="dark"] :is(.nav-item.active,.primary,.mobile-add),[data-ui="whimsigoth"] :is(.nav-item.active,.primary,.mobile-add){color:var(--button-ink)}
[data-theme="dark"] :is(.island,.world-door,.type-world .pearl,.type-hub .pearl),[data-ui="whimsigoth"] :is(.island,.world-door,.type-world .pearl,.type-hub .pearl){background:var(--surface-raised);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] :is(.world-door-icon,.group-symbol,.group-count),[data-ui="whimsigoth"] :is(.world-door-icon,.group-symbol,.group-count){background:var(--soft-accent);color:var(--ink)}
[data-theme="dark"] :is(.board.tree,.tree-viewport),[data-ui="whimsigoth"] :is(.board.tree,.tree-viewport){background-color:var(--surface-soft);border-color:var(--line)}
[data-theme="dark"] .tree-viewport,[data-ui="whimsigoth"] .tree-viewport{background-image:radial-gradient(var(--tree-dot) 1px,transparent 1px)}
[data-theme="dark"] .branch-edge,[data-ui="whimsigoth"] .branch-edge{stroke:var(--edge)}
[data-theme="dark"] .dependency-edge,[data-ui="whimsigoth"] .dependency-edge{stroke:var(--gold)}
[data-theme="dark"] :is(.pearl-add,.pearl-check,.pearl-collapse,.pill),[data-ui="whimsigoth"] :is(.pearl-add,.pearl-check,.pearl-collapse,.pill){background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.pill.urgent,.pill.overdue,.pearl-blocked),[data-ui="whimsigoth"] :is(.pill.urgent,.pill.overdue,.pearl-blocked){background:var(--soft-accent);color:var(--ink)}
[data-theme="dark"] :is(.calm-density,.thought-options,.check-button),[data-ui="whimsigoth"] :is(.calm-density,.thought-options,.check-button){border-color:var(--line)}
[data-theme="dark"] :is(.avatar,.art-one,.art-two),[data-ui="whimsigoth"] :is(.avatar,.art-one,.art-two){background:var(--soft-accent);color:var(--ink)}
[data-theme="dark"] ::placeholder{color:#a4b1a7;opacity:1}
[data-ui="whimsigoth"][data-theme="dark"] ::placeholder{color:#b9ac96}
[data-ui="whimsigoth"][data-theme="light"] ::placeholder{color:var(--muted);opacity:1}
[data-ui="whimsigoth"] .main{background-image:radial-gradient(ellipse at 95% 2%,#7a344629,transparent 52%),radial-gradient(ellipse at 5% 75%,#a5814a12,transparent 48%)}
[data-ui="whimsigoth"] :is(.intro h1,.auth h1){font-family:Georgia,'Times New Roman',serif;font-weight:500;letter-spacing:-1.6px}
[data-ui="whimsigoth"] :is(.capture-box,.calm-thought,.task-card,.world-door,dialog){border-radius:28px;box-shadow:0 10px 35px #2010290b}
[data-ui="whimsigoth"] .calm-thought{background-image:radial-gradient(ellipse at 100% 0%,#8e3b4514,transparent 55%)}
[data-ui="whimsigoth"] .intro{position:relative}
[data-ui="whimsigoth"] .intro::after{content:'☾  ·  ✧';position:absolute;right:4px;top:18px;color:var(--gold);font-size:26px;letter-spacing:8px;pointer-events:none;opacity:.65}
[data-ui="whimsigoth"] .pearl{box-shadow:0 0 0 6px #ba965610,0 8px 24px #17102314}
[data-ui="whimsigoth"] .world-door.color-1{background-image:linear-gradient(145deg,transparent,#74444b24)}
[data-ui="whimsigoth"] .world-door.color-2{background-image:linear-gradient(145deg,transparent,#b2915718)}
dialog::backdrop{background:#14201d70;backdrop-filter:blur(6px)}
[data-theme="dark"] dialog::backdrop{background:#08060daf}
.appearance-form{margin:18px 0 24px}
.appearance-form>label{display:block;margin-bottom:16px}
.appearance-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}
.appearance-choice{display:flex;flex-direction:column;text-align:left;gap:9px;padding:16px;border:2px solid var(--line);border-radius:18px;color:var(--ink);background:var(--surface);min-height:150px}
.appearance-choice[aria-pressed="true"]{border-color:var(--green);box-shadow:0 0 0 2px var(--soft-accent)}
.appearance-choice strong{font-size:15px}.appearance-choice small{color:var(--muted);line-height:1.5}
.appearance-swatch{width:100%;height:42px;border-radius:10px;background:linear-gradient(120deg,#e9eddf,#b9cba5);display:flex;align-items:center;justify-content:space-around;color:#355041}
.appearance-swatch.mystic{background:linear-gradient(120deg,#152238,#603b46);color:#e2cda2;font-size:20px}
@media(prefers-reduced-motion:no-preference){[data-ui="whimsigoth"] .world-door{transition:border-color .16s,box-shadow .16s}}
@media(max-width:600px){[data-ui="whimsigoth"] .intro::after{font-size:20px;top:15px;right:0}.appearance-choice{padding:12px}}

[data-ui="whimsigoth"] .brand{font-family:Georgia,serif;font-weight:600;letter-spacing:-.5px}
[data-ui="whimsigoth"] .calm-thought h3{font-family:Georgia,serif;font-size:23px;letter-spacing:0}
[data-ui="whimsigoth"] .world-door{border:1px solid var(--line)}
[data-ui="whimsigoth"] .appearance-choice[aria-pressed="true"]{border-color:var(--gold)}
[data-ui="whimsigoth"] .eyebrow{letter-spacing:1.8px}
[data-ui="whimsigoth"][data-theme="dark"] .world-door{background-image:linear-gradient(140deg,#68404c20,transparent 65%)}
[data-theme="dark"] .icon-button:hover,[data-ui="whimsigoth"] .icon-button:hover{background:var(--surface-raised)}
[data-theme="dark"] .mobile-nav .nav-item.active,[data-ui="whimsigoth"] .mobile-nav .nav-item.active{color:var(--button-ink)}
[data-theme="dark"] .tree-node.is-idea .pearl,[data-theme="dark"] .tree-node.is-done .pearl,[data-ui="whimsigoth"] .tree-node.is-idea .pearl,[data-ui="whimsigoth"] .tree-node.is-done .pearl{background:var(--surface-raised);border-color:var(--line)}
[data-theme="dark"] .pearl-caption span,[data-ui="whimsigoth"] .pearl-caption span{background:var(--surface-raised);color:var(--muted);border-color:var(--line)}

/* Sceau ancien : prune, cuivre et dégradés fixes, sans modifier la géométrie du micro. */
[data-ui="whimsigoth"][data-theme="dark"] .main{background-image:radial-gradient(ellipse at 100% 8%,#71304f48,transparent 55%),radial-gradient(ellipse at 0% 65%,#23425a38,transparent 60%)}
[data-ui="whimsigoth"][data-theme="dark"] :is(.capture-box,.calm-thought,.task-card,.world-door,.auth-card,dialog){background-image:linear-gradient(125deg,#25435946,transparent 48%,#642d4d38);box-shadow:inset 0 0 0 1px #b68a6310,0 12px 36px #090b1420}
[data-ui="whimsigoth"][data-theme="dark"] :is(.primary,.mobile-add,.nav-item.active,.check-button.checked,.pearl-check.checked,.voice-button,.voice-button.is-recording,.calm-density button.active){background:linear-gradient(120deg,#502e46,var(--action));color:var(--button-ink);border-color:#a37554;box-shadow:inset 0 0 0 1px #a37554}
[data-ui="whimsigoth"][data-theme="dark"] .primary:hover{background:linear-gradient(120deg,#5a334e,#442c46);filter:none}
[data-ui="whimsigoth"][data-theme="dark"] .mobile-nav .nav-item.active{color:var(--button-ink)}
[data-ui="whimsigoth"][data-theme="dark"] .sidebar .nav-item.active{color:var(--button-ink)}
[data-ui="whimsigoth"][data-theme="dark"] .mobile-nav{background:linear-gradient(120deg,#171d29f5,#241c2bf5)}
[data-ui="whimsigoth"][data-theme="dark"] .sidebar{background:linear-gradient(170deg,#191e2b,#221c2a)}

/* Le champ de recherche partage la surface de son conteneur. */
[data-theme="dark"] .search input,[data-ui="whimsigoth"] .search input{background:transparent;color:var(--ink);padding-left:0;padding-right:0}
.search .icon{flex-shrink:0}
[data-theme="dark"] .filter-chip,[data-ui="whimsigoth"] .filter-chip{background:var(--soft-accent);color:var(--ink);border:1px solid var(--line);min-height:44px}
@media(max-width:800px){
  .filters{grid-template-columns:minmax(0,1fr) auto}
  .filters .search{grid-column:1/-1}
  .filters .new-group{grid-column:2;justify-self:end}
  .filters select{grid-column:1;max-width:none}
}
