@font-face {
  font-family: Vazirmatn;
  src: url('/fonts/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  src: url('/fonts/vazirmatn-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}

:root {
  --paper: #F4F0E6;
  --surface: #FFFDF8;
  --ink: #1B2422;
  --muted: #5C6865;
  --line: #DDD6C6;
  --pine: #0E4F45;
  --pine-deep: #0A3A33;
  --pine-soft: #DCEBE5;
  --saffron: #B56C12;
  --saffron-soft: #F8E8CC;
  --clay: #A63D28;
  --clay-soft: #F6DED7;
  --host: #0E4F45;
  --executor: #D08A26;
  --platform: #6F7F92;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.75 Vazirmatn, Tahoma, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 800; }
h2 { font-size: 18px; line-height: 1.5; font-weight: 700; }
h3 { font-size: 15px; line-height: 1.6; font-weight: 700; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* چیدمان: روی دسکتاپ راهنما کنار اپ است و روی موبایل فقط اپ. */
.shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.side { display: none; }
.phone {
  background: var(--paper);
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 960px) {
  .shell { grid-template-columns: 340px minmax(0, 1fr); }
  .side {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    padding: 28px 24px;
    background: var(--pine-deep);
    color: #EEF4F0;
  }
  .phone { border-inline: 1px solid var(--line); }
}

/* پنل راهنما */
.side h1 { font-size: 20px; }
.side .muted { color: #B8CBC4; }
.side-guide {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
}
.side-guide h3 { color: #FFD48F; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 13.5px; }
.checklist li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.6; color: #B8CBC4; }
.checklist li.on { color: #fff; }
.tick {
  flex: none;
  width: 18px; height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid #6E8E85;
  display: grid; place-items: center;
  font-size: 11px; line-height: 1;
}
.on .tick { background: #FFD48F; border-color: #FFD48F; color: var(--pine-deep); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }

/* نوار بالا */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--pine);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}
.demo-tag {
  font-size: 12px;
  text-align: center;
  padding: 3px 12px;
  background: var(--saffron-soft);
  color: #6B3F07;
  font-weight: 600;
}
.roles { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 8px 10px 0; gap: 2px; }
.roles button {
  background: none; border: 0; color: #C9DED7;
  padding: 8px 2px 10px; min-height: 44px;
  font-weight: 600; font-size: 14px;
  border-bottom: 3px solid transparent;
}
.roles button[aria-pressed="true"] { color: #fff; border-color: #FFD48F; }

.guide-mobile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  background: var(--saffron-soft);
  padding: 9px 14px;
  border-bottom: 1px solid #E8D3A9;
  font-size: 13px; line-height: 1.6;
}
.guide-mobile strong { color: #6B3F07; display: block; }
.guide-mobile p { grid-column: 1 / -1; color: #5A4522; }
@media (min-width: 960px) { .guide-mobile { display: none; } }

/* محتوا */
.screen-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0; }
.back {
  width: 44px; height: 44px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  font-size: 19px; line-height: 1;
}
.content { padding: 14px 16px 24px; display: grid; gap: 14px; flex: 1; align-content: start; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.card.link { text-align: start; width: 100%; color: inherit; }
.card.link:hover { border-color: var(--pine); }
.card.active { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.section-title { margin-top: 6px; }

/* دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 16px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; text-align: center; line-height: 1.5;
  background: var(--pine); color: #fff;
}
.btn:hover:not(:disabled) { background: var(--pine-deep); }
.btn:disabled { background: #C9C5B8; color: #6A675E; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: #EDE7D8; }
.btn.danger { background: transparent; border-color: var(--clay); color: var(--clay); }
.btn.danger:hover:not(:disabled) { background: var(--clay-soft); }
.btn.small-btn { min-height: 40px; padding: 5px 12px; font-size: 13.5px; }
.side .btn { background: #FFD48F; color: var(--pine-deep); }
.side .btn:hover:not(:disabled) { background: #FFE2B3; }
.side .btn.ghost { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.side .btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.guide-mobile .btn { background: #6B3F07; min-height: 40px; }

/* فرم */
.field { display: grid; gap: 5px; }
.field label, .legend { font-weight: 600; font-size: 14px; }
.input {
  width: 100%; min-height: 48px; padding: 8px 12px;
  background: #fff;
  border: 1px solid #BDB6A5; border-radius: 11px;
  font-size: 16px;
}
textarea.input { min-height: 88px; resize: vertical; }
.input.ltr { direction: ltr; text-align: left; letter-spacing: .04em; }
.input[aria-invalid="true"] { border-color: var(--clay); }
.error { color: var(--clay); font-size: 13.5px; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.check input { width: 21px; height: 21px; margin: 2px 0 0; accent-color: var(--pine); flex: none; }
details > summary { cursor: pointer; color: var(--pine); font-weight: 600; font-size: 13.5px; min-height: 32px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.segmented button {
  min-height: 44px; border-radius: 10px; padding: 4px 6px;
  border: 1px solid #BDB6A5; background: #fff; font-weight: 600; font-size: 14px;
}
.segmented button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }

/* نقشه */
.map {
  position: relative; direction: ltr;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #E8E3D3;
  aspect-ratio: 360 / 250;
  width: 100%; padding: 0; display: block;
}
.map svg { width: 100%; height: 100%; display: block; }
button.map { cursor: crosshair; }
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  border: 0; background: none; padding: 0;
  min-width: 44px; min-height: 44px;
  display: grid; justify-items: center; align-content: end;
}
.pin span.dot {
  width: 22px; height: 22px;
  background: var(--pine); border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.pin.on span.dot { background: var(--saffron); }
.pin-static { position: absolute; transform: translate(-50%, -100%); pointer-events: none; }
.map-note {
  position: absolute; left: 8px; bottom: 6px;
  font-size: 11px; color: #5A5C50; direction: rtl;
  background: rgba(255,253,248,.85); padding: 0 7px; border-radius: 6px;
}

/* انتخاب زمان */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: none; min-height: 44px; padding: 5px 12px;
  border: 1px solid #BDB6A5; border-radius: 11px; background: #fff;
  font-weight: 600; font-size: 13.5px;
}
.chip[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip:disabled { background: #EAE5D8; color: #8A867A; border-color: var(--line); text-decoration: line-through; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slots .chip { width: 100%; }

/* قیمت */
.lines { display: grid; gap: 6px; }
.line { display: flex; justify-content: space-between; gap: 12px; }
.line.total { border-top: 1px dashed #BDB6A5; padding-top: 8px; font-weight: 800; font-size: 16px; }
.price { font-weight: 700; white-space: nowrap; }

/* نوار پایین */
.sticky-bar {
  position: sticky; bottom: 0; z-index: 15;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-bottom));
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.tabs {
  position: sticky; bottom: 0; z-index: 15;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: var(--safe-bottom);
}
.tabs button {
  border: 0; background: none; min-height: 54px;
  font-weight: 600; font-size: 13.5px; color: var(--muted);
  border-top: 3px solid transparent;
}
.tabs button[aria-pressed="true"] { color: var(--pine); border-color: var(--pine); }

/* وضعیت */
.badge {
  display: inline-block; white-space: nowrap;
  padding: 1px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700;
  background: var(--pine-soft); color: var(--pine);
}
.badge.warn { background: var(--saffron-soft); color: #7A4A0B; }
.badge.bad { background: var(--clay-soft); color: var(--clay); }
.badge.off { background: #E7E2D5; color: var(--muted); }

.tracker { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.tracker li { position: relative; text-align: center; font-size: 12px; line-height: 1.5; color: var(--muted); padding-top: 24px; }
.tracker li::before {
  content: ''; position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid #BDB6A5; z-index: 1;
}
.tracker li::after {
  content: ''; position: absolute; top: 11px; height: 2px; background: #BDB6A5;
  inset-inline-start: 50%; width: 100%;
}
.tracker li:last-child::after { display: none; }
.tracker li.done { color: var(--ink); font-weight: 600; }
.tracker li.done::before { background: var(--pine); border-color: var(--pine); }
.tracker li.done::after { background: var(--pine); }
.tracker li.now { color: #7A4A0B; font-weight: 700; }
.tracker li.now::before { background: var(--saffron); border-color: var(--saffron); box-shadow: 0 0 0 4px var(--saffron-soft); }

.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.split i { display: block; height: 100%; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }

.contact { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 11px; background: #F0EBDD; }
.contact.open { background: var(--pine-soft); }
.phone-no { direction: ltr; font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 3px; align-content: start; }
.tile strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.tile span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tile.held { background: var(--saffron-soft); border-color: #E8D3A9; }

.sms {
  background: #E6E2D4; padding: 12px; border-radius: 14px 14px 14px 4px;
  display: grid; gap: 8px; font-size: 14px;
}
.stars { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
.stars button { width: 46px; height: 46px; border: 0; background: none; font-size: 30px; line-height: 1; color: #C9C2B0; padding: 0; }
.stars button.on { color: var(--saffron); }

.ledger-row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ledger-row:first-of-type { border-top: 0; padding-top: 0; }

.hero { padding: 26px 16px 8px; display: grid; gap: 10px; }
.role-card {
  width: 100%; text-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 66px;
}
.role-card:hover { border-color: var(--pine); }
.role-card .arrow { color: var(--pine); font-size: 19px; }

.notice {
  font-size: 13px; line-height: 1.7;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--pine-soft);
  color: #143D35;
}
.notice.warn { background: var(--saffron-soft); color: #5A3A0A; }
.notice.bad { background: var(--clay-soft); color: #6E2415; }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; }

#toast {
  position: fixed; z-index: 50; inset-inline: 16px; bottom: calc(76px + var(--safe-bottom));
  display: flex; justify-content: center; pointer-events: none;
}
#toast div {
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 11px;
  font-size: 14px; max-width: 440px;
}

