/*
 * AREXMODS PRODUCT VISUAL FINISH v1.6.2-r1
 * Target: approved reference screenshot.
 * Replaces v1.5.5 in layout. v1.5.0-r2 remains as the visual base.
 * Robust viewport sizing uses BODY flex; no hardcoded header subtraction.
 */

@media (min-width: 1280px) and (min-height: 680px) {
  html,
  body.am1417-resource-page {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page {
    display: flex !important;
    flex-direction: column !important;
  }

  body.am1417-resource-page > header {
    flex: 0 0 auto !important;
  }

  body.am1417-resource-page main {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 7px 0 8px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page footer {
    display: none !important;
  }

  body.am1417-resource-page .resource-pro-v071 {
    display: grid !important;
    grid-template-rows: 30px clamp(322px, 38vh, 352px) clamp(72px, 8.5vh, 84px) minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-content: stretch !important;
    gap: 8px !important;
    width: min(88vw, 1500px) !important;
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-breadcrumbs-v071 {
    grid-row: 1 !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    border-radius: 9px !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }

  /* ========================= HERO ========================= */
  body.am1417-resource-page .resource-hero-v071,
  body.am1417-resource-page .resource-hero-v071.section-block {
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(410px, 1.08fr) minmax(490px, 1.18fr) minmax(300px, .72fr) !important;
    grid-auto-rows: 100% !important;
    gap: 12px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.am1417-resource-page .resource-hero-media-v071,
  body.am1417-resource-page .resource-hero-copy-v071,
  body.am1417-resource-page .resource-action-top-v140 {
    width: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-hero-media-v071 {
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) clamp(58px, 18%, 64px) !important;
    gap: 5px !important;
    padding: 9px !important;
  }

  body.am1417-resource-page .resource-hero-media-v071 > img {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 11px !important;
  }

  body.am1417-resource-page .resource-hero-overlay-v071 {
    left: 14px !important;
    right: 14px !important;
    bottom: clamp(68px, 21%, 78px) !important;
  }

  body.am1417-resource-page :is(.resource-hero-thumbs-v143,.resource-hero-thumbs-v144) {
    height: 100% !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 58px !important;
    gap: 7px !important;
  }

  body.am1417-resource-page :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144,.resource-hero-more-v143,.resource-hero-more-v144) {
    height: 100% !important;
    border-radius: 9px !important;
  }

  /* Center card: typography and proportions closer to reference. */
  body.am1417-resource-page .resource-hero-copy-v071 {
    padding: 16px 18px !important;
  }

  body.am1417-resource-page .resource-kicker-v071 {
    margin: 0 0 8px !important;
    font-size: 12px !important;
  }

  body.am1417-resource-page .resource-hero-copy-v071 h1 {
    margin: 0 0 10px !important;
    font-size: clamp(27px, 1.7vw, 34px) !important;
    line-height: 1.04 !important;
  }

  body.am1417-resource-page .resource-lead-v071 {
    margin: 0 0 10px !important;
    font-size: 12px !important;
    line-height: 1.34 !important;
    -webkit-line-clamp: 3 !important;
  }

  body.am1417-resource-page .resource-author-v071 {
    width: max-content !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 0 10px !important;
    padding: 5px 8px !important;
    border-radius: 10px !important;
  }

  body.am1417-resource-page .resource-author-avatar-v071 {
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
  }

  body.am1417-resource-page .resource-author-v071 small { font-size: 8px !important; }
  body.am1417-resource-page .resource-author-v071 b { font-size: 10px !important; }

  body.am1417-resource-page .resource-metrics-v071 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: auto !important;
    padding-top: 8px !important;
  }

  body.am1417-resource-page .resource-metrics-v071 > div {
    height: clamp(66px, 21%, 78px) !important;
    min-height: 66px !important;
    padding: 9px 6px !important;
    border-radius: 10px !important;
  }

  body.am1417-resource-page .resource-metrics-v071 strong { font-size: 19px !important; }
  body.am1417-resource-page .resource-metrics-v071 span { margin-top: 5px !important; font-size: 8px !important; }

  /* Right action panel */
  body.am1417-resource-page .resource-action-top-v140 {
    display: flex !important;
    flex-direction: column !important;
    padding: 17px 15px !important;
    background-image:
      radial-gradient(circle at 50% 105%, rgba(255,122,0,.09), transparent 38%),
      linear-gradient(180deg, rgba(255,255,255,.015), transparent 46%) !important;
  }

  body.am1417-resource-page .resource-price-line-v071 {
    margin: 0 0 13px !important;
    padding: 0 0 12px !important;
  }

  body.am1417-resource-page .resource-price-line-v071 span { font-size: 10px !important; }
  body.am1417-resource-page .resource-price-line-v071 strong {
    font-size: clamp(34px, 2.2vw, 42px) !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 {
    gap: 9px !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn) {
    min-height: 44px !important;
    height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
  }

  body.am1417-resource-page .resource-safe-v071,
  body.am1417-resource-page .commerce-license-note-v080,
  body.am1417-resource-page .unified-balance-v082 {
    max-height: 42px !important;
    margin-top: 8px !important;
    padding: 7px 8px !important;
    border-radius: 9px !important;
    font-size: 7.8px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }


  /*
   * Reference cleanup:
   * current product markup has one extra desktop action ("Уведомлять об обновлениях")
   * and the Marketplace verification strip. They are not present in the approved
   * reference and together exceed the available CTA height. Hide them visually
   * on desktop only; no backend/JS/data is removed.
   */
  body.am1417-resource-page .resource-primary-actions-v071 > :nth-child(4) {
    display: none !important;
  }

  body.am1417-resource-page .resource-safe-v071 {
    display: none !important;
  }

  /* Keep the three reference CTA buttons comfortably inside the card. */
  body.am1417-resource-page .resource-primary-actions-v071 {
    gap: 8px !important;
    margin-top: 2px !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn) {
    min-height: 44px !important;
    height: 44px !important;
  }

  /* ========================= STATUS CARDS ========================= */
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) {
    grid-row: 3 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > * {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr !important;
    column-gap: 10px !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 13px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *::before {
    grid-row: 1 / span 2 !important;
    content: "◆" !important;
    display: grid !important;
    place-items: center !important;
    width: 40px !important;
    height: 40px !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 11px !important;
    background: rgba(255,255,255,.035) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
  }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(1)::before { content: "◆" !important; color: #ff7a00 !important; }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(2)::before { content: "◷" !important; color: #27b9ff !important; }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(3)::before { content: "✓" !important; color: #60edb1 !important; }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(4)::before { content: "●" !important; color: #27b9ff !important; }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) :is(h2,h3,h4,strong,b) {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.05 !important;
  }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) :is(p,span,small) {
    font-size: 10px !important;
    line-height: 1.13 !important;
  }

  /* ========================= LOWER AREA ========================= */
  body.am1417-resource-page .resource-layout-v071 {
    grid-row: 4 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 1fr) 102px !important;
    align-content: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-main-v071 {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-tabs-shell-v071 {
    display: grid !important;
    grid-template-rows: 44px minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-tabs-v071 {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 5px 9px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.am1417-resource-page .resource-tabs-v071 button {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 11px 0 28px !important;
    border-radius: 9px !important;
    font-size: 9px !important;
  }

  body.am1417-resource-page .resource-tab-panel-v071,
  body.am1417-resource-page [data-resource-panel]:not([data-resource-panel="description"]) {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 10px 12px !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
  }

  body.am1417-resource-page .resource-description-wide-v1417 {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 8px 10px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-summary-grid-wide-v1417,
  body.am1417-resource-page .resource-summary-about-wide-v1417 {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }

  body.am1417-resource-page .resource-summary-about-wide-v1417 {
    padding: 8px 10px !important;
    border-radius: 11px !important;
  }

  body.am1417-resource-page .resource-summary-title-v144 {
    min-height: 27px !important;
    margin-bottom: 5px !important;
  }

  body.am1417-resource-page .resource-summary-title-v144 h3 { font-size: 16px !important; }
  body.am1417-resource-page .resource-summary-title-v144 small { font-size: 7.5px !important; }

  body.am1417-resource-page .resource-about-wide-layout-v1417 {
    display: grid !important;
    grid-template-columns: minmax(0, 1.68fr) minmax(330px, .78fr) !important;
    gap: 8px !important;
    min-height: 0 !important;
  }

  body.am1417-resource-page .resource-about-wide-copy-v1417 {
    padding: 7px 9px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-about-wide-label-v1417 {
    margin-bottom: 4px !important;
    font-size: 8px !important;
  }

  body.am1417-resource-page .resource-about-wide-text-v1417 {
    font-size: 10.5px !important;
    line-height: 1.34 !important;
    -webkit-line-clamp: 4 !important;
  }

  body.am1417-resource-page .resource-about-facts-wide-v1417,
  body.am1417-resource-page .resource-about-facts-v149 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body.am1417-resource-page .resource-about-facts-wide-v1417 > div,
  body.am1417-resource-page .resource-about-facts-v149 > div {
    padding: 5px 6px !important;
    border-radius: 9px !important;
  }

  body.am1417-resource-page .resource-about-facts-wide-v1417 b,
  body.am1417-resource-page .resource-about-facts-v149 b { font-size: 9px !important; }

  body.am1417-resource-page .resource-about-facts-wide-v1417 small,
  body.am1417-resource-page .resource-about-facts-v149 small { margin-top: 2px !important; font-size: 6.4px !important; }


  body.am1417-resource-page .resource-source-row-v144,
  body.am1417-resource-page .resource-source-row-wide-v1417 {
    margin-top: 2px !important;
    padding-top: 2px !important;
  }

  body.am1417-resource-page .resource-video-inline-v144,
  body.am1417-resource-page .resource-related-v071 {
    display: none !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    grid-auto-rows: 100% !important;
    gap: 9px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .side-card {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 h3 {
    min-height: 20px !important;
    margin: 0 0 6px !important;
    font-size: 11px !important;
  }

  body.am1417-resource-page .resource-facts-v071 > div,
  body.am1417-resource-page .resource-access-v071 > div {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
  }

  body.am1417-resource-page .resource-facts-v071 p,
  body.am1417-resource-page .resource-access-v071 p {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
  }

  body.am1417-resource-page .resource-facts-v071 p b,
  body.am1417-resource-page .resource-access-v071 p b { font-size: 8.5px !important; }

  body.am1417-resource-page .resource-access-v071 :is(a,button,.btn) {
    height: 23px !important;
    min-height: 23px !important;
    margin-top: 4px !important;
    padding: 3px 7px !important;
    font-size: 7.5px !important;
  }

  body.am1417-resource-page .resource-compat-game-v071 {
    height: 42px !important;
    min-height: 42px !important;
    padding: 5px 7px !important;
    border-radius: 9px !important;
  }

  body.am1417-resource-page .resource-egg-list-v071 { margin-top: 4px !important; }
  body.am1417-resource-page .resource-egg-list-v071 span { padding: 2px 5px !important; font-size: 7px !important; }
}

/* Short desktop viewport: same composition, slightly reduced hero/status/bottom. */
@media (min-width: 1280px) and (min-height: 680px) and (max-height: 819px) {
  body.am1417-resource-page .resource-pro-v071 {
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: 22px 270px 58px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body.am1417-resource-page .resource-hero-copy-v071 h1 { font-size: 24px !important; }
  body.am1417-resource-page .resource-lead-v071 { font-size: 10px !important; }

  body.am1417-resource-page .resource-action-top-v140 { padding: 11px !important; }
  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn) {
    height: 34px !important;
    min-height: 34px !important;
    font-size: 9px !important;
  }

  body.am1417-resource-page .resource-layout-v071 {
    grid-template-rows: minmax(0, 1fr) 82px !important;
    gap: 6px !important;
  }

  body.am1417-resource-page .resource-tabs-shell-v071 {
    grid-template-rows: 34px minmax(0, 1fr) !important;
  }

  body.am1417-resource-page .resource-tabs-v071 {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
  }
}

/* Tablet/mobile: normal vertical flow. */
@media (max-width: 1279px), (max-height: 679px) {
  html,
  body.am1417-resource-page {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
  }

  body.am1417-resource-page {
    display: block !important;
  }

  body.am1417-resource-page main {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-top: 8px !important;
    overflow: visible !important;
  }

  body.am1417-resource-page footer {
    display: block !important;
  }

  body.am1417-resource-page .resource-pro-v071 {
    display: block !important;
    width: calc(100% - 20px) !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
/* =========================================================
   v1.6.1 DECORATIVE LAYER — approved AREX MODS kit language
   No geometry / DOM / JS changes.
   ========================================================= */
@media (min-width: 1280px) and (min-height: 680px) {

  body.am1417-resource-page {
    --am161-orange: #ff7a00;
    --am161-orange-soft: rgba(255,122,0,.18);
    --am161-blue: #26b9ff;
    --am161-blue-soft: rgba(38,185,255,.14);
    --am161-green: #59e7a8;
    --am161-line: rgba(74,126,159,.34);
    --am161-panel: linear-gradient(180deg, rgba(8,24,36,.965), rgba(5,17,27,.985));
    --am161-panel-soft: linear-gradient(180deg, rgba(10,30,43,.91), rgba(5,17,27,.965));
  }

  /* Page atmosphere: orange left / blue right, like bg-gradients + glow assets. */
  body.am1417-resource-page main {
    background:
      radial-gradient(58% 70% at 8% 42%, rgba(255,95,0,.075), transparent 67%),
      radial-gradient(58% 74% at 93% 44%, rgba(0,150,255,.075), transparent 68%) !important;
  }

  /* Core cards */
  body.am1417-resource-page .resource-hero-media-v071,
  body.am1417-resource-page .resource-hero-copy-v071,
  body.am1417-resource-page .resource-action-top-v140,
  body.am1417-resource-page .resource-tabs-shell-v071,
  body.am1417-resource-page .resource-sidebar-v071 > .side-card {
    background: var(--am161-panel) !important;
    border: 1px solid var(--am161-line) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      0 12px 30px rgba(0,0,0,.16) !important;
  }

  /* Orange / blue glow frames inspired by border-glow-orange / border-glow-blue. */
  body.am1417-resource-page .resource-hero-media-v071 {
    border-color: rgba(255,122,0,.52) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255,122,0,.045),
      0 0 24px rgba(255,102,0,.08),
      0 12px 30px rgba(0,0,0,.18) !important;
  }

  body.am1417-resource-page .resource-hero-copy-v071 {
    border-color: rgba(31,137,195,.42) !important;
    box-shadow:
      inset 0 0 0 1px rgba(38,185,255,.035),
      0 0 24px rgba(38,185,255,.055),
      0 12px 30px rgba(0,0,0,.18) !important;
  }

  body.am1417-resource-page .resource-action-top-v140 {
    border-color: rgba(255,122,0,.62) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255,122,0,.075),
      0 0 28px rgba(255,105,0,.11),
      0 12px 30px rgba(0,0,0,.2) !important;
  }

  /* Gallery */
  body.am1417-resource-page .resource-hero-media-v071 {
    background:
      linear-gradient(180deg, rgba(255,122,0,.025), transparent 38%),
      var(--am161-panel) !important;
  }

  body.am1417-resource-page .resource-hero-media-v071 > img {
    border: 1px solid rgba(108,147,173,.25) !important;
    background:
      linear-gradient(135deg, rgba(255,122,0,.05), transparent 38%),
      repeating-linear-gradient(135deg, #091722 0 14px, #0a1a26 14px 15px) !important;
    box-shadow: inset 0 0 36px rgba(0,0,0,.25) !important;
  }

  body.am1417-resource-page :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144,.resource-hero-more-v143,.resource-hero-more-v144) {
    border: 1px solid rgba(69,112,139,.44) !important;
    background-color: #06121c !important;
    box-shadow: inset 0 0 18px rgba(0,0,0,.25) !important;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease !important;
  }

  body.am1417-resource-page :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144):hover {
    border-color: rgba(255,122,0,.8) !important;
    box-shadow: 0 0 14px rgba(255,122,0,.16) !important;
    transform: translateY(-1px) !important;
  }

  /* Kicker + free badge visual hierarchy */
  body.am1417-resource-page .resource-kicker-v071 {
    color: #34c9ff !important;
    letter-spacing: .035em !important;
    text-shadow: 0 0 14px rgba(38,185,255,.2) !important;
  }

  body.am1417-resource-page .resource-price-line-v071 strong {
    color: #69efb2 !important;
    text-shadow: 0 0 22px rgba(89,231,168,.16) !important;
  }

  /* CTA buttons — match the kit's install/download/favorite language. */
  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn) {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-color: rgba(74,115,142,.45) !important;
    background: linear-gradient(180deg, rgba(12,31,44,.94), rgba(6,20,30,.98)) !important;
    color: #eef7fd !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 > :first-child {
    border-color: rgba(255,137,26,.92) !important;
    background: linear-gradient(135deg, #ff9d1d 0%, #ff6900 72%, #ff5700 100%) !important;
    color: #fff !important;
    font-weight: 900 !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.22),
      0 8px 22px rgba(255,101,0,.18) !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 > :first-child::before {
    content: "⚡" !important;
    color: #ffe06b !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 > :nth-child(2)::before {
    content: "↓" !important;
    color: #dceaf4 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 > :nth-child(3)::before {
    content: "♡" !important;
    color: #f6fbff !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn):hover {
    transform: translateY(-1px) !important;
    border-color: rgba(255,122,0,.65) !important;
    box-shadow: 0 0 18px rgba(255,122,0,.1) !important;
  }

  body.am1417-resource-page .resource-primary-actions-v071 > :first-child:hover {
    filter: brightness(1.07) !important;
    box-shadow: 0 9px 26px rgba(255,101,0,.26) !important;
  }

  /* Metrics: separate icon-like accent blocks using the kit palette. */
  body.am1417-resource-page .resource-metrics-v071 > div {
    position: relative !important;
    background: linear-gradient(180deg, rgba(8,26,39,.88), rgba(5,18,28,.94)) !important;
    border: 1px solid rgba(66,111,140,.35) !important;
  }

  body.am1417-resource-page .resource-metrics-v071 > div::before {
    display: block !important;
    margin: 0 auto 3px !important;
    color: #91b6ca !important;
    font-size: 12px !important;
    line-height: 1 !important;
    opacity: .92 !important;
  }
  body.am1417-resource-page .resource-metrics-v071 > div:nth-child(1)::before { content: "★" !important; color: #ff8b16 !important; }
  body.am1417-resource-page .resource-metrics-v071 > div:nth-child(2)::before { content: "⇩" !important; color: #64bdff !important; }
  body.am1417-resource-page .resource-metrics-v071 > div:nth-child(3)::before { content: "◉" !important; color: #86caff !important; }
  body.am1417-resource-page .resource-metrics-v071 > div:nth-child(4)::before { content: "◆" !important; color: #9cc9ef !important; }

  /* Status cards */
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > * {
    background: var(--am161-panel-soft) !important;
    border: 1px solid rgba(63,108,138,.35) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.022) !important;
  }

  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(1) {
    border-top-color: rgba(255,122,0,.58) !important;
  }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(2) {
    border-top-color: rgba(38,185,255,.45) !important;
  }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(3) {
    border-top-color: rgba(89,231,168,.48) !important;
  }
  body.am1417-resource-page .resource-hero-v071 + :not(.resource-layout-v071) > *:nth-child(4) {
    border-top-color: rgba(38,185,255,.42) !important;
  }

  /* Tabs */
  body.am1417-resource-page .resource-tabs-v071 {
    background: rgba(4,15,24,.74) !important;
    border-bottom: 1px solid rgba(62,108,136,.30) !important;
  }

  body.am1417-resource-page .resource-tabs-v071 button {
    color: #b6c8d5 !important;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease !important;
  }

  body.am1417-resource-page .resource-tabs-v071 button[aria-selected="true"],
  body.am1417-resource-page .resource-tabs-v071 button.active {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255,122,0,.16), rgba(255,122,0,.06)) !important;
    box-shadow:
      inset 0 -2px 0 #ff7a00,
      0 0 16px rgba(255,122,0,.08) !important;
  }

  /* About panel */
  body.am1417-resource-page .resource-summary-about-wide-v1417,
  body.am1417-resource-page .resource-about-wide-copy-v1417,
  body.am1417-resource-page .resource-about-facts-wide-v1417 > div,
  body.am1417-resource-page .resource-about-facts-v149 > div {
    background: linear-gradient(180deg, rgba(8,26,39,.88), rgba(5,18,28,.94)) !important;
    border: 1px solid rgba(63,108,138,.32) !important;
  }

  body.am1417-resource-page .resource-about-wide-label-v1417 {
    color: #ff9a24 !important;
    letter-spacing: .04em !important;
    font-weight: 900 !important;
  }

  /* Bottom cards: info orange, access green, compatibility blue. */
  body.am1417-resource-page .resource-sidebar-v071 > .side-card {
    position: relative !important;
    overflow: hidden !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .side-card::after {
    content: "" !important;
    pointer-events: none !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    opacity: .36 !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .resource-facts-v071 {
    border-top-color: rgba(255,122,0,.68) !important;
  }
  body.am1417-resource-page .resource-sidebar-v071 > .resource-facts-v071::after {
    background: radial-gradient(260px 70px at 0 0, rgba(255,122,0,.10), transparent 70%) !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .resource-access-v071 {
    border-top-color: rgba(89,231,168,.55) !important;
  }
  body.am1417-resource-page .resource-sidebar-v071 > .resource-access-v071::after {
    background: radial-gradient(260px 70px at 0 0, rgba(89,231,168,.08), transparent 70%) !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .resource-compat-v071 {
    border-top-color: rgba(38,185,255,.58) !important;
  }
  body.am1417-resource-page .resource-sidebar-v071 > .resource-compat-v071::after {
    background: radial-gradient(260px 70px at 0 0, rgba(38,185,255,.09), transparent 70%) !important;
  }

  /* Placeholder/empty preview treatment — remains behind real screenshots. */
  body.am1417-resource-page .resource-hero-media-v071 {
    background-image:
      linear-gradient(135deg, rgba(255,122,0,.035), transparent 38%),
      repeating-linear-gradient(135deg, rgba(255,122,0,.025) 0 1px, transparent 1px 18px),
      var(--am161-panel) !important;
  }

  body.am1417-resource-page .resource-hero-media-v071 img[src*="placeholder"],
  body.am1417-resource-page .resource-hero-media-v071 img[src=""],
  body.am1417-resource-page .resource-hero-media-v071 img:not([src]) {
    opacity: .82 !important;
    filter: saturate(.75) contrast(1.04) !important;
    border-color: rgba(255,122,0,.42) !important;
  }
}

/* Keep responsive/mobile geometry and interactions unchanged. */
/* =========================================================
   v1.6.2 VISUAL FINISH
   Geometry is intentionally unchanged from v1.6.1.
   ========================================================= */
@media (min-width: 1280px) and (min-height: 680px) {

  /* Stronger active gallery state without changing thumbnail geometry. */
  body.am1417-resource-page
  :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144).active,
  body.am1417-resource-page
  :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144)[aria-current="true"],
  body.am1417-resource-page
  :is(.resource-hero-thumb-v143,.resource-hero-thumb-v144)[data-active="true"] {
    border-color: rgba(255,135,18,.96) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255,145,35,.16),
      0 0 0 1px rgba(255,122,0,.10),
      0 0 18px rgba(255,122,0,.22) !important;
    filter: saturate(1.04) brightness(1.035) !important;
  }

  /* Fallback for galleries whose JS does not expose an active attribute. */
  body.am1417-resource-page
  :is(.resource-hero-thumbs-v143,.resource-hero-thumbs-v144)
  :not(:has(.active,[aria-current="true"],[data-active="true"]))
  > :first-child {
    border-color: rgba(255,135,18,.90) !important;
    box-shadow:
      inset 0 0 0 1px rgba(255,145,35,.14),
      0 0 16px rgba(255,122,0,.18) !important;
  }

  /* Active tab: brighter but same height/padding as v1.6.1. */
  body.am1417-resource-page .resource-tabs-v071 button[aria-selected="true"],
  body.am1417-resource-page .resource-tabs-v071 button.active {
    color: #fff !important;
    border-color: rgba(255,132,18,.72) !important;
    background:
      linear-gradient(180deg, rgba(255,135,20,.21), rgba(255,103,0,.075)) !important;
    box-shadow:
      inset 0 -2px 0 #ff7a00,
      inset 0 1px 0 rgba(255,255,255,.035),
      0 0 18px rgba(255,122,0,.14) !important;
    text-shadow: 0 0 10px rgba(255,255,255,.08) !important;
  }

  /* Slightly more readable microcopy; dimensions stay unchanged. */
  body.am1417-resource-page .resource-tabs-v071 button {
    font-size: 10.5px !important;
    font-weight: 760 !important;
  }

  body.am1417-resource-page .resource-metrics-v071 span {
    font-size: 9px !important;
    color: #8fa8b8 !important;
  }

  body.am1417-resource-page
  .resource-hero-v071 + :not(.resource-layout-v071) :is(p,span,small) {
    font-size: 9.5px !important;
    color: #8fa8b8 !important;
  }

  /* About area: stronger separation from the background, same geometry. */
  body.am1417-resource-page .resource-summary-about-wide-v1417 {
    background:
      radial-gradient(55% 90% at 0 0, rgba(255,122,0,.045), transparent 72%),
      linear-gradient(180deg, rgba(8,28,41,.96), rgba(4,18,29,.985)) !important;
    border-color: rgba(79,127,157,.46) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      inset 0 0 0 1px rgba(23,70,96,.12) !important;
  }

  body.am1417-resource-page .resource-about-wide-copy-v1417 {
    background:
      linear-gradient(180deg, rgba(10,31,45,.94), rgba(6,21,32,.97)) !important;
    border-color: rgba(69,117,146,.40) !important;
  }

  body.am1417-resource-page
  :is(.resource-about-facts-wide-v1417,.resource-about-facts-v149) > div {
    background:
      linear-gradient(180deg, rgba(9,30,44,.93), rgba(5,19,30,.975)) !important;
    border-color: rgba(69,117,146,.42) !important;
  }

  body.am1417-resource-page
  :is(.resource-about-facts-wide-v1417,.resource-about-facts-v149) > div:hover {
    border-color: rgba(38,185,255,.46) !important;
    box-shadow: 0 0 13px rgba(38,185,255,.06) !important;
  }

  /* Guest action card: turn the otherwise empty lower area into intentional branding. */
  body.am1417-resource-page
  .resource-action-top-v140:not(:has(.resource-primary-actions-v071 > :nth-child(3)))::after {
    content: "AREX MODS" !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 0 3px 2px 0 !important;
    color: rgba(255,139,28,.085) !important;
    font-size: 28px !important;
    line-height: 1 !important;
    font-weight: 1000 !important;
    letter-spacing: .11em !important;
    text-shadow: 0 0 24px rgba(255,104,0,.07) !important;
  }

  body.am1417-resource-page
  .resource-action-top-v140:not(:has(.resource-primary-actions-v071 > :nth-child(3))) {
    background-image:
      radial-gradient(55% 55% at 82% 94%, rgba(255,105,0,.105), transparent 72%),
      linear-gradient(180deg, rgba(255,255,255,.015), transparent 46%) !important;
  }

  body.am1417-resource-page
  .resource-action-top-v140:not(:has(.resource-primary-actions-v071 > :nth-child(3)))
  .resource-primary-actions-v071 {
    margin-top: 5px !important;
  }

  /* Lower cards: stronger semantic accents, no size changes. */
  body.am1417-resource-page .resource-sidebar-v071 > .resource-facts-v071 {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      inset 0 2px 0 rgba(255,122,0,.18),
      0 0 18px rgba(255,122,0,.045) !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .resource-access-v071 {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      inset 0 2px 0 rgba(89,231,168,.16),
      0 0 18px rgba(89,231,168,.04) !important;
  }

  body.am1417-resource-page .resource-sidebar-v071 > .resource-compat-v071 {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      inset 0 2px 0 rgba(38,185,255,.17),
      0 0 18px rgba(38,185,255,.045) !important;
  }

  /* Better icon containers where the current markup already has leading icon blocks. */
  body.am1417-resource-page
  .resource-sidebar-v071 > :is(.resource-facts-v071,.resource-access-v071,.resource-compat-v071)
  h3 > :first-child {
    filter: drop-shadow(0 0 7px rgba(255,255,255,.06)) !important;
  }

  /* CTA hover/focus clarity, including keyboard navigation. */
  body.am1417-resource-page .resource-primary-actions-v071 :is(a,button,.btn):focus-visible,
  body.am1417-resource-page .resource-tabs-v071 button:focus-visible {
    outline: 1px solid rgba(255,145,35,.90) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(255,122,0,.10), 0 0 20px rgba(255,122,0,.12) !important;
  }
}
