/* NotBroken — Abstain (streaks for the things you are staying off). Tokens match the other tools. */
:root {
  --primary: #84C0A0; --primary-deep: #5B8A72; --terra: #E8A375; --text-light: #F2EFEA;
  --surface-bg: rgba(255, 255, 255, 0.12); --surface-border: rgba(255, 255, 255, 0.18); --surface-highlight: rgba(255, 255, 255, 0.24);
  --good: #7ED6A5; --warn: #F2D06B; --bad: #FF9B8A; --ink: #13171D;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #15181D; color: var(--text-light); }
.page-container {
  min-height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 1rem;
  background: linear-gradient(-45deg, #151A2B, #1E3A2E, #1A1F36, #2A4A3A); background-size: 400% 400%; animation: nbGradient 25s ease infinite;
}
@keyframes nbGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) { .page-container { animation: none; } }
main { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 1rem; padding: 0.25rem 0 1rem; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; margin: 0; }
a { color: var(--primary); }
.nb-panel { background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: 20px; padding: 1rem 1.1rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.nb-btn { font: inherit; font-size: 15px; font-weight: 600; border-radius: 12px; border: 1px solid var(--surface-border); background: rgba(255,255,255,.1); color: var(--text-light); padding: 11px 16px; min-height: 44px; cursor: pointer; transition: background .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nb-btn:hover { background: rgba(255,255,255,.18); }
.nb-btn:active { transform: scale(.98); }
.nb-btn:disabled { opacity: .45; cursor: default; transform: none; }
.nb-btn:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.nb-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--ink); }
.nb-btn--primary:hover { background: #A6D2BC; }
.nb-btn--ghost { background: transparent; }
.nb-btn--danger { color: var(--bad); border-color: rgba(255,155,138,.4); }
.nb-btn--sm { font-size: 13px; padding: 8px 12px; min-height: 36px; border-radius: 10px; }
.nb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- header ---- */
.ab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: .4rem .2rem 0; }
.ab-head__eyebrow { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--primary); font-weight: 700; margin: 0 0 6px; }
.ab-head h1 { font-size: clamp(1.6rem, 4.5vw, 2.1rem); line-height: 1.12; }
.ab-head p { margin: 8px 0 0; color: rgba(242,239,234,.8); font-size: 14.5px; line-height: 1.55; max-width: 520px; }
.ab-head--compact { align-items: center; padding-top: .2rem; }
.ab-head--compact h1 { font-size: clamp(1.35rem, 4vw, 1.7rem); }
.ab-head__btns { display: flex; gap: 8px; flex: 0 0 auto; }
.nb-btn--icon { width: 40px; padding: 0; min-height: 40px; border-radius: 12px; }
.nb-btn--icon svg { width: 18px; height: 18px; }
.ab-group { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(242,239,234,.55); margin: 6px 4px 0; grid-column: 1 / -1; }
.ab-quiet { font: inherit; font-size: 13px; font-weight: 600; color: rgba(242,239,234,.6); background: none; border: 0; padding: 8px 10px; min-height: 36px; cursor: pointer; border-radius: 10px; margin-left: auto; }
.ab-quiet:hover { color: var(--text-light); background: rgba(255,255,255,.08); }
.ab-quiet:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ab-check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 8px 0; }
.ab-foot-note { font-size: 12.5px; line-height: 1.55; color: rgba(242,239,234,.6); margin: 4px 6px 0; }
.ab-foot-note a { color: rgba(242,239,234,.8); }

/* ---- today bar ---- */
.ab-today { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; }
.ab-today__date { font-size: 13px; color: rgba(242,239,234,.72); letter-spacing: .3px; }
.ab-today__date strong { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; color: var(--text-light); letter-spacing: 0; }
.ab-today__btn { flex: 1 1 180px; min-height: 48px; font-size: 15px; border-radius: 14px; box-shadow: 0 10px 30px -14px rgba(132,192,160,.9); }
.ab-today__btn.is-done { background: rgba(126,214,165,.18); border-color: rgba(126,214,165,.5); color: var(--good); box-shadow: none; }
.ab-today__sum { font-size: 12.5px; line-height: 1.5; color: rgba(242,239,234,.72); width: 100%; margin: 0; }
.ab-today__sum b { color: var(--good); }
.ab-pledge { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 13.5px; color: rgba(242,239,234,.85); }
.ab-pledge button { margin-left: auto; }

/* ---- cards ---- */
.ab-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .ab-grid { grid-template-columns: 1fr 1fr; } }
.ab-card { --sk: var(--primary); --sk2: var(--primary-deep); position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 12px; border-radius: 18px; background: var(--surface-bg); border: 1px solid var(--surface-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 32px rgba(0,0,0,.18); transition: border-color .2s, transform .15s; }
.ab-card.is-clean { border-color: rgba(126,214,165,.55); }
.ab-card.is-over { border-color: rgba(242,208,107,.55); }
.ab-card.is-reset { border-color: rgba(255,155,138,.45); }
.ab-card--alcohol { --sk: #C98BE8; --sk2: #9A5FC2; }
.ab-card--nicotine { --sk: #B9B4AC; --sk2: #7A766E; }
.ab-card--cannabis { --sk: #7ED6A5; --sk2: #3F9E6E; }
.ab-card--drugs { --sk: #FF9BB3; --sk2: #D66A86; }
.ab-card--caffeine { --sk: #E8A375; --sk2: #C9764A; }
.ab-card--softdrinks { --sk: #7FB3FF; --sk2: #5B83D6; }
.ab-card--sugar { --sk: #F2D06B; --sk2: #C9A33E; }
.ab-card--junkfood { --sk: #F7C98B; --sk2: #D59A4E; }
.ab-card--carbs { --sk: #6FD6CF; --sk2: #3FA59E; }
.ab-card--gambling { --sk: #FF8A8A; --sk2: #C85C5C; }
.ab-card--custom { --sk: var(--primary); --sk2: var(--primary-deep); }
.ab-card--ketosis { --sk: #FFB86B; --sk2: #E07A2F; }
.ab-card--sleep { --sk: #9BB5FF; --sk2: #5C6FD6; }
.ab-card--exercise { --sk: #A5E86B; --sk2: #5FA530; }
.ab-card--habit { --sk: #FFD166; --sk2: #D19A1E; }
.ab-card__top { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; border-radius: 12px; }
.ab-card__top:focus-visible { outline: 3px solid var(--terra); outline-offset: 4px; }
.ab-card__icon { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--sk), var(--sk2)); color: var(--ink); box-shadow: 0 8px 20px -10px var(--sk); }
.ab-card__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ab-card__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ab-card__goal { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(242,239,234,.8); }
.ab-card__streak { font-family: 'Playfair Display', Georgia, serif; font-size: 1.75rem; font-weight: 700; line-height: 1.05; color: var(--text-light); }
.ab-card__streak small { font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500; color: rgba(242,239,234,.72); margin-left: 6px; }
.ab-card__meta { font-size: 12px; color: rgba(242,239,234,.7); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ab-card__meta b { color: var(--text-light); font-weight: 600; }
.ab-card__why { font-size: 12.5px; color: rgba(242,239,234,.72); font-style: italic; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* last seven days: a labelled strip, today outlined */
.ab-card__week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; align-items: end; margin-top: 2px; }
.ab-day { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.ab-day i { width: 100%; max-width: 30px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.12); display: block; }
.ab-day b { font-size: 9.5px; font-weight: 600; letter-spacing: .3px; color: rgba(242,239,234,.5); line-height: 1; }
.ab-day.is-today b { color: var(--text-light); }
.ab-day i.c { background: var(--good); }
.ab-day i.a { background: rgba(126,214,165,.4); }
.ab-day i.x { background: var(--bad); }
.ab-day i.o, .ab-day i.p { background: var(--warn); }
.ab-day i.t { outline: 2px solid rgba(255,255,255,.5); outline-offset: 1px; }

.ab-card__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ab-card__actions .nb-btn { flex: 0 1 auto; }
.ab-card__actions .nb-btn.is-on { background: rgba(126,214,165,.18); border-color: rgba(126,214,165,.55); color: var(--good); }
.ab-counter { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--surface-border); border-radius: 12px; overflow: hidden; }
.ab-counter button { font: inherit; font-size: 20px; font-weight: 600; width: 44px; min-height: 44px; border: 0; background: rgba(255,255,255,.08); color: var(--text-light); cursor: pointer; }
.ab-counter button:hover { background: rgba(255,255,255,.16); }
.ab-counter button:focus-visible { outline: 3px solid var(--terra); outline-offset: -3px; }
.ab-counter output { min-width: 64px; text-align: center; font-size: 14px; font-weight: 600; padding: 0 6px; }
.ab-counter output small { display: block; font-size: 10.5px; font-weight: 500; color: rgba(242,239,234,.7); }
.ab-counter.is-over output { color: var(--warn); }
.ab-counter.is-met { border-color: rgba(126,214,165,.55); }
.ab-counter.is-met output { color: var(--good); }

/* today's check-in */
.ab-card__checkin { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 10px; margin: 2px -4px 0; border-radius: 14px; background: rgba(0,0,0,.16); border: 1px solid rgba(255,255,255,.07); }
.ab-q { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-light); }
.ab-q__when { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--sk); }
.ab-q__aside { margin-left: auto; font-size: 12px; font-weight: 500; color: rgba(242,239,234,.65); }
.ab-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ab-ans__btn { font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 12px; border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; text-align: center; line-height: 1.2; }
.ab-ans__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ab-ans__btn:active { transform: scale(.98); }
.ab-ans__btn:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ab-ans__btn--yes { background: rgba(126,214,165,.16); border: 1px solid rgba(126,214,165,.6); color: #B8F0CF; }
.ab-ans__btn--yes:hover { background: rgba(126,214,165,.28); }
.ab-ans__btn--no { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.2); color: rgba(242,239,234,.9); }
.ab-ans__btn--no:hover { background: rgba(255,155,138,.14); border-color: rgba(255,155,138,.55); color: #FFC4B8; }
.ab-ans__btn--solo { flex: 1 1 auto; }
.ab-countrow { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.ab-countrow .ab-counter { flex: 0 0 auto; }
.ab-counter output { min-width: 96px; font-size: 18px; font-weight: 700; line-height: 1.1; }
.ab-counter output small { margin-top: 2px; }
.ab-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.ab-bar i { display: block; height: 100%; border-radius: inherit; background: var(--warn); transition: width .25s; }
.ab-bar.is-met i { background: var(--good); }
.ab-done { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; line-height: 1.35; padding: 10px 12px; border-radius: 12px; min-height: 48px; }
.ab-done svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ab-done span { flex: 1 1 160px; }
.ab-done--good { background: rgba(126,214,165,.14); color: #CFF5DF; }
.ab-done--good svg { color: var(--good); }
.ab-done--bad { background: rgba(255,155,138,.12); color: #FFD3CA; }
.ab-done--bad svg { color: var(--bad); }
.ab-done--warn { background: rgba(242,208,107,.14); color: #F8E3A6; }
.ab-done--warn svg { color: var(--warn); }
.ab-link { font: inherit; font-size: 13px; font-weight: 600; color: var(--text-light); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer; margin-left: auto; }
.ab-link:hover { background: rgba(255,255,255,.18); }
.ab-link:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ab-link--inline { display: inline; margin: 0; padding: 2px 8px; min-height: 0; font-size: 12.5px; vertical-align: baseline; }
.ab-hint { margin: 0; font-size: 12.5px; line-height: 1.5; color: rgba(242,239,234,.72); }
.ab-hint b { color: var(--text-light); font-weight: 600; }
@media (max-width: 340px) { .ab-ans { grid-template-columns: 1fr; } }
.ab-next { font-size: 12px; color: rgba(242,239,234,.7); }
.ab-next b { color: var(--terra); font-weight: 600; }

/* ---- empty state ---- */
.ab-empty { text-align: center; padding: 1.4rem 1rem 1.2rem; }
.ab-empty h2 { font-size: 1.35rem; margin-bottom: 8px; }
.ab-empty p { color: rgba(242,239,234,.8); font-size: 14.5px; line-height: 1.6; margin: 0 auto 14px; max-width: 480px; }
.ab-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ab-preset { --sk: var(--primary); --sk2: var(--primary-deep); display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; font-weight: 600; text-align: left; color: var(--text-light); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 9px 10px; min-height: 54px; cursor: pointer; transition: background .15s, border-color .15s, transform .12s; }
.ab-preset:hover { background: rgba(255,255,255,.14); border-color: var(--sk); }
.ab-preset:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ab-preset.is-selected { border-color: var(--sk); background: rgba(255,255,255,.16); }
.ab-preset i { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--sk), var(--sk2)); color: var(--ink); }
.ab-preset i svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ab-preset--alcohol { --sk: #C98BE8; --sk2: #9A5FC2; } .ab-preset--nicotine { --sk: #B9B4AC; --sk2: #7A766E; } .ab-preset--cannabis { --sk: #7ED6A5; --sk2: #3F9E6E; }
.ab-preset--drugs { --sk: #FF9BB3; --sk2: #D66A86; } .ab-preset--caffeine { --sk: #E8A375; --sk2: #C9764A; } .ab-preset--softdrinks { --sk: #7FB3FF; --sk2: #5B83D6; }
.ab-preset--sugar { --sk: #F2D06B; --sk2: #C9A33E; } .ab-preset--junkfood { --sk: #F7C98B; --sk2: #D59A4E; } .ab-preset--carbs { --sk: #6FD6CF; --sk2: #3FA59E; }
.ab-preset--gambling { --sk: #FF8A8A; --sk2: #C85C5C; } .ab-preset--custom { --sk: #F2EFEA; --sk2: #B9B4AC; }
.ab-preset--ketosis { --sk: #FFB86B; --sk2: #E07A2F; } .ab-preset--sleep { --sk: #9BB5FF; --sk2: #5C6FD6; } .ab-preset--exercise { --sk: #A5E86B; --sk2: #5FA530; } .ab-preset--habit { --sk: #FFD166; --sk2: #D19A1E; }
.ab-empty .ab-sub, .ab-sheet__card .ab-sub:first-child { text-align: left; }

/* ---- sheets (dark, on-brand; the shared .nb-sheet is light) ---- */
.ab-sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 3100; display: none; align-items: center; justify-content: center; background: rgba(10, 13, 20, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 16px; }
.ab-sheet.is-open { display: flex; }
.ab-sheet__card { width: 100%; max-width: 560px; max-height: calc(100% - 32px); max-height: calc(100dvh - 32px); margin: auto 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: #1A2330; color: var(--text-light); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 18px 18px 20px; box-shadow: 0 24px 70px rgba(0,0,0,.55); position: relative; }
@media (min-width: 700px) { .ab-sheet { padding: 24px; } .ab-sheet__card { max-height: calc(100% - 48px); max-height: calc(100dvh - 48px); } }
.ab-sheet__close { position: sticky; top: 0; float: right; margin: -4px -4px 0 8px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: var(--text-light); font-size: 22px; line-height: 1; cursor: pointer; }
.ab-sheet__close:hover { background: rgba(255,255,255,.18); }
.ab-sheet__eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--primary); margin: 0 0 6px; }
.ab-sheet__title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; line-height: 1.2; padding-right: 40px; }
.ab-sheet__hint { font-size: 13.5px; color: rgba(242,239,234,.78); margin: 0 0 14px; line-height: 1.5; }
.ab-sheet__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ab-sheet__actions .nb-btn { flex: 1 1 auto; }
.ab-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.ab-field > label, .ab-field__label { font-size: 12.5px; font-weight: 600; color: rgba(242,239,234,.85); letter-spacing: .2px; }
.ab-field input[type="text"], .ab-field input[type="number"], .ab-field input[type="datetime-local"], .ab-field textarea, .ab-field select {
  font: inherit; font-size: 15px; color: var(--text-light); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 11px 12px; min-height: 46px; width: 100%; }
.ab-field textarea { min-height: 72px; resize: vertical; }
.ab-field input:focus-visible, .ab-field textarea:focus-visible, .ab-field select:focus-visible { outline: 3px solid var(--terra); outline-offset: 1px; }
.ab-field__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ab-field__row > * { flex: 1 1 120px; }
.ab-field small { font-size: 12px; color: rgba(242,239,234,.65); }
.ab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-chip { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-light); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 8px 14px; min-height: 38px; cursor: pointer; }
.ab-chip[aria-pressed="true"], .ab-chip[aria-checked="true"], .ab-chip.is-on { background: rgba(132,192,160,.22); border-color: var(--primary); color: #CFEBDC; }
.ab-chip:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ab-chips--stack { flex-direction: column; align-items: stretch; }
.ab-chips--stack .ab-chip { text-align: left; padding: 12px 16px; min-height: 48px; border-radius: 14px; font-size: 15px; }
.ab-wiz__dots { display: flex; gap: 6px; margin: 4px 44px 16px 0; }
.ab-wiz__dots i { display: block; flex: 1 1 auto; height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); }
.ab-wiz__dots i.done { background: var(--primary-deep); }
.ab-wiz__dots i.now { background: var(--primary); }
.ab-wiz .ab-sheet__title { font-size: 1.55rem; }
.ab-wiz .ab-field input[type="text"], .ab-wiz .ab-field input[type="number"], .ab-wiz .ab-field input[type="datetime-local"] { font-size: 17px; min-height: 52px; }
.ab-wiz .ab-sheet__actions { margin-top: 20px; }
.ab-caution { font-size: 13px; line-height: 1.5; color: #FFD9C9; background: rgba(232,163,117,.12); border: 1px solid rgba(232,163,117,.35); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.ab-caution a { color: #FFD9C9; }

/* ---- detail ---- */
.ab-detail__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ab-detail__streak { font-family: 'Playfair Display', Georgia, serif; font-size: 2.3rem; font-weight: 700; line-height: 1; }
.ab-detail__streak small { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: rgba(242,239,234,.72); margin-left: 6px; }
.ab-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.ab-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 11.5px; color: rgba(242,239,234,.75); }
.ab-stat em.ab-stat__date { font-size: 1rem; padding-top: 4px; }
.ab-stat em { font-style: normal; font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; font-weight: 700; color: var(--text-light); line-height: 1.1; }
.ab-sub { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--primary); margin: 16px 0 8px; }
.ab-cal { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.ab-cal i { min-height: 16px; aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,.08); display: block; }
.ab-cal i.c { background: var(--good); } .ab-cal i.a { background: rgba(126,214,165,.38); } .ab-cal i.x { background: var(--bad); } .ab-cal i.o, .ab-cal i.p { background: var(--warn); } .ab-cal i.t { outline: 2px solid rgba(255,255,255,.6); outline-offset: -1px; }
.ab-cal button { min-height: 16px; aspect-ratio: 1; border-radius: 4px; border: 0; padding: 0; background: rgba(255,255,255,.08); cursor: pointer; display: block; width: 100%; }
.ab-cal button.c { background: var(--good); } .ab-cal button.a { background: rgba(126,214,165,.38); } .ab-cal button.x { background: var(--bad); } .ab-cal button.o, .ab-cal button.p { background: var(--warn); } .ab-cal button.t { outline: 2px solid rgba(255,255,255,.6); outline-offset: -1px; }
.ab-cal button:focus-visible { outline: 3px solid var(--terra); outline-offset: 1px; }
.ab-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: rgba(242,239,234,.7); margin-top: 8px; }
.ab-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: rgba(255,255,255,.1); }
.ab-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ab-timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: rgba(242,239,234,.85); padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.ab-timeline li.is-past { border-color: rgba(126,214,165,.4); }
.ab-timeline li.is-next { border-color: var(--terra); background: rgba(232,163,117,.08); }
.ab-timeline b { flex: 0 0 74px; font-size: 12px; color: var(--primary); font-weight: 700; padding-top: 2px; }
.ab-timeline li.is-past b { color: var(--good); }
.ab-timeline li.is-next b { color: var(--terra); }
.ab-slips { list-style: none; margin: 0; padding: 0; font-size: 13px; color: rgba(242,239,234,.8); }
.ab-slips li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.ab-source { font-size: 12px; color: rgba(242,239,234,.6); margin: 8px 0 0; line-height: 1.5; }
.ab-source a { color: rgba(242,239,234,.8); }

/* ---- footer tools ---- */
.ab-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ab-tools label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(242,239,234,.8); margin-left: auto; }
.ab-note { font-size: 13px; line-height: 1.55; color: rgba(242,239,234,.78); }
.ab-note p { margin: 0 0 8px; }

/* ---- toast + celebration ---- */
.ab-toast { position: fixed; left: 0; right: 0; width: max-content; margin: 0 auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateY(20px); z-index: 3300; background: #1A2330; color: var(--text-light); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 12px 16px; font-size: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s; max-width: min(92vw, 520px); display: flex; align-items: center; gap: 12px; }
.ab-toast > span { flex: 1 1 auto; min-width: 0; }
.ab-toast.is-on { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ab-toast button { font: inherit; font-weight: 700; color: var(--primary); background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.ab-confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; z-index: 3250; overflow: hidden; }
.ab-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: .95; animation: abFall 1.5s cubic-bezier(.2,.6,.3,1) forwards; }
@keyframes abFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(100vh) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ab-confetti { display: none; } }
.ab-card.is-celebrate { animation: abPop .5s ease; }
@keyframes abPop { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
.ab-ans__btn span { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.ab-ans__btn span small { font-size: 12px; font-weight: 500; opacity: .85; }
.ab-ans__btn--solo span { flex-direction: row; gap: 4px; align-items: baseline; }
.ab-hintrow { display: flex; align-items: center; gap: 8px; }
.ab-hintrow .ab-hint { flex: 1 1 auto; }
.ab-link svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.ab-countrow .ab-ans__btn--solo { flex: 1 1 120px; }
.ab-hint--right { text-align: right; }
