:root {
  --paper: #FBF3E4;
  --paper-alt: #F4E9D4;
  --surface: #FFFDF9;
  --ink: #22302B;
  --muted: #4B5B55;
  --line: #C6B598;
  --line-strong: #877860;
  --coral: #C94429;
  --coral-hover: #B33820;
  --coral-art: #E85C3F;
  --teal: #1E786D;
  --teal-soft: #DDF3EE;
  --sun: #F4C542;
  --sun-soft: #FBEDC9;
  --good-bg: #DDF3EE;
  --good-ink: #155E55;
  --warn-bg: #FBEDC9;
  --warn-ink: #7A4D04;
  --alert-bg: #FBE3DA;
  --alert-ink: #9D2D19;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font-display: "Baloo 2", "Nunito", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

#app {
  flex: 1 0 auto;
  padding: 16px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  border-bottom: 2px solid var(--line);
}

.topbar.is-in-screen .topnav .nav-btn {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-text small {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--ink);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-btn:hover,
.icon-btn:hover {
  background: var(--paper-alt);
  border-color: var(--line-strong);
}

.nav-btn.is-active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.nav-btn svg,
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  padding: 8px 10px;
}

.icon-btn .ico-off {
  display: none;
}

body.voice-off .icon-btn .ico-on {
  display: none;
}

body.voice-off .icon-btn .ico-off {
  display: block;
}

body.voice-off .icon-btn {
  background: var(--paper-alt);
}

.h1,
.h2,
.display {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.16;
  color: var(--ink);
}

.display {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
}

.h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  font-weight: 800;
}

.h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
}

.kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  min-height: 50px;
  padding: 12px 24px;
  font-size: 1.05rem;
}

.btn-sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--coral);
  color: #FFFFFF;
  border-color: #9A2F19;
  box-shadow: 0 3px 0 #9A2F19;
}

.btn-primary:hover:not(:disabled) {
  background: var(--coral-hover);
}

.btn-soft {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 3px 0 var(--line);
}

.btn-soft:hover:not(:disabled) {
  background: var(--paper-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--paper-alt);
}

.link-btn,
.back-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  color: var(--teal);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover,
.back-btn:hover {
  color: var(--ink);
}

.domain-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft, var(--paper-alt));
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.domain-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d, var(--teal));
}

.tone-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.tone-pill.tone-good {
  background: var(--good-bg);
  color: var(--good-ink);
}

.tone-pill.tone-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.tone-pill.tone-alert {
  background: var(--alert-bg);
  color: var(--alert-ink);
}

.bird {
  display: block;
}

.bird-md {
  width: 68px;
  height: 72px;
}

.bird-lg {
  width: 96px;
  height: 100px;
}

.bird-xl {
  width: 120px;
  height: 126px;
}

.page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
}

.page-head-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.page-head .lead {
  margin: 4px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.footer {
  margin-top: auto;
  padding: 20px 0 28px;
  border-top: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral-art);
  flex-shrink: 0;
}

.footer p {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  max-width: calc(100vw - 32px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .page {
    padding: 0 16px;
  }

  .topbar {
    padding: 12px 0;
  }

  .brand-text small {
    display: none;
  }

  .nav-btn {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .nav-btn span {
    font-size: 0.88rem;
  }
}

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