:root {
  --brand: #c2410c; --brand-d: #7c2d12; --brand-l: #fff1e7;
  --bg: #faf7f4; --card: #fff; --ink: #1c1917; --ink2: #44403c; --muted: #78716c; --line: #ece5de;
  --green: #15803d; --amber: #b45309; --red: #b91c1c; --blue: #1d4ed8;
  --r: 16px; --shadow: 0 1px 2px rgba(28,25,23,.05), 0 6px 20px rgba(28,25,23,.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: .4rem 0; }
p { margin: .3rem 0 .6rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.row { display: flex; align-items: center; } .gap { gap: .5rem; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .65rem 1rem; border-radius: 12px; font: inherit; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-align: center; transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.danger { background: transparent; color: var(--red); border-color: transparent; }
.btn.block { width: 100%; } .btn.big { padding: .9rem 1.2rem; font-size: 1.05rem; } .btn.small { padding: .4rem .7rem; font-size: .85rem; border-radius: 10px; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }

label { display: block; font-size: .85rem; font-weight: 650; color: var(--ink2); margin: .6rem 0; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: .65rem .75rem; margin-top: .3rem; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 550; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.err { color: var(--red); font-size: .9rem; min-height: 1.2em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.pill { display: inline-block; font-size: .74rem; font-weight: 750; padding: .2rem .55rem; border-radius: 99px; white-space: nowrap; }
.pill.blue { background: #dbeafe; color: #1e40af; } .pill.amber { background: #fef3c7; color: #92400e; } .pill.green { background: #dcfce7; color: #166534; }
.pill.slate { background: #e7e5e4; color: #44403c; } .pill.red { background: #fee2e2; color: #991b1b; } .pill.brand { background: var(--brand-l); color: var(--brand-d); }

.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(12,10,9,.5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.sheet-wrap.in { opacity: 1; }
.sheet { position: relative; background: var(--card); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; transform: translateY(40px); transition: transform .2s; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-body { padding: 1.3rem 1.2rem calc(1.3rem + var(--safe-b)); }
.sheet-x { position: absolute; top: .7rem; right: .7rem; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; z-index: 2; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }

#toasts { position: fixed; left: 50%; bottom: calc(1.2rem + var(--safe-b)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 12px; font-weight: 650; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center; }
.toast.err { background: #991b1b; } .toast.out { opacity: 0; transition: opacity .3s; }

.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: #92400e; color: #fff; text-align: center; font-size: .85rem; font-weight: 650; padding: .35rem; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
