@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-variable.woff2") format("woff2-variations"),
       url("../fonts/vazirmatn-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #151A2D;
  --muted: #586078;
  --line: #DFE3EC;
  --line-strong: #C6CCDA;
  --lapis: #22409A;
  --lapis-deep: #182E73;
  --lapis-tint: #E9EDF8;
  --gold: #C9982F;
  --gold-tint: #FBF3DF;
  --pom: #B3243A;
  --pom-ink: #7A1626;
  --pom-tint: #FCEBEE;
  --leaf: #1D7A4C;
  --leaf-ink: #145536;
  --leaf-tint: #E5F4EC;
  --amber: #8A5A00;
  --amber-tint: #FFF3D4;
  --r-lg: 18px;
  --r-md: 12px;
  --pad: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lapis); }

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--ink);
  border-radius: 6px;
}
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; }
.mt { margin-top: 14px; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: max(var(--pad), env(safe-area-inset-right)) max(var(--pad), env(safe-area-inset-left));
}
.narrow { max-width: 680px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* Icons */
.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Demo band: not part of the real site */
.demo-bar {
  background: var(--gold-tint);
  border-bottom: 1px solid #E9D49C;
  font-size: .875rem;
  line-height: 1.6;
}
.demo-bar__in {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 6px;
}
.demo-bar__text { margin: 0; }
.demo-bar__btn {
  flex: none; min-height: 40px; padding: 4px 14px;
  border: 1px solid #C9A24A; border-radius: 999px; background: #fff;
  font-weight: 700; font-size: .875rem; cursor: pointer;
}

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font-size: 1.1875rem; font-weight: 800; white-space: nowrap; }
.site-header__side { display: flex; align-items: center; gap: 8px; font-size: .875rem; white-space: nowrap; }
.team-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--lapis-tint); color: var(--lapis-deep); font-weight: 700;
}

.app { flex: 1; outline: none; }
.loading { padding-block: 48px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .875rem; }
.site-footer__in { padding-block: 18px calc(18px + env(safe-area-inset-bottom)); }
.site-footer p { margin: 0 0 4px; }
.site-footer__muted { color: var(--muted); }

/* Pages */
.page { padding-block: 20px 40px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; font-weight: 800; }
.page-head .lead { margin: 4px 0 0; }
.lead { color: var(--muted); }
.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  color: var(--lapis); text-decoration: none; font-weight: 600; font-size: .9375rem;
}
.back-link .i { width: 18px; height: 18px; }
.section { margin-top: 26px; }
.section > h2 { font-size: 1.125rem; font-weight: 800; margin-bottom: 4px; }
.section > .hint { color: var(--muted); font-size: .875rem; margin: 0 0 12px; }
.section > h2 + :not(.hint) { margin-top: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 20px;
  border-radius: var(--r-md); border: 1.5px solid transparent;
  font-weight: 700; font-size: 1rem; line-height: 1.4;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn .i { width: 20px; height: 20px; }
.btn--primary { background: var(--lapis); color: #fff; }
.btn--primary:hover { background: var(--lapis-deep); }
.btn--secondary { background: #fff; color: var(--lapis); border-color: var(--lapis); }
.btn--secondary:hover { background: var(--lapis-tint); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn--ok { background: var(--leaf); color: #fff; }
.btn--danger { background: #fff; color: var(--pom); border-color: var(--pom); }
.btn--demo { background: #fff; color: var(--ink); border: 1.5px dashed var(--gold); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 6px 14px; font-size: .9375rem; border-radius: 10px; }
.btn:disabled, .btn[aria-disabled="true"] { background: #B9C0D2; border-color: transparent; color: #fff; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.link-btn {
  border: 0; background: none; padding: 0; min-height: 44px; color: var(--lapis);
  font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}

/* Notes */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-radius: 14px;
  font-size: .9375rem; line-height: 1.75;
}
.note .i { margin-top: 3px; }
.note p { margin: 0; }
.note strong { display: block; margin-bottom: 2px; }
.note--info { background: var(--lapis-tint); color: var(--lapis-deep); }
.note--warn { background: var(--pom-tint); color: var(--pom-ink); }
.note--pending { background: var(--amber-tint); color: var(--amber); }
.note--ok { background: var(--leaf-tint); color: var(--leaf-ink); }
.note ul { margin: 6px 0 0; padding-inline-start: 1.1rem; }

.demo-helper {
  margin-top: 16px; padding: 12px 14px;
  border: 1.5px dashed var(--gold); background: var(--gold-tint); border-radius: 14px;
  font-size: .9375rem;
}
.demo-helper p { margin: 0 0 10px; }
.demo-helper .btn-row { gap: 8px; }

/* Home */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 24px 40px; }
.hero h1 {
  font-size: clamp(1.75rem, 1.15rem + 2.6vw, 2.625rem);
  line-height: 1.45; font-weight: 800; margin-bottom: 12px;
}
.hero .lead { font-size: 1.0625rem; max-width: 34rem; }
.how { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 14px; }
.how li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.how__n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--lapis); color: var(--lapis); font-weight: 800; line-height: 1;
}
.how p { margin: 4px 0 0; }

.dir__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.dir__head h2 { font-size: 1.25rem; font-weight: 800; }
.dir__count { color: var(--muted); font-size: .9375rem; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-inline: -2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-weight: 600; font-size: .9375rem; white-space: nowrap; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.chip--toggle { display: inline-flex; align-items: center; gap: 6px; }
.filters__sep { flex: none; width: 1px; margin: 8px 2px; background: var(--line-strong); }

.dir { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dir__list { list-style: none; margin: 0; padding: 0; }
.dir__list li + li { border-top: 1px solid var(--line); }
.doc-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 14px;
  padding: 16px; color: inherit; text-decoration: none;
}
.doc-row:hover { background: #FAFBFD; }
.doc-row:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 3px var(--ink); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lapis-tint); color: var(--lapis); font-size: 1.375rem; font-weight: 800; line-height: 1;
}
.doc-row__name { font-size: 1.0625rem; font-weight: 800; margin: 0; }
.doc-row__spec { margin: 0; color: var(--muted); font-size: .9375rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; line-height: 1.8;
}
.badge .i { width: 15px; height: 15px; stroke-width: 2.2; }
.badge--f { background: var(--lapis-tint); color: var(--lapis-deep); }
.badge--ok { background: var(--leaf-tint); color: var(--leaf-ink); }
.badge--plain { background: #EFF1F6; color: var(--muted); }
.badge--pending { background: var(--amber-tint); color: var(--amber); }
.badge--bad { background: var(--pom-tint); color: var(--pom-ink); }
.doc-row__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: .875rem; color: var(--muted); }
.doc-row__meta b { color: var(--ink); font-weight: 700; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 12px; }

/* Stepper */
.stepper { list-style: none; padding: 0; margin: 4px 0 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stepper li { padding-top: 8px; border-top: 4px solid var(--line); font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.stepper li.is-done { border-color: var(--lapis); color: var(--ink); }
.stepper li.is-current { border-color: var(--lapis); color: var(--lapis); font-weight: 800; }

/* Doctor summary */
.doc-head {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; align-items: center;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.doc-head .avatar { width: 56px; height: 56px; }
.doc-head h1 { font-size: 1.25rem; font-weight: 800; }
.doc-head__sub { margin: 0; color: var(--muted); font-size: .9375rem; }
.doc-head .badges { grid-column: 1 / -1; margin-top: 8px; }

/* Service options */
.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 12px; align-items: start;
  padding: 14px 16px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 14px; cursor: pointer;
}
.option input { width: 20px; height: 20px; margin: 5px 0 0; accent-color: var(--lapis); }
.option.is-on { border-color: var(--lapis); background: var(--lapis-tint); box-shadow: inset 0 0 0 1px var(--lapis); }
.option__name { font-weight: 800; }
.option__price { font-weight: 800; white-space: nowrap; }
.option__desc { grid-column: 2 / -1; color: var(--muted); font-size: .875rem; }
.option:has(input:focus-visible) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

/* Days and slots */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-inline: -2px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; min-width: 88px; min-height: 66px; padding: 6px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; cursor: pointer; line-height: 1.45;
}
.day__label { font-weight: 800; }
.day__date { font-size: .8125rem; color: var(--muted); }
.day[aria-pressed="true"] { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.day[aria-pressed="true"] .day__date { color: #D9E0F5; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot {
  min-height: 50px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff;
  font-weight: 700; cursor: pointer;
}
.slot[aria-pressed="true"] { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.slot:disabled { background: #ECEFF5; border-color: transparent; color: #8A91A5; text-decoration: line-through; cursor: not-allowed; }
.slots-empty { padding: 18px 16px; border-radius: 14px; background: #fff; border: 1px dashed var(--line-strong); color: var(--muted); }
.slots-empty p { margin: 0; }

/* Sticky action bar */
.action-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  margin: 28px calc(-1 * var(--pad)) 0;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
.action-bar__summary { flex: 1; min-width: 0; font-size: .875rem; line-height: 1.55; color: var(--muted); }
.action-bar__summary strong { display: block; color: var(--ink); font-size: .9375rem; }
.action-bar .btn { flex: none; min-width: 128px; }
.action-bar--single .btn { flex: 1; }

/* Summary strip */
.summary-strip {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: .9375rem;
}
.summary-strip p { margin: 0; }
.summary-strip strong { display: block; }

/* Forms */
.form-card { padding: 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.form-card + .form-card { margin-top: 14px; }
.form-card > h2, fieldset > legend { font-size: 1.0625rem; font-weight: 800; margin-bottom: 12px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.field__hint { display: block; color: var(--muted); font-size: .875rem; margin-top: 6px; line-height: 1.65; }
.field__error { display: flex; gap: 6px; align-items: flex-start; color: var(--pom); font-size: .875rem; font-weight: 600; margin-top: 6px; }
.field__error .i { width: 18px; height: 18px; margin-top: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 10px 14px;
  font-size: 1rem; line-height: 1.6;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
}
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23586078' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 20px; background-position: left 12px center;
  padding-left: 40px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--lapis); box-shadow: 0 0 0 3px rgba(34, 64, 154, .18); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--pom); }
.input--ltr { direction: ltr; text-align: right; }
.input--ltr::placeholder { direction: rtl; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
.pair > .field:first-child { margin-bottom: 16px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.seg__opt { position: relative; display: block; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opt span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 6px 10px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: #fff; font-weight: 700; line-height: 1.4;
}
.seg__opt input:checked + span { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.seg__opt input:focus-visible + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.seg.is-invalid .seg__opt span { border-color: var(--pom); }

.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 4px 0 0; accent-color: var(--lapis); }
.check span { line-height: 1.75; }

.upload {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  border: 1.5px dashed var(--line-strong); border-radius: 14px; background: #FBFCFE; cursor: pointer;
}
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.upload__text strong { display: block; }
.upload__text span { color: var(--muted); font-size: .875rem; }
.upload__preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.upload__preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.error-summary { margin-bottom: 14px; }

.emergency { padding: 16px; border-radius: var(--r-lg); background: var(--pom-tint); color: var(--pom-ink); }
.emergency h2 { display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; font-weight: 800; margin-bottom: 6px; }
.emergency ul { margin: 0 0 12px; padding-inline-start: 1.2rem; }
.emergency .check { color: var(--ink); background: #fff; padding: 12px; border-radius: var(--r-md); }

/* Payment: the ticket */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: .9375rem; font-weight: 700; line-height: 1.5;
}
.pill--pending { background: var(--amber-tint); color: var(--amber); }
.pill--bad { background: var(--pom-tint); color: var(--pom-ink); }
.pill .i { width: 20px; height: 20px; }
.countdown { white-space: nowrap; }

.ticket {
  position: relative; margin-top: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px;
}
.ticket__top { position: relative; padding: 20px 20px 22px; background: var(--lapis); color: #fff; overflow: hidden; }
.ticket__top > :not(.ticket__star) { position: relative; z-index: 1; }
.ticket__star {
  position: absolute; inset-inline-end: -44px; top: 50%; transform: translateY(-50%);
  width: 184px; height: 184px; opacity: .9; pointer-events: none;
}
.ticket__label { margin: 0; font-size: .875rem; color: #D6DDF4; }
.ticket__code { margin: 0 0 12px; font-size: 2.125rem; font-weight: 800; letter-spacing: .06em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ticket__top .btn--sm { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.ticket__top .btn--sm:hover { background: rgba(255, 255, 255, .12); }
.ticket__divider { position: relative; height: 0; border-top: 2px dashed var(--line-strong); }
.ticket__divider::before, .ticket__divider::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ground); border: 1px solid var(--line-strong);
}
.ticket__divider::before { inset-inline-start: -12px; }
.ticket__divider::after { inset-inline-end: -12px; }
.ticket__body { padding: 18px 20px 20px; display: grid; gap: 14px; }
.ticket__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket__row p { margin: 0; }
.ticket__row .k { display: block; color: var(--muted); font-size: .875rem; }
.ticket__row .v { font-size: 1.25rem; font-weight: 800; }

.pay-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pay-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; }
.pay-steps .how__n { width: 30px; height: 30px; font-size: .9375rem; }
.pay-steps p { margin: 2px 0 0; }

/* Status */
.status { text-align: center; padding: 8px 8px 4px; }
.status__icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; }
.status__icon .i { width: 34px; height: 34px; stroke-width: 2.2; }
.status--ok .status__icon { background: var(--leaf-tint); color: var(--leaf); }
.status--pending .status__icon { background: var(--amber-tint); color: var(--amber); }
.status h1 { font-size: 1.5rem; font-weight: 800; }
.status p { color: var(--muted); margin: 6px auto 0; max-width: 30rem; }

.dl {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.dl dt { color: var(--muted); font-size: .9375rem; }
.dl dd { margin: 0; font-weight: 700; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.checklist .i { color: var(--leaf); margin-top: 3px; stroke-width: 2.2; }

.bubble {
  max-width: 32rem; padding: 12px 14px; border-radius: 16px 16px 16px 4px;
  background: #E2F2E6; color: #12331F; white-space: pre-line; font-size: .9375rem; line-height: 1.85;
}
.bubble-meta { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }

.rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.rules summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 12px 16px; font-weight: 800; cursor: pointer; list-style: none;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary .i { transition: transform .2s; }
.rules[open] summary .i { transform: rotate(180deg); }
.rules table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.rules th, .rules td { text-align: start; vertical-align: top; padding: 10px 16px; border-top: 1px solid var(--line); line-height: 1.7; }
.rules th { width: 50%; font-weight: 600; color: var(--muted); }

/* Prescription */
.rx-sheet {
  position: relative; overflow: hidden; padding: 22px 20px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
}
.rx-sheet::after {
  content: "نمونه"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 6.5rem; font-weight: 900; color: rgba(34, 64, 154, .06); transform: rotate(-16deg); pointer-events: none;
}
.rx-sheet__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--lapis); }
.rx-sheet__head p { margin: 0; }
.rx-sheet__brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.rx-sheet__brand svg { width: 26px; height: 26px; }
.rx-sheet h3 { font-size: 1rem; font-weight: 800; margin: 14px 0 6px; }
.rx-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: .9375rem; }
.rx-grid dt { color: var(--muted); }
.rx-grid dd { margin: 0; font-weight: 700; }
.rx-items { list-style: none; margin: 0; padding: 0; }
.rx-items li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.rx-n { font-weight: 800; color: var(--lapis); }
.rx-items small { display: block; color: var(--muted); font-size: .875rem; }
.rx-foot { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-strong); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: .8125rem; color: var(--muted); }

/* Survey */
.stars { display: flex; gap: 6px; flex-wrap: wrap; }
.star {
  width: 50px; height: 50px; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; color: #9AA1B4;
}
.star .i { width: 26px; height: 26px; }
.star.is-on { color: #B07F14; border-color: var(--gold); background: var(--gold-tint); }
.star.is-on .i { fill: currentColor; }
.q { margin-bottom: 18px; }
.q__label { display: block; font-weight: 700; margin-bottom: 8px; }

/* Team: operator */
.team-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 16px; }
.team-head h1 { font-size: 1.5rem; font-weight: 800; }
.team-head p { margin: 0; color: var(--muted); }
.op-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.op-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.op-table th { text-align: start; font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 10px 14px; background: #F7F8FB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.op-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.op-table tr:last-child td { border-bottom: 0; }
.op-table tr.is-mine, .op-table tr.is-mine td { background: #FFFAEC; }
.op-codecell { display: inline-flex; flex-direction: column; align-items: flex-start; }
.op-code { font-weight: 800; letter-spacing: .03em; }
.op-actions { white-space: nowrap; }
.op-actions .btn + .btn { margin-inline-start: 6px; }
.op-empty { padding: 22px 16px; color: var(--muted); }
.op-empty p { margin: 0; }
.mine-tag { display: block; width: max-content; margin-top: 2px; padding: 0 8px; border-radius: 999px; background: var(--gold-tint); border: 1px dashed var(--gold); font-size: .75rem; font-weight: 700; color: var(--ink); }
.done-list { list-style: none; margin: 0; padding: 0; }
.done-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.done-list li:first-child { border-top: 0; }
.outage { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.outage p { margin: 0; }

/* Team: doctor */
.dp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dp-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dp-list li + li { border-top: 1px solid var(--line); }
.dp-item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 2px 12px; width: 100%;
  padding: 14px 16px; text-align: start; background: none; border: 0; cursor: pointer;
  border-inline-start: 4px solid transparent;
}
.dp-item.is-on { background: var(--lapis-tint); border-inline-start-color: var(--lapis); }
.dp-item__time { font-weight: 800; }
.dp-item__who { font-weight: 700; }
.dp-item__svc { grid-column: 2; color: var(--muted); font-size: .875rem; }
.dp-item .badges { grid-column: 2; margin-top: 4px; }
.dp-detail { padding: 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dp-detail h2 { font-size: 1.1875rem; font-weight: 800; }
.dp-detail h3 { font-size: 1rem; font-weight: 800; margin: 18px 0 8px; }
.lab-photo { display: grid; place-items: center; width: 100%; max-width: 280px; aspect-ratio: 4 / 3; border-radius: 12px; background: #EEF1F7; border: 1px solid var(--line); color: var(--muted); font-size: .875rem; overflow: hidden; }
.lab-photo img { width: 100%; height: 100%; object-fit: cover; }
.med-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px 8px; margin-bottom: 14px; }
.med-row__n {
  grid-row: 1 / span 2; align-self: start; margin-top: 13px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lapis-tint); color: var(--lapis); font-size: .8125rem; font-weight: 800;
}
.med-row .input { grid-column: 2; }
#dpName { scroll-margin-top: 12px; }

/* Dialogs */
dialog.sheet {
  width: min(580px, 100%); max-width: 100%; max-height: 90vh; max-height: 90dvh;
  margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: 0 -10px 40px rgba(21, 26, 45, .22);
}
dialog.sheet::backdrop { background: rgba(21, 26, 45, .5); }
.sheet__in { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 90vh; max-height: 90dvh; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sheet__head h2 { font-size: 1.25rem; font-weight: 800; }
.sheet__lead { color: var(--muted); }
.sheet__body p:last-child { margin-bottom: 0; }
.sheet__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sheet__actions .btn { min-width: 120px; }
.guide-groups { display: grid; gap: 8px 24px; }
.guide-groups h3, .guide-tips__title { font-size: 1rem; font-weight: 800; margin: 10px 0 6px; }
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { display: flex; align-items: center; gap: 10px; }
.guide-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: var(--muted); font-size: .8125rem; font-weight: 800; line-height: 1;
}
.guide-list a { display: inline-block; min-height: 40px; padding-block: 6px; font-weight: 600; }
.guide-tips { margin: 0; padding-inline-start: 1.2rem; color: var(--ink); font-size: .9375rem; }
.guide-tips li { margin-bottom: 6px; }

/* Toast */
.toast {
  position: fixed; z-index: 60; inset-inline: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: 440px; margin-inline: auto; padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: .9375rem; line-height: 1.6; text-align: center;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.is-on { opacity: 1; transform: none; }

/* Larger screens */
@media (max-width: 399px) {
  .team-tag__long { display: none; }
  .site-header__side .btn--sm { padding-inline: 12px; }
}

@media (min-width: 420px) {
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  :root { --pad: 24px; }
  .page { padding-block: 28px 56px; }
  .page-head h1, .team-head h1 { font-size: 1.75rem; }
  .slots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .doc-row { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; padding: 18px 20px; }
  .doc-row .avatar { width: 56px; height: 56px; }
  .doc-row__meta { grid-column: 3; grid-row: 1; flex-direction: column; align-items: flex-end; text-align: end; }
  .action-bar { position: static; margin: 28px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); }
  .form-card { padding: 22px 22px; }
  dialog.sheet { margin: auto; border-radius: 22px; }
  .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters { flex-wrap: wrap; overflow: visible; }
  .pair > .field:first-child { margin-bottom: 0; }
  .med-row { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; margin-bottom: 8px; }
  .med-row__n { grid-row: auto; align-self: center; margin-top: 0; }
  .med-row .input { grid-column: auto; }
  .guide-groups { grid-template-columns: 1fr 1fr; }
  .status { padding-top: 16px; }
}

@media (min-width: 960px) {
  .home { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 48px; align-items: start; padding-block: 40px 64px; }
  .home__intro { position: sticky; top: 24px; }
  .dp { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
}

@media (max-width: 899px) {
  .op-table, .op-table tbody, .op-table tr, .op-table td { display: block; width: 100%; }
  .op-table thead { display: none; }
  .op-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .op-table tr:last-child { border-bottom: 0; }
  .op-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; }
  .op-table td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; flex: none; }
  .op-table td.op-actions { justify-content: flex-start; padding-top: 10px; }
  .op-table td.op-actions::before { content: none; }
  .op-codecell { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff; }
  body { display: block; min-height: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .skip, .demo-bar, .site-header, .site-footer, .toast, dialog, .action-bar { display: none !important; }
  body.print-rx .page { padding: 0; max-width: none; }
  body.print-rx .page > :not(.rx-section),
  body.print-rx .rx-section > :not(.rx-sheet) { display: none !important; }
  body.print-rx .rx-section { margin: 0; }
  body.print-rx .rx-sheet { border: 0; border-radius: 0; padding: 0; }
  body.print-rx .rx-sheet::after { font-size: 9rem; }
}
