:root {
  --bg: #f3efe6;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e4ddd0;
  --card: #fffcf6;
  --nav: 4.6rem;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Outfit, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-weight: 380;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 560; margin: 0 0 8px; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav) + var(--safe) + 16px); }
header.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 14px 16px 10px;
  background: rgba(243,239,230,.94);
}
header.top strong { display: block; font-family: Fraunces, serif; font-size: 1.45rem; }
header.top span { color: var(--muted); font-size: .82rem; }
main { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.card, .status {
  border-radius: 18px;
  padding: 16px;
}
.card { background: var(--card); border: 1px solid var(--line); }
.status { color: #fffdf8; }
.status.wait { background: #9a3412; }
.status.top { background: #166534; }
.status.alert { background: #9f1239; }
.status.hold { background: #44403c; }
.status .kicker { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.status h2 { font-size: 1.7rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 10px; font-size: .8rem; }
label { display: block; font-size: .78rem; color: var(--muted); margin: 10px 0 6px; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px;
}
input[type="checkbox"] { width: auto; margin-right: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scale header { display: flex; justify-content: space-between; }
input[type="range"] { width: 100%; accent-color: #9a3412; }
.btn, .icon-btn {
  border: 0; border-radius: 999px; padding: 12px 16px; background: var(--ink); color: #fffdf8;
  text-decoration: none; display: inline-block;
}
.btn { width: 100%; margin-top: 12px; }
.btn.small, .icon-btn { width: auto; padding: 8px 12px; font-size: .85rem; margin-top: 0; }
.icon-btn { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.green { background: #166534; }
.btn.red { background: #9f1239; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #1c1917; display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe));
}
.nav a { color: #d6d3d1; text-decoration: none; font-size: .68rem; text-align: center; min-width: 58px; }
.nav a.on { color: #fff; }
.nav b { display: block; font-family: Fraunces, serif; font-size: .95rem; font-weight: 560; }
.hint, .src { font-size: .82rem; color: var(--muted); line-height: 1.45; }
.src { margin-top: 8px; }
.warn, .ok { border-radius: 12px; padding: 10px 12px; font-size: .82rem; line-height: 1.4; }
.warn { background: #fef3c7; color: #78350f; }
.ok { background: #dcfce7; color: #166534; }
.advice p, .advice li { font-size: .92rem; line-height: 1.5; }
.advice ul { margin: 6px 0 0; padding-left: 18px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.log-item, .note-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
svg.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 12px; font-size: .75rem; color: var(--muted); margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 4px; }
.dot.band { background: #dcfce7; border: 1px solid #166534; }
.dot.score { background: #1e3a8a; }
.dot.step { background: #9a3412; }
@media (min-width: 900px) {
  .app { max-width: 720px; }
}
