:root {
  color-scheme: light;
  --paper: #efe8dc;
  --card: #f7f3eb;
  --ink: #1a1714;
  --muted: #6f675e;
  --line: #e3d8c8;
  --note: #f3e6cf;
  --ok: #1f6b45;
  --fail: #b8432f;
  --soft: #c8bba8;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

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

button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

#app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

#app.plain {
  padding-bottom: 32px;
}

.pad { padding: 18px 20px 0; }

.header, .row, .peek, .sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand, .hero-days, .sheet-amount, .seal {
  font-family: "Songti SC", "Noto Serif SC", serif;
}

.brand {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
}

.brand-sub, .muted, .field-label { color: var(--muted); }

.brand-sub, .muted { font-size: 14px; line-height: 1.5; }

.card {
  background: var(--card);
  margin: 14px 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
}

.card-title { font-size: 17px; font-weight: 600; }

.hero-days {
  margin-top: 8px;
  font-size: 64px;
  line-height: 1;
}

.hero-caption { margin-top: 4px; }

.note {
  margin-top: 12px;
  background: var(--note);
  padding: 10px 12px;
  font-size: 14px;
}

.fail { color: var(--fail); }
.ok { color: var(--ok); }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--ok);
  color: var(--ok);
  font-size: 12px;
  line-height: 20px;
}

.tag.warn { border-color: var(--fail); color: var(--fail); }

.btn, .choice-item {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
  padding: 12px 14px;
  border-radius: 8px;
}

.btn {
  background: var(--ink);
  color: var(--card);
  font-size: 16px;
}

.btn.line {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn.danger {
  background: transparent;
  color: var(--fail);
  border: 1px solid var(--fail);
}

.btn:disabled { opacity: 0.55; }

.choice { display: flex; gap: 8px; margin-top: 8px; }

.choice-item {
  margin-top: 0;
  border: 1px solid var(--soft);
  background: transparent;
}

.choice-item.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--card);
}

.item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child { border-bottom: 0; }

.item-title { font-size: 17px; font-weight: 600; }

.field { padding: 12px 0; border-bottom: 1px solid var(--line); }

.field-label { font-size: 13px; }

.field input, .picker {
  width: 100%;
  margin-top: 6px;
  border: 0;
  background: transparent;
  font-size: 17px;
  padding: 4px 0;
}

.field input:focus { outline: none; }

.seal {
  width: 42px;
  height: 42px;
  border: 2px solid var(--fail);
  color: var(--fail);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 20px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 0;
}

.chip {
  border: 1px solid var(--soft);
  padding: 6px 10px;
  white-space: nowrap;
  background: transparent;
}

.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }

.plate {
  font-size: 22px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.peek { align-items: flex-start; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fail);
  margin-top: 8px;
  flex: none;
}

.dot.read { background: transparent; border: 1px solid var(--soft); }

.tab {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f7f3eb;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab button {
  padding: 12px 0 14px;
  color: var(--muted);
}

.tab button.on { color: var(--ink); font-weight: 600; }

.mask {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
}

.sheet, .dialog {
  width: min(440px, 100%);
  background: var(--card);
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
}

.dialog { margin: auto 16px auto; }

.sheet-kicker { color: var(--muted); font-size: 13px; }

.sheet-amount { font-size: 40px; margin: 6px 0 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--card);
  padding: 10px 14px;
  max-width: 90%;
  z-index: 4;
}

.link { color: #9a3b28; margin-top: 10px; background: none; }

.empty { color: var(--muted); }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}

.block { margin-top: 10px; line-height: 1.55; }
