/* Kiwi: the founder's palette and type (design/README.md), phone first. */
:root {
  --mint: #E6F7F2;
  --mint-dark: #BFE8E1;
  --sky: #A7D7F3;
  --cream: #FFF7E6;
  --kiwi: #B9855F;
  --teal: #245D59;
  --teal-ink: #1B4744;
  --yellow: #FFD97A;
  --soft-blue: #E8F3FF;
  --grey: #8A9CA0;
  --ink: #1F2A2A;
  --white: #FFFFFF;
  --red: #D9534F;
  --red-soft: #FDECEA;
  --line: #D6ECE6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 42, 42, .05), 0 6px 18px rgba(36, 93, 89, .08);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 var(--font);
  color: var(--ink);
  background: var(--mint);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--teal); line-height: 1.15; margin: 0 0 .35em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
.muted { color: #5B6E6C; }
.small { font-size: .875rem; }
.center-text { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.noscript { padding: 24px; text-align: center; }

/* ---- Layout: one phone column, centred on wide screens ---- */
#app { max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
#view { outline: none; padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + var(--safe-b)); }
body.has-tabs #view { padding-bottom: calc(var(--tabbar-h) + 28px + var(--safe-b)); }
body.kiwi-open #view { padding-bottom: calc(var(--tabbar-h) + 230px + var(--safe-b)); }
@media (min-width: 600px) {
  body { background: radial-gradient(circle at 20% 10%, var(--soft-blue), transparent 40%), radial-gradient(circle at 80% 90%, var(--cream), transparent 45%), var(--mint); }
  #app { background: var(--mint); box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(36, 93, 89, .12); }
}
.loading { text-align: center; padding-top: 30vh; color: var(--grey); }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen.center { align-items: stretch; text-align: center; padding-top: 4vh; }
.screen.center > img, .screen.center .intro-kiwi { margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px; border-radius: 999px; border: 0;
  font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--teal); color: var(--white); }
.btn.primary:hover { background: var(--teal-ink); }
.btn.secondary { background: var(--white); color: var(--teal); box-shadow: inset 0 0 0 2px var(--mint-dark); }
.btn.ghost { background: var(--white); color: var(--teal); flex: 1; min-height: 48px; padding: 8px 10px; box-shadow: var(--shadow); flex-direction: column; gap: 0; font-size: .95rem; }
.btn.ghost small { font-weight: 600; color: var(--grey); font-size: .75rem; }
.btn.ghost.danger, .danger-text, .rows .row.danger-text { color: var(--red); }
.btn.add { background: #5CC2B3; color: var(--white); margin-top: 6px; }
.btn.add:hover { background: #4AB0A2; }
.link { background: none; border: 0; color: var(--teal); font: 600 .95rem var(--font); padding: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  border: 0; background: var(--white); color: var(--teal); font: 700 .875rem var(--font); cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--mint-dark);
}
.chip.picked, .chip:active { background: var(--mint-dark); }
.chip.danger { color: var(--red); box-shadow: inset 0 0 0 1.5px #F3C5C3; }
.chip.on-dark { background: var(--yellow); color: var(--ink); box-shadow: none; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--teal); }
.icon-btn:hover { background: rgba(255, 255, 255, .6); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.inline { width: 18px; height: 18px; vertical-align: -3px; }
.row-actions, .action-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Cards and forms ---- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h2 { margin-bottom: .3em; }
.notice { background: var(--cream); border-radius: 14px; padding: 12px 14px; font-size: .925rem; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--teal); text-align: left; }
.field input, .field textarea, .field select { font-weight: 400; }
input, select, textarea {
  font: 1rem var(--font); color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(36, 93, 89, .15); }
textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; text-align: left; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--teal); flex: none; }
.rows { padding: 4px 16px; }
.rows .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); width: 100%; }
.rows .row:last-child { border-bottom: 0; }
.rows .row > span { font-weight: 700; display: flex; flex-direction: column; text-align: left; }
.rows .row small { font-weight: 400; color: var(--grey); font-size: .8rem; }
.rows .row input:not([type=checkbox]), .rows .row select { width: auto; max-width: 58%; min-height: 40px; padding: 6px 10px; border: 0; background: var(--mint); text-align: right; }
.rows .row.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rows .row.split label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.rows .row.split input, .rows .row.split select { max-width: 100%; text-align: left; }
.row-note { margin: 0 0 10px; }
.link-row { background: none; border: 0; cursor: pointer; font: inherit; }
.chev { width: 18px; height: 18px; color: var(--grey); }
input[type=checkbox][role=switch] {
  appearance: none; -webkit-appearance: none; width: 50px; height: 30px; min-height: 0; padding: 0; border: 0;
  border-radius: 999px; background: #CBD8D6; position: relative; cursor: pointer; flex: none; transition: background .15s;
}
input[type=checkbox][role=switch]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s;
}
input[type=checkbox][role=switch]:checked { background: var(--teal); }
input[type=checkbox][role=switch]:checked::after { transform: translateX(20px); }

/* ---- Top bar and page heads ---- */
.topbar { display: flex; align-items: center; gap: 4px; margin: -6px 0 -4px -10px; min-height: 44px; }
.topbar-title { font-size: 1.1rem; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; }
.page-head .head-kiwi-img { width: 64px; }
.section-title { margin: 10px 0 0; font-size: 1.05rem; }
.intro { text-align: center; display: flex; flex-direction: column; align-items: center; }
.intro-kiwi { width: 150px; margin-bottom: 6px; }

/* ---- Welcome (mockup 01) ---- */
.welcome { min-height: calc(100dvh - 40px); justify-content: space-between; padding-top: 6vh; }
.wordmark-wrap { text-align: center; }
.wordmark { font-family: var(--display); font-size: 4.2rem; font-weight: 600; color: var(--teal); margin: 0; letter-spacing: -.01em; position: relative; display: inline-block; }
.spark { position: absolute; display: block; border-radius: 999px; }
.spark-a { width: 12px; height: 26px; background: #5BB3E6; right: -20px; top: 2px; transform: rotate(28deg); }
.spark-b { width: 10px; height: 10px; background: var(--yellow); right: -32px; top: 30px; }
.tagline { font-size: 1.15rem; color: var(--teal); margin-top: 4px; font-weight: 600; }
.hero-kiwi { position: relative; width: min(68vw, 270px); margin: 4px auto; }
.alert-lines { position: absolute; right: -6%; top: -4%; width: 34%; height: 34%; pointer-events: none; }
.alert-lines i { position: absolute; width: 9px; height: 26px; border-radius: 999px; background: var(--yellow); }
.alert-lines i:nth-child(1) { left: 10%; top: 30%; transform: rotate(-20deg); }
.alert-lines i:nth-child(2) { left: 42%; top: 6%; transform: rotate(18deg); }
.alert-lines i:nth-child(3) { left: 70%; top: 40%; transform: rotate(62deg); }
.install h2 { font-size: 1.05rem; }
.install ol { margin: 0 0 8px; padding-left: 20px; }
.install li { margin: 4px 0; }

/* ---- Today (mockup 02) ---- */
.demo-bar { background: var(--teal); color: var(--white); border-radius: 14px; padding: 8px 8px 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.today-head h1 { font-size: 1.85rem; margin-bottom: 2px; }
.today-head p { margin: 0; }
.head-kiwi { width: 76px; flex: none; transition: transform .3s ease; }
.head-kiwi.stage-3 { transform: scale(1.12); }
.segmented { display: flex; gap: 6px; background: var(--white); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.segmented a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .9rem; color: var(--teal); min-height: 40px; }
.segmented a[aria-current] { background: var(--teal); color: var(--white); }
.cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.reminder-card { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-left: 5px solid transparent; }
.reminder-card.stage-1 { border-left-color: var(--yellow); }
.reminder-card.stage-2 { border-left-color: #F2A65A; }
.reminder-card.stage-3 { border-left-color: var(--red); }
.reminder-card.is-done { opacity: .7; }
.card-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); min-height: 48px; }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-title { font-weight: 800; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: .85rem; color: var(--grey); display: flex; align-items: center; gap: 6px; }
.card-sub.overdue { color: var(--red); font-weight: 700; }
.warn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.cat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cat-icon.big { width: 52px; height: 52px; border-radius: 14px; }
.tone-red { background: #FDECEA; color: #D9534F; }
.tone-yellow { background: #FFF4D6; color: #C98A00; }
.tone-blue { background: var(--soft-blue); color: #3B8FD0; }
.tone-teal { background: var(--mint); color: var(--teal); }
.tick { width: 44px; height: 44px; flex: none; display: grid; place-items: center; text-decoration: none; position: relative; }
.tick::before { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #B9C9C6; position: absolute; }
.tick:hover::before { border-color: var(--teal); }
.tick.done { color: var(--white); font-weight: 800; }
.tick.done::before { background: #5CC2B3; border-color: #5CC2B3; z-index: -1; }
.empty-card, .empty { color: var(--grey); text-align: center; padding: 18px; list-style: none; }

/* ---- Add (mockup 03) ---- */
.big-title textarea { font: 600 1.35rem/1.3 var(--font); border: 0; background: var(--cream); border-radius: var(--radius); padding: 16px; min-height: 92px; }
.dial-chip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 10px 14px; }
.dial-chip span { flex: 1; display: flex; flex-direction: column; }
.dial-chip small { color: var(--grey); }
.dial-chip-kiwi { width: 52px; flex: none; }
.dial-pick { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dial-pick legend { font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.radio-card input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; accent-color: var(--teal); flex: none; }
.radio-card span { display: flex; flex-direction: column; }
.radio-card small { color: var(--grey); }
.code-box { font: 600 1.4rem/1.3 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .06em; background: var(--white); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); word-break: break-all; margin: 0; user-select: all; }
.code-box.big { font-size: 2.6rem; letter-spacing: .12em; }

/* ---- Dial (mockup 04) ---- */
.dial-kiwi { position: relative; width: min(58vw, 220px); margin: 0 auto; }
.dial-img { transition: transform .25s ease; }
.dial-track { padding: 4px 6px 0; }
.dial-track input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; min-height: 0; padding: 0; border: 0; border-radius: 999px;
  background: linear-gradient(to right, var(--teal) var(--fill, 50%), var(--mint-dark) var(--fill, 50%));
}
.dial-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); border: 5px solid var(--white); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: pointer; }
.dial-track input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); border: 5px solid var(--white); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.dial-stops { display: flex; justify-content: space-between; margin-top: 8px; }
.dial-stop { background: none; border: 0; font: 600 .85rem var(--font); color: var(--grey); display: flex; flex-direction: column; align-items: center; min-width: 64px; min-height: 44px; cursor: pointer; }
.dial-stop b { font-size: 1rem; color: var(--grey); }
.dial-stop.active, .dial-stop.active b { color: var(--teal); }
.sample { background: #EAF6F2; box-shadow: none; }
.sample-title { font-weight: 800; color: var(--teal); margin-bottom: 4px; }
.sample-line { font-size: 1.05rem; font-weight: 600; margin: 0; }

/* ---- Done (mockup 06) ---- */
.options .option { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 60px; cursor: pointer; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink); width: 100%; text-align: left; padding: 8px 0; }
.options .option .ico { color: var(--teal); }
.options details.option { display: block; }
.options details.option summary { display: flex; align-items: center; gap: 12px; list-style: none; min-height: 44px; cursor: pointer; }
.options details.option summary::-webkit-details-marker { display: none; }
.options details.option textarea { margin: 8px 0; }
.option span { font-weight: 700; display: flex; flex-direction: column; }
.option small { color: var(--grey); font-weight: 400; }
.file-pick:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 8px; }
.checking .intro-kiwi.peering { animation: peer 1.2s ease-in-out infinite alternate; }
@keyframes peer { from { transform: rotate(-6deg); } to { transform: rotate(6deg) translateY(-4px); } }
.reasons { background: var(--red-soft); border-radius: 14px; padding: 12px 14px 12px 32px; margin: 0; }
.reasons li { margin: 4px 0; }
.celebrate-art { position: relative; width: min(70vw, 260px); margin: 12px auto 0; }
.celebrate-img { animation: hop .9s ease-out 2; }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-16px) rotate(-3deg); } 100% { transform: translateY(0); } }
.celebrate h1 { font-size: 2rem; margin-top: 4px; }

/* ---- Reminder ---- */
.rem-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.rem-head h1 { font-size: 1.45rem; margin: 0; }
.rem-head .card-sub { margin: 2px 0 0; }
.rem-kiwi { width: 64px; }
.facts { margin: 0; display: grid; gap: 0; padding: 6px 16px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--grey); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.timeline, .sent, .proofs, .log-list, .feed-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li { display: grid; grid-template-columns: 112px 1fr; gap: 10px; font-size: .9rem; padding-left: 12px; border-left: 3px solid var(--mint-dark); }
.timeline time, .sent time, .proofs time, .feed-item time { color: var(--grey); font-size: .8rem; }
.sent > li, .proofs > li { background: var(--white); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.sent p { margin: 4px 0; }
.proofs ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--mint); color: var(--teal); }
.kind-call .pill, .kind-poke .pill { background: #FFF4D6; color: #8A6100; }
.kind-buddy .pill, .verdict-mismatch .pill, .verdict-not_proof .pill { background: var(--red-soft); color: #A33A36; }
.verdict-verified .pill { background: #DDF5EE; color: #1D7A68; }
.verdict-partial .pill, .verdict-checking .pill { background: #FFF4D6; color: #8A6100; }
.kind-judge .pill { background: #EDE7FB; color: #5B45A8; }

/* ---- Buddy ---- */
.preview { background: #F3FAF8; }
.preview .from { font-weight: 800; color: var(--teal); margin-bottom: 4px; }
.status-ok { color: #1D7A68; font-weight: 700; }
.link-box { background: var(--mint); border-radius: 10px; padding: 10px; word-break: break-all; font-size: .9rem; user-select: all; }
.checklist { margin: 0; padding: 14px 14px 14px 34px; text-align: left; }
.checklist li { margin: 6px 0; }

/* ---- Settings and log ---- */
.devices { list-style: none; margin: 0; }
.pair h3 { margin: 0; }
.log-item { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); }
.log-item summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 44px; }
.log-item summary::-webkit-details-marker { display: none; }
.log-item time { grid-column: 2; color: var(--grey); font-size: .8rem; }
.log-summary { font-weight: 700; }
.log-item p { padding: 0 14px 12px; margin: 0; font-size: .92rem; color: #445856; }

/* ---- Call (stub) ---- */
.call { background: linear-gradient(180deg, #A7D7F3, #FFE7D1); margin: -16px -16px 0; padding: 40px 16px 32px; min-height: 100dvh; text-align: center; }
.call-label { font-family: var(--display); font-size: 1.4rem; color: var(--teal); }
.call-kiwi { width: min(62vw, 240px); margin: 0 auto; animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.disclosure { font-weight: 700; }
.call-actions { display: flex; justify-content: center; gap: 18px; margin-top: 20px; }
.round { width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; font: 700 .8rem var(--font); text-decoration: none; color: var(--white); background: var(--grey); }
.round.hangup { background: var(--red); }
.round.answer { background: #2FA36B; }
.call-kiwi.answered { animation: none; }

/* ---- Bottom bar ---- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; max-width: 460px; margin: 0 auto;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
}
#tabbar[hidden] { display: none; }
#tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; font-weight: 700; color: var(--grey); text-decoration: none; min-height: 50px; justify-content: center; }
#tabbar svg { width: 24px; height: 24px; fill: currentColor; }
#tabbar a[aria-current] { color: var(--teal); }

/* ---- The kiwi popup (Marah 6.10): floats, never blocks ---- */
#popup-layer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 460px; margin: 0 auto; pointer-events: none; }
.kiwi-pop { position: absolute; left: 10px; bottom: calc(var(--tabbar-h) + 10px + var(--safe-b)); width: min(70vw, 300px); pointer-events: none; }
.kiwi-pop[hidden] { display: none; }
.kiwi-pop-body { pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; width: 100%; font: inherit; color: inherit; }
.bubble { background: var(--white); border-radius: 18px 18px 18px 4px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 700; font-size: .95rem; text-align: left; max-width: 100%; margin-bottom: -6px; position: relative; z-index: 1; }
.bubble small { display: block; color: var(--grey); font-weight: 600; font-size: .75rem; margin-top: 2px; }
.kiwi-pop-art { width: 46%; display: block; }
.kiwi-pop-art { transform-origin: 0 100%; }
.kiwi-pop.puffing .kiwi-pop-art { animation: puff 3.2s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes puff {
  0% { transform: scale(.4); }
  35% { transform: scale(calc(var(--puff, 1) * .85)); }
  55% { transform: scale(calc(var(--puff, 1) * .8)); }
  100% { transform: scale(var(--puff, 1)); }
}
.kiwi-badge { position: absolute; left: 12px; bottom: calc(var(--tabbar-h) + 12px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; border: 0; padding: 4px; background: var(--white); box-shadow: var(--shadow); cursor: pointer; pointer-events: auto; }
.kiwi-badge[hidden] { display: none; }
.kiwi-badge.grumpy { box-shadow: 0 0 0 3px var(--yellow), var(--shadow); }
.kiwi-badge-img { width: 100%; height: 100%; object-fit: contain; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto; padding: 0 8px calc(var(--tabbar-h) + 8px + var(--safe-b)); }
.sheet[hidden] { display: none; }
.sheet-card { background: var(--white); border-radius: 22px; box-shadow: 0 -4px 30px rgba(31, 42, 42, .18); max-height: 62vh; overflow: auto; padding: 8px 14px 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--white); padding-top: 6px; }
.sheet-head h2 { margin: 0; }
.feed-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.feed-item:last-child { border-bottom: 0; }
.feed-item p { margin: 0 0 2px; font-weight: 600; }
.feed-item .row-actions { margin-top: 8px; }

/* ---- Snap (snap design 8) ---- */
.snap-box { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.btn.snap { min-height: 64px; font-size: 1.1rem; background: #5CC2B3; color: var(--white); box-shadow: 0 6px 18px rgba(36, 93, 89, .18); }
.btn.snap:hover { background: #4AB0A2; }
.btn.snap.secondary { background: var(--white); color: var(--teal); box-shadow: inset 0 0 0 2px var(--mint-dark); min-height: 52px; font-size: 1rem; }
.btn.snap .ico { width: 26px; height: 26px; }
.btn.snap:focus-within, .btn.finish:focus-within { outline: 3px solid var(--teal); outline-offset: 3px; }
.type-it { align-self: center; }
.btn.snap-dock {
  position: fixed; z-index: 25; left: 50%; translate: -50% 0; width: min(calc(100% - 32px), 428px);
  bottom: calc(var(--tabbar-h) + 12px + var(--safe-b));
}
body.has-dock.has-tabs #view { padding-bottom: calc(var(--tabbar-h) + 104px + var(--safe-b)); }
.snap-extras { display: flex; flex-direction: column; align-items: center; gap: 2px; }
body.has-dock .kiwi-pop { bottom: calc(var(--tabbar-h) + 88px + var(--safe-b)); }
body.has-dock .kiwi-badge { bottom: calc(var(--tabbar-h) + 88px + var(--safe-b)); }
body.has-dock .snap-card { bottom: calc(var(--tabbar-h) + 88px + var(--safe-b)); }
body.has-dock .sheet { padding-bottom: calc(var(--tabbar-h) + 88px + var(--safe-b)); }
.sample-row { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 4px; }
.sample-row .chip-row { justify-content: center; }
.chip.strong { background: var(--teal); color: var(--white); box-shadow: none; }
.tick { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.finish-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.finish { flex-direction: column; gap: 4px; min-height: 84px; border-radius: var(--radius); }
.btn.finish .ico { width: 26px; height: 26px; }
.verdict-card h2 { margin-bottom: 4px; }
.verdict-card p { margin: 0 0 8px; }
.verdict-card .reasons { margin-bottom: 8px; }
.repeat-ask { background: var(--cream); border-radius: 14px; padding: 10px 12px; margin: 6px 0 2px; text-align: left; }
.repeat-ask p { margin: 0 0 8px; font-weight: 700; }
.fix .rows .row input:not([type=checkbox]), .fix .rows .row select { max-width: 55%; }
.first-snap .snap-box { margin-top: 0; }

#snap-layer { position: fixed; inset: auto 0 0 0; z-index: 40; max-width: 460px; margin: 0 auto; pointer-events: none; }
.snap-reading { position: fixed; inset: 0; background: rgba(230, 247, 242, .82); display: grid; place-items: center; pointer-events: auto; z-index: 45; }
.snap-reading[hidden] { display: none; }
.snap-reading-card { background: var(--white); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; width: min(80vw, 280px); }
.snap-reading-card p { margin: 0; display: flex; flex-direction: column; }
.snap-reading-card small { color: var(--grey); font-weight: 600; }
.reading-kiwi { width: 120px; animation: peer 1.2s ease-in-out infinite alternate; }
.snap-card {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 10px + var(--safe-b));
  background: var(--white); border-radius: 20px; padding: 14px 44px 12px 16px; pointer-events: auto;
  box-shadow: 0 -2px 24px rgba(31, 42, 42, .18); border-left: 6px solid #5CC2B3;
}
body:not(.has-tabs) .snap-card { bottom: calc(12px + var(--safe-b)); }
.snap-card[hidden] { display: none; }
.snap-card.slide { animation: slide-up .28s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes slide-up { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.snap-card.warn { border-left-color: var(--yellow); }
.snap-card.good { border-left-color: #2FA36B; }
.snap-title { font-weight: 800; margin: 0 0 2px; color: var(--teal); }
.snap-sub { margin: 0 0 4px; color: #445856; font-weight: 600; font-size: .92rem; }
.snap-hint { padding: 4px 0; min-height: 36px; text-align: left; font-size: .9rem; }
.snap-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.snap-actions .chip { min-height: 40px; padding: 6px 16px; }
.snap-reasons { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; }
.snap-close { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--grey); cursor: pointer; border-radius: 50%; }
.snap-done { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; }
.snap-done-kiwi { width: 64px; animation: hop .9s ease-out 2; }
.snap-sheet { position: fixed; inset: 0; background: rgba(31, 42, 42, .28); display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; z-index: 42; }
.snap-sheet[hidden] { display: none; }
.snap-sheet .sheet-card { width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); max-height: 75vh; }
.pick-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pick { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--mint); border: 0; border-radius: 14px; padding: 12px 14px; min-height: 52px; font: inherit; color: var(--ink); cursor: pointer; }
.pick strong { font-weight: 800; }
.pick small { color: var(--grey); }
.pick.none { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--mint-dark); color: var(--teal); font-weight: 700; }
.confirm-done { margin-top: 8px; }

/* ---- Toast ---- */
#toast {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, -150%); z-index: 50;
  width: max-content; visibility: hidden; opacity: 0;
  background: var(--teal); color: var(--white); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: .92rem;
  max-width: min(92vw, 420px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); transition: transform .25s ease, opacity .25s ease, visibility .25s; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
#toast.error { background: #A33A36; }

/* Mock mode marker, so screenshots never pass for the real thing. */
html.mock body::after { content: 'MOCK DATA'; position: fixed; top: 6px; right: 6px; z-index: 60; font: 800 .65rem var(--font); letter-spacing: .08em; background: var(--yellow); color: var(--ink); padding: 3px 7px; border-radius: 6px; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kiwi-pop .kiwi-pop-art { transform: scale(var(--puff, 1)); }
}
.field small { font-weight: 400; color: #5B6E6C; font-size: .8rem; }
body.kiwi-open.has-dock.has-tabs #view { padding-bottom: calc(var(--tabbar-h) + 320px + var(--safe-b)); }
