/* صفحه‌های داخلی سایت — همان زبان صفحهٔ اصلی (home3d.css): پس‌زمینهٔ تیره، شیشهٔ مات، فیروزه‌ای برند.
   هدر، منوی کشویی و فوتر از قانون‌های .h3-home در home3d.css می‌آیند؛ اینجا فقط بدنهٔ صفحه است.
   فعلاً: /appointments */

.h3-inner {
  background:
    radial-gradient(60% 46% at 78% 0%, rgba(79, 203, 209, 0.09), transparent 70%),
    radial-gradient(50% 40% at 8% 100%, rgba(79, 203, 209, 0.05), transparent 70%),
    #07141a !important;
  background-attachment: fixed;
}
/* home3d.css کلیک را از main صفحهٔ اصلی برمی‌دارد (صحنهٔ سه‌بعدی زیرش است)؛ صفحهٔ داخلی صحنه ندارد */
.h3-inner main, .h3-inner main * { pointer-events: auto; }
.h3-inner main::before { content: none !important; }
.h3-inner main { padding-top: 88px; }

.ap-wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* شیشهٔ مشترک: همان کارت ناحیه (.h3-rcard) */
.ap-card, .ap-search {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(80% 110px at 85% 0%, rgba(79, 203, 209, 0.1), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.035) 42%, rgba(255, 255, 255, 0.02) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}

/* ── عنوان، جستجو و چیپ‌ها ── */
.ap-hero { padding: clamp(28px, 6vw, 64px) 0 20px; }
.ap-hero .ap-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.ap-title { font-size: clamp(26px, 6.4vw, 40px); }

.ap-search {
  display: flex; align-items: center; gap: 10px; width: min(640px, 100%); height: 58px;
  padding: 0 18px 0 8px; border-radius: 999px; cursor: text; transition: border-color 0.2s;
}
.ap-search:focus-within { border-color: rgba(79, 203, 209, 0.55); }
.ap-search > svg { width: 20px; height: 20px; flex: none; color: var(--h3-faint); }
.ap-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  color: var(--h3-ink); font: inherit; font-size: 16px; text-align: right;
}
.ap-search input::placeholder { color: var(--h3-faint); }
.ap-search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
.ap-count {
  flex: none; height: 40px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--h3-accent); background: rgba(79, 203, 209, 0.12);
}
.ap-count:empty { display: none; }

.ap-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.ap-chips .apt-filter-pill {
  min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--h3-line);
  background: rgba(255, 255, 255, 0.05); color: var(--h3-dim);
  font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ap-chips .apt-filter-pill:hover { color: var(--h3-ink); border-color: rgba(79, 203, 209, 0.4); background: rgba(79, 203, 209, 0.08); }
.ap-chips .apt-filter-pill.active { color: var(--h3-accent); border-color: rgba(79, 203, 209, 0.5); background: rgba(79, 203, 209, 0.16); }
.ap-chips .apt-filter-pill:focus-visible { outline: 2px solid var(--h3-accent); outline-offset: 2px; }

/* ── فهرست پزشکان ── */
.ap-list { padding: 12px 0 64px; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ap-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; min-width: 0; transition: border-color 0.2s; }
.ap-card:hover { border-color: rgba(255, 255, 255, 0.24); }

.ap-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-av {
  flex: none; width: 56px; height: 56px; border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  color: var(--h3-accent); border: 1px solid rgba(79, 203, 209, 0.32);
  background: linear-gradient(180deg, rgba(79, 203, 209, 0.2), rgba(79, 203, 209, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.ap-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-name, .ap-spec, .ap-sub { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-name { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--h3-ink); }
.ap-name a { color: inherit; text-decoration: none; transition: color 0.2s; }
.ap-name a:hover { color: var(--h3-accent); }
.ap-spec { font-size: 13px; color: var(--h3-accent); }
.ap-sub { font-size: 12px; color: var(--h3-faint); }
.ap-rate { flex: none; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 12.5px; font-weight: 600; color: #f5c451; }
.ap-rate svg { width: 13px; height: 13px; }

.ap-meta { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--h3-line); display: flex; flex-direction: column; gap: 8px; }
.ap-meta li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--h3-dim); }
.ap-meta li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-meta svg { width: 16px; height: 16px; flex: none; color: var(--h3-accent); }

.ap-tags { display: flex; gap: 6px; overflow: hidden; }
.ap-tags span { flex: none; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--h3-line); background: rgba(255, 255, 255, 0.05); font-size: 12px; color: var(--h3-dim); white-space: nowrap; }

.ap-slots { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.ap-slots > svg { width: 16px; height: 16px; flex: none; color: var(--h3-accent); }
.ap-slots a {
  flex: none; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--h3-line); background: rgba(255, 255, 255, 0.06);
  font-size: 12.5px; color: var(--h3-ink); text-decoration: none; white-space: nowrap; direction: ltr; transition: border-color 0.2s, background 0.2s;
}
.ap-slots a:hover { border-color: rgba(79, 203, 209, 0.45); background: rgba(79, 203, 209, 0.1); }

.ap-actions { display: flex; gap: 8px; margin-top: auto; }
.ap-actions .h3-btn { min-height: 44px; font-size: 14px; }
.ap-actions .h3-btn--main { flex: 1; }
.ap-call { flex: none; width: 44px; padding: 0 !important; }
.ap-call svg { width: 18px; height: 18px; }

.ap-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 20px; border-radius: 22px; border: 1px dashed rgba(255, 255, 255, 0.16); }
.ap-empty p { margin: 0; font-size: 15px; color: var(--h3-dim); }

/* ── موبایل ── */
@media (max-width: 820px) {
  .h3-inner main { padding-top: 84px; }
  .ap-hero .ap-wrap { gap: 16px; }
  .ap-search { height: 52px; }
  .ap-count { height: 36px; padding: 0 12px; font-size: 12px; }
  .ap-grid { grid-template-columns: 1fr; gap: 12px; }
  .ap-card { padding: 16px; }
}
.ap-chips .ap-chip-x { display: inline-flex; align-items: center; gap: 6px; }
.ap-chips .ap-chip-x svg { width: 14px; height: 14px; }

/* ── چیدمان: کارت جستجوی پیشرفته (راست، ثابت) + فهرست یک‌ستونه ── */
.ap-card, .ap-side {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(80% 110px at 85% 0%, rgba(79, 203, 209, 0.1), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.035) 42%, rgba(255, 255, 255, 0.02) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}
.h3-inner main { padding-top: 96px; }
.ap-list { padding: 8px 0 64px; }
.ap-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }

/* کارت جستجو: بخش‌ها با خط نازک جدا می‌شوند */
.ap-side {
  position: sticky; top: 92px; display: flex; flex-direction: column; padding: 0; border-radius: 22px;
  max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin;
}
.ap-side > * { padding: 16px 20px; border-top: 1px solid var(--h3-line); }
.ap-side > :first-child { border-top: 0; }
.ap-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-side-head h1 { margin: 0; font-size: 16px; font-weight: 600; color: var(--h3-ink); white-space: nowrap; }
.ap-reset { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13px; color: var(--h3-accent); cursor: pointer; transition: color 0.2s; }
.ap-reset:hover { color: #6fdbe0; }

.ap-side > .ap-search { margin: 0; }
.ap-side .ap-search {
  width: auto; height: 48px; padding: 0 14px; border-radius: 14px; box-shadow: none; margin-inline: 20px;
  background: rgba(255, 255, 255, 0.06); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.ap-side > .ap-search { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-block: 0; margin-block: 0 16px; }
.ap-field { display: flex; flex-direction: column; gap: 10px; }
.ap-label { font-size: 13px; font-weight: 600; color: var(--h3-dim); }
.ap-side .ap-chips { justify-content: flex-start; max-width: none; gap: 6px; }
.ap-side .ap-chips .apt-filter-pill { min-height: 32px; padding: 0 12px; font-size: 12.5px; }

.ap-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--h3-line); }
.ap-seg button {
  height: 34px; border: 0; border-radius: 9px; background: none; color: var(--h3-dim);
  font: inherit; font-size: 13px; cursor: pointer; transition: color 0.2s, background 0.2s;
}
.ap-seg button:hover { color: var(--h3-ink); }
.ap-seg button.active { color: var(--h3-accent); background: rgba(79, 203, 209, 0.16); }

.ap-check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--h3-dim); cursor: pointer; }
.ap-check input { width: 18px; height: 18px; accent-color: #4fcbd1; flex: none; margin: 0; }

.ap-select {
  appearance: none; -webkit-appearance: none; height: 44px; padding: 0 14px 0 36px; border-radius: 12px; border: 1px solid var(--h3-line);
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa7ad' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--h3-ink); font: inherit; font-size: 14px; cursor: pointer;
}
.ap-select:focus-visible { outline: 2px solid var(--h3-accent); outline-offset: 2px; }
.ap-select option { color: #111; }

.ap-side-foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--h3-dim); }
.ap-side-foot b { min-width: 34px; height: 28px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--h3-accent); background: rgba(79, 203, 209, 0.12); }

/* کارت پزشک: بالا هویت، وسط اطلاعات، پایین دکمه‌ها */
.ap-grid { grid-template-columns: 1fr; gap: 14px; }
.ap-card { flex-direction: column; gap: 0; padding: 0; border-radius: 22px; overflow: hidden; }
.ap-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.ap-av { width: 72px; height: 72px; border-radius: 18px; }
.ap-head { gap: 14px; }
.ap-name { font-size: 18px; }
.ap-spec { font-size: 14px; }
.ap-sub { font-size: 12.5px; }
.ap-meta { padding-top: 14px; flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }
.ap-meta li { font-size: 13.5px; }
.ap-actions {
  margin: 0; padding: 14px 22px; flex-direction: row; justify-content: flex-start; gap: 10px;
  border-top: 1px solid var(--h3-line); background: rgba(255, 255, 255, 0.03);
}
.ap-actions .h3-btn { min-height: 44px; width: auto; }
.ap-actions .h3-btn--main { flex: none; min-width: 170px; justify-content: center; }
.ap-call { width: 44px !important; flex: none; }

@media (max-width: 1000px) {
  .ap-layout { grid-template-columns: 1fr; }
  .ap-side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .h3-inner main { padding-top: 84px; }
  .ap-body { padding: 16px; }
  .ap-actions { padding: 12px 16px; }
  .ap-actions .h3-btn--main { flex: 1; }
  .ap-av { width: 60px; height: 60px; }
  .ap-name { font-size: 16px; }
  .ap-meta { flex-direction: column; gap: 8px; }
}

/* ══ پنل جستجوی پیشرفته: فشرده، بدون اسکرول در دسکتاپ؛ برگهٔ پایین در موبایل ══ */
.ap-side { position: static; max-height: none; overflow: visible; }
.ap-side > * { padding: 12px 16px; }
.ap-side > .ap-search { margin: 0 16px 12px; padding: 0 14px; height: 44px; }
.ap-side-head { padding-block: 14px 12px; }
.ap-side-head h1 { font-size: 15px; }
.ap-field { gap: 8px; }
.ap-label { font-size: 12px; }
.ap-native { display: none !important; }
.ap-mbar, .ap-sheet-backdrop, .ap-sheet-x, .ap-apply-wrap { display: none; }
.ap-chips:empty { display: none; }
.ap-side .ap-chips { margin: 0; }

/* سلکت‌باکس شیشه‌ای */
.ap-dd { position: relative; }
.ap-dd-btn {
  width: 100%; height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 12px; border: 1px solid var(--h3-line); background: rgba(255, 255, 255, 0.06); color: var(--h3-ink);
  font: inherit; font-size: 13.5px; cursor: pointer; text-align: right; transition: border-color .2s, background .2s;
}
.ap-dd-btn:hover { border-color: rgba(79, 203, 209, 0.4); background: rgba(255, 255, 255, 0.09); }
.ap-dd.open .ap-dd-btn { border-color: rgba(79, 203, 209, 0.6); }
.ap-dd-btn:focus-visible { outline: 2px solid var(--h3-accent); outline-offset: 2px; }
.ap-dd-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-dd-btn > svg { width: 15px; height: 15px; flex: none; color: var(--h3-faint); transition: transform .2s; }
.ap-dd.open .ap-dd-btn > svg { transform: rotate(180deg); color: var(--h3-accent); }
.ap-dd-list {
  position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  max-height: 264px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(165deg, rgba(30, 52, 62, 0.98), rgba(16, 32, 40, 0.98));
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.ap-dd-list[hidden] { display: none; }
.ap-dd.up .ap-dd-list { top: auto; bottom: calc(100% + 6px); }
.ap-dd-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 12px;
  border-radius: 10px; font-size: 13.5px; color: var(--h3-dim); cursor: pointer; transition: background .15s, color .15s;
}
.ap-dd-list li:hover { background: rgba(255, 255, 255, 0.08); color: var(--h3-ink); }
.ap-dd-list li svg { width: 14px; height: 14px; flex: none; opacity: 0; color: var(--h3-accent); }
.ap-dd-list li.active { color: var(--h3-accent); background: rgba(79, 203, 209, 0.12); }
.ap-dd-list li.active svg { opacity: 1; }

/* چک‌باکس دایره‌ای */
.ap-check { position: relative; gap: 10px; min-height: 44px; }
.ap-check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; inset-inline-start: 16px; cursor: pointer; }
.ap-check-dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.05); color: #0b2a33; transition: background .2s, border-color .2s;
}
.ap-check-dot svg { width: 13px; height: 13px; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.ap-check:hover .ap-check-dot { border-color: rgba(79, 203, 209, 0.7); }
.ap-check input:checked + .ap-check-dot { background: #4fcbd1; border-color: #4fcbd1; }
.ap-check input:checked + .ap-check-dot svg { opacity: 1; transform: none; }
.ap-check input:focus-visible + .ap-check-dot { outline: 2px solid var(--h3-accent); outline-offset: 2px; }

/* آیکون جای‌خالی پزشک بدون عکس */
.ap-ph { width: 54%; height: 54%; color: var(--h3-accent); }
#aptModalDocAvatar .ap-ph { width: 24px; height: 24px; }

/* موبایل/تبلت: جستجو + دکمهٔ فیلتر؛ فیلترها در برگهٔ پایین */
@media (max-width: 1000px) {
  .ap-mbar { display: flex; align-items: center; gap: 10px; }
  .ap-search--m { flex: 1; min-width: 0; width: auto; height: 50px; padding: 0 14px; border-radius: 16px; }
  .ap-filter-btn {
    position: relative; flex: none; height: 50px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
    border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--h3-ink); font: inherit; font-size: 14px; cursor: pointer;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  }
  .ap-filter-btn svg { width: 18px; height: 18px; color: var(--h3-accent); }
  .ap-filter-btn i {
    position: absolute; top: -6px; inset-inline-start: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: #0b2a33; background: #4fcbd1;
  }
  .ap-filter-btn i[hidden] { display: none; }

  .ap-sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 79; background: rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.ap-sheet-open .ap-sheet-backdrop { opacity: 1; pointer-events: auto; }
  .ap-side {
    position: fixed; z-index: 80; inset-inline: 0; bottom: 0; top: auto; max-height: 88dvh; overflow-y: auto; border-radius: 24px 24px 0 0;
    background: linear-gradient(165deg, rgba(26, 46, 56, 0.99), rgba(12, 26, 33, 0.99)); -webkit-backdrop-filter: none; backdrop-filter: none;
    transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.25, .8, .25, 1), visibility 0s .3s;
    scrollbar-width: thin; overscroll-behavior: contain;
  }
  .ap-side.is-open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.25, .8, .25, 1); }
  .ap-side > .ap-search { display: none; }
  .ap-side-head { position: sticky; top: 0; z-index: 2; background: inherit; }
  .ap-sheet-x { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--h3-ink); cursor: pointer; }
  .ap-sheet-x svg { width: 16px; height: 16px; }
  .ap-side-head { gap: 8px; }
  .ap-side-head h1 { margin-inline-end: auto; }
  .ap-apply-wrap { display: block; position: sticky; bottom: 0; background: inherit; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ap-apply { width: 100%; min-height: 46px; justify-content: center; }
  .ap-layout { gap: 14px; }
}
body.ap-sheet-open { overflow: hidden; }
@media (max-width: 1000px) {
  .ap-layout { grid-template-columns: minmax(0, 1fr); }
  .ap-mbar > * { min-width: 0; }
}
