:root {
  --bg: #faf6ef; --card: #fff; --ink: #2a211c; --muted: #7a6d63; --line: #eadfd1;
  --brand: #b8432c; --brand-ink: #fff; --brand-soft: #fbe7e1; --ok: #1f7a4d; --ok-soft: #dff3e8; --warn: #a56a00; --warn-soft: #fff1d6; --bad: #b3261e; --bad-soft: #fde4e1;
  --radius: 14px; --shadow: 0 2px 14px #2a211c14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --bg: #1d1815; --card: #2a2420; --ink: #f4ede4; --muted: #b0a396; --line: #43382f; --brand: #e0705a; --brand-ink: #1d1815; --brand-soft: #4a2a22; --ok: #5fcf97; --ok-soft: #20382b; --warn: #f0b84d; --warn-soft: #3e3218; --bad: #ff8d84; --bad-soft: #4a2320; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.7 Vazirmatn, 'Segoe UI', Tahoma, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 58px; }
.logo { font-weight: 800; font-size: 1.3rem; color: var(--brand); }
.logo small { font-weight: 400; color: var(--muted); font-size: .75rem; margin-right: 6px; }
nav { display: flex; gap: 4px; margin-right: auto; flex-wrap: wrap; }
nav a, nav button { padding: 6px 12px; border-radius: 999px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
nav a.active, nav a:hover, nav button:hover { background: var(--brand-soft); color: var(--brand); }
.badge { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-right: 4px; }
main { padding: 20px 0 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.narrow { max-width: 420px; margin: 24px auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: 1fr 340px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .sticky { position: static !important; } }
.sticky { position: sticky; top: 74px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.price { font-weight: 800; } .price small { font-weight: 400; color: var(--muted); }
.up { color: var(--bad); } .down { color: var(--ok); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
textarea { min-height: 70px; }
input[type=checkbox], input[type=radio] { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn.block { width: 100%; margin-top: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font: inherit; color: var(--ink); }
.chip.sel { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.chip[disabled] { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.chip small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; text-decoration: none; }
.optcard { text-align: right; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font: inherit; color: var(--ink); min-width: 150px; }
.optcard.sel { border-color: var(--brand); background: var(--brand-soft); }
.optcard[disabled] { opacity: .4; cursor: not-allowed; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-left: 4px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.bad { background: var(--bad-soft); color: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: var(--brand-soft); }
.msg { padding: 10px 14px; border-radius: 10px; margin: 8px 0; font-size: .9rem; }
.msg.err { background: var(--bad-soft); color: var(--bad); } .msg.warn { background: var(--warn-soft); color: var(--warn); } .msg.ok { background: var(--ok-soft); color: var(--ok); }
.hint { font-size: .85rem; color: var(--warn); margin-top: 6px; }
.sum div { display: flex; justify-content: space-between; padding: 3px 0; }
.sum .total { font-size: 1.15rem; font-weight: 800; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
.sum .sub { color: var(--muted); font-size: .85rem; padding-right: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: var(--card); font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty span { min-width: 80px; text-align: center; font-weight: 700; }
.steps { display: flex; gap: 0; margin: 10px 0 16px; }
.step { flex: 1; text-align: center; font-size: .78rem; color: var(--muted); position: relative; padding-top: 18px; }
.step::before { content: ''; position: absolute; top: 0; right: 50%; width: 14px; height: 14px; margin-right: -7px; border-radius: 50%; background: var(--line); }
.step.done { color: var(--ink); } .step.done::before { background: var(--ok); } .step.cur::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.tabs a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.drawer { position: fixed; inset: 0 auto 0 0; width: min(560px, 100%); background: var(--bg); box-shadow: 8px 0 30px #0004; overflow: auto; padding: 16px; z-index: 30; }
.scrim { position: fixed; inset: 0; background: #0006; z-index: 20; }
#toasts { position: fixed; bottom: 16px; left: 16px; z-index: 99; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px #0004; }
.toast.error { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.stat { font-size: 1.5rem; font-weight: 800; } .statlabel { color: var(--muted); font-size: .8rem; }
.spark { width: 70px; height: 22px; vertical-align: middle; }
[hidden] { display: none !important; }
