:root {
  /* Layout: one phone-width column, scrolling views, fixed bottom nav. Single theme by choice. */
  --ground: #F6F4FB;
  --ink: #1E1B3A;
  --ink-soft: #35315A;
  --muted: #5A5674;
  --violet: #6C4DF5;
  --marigold: #FFB627;
  --lilac: #CFC4FF;
  --paper: #FFFFFF;
  --alert: #FFE1DA;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #14122B; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button, textarea, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }

#app { height: 100%; max-width: 430px; margin: 0 auto; background: var(--ground); display: flex; flex-direction: column; overflow: hidden; }
#app.dark { background: var(--ink); color: #FFFFFF; }
#app.brand { background: var(--violet); color: #FFFFFF; }
main { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 22px 24px; display: flex; flex-direction: column; gap: 20px; }
/* On short screens, scroll instead of squashing sections into each other. */
main > * { flex-shrink: 0; }

.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.muted { color: var(--muted); }
.muted a { color: inherit; font-weight: 700; }
.dark .muted { color: #C9C5E6; }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.push { margin-top: auto; }

.round { width: 44px; height: 44px; border-radius: 22px; background: var(--paper); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dark .round { background: var(--ink-soft); color: #FFFFFF; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--lilac); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); flex-shrink: 0; }

.btn { min-height: 56px; border-radius: 28px; padding: 0 24px; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; text-decoration: none; }
.btn.violet { background: var(--violet); color: #FFFFFF; }
.btn.marigold { background: var(--marigold); color: var(--ink); }
.btn.line { border: 2px solid currentColor; }
.btn.fit { width: auto; align-self: flex-start; min-height: 48px; font-size: 16px; }
.btn:disabled { background: #DAD6EA; color: var(--muted); cursor: not-allowed; }
.textbtn { min-height: 44px; font-weight: 700; text-decoration: underline; align-self: center; }

.banner { background: var(--violet); color: #FFFFFF; border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.banner.quiet { background: var(--paper); color: var(--ink); }
.note { background: var(--paper); border-radius: 20px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.dark .note { background: var(--ink-soft); }
.note .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--marigold); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice { background: var(--alert); color: var(--ink); border-radius: 16px; padding: 12px 16px; font-size: 15px; font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-weight: 700; font-size: 15px; }
.field input { height: 56px; border-radius: 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 0 16px; font-size: 17px; width: 100%; }
.field input::placeholder { color: var(--muted); }
.brand .field input { border-color: #FFFFFF; }
.linkbox { background: var(--paper); border-radius: 16px; padding: 12px 16px; font-size: 14px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }

.listrow { background: var(--paper); border-radius: 20px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; }
.mini { width: 44px; height: 56px; border-radius: 10px; flex-shrink: 0; }
.listrow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; background: var(--ground); white-space: nowrap; }
.pill.on { background: var(--marigold); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; margin: -4px -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--ink); font-weight: 700; font-size: 15px; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.chip .sw { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.chip[aria-pressed="true"] .sw { border-color: #FFFFFF; }

.card { border-radius: 28px; padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; }
.card .starter { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.card .text { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card textarea { width: 100%; min-height: 150px; border: 0; background: transparent; resize: none; padding: 0; font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; }
.card textarea::placeholder { color: inherit; opacity: 0.55; }
.card textarea:focus { outline: none; }
.card .count { align-self: flex-end; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tilt { transform: rotate(-1.5deg); }

.stage { position: relative; width: min(300px, 100%); min-height: 380px; align-self: center; margin-top: 12px; perspective: 900px; }
.stage .card { min-height: 380px; }
.cover { position: absolute; inset: 0; border-radius: 28px; touch-action: none; user-select: none; -webkit-user-select: none; }
.cover.peel { padding: 28px 26px; display: flex; flex-direction: column; gap: 12px; cursor: grab; }
.cover.peel .display { font-size: 36px; }
.cover.peel .grab { margin-top: auto; align-self: flex-end; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.cover.fold { display: grid; grid-template-rows: 1fr 1fr; gap: 0; touch-action: auto; }
.flap { font-family: var(--display); font-weight: 700; font-size: 24px; transition: transform 0.5s ease, opacity 0.5s ease; }
.flap.top { border-radius: 28px 28px 0 0; transform-origin: top; border-bottom: 2px dashed rgba(255,255,255,0.5); }
.flap.bottom { border-radius: 0 0 28px 28px; transform-origin: bottom; }
.flap.gone { transform: rotateX(88deg); opacity: 0; pointer-events: none; }
canvas.cover { width: 100%; height: 100%; cursor: crosshair; }

.jar { display: flex; flex-direction: column; align-items: center; align-self: center; }
.jar .lid { width: 150px; height: 22px; border-radius: 8px; background: var(--ink); }
.jar .neck { width: 126px; height: 14px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); background: var(--paper); }
.jar .glass { width: 230px; height: 230px; border: 3px solid var(--ink); border-radius: 44px 44px 56px 56px; background: var(--paper); position: relative; overflow: hidden; }
.slip { position: absolute; width: 78px; height: 46px; border-radius: 10px; }
.jar.shaking { animation: shake 0.6s ease; }
@keyframes shake { 0%,100% { transform: rotate(0); } 15% { transform: rotate(-9deg) translateX(-8px); } 35% { transform: rotate(8deg) translateX(8px); } 55% { transform: rotate(-6deg) translateX(-5px); } 75% { transform: rotate(4deg) translateX(4px); } }
.drop { animation: drop 0.35s ease; }
@keyframes drop { from { transform: translateY(-24px) rotate(-4deg); opacity: 0.4; } to { transform: none; opacity: 1; } }

.trail { position: relative; display: flex; flex-direction: column; gap: 14px; }
.trail::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 3px; border-radius: 2px; background: var(--lilac); }
.hop { position: relative; display: flex; align-items: center; gap: 14px; }
.hop .node { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--display); font-weight: 700; font-size: 16px; background: var(--paper); border: 3px solid var(--lilac); }
.hop .node.fill { border: 0; }

nav { flex-shrink: 0; height: 84px; padding: 0 40px 10px; background: var(--paper); border-radius: 28px 28px 0 0; display: flex; justify-content: space-between; align-items: center; }
nav .tab { min-width: 56px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
nav .tab[aria-current="page"] { color: var(--violet); }
nav .plus { width: 60px; height: 60px; border-radius: 50%; background: var(--marigold); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.fan { position: relative; height: 160px; }
.fan div { position: absolute; border-radius: 20px; }

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

/* Small print links inside the app */
.fine { font-size: 13px; text-align: center; }
.fine a, .doc a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Privacy and terms pages */
body.docpage { background: var(--ground); }
.doc { max-width: 640px; margin: 0 auto; padding: 32px 22px 64px; display: flex; flex-direction: column; gap: 14px; }
.doc .brandline { font-family: var(--display); font-weight: 700; font-size: 20px; text-decoration: none; }
.doc h1 { font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1.08; letter-spacing: -0.02em; margin-top: 8px; }
.doc h2 { font-family: var(--display); font-weight: 700; font-size: 22px; margin-top: 18px; }
.doc p, .doc li { font-size: 16px; line-height: 1.55; }
.doc ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc .updated { color: var(--muted); font-size: 14px; }
.doc .summary { background: var(--paper); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.doc mark.todo { background: var(--marigold); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
