/* V41.1.1 — panel dự án: nhiều thông tin nhưng vẫn gọn, không tràn màn hình */
.info-panel.project-info {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  width: min(455px, calc(100% - 48px));
}
.info-panel.project-info .info-details { grid-template-columns: 126px minmax(0,1fr); gap: 10px 12px; }
.info-panel.project-info .info-details dt { font-weight: 700; color: #667b89; }
.info-panel.project-info .info-details dd { line-height: 1.48; font-weight: 700; }
@media (max-width: 760px) {
  .info-panel.project-info { max-height: 76vh; width: calc(100% - 20px); }
  .info-panel.project-info .info-details { grid-template-columns: 1fr; gap: 3px; }
  .info-panel.project-info .info-details dt { margin-top: 9px; }
}
/* V41.2 — hồ sơ PDF + ảnh dự án trong panel công khai */
.project-public-assets{display:grid;gap:10px!important}.project-public-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.project-public-gallery figure{margin:0;min-width:0}.project-public-gallery img{display:block;width:100%;height:92px;object-fit:cover;border-radius:9px;background:#e8efed;border:1px solid rgba(33,70,60,.12)}.project-public-gallery figcaption{margin-top:4px;font-size:10px;line-height:1.3;color:#697b75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.project-public-documents{display:grid;gap:6px}.project-public-documents a{display:grid;gap:2px;padding:8px 9px;border:1px solid #d8e5e1;border-radius:9px;background:#f8fbfa;color:#24584c;text-decoration:none}.project-public-documents a:hover{border-color:#63ad9b;background:#f0faf7}.project-public-documents strong{font-size:11px;line-height:1.35}.project-public-documents small{font-size:9.5px;color:#768781}@media(max-width:640px){.project-public-gallery{grid-template-columns:1fr 1fr}.project-public-gallery img{height:78px}}

/* V41.5.1 — panel dự án: cuộn đủ + responsive thực tế ở desktop/iPhone/fullscreen */
.info-panel.project-info {
  box-sizing: border-box;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  scroll-padding-bottom: 28px;
  padding-bottom: 28px;
}

/* Desktop: panel gốc nằm dưới bảng lớp dữ liệu (top:430px).
   Giới hạn chiều cao theo chính map-shell để đáy panel luôn còn trong màn hình. */
@media (min-width:1181px) {
  .info-panel.project-info {
    max-height: calc(100% - 448px) !important;
  }
  html.nhpq-map-fullscreen .info-panel.project-info {
    max-height: calc(100% - 448px) !important;
  }
}

/* Tablet / điện thoại xoay ngang: dùng drawer bên phải và tận dụng hết chiều cao
   từ mép trên tới ngay phía trên dock. Không để max-height cũ bó panel thành một ô nhỏ. */
@media (min-width:761px) and (max-width:1180px) and (orientation:landscape),
       (min-width:761px) and (max-height:560px) and (orientation:landscape) and (any-pointer:coarse) {
  .info-panel.project-info {
    top: max(var(--nhpq-tablet-edge, 10px), env(safe-area-inset-top)) !important;
    right: max(var(--nhpq-tablet-edge, 10px), env(safe-area-inset-right)) !important;
    bottom: calc(var(--nhpq-tablet-dock-h, 70px) + var(--nhpq-tablet-panel-gap, 10px) + max(var(--nhpq-tablet-edge, 10px), env(safe-area-inset-bottom))) !important;
    left: auto !important;
    width: min(430px, 46vw) !important;
    max-height: none !important;
    height: auto !important;
    padding: 18px 17px 24px;
    border-radius: 20px;
    transform: translateX(calc(100% + 40px));
  }
  .info-panel.project-info.open { transform: translateX(0); }
  .info-panel.project-info .info-details {
    grid-template-columns: 112px minmax(0,1fr);
    gap: 8px 10px;
  }
  .info-panel.project-info h1 { font-size: 20px; line-height: 1.2; }
  .info-panel.project-info .info-subtitle { margin-bottom: 12px; font-size: 12.5px; }
}

/* iPhone/điện thoại dọc: không phủ gần kín bản đồ nữa.
   Giữ thành bottom-sheet khoảng nửa màn hình và bố trí 2 cột để thông tin gọn hơn. */
@media (max-width:760px) and (orientation:portrait) {
  .info-panel.project-info {
    top: auto !important;
    right: var(--nhpq-mobile-edge, 8px) !important;
    bottom: calc(var(--nhpq-mobile-dock-h, 64px) + max(16px, env(safe-area-inset-bottom))) !important;
    left: var(--nhpq-mobile-edge, 8px) !important;
    width: auto !important;
    max-height: min(54dvh, 560px) !important;
    height: auto !important;
    padding: 18px 16px 24px;
    border-radius: 22px;
  }
  .info-panel.project-info h1 {
    padding-right: 26px;
    font-size: 21px;
    line-height: 1.18;
  }
  .info-panel.project-info .info-subtitle {
    margin: 6px 0 12px;
    font-size: 12.5px;
    line-height: 1.4;
  }
  .info-panel.project-info .info-details {
    grid-template-columns: minmax(94px, 30%) minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    font-size: 12.5px;
  }
  .info-panel.project-info .info-details dt {
    margin-top: 0 !important;
    line-height: 1.35;
  }
  .info-panel.project-info .info-details dd {
    line-height: 1.42;
  }
}

/* Điện thoại xoay ngang có CSS viewport rộng hơn 760px nên rơi vào layout tablet.
   Ép drawer cao hết phần khả dụng, kể cả trong CSS fullscreen của Safari iPhone. */
@media (orientation:landscape) and (max-height:560px) and (any-pointer:coarse) {
  html.nhpq-map-fullscreen .info-panel.project-info,
  .map-shell:fullscreen .info-panel.project-info,
  .map-shell:-webkit-full-screen .info-panel.project-info,
  .info-panel.project-info {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: calc(var(--nhpq-tablet-dock-h, var(--nhpq-mobile-dock-h, 64px)) + 14px + env(safe-area-inset-bottom)) !important;
    left: auto !important;
    width: min(420px, 48vw) !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: auto !important;
    padding: 14px 15px 20px;
  }
  .info-panel.project-info h1 { font-size: 18px; }
  .info-panel.project-info .eyebrow { margin-bottom: 5px; font-size: 10px; }
  .info-panel.project-info .info-subtitle { margin: 4px 0 9px; font-size: 11.5px; }
  .info-panel.project-info .info-details {
    grid-template-columns: 104px minmax(0,1fr) !important;
    gap: 6px 9px !important;
    font-size: 11.5px;
  }
  .info-panel.project-info .info-details dt,
  .info-panel.project-info .info-details dd { line-height: 1.35; }
}

/* Project profile/share actions */
.project-share-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px;margin-top:14px;padding-top:14px;border-top:1px solid #dce8ea}.project-share-actions a,.project-share-actions button{display:flex;align-items:center;justify-content:center;min-height:42px;padding:9px 11px;border:1px solid #b9d9d2;border-radius:11px;background:#fff;color:#0b6d61;font:inherit;font-weight:850;text-decoration:none;cursor:pointer;text-align:center}.project-share-actions .primary{border-color:#0b806f;background:#0b806f;color:#fff}.project-share-actions button[data-copied="1"]{background:#e8f7f3;color:#08705f}@media(max-width:520px){.project-share-actions{grid-template-columns:1fr}}

/* V41.9.47 — project actions must obey the hidden state. */
.project-share-actions[hidden]{display:none!important}
