/* AGENTVILLE app styles. Mobile-first. Each app gets a theme (html[data-theme]) picked from its name. */

:root,
html[data-theme='terracotta'] {
  --paper: #fbf4ec;
  --paper-2: #f4e7da;
  --card: #fffdfa;
  --ink: #2b1d16;
  --ink-soft: #6d5a4f;
  --line: #ead9c9;
  --accent: #c8553d;
  --accent-ink: #ffffff;
  --accent-soft: #f8e2d9;
  --glow: #f2b88f;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800;
}
html[data-theme='ocean'] {
  --paper: #f1f6fb;
  --paper-2: #e2edf7;
  --card: #ffffff;
  --ink: #0f2a3d;
  --ink-soft: #4c6577;
  --line: #d5e3ef;
  --accent: #1f6fb2;
  --accent-ink: #ffffff;
  --accent-soft: #dcebf8;
  --glow: #8fd3f4;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800;
}
html[data-theme='forest'] {
  --paper: #f3f6ef;
  --paper-2: #e5ecdd;
  --card: #fdfffb;
  --ink: #1c2a1f;
  --ink-soft: #55665a;
  --line: #d8e2cf;
  --accent: #2f7d4f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe1;
  --glow: #b7e4a4;
  --display: 'Young Serif', Georgia, serif;
  --body: 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 400;
}
html[data-theme='plum'] {
  --paper: #f8f3f8;
  --paper-2: #efe3ef;
  --card: #fffcff;
  --ink: #2a1830;
  --ink-soft: #6a5670;
  --line: #e8d8e9;
  --accent: #8a3fb0;
  --accent-ink: #ffffff;
  --accent-soft: #efe0f6;
  --glow: #f3a6c8;
  --display: 'DM Serif Display', Georgia, serif;
  --body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 400;
}
html[data-theme='sunshine'] {
  --paper: #fffaeb;
  --paper-2: #fdf0c9;
  --card: #ffffff;
  --ink: #2d2410;
  --ink-soft: #6b5d3d;
  --line: #f1e3b5;
  --accent: #f2b705;
  --accent-ink: #2d2410;
  --accent-soft: #fdefc0;
  --glow: #ffd36b;
  --display: 'Baloo 2', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800;
}
html[data-theme='midnight'] {
  --paper: #11131c;
  --paper-2: #181b27;
  --card: #1b1f2d;
  --ink: #f1f3fa;
  --ink-soft: #a5acc2;
  --line: #2b3043;
  --accent: #ff7a59;
  --accent-ink: #1d0d07;
  --accent-soft: #3a2420;
  --glow: #7b5cff;
  --display: 'Syne', ui-sans-serif, system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800;
  color-scheme: dark;
}

:root {
  --radius: 18px;
  --shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent), 0 10px 30px color-mix(in srgb, var(--ink) 8%, transparent);
  --shadow-lift: 0 2px 4px color-mix(in srgb, var(--ink) 8%, transparent), 0 18px 40px color-mix(in srgb, var(--ink) 14%, transparent);
  --ok: #1f9d55;
  --ok-soft: color-mix(in srgb, #1f9d55 14%, var(--card));
  --warn: #b7791f;
  --warn-soft: color-mix(in srgb, #e0a020 18%, var(--card));
  --bad: #d64545;
  --bad-soft: color-mix(in srgb, #d64545 14%, var(--card));
  color-scheme: light;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; line-height: 1.55; background: var(--paper); }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) 48px max(16px, env(safe-area-inset-right)); }
a { color: var(--accent); text-underline-offset: 3px; }
html[data-theme='sunshine'] main a:not(.button):not(.card) { color: #8a5d00; }
html[data-theme='sunshine'] a.account { color: var(--ink); }
html[data-theme='midnight'] h1 { font-size: clamp(28px, 8vw, 46px); letter-spacing: -0.02em; }
html[data-theme='midnight'] .hero.big h1 { font-size: clamp(32px, 9.5vw, 58px); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 10px; font-family: var(--display); font-weight: var(--display-weight); letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(32px, 9vw, 56px); }
h2 { font-size: 21px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Header ---------- */

header.site {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--glow)));
  color: var(--accent-ink); font-size: 17px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.account { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); margin: 0; white-space: nowrap; }
.account span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
a.account { font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
header.site nav {
  grid-column: 1 / -1; display: flex; gap: 4px; margin: 0 -16px; padding: 4px 16px 8px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
header.site nav::-webkit-scrollbar { display: none; }
header.site nav a {
  flex: none; scroll-snap-align: start; padding: 7px 14px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 14.5px; white-space: nowrap;
}
header.site nav a:hover { color: var(--ink); background: var(--paper-2); }
header.site nav a.active { background: var(--ink); color: var(--paper); }
@media (min-width: 760px) {
  header.site { grid-template-columns: auto 1fr auto; padding: 12px 28px; }
  header.site nav { grid-column: 2; grid-row: 1; justify-content: center; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .account { grid-column: 3; grid-row: 1; }
}

footer.site { display: flex; justify-content: center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: 13px; opacity: 0.8; }
footer.site b { font-weight: 800; letter-spacing: 0.06em; }

/* ---------- Buttons, cards, forms ---------- */

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 11px 22px;
  border: 0; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: transform 90ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.button:hover, button:hover { filter: brightness(1.05); }
.button:active, button:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.16); }
.button.secondary, button.secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line), 0 2px 6px color-mix(in srgb, var(--ink) 6%, transparent); }
button.link { min-height: 0; padding: 0; background: none; box-shadow: none; color: var(--accent); font-size: 14px; font-weight: 700; }
button[disabled] { opacity: 0.6; cursor: progress; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform 140ms ease, box-shadow 140ms ease; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
a.card h2 { color: var(--ink); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.stack > * + * { margin-top: 14px; }

form.stack label, .field { display: block; font-weight: 700; font-size: 14px; color: var(--ink); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper);
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
input:focus, textarea:focus, select:focus { outline: none; background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

.notice { padding: 13px 15px; border-radius: 13px; background: var(--warn-soft); color: var(--ink); font-weight: 600; font-size: 14.5px; border: 1px solid color-mix(in srgb, #e0a020 30%, transparent); }
.notice.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--paper-2); color: var(--ink); }
.pill.ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.pill.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 75%, var(--ink)); }
.pill.bad { background: var(--bad-soft); color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }

.empty { text-align: center; padding: 64px 0; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: 26px 0 12px; }
.hero p { font-size: clamp(17px, 4.4vw, 20px); color: var(--ink-soft); max-width: 36em; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero.big {
  isolation: isolate; margin: 4px 0 22px; padding: 44px 22px 30px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(160deg, var(--card), var(--paper-2));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero.big::before, .hero.big::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(30px); opacity: 0.55; }
.hero.big::before { width: 260px; height: 260px; right: -80px; top: -90px; background: var(--glow); }
.hero.big::after { width: 220px; height: 220px; left: -90px; bottom: -110px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.hero.big h1 { font-size: clamp(38px, 11vw, 68px); }
.eyebrow { display: inline-block; margin-bottom: 12px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
@media (min-width: 760px) { .hero.big { padding: 64px 48px 44px; } }

/* Feature cards on the landing page. */
a.card.feature, .feature { display: flex; gap: 14px; align-items: center; }
.feature .text { flex: 1; min-width: 0; }
.feature .icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.feature h2 { margin: 2px 0 4px; font-size: 19px; }
.feature p { margin: 0; }
.feature .go { margin-left: auto; align-self: center; color: var(--ink-soft); font-size: 22px; transition: transform 140ms ease; }
a.feature:hover .go { transform: translateX(3px); color: var(--accent); }

/* ---------- Shop ---------- */

.shop-hero { padding: 18px 0 6px; }
.shop-hero h1 { font-size: clamp(30px, 8vw, 48px); margin-bottom: 6px; }
.shop-hero p { font-size: 16.5px; margin-bottom: 10px; }
.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
@media (min-width: 720px) { .products { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; } }
/* One product: one wide card (art beside the price), not half an empty grid. */
.products:has(> .product:only-child) { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.products > a.card.product:only-child { flex-direction: row; align-items: center; gap: 4px; }
.products > a.card.product:only-child > :first-child { width: 44%; flex: none; }
a.card.product { padding: 8px 8px 12px; border-radius: 20px; display: flex; flex-direction: column; }
.product .print { border-radius: 14px; }
.product-info { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px 0; flex: 1; }
.product-info h2 { margin: 0; font-family: var(--body); font-weight: 800; font-size: 16px; letter-spacing: -0.005em; }
.product-info .blurb { margin: 2px 0 8px; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.buy-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.buy-row .from { display: flex; flex-direction: column; line-height: 1.1; color: var(--ink); }
.buy-row .from small { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.buy-row .from strong { font-size: 16px; font-weight: 800; }
.buy-row .chip { padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
@media (min-width: 720px) { .product-info h2 { font-size: 19px; } .product-info .blurb { font-size: 14.5px; } }

/* A framed print. */
.print { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 10px; background: #fff; padding: 7%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent); }
.print svg { display: block; width: 100%; height: 100%; border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(0, 0, 0, 0.1); }

.item { display: grid; gap: 18px; align-items: start; }
.item { gap: 14px; }
.item .print { width: min(50%, 190px); margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow-lift); }
.item .checkout > * + * { margin-top: 10px; }
.item h1 { font-size: clamp(28px, 7.5vw, 44px); margin-bottom: 0; }
.price { font-size: 22px; font-weight: 800; color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin: 6px 0 4px; color: var(--ink-soft); }
@media (min-width: 760px) { .item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; } .item .print { width: 100%; border-radius: 18px; } }
fieldset.options { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.options legend { margin-bottom: 8px; }
label.option {
  flex: 1 1 140px; display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-weight: 700; cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
label.option input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
label.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checkout button { width: 100%; }

.receipt { position: relative; max-width: 520px; margin: 10px auto 0; padding: 30px 24px 22px; text-align: center; border-radius: 24px; }
.receipt::before { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 6px; border-radius: 0 0 6px 6px; background: var(--accent); }
.receipt .check { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.receipt .check svg { width: 30px; height: 30px; }
.receipt h1 { font-size: clamp(28px, 7vw, 38px); }
.receipt .lines { margin: 16px 0; padding: 14px 0; border-top: 1.5px dashed var(--line); border-bottom: 1.5px dashed var(--line); }
.receipt .lines p { margin: 4px 0; }

/* Older generated shops: CSS-only art. */
.art { aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; position: relative; background: linear-gradient(160deg, var(--a), var(--b) 55%, var(--c)); box-shadow: inset 0 0 0 10px #fff, inset 0 0 0 11px var(--line); }
.art::before { content: ''; position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; left: 27%; top: 18%; background: color-mix(in srgb, var(--a) 60%, #fff); opacity: 0.85; }
.art::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: var(--c); clip-path: polygon(0 40%, 30% 10%, 55% 45%, 80% 15%, 100% 35%, 100% 100%, 0 100%); opacity: 0.9; }

/* ---------- Leaderboard ---------- */

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li { position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--paper); overflow: hidden; isolation: isolate; }
.board li .bar { position: absolute; inset: 0 auto 0 0; z-index: -1; background: var(--accent-soft); border-radius: 14px; }
.board .rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--card); font-weight: 800; font-size: 15px; box-shadow: inset 0 0 0 1.5px var(--line); }
.board li:nth-child(-n + 3) .rank { box-shadow: none; }
.board li:nth-child(1) .rank { background: #f3c63f; color: #4a3600; }
.board li:nth-child(2) .rank { background: #d5dae2; color: #333a46; }
.board li:nth-child(3) .rank { background: #e0a878; color: #4d2a10; }
.board .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .num { font-variant-numeric: tabular-nums; font-weight: 800; }
.board li:first-child { background: color-mix(in srgb, var(--glow) 30%, var(--paper)); }
table.rank { width: 100%; border-collapse: collapse; }
table.rank td, table.rank th { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.rank td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }

/* ---------- Chat ---------- */

.chat-card { padding: 10px; }
.messages { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; min-height: 200px; overflow-y: auto; padding: 8px 6px; scroll-behavior: smooth; }
.message { align-self: flex-start; max-width: 82%; margin: 0; padding: 9px 14px 10px; border-radius: 18px 18px 18px 6px; background: var(--paper-2); color: var(--ink); line-height: 1.4; animation: pop 220ms ease; overflow-wrap: anywhere; }
.message.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--accent); color: var(--accent-ink); }
.message .who { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 800; opacity: 0.72; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer label { margin: 0; }
.composer button { min-width: 88px; }

/* ---------- Sign up ---------- */

.auth-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .auth-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.auth-grid form:first-child { border-top: 5px solid var(--accent); }

/* ---------- Update bar ---------- */

.update-bar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--ink); color: var(--paper);
  box-shadow: var(--shadow-lift); font-weight: 700; font-size: 14px; white-space: nowrap;
  animation: rise 300ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.update-bar button { min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } }

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

.composer label { display: block; font-weight: 700; font-size: 14px; color: var(--ink); }

/* Wave: find yourself in AGENTVILLE */
.wave-box { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 40; display: grid; justify-items: end; gap: 8px; }
.wave-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--ink, #1f2433); color: #fff; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.wave-button span { display: inline-block; transform-origin: 70% 80%; }
.wave-button svg { display: block; }
.wave-button.waving span { animation: wave-hand 0.9s ease; }
@keyframes wave-hand { 15%, 45%, 75% { transform: rotate(18deg); } 30%, 60% { transform: rotate(-10deg); } }
.wave-note {
  max-width: min(300px, calc(100vw - 28px)); padding: 12px 14px; border-radius: 16px; background: #fff; color: #1f2433;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); display: grid; gap: 6px; font-size: 14px;
  animation: wave-in 260ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.wave-note[hidden] { display: none; }
.wave-note span { color: #5d6577; font-size: 13px; }
@keyframes wave-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
.wave-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.wave-colors button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .wave-button.waving span, .wave-note { animation: none; } }

/* Forms agents write from scratch: a fieldset is a card section with its legend inside, and plain
   radio/checkbox labels become big tappable rows. */
fieldset { min-width: 0; margin: 0; }
fieldset.card { border: 1px solid var(--line); }
fieldset > legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; }
fieldset > legend.eyebrow { width: auto; }
fieldset > legend + * { clear: both; }
label:not(.option):has(> input[type='radio']:only-of-type),
label:not(.option):has(> input[type='checkbox']:only-of-type) {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); cursor: pointer;
}
label:not(.option) > input[type='radio'], label:not(.option) > input[type='checkbox'] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
label:not(.option):has(> input:checked) { border-color: var(--accent); background: var(--accent-soft); }
