/* --------------------------------------------------------------------------
   A2TDEV final focused fix: healthy notifications + realtime blog search
   Loaded after all broad responsive layers on purpose.
   -------------------------------------------------------------------------- */


.a2t-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:root {
  --a2t-focus-header-h: var(--a2t-repair-header-h, var(--a2t-header-height, 72px));
}

@media (max-width: 760px) {
  /* Notifications: stable scroll, no text stacking, readable cards. */
  .a2t-notification-modal[hidden] {
    display: none !important;
  }

  .a2t-notification-modal:not([hidden]) {
    position: fixed !important;
    inset: var(--a2t-focus-header-h) 0 0 0 !important;
    width: 100vw !important;
    height: calc((var(--a2t-vh, 1vh) * 100) - var(--a2t-focus-header-h)) !important;
    max-height: calc((var(--a2t-vh, 1vh) * 100) - var(--a2t-focus-header-h)) !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    padding: 12px clamp(14px, 4vw, 18px) max(14px, env(safe-area-inset-bottom, 0px)) !important;
    overflow: hidden !important;
    background: #ffffff !important;
    z-index: 2500 !important;
    isolation: isolate !important;
    overscroll-behavior: contain !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html[data-theme='dark'] .a2t-notification-modal:not([hidden]),
  body.dark-mode .a2t-notification-modal:not([hidden]),
  body.dark .a2t-notification-modal:not([hidden]) {
    background: #05070d !important;
  }

  .a2t-notification-dialog {
    position: relative !important;
    width: min(100%, 430px) !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    resize: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    contain: layout style !important;
    touch-action: pan-y !important;
  }

  .a2t-notification-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 6px 0 14px !important;
    border-bottom: 1px solid rgba(226, 232, 240, .95) !important;
    background: #ffffff !important;
    box-shadow: 0 16px 28px rgba(255, 255, 255, .96) !important;
  }

  html[data-theme='dark'] .a2t-notification-head,
  body.dark-mode .a2t-notification-head,
  body.dark .a2t-notification-head {
    background: #05070d !important;
    border-bottom-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 16px 28px rgba(5, 7, 13, .92) !important;
  }

  .a2t-notification-head .a2t-page-kicker {
    width: fit-content !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  .a2t-notification-head h2 {
    margin: 10px 0 0 !important;
    font-size: 19px !important;
    line-height: 1.15 !important;
    letter-spacing: -.04em !important;
  }

  .a2t-notification-head p {
    display: none !important;
  }

  .a2t-notification-actions {
    position: sticky !important;
    top: 6px !important;
    z-index: 11 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  .a2t-notification-actions strong {
    width: auto !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: #eef4ff !important;
    color: #2563ff !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
  }

  .a2t-notification-actions .a2t-icon-btn,
  [data-notification-close] {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(226, 232, 240, .95) !important;
    background: #ffffff !important;
    color: #020617 !important;
    box-shadow: 0 18px 36px rgba(15, 23, 42, .08) !important;
    padding: 0 !important;
  }

  .a2t-notification-list,
  .a2t-notification-empty {
    position: relative !important;
    z-index: 1 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 14px 0 max(30px, env(safe-area-inset-bottom, 0px)) !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  .a2t-notification-item,
  .a2t-notification-list > a.a2t-notification-item {
    position: relative !important;
    z-index: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 18px !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid #e4eaf3 !important;
    border-radius: 20px !important;
    background: #f8fbff !important;
    color: #07111f !important;
    text-decoration: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
  }

  html[data-theme='dark'] .a2t-notification-item,
  body.dark-mode .a2t-notification-item,
  body.dark .a2t-notification-item {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .18) !important;
    color: #f8fafc !important;
  }

  .a2t-notification-item.is-viewed {
    opacity: .58 !important;
  }

  .a2t-notification-icon {
    position: static !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    display: grid !important;
    place-items: center !important;
    align-self: start !important;
    margin: 0 !important;
    border-radius: 16px !important;
    background: #eef5ff !important;
    color: #2563ff !important;
    flex: 0 0 auto !important;
  }

  .a2t-notification-copy {
    position: static !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow: visible !important;
  }

  .a2t-notification-copy small,
  .a2t-notification-copy strong,
  .a2t-notification-copy span,
  .a2t-notification-copy em {
    position: static !important;
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .a2t-notification-copy small {
    order: 1 !important;
    color: #718096 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
  }

  .a2t-notification-copy strong {
    order: 2 !important;
    color: inherit !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    letter-spacing: -.015em !important;
    font-weight: 950 !important;
  }

  .a2t-notification-copy span {
    order: 3 !important;
    color: #475569 !important;
    font-size: 14px !important;
    line-height: 1.42 !important;
    font-weight: 720 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .a2t-notification-copy em {
    order: 4 !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-top: 4px !important;
    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: #eaf2ff !important;
    color: #155dfc !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-style: normal !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html[data-theme='dark'] .a2t-notification-copy span,
  body.dark-mode .a2t-notification-copy span,
  body.dark .a2t-notification-copy span {
    color: #cbd5e1 !important;
  }

  .a2t-notification-item > b {
    position: static !important;
    align-self: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    min-width: 18px !important;
    height: 32px !important;
    color: #94a3b8 !important;
    font-size: 28px !important;
    line-height: 1 !important;
  }

  /* Blog listing: remove old chip/search rail and use product-like realtime controls. */
  .sorting-filter-form,
  #myBtnContainer,
  .search-wrapper,
  .dot-sep {
    display: none !important;
  }

  .blog-container#a2t-blog-listing {
    width: min(100% - 28px, 430px) !important;
    margin-inline: auto !important;
    padding-top: 12px !important;
    overflow: visible !important;
  }

  .blog-container#a2t-blog-listing .blog-cta {
    margin: 10px 0 14px !important;
  }

  .blog-container#a2t-blog-listing .blog-cta h3 {
    margin-bottom: 10px !important;
    font-size: clamp(30px, 9vw, 38px) !important;
    line-height: 1 !important;
  }

  .blog-container#a2t-blog-listing .blog-cta p {
    display: block !important;
    -webkit-line-clamp: unset !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #475569 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
  }

  .a2t-blog-live-panel {
    margin: 0 0 18px !important;
    padding: 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06) !important;
  }

  html[data-theme='dark'] .a2t-blog-live-panel,
  body.dark-mode .a2t-blog-live-panel,
  body.dark .a2t-blog-live-panel {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28) !important;
  }

  .a2t-blog-live-search {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .a2t-blog-search-field {
    width: 100% !important;
    min-height: 54px !important;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
  }

  .a2t-blog-search-field i {
    color: #64748b !important;
    font-size: 15px !important;
  }

  .a2t-blog-search-field input,
  .a2t-blog-live-search select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 52px !important;
    height: 52px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #0f172a !important;
    font-size: 16px !important;
    font-weight: 750 !important;
    box-shadow: none !important;
  }

  .a2t-blog-live-search select {
    padding: 0 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    appearance: auto !important;
  }

  .a2t-blog-live-search button {
    width: 100% !important;
    min-height: 52px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: #155dfc !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    box-shadow: 0 16px 34px rgba(21, 93, 252, .24) !important;
  }

  html[data-theme='dark'] .a2t-blog-search-field,
  html[data-theme='dark'] .a2t-blog-live-search select,
  body.dark-mode .a2t-blog-search-field,
  body.dark-mode .a2t-blog-live-search select,
  body.dark .a2t-blog-search-field,
  body.dark .a2t-blog-live-search select {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, .18) !important;
  }

  html[data-theme='dark'] .a2t-blog-search-field input,
  html[data-theme='dark'] .a2t-blog-live-search select,
  body.dark-mode .a2t-blog-search-field input,
  body.dark-mode .a2t-blog-live-search select,
  body.dark .a2t-blog-search-field input,
  body.dark .a2t-blog-live-search select {
    color: #f8fafc !important;
  }

  .a2t-blog-filter-meta {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 10px !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
  }

  .a2t-blog-filter-meta strong,
  .a2t-blog-filter-meta em {
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: #eef4ff !important;
    color: #155dfc !important;
    font-style: normal !important;
    font-weight: 950 !important;
  }

  [data-blog-live-results] {
    position: relative !important;
    min-height: 140px !important;
  }

  [data-blog-live-form][data-loading] button,
  [data-blog-live-results][data-loading] {
    opacity: .72 !important;
    cursor: progress !important;
  }

  .blog-container .a2t-blog-live-grid.grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-top: 0 !important;
  }

  .a2t-blog-card-fallback {
    width: 100% !important;
    height: clamp(178px, 54vw, 230px) !important;
    display: grid !important;
    place-items: center !important;
    background: linear-gradient(135deg, #0f172a, #155dfc) !important;
    color: #ffffff !important;
    font-size: 32px !important;
    font-weight: 950 !important;
    letter-spacing: -.06em !important;
  }

  .a2t-blog-empty-state {
    display: grid !important;
    gap: 8px !important;
    padding: 22px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06) !important;
  }

  .a2t-blog-empty-state strong {
    color: #0f172a !important;
    font-size: 20px !important;
    font-weight: 950 !important;
  }

  .a2t-blog-empty-state span {
    color: #64748b !important;
    line-height: 1.5 !important;
  }

  .a2t-blog-empty-state a {
    width: fit-content !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    background: #155dfc !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 950 !important;
  }
}

@media (min-width: 761px) {
  .a2t-blog-live-panel {
    margin: 0 0 24px;
    padding: 12px;
    border: 1px solid var(--a2t-line, #e8ebf1);
    border-radius: 24px;
    background: var(--a2t-surface, #fff);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
  }

  .a2t-blog-live-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 260px) auto;
    gap: 10px;
    align-items: center;
  }

  .a2t-blog-search-field,
  .a2t-blog-live-search select {
    min-height: 52px;
    border: 1px solid var(--a2t-line, #e8ebf1);
    border-radius: 18px;
    background: var(--a2t-soft, #f8fafc);
  }

  .a2t-blog-search-field {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 14px;
  }

  .a2t-blog-search-field input,
  .a2t-blog-live-search select {
    min-height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    font-weight: 750;
  }

  .a2t-blog-live-search button {
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    background: #155dfc;
    color: #fff;
    padding: 0 24px;
    font-weight: 950;
  }

  .a2t-blog-filter-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    color: var(--a2t-muted, #64748b);
    font-size: 13px;
    font-weight: 800;
  }

  .a2t-blog-filter-meta strong,
  .a2t-blog-filter-meta em {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #155dfc;
    font-style: normal;
    font-weight: 950;
  }
}
