:root {
  color-scheme: light;
  font: 100%/1.55 "Inter", system-ui, sans-serif;
  color: #182820;
  background: #f2f4ed;
  --green: #234c3c;
  --line: #c9d3c8;
}
* { box-sizing: border-box; }
body { margin: 0; }
.top, main { width: min(100% - 2rem, 44rem); margin: auto; }
.top { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 0; font-weight: 700; }
.mark { color: var(--green); font-size: 1.6rem; }
main { padding: .5rem 0 3rem; }
.intro, .card, .library { border: 1px solid var(--line); border-radius: 1.35rem; background: #fffefa; }
.intro { padding: clamp(1.25rem, 5vw, 2.75rem); }
h1, h2 { font: 500 clamp(2.1rem, 7vw, 3.75rem)/1.03 Georgia, serif; letter-spacing: -.04em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 5vw, 2.85rem); }
p { margin: .7rem 0 1rem; }
form { display: grid; gap: .65rem; margin-top: 1.6rem; }
label, summary { font-weight: 650; }
textarea, button { font: inherit; }
textarea { width: 100%; border: 1px solid #83988c; border-radius: .75rem; padding: .85rem; resize: vertical; background: #fff; color: inherit; }
button { cursor: pointer; color: var(--green); border: 1px solid var(--line); background: #edf3ea; border-radius: .7rem; min-height: 2.75rem; padding: .45rem .8rem; }
button:hover { background: #dceadc; }
.primary { background: var(--green); color: white; font-weight: 700; }
.primary:hover { background: #19392d; }
:focus-visible { outline: 3px solid #496fb0; outline-offset: 3px; }
.examples { margin-top: 1.25rem; }
.examples p { margin-bottom: .45rem; }
.examples button { margin: 0 .15rem .35rem 0; }
#status:empty { display: none; }
#status { background: #e1ebdc; border-radius: .75rem; padding: .8rem 1rem; }
.card { overflow: hidden; margin: 1rem 0; }
.cover { display: block; width: 100%; aspect-ratio: 3.85; object-fit: cover; object-position: top; }
.card-body { padding: clamp(1rem, 4vw, 2rem); }
.card-body details { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: .85rem 0; }
.card-body ul { padding-left: 1.4rem; }
.card-body li + li { margin-top: .4rem; }
.original img { display: block; width: 100%; height: auto; }
.original a { display: inline-block; margin-bottom: .6rem; color: var(--green); }
.library { padding: .15rem 1rem; margin-top: 1rem; }
#library-list { display: grid; gap: .45rem; padding-bottom: .85rem; }
#library-list button { text-align: left; }
.card-body > p:first-of-type { font-family: Georgia, serif; font-size: 1.2rem; font-style: italic; }
.card-body summary { color: var(--green); }
.card-body summary span { color: #42584b; font-weight: 450; }
.card-body h3 { font-size: 1rem; margin: .85rem 0 .2rem; }
.card-body h3 + ul { margin-top: .2rem; }
.card-body ol { padding-left: 1.5rem; }
blockquote { margin: .85rem 0 1.2rem; padding: .8rem 1rem; border-left: .22rem solid #6d8e76; background: #edf3ea; font-family: inherit; font-size: 1.02rem; font-style: italic; }
.reminders blockquote { margin: .9rem 0; }
.return-card { display: block; margin-bottom: 1rem; }
.related { border-top: 1px solid var(--line); padding-top: .4rem; }
.related button { display: block; width: 100%; margin-top: .65rem; padding: .8rem 1rem; text-align: left; }
.related button span { display: block; margin-top: .2rem; color: #42584b; }
.views { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.views [aria-pressed="true"] { background: var(--green); color: white; }
#step-time { font: inherit; min-height: 2.75rem; width: 100%; border: 1px solid #83988c; border-radius: .7rem; padding: .55rem; background: white; color: inherit; }
.step-note { color: #42584b; }
#step-list { list-style: none; padding: 0; }
.planned-step { display: grid; gap: .45rem; border-top: 1px solid var(--line); padding: .85rem 0; overflow-wrap: anywhere; }
.step-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.step-actions button { min-width: 0; font-size: .875rem; padding-inline: .55rem; }
.step-alert { display: block; width: 100%; margin-bottom: .6rem; text-align: left; font-weight: 650; }
#install-app { margin-inline-start: auto; }


:root {
  color-scheme: dark;
  color: #f7f2ff;
  background: #151123;
  --green: #d9c6ff;
  --line: #504461;
}
body {
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% -20%, #51406b, transparent 65%), #151123;
}
[hidden] { display: none !important; }
.top, main { width: min(100%, 29rem); }
.top { background: #211b35; padding: .9rem 1.1rem; }
.top { padding-top: calc(.9rem + env(safe-area-inset-top)); }
.top, main {
  padding-left: max(1.1rem, env(safe-area-inset-left));
  padding-right: max(1.1rem, env(safe-area-inset-right));
}
.mark { display: grid; place-items: center; width: 2rem; height: 2rem; color: #24193d; background: #d8c1ff; border-radius: .68rem; }
main {
  padding: .4rem 1.1rem calc(5.8rem + env(safe-area-inset-bottom));
  min-height: calc(100svh - 3.8rem);
  background: #211b35;
}
h1, h2 { font-family: system-ui, sans-serif; font-weight: 750; letter-spacing: -.045em; }
h1 { font-size: clamp(1.85rem, 7vw, 2.55rem); }
h2 { font-size: clamp(1.55rem, 6vw, 2rem); }
.intro { padding: .75rem 0 0; border: 0; background: transparent; }
.intro > p { color: #d7cce8; }
form { margin-top: 1.1rem; }
textarea, #step-time {
  min-width: 0;
  color: #fff8ff;
  background: #33294b;
  border: 1px solid #655578;
  border-radius: 1rem;
}
textarea::placeholder { color: #cebedf; }
button { color: #f3eaff; background: #392e51; }
button:hover { background: #493a65; }
.primary, .primary:hover {
  color: #261838;
  background: linear-gradient(120deg, #e2c3ff, #f6bfcf);
  border: 0;
  min-height: 3rem;
}
:focus-visible { outline-color: #f1bff1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.examples { margin-top: 1.65rem; }
.examples h2 { margin-bottom: .75rem; font-size: 1.2rem; letter-spacing: -.02em; }
.photo-grid { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.photo-grid .photo-tile { min-height: clamp(5.5rem, calc((100svh - 34rem) / 3), 10rem); }
.photo-tile {
  position: relative;
  display: flex;
  align-items: end;
  isolation: isolate;
  min-height: 6.3rem;
  overflow: hidden;
  padding: .75rem;
  border-radius: 1rem;
  text-align: left;
  color: white;
}
.examples .photo-tile { margin: 0; }
.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 12%, #21182bea 98%);
}
.photo-tile img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.photo-tile strong { line-height: 1.2; padding: .35rem .5rem; background: #1a132ae0; border-radius: .45rem; }
#library-list { margin-top: 1.1rem; gap: .75rem; }
#library-list .photo-tile { min-height: clamp(8rem, calc((100svh - 13rem) / 3), 18rem); }
.welcome { display: grid; gap: .9rem; }
.welcome p { margin: 0 0 .45rem; }
.welcome-visual { height: 13rem; position: relative; margin-top: .75rem; }
.welcome-visual img {
  position: absolute;
  left: 50%;
  top: .85rem;
  width: 38%;
  height: 10.8rem;
  object-fit: cover;
  object-position: top;
  border-radius: 1rem;
  border: 2px solid #ac91c6;
  box-shadow: 0 .5rem 1.5rem #0f0922a0;
}
.welcome-visual img:first-child { transform: translateX(-117%) rotate(-10deg); }
.welcome-visual img:last-child { transform: translateX(17%) rotate(10deg); }
.welcome-visual img:nth-child(2) { z-index: 1; top: 0; transform: translateX(-50%); height: 12rem; }
.views {
  position: fixed;
  z-index: 5;
  inset: auto auto 0 50%;
  transform: translateX(-50%);
  width: min(100%, 29rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .3rem;
  margin: 0;
  padding: .45rem .7rem calc(.4rem + env(safe-area-inset-bottom));
  background: #29213e;
  border-top: 1px solid #524461;
}
.views button { display: grid; justify-items: center; gap: .1rem; border: 0; background: transparent; font-size: .83rem; color: #ded1ef; }
.views button { min-width: 0; padding-inline: .2rem; }
.views button span { font-size: 1.3rem; line-height: 1.15; }
.views [aria-pressed="true"] { color: #f7e9ff; background: #4b3868; }
.card { margin-top: 0; background: #2c2341; }
.card .cover { aspect-ratio: 3.8; }
.back-guide { margin: .6rem; }
.card-body summary span, .related button span, .step-note { color: #d7cce8; }
blockquote { background: #382d50; border-color: #b697df; }
#status { background: #392e51; }
.step-alert { background: #4b3868; }
#steps { min-height: calc(100svh - 9rem - env(safe-area-inset-bottom)); }
#steps:has(.step-empty:not([hidden])) { display: flex; flex-direction: column; }
#step-list:empty { display: none; }
.step-empty {
  flex: 1;
  min-height: 12rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .65rem;
  padding: 1.25rem;
  text-align: center;
  background: #2c2341;
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.step-empty span { color: #e2c3ff; font-size: 1.55rem; }
.step-empty h2 { font-size: 1.2rem; }
.step-empty p { margin: 0; color: #d7cce8; }

@media (max-width: 350px) {
  .top, main { padding-inline: .8rem; }
  .views button { font-size: .78rem; }
  .card-body { padding-inline: .8rem; }
}

/* Repères */
:root {
  color: #eefbf6;
  background: #081b18;
  --green: #9de6c9;
  --line: #315d51;
  --surface: #102b25;
  --panel: #153c32;
  --muted: #b5d5ca;
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
}
body { background: radial-gradient(ellipse at 50% -15%, #1d5b4c, transparent 62%), #081b18; }
.top, main { background: var(--surface); }
.top { gap: .6rem; font: 700 1.45rem/1 var(--display); letter-spacing: -.035em; border-bottom: 1px solid #ffffff12; }
.mark { background: #9be7ce; color: #123b31; width: 2.25rem; height: 2.25rem; }
.mark svg, .views svg, .step-empty svg { display: block; width: 1.35rem; height: 1.35rem; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.045em; line-height: 1.08; }
h1 { font-size: clamp(2.1rem, 8vw, 3.1rem); }
h2 { font-size: clamp(1.85rem, 7vw, 2.5rem); }
.intro { padding-top: 1.1rem; }
.intro > p, .card-body summary span, .related button span, .step-note, .step-empty p { color: var(--muted); }
.welcome { padding-top: 1.65rem; gap: 1rem; }
.welcome h1 { font-size: clamp(2.5rem, 10vw, 3.6rem); }
.welcome-visual { height: clamp(13rem, 36svh, 19rem); margin: 0 0 .6rem; border-radius: 1.4rem; background: radial-gradient(ellipse at center, #3d6854, transparent 72%); }
.welcome-visual img { width: 40%; height: 72%; top: 14%; border-color: #5ea38f; box-shadow: 0 .8rem 1.6rem #081711a0; }
.welcome-visual img:nth-child(2) { top: 7%; height: 86%; }
textarea, #step-time { background: #19382f; border-color: #537468; color: #eefbf6; }
textarea::placeholder { color: #b6c9bc; }
button { background: #24463b; color: #f7f3e8; }
button:hover { background: #315648; }
.primary, .primary:hover { background: linear-gradient(112deg, #a5efd3, #c4f5ac); color: #10372c; font-weight: 750; }
.primary:hover { background: #c1f8e2; }
:focus-visible { outline-color: #c4fae9; }
.views { background: #152f28; border-color: var(--line); padding-block-start: .5rem; }
.views button { color: #c7d8cd; padding-block: .45rem; }
.views [aria-pressed="true"] { background: #266353; color: #d0ffed; }
.examples h2 { font-size: 1.55rem; }
.photo-tile { border-color: #688476; }
.photo-tile::after { background: linear-gradient(transparent 15%, #0a1e18eb 100%); }
.photo-tile strong { background: #102822e8; }
#library-list .photo-tile { min-height: clamp(9rem, calc((100svh - 17rem) / 3), 16rem); }
.card, .step-empty { background: var(--panel); }
.card .cover { aspect-ratio: 2.65; }
.card-body details { border: 1px solid var(--line); background: #142e26; border-radius: .85rem; margin: .6rem 0; padding: 0 .9rem; }
.card-body details[open] { padding-bottom: .85rem; border-color: #63ac96; }
.card-body summary { position: relative; list-style: none; padding: .75rem 1.45rem .75rem 0; color: #edfdf6; }
.card-body summary::-webkit-details-marker { display: none; }
.card-body summary::after { content: "+"; position: absolute; right: 0; top: .75rem; color: var(--green); font-weight: 500; }
.card-body details[open] summary::after { content: "−"; }
.card-body summary strong, .card-body summary span { display: block; }
.card-body summary span { font-size: .87rem; line-height: 1.3; }
.card-body > p:first-of-type { font-family: inherit; font-style: normal; font-weight: 550; color: #b7efdb; }
blockquote { background: #254236; border-color: #76c7ac; }
#status, .step-alert { background: #2d5143; }
#steps form { padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.step-empty svg { color: var(--green); }

/* Hiérarchie des textes */
:root {
  --heading: #a5efd3;
  --subheading: #d3eaa7;
  --copy: #eefbf6;
}
h1, h2 { color: var(--heading); }
.card-body h3, .planned-step > strong { color: var(--subheading); }
.card-body summary strong, .card-body .original summary { color: var(--heading); }
.card-body details[open] summary strong, .card-body .original[open] summary { color: var(--subheading); }
.card-body summary span, .planned-step > span { color: var(--muted); }
.card-body > p:first-of-type { color: var(--muted); }
.card-body li { color: var(--copy); }
.photo-tile strong { color: var(--heading); background: #102822f2; }

@font-face {
  font-family: "Inter";
  src: url("assets/inter-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

#library-filter {
  display: block;
  width: 100%;
  margin-top: .4rem;
  min-height: 2.75rem;
  padding: .65rem .85rem;
  font: inherit;
  color: var(--copy);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .8rem;
}
#library-list section { display: grid; gap: .4rem; }
#library-list h2 { font-size: 1.25rem; margin-block: .6rem .2rem; }
#library-list button { color: var(--heading); }
.theme-family { color: var(--muted); font-weight: 650; margin-bottom: .5rem; }

#library-list details { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding-inline: .65rem; }
#library-list summary, #library-list button { display: flex; align-items: center; gap: .65rem; }
#library-list summary { list-style: none; color: var(--heading); }
#library-list summary::-webkit-details-marker { display: none; }
#library-list summary::after { content: "+"; margin-inline-start: auto; padding-inline: .3rem; }
#library-list details[open] summary::after { content: "−"; }
#library-list details > button { width: 100%; margin-bottom: .45rem; padding: .55rem; }
.theme-icon { display: grid; place-items: center; flex: 0 0 1.9rem; height: 1.9rem; border-radius: .55rem; background: #266353; color: #d0ffed; }
.theme-icon svg { width: 1.15rem; height: 1.15rem; }

.card .family-cover { aspect-ratio: 1.95; object-position: center; }
.theme-family { display: flex; align-items: center; gap: .55rem; }

:root { --mint-action: linear-gradient(112deg, #a5efd3, #c4f5ac); --mint-ink: #10372c; }
.primary, .mark, .theme-icon { background: var(--mint-action); color: var(--mint-ink); }
.views svg, .step-empty svg { color: var(--heading); }
.views [aria-pressed="true"] span { display: grid; place-items: center; width: 1.75rem; height: 1.5rem; border-radius: .45rem; background: var(--mint-action); }
.views [aria-pressed="true"] svg { color: var(--mint-ink); }

.editorial-cover {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  align-items: stretch;
  background: #ebe4cf;
  color: #12372c;
}
.editorial-photo { position: relative; min-height: 10.75rem; isolation: isolate; }
.editorial-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.editorial-family {
  position: absolute;
  inset: auto .45rem .55rem .5rem;
  width: fit-content;
  max-width: calc(100% - .95rem);
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .5rem .28rem .3rem;
  border-radius: .55rem;
  background: #102822ef;
  color: #d0ffed;
  font-size: .83rem;
  font-weight: 700;
}
.editorial-family .theme-icon { flex-basis: 1.35rem; height: 1.35rem; border-radius: .35rem; }
.editorial-family svg { width: .88rem; height: .88rem; }
.editorial-note {
  align-self: center;
  margin: .7rem .65rem .7rem .25rem;
  padding: .75rem .65rem;
  border: 1px solid #d0bf94;
  border-radius: .16rem;
  background: #fff3d6;
  box-shadow: 0 .25rem .65rem #392b171c;
  transform: rotate(-2deg);
}
.editorial-note-label { display: block; margin-bottom: .45rem; font-size: .875rem; font-weight: 750; }
.editorial-note p { margin: 0; font: italic 500 1rem/1.4 Georgia, serif; overflow-wrap: anywhere; }
@media (max-width: 350px) {
  .editorial-cover { grid-template-columns: 1fr; }
  .editorial-photo { min-height: 9rem; }
  .editorial-note { margin: .5rem .8rem .7rem; transform: none; }
}

/* Palette émeraude */
[data-palette="emeraude"] {
  background: #060c0d;
  --surface: #091716;
  --panel: #101f1e;
  --line: #2b5550;
  --heading: #e6fff8;
  --subheading: #83e8c7;
  --muted: #bad5cf;
  --copy: #f0faf8;
  --mint-ink: #0a342a;
}
[data-palette="emeraude"] body {
  background: radial-gradient(ellipse at 50% -20%, #123b35, transparent 65%), #060c0d;
}
[data-palette="emeraude"] .top { background: #0a1717; }
[data-palette="emeraude"] main {
  background: radial-gradient(ellipse 90% 27rem at 94% 1rem, #145b4c, transparent),
    radial-gradient(ellipse 80% 20rem at -15% 15rem, #113a43, transparent), var(--surface);
}
[data-palette="emeraude"] .welcome-visual {
  background: radial-gradient(ellipse at center, #35be9670, transparent 70%);
}
[data-palette="emeraude"] .views { background: #0c201e; }
[data-palette="emeraude"] .views [aria-pressed="true"] { background: #173c35; color: var(--heading); }
[data-palette="emeraude"] textarea,
[data-palette="emeraude"] #step-time,
[data-palette="emeraude"] .card-body details { background: #0d211f; }
[data-palette="emeraude"] button:not(.primary):not(.photo-tile):not([data-view]) { background: #15342f; }
[data-palette="emeraude"] a { color: #9cf4d7; }
[data-palette="emeraude"] :focus-visible { outline-color: #9cf4d7; }

.section-accent-0 { --section-color: #98ebcb; }
.section-accent-1 { --section-color: #9ccdfa; }
.section-accent-2 { --section-color: #c0bafc; }
.section-accent-3 { --section-color: #f3cf91; }
.section-accent-4 { --section-color: #efb7cf; }
.section-accent-5 { --section-color: #c7eb9f; }

#result .section-accent {
  border-inline-start: .22rem solid var(--section-color);
}
#result .section-accent[open] {
  border-color: var(--section-color);
}
#result .section-accent summary strong,
#result .section-accent summary::after {
  color: var(--section-color);
}


#search-choices, #search-live, #search-support, .search-reason {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #426c61;
  border-radius: .9rem;
  background: #173732;
  color: #e3f7f0;
}
#search-choices h2, #search-live h2, #search-support h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.search-options { display: grid; gap: .5rem; }
.search-options button {
  min-height: 44px;
  padding: .6rem .75rem;
  text-align: left;
  color: #e3f7f0;
  background: #214840;
  border: 1px solid #578477;
  border-radius: .65rem;
}
.search-reason { margin-inline: 1rem; }
.search-reason strong { color: #b9f2db; }
.search-reason p { margin: .25rem 0 0; }

/* Let the actual header height determine the remaining space. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  min-height: 100dvh;
}
.top, main { margin-block: 0; }
.top { flex: none; }
main { flex: 1; min-height: 0; min-width: 0; }
main:has(#welcome:not([hidden])) {
  display: flex;
  flex-direction: column;
  padding-block: 0 calc(clamp(1.25rem, 5svh, 3rem) + env(safe-area-inset-bottom));
}
.welcome {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: clamp(1rem, 8svh - 1rem, 3.5rem);
  gap: clamp(.7rem, 2svh, 1.25rem);
}
.welcome-visual {
  flex: none;
  height: clamp(9rem, 29svh, 17.5rem);
  margin-bottom: 0;
}
.welcome-visual img { width: 38%; }
.welcome h1 { font-size: clamp(2rem, 10vw, 3.6rem); }
.welcome p { margin-bottom: .25rem; }
#start-guides { margin-top: auto; }
.views {
  padding-inline: max(.7rem, env(safe-area-inset-left)) max(.7rem, env(safe-area-inset-right));
}
#step-form, #step-form > *, #library-filter { min-width: 0; }
#step-time { max-width: 100%; }
@media (max-height: 570px) {
  .welcome { padding-top: .85rem; gap: .65rem; }
  .welcome-visual { height: clamp(7rem, 32svh, 10.5rem); }
  main:has(#welcome:not([hidden])) {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}


/* Accueil et aide */
.top-actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
#help { display: grid; place-items: center; width: 2.75rem; padding: 0; border-radius: .85rem; }
main:has(#welcome:not([hidden])) {
  position: relative;
  isolation: isolate;
  overflow: clip;
  justify-content: center;
  padding-block: clamp(1.1rem, 4svh, 2.75rem) max(1.35rem, env(safe-area-inset-bottom));
}
[data-palette] main:has(#welcome:not([hidden])) {
  background:
    radial-gradient(ellipse 78% 37% at 50% 28%, #2d7860 0%, #174c3d 48%, transparent 100%),
    linear-gradient(180deg, #0a211b, #0c2921 49%, #081a17 84%);
}
.network {
  display: none;
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mask-image: linear-gradient(#000b, #000 28%, #0009 52%, transparent 78%);
}
main:has(#welcome:not([hidden])) .network { display: block; }
.welcome-art { position: relative; }
.celebration {
  display: block;
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size, .35rem);
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--light, #a4ffda);
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  opacity: .55;
}
.spark:nth-child(3n) { border-radius: 0; clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%); }
@media (prefers-reduced-motion: no-preference) {
  .spark { animation: spark-rise var(--time, 5s) var(--delay, 0s) ease-in-out infinite; }
  #welcome .welcome-visual img:nth-child(2) {
    animation: card-arrival .8s cubic-bezier(.2,.75,.25,1) both;
  }
}
@keyframes spark-rise {
  0%, 100% { opacity: .22; transform: translate(0, 7px) scale(.65); }
  45% { opacity: .95; transform: translate(var(--drift, 8px), -14px) scale(1.15); }
  75% { opacity: .55; transform: translate(var(--drift, 8px), -21px) scale(.8); }
}
@keyframes card-arrival {
  from { opacity: .55; transform: translateX(-50%) translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateX(-50%); }
}
#welcome { flex: none; padding-top: 0; gap: clamp(.65rem, 1.8svh, 1.05rem); }
#welcome h1, #welcome p { text-align: center; }
[data-palette] #welcome .welcome-visual {
  height: clamp(8rem, 27svh, 15.8rem);
  background: transparent;
}
#welcome p { max-width: 30ch; margin-inline: auto; }
#start-guides {
  display: grid; justify-items: center; gap: .5rem; align-self: center;
  margin-top: .35rem; padding: 0 1rem; background: transparent; border: 0;
  color: var(--heading); font-weight: 750;
}
.orb-stage { position: relative; isolation: isolate; display: grid; place-items: center; width: 11rem; height: 8rem; }
.orb {
  display: grid; place-items: center; width: 6.25rem; aspect-ratio: 1;
  border-radius: 50%; color: #103b32;
  background: radial-gradient(circle at 31% 25%, #e6ffe8, #b5f5ca 44%, #7dd7a8 100%);
  box-shadow: inset 0 0 0 1px #e1fff38a, 0 0 26px #7afbbc50;
  transition: transform .18s ease, box-shadow .18s ease;
}
.start:hover .orb, .start:focus-visible .orb { transform: scale(1.04); box-shadow: inset 0 0 0 1px #e1fff3a0, 0 0 32px #7afbbc70; }
.orbit { position: absolute; z-index: -1; pointer-events: none; border: 1px solid #9ce8c652; border-radius: 50%; width: 7.55rem; height: 7.55rem; }
.orbit:nth-child(2) { width: 10rem; height: 5rem; transform: rotate(-19deg); border-color: #9ce8c644; }
.orbit::after { content: ""; position: absolute; left: calc(50% - .19rem); top: -.19rem; width: .38rem; aspect-ratio: 1; border-radius: 50%; background: #d5ffe9; box-shadow: 0 0 12px 2px #91f4c8; }
.orbit:nth-child(2)::after { left: auto; right: .78rem; top: .55rem; width: .28rem; }
@media (prefers-reduced-motion: no-preference) {
  .orbit:first-child { animation: orb-turn 6s linear infinite; }
  .orbit:nth-child(2) { animation: orb-tilt 4s ease-in-out infinite alternate; }
}
@keyframes orb-turn { to { transform: rotate(1turn); } }
@keyframes orb-tilt { from { transform: rotate(-28deg); opacity: .65; } to { transform: rotate(16deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .orb { transition: none; } }
#help-panel { width: min(calc(100% - 2rem), 25rem); border: 1px solid #426c61; border-radius: 1.2rem; background: #102722; color: var(--copy); padding: 1.15rem; }
#help-panel::backdrop { background: #061512bb; }
#help-panel header { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
#help-panel h2 { font-size: 1.35rem; }
#help-panel details { border-top: 1px solid var(--line); }
#help-panel details p { margin-top: 0; color: var(--muted); }

main { position: relative; isolation: isolate; }
[data-palette="emeraude"] main:not(:has(#welcome:not([hidden]))) {
  background: radial-gradient(ellipse 95% 18rem at 52% -1rem, #205a4a, transparent 100%), var(--surface);
}
main:not(:has(#welcome:not([hidden]))) .network {
  display: block;
  height: 21rem;
  opacity: .65;
  mask-image: linear-gradient(#000 10%, #0008 50%, transparent 92%);
}
.network-light {
  position: absolute;
  inset: 0 0 auto;
  height: 19rem;
  z-index: -1;
  pointer-events: none;
  opacity: .65;
  background:
    radial-gradient(circle at 15% 31%, #aeffdabf 0 2px, #72e5ab70 4px, transparent 19px),
    radial-gradient(circle at 84% 38%, #b6ffdfb8 0 2px, #72e5ab5c 5px, transparent 23px),
    radial-gradient(circle at 68% 16%, #c8ffd0aa 0 1px, #8de2b34d 3px, transparent 14px),
    radial-gradient(ellipse at 52% 46%, #66deb322 0%, transparent 63%);
}
main:has(#welcome:not([hidden])) .network-light { height: clamp(15rem, 42svh, 24rem); }
#result .card { background: var(--panel); }
@media (prefers-reduced-motion: no-preference) {
  .network-light { animation: network-light-drift 4.5s ease-in-out infinite alternate; }
}
@keyframes network-light-drift {
  from { opacity: .38; transform: translate(0, 0); }
  to { opacity: 1; transform: translate(6px, 12px); }
}

[data-palette] #result .original .open-original {
  display: block;
  margin-block: 0 .75rem;
}
#original-viewer {
  position: fixed;
  inset: 0;
  width: min(100%, 48rem);
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--copy);
  background: var(--surface);
}
#original-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#original-viewer::backdrop { background: #030b0bf0; }
html:has(#original-viewer[open]) { overflow: hidden; }
.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  padding: calc(.6rem + env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .6rem max(.75rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.viewer-image {
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}
.viewer-image img { display: block; width: 100%; max-width: 100%; height: auto; }
.viewer-image.is-zoomed img { width: 175%; max-width: none; }

.viewer-toolbar form { margin: 0; }

.save-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .65rem;
}
.save-card-status { color: var(--muted); font-size: .875rem; }
[data-palette] #result .save-card[aria-pressed="true"] {
  border-color: var(--subheading);
  color: var(--heading);
}
#saved-cards {
  padding: .9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--panel);
}
#saved-cards h2 { font-size: 1.15rem; margin: 0 0 .65rem; }
#saved-card-list { display: grid; gap: .5rem; }
#saved-card-list button { text-align: left; }

.browse-themes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: fit-content;
  max-width: 100%;
  margin: .7rem auto 0;
}
#library-list .family-copy {
  display: grid;
  gap: .12rem;
  min-width: 0;
}
#library-list .family-copy > span {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 450;
}

.browse-themes svg {
  flex: none;
  color: #a4f5d7;
  filter: drop-shadow(0 0 3px #8af3ca60);
}
@media (prefers-reduced-motion: no-preference) {
  .browse-themes svg { animation: themes-glow 1.4s ease-out both; }
}
@keyframes themes-glow {
  0%, 100% { filter: drop-shadow(0 0 3px #8af3ca60); }
  38% { filter: drop-shadow(0 0 7px #9fffe1e0); }
}

#library-list .wounds-collection { gap: .75rem; }
#library-list .wounds-collection h2 { margin: .7rem 0 0; }
.card-body .card-collection {
  margin: 0 0 .4rem;
  color: var(--muted);
  font: 650 .9rem/1.4 Inter, system-ui, sans-serif;
}

.step-alert { overflow-wrap: anywhere; }
.step-alert-label {
  display: block;
  margin-bottom: .15rem;
  color: #ffdb98;
  font-size: .875rem;
}

#search-live { margin-block: 0; padding: .75rem; }

.library-picker { position: relative; }
.library-picker #library-filter { padding-right: 3rem; width: 100%; }
[data-palette] .library-picker .library-picker-toggle {
  position: absolute;
  right: .2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}
.library-options {
  position: absolute;
  z-index: 3;
  inset: 100% 0 auto;
  max-height: min(42vh, 19rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: .35rem;
  margin-top: .35rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  color: var(--copy);
  background: #112b25;
  box-shadow: 0 .7rem 1.6rem #020e0ba0;
}
.library-options [role="option"] { min-height: 44px; padding: .55rem .7rem; border-radius: .5rem; cursor: pointer; }
.library-options [aria-selected="true"], .library-options [role="option"]:hover { background: #245345; color: #e0fff2; }
.library-options small { display: block; color: var(--muted); }

#reflections {
  margin: .75rem 0 1rem;
  padding: 0 .85rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--panel);
}
#reflection-list { list-style: none; padding: 0; margin: 0; }
#reflection-list li {
  display: grid;
  gap: .25rem;
  padding: .6rem 0;
  border-top: 1px solid var(--line);
}
#reflection-list button { justify-self: start; }
#reflection-list small, #reflection-form small { color: var(--muted); }
.reflection-start { display: block; margin: .4rem 0 .65rem; }
#reflection-dialog {
  width: min(calc(100% - 1.5rem), 31rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  color: var(--copy);
  overflow: auto;
}
#reflection-dialog::backdrop { background: #061512c9; }
.reflection-heading, .reflection-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
#reflection-dialog h2 { font-size: 1.35rem; }
#reflection-status:empty { display: none; }
#reflection-actions { display: grid; gap: .5rem; margin-top: .65rem; }

:root {
  --reflection-ink: #eedaff;
  --reflection-accent: #c8abf4;
  --reflection-panel: #252139;
  --reflection-line: #756195;
}
.views { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.views [data-view="reflections"] { color: var(--reflection-ink); }
.views [data-view="reflections"] svg { color: var(--reflection-accent); }
[data-palette] .views [data-view="reflections"][aria-pressed="true"] { background: #39294e; color: var(--reflection-ink); }
.views [data-view="reflections"][aria-pressed="true"] span { background: var(--reflection-accent); }
.views [data-view="reflections"][aria-pressed="true"] svg { color: #302048; }
@media (max-width: 360px) {
  .views { gap: .15rem; padding-inline: .35rem; }
  .views button { font-size: .7rem; padding-inline: .1rem; }
}
#reflections h1, #reflection-title, .reflection-path > strong { color: var(--reflection-ink); }
.reflection-library-panel, .reflection-path {
  padding: .85rem;
  border: 1px solid var(--reflection-line);
  border-radius: .85rem;
  background: var(--reflection-panel);
}
#reflections { margin: 0; padding: .75rem 0 0; border: 0; background: transparent; }
#reflection-empty { margin: .35rem 0; }
#reflection-dialog { background: var(--reflection-panel); border-color: var(--reflection-line); }
[data-palette] #reflection-form .primary {
  background: var(--reflection-accent);
  color: #261938;
}
[data-palette] #reflection-dialog button:not(.primary),
[data-palette] #reflections button,
[data-palette] #result button.reflection-start,
[data-palette] #result .reflection-path button {
  background: #392d4d;
  border-color: var(--reflection-line);
  color: var(--reflection-ink);
}
.reflection-path { display: grid; gap: .55rem; margin: .65rem 0; }
.reflection-path button { text-align: left; }

.library-count { color: var(--muted); }
.library-search-icon {
  position: absolute;
  top: 50%;
  left: .8rem;
  transform: translateY(-50%);
  color: #a4f5d7;
  pointer-events: none;
}
[data-palette] .library-picker #library-filter {
  padding-left: 2.4rem;
  border-color: #5e9d8a;
}
.library-themes-title { margin-top: 1.15rem; font-size: 1.3rem; }
#saved-cards {
  margin: .95rem 0 0;
  padding: 0 .8rem;
  border-color: #846841;
  background: #2d261e;
}
#saved-cards summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding-block: .65rem;
  list-style: none;
  color: #ffdb98;
}
#saved-cards summary::-webkit-details-marker { display: none; }
#saved-cards summary svg { flex: none; }
#saved-card-count {
  padding: .05rem .45rem;
  border-radius: 1rem;
  color: #ffdb98;
  background: #49361f;
}
#saved-cards summary::after { content: '+'; margin-inline-start: auto; }
#saved-cards[open] summary::after { content: '−'; }
#saved-card-list { padding-bottom: .75rem; }
[data-palette] #saved-card-list button {
  border-color: #846841;
  background: #3a2d20;
  color: #fff1d5;
}


.journey-entry,.journey-box { margin-block: 1rem; padding: 1rem; border: 1px solid #756195; border-radius: .9rem; background: #252139; }
.journey-entry h2,.journey-box h2 { color: #eedaff; font-size: 1.2rem; }
#journey h1 { font-size: clamp(1.85rem,8vw,2.6rem); }
#journey-progress { display: flex; gap: .35rem; list-style: none; padding: 0; margin: .9rem 0; }
#journey-progress li { flex: 1; height: .3rem; border-radius: 1rem; background: #514564; }
#journey-progress .reached { background: #c8abf4; }
#journey .primary,.journey-entry .primary { color: #251638; background: #c8abf4; }
.journey-back { margin: .6rem; }
.journey-actions { display: grid; gap: .5rem; }
.journey-box textarea { margin: .3rem 0; }
.journey-box label { display: block; }
#journey-status { color: #eedaff; }
#journey-status:empty { display: none; }
