:root {
  --bg: #F7F6F2; --ink: #1A1A1A; --muted: #6B6B66; --line: #E6E4DC; --line2: #D6D4CC; --card: #FFFFFF;
  --green: #2E9E5B; --yellow: #E0A800; --red: #C8453A;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Jost', system-ui, -apple-system, sans-serif; font-size: 16px; }
body { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.view { display: flex; flex-direction: column; min-height: calc(100vh - 76px - env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 20px 8px; }
.logo { height: 40px; width: auto; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h2 { font-size: 20px; font-weight: 500; }
.pad { padding: 14px 20px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.baseline { align-items: baseline; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.link { background: none; border: 0; padding: 8px 2px; min-height: 44px; color: var(--ink); text-decoration: underline; font-size: 14px; font-weight: 500; }
.link.muted { color: var(--muted); text-decoration: none; }
.hint { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; color: var(--muted); }
.error { color: var(--red); font-size: 14px; margin: 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); } .dot.red { background: var(--red); }

.big { display: flex; align-items: center; gap: 18px; border-radius: 18px; padding: 22px; min-height: 44px; text-align: left; border: 1.5px solid var(--ink); width: 100%; }
.big.primary { background: var(--ink); color: var(--bg); }
.big.outline { background: var(--card); color: var(--ink); }
.big svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.big span { display: flex; flex-direction: column; gap: 2px; }
.big b { font-size: 22px; font-weight: 500; line-height: 1.1; }
.big small { font-size: 14px; opacity: .75; }

.btn { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--card); padding: 0 16px; font-size: 15px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }
.btn.tall { min-height: 56px; font-size: 18px; border-radius: 16px; }
.btn:disabled { opacity: .45; }
.quick { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); font-size: 15px; }

.field { display: flex; flex-direction: column; gap: 3px; }
.field > span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, textarea { background: transparent; border: 0; border-bottom: 1px solid var(--line2); padding: 4px 0 6px; outline: none; border-radius: 0; width: 100%; font-size: 17px; }
.field input:focus { border-bottom-color: var(--ink); }
textarea { border: 1px solid var(--line2); border-radius: 10px; padding: 10px; font-size: 15px; line-height: 1.4; resize: vertical; }

.chips { flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); font-size: 14px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }
.chip.select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.propbtn { flex: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--card); font-size: 15px; }
.propbtn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }

.thumb { width: 84px; height: 112px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); overflow: hidden; flex-shrink: 0; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.alloc { display: flex; flex-direction: column; gap: 10px; }
.alloc .row.props { gap: 8px; }
.alloc .amount { width: 110px; text-align: right; }
.alloc .remove { align-self: flex-end; }

.list { padding: 0; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #EDEBE4; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.item:last-child { border-bottom: 0; }
.item .txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.item .t { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .amt { font-size: 16px; font-weight: 500; }
.item .amt.muted { font-size: 14px; font-weight: 400; }
.empty { padding: 22px 16px; color: var(--muted); font-size: 14px; text-align: center; }

.stat { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.stat b { font-size: 22px; font-weight: 500; display: flex; align-items: center; gap: 8px; }

.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 26px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.iconbtn.boxed { border: 1px solid var(--line2); background: var(--card); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; border-top: 1px solid var(--line); background: var(--bg); padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); }
#tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; min-height: 44px; background: none; border: 0; color: #8A8880; font-size: 11px; }
#tabs button.on { color: var(--ink); font-weight: 500; }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.busy { position: fixed; inset: 0; background: rgba(247,246,242,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 16px; z-index: 10; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line2); border-top-color: var(--ink); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 11; max-width: 90vw; }
