@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(/fonts/figtree.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces.woff2) format('woff2'); }
:root {
  --bg: #F6F1E9; --card: #FFFFFF; --ink: #2A241D; --muted: #6B6155; --soft: #5C4A33;
  --line: #EFE7DB; --field: #FBF8F3; --border: #D9CEBF; --tan: #EADCC6; --chip: #F3ECE2;
  --accent: #9A5B24; --gold: #E9B872; --ok: #2F5A2E; --ok-bg: #E3EDDD; --bad: #B3261E;
  --serif: 'Fraunces', Georgia, serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Figtree', system-ui, sans-serif; }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2 { font-family: var(--serif); margin: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; }
h2 { font-size: 20px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 20px 16px 110px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 4px 0 -4px; }
.center { text-align: center; }

.btn { height: 48px; padding: 0 20px; border-radius: 24px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.block { width: 100%; height: 54px; border-radius: 27px; font-size: 16px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--border); color: var(--ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ok { background: var(--ok); }
.btn.small { height: 38px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--chip); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }
.xbtn { width: 40px; height: 40px; border: none; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field input, .field textarea, .field select { height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--field); font-size: 16px; font-weight: 500; width: 100%; }
.field textarea { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--soft); line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--border); background: var(--card); font-size: 14px; font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.dashed { border-style: dashed; background: var(--field); color: var(--soft); font-weight: 600; font-size: 13px; }

.slotrow { display: flex; align-items: center; gap: 12px; min-height: 54px; border-top: 1px solid var(--line); }
.logbtn { min-width: 76px; height: 40px; border-radius: 20px; border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); font-size: 14px; font-weight: 700; }
.logbtn.done { border: none; background: var(--ok-bg); color: var(--ok); }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.pill.warn { background: #F8E3C8; color: #7A4518; }
.pill.bad { background: #F6DAD7; color: var(--bad); }

.alert { background: var(--ink); color: var(--bg); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.alert p { color: #D9CEBF; font-size: 14px; line-height: 1.4; }
.banner { background: var(--tan); border-radius: 18px; padding: 12px 8px 12px 14px; display: flex; align-items: center; gap: 12px; }
.banner button.link { background: none; border: none; padding: 0; text-align: left; }

.avatar { width: 48px; height: 48px; border-radius: 24px; background: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.age { padding: 8px 12px; border-radius: 999px; background: var(--tan); display: flex; flex-direction: column; align-items: center; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid #E6DCCD; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: center; z-index: 5; }
.nav .in { width: 100%; max-width: 480px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.nav button { border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
.nav button[aria-current="page"] { color: var(--accent); font-weight: 700; }
.badge { position: absolute; top: -2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); width: calc(100% - 24px); max-width: 456px; padding: 14px 16px; border-radius: 16px; background: var(--ok); color: #fff; font-size: 14px; font-weight: 600; z-index: 20; }
.toast.err { background: var(--bad); }
.savebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); width: calc(100% - 24px); max-width: 456px; padding: 10px 10px 10px 16px; border-radius: 20px; background: var(--ink); color: var(--bg); display: flex; align-items: center; gap: 10px; z-index: 10; }

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 290px; margin: 0 auto; }
.pinpad button { height: 64px; border-radius: 32px; border: none; background: var(--card); font-size: 24px; font-weight: 600; }
.pinpad button.txt { background: transparent; font-size: 15px; color: var(--muted); }
.dots { display: flex; gap: 18px; justify-content: center; }
.dots span { width: 16px; height: 16px; border-radius: 8px; border: 2px solid var(--ink); }
.dots span.on { background: var(--ink); }

.sheet-bg { position: fixed; inset: 0; background: rgba(42, 36, 29, 0.55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; max-height: 92dvh; overflow-y: auto; }
.grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--tan); }
.seg button { height: 40px; border-radius: 10px; border: none; background: transparent; font-weight: 700; color: var(--soft); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.num { width: 28px; height: 28px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.photo-main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; background: var(--tan); display: block; }
.dropzone { aspect-ratio: 1; border-radius: 24px; border: 2px dashed #C9B89F; background: var(--field); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--tan); display: block; }
.bubble { align-self: flex-start; max-width: 300px; padding: 10px 14px; border-radius: 18px; background: #E9E9EB; font-size: 15px; line-height: 1.35; color: #111; white-space: pre-wrap; word-break: break-word; }
.list { background: var(--card); border-radius: 20px; padding: 4px 16px; }
.list > * { border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: none; }
.dot { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; }
.center-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px 24px; }
.timeinput { border: none; background: transparent; font-size: 18px; font-weight: 700; text-align: center; width: 116px; height: 44px; padding: 0 2px; border-radius: 12px; }
.timeinput::-webkit-calendar-picker-indicator { display: none; }
.timeinput:focus { outline: 2px solid var(--accent); }
.stepval { min-width: 104px; text-align: center; font-size: 15px; font-weight: 700; }
