:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #6b6860;
  --line: #e4e1d8;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --accent: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --tabs-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.who { font-size: 13px; color: var(--muted); }

.banner { margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: #fef3c7; color: #78350f; font-size: 14px; }
.view { padding: 16px 16px calc(var(--tabs-h) + 24px); max-width: 760px; margin: 0 auto; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; height: var(--tabs-h); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); }
.tabs svg { width: 22px; height: 22px; fill: currentColor; }
.tabs a.on { color: var(--brand); font-weight: 600; }

h1 { font-size: 22px; margin: 4px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.check input { width: auto; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile .img { aspect-ratio: 1; background: #ece9e1 center/cover no-repeat; }
.tile .body { padding: 8px 10px 10px; }
.tile .title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.price { font-weight: 700; color: var(--brand); }
.price::after { content: " π"; font-weight: 600; }
.big-price { font-size: 26px; }

.hero { aspect-ratio: 4/3; background: #ece9e1 center/contain no-repeat; border-radius: var(--radius); border: 1px solid var(--line); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.desc { white-space: pre-wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--danger); border-color: #f1c4c4; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btns { display: grid; gap: 8px; margin-top: 12px; }
.btns.two { grid-template-columns: 1fr 1fr; }

.seg { display: flex; gap: 4px; background: #ebe8df; padding: 4px; border-radius: 10px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.item { display: flex; gap: 12px; padding: 12px; align-items: center; }
.item + .item { border-top: 1px solid var(--line); }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; background: #ece9e1 center/cover no-repeat; }
.item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #ebe8df; color: var(--muted); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: var(--danger); }
.badge.info { background: #ccfbf1; color: var(--brand); }

.steps { display: flex; gap: 4px; margin: 10px 0; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--brand); }

.chat { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.msg { max-width: 80%; padding: 8px 11px; border-radius: 12px; background: #ebe8df; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; }
.msg .who { display: block; font-size: 11px; opacity: .7; }

.stars { display: flex; gap: 4px; font-size: 28px; }
.stars button { border: 0; background: none; cursor: pointer; color: #d6d3c9; padding: 0; }
.stars button.on { color: #f59e0b; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; }
.toast.err { background: var(--danger); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.spinner { width: 28px; height: 28px; margin: 40px auto; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview { width: 100%; aspect-ratio: 4/3; border-radius: 10px; border: 1px dashed var(--line); background: #f1efe8 center/contain no-repeat; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
