/* Shared record-detail sheet; the controller keeps its bounds synced to the
   visual viewport so browser chrome and the on-screen keyboard cannot cover it. */
.mobile-detail-popup-layer[hidden] { display: none !important; }
.mobile-detail-popup-layer {
  position: fixed;
  z-index: 64;
  top: var(--visible-viewport-top, 0px);
  right: 0;
  left: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  width: 100%;
  height: var(--visible-viewport-height, 100dvh);
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgb(8 13 27 / 50%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overscroll-behavior: contain;
}
.mobile-detail-popup {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(var(--visible-viewport-height, 100dvh) - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 16px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -18px 55px rgb(8 13 27 / 25%);
}
.mobile-detail-popup:focus { outline: none; }
.mobile-detail-popup-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.mobile-detail-popup-title {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: var(--zkl-font-16, 16px);
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mobile-detail-popup-close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: var(--zkl-font-24, 24px);
  line-height: 1;
}
.mobile-detail-popup-close:focus-visible,
.mobile-detail-popup-actions :focus-visible { outline: 2px solid var(--ci-primary); outline-offset: 2px; }
.mobile-detail-popup-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mobile-detail-popup-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 58px;
  padding: 9px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.mobile-detail-popup-actions[hidden] { display: none !important; }
.mobile-detail-popup-actions .mobile-compact-value { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-detail-popup-actions .button,
.mobile-detail-popup-actions .icon-button { min-height: 44px !important; }
.detail-eye-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 8px !important;
}
.detail-eye-button > svg,
.detail-eye-button .ui-icon-eye {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-eye-button:focus-visible { outline: 2px solid var(--ci-primary); outline-offset: 2px; }
body.mobile-detail-popup-open { overscroll-behavior: none; }
@media (max-width: 760px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .mobile-detail-popup { width: min(100%, 720px); }
  .mobile-detail-popup-body { padding: 10px 9px; }
  .mobile-detail-popup-actions { justify-content: flex-start; }
}
