:root {
  --bg: #f4f1ea;
  --card: #fffdf8;
  --ink: #1d1b18;
  --muted: #6b665d;
  --line: #e2ddd2;
  --accent: #1f5c46;
  --accent-ink: #f4f1ea;
  --r: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(88px, calc(72px + env(safe-area-inset-bottom)));
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 8px; min-height: 40px; flex-wrap: wrap; }
.back { padding: 8px 10px 8px 0; color: var(--accent); font-weight: 600; }
.trail { display: flex; gap: 6px; flex-wrap: wrap; }
.trail button {
  font-size: 13px; padding: 5px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

h1 { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 500; font-size: 30px; line-height: 1.15; margin: 20px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }

.list { display: grid; gap: 8px; }
.opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 14px 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  transition: transform .12s ease, border-color .12s ease;
}
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(.985); }
.opt b { font-weight: 600; font-size: 16px; }
.opt span { font-size: 13px; color: var(--muted); }
.list.compact .opt { padding: 11px 14px; }
.list.compact .opt b { font-size: 15px; font-weight: 500; }

.result { margin-top: 16px; }
.result .name { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 15px; color: var(--accent); font-weight: 600; }
.result h1 { margin-top: 6px; }
.fact { padding: 12px 0; border-top: 1px solid var(--line); }
.fact dt { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.fact dd { margin: 0; font-size: 16px; line-height: 1.4; }
.say {
  display: flex; align-items: center; gap: 10px; margin-top: 4px;
  background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 12px 14px;
}
.say code { flex: 1; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; line-height: 1.35; }
.copy { background: var(--bg); color: var(--ink); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; min-width: 64px; }
.nexts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  font-size: 14px; padding: 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.chip:hover { border-color: var(--accent); }

.fab {
  position: fixed; right: max(16px, calc(50% - 264px)); bottom: max(20px, env(safe-area-inset-bottom));
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  padding: 14px 20px; border-radius: 999px;
  box-shadow: 0 6px 18px rgb(31 92 70 / .28);
  transition: transform .12s ease;
}
.fab:active { transform: scale(.96); }

dialog { border: 0; padding: 0; background: transparent; max-width: 560px; width: 100%; margin: auto auto 0; }
dialog::backdrop { background: rgb(29 27 24 / .35); }
.sheet { background: var(--bg); border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.close { font-size: 26px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
dialog[open] .sheet { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
