/* ==========================================================================
   DISCOUNT-CARDS.RU — публичная часть
   ========================================================================== */

:root {
  --brand: #6d28d9;
  --brand-600: #7c3aed;
  --brand-100: #ede9fe;
  --accent: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --border: #e5e7eb;
  --text: #16161d;
  --muted: #6b7280;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 16, 29, .06), 0 8px 24px rgba(16, 16, 29, .06);
  --shadow-lg: 0 12px 40px rgba(16, 16, 29, .12);
  --wrap: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .95em;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.plain { list-style: none; margin: 0; padding: 0; }

/* !important обязателен: общее правило для полей формы ниже задаёт
   input[type="text"] { width: 100% }, и по специфичности оно перебивает
   этот класс — honeypot в форме подвала растягивался на всю ширину. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  margin: -1px !important; padding: 0 !important;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; border-radius: 4px; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px; flex-wrap: wrap;
  /* Вертикальные поля нужны только когда шапка переносится на несколько
     строк (мобильная раскладка): без них логотип прижимался к самому верху
     экрана, потому что min-height перестаёт работать, как только контент
     выше неё. На широком экране высоту по-прежнему задаёт min-height. */
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 10px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-weight: 800;
}

.header-search { display: flex; flex: 1 1 260px; max-width: 460px; gap: 8px; }
.header-search input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .95rem;
}
.header-search button {
  padding: 10px 18px; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer;
}
.header-search button:hover { background: var(--brand-600); }

.header-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.header-nav a { color: var(--text); font-weight: 500; font-size: .95rem; }
.header-nav .btn { color: #fff; }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 6px 18px rgba(109, 40, 217, .3); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .875rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-copy {
  background: var(--brand-100); color: var(--brand-600);
  border: 0; border-radius: var(--radius-sm);
  padding: 8px 14px; font-weight: 600; font-size: .875rem; cursor: pointer;
}
.btn-copy:hover { background: var(--brand); color: #fff; }
.btn-copy.copied { background: var(--success); color: #fff; }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(900px 400px at 12% -10%, rgba(124, 58, 237, .22), transparent 60%),
    radial-gradient(700px 380px at 88% 0%, rgba(245, 158, 11, .18), transparent 55%);
  padding: clamp(36px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--border);
}

.hero-inner { display: grid; grid-template-columns: 1.35fr .85fr; gap: 40px; align-items: center; }
.hero-text h1 { margin-bottom: .3em; }
.lead { font-size: 1.15rem; color: var(--muted); }

.hero-search { display: flex; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.hero-search input {
  flex: 1 1 280px; padding: 15px 20px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}

.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 0; }
.hero-stats dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero-stats dd { margin: 2px 0 0; font-size: 1.65rem; font-weight: 800; }

.hero-channels {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.hero-channels h2 { font-size: 1.05rem; margin-bottom: 14px; }

.channel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.channel a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent; transition: border-color .15s ease, transform .12s ease;
}
.channel a:hover { text-decoration: none; border-color: var(--brand); transform: translateX(2px); }
.channel-icon {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--brand-100);
}
/* Загруженная иконка канала занимает весь квадрат значка */
.channel-icon-img { display: block; object-fit: cover; background: var(--surface-2); }
.channel-telegram .channel-icon { background: #e3f2fd; }
.channel-vk .channel-icon { background: #e7edf7; }
.channel-max .channel-icon { background: #eef7ec; }
.channel-info { display: flex; flex-direction: column; min-width: 0; }
.channel-title { font-weight: 600; }
.channel-sub { font-size: .82rem; color: var(--muted); }

/* ---------- Секции ---------- */

.section { padding: clamp(32px, 5vw, 56px) 0; }
.section-inner { margin-top: 44px; }
.section-head { margin-bottom: 24px; }
.section-head h2, .section-head h1 { margin-bottom: 4px; }

.section-cta { background: var(--surface); border-top: 1px solid var(--border); }

.cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px 40px; flex-wrap: wrap;
}
.cta-text { flex: 1 1 420px; min-width: 0; }
.cta-text > :last-child { margin-bottom: 0; }

.cta-actions {
  flex: 0 1 auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 10px; text-align: right;
}
.cta-actions > p { margin: 0; max-width: 34ch; }

/* ---------- Сетка карточек ---------- */

.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.promo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-title a { color: var(--text); }
.card-shop { margin: 0; color: var(--muted); font-size: .9rem; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .01em;
}
.badge-discount { background: var(--brand); color: #fff; }
.badge-lg { font-size: .95rem; padding: 6px 14px; }
.badge-hot { background: #fff1e6; color: #b45309; }
.badge-star { background: #fef3c7; color: #92400e; }

.promo-code {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border);
}
.promo-code code { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; word-break: break-all; }
.promo-code-lg { padding: 16px; margin: 20px 0; flex-wrap: wrap; }
.promo-code-lg code { font-size: 1.5rem; }
.promo-code-label { flex-basis: 100%; font-size: .8rem; color: var(--muted); }

/* Согласие под формой и страница документов */
.check-consent { align-items: flex-start; margin: 4px 0 18px; }
.check-consent span { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.check-consent a { color: var(--brand-600); }

.legal-page article + .legal-block { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.legal-page p { line-height: 1.7; }

/* Бонусные баллы — вместо блока с кодом */
.promo-kind {
  margin: 12px 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted);
  font-size: .9rem;
}

.card-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-lg .chip { padding: 9px 16px; font-size: .95rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: .82rem;
}
.chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-600); }
.chip-brand { background: var(--brand-100); border-color: transparent; }
.chip-count { color: var(--muted); font-size: .78em; }

.card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.card-actions.center { justify-content: center; }

.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }

.load-more-wrap,
.lazy-more { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
.lazy-more .btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Фильтры ---------- */

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 16px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.filters select, .filters input {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: .92rem; max-width: 100%;
}
.filters-search { flex: 1 1 240px; }

/* ---------- Страница скидки ---------- */

.breadcrumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs .current { color: var(--text); }

.promo-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.promo-shop { color: var(--muted); }
.promo-image { border-radius: var(--radius); margin: 20px 0; width: 100%; }
.promo-block { margin-top: 28px; }
.promo-block h2 { font-size: 1.15rem; }

.info-card { padding: 20px; gap: 0; }
.info-card h2 { font-size: 1.05rem; }
.info-list { margin: 0; display: grid; gap: 4px; }
.info-list dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 12px; }
.info-list dd { margin: 0; }

.delivery-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.delivery-list li:last-child { border-bottom: 0; }
.tag { font-size: .7rem; background: var(--brand-100); color: var(--brand-600); padding: 2px 8px; border-radius: 999px; }

/* ---------- Формы ---------- */

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

fieldset { border: 0; padding: 0; margin: 0 0 28px; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 0 12px; }

.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 600; font-size: .9rem; }
.form-row small { color: var(--muted); font-size: .8rem; }
/* Скрытое поле кода (бонусные баллы) — display:flex перебивает атрибут hidden */
.form-row[hidden] { display: none; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input:not([type]), input[type="text"], input[type="search"], input[type="url"], input[type="email"],
input[type="password"], input[type="number"], input[type="tel"], input[type="datetime-local"],
input[type="date"], input[type="time"], input[type="file"],
select, textarea {
  width: 100%; padding: 11px 14px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 90px; }
select[multiple] { padding: 6px; }

.check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin-top: 10px; }

/* ---------- Поле множественного выбора с поиском ---------- */

.mp { position: relative; }
/* Без JS остаётся обычный <select multiple>; с JS его подменяет поле с поиском. */
.js .mp-native,
.mp-native-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mp-control {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  width: 100%; min-height: 46px; padding: 7px 10px; cursor: text;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mp.is-open .mp-control { border-color: var(--brand); }

.mp-input {
  flex: 1 1 180px; min-width: 140px;
  border: 0 !important; background: transparent !important;
  padding: 4px 2px !important; font: inherit; font-size: .95rem; color: var(--text);
  outline: none;
}

.mp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 11px; border-radius: 999px;
  background: var(--brand-100); color: var(--brand-600);
  font-size: .86rem; font-weight: 600; line-height: 1.3; max-width: 100%;
}
.mp-chip-x {
  border: 0; background: rgba(0, 0, 0, .08); color: inherit; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; line-height: 1;
  font-size: .95rem; display: grid; place-items: center; padding: 0;
}
.mp-chip-x:hover { background: rgba(0, 0, 0, .18); }

.mp-menu {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 300px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.mp-opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; font-size: .92rem;
}
.mp-opt:hover, .mp-opt.is-active { background: var(--surface-2); }
.mp-opt.is-picked { color: var(--brand-600); font-weight: 600; }
.mp-opt.is-picked::after { content: '¹3'; float: right; }
.mp-group {
  padding: 10px 12px 4px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.mp-none { padding: 10px 12px; color: var(--muted); font-size: .88rem; }

.mp-add {
  margin-top: 4px; border-top: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--brand-600); font-weight: 600;
}
.mp-add:disabled { opacity: .6; cursor: progress; }
.mp-add-error { color: var(--danger); font-weight: 500; }

.mp-footer { display: none; gap: 10px; align-items: center; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.mp-footer.is-on { display: flex; }
.mp-clear {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--brand); font: inherit; font-size: .8rem; text-decoration: underline;
}

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
/* Комментарий продавца модератору — только в админке */
.alert-note { background: #fef9c3; color: #713f12; }
.alert-note p { margin: 6px 0 0; white-space: pre-wrap; }

.success-card { padding: 40px; align-items: center; text-align: center; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--success); color: #fff; font-size: 2rem; margin-bottom: 16px;
}

.contact-form { display: grid; gap: 8px; }
.contact-form input, .contact-form textarea { font-size: .9rem; }

/* Ответ формы обращения: и через fetch, и флешем после обычной отправки */
.form-note {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; line-height: 1.4;
}
.form-note-ok { background: rgba(22, 163, 74, .12); color: var(--success); }
.form-note-error { background: rgba(220, 38, 38, .12); color: var(--danger); }

.big-404 { font-size: clamp(4rem, 18vw, 9rem); margin: 0; background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Пагинация ---------- */

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page {
  min-width: 42px; padding: 9px 14px; text-align: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .92rem;
}
.page:hover { border-color: var(--brand); text-decoration: none; }
.page-current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.page-gap { padding: 9px 4px; color: var(--muted); }

/* ---------- Подвал ---------- */

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 32px; }
.footer-grid h3 { font-size: .95rem; }
.footer-grid li { margin-bottom: 6px; }
.logo-footer { margin-bottom: 12px; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; margin-top: 32px; border-top: 1px solid var(--border); font-size: .82rem;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
  .promo-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .header-nav {
    display: none; width: 100%; flex-direction: column;
    align-items: stretch; gap: 10px; padding-bottom: 14px;
  }
  .header-nav.open { display: flex; }
  .burger { display: block; margin-left: auto; order: 2; }
  /* Строка поиска переезжает под логотип: отступ снизу даёт уже .header-inner */
  .header-search { order: 3; width: 100%; max-width: none; flex: 1 1 100%; }
  /* Логотип и поиск стоят вплотную друг к другу — межстрочный зазор меньше
     бокового, иначе шапка занимала бы пол-экрана */
  .header-inner { row-gap: 12px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  /* колонка: главная ось вертикальная, поэтому flex-basis сбрасываем —
     иначе 420px из .cta-text превратились бы в высоту блока */
  .cta { flex-direction: column; align-items: stretch; }
  .cta-text { flex: 0 1 auto; }
  .cta-actions { align-items: stretch; text-align: left; }
  .cta-actions .btn { width: 100%; }
  .cta-actions > p { max-width: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 18px; }
  .hero-stats dd { font-size: 1.35rem; }
}

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

/* ---------- Календарь для полей даты и времени ---------- */
/* Позиционируется фиксировано и живёт в <body>, чтобы его не обрезали
   таблицы с горизонтальной прокруткой. */
.dtp {
  position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 16px); padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.dtp[hidden] { display: none; }
.dtp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dtp-title { font-size: .95rem; }
.dtp-nav {
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.dtp-nav:hover { background: var(--surface-2); }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dtp-week { text-align: center; font-size: .72rem; color: var(--muted); padding-bottom: 4px; }
.dtp-day {
  padding: 6px 0; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: .85rem; border-radius: 8px; cursor: pointer;
}
.dtp-day:hover:not(:disabled) { background: var(--surface-2); }
.dtp-day.is-out { color: var(--muted); opacity: .55; }
.dtp-day.is-today { box-shadow: inset 0 0 0 1px var(--border); }
.dtp-day.is-sel { background: var(--brand); color: #fff; }
.dtp-day:disabled { opacity: .3; cursor: not-allowed; }
.dtp-time { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .85rem; }
.dtp-time select { width: auto; padding: 4px 6px; }
.dtp-time .btn { margin-left: auto; }
/* Три кнопки в ряд: внутри окна они компактнее обычных btn-sm, а если
   всё-таки не помещаются (крупный шрифт у пользователя) — переносятся. */
.dtp .btn { padding: 7px 12px; font-size: .8rem; }
.dtp-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dtp-actions [data-dtp-clear] { margin-right: auto; }
