/* =========================================================
   AidenDesk Pro v20 — mobile contact, contrast and content QA
   ========================================================= */

.screen-reader-text {
  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;
}

body.contact-panel-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* The pre-call instruction belongs to the phone item, directly under the number. */
.phone-contact-guidance {
  display: block;
  margin-top: 4px;
  color: #384d69 !important;
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1.65;
  direction: rtl;
  text-align: right;
}

.footer-phone-link .phone-contact-guidance {
  max-width: 260px;
  color: #dce8f8 !important;
}

.contact-phone-card > div,
.contact-phone-card > span:last-child,
.project-phone > span,
.quick-contact > span {
  min-width: 0;
}

.contact-phone-card small[dir="ltr"],
.project-phone small[dir="ltr"],
.quick-contact small[dir="ltr"],
.footer-phone-link small[dir="ltr"] {
  display: block;
  width: max-content;
  max-width: 100%;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

/* Contact dialog: compact, scroll-safe and readable on phones. */
.floating-contact-panel {
  isolation: isolate;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.floating-contact-head {
  position: sticky;
  top: -16px;
  z-index: 3;
  margin: -16px -16px 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(38, 76, 124, .18);
  border-radius: 21px 21px 0 0;
  background: rgba(238, 244, 247, .96);
  backdrop-filter: blur(12px);
}

.floating-contact-grid > a {
  text-decoration: none;
}

.floating-contact-grid > a:focus-visible,
.contact-close:focus-visible,
.floating-contact-button:focus-visible {
  outline: 3px solid #f2c85f;
  outline-offset: 3px;
}

.floating-contact-grid > a.contact-phone-card {
  grid-column: 1 / -1;
  min-height: 88px;
  background: linear-gradient(145deg, #f2f7ff, #f5e8c4);
}

.floating-contact-grid .phone-contact-guidance {
  max-width: 300px;
}

/* Explicitly enforce side-card contrast over legacy/cache rules. */
.side-panel .side-cta,
.article-sidebar .side-cta,
.side-cta {
  border: 1px solid rgba(255,255,255,.28) !important;
  background: linear-gradient(145deg, #071a35 0%, #0d3f83 58%, #1b63b9 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 18px 38px rgba(7, 26, 53, .22) !important;
}

.side-panel .side-cta strong,
.article-sidebar .side-cta strong,
.side-cta strong,
.side-cta h2,
.side-cta h3 {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
}

.side-panel .side-cta p,
.article-sidebar .side-cta p,
.side-cta p {
  color: #e8f1ff !important;
  opacity: 1 !important;
}

.side-cta .button,
.side-cta .button-primary {
  border-color: #d8b653 !important;
  background: linear-gradient(135deg, #f4d67f, #c8942f) !important;
  color: #071a35 !important;
  box-shadow: none !important;
}

.side-cta .button:hover,
.side-cta .button:focus-visible {
  background: #fff0bd !important;
  color: #071a35 !important;
}

/* Long-form educational content. */
.article-content .article-deep-guide {
  margin-top: 34px;
  padding-top: 10px;
  border-top: 1px solid rgba(24, 92, 175, .18);
}

.article-content .article-deep-guide h2 {
  margin-top: 34px;
  scroll-margin-top: 130px;
}

.article-action-list,
.article-warning-list,
.article-control-list,
.article-related-reading {
  display: grid;
  gap: 10px;
  margin: 16px 0 25px;
  padding: 0;
  list-style: none;
  counter-reset: aid-step;
}

.article-action-list li,
.article-warning-list li,
.article-control-list li,
.article-related-reading li {
  position: relative;
  margin: 0;
  padding: 12px 46px 12px 14px;
  border: 1px solid #c6d7ed;
  border-radius: 13px;
  background: #f7fbff;
  color: #233b5b;
}

.article-action-list li {
  counter-increment: aid-step;
}

.article-action-list li::before {
  content: counter(aid-step);
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 9px;
  background: #1455a4;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.article-warning-list li {
  border-color: #e8cf9a;
  background: #fffaf0;
}

.article-warning-list li::before {
  content: "!";
  position: absolute;
  right: 14px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #b86a1e;
  color: #fff;
  font-weight: 900;
}

.article-control-list li::before {
  content: "✓";
  position: absolute;
  right: 14px;
  top: 11px;
  color: #126b59;
  font-size: 20px;
  font-weight: 900;
}

.article-related-reading li {
  padding-right: 40px;
  background: #f2f7ff;
}

.article-related-reading li::before {
  content: "↗";
  position: absolute;
  right: 14px;
  top: 11px;
  color: #1455a4;
  font-size: 17px;
  font-weight: 900;
}

.article-related-reading a {
  color: #0c4d99;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-inline-faq {
  display: grid;
  gap: 10px;
  margin: 16px 0 26px;
}

.article-inline-faq details {
  overflow: hidden;
  border: 1px solid #bfd1e8;
  border-radius: 14px;
  background: #fff;
}

.article-inline-faq summary {
  position: relative;
  padding: 15px 46px 15px 16px;
  color: #102e57;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.article-inline-faq summary::-webkit-details-marker { display: none; }
.article-inline-faq summary::before {
  content: "+";
  position: absolute;
  right: 15px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: #e7f0fd;
  color: #1455a4;
  font-size: 19px;
}
.article-inline-faq details[open] summary::before { content: "−"; }
.article-inline-faq details p {
  margin: 0;
  padding: 0 16px 16px;
  color: #405672;
}

.article-v20-summary,
.article-review-box {
  margin: 27px 0 0;
  padding: 17px 18px;
  border-right: 4px solid #c99a37;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4f8ff, #fff6dd);
  color: #253d5d;
}

.article-review-box {
  display: grid;
  gap: 4px;
  margin-top: 25px;
}
.article-review-box strong { color: #0b315f; }
.article-review-box small { color: #5a6e87; }

.article-meta .reading-time {
  white-space: nowrap;
}

/* Better card typography where cached legacy CSS made text too pale. */
.service-detail .side-title,
.side-panel .side-title,
.quick-contact strong {
  color: #0a2b56 !important;
}
.quick-contact .phone-contact-guidance { color: #405672 !important; }

@media (max-width: 700px) {
  body.contact-panel-open .floating-contact-button {
    opacity: 0;
    pointer-events: none;
  }

  .floating-contact-panel {
    top: max(10px, env(safe-area-inset-top));
    right: max(9px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(9px, env(safe-area-inset-left));
    width: auto;
    max-width: none !important;
    max-height: none !important;
    padding: 13px;
    border-radius: 20px;
  }

  .floating-contact-head {
    top: -13px;
    margin: -13px -13px 9px;
    padding: 13px;
    border-radius: 20px 20px 0 0;
  }

  .floating-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .floating-contact-grid > a {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 7px;
    min-height: 62px;
    padding: 8px;
  }

  .floating-contact-grid > a.contact-phone-card,
  .floating-contact-grid > a.contact-feedback-card {
    grid-column: 1 / -1 !important;
  }

  .floating-brand-icon svg,
  .floating-brand-icon img {
    width: 34px;
    height: 34px;
  }

  .floating-contact-grid strong { font-size: 10.5px; }
  .floating-contact-grid small { font-size: 9px; }
  .floating-contact-grid .phone-contact-guidance {
    margin-top: 3px;
    font-size: 9.5px !important;
    line-height: 1.55;
  }

  .article-content .article-deep-guide h2 { scroll-margin-top: 105px; }
  .article-action-list li,
  .article-warning-list li,
  .article-control-list li,
  .article-related-reading li { padding-left: 11px; }
}

@media (max-width: 350px) {
  .floating-contact-grid { grid-template-columns: 1fr !important; }
  .floating-contact-grid > a,
  .floating-contact-grid > a.contact-phone-card,
  .floating-contact-grid > a.contact-feedback-card { grid-column: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-contact-panel { scroll-behavior: auto; }
}

.article-v20-intro {
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid #bcd0e9;
  border-radius: 14px;
  background: linear-gradient(135deg, #f2f7ff, #fff7e4);
  color: #253e60;
}
.article-v20-intro strong { color: #0b4e99; }
