@font-face { font-family: "Lato"; src: url("fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Playfair"; src: url("fonts/Playfair-Regular.ttf") format("truetype"); font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair"; src: url("fonts/Playfair-Italic.ttf") format("truetype"); font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --green: #1D3C34; --gold: #A6844B; --cream: #F6F4EA; --paper: #FFFFFF;
  --ink-2: #4A5B54; --line: #DCD6C4; --danger: #8E3B2B;
  --personal: #5E7F6A; --professional: #1D3C34; --family: #A4583A;
  --serif: "Playfair", Georgia, "Times New Roman", serif;
  --sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --pad: clamp(20px, 5vw, 40px);
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--cream); color: var(--green); font: 400 17px/1.55 var(--sans); display: flex; flex-direction: column; min-height: 100dvh; -webkit-text-size-adjust: 100%; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.bar { background: var(--green); color: var(--cream); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--pad) 12px; min-height: 58px; }
.bar-title { font: italic 400 19px var(--serif); }
.bar-logo { height: 26px; width: auto; }

/* Tracker: sticky, compacts while scrolling down */
.tracker { position: sticky; top: 0; z-index: 10; background: var(--cream); border-bottom: 1px solid var(--line); }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s ease-out; }
.tracker-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 980px; margin: 0 auto; padding: 10px var(--pad) 4px; font-size: 14px; }
.ctx { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracker-summary { color: var(--ink-2); white-space: nowrap; font-size: 13px; }
.chips { list-style: none; margin: 0 auto; padding: 4px var(--pad) 10px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 980px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 5px; color: var(--ink-2); font-size: 13px; min-height: 34px; white-space: nowrap; }
.chip.is-current { border-color: var(--green); color: var(--green); font-weight: 700; }
body.compact .chips { display: none; }

/* Rings */
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--gold); transition: stroke-dashoffset .2s ease-out; }
.ring .tick { stroke: var(--green); }
.ring-lg { margin-bottom: 24px; }

/* Screen */
.screen { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: clamp(24px, 5vh, 48px) var(--pad) 32px; outline: none; }
body[data-type="combo"] .screen { max-width: 980px; }
.eyebrow { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.title { font: italic 400 clamp(32px, 7vw, 44px)/1.12 var(--serif); margin: 0 0 14px; text-wrap: balance; }
.subtitle { font: italic 400 22px/1.3 var(--serif); margin: 28px 0 8px; }
.lede { font-size: 17px; color: var(--ink-2); margin: 0 0 20px; text-wrap: pretty; }
.question { font: italic 400 clamp(23px, 5.4vw, 30px)/1.28 var(--serif); margin: 0 0 18px; text-wrap: balance; }
.question-sm { font-size: clamp(19px, 4.4vw, 22px); }
.hint { font-size: 15px; color: var(--ink-2); margin: -8px 0 18px; text-wrap: pretty; }
.note { font-size: 15px; color: var(--green); background: var(--paper); border-left: 3px solid var(--gold); padding: 10px 14px; margin: 0 0 18px; }
.meta { font-size: 15px; color: var(--ink-2); }
.ref { font-weight: 700; color: var(--green); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--paper); border-radius: 4px; padding: 2px 8px; margin: 0; }
.tag-P, .tag-personal { background: var(--personal); }
.tag-W, .tag-professional { background: var(--professional); }
.tag-F, .tag-family { background: var(--family); }
.pair + .pair { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 4px; }
.pair .tag { margin-bottom: 10px; }
.side { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }

/* Fields */
.field { display: block; margin-bottom: 20px; }
.field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
textarea, input[type="text"] { width: 100%; font: 400 17px/1.5 var(--sans); color: var(--green); background: transparent; border: 0; border-bottom: 1.5px solid var(--green); border-radius: 0; padding: 8px 0; resize: none; -webkit-appearance: none; appearance: none; }
textarea { min-height: 2.6em; overflow: hidden; }
::placeholder { color: #8A958F; }
textarea:focus, input:focus { outline: none; border-bottom: 2px solid var(--gold); }
[data-block].is-new { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Carry-forward */
.carry { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.carry p { margin: 0; }
.carry-text { font: italic 400 19px/1.4 var(--serif); margin: 6px 0 14px !important; }
.carry-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Welcome */
.voda { list-style: none; padding: 0; margin: 0 0 8px; }
.voda li { display: flex; gap: 14px; padding: 8px 0; }
.voda-l { font: italic 400 26px/1 var(--serif); color: var(--gold); width: 1.1em; flex: none; }
.sections, .guide { list-style: none; padding: 0; margin: 0 0 8px; border-top: 1px solid var(--line); }
.sections li, .guide li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.sections span, .guide span { color: var(--ink-2); font-size: 15px; }
.guide em { font-style: normal; font-size: 13px; color: var(--green); }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin-top: 24px; }
.intro { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: 3vh; }
.intro .stack { width: 100%; margin-left: auto; margin-right: auto; }

/* Quarter overview grid */
.qgrid { display: grid; grid-template-columns: minmax(84px, auto) repeat(4, 1fr); gap: 6px; align-items: center; margin: 8px 0 18px; }
.qh { font-size: 13px; color: var(--ink-2); text-align: center; }
.qr { font-size: 11px; justify-self: start; padding: 2px 6px; }
.qcell { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 0 6px; min-height: 64px; }
.qid { font-size: 12px; color: var(--ink-2); }
.qskip { font-size: 22px; line-height: 40px; color: var(--ink-2); }

/* Two columns on wide screens */
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: start; }
  .split .lead { position: sticky; top: 150px; }
}

/* Bottom nav */
.nav { position: sticky; bottom: 0; z-index: 10; background: var(--cream); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 10px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 10px); }
.saved { flex: 1; text-align: center; font-size: 13px; color: var(--ink-2); }
.btn { background: var(--green); color: var(--cream); border: 0; border-radius: 999px; padding: 12px 26px; min-height: 48px; font-weight: 700; font-size: 16px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.btn-danger { background: var(--danger); }
.link { background: none; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; padding: 10px 4px; min-height: 44px; font-size: 16px; }
.link:disabled { visibility: hidden; }
.link-quiet { color: var(--ink-2); font-size: 14px; }

/* Final */
.todo { list-style: none; padding: 0; margin: 0 0 8px; width: 100%; text-align: left; border-top: 1px solid var(--line); }
.todo li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.status { font-size: 15px; color: var(--ink-2); min-height: 1.5em; margin: 0; }

.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px); transform: translateX(-50%); background: var(--green); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 30; animation: rise .2s ease-out; }
.foot { text-align: center; font-size: 12px; color: var(--ink-2); padding: 10px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 10px); }
body:not([data-type="welcome"]):not([data-type="final"]) .foot { display: none; }

.sheet { border: 0; border-radius: 16px; padding: 24px; width: min(92vw, 420px); background: var(--cream); color: var(--green); }
.sheet::backdrop { background: rgba(29,60,52,.45); }
.sheet-title { font: italic 400 26px var(--serif); margin: 0 0 12px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
