:root {
  color-scheme: light dark;
  --bg: #e8e2d6;
  --surface: #fffdf8;
  --ink: #1c1916;
  --muted: #5e584e;
  --line: #e3dacd;
  --accent: #8f3f10;
  --accent-ink: #fffaf6;
  --danger: #8d2424;
  --shadow: 0 0 0 1px var(--line);
  font-family: "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121411;
    --surface: #1c1f1c;
    --ink: #f4f0e8;
    --muted: #c8c2b6;
    --line: #343a34;
    --accent: #f0b183;
    --accent-ink: #2a1308;
    --danger: #ffb4b4;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

#app { min-height: 100vh; }

.shell {
  width: min(100%, 440px);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.top {
  position: relative;
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.bell {
  position: absolute;
  top: 16px;
  right: 12px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
}

.bell .count {
  display: inline-block;
  margin-left: 6px;
  min-width: 1.4em;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

.top:has(.bell) h1 { padding-right: 112px; }

h1 { margin: 0; font-size: 1.45rem; font-weight: 600; line-height: 1.25; }

h2 { margin: 8px 0 0; font-size: 1rem; font-weight: 600; }

.who, .note, .meta { margin: 0; color: var(--muted); line-height: 1.4; }

.screen {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.screen[hidden] { display: none; }

.screen p { margin: 0; line-height: 1.35; }

.shell.entry {
  justify-content: center;
  padding: 8px 0 32vh;
}

.shell.entry h1 { font-size: 2rem; }

.shell.entry .back { align-self: flex-start; }

.shell.entry.phone .top { transform: translateY(-72px); }

.shell.entry .greet { margin: 0; text-align: center; font-size: 1.05rem; }

.shell.entry.phone .screen { margin-top: 36px; }

.shell.entry .top,
.shell.entry .screen {
  width: min(100%, 360px);
  margin-left: auto;
  margin-right: auto;
  align-items: stretch;
}

.shell.entry .top { align-items: center; text-align: center; }

.shell.entry .screen { flex: 0 0 auto; }

.shell.entry .note,
.shell.entry .field label { text-align: center; }

.primary, .secondary, .choice, .back, .mini, .nav button {
  min-height: 48px;
  border-radius: 12px;
}

.primary, .secondary { width: 100%; padding: 12px 16px; }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
}

.secondary, .choice, .mini, .back, .nav button {
  background: transparent;
  border: 1px solid var(--line);
}

.choice {
  width: 100%;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.choice b, .price { font-weight: 600; }

.back, .mini { padding: 8px 12px; min-height: 40px; border-radius: 10px; }

.nav {
  display: flex;
  gap: 6px;
  padding: 8px;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.nav button {
  flex: 1 1 0;
  padding: 8px 4px;
  border-color: transparent;
}

.nav button[aria-current="page"] {
  border-color: var(--accent);
  font-weight: 600;
}

form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

form[hidden], .note[hidden], .alert[hidden], .err[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 2px; }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 12px;
}

.field textarea { min-height: 72px; resize: vertical; }

.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }

fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 8px 12px 12px; }

legend { padding: 0 4px; }

a.call { color: var(--accent); font-weight: 600; }

.err { margin: 0; color: var(--danger); }

.block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flag { margin: 0; font-weight: 700; }

.alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.samples { display: flex; flex-direction: column; gap: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
