/* ==========================================================================
   DevTechnic — Service Status & NOC Telemetry Portal
   Design: Simpra / Better Uptime Enterprise Aesthetic
   Colors: DevNet Gold Gradient, Crisp White Cards, Emerald Status Greens
   Typography: Plus Jakarta Sans & JetBrains Mono
   ========================================================================== */

:root {
  /* Brand Topbar Gradient (DevNet Main Project) */
  --topbar-gradient: linear-gradient(90deg, #ca8a04 0%, #eab308 35%, #f59e0b 70%, #d97706 100%);
  --topbar-text: #0b1320;
  --topbar-text-muted: rgba(11, 19, 32, 0.75);

  /* Colors */
  --color-dark: #111827;
  --color-dark-muted: #374151;
  --color-gray-text: #6b7280;
  --color-gray-light: #9ca3af;
  --color-bg: #f9fafb;
  --color-card-bg: #ffffff;
  --color-border: #f3f4f6;
  --color-border-dark: #e5e7eb;

  /* Status Tokens */
  --status-green: #22c55e;
  --status-green-hover: #16a34a;
  --status-green-light: #dcfce7;
  --status-green-faded: #a7f3d0;
  --status-amber: #f59e0b;
  --status-amber-light: #fef3c7;
  --status-red: #ef4444;
  --brand-yellow: #ca8a04;
  --brand-yellow-hover: #a16207;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
  --shadow-floating: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   TOP HERO BANNER
   ========================================================================== */
.status-hero-banner {
  background: var(--topbar-gradient);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 100%;
  padding: 2.2rem 1.5rem 4.5rem;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.banner-inner {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top Right Meta Telemetry & Bell Button */
.banner-right-meta {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.update-telemetry-text {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--topbar-text);
  line-height: 1.35;
}

.last-updated-row {
  white-space: nowrap;
  color: var(--topbar-text);
}

.last-updated-row span {
  font-weight: 700;
  color: var(--topbar-text);
}

.next-update-row {
  color: var(--topbar-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.subscribe-bell-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background-color: var(--status-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
  flex-shrink: 0;
}

.subscribe-bell-btn:hover {
  background-color: var(--status-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.4);
}

/* Center Brand Logo & Title */
.banner-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.2rem;
}

.brand-link {
  display: inline-block;
  transition: transform 0.2s ease;
}

.brand-link:hover {
  transform: scale(1.02);
}

.brand-logo-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.bolt-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-name-text {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--topbar-text);
  letter-spacing: -0.6px;
}

.brand-separator-line {
  width: 140px;
  height: 1.5px;
  background-color: rgba(11, 19, 32, 0.22);
  margin: 0.75rem 0 0.85rem;
}

.service-status-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--topbar-text);
  letter-spacing: -0.2px;
}

/* ==========================================================================
   PAGE CONTAINER
   ========================================================================== */
.page-container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  flex: 1;
}

/* ==========================================================================
   FLOATING STATUS HERO CARD
   ========================================================================== */
.floating-status-card {
  background-color: var(--color-card-bg);
  border-radius: 10px;
  padding: 1.45rem 2rem;
  box-shadow: var(--shadow-floating);
  margin-top: -30px;
  margin-bottom: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 5;
  width: 100%;
}

.status-card-left {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
}

.big-status-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--status-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.status-main-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.4px;
}

.status-main-title .highlight-green {
  color: var(--status-green);
}

.status-card-right {
  font-size: 0.92rem;
  color: var(--color-gray-text);
  white-space: nowrap;
}

.latest-downtime-link {
  color: var(--brand-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  margin-right: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.latest-downtime-link:hover {
  color: var(--brand-yellow-hover);
  opacity: 0.9;
}

/* ==========================================================================
   COMMON SECTION HEADERS
   ========================================================================== */
.status-block-section {
  margin-bottom: 2.75rem;
  width: 100%;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  gap: 0.5rem;
}

.section-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-gray-text);
}

.calendar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--brand-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
}

.calendar-action-btn:hover {
  color: var(--brand-yellow-hover);
  opacity: 0.9;
}

/* ==========================================================================
   UPTIME (LAST 90 DAYS) CARD & SERVICES LIST
   ========================================================================== */
.services-uptime-card {
  background-color: var(--color-card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  overflow: hidden;
  width: 100%;
}

.service-uptime-row {
  display: flex;
  align-items: center;
  padding: 1.05rem 1.6rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
  cursor: pointer;
  width: 100%;
}

.service-uptime-row:last-child {
  border-bottom: none;
}

.service-uptime-row:hover {
  background-color: #fafbfc;
}

/* Desktop: Service Name Column */
.service-name-col {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.service-name-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-arrow-icon {
  color: var(--color-gray-light);
  font-size: 0.8rem;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.service-uptime-row:hover .service-arrow-icon {
  transform: translateX(2px);
  color: var(--color-dark);
}

/* Desktop: Uptime Rate Column */
.service-rate-col {
  width: 78px;
  flex-shrink: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--status-green);
  text-align: left;
  font-family: var(--font-mono);
}

/* Desktop: 90-Day Micro Bar Strip */
.service-bars-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5px;
  margin: 0 1.5rem;
  height: 24px;
  min-width: 0;
}

.tick-bar {
  flex: 1 1 0px;
  min-width: 1.5px;
  max-width: 4.5px;
  height: 22px;
  border-radius: 1.5px;
  background-color: var(--status-green);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.tick-bar:hover {
  transform: scaleY(1.25);
  opacity: 0.8;
}

.tick-bar.tick-faded {
  background-color: var(--status-green-faded);
}

.tick-bar.tick-degraded {
  background-color: var(--status-amber);
}

.tick-bar.tick-outage {
  background-color: var(--status-red);
}

/* Desktop: Status Indicator Column (Right: ● Up) */
.service-status-col {
  width: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.status-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-green);
  flex-shrink: 0;
}

.status-text-sm {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--status-green);
}

/* ==========================================================================
   OVERALL UPTIME CARD (4 Metric Columns)
   ========================================================================== */
.overall-uptime-card {
  background-color: var(--color-card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 1.8rem 1rem;
  width: 100%;
}

.uptime-metric-col {
  text-align: center;
  padding: 0 1rem;
  border-right: 1px solid var(--color-border);
  min-width: 0;
}

.uptime-metric-col:last-child {
  border-right: none;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -0.6px;
  font-family: var(--font-sans);
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-gray-text);
  margin-top: 0.35rem;
}

/* ==========================================================================
   DATACENTERS SECTION
   ========================================================================== */
.badge-all-green {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--status-green);
  background-color: var(--status-green-light);
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.datacenters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
}

.dc-card {
  background-color: var(--color-card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  transition: all 0.2s ease;
  width: 100%;
}

.dc-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.dc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.dc-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-dark);
  min-width: 0;
}

.dc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-dark);
  background-color: #f3f4f6;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.dc-role-text {
  font-size: 0.82rem;
  color: var(--color-gray-text);
  margin-bottom: 0.85rem;
}

.dc-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--color-dark-muted);
}

.dc-pill {
  background-color: #f9fafb;
  border: 1px solid var(--color-border-dark);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

/* ==========================================================================
   INCIDENTS SECTION
   ========================================================================== */
.incidents-list-card {
  background-color: var(--color-card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  overflow: hidden;
  width: 100%;
}

.incident-item-row {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}

.incident-item-row:last-child {
  border-bottom: none;
}

.incident-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.incident-title-text {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--color-dark);
  min-width: 0;
}

.incident-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-scheduled {
  background-color: #eff6ff;
  color: #2563eb;
}

.tag-resolved {
  background-color: var(--status-green-light);
  color: var(--status-green);
}

.incident-desc-text {
  font-size: 0.85rem;
  color: var(--color-dark-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.incident-meta-date {
  font-size: 0.76rem;
  color: var(--color-gray-text);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.status-page-footer {
  border-top: 1px solid var(--color-border-dark);
  padding: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-gray-text);
  margin-top: 2rem;
  width: 100%;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--color-dark);
}

.footer-sep {
  opacity: 0.4;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-right a:hover {
  color: var(--color-dark);
  text-decoration: underline;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  padding: 1.25rem;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
  max-height: 90vh;
}

.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

.modal-dialog-lg {
  max-width: 780px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  font-size: 1.5rem;
  color: var(--color-gray-light);
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--color-dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--color-dark-muted);
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  border: 1px solid var(--color-border-dark);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--status-green);
}

.form-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--status-green);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.form-submit-btn:hover {
  background-color: var(--status-green-hover);
}

.modal-feed-links {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--color-gray-text);
}

.modal-feed-links a {
  color: var(--color-dark);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.modal-feed-links a:hover {
  color: var(--status-green);
}

/* Calendar Modal Specifics */
.calendar-summary-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.cal-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-green);
}

.dot-amber {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-amber);
}

.dot-red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-red);
}

.calendar-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.cal-month-box {
  background: #f9fafb;
  border: 1px solid var(--color-border-dark);
  border-radius: 8px;
  padding: 0.85rem;
}

.cal-month-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-dark);
  text-align: center;
  margin-bottom: 0.6rem;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background-color: var(--status-green);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.cal-day-cell.degraded {
  background-color: var(--status-amber);
}

/* Service Detail Modal Content */
.srv-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.srv-detail-card {
  background: #f9fafb;
  border: 1px solid var(--color-border-dark);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.srv-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-gray-text);
  text-transform: uppercase;
}

.srv-detail-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-top: 0.2rem;
  font-family: var(--font-mono);
}

/* ==========================================================================
   TOOLTIP & TOAST
   ========================================================================== */
.custom-tooltip {
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: 2000;
  background: rgba(17, 24, 39, 0.95);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: calc(100vw - 20px);
}

.custom-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (Desktop -> Tablet -> Mobile -> Micro)
   ========================================================================== */

/* --- Tablet / Small Laptop Breakpoint (<= 880px) --- */
@media (max-width: 880px) {
  .status-hero-banner {
    padding: 1.8rem 1.25rem 3.8rem;
  }

  .banner-right-meta {
    position: static;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.25rem;
  }

  .update-telemetry-text {
    text-align: left;
  }

  .floating-status-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    margin-top: -26px;
    margin-bottom: 2.2rem;
  }

  .status-card-right {
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
  }

  .overall-uptime-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .uptime-metric-col:nth-child(2) {
    border-right: none;
  }

  .service-name-col {
    width: 180px;
    min-width: 0;
  }

  .service-bars-col {
    margin: 0 1rem;
  }

  .modal-dialog-lg {
    max-width: 95%;
  }

  .calendar-months-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Mobile Breakpoint (<= 680px) --- */
@media (max-width: 680px) {
  /* Layout Root & Margins */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-container {
    padding: 0 0.85rem 3rem;
    width: 100%;
    max-width: 100%;
  }

  /* Top Hero Banner */
  .status-hero-banner {
    padding: 1.1rem 0.85rem 3.2rem;
  }

  .banner-right-meta {
    position: static;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.85rem;
  }

  .update-telemetry-text {
    font-size: 0.74rem;
  }

  .subscribe-bell-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .brand-logo-mark {
    gap: 0.45rem;
  }

  .brand-name-text {
    font-size: 1.75rem;
  }

  .bolt-icon {
    width: 26px;
    height: 26px;
  }

  .brand-separator-line {
    width: 100px;
    margin: 0.45rem 0 0.55rem;
  }

  .service-status-heading {
    font-size: 0.98rem;
  }

  /* Floating Status Card */
  .floating-status-card {
    margin-top: -22px;
    margin-bottom: 1.85rem;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    gap: 0.75rem;
  }

  .status-card-left {
    width: 100%;
    min-width: 0;
    gap: 0.65rem;
  }

  .status-main-title {
    font-size: 1.2rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .big-status-dot {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .status-card-right {
    font-size: 0.8rem;
    white-space: normal;
    word-break: break-word;
    padding-top: 0.55rem;
    border-top: 1px solid var(--color-border);
  }

  /* Section Header Rows & Title Groups */
  .status-block-section {
    margin-bottom: 2.2rem;
  }

  .section-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
  }

  .section-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
  }

  .section-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
  }

  .section-subtitle {
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.35;
    color: var(--color-gray-text);
  }

  .calendar-action-btn {
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.15rem;
  }

  .badge-all-green {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 2-Tier Mobile Service Row: Name & Status on top line, 90 Bars full-width underneath */
  .service-uptime-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "name rate status"
      "bars bars bars";
    row-gap: 0.45rem;
    column-gap: 0.4rem;
    padding: 0.8rem 0.9rem;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
  }

  .service-uptime-row:active {
    background-color: #f3f4f6;
  }

  .service-name-col {
    grid-area: name;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .service-name-text {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    display: block;
  }

  .service-arrow-icon {
    flex-shrink: 0;
    font-size: 0.72rem;
    opacity: 0.6;
  }

  .service-rate-col {
    grid-area: rate;
    width: auto;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
  }

  .service-status-col {
    grid-area: status;
    width: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
  }

  .status-dot-sm {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
  }

  .status-text-sm {
    font-size: 0.78rem;
  }

  .service-bars-col {
    grid-area: bars;
    width: 100%;
    max-width: 100%;
    margin: 0;
    gap: 1px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
  }

  .tick-bar {
    height: 16px;
    border-radius: 1px;
    flex: 1 1 0px;
    min-width: 1px;
    max-width: none;
  }

  /* Overall Uptime 2x2 Grid */
  .overall-uptime-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.1rem 0.5rem;
    row-gap: 1.1rem;
  }

  .uptime-metric-col {
    padding: 0 0.4rem;
    min-width: 0;
  }

  .uptime-metric-col:nth-child(1) {
    border-right: 1px solid var(--color-border);
  }

  .uptime-metric-col:nth-child(2) {
    border-right: none;
  }

  .uptime-metric-col:nth-child(3) {
    border-right: 1px solid var(--color-border);
  }

  .uptime-metric-col:nth-child(4) {
    border-right: none;
  }

  .metric-value {
    font-size: 1.35rem;
    white-space: nowrap;
  }

  .metric-label {
    font-size: 0.74rem;
    white-space: nowrap;
  }

  /* Datacenters Grid (Single column on mobile) */
  .datacenters-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .dc-card {
    padding: 0.95rem;
  }

  .dc-title-group {
    font-size: 0.9rem;
  }

  .dc-badge {
    font-size: 0.68rem;
    padding: 0.12rem 0.4rem;
  }

  .dc-role-text {
    font-size: 0.78rem;
    margin-bottom: 0.7rem;
  }

  .dc-meta-pills {
    gap: 0.35rem;
  }

  .dc-pill {
    font-size: 0.72rem;
    padding: 0.18rem 0.45rem;
  }

  /* Past Incidents List */
  .incident-item-row {
    padding: 1rem 0.95rem;
  }

  .incident-item-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .incident-title-text {
    font-size: 0.88rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .incident-status-tag {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
  }

  .incident-desc-text {
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-word;
  }

  .incident-meta-date {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 0.75rem;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    margin: 0;
    border-radius: 10px;
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-title {
    font-size: 0.98rem;
  }

  .modal-body {
    padding: 1.15rem;
  }

  .form-input {
    font-size: 1rem; /* Prevents iOS Safari auto-zoom */
    padding: 0.7rem 0.85rem;
  }

  .calendar-months-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .calendar-summary-row {
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    font-size: 0.74rem;
  }

  .srv-detail-info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .srv-detail-card {
    padding: 0.65rem 0.8rem;
  }

  /* Footer on Mobile */
  .status-page-footer {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    padding: 1.5rem 0 2rem;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.25rem;
  }

  .footer-sep {
    display: none;
  }

  .footer-right {
    gap: 1rem;
    font-size: 0.82rem;
  }
}

/* --- Ultra-Compact / Fold Mobile Breakpoint (<= 380px) --- */
@media (max-width: 380px) {
  .brand-name-text {
    font-size: 1.45rem;
  }

  .bolt-icon {
    width: 22px;
    height: 22px;
  }

  .status-main-title {
    font-size: 1.05rem;
  }

  .metric-value {
    font-size: 1.12rem;
  }

  .metric-label {
    font-size: 0.68rem;
  }

  .service-name-text {
    font-size: 0.76rem;
  }

  .service-rate-col {
    font-size: 0.72rem;
  }

  .status-text-sm {
    font-size: 0.72rem;
  }

  .section-title {
    font-size: 1.05rem;
  }

  .section-subtitle {
    font-size: 0.74rem;
  }
}

