/* 세잎 들판. 화면 전체가 들판이고, 메뉴와 막대, 창은 그 위에 어둡게 떠 있습니다.
   흰 바탕 대신 흙빛에 가까운 어두운 초록을 써서 눈이 덜 부시게 했어요. */
:root {
  --bg: #0e1410;           /* the soil */
  --surface: #151d18;      /* bars, labels, the sheet */
  --surface-2: #1d2721;    /* inputs, hover */
  --glass: rgba(16, 23, 19, 0.86);
  --ink: #e6ebe3;
  --muted: #9ba79d;        /* 6:1 on the surface */
  --line: #33403a;
  --accent: #7fcf95;       /* found clovers, links, the main action */
  --accent-strong: #5fb87a;
  --accent-ink: #0b130e;
  --accent-soft: rgba(127, 207, 149, 0.14);
  --gold: #e0b84a;         /* clovers you planted */
  --surface-3: #26332b;
  --accent-hover: #95dba8;
  --edge-line: rgba(255, 255, 255, 0.07);
  --hover: rgba(255, 255, 255, 0.07);
  --top-fade: rgba(10, 15, 12, 0.78);
  --blossom: #f4f1e0;
  --blossom-edge: transparent;
  --danger: #f08a80;
  --danger-soft: rgba(240, 138, 128, 0.14);

  --font: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --step-small: 0.875rem;
  --edge-l: max(14px, env(safe-area-inset-left, 0px));
  --edge-r: max(14px, env(safe-area-inset-right, 0px));
  --edge-t: max(12px, env(safe-area-inset-top, 0px));
  --edge-b: max(12px, env(safe-area-inset-bottom, 0px));
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
/* the field page is an app: one screen, no page scroll */
body.app { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.02em; line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(127, 207, 149, 0.3); color: var(--ink); }
[hidden] { display: none !important; }

/* ---------- the field fills the screen ---------- */
.field { position: fixed; inset: 0; background: var(--bg); overflow: hidden; isolation: isolate; }
.field > canvas:not(.minimap) { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; }
.field > canvas.is-panning { cursor: grabbing; }
.field noscript p { position: absolute; inset: 40% 24px auto; text-align: center; }

/* ---------- the light over the field, by time of day ----------
   the colour of the hour is painted into the field itself (field.js setLight);
   here only a soft glow from the sun or moon, with plain transparency, which costs the browser almost nothing */
.sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sky > * { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1.2s ease; opacity: 0; }
.sky .tint { display: none; }
[data-time] .sky .light, [data-time="night"] .sky .flies, [data-time="dusk"] .sky .flies { opacity: 1; }
[data-time="dawn"] .sky .light { background: radial-gradient(ellipse 80% 70% at 8% -12%, rgba(255, 200, 186, 0.2), transparent 70%); }
[data-time="day"] .sky .light { background: radial-gradient(ellipse 70% 60% at 88% -18%, rgba(255, 246, 205, 0.32), transparent 70%); }
[data-time="dusk"] .sky .light { background: radial-gradient(ellipse 85% 75% at 102% 108%, rgba(255, 150, 80, 0.26), transparent 70%); }
[data-time="night"] .sky .light { background: radial-gradient(ellipse 55% 50% at 88% -10%, rgba(200, 214, 255, 0.12), transparent 70%); }

/* daytime: light panels and dark text, warm off-white rather than bright white */
[data-time="day"] {
  --bg: #20301f;
  --surface: #f6f4ec;
  --surface-2: #ebe8dc;
  --surface-3: #e1ddcd;
  --glass: rgba(248, 246, 237, 0.9);
  --ink: #1d241f;
  --muted: #5b655d;
  --line: #d3cfbf;
  --accent: #2c7d45;
  --accent-hover: #236a39;
  --accent-ink: #ffffff;
  --accent-soft: rgba(44, 125, 69, 0.12);
  --gold: #b88a16;
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.1);
  --edge-line: rgba(30, 40, 30, 0.08);
  --hover: rgba(30, 40, 30, 0.06);
  --top-fade: rgba(246, 244, 236, 0.75);
  --blossom: #fbf8ec;
  --blossom-edge: #cfc8ad;
  color-scheme: light;
}
[data-time="day"] .wordmark, [data-time="day"] .menu button { color: var(--ink); }
[data-time="day"] .sheet::backdrop { background: rgba(20, 30, 20, 0.35); }
[data-time="day"] .read-photo, [data-time="day"] .photo-prev { background: #e7e4d8; }

/* ---------- floating header ---------- */
.top {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: var(--edge-t) var(--edge-r) 28px var(--edge-l);
  background: linear-gradient(var(--top-fade), transparent);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; padding: 8px 4px; }
.wordmark svg { width: 26px; height: 26px; fill: var(--accent); stroke: var(--accent); transition: transform 400ms var(--ease-out); }
.wordmark:hover svg { transform: rotate(-8deg) scale(1.06); }
.menu { display: flex; gap: 4px; }
.menu button {
  white-space: nowrap;
  background: none; border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer;
  color: var(--ink); opacity: 0.82; font-size: 0.9375rem; font-weight: 400;
  transition: opacity 160ms ease, background-color 160ms ease;
}
.menu button:hover { opacity: 1; background: var(--hover); }
.menu .lang-btn { display: inline-grid; place-items: center; width: 38px; padding: 8px 0; }
.lang-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; }
#nav-write { background: var(--accent); color: var(--accent-ink); opacity: 1; }
#nav-write:hover { background: var(--accent-hover); }

/* ---------- first-visit card ---------- */
.intro {
  position: absolute; z-index: 3; left: var(--edge-l); top: calc(var(--edge-t) + 60px);
  width: min(460px, calc(100% - var(--edge-l) - var(--edge-r)));
  display: grid; gap: 10px; padding: 20px 22px;
  background: var(--glass); border: 1px solid var(--edge-line); border-radius: 18px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: rise 600ms var(--ease-out) 200ms both;
}
.intro h1 { font-size: 1.25rem; }
.intro p { color: var(--muted); font-size: 0.9375rem; line-height: 1.7; text-wrap: pretty; }
.intro-actions { gap: 6px 16px; margin-top: 4px; }
.intro-snooze { color: var(--muted) !important; font-size: 0.8125rem; min-height: 32px; }
.intro-langs { display: inline-flex; gap: 12px; justify-self: end; margin-top: -4px; }
.intro-langs .btn.link { color: var(--muted); font-size: 0.8125rem; min-height: 28px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.demo-note {
  position: absolute; z-index: 3; left: 50%; bottom: calc(var(--edge-b) + 76px); transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; background: var(--glass); color: var(--muted);
  font-size: 0.8125rem; white-space: nowrap; pointer-events: none;
}
.demo-note code { color: var(--ink); }

/* ---------- while the meadow is being laid out ---------- */
.loading {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--glass); color: var(--muted);
  font-size: 0.875rem; pointer-events: none; transition: opacity 500ms ease;
  animation: breathe 1.6s ease-in-out infinite;
}
.loading.done { opacity: 0; animation: none; }
@keyframes breathe { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .loading { animation: none; } }

/* ---------- the map in the corner ---------- */
.minimap {
  position: absolute; z-index: 3; right: var(--edge-r); top: calc(var(--edge-t) + 60px);
  background: var(--glass); border: 1px solid var(--edge-line); border-radius: 10px;
  cursor: pointer; touch-action: none;
  color: rgba(231, 236, 229, 0.9); --map-dot: #7fcf95; --map-empty: rgba(190, 214, 176, 0.55);
}
[data-time="day"] .minimap { color: rgba(29, 36, 31, 0.75); --map-dot: #2c7d45; --map-empty: rgba(44, 125, 69, 0.35); }

/* ---------- lines people wrote, beside the field ---------- */
.feed {
  position: absolute; z-index: 3; right: var(--edge-r); top: calc(var(--edge-t) + 60px + 99px + 12px);
  width: min(380px, 34vw); max-height: calc(100% - var(--edge-t) - 60px - 99px - 12px - var(--edge-b) - 76px); overflow: hidden;
  padding: 14px 8px 8px; background: var(--glass); border: 1px solid var(--edge-line); border-radius: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.feed-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px 10px; }
.feed-title { font-size: 0.75rem; font-weight: 400; letter-spacing: 0.02em; color: var(--muted); }
.feed-x {
  flex: none; width: 28px; height: 28px; margin: -6px 0 -4px; border: 0; border-radius: 50%; background: none; cursor: pointer;
  color: var(--muted); font-size: 1.125rem; line-height: 1; transition: background-color 160ms ease, color 160ms ease;
}
.feed-x:hover { background: var(--hover); color: var(--ink); }
/* the list put away: a small pill in its place */
.feed-open {
  position: absolute; z-index: 3; right: var(--edge-r); top: calc(var(--edge-t) + 60px + 99px + 12px);
  min-height: 36px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--edge-line); cursor: pointer;
  background: var(--glass); color: var(--ink); font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.feed-open::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blossom); box-shadow: 0 0 0 1px var(--blossom-edge); }
.feed-open:hover { background: var(--surface); }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.feed-list li { transition: opacity 360ms ease, transform 420ms var(--ease-out); }
.feed-list li.out { opacity: 0; transform: translateY(-6px); }
.feed-list li.in { opacity: 0; transform: translateY(6px); transition: none; }
.feed-list button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 0.78125rem; line-height: 1.5;
  transition: background-color 160ms ease;
}
.feed-list button:hover { background: var(--hover); }
.feed-list .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--blossom); box-shadow: 0 0 0 1px var(--blossom-edge); transform: translateY(-1px); }
.feed-list .dot.mine { background: var(--gold); }
.feed-list .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- the bar along the bottom ---------- */
.field-bar {
  position: absolute; z-index: 3; left: var(--edge-l); right: var(--edge-r); bottom: var(--edge-b);
  display: flex; align-items: center; gap: 8px 12px;
  padding: 7px 7px 7px 7px; background: var(--glass); border: 1px solid var(--edge-line); border-radius: 999px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: var(--step-small);
}
.help-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); font-weight: 500;
  transition: background-color 160ms ease;
}
.help-btn:hover { background: var(--surface-3); }
.field-bar .count { flex: none; white-space: nowrap; font-weight: 400; font-variant-numeric: tabular-nums; }
.field-bar .count b { color: var(--accent); font-weight: 500; }
.field-bar .hint-row { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); min-width: 0; }
.hint-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.hint-btn {
  flex: none; white-space: nowrap;
  font: 400 var(--step-small)/1 var(--font); color: var(--ink);
  background: var(--surface-2); border: 0; border-radius: 999px; padding: 13px 16px; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.hint-btn:hover { background: var(--surface-3); }
.hint-btn.is-open { background: var(--accent); color: var(--accent-ink); }
.hint-btn.is-open:hover { background: var(--accent-hover); }
.hint-btn:active { transform: scale(0.97); }
.hint-btn[disabled] { opacity: 0.5; cursor: default; }

/* ---------- the label over a found clover ---------- */
.find-tag {
  position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none;
  transform: translate(-50%, calc(-100% - 22px));
  display: block; max-width: min(340px, calc(100% - 24px));
  padding: 6px 13px; background: var(--glass); color: var(--ink); border: 1px solid var(--edge-line); border-radius: 999px;
  font: 400 0.8125rem/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity 220ms ease, transform 260ms var(--ease-out);
}
.find-tag::before { content: ""; display: inline-block; vertical-align: 0.1em; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); }
.find-tag.is-mine::before { background: var(--gold); }
.find-tag.is-empty { color: var(--muted); }
.find-tag.is-empty::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.find-tag.has-photo { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 14px; }
.find-tag.has-photo::before { display: none; }
.find-tag.has-photo img { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--edge-line); }
.find-tag.has-photo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.find-tag.is-hidden, .find-tag.is-off { opacity: 0; transform: translate(-50%, calc(-100% - 14px)) scale(0.94); }

/* ---------- the sheet: every window opens here ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: min(86svh, 820px);
  margin: auto; padding: 0; border: 1px solid var(--edge-line); border-radius: 22px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(5, 8, 6, 0.6); }
.sheet[open] { animation: sheet-in 360ms var(--ease-out); }
.sheet[open]::backdrop { animation: fade-in 260ms ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-body { padding: 28px 28px 24px; display: grid; gap: 20px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sheet-head h2 { font-size: 1.375rem; }
.eyebrow { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.x-btn { flex: none; width: 40px; height: 40px; margin: -8px -10px 0 0; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.x-btn:hover { background: var(--surface-2); color: var(--ink); }
.sheet .note { color: var(--muted); font-size: 0.9375rem; }
.sheet .note.small { font-size: 0.8125rem; line-height: 1.6; }
.sheet .note a { color: var(--accent); text-underline-offset: 3px; }

/* help */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: n; }
.steps li { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; counter-increment: n; }
.steps li::before { content: "0" counter(n); grid-row: span 2; color: var(--accent); font-size: var(--step-small); font-variant-numeric: tabular-nums; padding-top: 2px; }
.steps b { font-weight: 500; }
.steps span { color: var(--muted); font-size: 0.9375rem; line-height: 1.7; }

/* time of day picker */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted);
  font-size: var(--step-small); cursor: pointer; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--step-small); cursor: pointer; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check small { color: var(--muted); font-size: 0.8125rem; line-height: 1.5; display: inline-block; margin-top: 2px; }

/* reading */
.read-photo { margin: 0 -28px; background: #0a0f0c; }
.read-photo img { display: block; width: 100%; max-height: 52svh; object-fit: contain; }
.read-more { white-space: pre-line; color: var(--ink); border-left: 2px solid var(--accent-soft); padding-left: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8125rem; font-weight: 400; justify-self: start; }
.badge.warn { background: var(--danger-soft); color: var(--danger); }

/* buttons */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.row.split { justify-content: space-between; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 0.9375rem; font-weight: 400; cursor: pointer; text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: var(--step-small); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: transparent; color: var(--muted); padding: 0 12px; }
.btn.quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.link { border: 0; padding: 0; min-height: 32px; color: var(--accent); background: none; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; justify-self: start; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.wide { width: 100%; }

/* writing */
.form { display: grid; gap: 18px; }
.f { display: grid; gap: 6px; }
.f > label, .f > .lab { font-size: var(--step-small); font-weight: 400; display: flex; justify-content: space-between; gap: 8px; }
.f .opt { color: var(--muted); font-weight: 300; }
.f .cnt { color: var(--muted); font-weight: 300; font-variant-numeric: tabular-nums; }
.f .cnt.over { color: var(--danger); }
.f input[type="text"], .f input[type="date"], .f textarea, .f select {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink);
  font-size: 1rem; font-weight: 300; line-height: 1.5;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.f input::placeholder, .f textarea::placeholder { color: #6f7b72; }
.f textarea { min-height: 140px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.f .err { color: var(--danger); font-size: var(--step-small); }
.form .err { color: var(--danger); font-size: var(--step-small); }
.two { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; }
details.more summary { cursor: pointer; font-size: var(--step-small); font-weight: 400; color: var(--accent); list-style: none; padding: 4px 0; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
details.more[open] summary { margin-bottom: 8px; }
.photo-pick { display: grid; gap: 10px; }
.photo-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-prev { position: relative; border-radius: 12px; overflow: hidden; background: #0a0f0c; }
.photo-prev img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.photo-prev .meta { position: absolute; left: 10px; bottom: 10px; background: var(--glass); border-radius: 999px; padding: 2px 10px; font-size: 0.8125rem; }

/* login */
.providers { display: grid; gap: 10px; }
/* Kakao's own button colours, as Kakao asks for them */
.btn.provider-kakao { background: #fee500; border-color: #fee500; color: #191919; }
.btn.provider-kakao:hover { background: #f3da00; border-color: #f3da00; }
.inapp { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 0.875rem; }
.inapp b { font-weight: 500; }
.inapp p { color: var(--muted); }
.inapp .row { margin-top: 4px; }

/* my records */
.mine { list-style: none; margin: 0; padding: 0; display: grid; }
.mine li { display: grid; gap: 4px; padding: 16px 0; border-top: 1px solid var(--line); }
.mine li:first-child { border-top: 0; padding-top: 4px; }
.mine .l { font-weight: 400; }
.mine .row { margin-top: 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--edge-b) + 72px); z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: 0.9375rem; font-weight: 400; text-align: center;
  transition: opacity 240ms ease, transform 320ms var(--ease-out);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- plain pages (privacy) ---------- */
.doc-langs a { color: var(--accent); }
.doc .eyebrow.doc-langs { margin: 0 0 -12px; }
.page-top { display: flex; align-items: center; padding: 28px max(20px, env(safe-area-inset-left, 0px)) 0; }

@media (prefers-reduced-motion: reduce) {
  .sheet[open], .sheet[open]::backdrop, .intro { animation: none; }
  .find-tag, .toast { transition: opacity 120ms ease; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  /* on a phone the header keeps only the mark; the name is on the first card */
  .wordmark { font-size: 1rem; }
  .wordmark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wordmark svg { width: 28px; height: 28px; }
  .menu { gap: 2px; }
  .menu button { padding: 8px 9px; font-size: 0.875rem; }
  .menu .lang-btn { width: 34px; }
  .intro { top: auto; bottom: calc(var(--edge-b) + 66px); padding: 18px; }
  .intro h1 { font-size: 1.125rem; }
  .intro p { font-size: 0.875rem; }
  .intro p br, .intro h1 br { display: none; }
  .field-bar { gap: 8px; }
  .field-bar .hint-text { display: none; }
  .hint-btn { padding: 13px 14px; }
  /* on a phone the list becomes one changing line under the header */
  .feed { left: var(--edge-l); right: calc(var(--edge-r) + 92px + 8px); width: auto; top: calc(var(--edge-t) + 60px); max-height: none; padding: 4px; border-radius: 14px; }
  .feed-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .feed { display: flex; align-items: center; }
  .feed-head { order: 2; padding: 0 2px 0 0; }
  .feed-x { margin: 0; }
  .feed-list { flex: 1; min-width: 0; }
  .feed-open { top: calc(var(--edge-t) + 60px); right: auto; left: var(--edge-l); }
  .feed-list button { padding: 7px 10px; font-size: 0.8125rem; }
  .demo-note { bottom: calc(var(--edge-b) + 70px); white-space: normal; width: max-content; max-width: calc(100% - 28px); text-align: center; }
  .count-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .count::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }
  /* on a phone the sheet rises from the bottom edge */
  .sheet { width: 100vw; max-width: 100vw; max-height: 92svh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
  .sheet-body { padding: 24px 20px max(20px, env(safe-area-inset-bottom, 0px)); }
  .read-photo { margin: 0 -20px; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
/* narrow phones: while a found clover's button shows, "show me one" steps aside so the count keeps its room */
@media (max-width: 430px) {
  .field-bar { gap: 6px; padding: 6px; }
  .help-btn { width: 36px; height: 36px; }
  .hint-btn { padding: 12px 13px; }
  .field-bar.has-open #hint-btn { display: none; }
}
@media (max-width: 380px) {
  .menu button { font-size: 0.8125rem; padding: 8px 7px; }
  .count { font-size: 0.8125rem; }
}
