/* Moon & Moss — sage, moss and cream; calm, earthy, a little magical. */
:root {
  --cream: #f6f2e7;
  --paper: #fbf9f2;
  --mist: #eef0e2;
  --sage: #a9b998;
  --sage-soft: #dfe6d3;
  --moss: #5e7d4c;
  --forest: #2f4a33;
  --ink: #2a3a2c;
  --muted: #6d7a68;
  --bark: #8a6f55;
  --moon: #e3cf94;
  --rust: #b5764f;
  --shadow: 0 10px 30px rgba(47, 74, 51, .12), 0 2px 6px rgba(47, 74, 51, .08);
  --radius: 22px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--mist);
  background-image: radial-gradient(1200px 600px at 110% -10%, #e9e3c7 0%, transparent 60%),
                    radial-gradient(900px 700px at -20% 110%, #d9e3cc 0%, transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100%;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--forest); margin: 0; }
h1 { font-size: 30px; letter-spacing: .3px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* drifting leaves */
.leaves { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.leaves i { position: absolute; top: -40px; width: 16px; height: 16px; border-radius: 0 70% 0 70%;
  background: var(--sage); opacity: .35; animation: drift 22s linear infinite; }
.leaves i:nth-child(1) { left: 8%;  animation-delay: 0s;   animation-duration: 26s; }
.leaves i:nth-child(2) { left: 28%; animation-delay: -6s;  background: var(--moss); opacity: .2; }
.leaves i:nth-child(3) { left: 50%; animation-delay: -12s; animation-duration: 30s; }
.leaves i:nth-child(4) { left: 68%; animation-delay: -3s;  background: var(--moon); opacity: .35; }
.leaves i:nth-child(5) { left: 84%; animation-delay: -17s; animation-duration: 24s; }
.leaves i:nth-child(6) { left: 95%; animation-delay: -9s;  background: var(--moss); opacity: .18; }
@keyframes drift {
  0%   { transform: translate(0, -5vh) rotate(0deg); }
  50%  { transform: translate(-40px, 50vh) rotate(160deg); }
  100% { transform: translate(20px, 110vh) rotate(320deg); }
}
@media (prefers-reduced-motion: reduce) { .leaves { display: none; } .card { transition: none !important; } }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.top .back { font-size: 15px; color: var(--moss); padding: 8px 4px; }
.moon { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.moon b { font-size: 22px; font-weight: normal; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand small { font-size: 13px; color: var(--muted); }

/* home tiles */
.hello { margin: 6px 0 20px; }
.hello p { margin: 6px 0 0; color: var(--muted); }
.tiles { display: grid; gap: 12px; }
.tile { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 16px 18px;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.tile .ico { font-size: 28px; width: 40px; text-align: center; }
.tile .tx { flex: 1; }
.tile .tx b { display: block; font-family: var(--serif); font-weight: 500; font-size: 19px; color: var(--forest); }
.tile .tx span { font-size: 14px; color: var(--muted); }
.tile.glow { background: linear-gradient(135deg, #fbf6e3, #eef3e2); box-shadow: 0 0 0 2px var(--moon), var(--shadow); }
.tile.quiet { background: rgba(251, 249, 242, .6); box-shadow: none; border: 1px solid var(--sage-soft); }
.tile .arrow { color: var(--sage); font-size: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { padding: 10px 16px; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow); font-size: 15px; }
.chip.on { background: var(--moss); color: #fff; }

/* play */
.progress { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.progress i { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-soft); }
.progress i.done { background: var(--sage); }
.progress i.now { background: var(--moss); transform: scale(1.3); }
.stage { position: relative; min-height: 380px; display: flex; flex-direction: column; }
.card { position: relative; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); padding: 22px;
  min-height: 340px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .35s ease, opacity .35s ease; }
.card.dragging { transition: none; }
.card .tag { position: absolute; top: 16px; left: 20px; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.card .from { position: absolute; top: 14px; right: 18px; font-size: 12px; color: var(--bark); background: #f3ebdc; padding: 4px 10px; border-radius: 999px; }
.card .q { font-family: var(--serif); font-size: 26px; line-height: 1.3; text-align: center; color: var(--forest); padding: 18px 6px; }
.card .q.small-q { font-size: 18px; padding: 10px 6px 0; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { min-height: 170px; border-radius: 20px; background: var(--mist); display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 14px; font-family: var(--serif); font-size: 20px; line-height: 1.3; color: var(--forest);
  border: 2px solid transparent; transition: transform .15s, background .2s, border-color .2s; }
.opt:active { transform: scale(.97); }
.opt.lean { border-color: var(--sage); background: var(--sage-soft); }
.opt.picked { background: var(--moss); color: #fff; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.yn button { padding: 16px; border-radius: 18px; font-size: 17px; background: var(--paper); box-shadow: var(--shadow); }
.yn .no { color: var(--bark); }
.yn .yes { color: var(--moss); }
.stamp { position: absolute; top: 40%; font-family: var(--serif); font-size: 26px; padding: 6px 16px; border-radius: 12px; opacity: 0; pointer-events: none; }
.stamp.yes { right: 18px; color: var(--moss); border: 3px solid var(--moss); transform: rotate(10deg); }
.stamp.no { left: 18px; color: var(--bark); border: 3px solid var(--bark); transform: rotate(-10deg); }
.hint { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }
.undo { color: var(--muted); font-size: 14px; padding: 8px; }

/* after-answer sheet */
.sheet { margin-top: 14px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sheet .lbl { font-size: 14px; color: var(--muted); width: 100%; }
.pill { padding: 10px 14px; border-radius: 999px; background: var(--mist); font-size: 15px; }
.pill.on { background: var(--moss); color: #fff; }
.pill.ghost { background: transparent; color: var(--muted); }
.pill.rec { background: #f3e1d6; color: var(--rust); }
.next { width: 100%; padding: 15px; border-radius: 16px; background: var(--forest); color: #fff; font-size: 17px; }
.next.soft { background: var(--sage-soft); color: var(--forest); }
textarea, input[type=text] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--sage-soft); background: #fff; color: var(--ink); resize: vertical; }
textarea { min-height: 80px; }

/* pin */
.center { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.dots { display: flex; gap: 14px; margin: 10px 0; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--moss); }
.dots i.full { background: var(--moss); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.pad button { height: 64px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); font-size: 24px; font-family: var(--serif); }
.pad button.blank { visibility: hidden; }
.err { color: var(--rust); min-height: 22px; font-size: 14px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* garden */
.summary { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.summary .big { font-family: var(--serif); font-size: 22px; color: var(--forest); }
.topic { display: grid; grid-template-columns: 90px 1fr 54px; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; }
.bar { height: 12px; border-radius: 999px; background: var(--sage-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--moss); border-radius: 999px; }
.gcard { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.gcard .gq { font-family: var(--serif); font-size: 18px; color: var(--forest); margin-bottom: 10px; }
.gcard .badge { float: right; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--forest); }
.gcard .badge.diff { background: #f3ebdc; color: var(--bark); }
.both { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who { background: var(--mist); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.who b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 4px; }
.who .pick { font-family: var(--serif); font-size: 16px; color: var(--forest); }
.who .note { margin-top: 6px; font-style: italic; color: var(--ink); }
.who audio { width: 100%; margin-top: 6px; height: 34px; }
.who .g { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* stats */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 20px; color: var(--forest); font-weight: 500; }
.stat span { font-size: 12px; color: var(--muted); }
.section { margin: 22px 0 8px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 70px; padding: 6px 0; }
.hours i { display: block; background: var(--moss); border-radius: 3px 3px 0 0; min-height: 1px; }
.hours.w i { background: var(--sage); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--sage-soft); }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list { margin: 6px 0; padding: 0; list-style: none; font-size: 14px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--sage-soft); }
.list li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* review */
.rv { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--sage-soft); font-size: 15px; }
.rv input { width: 22px; height: 22px; accent-color: var(--moss); margin-top: 2px; flex: none; }
.rv.off .rvt { text-decoration: line-through; color: var(--muted); }
.rv small { color: var(--muted); }

/* live */
.waiting { text-align: center; padding: 30px 10px; color: var(--muted); }
.pulse { display: inline-block; font-size: 42px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .7; } }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.seg { display: flex; gap: 6px; background: var(--paper); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); margin-bottom: 14px; }
.seg button { flex: 1; padding: 10px; border-radius: 999px; font-size: 15px; }
.seg button.on { background: var(--moss); color: #fff; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 14px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 5; font-size: 15px; box-shadow: var(--shadow); }

.change { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.change .pill { padding: 7px 11px; font-size: 13px; background: var(--paper); }
.change .pill.on { background: var(--moss); color: #fff; }
.linkish { font-size: 12px; color: var(--moss); padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }

details.day { margin: 10px 0; }
details.day summary { cursor: pointer; font-size: 14px; color: var(--forest); padding: 8px 0; font-weight: 600; }
