/*
 * DAVR 2026 visual system — browser, Telegram Mini App and responsive web.
 * Source-owned presentation layer. Existing React state, API calls and
 * accessibility semantics stay in charge; no display changes on auth/forms.
 *
 * Applied after legacy + PWA CSS. The desktop layout itself is in
 * desktop-marketplace.css. Use reversible CSS only.
 */
html.davr-desktop-browser-layout,
html.davr-mobile-layout {
  --davr-surface: #fff;
  --davr-canvas: #f5f8f7;
  --davr-elevated: #fbfdfc;
  --davr-line: #deebe6;
  --davr-brand: #098568;
  --davr-brand-deep: #086951;
  --davr-text: #1d302b;
  --davr-secondary-text: #647b71;
  --davr-soft-shadow: 0 8px 24px rgba(15, 60, 46, .055);
  --davr-elevated-shadow: 0 15px 36px rgba(15, 60, 46, .085);
  --davr-focus: #58bea2;
  color-scheme: light;
}

html.davr-desktop-browser-layout body,
html.davr-mobile-layout body {
  background: var(--davr-canvas);
  color: var(--davr-text);
  text-rendering: optimizeLegibility;
}
html.davr-desktop-browser-layout .shell,
html.davr-mobile-layout .shell {
  background: transparent;
}
html.davr-desktop-browser-layout :where(button, a, input, select, textarea):focus-visible,
html.davr-mobile-layout :where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--davr-focus);
  outline-offset: 3px;
}
html.davr-desktop-browser-layout :where(h1,h2,h3),
html.davr-mobile-layout :where(h1,h2,h3) {
  color: var(--davr-text);
  text-wrap: pretty;
}
html.davr-desktop-browser-layout .section-heading,
html.davr-mobile-layout .section-heading {
  gap: 12px;
  margin-bottom: 18px;
}
html.davr-desktop-browser-layout .section-heading > h2,
html.davr-mobile-layout .section-heading > h2 {
  font-weight: 820;
  letter-spacing: -.035em;
}
html.davr-desktop-browser-layout :where(.page-heading, .intro) h1,
html.davr-mobile-layout :where(.page-heading, .intro) h1 {
  letter-spacing: -.04em;
}
html.davr-desktop-browser-layout .primary,
html.davr-mobile-layout .primary {
  border-radius: 14px;
  background: linear-gradient(135deg, #0c9b7a, #08735e);
  color: #fff;
  font-weight: 760;
  box-shadow: 0 7px 16px rgba(8, 130, 97, .16);
  transition: box-shadow .17s ease, filter .17s ease, transform .17s ease;
}
html.davr-desktop-browser-layout .primary:hover,
html.davr-mobile-layout .primary:hover {
  background: linear-gradient(135deg, #099172, #08664f);
  box-shadow: 0 10px 22px rgba(8, 130, 97, .21);
}
html.davr-desktop-browser-layout .primary:active,
html.davr-mobile-layout .primary:active {
  transform: translateY(1px);
}
html.davr-desktop-browser-layout .outline,
html.davr-mobile-layout .outline {
  border-color: #d0e4db;
  border-radius: 13px;
  background: #fff;
  color: #0b755c;
  font-weight: 700;
}
html.davr-desktop-browser-layout .outline:hover,
html.davr-mobile-layout .outline:hover {
  border-color: #9bcdb9;
  background: #eff9f4;
}
html.davr-desktop-browser-layout :where(.search,.shop-search,.davr-mobile-shop-search),
html.davr-mobile-layout :where(.search,.shop-search,.davr-mobile-shop-search) {
  border: 1px solid var(--davr-line) !important;
  border-radius: 17px !important;
  background: #fff !important;
  box-shadow: var(--davr-soft-shadow);
}
html.davr-desktop-browser-layout :where(.search,.shop-search):focus-within,
html.davr-mobile-layout :where(.search,.shop-search,.davr-mobile-shop-search):focus-within {
  border-color: #83c8b1 !important;
  box-shadow: 0 0 0 4px rgba(9,133,104,.10);
}
html.davr-desktop-browser-layout :where(.filter-panel,.active-filter-summary),
html.davr-mobile-layout :where(.filter-panel,.active-filter-summary) {
  border-radius: 20px;
}
html.davr-desktop-browser-layout .filter-panel,
html.davr-mobile-layout .filter-panel {
  border: 1px solid var(--davr-line);
  background: #fff;
  box-shadow: var(--davr-soft-shadow);
}
html.davr-desktop-browser-layout :where(.picker, .form-grid input, .form-grid select, .form-grid textarea),
html.davr-mobile-layout :where(.picker, .form-grid input, .form-grid select, .form-grid textarea) {
  border-radius: 12px;
}
/* Panels, catalog and business cards */
html.davr-desktop-browser-layout :where(.store-card, .profile-shops, .profile-banner, .shop-banner),
html.davr-mobile-layout :where(.store-card, .profile-shops, .profile-banner, .shop-banner) {
  border-color: var(--davr-line);
  border-radius: 22px;
  box-shadow: var(--davr-soft-shadow);
}
html.davr-desktop-browser-layout :where(.store-card,.profile-shops,.profile-banner),
html.davr-mobile-layout :where(.store-card,.profile-shops,.profile-banner) {
  background: linear-gradient(145deg, #fff 0%, #f7fcf9 100%);
}
html.davr-desktop-browser-layout .store-card h2,
html.davr-mobile-layout .store-card h2 {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
html.davr-desktop-browser-layout .store-card .store-type,
html.davr-mobile-layout .store-card .store-type {
  border-radius: 8px;
  padding: 5px 10px;
  background: #e3f6ed;
  color: #0a725b;
}
html.davr-desktop-browser-layout .shop-banner,
html.davr-mobile-layout .shop-banner {
  background: linear-gradient(110deg, #f3faf6, #fff);
}
html.davr-desktop-browser-layout .shop-rating,
html.davr-mobile-layout .shop-rating {
  flex-wrap: wrap;
}
html.davr-desktop-browser-layout .shop-category-tabs,
html.davr-mobile-layout .shop-category-tabs {
  gap: 9px;
}
html.davr-desktop-browser-layout .shop-category-tabs button,
html.davr-mobile-layout .shop-category-tabs button {
  border: 1px solid var(--davr-line);
  border-radius: 12px;
  background: #fff;
  font-weight: 690;
}
html.davr-desktop-browser-layout .shop-category-tabs button.active,
html.davr-mobile-layout .shop-category-tabs button.active {
  border-color: #a4d9c5;
  background: #e7f8ee;
  color: #076d56;
}
html.davr-desktop-browser-layout .profile-actions button,
html.davr-mobile-layout .profile-actions button {
  border-radius: 17px;
  border-color: var(--davr-line);
  background: #fff;
}
html.davr-desktop-browser-layout :where(.own-row,.moderation-row,.management-user,.management-metrics article),
html.davr-mobile-layout :where(.own-row,.moderation-row,.management-user,.management-metrics article) {
  border: 1px solid var(--davr-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 17px rgba(14,69,49,.04);
}
html.davr-desktop-browser-layout :where(.own-row,.moderation-row) img,
html.davr-mobile-layout :where(.own-row,.moderation-row) img {
  border-radius: 14px;
}
html.davr-desktop-browser-layout .status,
html.davr-mobile-layout .status {
  border-radius: 9px;
  font-weight: 700;
}
html.davr-desktop-browser-layout :where(.stats > div, .seller-overview, .seller-metrics > div),
html.davr-mobile-layout :where(.stats > div, .seller-overview, .seller-metrics > div) {
  border: 1px solid var(--davr-line);
  border-radius: 20px;
  box-shadow: var(--davr-soft-shadow);
}
html.davr-desktop-browser-layout .seller-overview,
html.davr-mobile-layout .seller-overview {
  background: linear-gradient(130deg, #fff, #f2faf6);
}
html.davr-desktop-browser-layout .seller-metrics > div,
html.davr-mobile-layout .seller-metrics > div {
  background: #fff;
}
html.davr-desktop-browser-layout :where(.seller-metrics strong,.stats strong,.management-metrics strong),
html.davr-mobile-layout :where(.seller-metrics strong,.stats strong,.management-metrics strong) {
  color: #0a8066;
  font-variant-numeric: tabular-nums;
}
html.davr-desktop-browser-layout .management-tabs,
html.davr-mobile-layout .management-tabs {
  align-items: center;
}
html.davr-desktop-browser-layout .management-tabs button,
html.davr-mobile-layout .management-tabs button {
  border: 1px solid #dbeae3;
  border-radius: 999px;
  background: #fff;
  font-weight: 740;
}
html.davr-desktop-browser-layout .management-tabs button.active,
html.davr-mobile-layout .management-tabs button.active {
  border-color: #0a886a;
  background: #0a886a;
  color: #fff;
}
/* Listing details, posting, editing, filters and dialogs: palette only, no flow changes. */
html.davr-desktop-browser-layout :where(.detail-modal,.form-modal,.filter-modal,.category-modal),
html.davr-mobile-layout :where(.detail-modal,.form-modal,.filter-modal,.category-modal) {
  border: 1px solid rgba(221,238,229,.8);
  background: #f9fbfa !important;
  box-shadow: 0 26px 84px rgba(8,40,29,.21);
}
html.davr-desktop-browser-layout .modal-top,
html.davr-mobile-layout .modal-top {
  border-color: var(--davr-line);
}
html.davr-desktop-browser-layout :where(.detail-description-inline,.detail-specs,.seller),
html.davr-mobile-layout :where(.detail-description-inline,.detail-specs,.seller) {
  border: 1px solid var(--davr-line);
  border-radius: 19px;
  background: #fff;
  box-shadow: var(--davr-soft-shadow);
}
html.davr-desktop-browser-layout .detail-gallery-stage,
html.davr-mobile-layout .detail-gallery-stage {
  background: #edf4f0;
}
html.davr-desktop-browser-layout :where(.detail-spec-row,.detail-sale-terms > div),
html.davr-mobile-layout :where(.detail-spec-row,.detail-sale-terms > div) {
  border-bottom-color: #e7efeb;
}
html.davr-desktop-browser-layout .listing-form,
html.davr-mobile-layout .listing-form {
  min-width: 0;
}
html.davr-desktop-browser-layout :where(.listing-form input,.listing-form select,.listing-form textarea,.filter-panel input,.filter-panel select,.management-search input),
html.davr-mobile-layout :where(.listing-form input,.listing-form select,.listing-form textarea,.filter-panel input,.filter-panel select,.management-search input) {
  border-color: #d4e5dc;
  border-radius: 12px;
  background: #fff;
}
html.davr-desktop-browser-layout :where(.listing-form input,.listing-form select,.listing-form textarea):focus,
html.davr-mobile-layout :where(.listing-form input,.listing-form select,.listing-form textarea):focus {
  border-color: #7ec4a9;
}
html.davr-desktop-browser-layout .davr-posting-category-picker,
html.davr-mobile-layout .davr-posting-category-picker {
  border-radius: 14px;
  border-color: #cce5d9;
  background: #f3faf7;
}
html.davr-desktop-browser-layout .davr-desktop-posting-card {
  border: 1px solid #d8e8e0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 25px 65px rgba(15,44,31,.18);
}
html.davr-desktop-browser-layout .davr-posting-row {
  border-bottom-color: #e9f1ec;
}
html.davr-desktop-browser-layout .davr-posting-row:hover {
  background: #f4fbf8;
}
html.davr-desktop-browser-layout .category-modal,
html.davr-mobile-layout .category-modal {
  overflow: hidden;
}
html.davr-desktop-browser-layout .category-level > button,
html.davr-mobile-layout .category-level > button {
  transition: background-color .15s ease, color .15s ease;
}
html.davr-desktop-browser-layout .category-leaf,
html.davr-mobile-layout .category-leaf {
  border-color: #daeae1;
  border-radius: 14px;
  background: #fff;
}
/* Profile, support, notifications, mod tools — consistent accessible design. */
html.davr-desktop-browser-layout :where(.support-chat-modal,.davr-notification-card),
html.davr-mobile-layout :where(.support-chat-modal,.davr-notification-card) {
  border: 1px solid var(--davr-line);
  border-radius: 22px;
  box-shadow: var(--davr-elevated-shadow);
}
html.davr-desktop-browser-layout .davr-notification-item,
html.davr-mobile-layout .davr-notification-item {
  border-radius: 13px;
}
html.davr-desktop-browser-layout :where(.management-tools,.support-inbox,.profile-shops),
html.davr-mobile-layout :where(.management-tools,.support-inbox,.profile-shops) {
  min-width: 0;
}
html.davr-desktop-browser-layout .management-metrics article,
html.davr-mobile-layout .management-metrics article {
  background: linear-gradient(135deg, #fff, #f6fbf8);
}
html.davr-desktop-browser-layout .notice,
html.davr-mobile-layout .notice {
  border-radius: 16px;
}
html.davr-desktop-browser-layout .empty,
html.davr-mobile-layout .empty {
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--davr-soft-shadow);
}
/* Widescreen details: avoid tiny center columns, but keep modal max-width
   so reading lengths remain usable. */
@media (min-width: 1280px) {
  html.davr-desktop-browser-layout .shell > footer {
    width: auto;
    max-width: none;
    margin: 0 24px 0 256px;
  }
  html.davr-desktop-browser-layout .intro {
    gap: 24px;
  }
  html.davr-desktop-browser-layout .section-heading > h2 {
    font-size: clamp(23px, 1.7vw, 29px);
  }
  html.davr-desktop-browser-layout .shop-grid .store-card {
    min-height: 245px;
  }
}
/* Mobile web/Telegram: compact glass tabs inspired by navigation reference. */
@media (max-width: 700px) {
  html.davr-mobile-layout body {
    background: #f6f9f7;
  }
  html.davr-mobile-layout #root header {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid #e9f1ec !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
  }
  html.davr-mobile-layout #root header > .davr-mobile-profile {
    border: 1px solid #dbece3;
    background: #f1f9f5;
    color: #0d755d;
  }
  html.davr-mobile-layout .catalog-discovery {
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 8px 22px rgba(14,61,44,.055) !important;
  }
  html.davr-mobile-layout .catalog-discovery .search {
    min-height: 44px !important;
    border-radius: 14px !important;
    box-shadow: none;
  }
  html.davr-mobile-layout .davr-mobile-shortcuts .davr-category-symbol {
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(18,77,52,.07);
  }
  html.davr-mobile-layout .davr-mobile-city-row {
    border: 1px solid #e2eee7;
    border-radius: 13px;
    background: #fff;
  }
  html.davr-mobile-layout #root main {
    min-width: 0;
  }
  html.davr-mobile-layout .listing-grid {
    gap: 12px;
  }
  html.davr-mobile-layout .listing-grid > .card {
    min-width: 0;
    padding: 6px 6px 11px;
    border: 1px solid #e0ebe5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(15,55,41,.06);
  }
  html.davr-mobile-layout .listing-grid > .card .photo {
    border-radius: 13px;
    aspect-ratio: 1.06;
  }
  html.davr-mobile-layout .listing-grid > .card strong {
    margin: 9px 4px 4px;
    font-size: clamp(17px, 4.5vw, 21px);
    line-height: 1.3;
  }
  html.davr-mobile-layout .listing-grid > .card h3 {
    margin: 0 4px 5px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 720;
    overflow-wrap: anywhere;
  }
  html.davr-mobile-layout .listing-grid > .card p {
    margin-inline: 4px;
    color: #72837b;
    font-size: 11px;
    line-height: 1.5;
  }
  html.davr-mobile-layout :where(.shop-banner,.profile-banner,.profile-shops,.seller-overview) {
    border: 1px solid #dfede6;
    border-radius: 19px;
    background: #fff;
    box-shadow: var(--davr-soft-shadow);
  }
  html.davr-mobile-layout .seller-overview {
    padding: 16px;
  }
  html.davr-mobile-layout .seller-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  html.davr-mobile-layout .seller-metrics > div {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid #e1eee6;
    border-radius: 15px;
    box-shadow: none;
  }
  html.davr-mobile-layout .seller-metrics strong {
    font-size: 24px;
  }
  html.davr-mobile-layout .seller-metrics span {
    font-size: 12px;
    line-height: 1.3;
  }
  html.davr-mobile-layout .management-tabs button {
    border-radius: 12px;
    padding: 9px 12px;
  }
  html.davr-mobile-layout .davr-mobile-categories {
    background: #f8fbf9;
  }
  html.davr-mobile-layout .davr-mobile-category-header {
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid #e3eee8;
  }
  html.davr-mobile-layout .davr-mobile-category-search-wrap {
    border: 1px solid #d6e8dd;
    border-radius: 15px;
    background: #fff;
  }
  html.davr-mobile-layout .davr-mobile-category-row {
    border-bottom-color: #e7efe9;
    background: transparent;
  }
  html.davr-mobile-layout .davr-mobile-category-row:active {
    background: #eaf8f0;
  }
  html.davr-mobile-layout .davr-mobile-category-result {
    border: 1px solid #cce9db;
    border-radius: 17px;
    background: linear-gradient(130deg, #f0fbf5, #fff);
  }
  html.davr-mobile-layout .davr-mobile-tabbar {
    left: 8px;
    right: 8px;
    bottom: max(5px, env(safe-area-inset-bottom));
    height: 65px;
    align-items: center;
    padding: 5px 5px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 23px;
    background: rgba(23,36,39,.94);
    box-shadow: 0 12px 30px rgba(5,31,25,.22), inset 0 1px rgba(255,255,255,.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  html.davr-mobile-layout .davr-mobile-tab {
    height: 53px;
    gap: 3px;
    border-radius: 17px;
    color: #b8c9c7;
    font-size: 10px;
    font-weight: 650;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
  }
  html.davr-mobile-layout .davr-mobile-tab.is-active {
    background: rgba(36,179,148,.18);
    color: #80f1d7;
    text-shadow: 0 0 12px rgba(67,250,195,.27);
  }
  html.davr-mobile-layout .davr-mobile-tab > svg {
    width: 22px;
    height: 22px;
  }
  html.davr-mobile-layout .davr-mobile-tab.is-post {
    color: #ecfffa;
    transform: none;
  }
  html.davr-mobile-layout .davr-mobile-post-icon {
    width: 41px;
    height: 34px;
    border-radius: 13px;
    background: linear-gradient(135deg, #11b994, #087c68);
    box-shadow: 0 4px 13px rgba(13,191,147,.28);
  }
}
@media (max-width: 350px) {
  html.davr-mobile-layout .davr-mobile-tab {
    font-size: 9px;
  }
  html.davr-mobile-layout .davr-mobile-tabbar {
    left: 4px;
    right: 4px;
    gap: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.davr-desktop-browser-layout :where(.primary,.outline,.management-tabs button,.category-level > button),
  html.davr-mobile-layout :where(.primary,.outline,.management-tabs button,.davr-mobile-tab,.category-level > button) {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
