/* Witchy Whatknots - styles. Sage green, cream and a soft gold moon accent. */
:root {
  --sage-700: #44543d;
  --sage-600: #55664c;
  --sage-500: #778169;
  --sage-200: #cfd9c2;
  --sage-100: #e6ecdc;
  --cream: #f8f3e6;
  --cream-2: #efe7d2;
  --gold: #c9a24b;
  --gold-soft: #e6cf8f;
  --gold-text: #7a5a10;
  --ink: #26301f;
  --ink-soft: #46523f;
  --radius: 18px;
  --tab-h: 64px;
  --font-display: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--sage-700); margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--sage-700); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus, [tabindex="-1"]:focus { outline: none; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--ink); padding: .6rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* header */
.app-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: var(--sage-600); color: var(--cream);
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .02em; }
.brand img { border-radius: 50%; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--cream); text-decoration: none; }
.icon-btn:hover, .icon-btn[aria-current="page"] { background: rgba(255,255,255,.16); }

/* banner */
.banner { display: flex; align-items: flex-start; gap: 8px; background: var(--gold-soft); color: #3b2d05; padding: 10px 6px 10px 14px; font-size: .95rem; }
.banner[hidden] { display: none; }
.banner p { margin: 0; flex: 1; font-weight: 600; }
.banner button { flex: none; width: 44px; height: 44px; margin: -8px 0; border: 0; background: none; font-size: 1.6rem; color: #3b2d05; cursor: pointer; border-radius: 50%; }
.banner button:hover { background: rgba(0,0,0,.08); }

/* screens */
main { display: block; max-width: 640px; margin: 0 auto; }
.screen { padding: 18px 16px 28px; }
.screen[hidden] { display: none; }
.lede { color: var(--ink-soft); }
.card-surface { background: #fff9ea; border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card-surface.sage { background: var(--sage-100); }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; margin: 0 0 4px; }
.small { font-size: .88rem; color: var(--ink-soft); }
.notice { background: var(--sage-100); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  background: var(--sage-600); color: var(--cream); border: 0; border-radius: 999px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; width: 100%; margin: 0 0 10px;
}
.btn:hover { background: var(--sage-700); }
.btn.secondary { background: transparent; color: var(--sage-700); box-shadow: inset 0 0 0 2px var(--sage-600); }
.btn.gold { background: var(--gold); color: #2d2204; }
.btn.gold:hover { background: #b98f3a; }
.btn.small-btn { width: auto; min-height: 44px; padding: 8px 16px; }
.btn.danger { background: transparent; color: #7a2b1d; box-shadow: inset 0 0 0 2px #b0614f; }

/* moon */
.moon-hero { text-align: center; padding: 6px 0 4px; }
.moon-art { width: 210px; height: 210px; display: block; margin: 0 auto 6px; }
.phase-name { font-size: 1.9rem; margin-bottom: 0; }
.illum { font-size: 1.1rem; color: var(--ink-soft); margin: 2px 0 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.fact { background: var(--sage-100); border-radius: 14px; padding: 12px; }
.fact .label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.fact .value { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--sage-700); }
.fact .sub { display: block; font-size: .85rem; color: var(--ink-soft); }
.affirm { font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--sage-700); margin: 0; }
.jar-card { background: var(--cream-2); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.jar-card svg { width: 56px; height: 56px; }
.jar-card h3, .jar-card h2 { margin-bottom: 2px; font-size: 1.1rem; }
.jar-card .btn { grid-column: 1 / -1; margin: 4px 0 0; }

/* daily card: NO border, outline, frame or shadow on card art */
.card-stage { text-align: center; margin: 4px 0 16px; }
.card-art { display: block; width: min(250px, 62vw); height: auto; aspect-ratio: 2 / 3; margin: 0 auto; border: 0; outline: 0; box-shadow: none; border-radius: 0; background: none; }
.card-stage figcaption { margin-top: 10px; }
.card-title { font-size: 1.6rem; margin: 0; }
.placeholder-tag { display: inline-block; background: var(--gold-soft); color: #3b2d05; font-size: .75rem; font-weight: 700; letter-spacing: .1em; padding: 3px 10px; border-radius: 999px; margin-top: 4px; }

/* guide */
details { background: #fff9ea; border-radius: 14px; margin: 0 0 10px; }
summary { list-style: none; cursor: pointer; padding: 14px 16px; min-height: 48px; font-family: var(--font-display); font-size: 1.1rem; color: var(--sage-700); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; color: var(--gold-text); }
details[open] summary::after { content: "–"; }
details .body { padding: 0 16px 14px; }
.tip { background: var(--sage-100); border-radius: 10px; padding: 8px 12px; font-size: .92rem; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
textarea { width: 100%; min-height: 110px; font: inherit; padding: 10px 12px; border: 2px solid var(--sage-200); border-radius: 12px; background: #fff; color: var(--ink); resize: vertical; }
textarea:focus { border-color: var(--sage-600); }
.entry { background: #fff9ea; border-radius: 12px; padding: 12px 14px; margin: 0 0 10px; }
.entry .meta { font-size: .82rem; color: var(--gold-text); font-weight: 700; margin: 0 0 4px; }
.entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1 1 140px; width: auto; }

/* shop */
.shop-logo { display: block; width: 220px; height: 220px; margin: 0 auto 10px; border-radius: 28px; object-fit: cover; }

/* notifications */
.toggle-list { list-style: none; padding: 0; margin: 0 0 14px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff9ea; border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; }
.toggle .t-text { flex: 1; }
.toggle .t-title { display: block; font-weight: 700; margin: 0; }
.toggle .t-desc { display: block; font-size: .88rem; color: var(--ink-soft); font-weight: 400; }
.switch { position: relative; flex: none; width: 54px; height: 32px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #b3b8a8; transition: background .2s; }
.switch .thumb { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked ~ .track { background: var(--sage-600); }
.switch input:checked ~ .thumb { transform: translateX(22px); }
.switch input:focus-visible ~ .track { outline: 3px solid var(--gold); outline-offset: 2px; }
.preview li { margin: 0 0 6px; }
.preview { padding-left: 1.1rem; margin: 0 0 8px; }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--sage-700); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-h); color: #dfe6d3; text-decoration: none; font-size: .78rem; font-weight: 600; }
.tabbar a .ti { opacity: .85; }
.tabbar a[aria-current="page"] { color: #fff; box-shadow: inset 0 3px 0 var(--gold); }
.tabbar a[aria-current="page"] .ti { color: var(--gold-soft); opacity: 1; }

/* splash */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #707962; transition: opacity .5s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash { align-content: center; justify-items: center; gap: 14px; }
.splash img { width: 200px; height: 200px; border-radius: 50%; }
.splash-name { margin: 0; font-family: var(--font-display); font-size: 2rem; letter-spacing: .06em; color: #f3e3a8; }
.splash[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (min-width: 700px) { .screen { padding: 28px 24px 40px; } }

/* zodiac */
.sign-pill { display: inline-block; background: var(--sage-100); color: var(--sage-700); font-weight: 600; font-size: .9rem; padding: 4px 12px; border-radius: 999px; margin: 6px 0 0; }
.sky-line { margin: 0 0 4px; }
.sign-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 6px; }
.sign-btn { display: flex; flex-direction: column; align-items: flex-start; min-height: 56px; padding: 8px 12px; border: 2px solid var(--sage-200); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sign-btn .sn { font-family: var(--font-display); font-weight: 700; color: var(--sage-700); }
.sign-btn .sd { font-size: .8rem; color: var(--ink-soft); }
.sign-btn[aria-pressed="true"] { background: var(--sage-600); border-color: var(--sage-600); }
.sign-btn[aria-pressed="true"] .sn, .sign-btn[aria-pressed="true"] .sd { color: var(--cream); }
.bday { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.bday > div { flex: 1 1 110px; }
select { width: 100%; min-height: 48px; font: inherit; padding: 8px 10px; border: 2px solid var(--sage-200); border-radius: 12px; background: #fff; color: var(--ink); }
.bday .btn { flex: 1 1 100%; width: 100%; }

/* greeting + explore cards (home) */
.greeting { font-family: var(--font-display); font-size: 1.05rem; color: var(--sage-700); margin: 0 0 4px; text-align: center; }
.explore-grid { margin: 6px 0 14px; }
.explore { display: block; background: #fff9ea; border-radius: var(--radius); margin: 0 0 10px; color: var(--ink); text-decoration: none; overflow: hidden; }
.explore:hover { background: #fdf3da; }
.explore h2 { font-size: 1.1rem; padding: 14px 16px 0; margin: 0 0 2px; }
.explore p { padding: 0 16px 14px; margin: 0; }
.explore-craft .explore-body p { padding-top: 10px; }

/* Men of the Craft: darker sage + copper accent, same fonts, spacing and card shapes */
:root { --craft-deep: #2c3829; --craft-mid: #3d4d39; --copper: #b8733d; --copper-text: #8f4f22; --copper-soft: #e0b48c; }
.craft-banner { position: relative; height: 96px; overflow: hidden; background: var(--craft-deep); }
.craft-banner .craft-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.craft-banner-text { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 10px; }
.craft-emblem { width: 40px; height: 40px; flex: none; }
.craft-emblem svg { width: 40px; height: 40px; display: block; }
.craft-title { font-family: var(--font-display); font-size: 1.3rem; color: #f8ecd0; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.45); }
.new-badge { position: absolute; top: 10px; right: 10px; background: #8f4f22; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .12em; padding: 3px 10px; border-radius: 999px; }
.screen.craft .craft-banner { margin: -18px -16px 14px; }
@media (min-width: 700px) { .screen.craft .craft-banner { margin: -28px -24px 16px; } }
.craft .eyebrow, .craft-h2 { color: var(--copper-text); }
.craft-h2 { font-size: 1.15rem; margin-top: 22px; border-bottom: 2px solid var(--copper-soft); padding-bottom: 4px; }
.craft-h1 { color: var(--craft-mid); }
.craft summary::after { color: var(--copper-text); }
.craft .tip { background: #e9e4d6; }
.craft-jar { background: #ece3d3; }
.btn.craft-btn { background: var(--craft-mid); color: #f8ecd0; }
.btn.craft-btn:hover { background: var(--craft-deep); }
.week { list-style: none; margin: 0 0 10px; padding: 0; }
.week li { display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px; margin: 0 0 6px; background: #fff9ea; }
.week li strong { flex: none; width: 5.6rem; color: var(--copper-text); }
.week li.today { background: var(--craft-mid); color: #f8ecd0; }
.week li.today strong { color: var(--copper-soft); }

/* chips, search, herbs, names */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip-btn, .chip-link { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--sage-200); background: #fff; color: var(--sage-700); font: inherit; font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--sage-600); border-color: var(--sage-600); color: var(--cream); }
.craft .chip-link { border-color: var(--copper-soft); color: var(--craft-mid); }
.search { width: 100%; min-height: 48px; font: inherit; padding: 8px 14px; border: 2px solid var(--sage-200); border-radius: 12px; background: #fff; color: var(--ink); }
.search:focus { border-color: var(--sage-600); }
.pill { flex: none; font-family: var(--font-body); font-size: .75rem; font-weight: 700; color: var(--sage-700); background: var(--sage-100); padding: 2px 10px; border-radius: 999px; margin-left: auto; }
details summary { gap: 10px; }
.uses { margin: 0 0 10px; padding-left: 1.1rem; }
.uses li { margin: 0 0 4px; }
.safety { background: #f3e3c4; border-radius: 10px; padding: 8px 12px; font-size: .92rem; color: #3b2d05; }
fieldset.qa { border: 0; padding: 0; margin: 0 0 14px; min-inline-size: 0; }
.qa { margin: 0 0 14px; }
legend { font-weight: 600; padding: 0; margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--sage-200); background: #fff; font-weight: 600; color: var(--sage-700); }
.chip input:checked + span { background: var(--sage-600); border-color: var(--sage-600); color: var(--cream); }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
details.mini { background: none; margin: 8px 0 0; }
details.mini summary { padding: 8px 0; min-height: 44px; font-family: var(--font-body); font-size: .95rem; text-decoration: underline; }
details.mini summary::after { content: ""; }
.name-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name-card .btn { flex: none; margin: 0; }
.witch-name { font-family: var(--font-display); font-size: 1.3rem; color: var(--sage-700); margin: 0; }

/* moon water banner, steps, altar */
.mw-banner { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; background: var(--sage-100); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; color: var(--ink); text-decoration: none; }
.mw-banner svg { width: 40px; height: 40px; }
.mw-banner p { margin: 2px 0 4px; font-size: .95rem; }
.mw-banner .mw-link { font-size: .9rem; font-weight: 700; color: var(--sage-700); text-decoration: underline; }
.steps { padding-left: 1.2rem; margin: 0 0 10px; }
.steps li { margin: 0 0 8px; }
.toggle.sub { display: block; background: var(--sage-100); }
.altar-stage { width: 100%; margin: 0 0 10px; display: flex; justify-content: center; border-radius: 12px; overflow: hidden; position: relative; }
.altar-stage svg { display: block; height: min(636px, 64vh); width: auto; max-width: 100%; }
.altar-stage svg [data-slot], .altar-stage svg [data-info] { cursor: pointer; }
.altar-stage svg [data-slot]:focus-visible { outline: none; }
.altar-stage svg [data-slot]:focus-visible .ring { stroke: #e6cf8f; stroke-width: 3; stroke-dasharray: 0; opacity: 1; }
.altar-stage svg [data-info]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.altar-stage .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.3s ease-in-out infinite alternate; }
.altar-stage .glow { animation: glowpulse 3s ease-in-out infinite alternate; }
.altar-stage.igniting::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, rgba(255,211,107,.55), rgba(255,211,107,0) 65%); animation: ignite 1.5s ease-out forwards; pointer-events: none; }
@keyframes flicker { 0% { transform: scale(1, 1) rotate(-2deg); } 50% { transform: scale(.94, 1.06) rotate(1deg); } 100% { transform: scale(1.03, .97) rotate(2deg); } }
@keyframes glowpulse { from { opacity: .7; } to { opacity: 1; } }
@keyframes ignite { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.altar-info { background: var(--sage-100); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; min-height: 3.2em; font-size: .95rem; }
.altar-info a { color: var(--sage-700); }
@media (prefers-reduced-motion: reduce) { .altar-stage .flame, .altar-stage .glow, .altar-stage.igniting::after { animation: none; } }

/* extras: desert, coven, familiars, runes */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.desert-eyebrow, .law-note h2, .desert-banner strong { color: #8f5340; }
.law-note, .ethics, .desert-banner, .mw-banner.desert-banner { background: #edddd0; border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; color: var(--ink); text-decoration: none; display: block; }
.ethics { background: #edddd0; }
.warning-card { background: #f3e0d4; border-left: 4px solid #8f5340; border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.warning-card h3 { color: #6a3a2c; }
.sources { padding-left: 1.2rem; margin: 0 0 8px; }
.sources a { overflow-wrap: anywhere; }
.sw-map { width: 100%; height: auto; display: block; border-radius: 16px; margin: 0 0 12px; }
.pin-card { background: #fff9ea; border-radius: 16px; padding: 14px; margin: 0 0 14px; }
.spell-card.craft-accent summary { background: linear-gradient(90deg, #edddd0, #fff9ea); }
.emblem-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.emblem-btn { background: #fff; border: 2px solid var(--sage-200); border-radius: 14px; padding: 8px; min-width: 72px; cursor: pointer; color: var(--ink); font: inherit; }
.emblem-btn[aria-pressed="true"] { border-color: var(--sage-600); background: var(--sage-100); }
.member-list { list-style: none; padding: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff9ea; border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
.cal-list { list-style: none; padding: 0; }
.teaser { background: #e6ecdc; }
.companion-host { margin: 0 0 14px; }
.companion { background: #fff9ea; border-radius: 18px; padding: 12px 14px; text-align: center; }
.companion-btn { background: none; border: 0; cursor: pointer; width: 140px; height: 140px; padding: 0; }
.familiar-svg, .familiar-art svg, .companion-btn svg { width: 140px; height: 140px; display: block; margin: 0 auto; }
.familiar-bob { animation: fam-bob 2.8s ease-in-out infinite; }
@keyframes fam-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.companion-msg { font-family: var(--font-display); font-style: italic; margin: 6px 0; color: var(--sage-700); }
.bond-meter { height: 8px; background: var(--sage-200); border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.bond-meter span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.care-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.familiar-result { text-align: center; }
.rune-art { display: flex; justify-content: center; margin: 8px 0; }
.rune-entry summary { gap: 10px; }
.cast-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 400px) { .cast-row { grid-template-columns: repeat(3, 1fr); } }
.cast-card { background: #fff9ea; border-radius: 14px; padding: 10px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .familiar-bob, .companion-btn svg, .care-drop, .care-flame { animation: none !important; }
}
