/* Witchy Whatknots: mood check-in, witch quiz, profile, badges, tools extras. */
.tabbar { grid-template-columns: repeat(6, 1fr); }
.tabbar a { font-size: .72rem; }
#profile-link svg { width: 26px; height: 26px; background: var(--cream); border-radius: 50%; padding: 2px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.btn-row .btn { flex: 1 1 150px; margin: 0; }
.err { color: #7a2b1d; font-weight: 600; }
.count-pill { display: inline-block; background: var(--sage-100); color: var(--sage-700); font-weight: 700; padding: 4px 14px; border-radius: 999px; }
.saved-note { background: var(--sage-100); border-radius: 12px; padding: 10px 12px; font-weight: 600; color: var(--sage-700); }

/* mood */
.mood-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.mood-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; min-height: 76px; border-radius: 16px; background: var(--sage-100); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; text-align: center; }
.mood-btn:hover, .mood-btn:focus-visible { background: var(--sage-200); }
.mood-ico { display: inline-flex; }
.mood-head { display: flex; align-items: center; gap: 12px; }
.sug-list, .reads, .log-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sug-list a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.sug-list a:hover { background: var(--sage-100); }
.sug-kind { flex: none; min-width: 64px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }
.reads li { padding: 6px 0; }
.notice.crisis { background: #f4e6d8; }
.mood-jar { grid-template-columns: 1fr; }
.dots { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 320px; }
.dots .dot { width: 30px; height: 30px; border-radius: 50%; background: #e6e2d2; justify-self: center; }
.dots .dot.on { background: var(--c, var(--sage-600)); }
.dots-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--ink-soft); }
.dots-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.log-list li { display: flex; align-items: center; gap: 4px; font-size: .9rem; }
.moon-log-row { margin: 6px 0 10px; text-align: center; }

/* witch quiz */
.path-icons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 14px; }
.qbar { height: 6px; background: var(--sage-100); border-radius: 99px; overflow: hidden; margin: 0 0 14px; }
.qbar span { display: block; height: 100%; background: var(--sage-600); border-radius: 99px; }
.q-h1 { font-size: 1.45rem; }
.wq-opts { border: 0; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; min-inline-size: 0; }
.wq-opt { position: relative; display: block; }
.wq-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wq-opt span { display: flex; align-items: center; min-height: 56px; padding: 10px 16px; border-radius: 16px; background: #fff; border: 2px solid var(--sage-200); }
.wq-opt input:checked + span { background: var(--sage-600); color: var(--cream); border-color: var(--sage-600); }
.wq-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.result-head { display: flex; align-items: center; gap: 12px; }
.result-head h1 { margin: 0; }
.chips-static { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-static li { background: var(--sage-100); color: var(--sage-700); border-radius: 999px; padding: 6px 14px; font-size: .9rem; font-weight: 600; }
.chips-static.linkish a { color: var(--sage-700); text-decoration: none; display: inline-block; min-height: 32px; line-height: 32px; }
.runner { background: #fff9ea; border-radius: 12px; padding: 10px 12px; }
.path-grid { display: grid; gap: 10px; margin: 10px 0 14px; }
.path-card { display: grid; grid-template-columns: 44px 1fr 52px; gap: 12px; align-items: center; background: #fff9ea; border-radius: 16px; padding: 10px 14px; color: var(--ink); text-decoration: none; min-height: 64px; }
.path-card.mine { background: var(--sage-100); }
.path-card:hover { background: #fdf3da; }
.path-name { font-weight: 600; }
.mine-tag { font-weight: 400; font-size: .85rem; color: var(--gold-text); }
.checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.checklist label { display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 10px 14px; background: #fff; border-radius: 14px; cursor: pointer; }
.checklist input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--sage-600); }
.path-tip { margin: 6px 0 8px; }
.witch-card .wc-row { display: flex; align-items: center; gap: 12px; }
.witch-card h2 { margin: 0; }
.witch-card .btn { display: inline-flex; width: auto; margin-right: 8px; }

/* profile */
.pf-id, .pf-fam, .pf-space, .pf-path { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.pf-h3 { font-size: 1rem; margin: 10px 0 2px; color: var(--gold-text); }
.pf-fam .familiar-art svg { width: 110px; height: 110px; }
.emblem-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emblem-pick { position: relative; display: flex; flex-direction: column; align-items: center; width: 74px; padding: 6px 2px; border-radius: 14px; background: #fff; border: 2px solid var(--sage-200); text-align: center; }
.emblem-pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.emblem-pick:has(input:checked) { border-color: var(--sage-600); background: var(--sage-100); }
.emblem-pick:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.altar-thumb { width: 96px; flex: none; }
.altar-thumb svg { width: 100%; height: auto; border-radius: 10px; display: block; }
.card-preview svg { width: 100%; max-width: 280px; height: auto; display: block; margin: 8px auto; }
.danger-zone { background: none; }

/* badges */
.badge-sec { margin: 0 0 14px; }
.badge-grid { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: #fff9ea; border-radius: 16px; padding: 10px 6px 12px; }
.badge.off { background: #f1eee2; }
.badge .b-name { font-weight: 600; font-size: .86rem; line-height: 1.2; }
.badge .b-hint { line-height: 1.25; font-size: .78rem; }
.badge .btn.small-btn { min-height: 44px; padding: 4px 10px; font-size: .8rem; margin: 4px 0 0; }
.badge-row { list-style: none; padding: 0; margin: 4px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.badge-row li { display: flex; flex-direction: column; align-items: center; width: 74px; text-align: center; }
.badge-toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--sage-700); color: var(--cream); border-radius: 18px; box-shadow: 0 6px 18px rgba(30, 40, 25, .28); max-width: 520px; margin: 0 auto; animation: bt-in .45s ease-out both; }
.badge-toast .small { color: #e6ecdc; margin: 0; }
.badge-toast strong { font-family: var(--font-display); font-weight: 600; }
.badge-toast .bt-fam svg { width: 44px; height: 44px; }
.badge-toast .bt-link { margin-left: auto; color: var(--gold-soft); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; }
.badge-toast .bt-x { background: none; border: 0; color: var(--cream); font-size: 1.6rem; width: 44px; height: 44px; cursor: pointer; }
@keyframes bt-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .badge-toast { animation: none; } }

@media (max-width: 360px) { .mood-grid { grid-template-columns: repeat(3, 1fr); } .badge-grid { grid-template-columns: repeat(2, 1fr); } }

/* tool entries: left-aligned titles */
.tool-entry summary { justify-content: flex-start; text-align: left; gap: 12px; }
.tool-entry summary::after { margin-left: auto; }
.tool-entry summary .sum-title { flex: 1; }
.badge.off .b-name { color: #4a4f43; }
details[id], #knots, #diy, .knot-card[id] { scroll-margin-top: 84px; }
#pf-familiar { scroll-margin-top: 84px; }
