/* ===== Security rows — inline controls ===== */
.security-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0;
}
.security-list > div > dt {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}
.security-list > div > dd {
  margin: 0;
  flex: 0 1 auto;
  text-align: right;
  white-space: nowrap;
}
.security-list > div > button.text-button,
.security-list > div > .inline-select {
  flex: 0 0 auto;
  margin-left: 0.5rem !important;
  padding: 0.375rem 0.75rem;
  border: 1px solid #d0d5d0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
  height: auto;
  min-height: 0;
}
.security-list > div > button.text-button:active { background: #f0f2ef; }
.security-list > div > .inline-select {
  padding-right: 1.75rem;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* On narrow screens, controls go below on their own row */
@media (max-width: 520px) {
  .security-list > div {
    flex-wrap: wrap;
  }
  .security-list > div > dt { flex: 1 1 100%; }
  .security-list > div > dd { flex: 1 1 auto; text-align: left; }
  .security-list > div > button.text-button,
  .security-list > div > .inline-select {
    flex: 0 0 auto;
    margin-left: auto !important;
  }
}

/* Undo global * { max-width: 100% } breaking inline controls */
.security-list > div > button,
.security-list > div > .inline-select {
  max-width: none;
}

/* Tighten the giant "Security posture" heading — was oversized */
h1, h2 { line-height: 1.15; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 4.5vw, 1.875rem); }

/* Page header row (5 seconds / refresh / password / signout) */
.page-toolbar, .top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Footer spacing so nothing gets cut on mobile */
.panel-footer, footer {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

/* Kill the horizontal overflow from grid gutters on small screens */
@media (max-width: 520px) {
  .metrics-grid, .overview-grid, .service-layout {
    margin-left: 0;
    margin-right: 0;
  }
}
