:root {
  --paper: #f6f1e8;
  --page: #e7dfd2;
  --ink: #241c16;
  --muted: #6f6256;
  --line: #e3d6c6;
  --card: #fffaf3;
  --accent: #c4622d;
  --accent-ink: #fff8f2;
  --cry: #e7eef2;
  --ok: #2f6f4e;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

#app {
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(108px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 13px;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  margin: 4px 0 8px;
}
h2 { font-size: 20px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card, .summary, .sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
}
.cry {
  background: var(--cry);
  border-color: transparent;
}
.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.row span:last-child { text-align: right; }

.actions, .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices button { min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
button.wide { grid-column: 1 / -1; }
button.solid, button.ghost, button.hold, button.texty {
  border-radius: 14px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--card);
}
button.solid {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
button.ghost { background: transparent; }
button.hold[data-armed="1"], button.solid[aria-pressed="true"] {
  background: #8d3e16;
  color: white;
  border-color: transparent;
}
button:disabled { opacity: 0.45; }

.dots { display: flex; gap: 8px; margin: 8px 0 12px; }
.dots i {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: #ddd2c3;
  display: block;
}
.dots i.on { background: var(--ok); }

.clip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.clip strong { font-size: 22px; font-family: var(--serif); }
.clip .ops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.clip button, .tiny {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0 12px;
}

.meter {
  height: 8px;
  background: #efe6da;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}
.meter b {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.talk-button {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 0;
  display: block;
  margin: 22px auto;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--serif);
  font-size: 32px;
}
.talk-button[aria-pressed="true"] { background: #8d3e16; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff8f2;
  border-radius: 999px;
  padding: 8px 14px;
  z-index: 3;
}
nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(246, 241, 232, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
nav button {
  min-height: 48px;
  border: 0;
  background: transparent;
  border-radius: 12px;
}
nav button[aria-current="page"] {
  background: #efe4d4;
  font-weight: 650;
}
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.slider { width: 100%; accent-color: var(--accent); }
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 15px;
}
.field input {
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  padding: 0 14px;
  font-size: 17px;
}
.error { color: #9b2c1c; }
.banner {
  background: #f3e2c8;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
