:root {
  --bg: #f3f1ec; --card: #ffffff; --ink: #1f2933; --muted: #667085; --line: #e2ded6;
  --accent: #c4552d; --accent-soft: #f6e3da; --ok: #2f7d4f; --ok-soft: #dcefe3; --warn: #b7791f; --warn-soft: #fbefd5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b; --card: #22262b; --ink: #eceff3; --muted: #9aa4b2; --line: #343a42;
    --accent: #e0774f; --accent-soft: #3a2a23; --ok: #5fbf84; --ok-soft: #1f3327; --warn: #e0b04f; --warn-soft: #3a3120;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, system-ui, "Segoe UI", sans-serif; }
body { min-height: 100vh; padding: env(safe-area-inset-top) 0 0; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.loading { padding: 40px 16px; color: var(--muted); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { background: none; border: 0; color: var(--accent); font-size: 30px; line-height: 1; padding: 0 8px 4px 0; }
.net { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.net.on { background: var(--ok-soft); color: var(--ok); }
.net.off { background: var(--warn-soft); color: var(--warn); }
.body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.card.link, .field.link { color: inherit; text-decoration: none; }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.t { font-weight: 600; }
.s { font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.todo { background: var(--accent-soft); color: var(--accent); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.field:last-child { border-bottom: 0; }
.field .v { color: var(--muted); text-align: right; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 -4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 22px; padding: 11px 16px; font-size: 16px; min-height: 44px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; background: none; color: var(--accent); font-size: 26px; width: 56px; min-height: 48px; }
.stepper .num { flex: 1; min-width: 0; border: 0; text-align: center; font-size: 20px; font-weight: 600; background: none; color: var(--ink); }
.stepper .unit { align-self: center; color: var(--muted); font-size: 14px; padding-right: 4px; min-width: 0; }
.txt { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; background: var(--card); color: var(--ink); }
.btn { display: block; width: 100%; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 14px; padding: 14px; font-size: 17px; font-weight: 600; text-align: center; min-height: 48px; }
.btn.sec { background: var(--card); color: var(--accent); }
.btn.small { padding: 8px; font-size: 14px; min-height: 36px; margin-top: 8px; }
.row2 { display: flex; gap: 10px; }
.row2 .btn { flex: 1; }
.note { font-size: 13px; color: var(--ink); background: var(--warn-soft); border-radius: 10px; padding: 9px 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.ph { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .x { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 14px; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; }
.hidden { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; max-width: 640px; margin: 0 auto; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; text-align: center; padding: 14px 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.tabbar a.on { color: var(--accent); font-weight: 700; }
