/* Status-specific overlays on Develop CIP chrome (developer-account.css). */

:root {
  --status-up: #34c759;
  --status-down: #ff3b30;
  --status-warn: #ff9f0a;
  --status-unknown: #8e8e93;
}

.dev-sidebar-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--hairline, #d2d2d7);
}

.dev-sidebar-subheading {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #86868b);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-banner {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.status-banner h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.status-banner.is-operational h1 { color: var(--status-up); }
.status-banner.is-degraded h1,
.status-banner.is-partial_outage h1,
.status-banner.is-maintenance h1 { color: var(--status-warn); }
.status-banner.is-major_outage h1 { color: var(--status-down); }

.site-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline, #d2d2d7);
  text-decoration: none;
  color: inherit;
}

.site-row:hover .site-name { color: var(--link, #0066cc); }

.site-name {
  font-size: 17px;
  font-weight: 400;
  color: var(--text, #1d1d1f);
}

.comp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary, #6e6e73);
}

.comp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-unknown);
}
.comp-dot.is-operational { background: var(--status-up); }
.comp-dot.is-degraded,
.comp-dot.is-partial_outage,
.comp-dot.is-maintenance { background: var(--status-warn); }
.comp-dot.is-major_outage { background: var(--status-down); }

.site-open {
  font-size: 14px;
  color: var(--link, #0066cc);
}

.incident-card,
.maint-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline, #d2d2d7);
}

.incident-update {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--hairline, #d2d2d7);
}

.incident-update-body {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.47;
  white-space: pre-wrap;
  color: var(--text, #1d1d1f);
}

.incident-card h3,
.maint-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
}

.incident-meta,
.maint-meta {
  font-size: 13px;
  color: var(--text-secondary, #6e6e73);
  margin: 0 0 8px;
}

.maint-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.47;
  white-space: pre-wrap;
  color: var(--text, #1d1d1f);
}

.subscribe-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.subscribe-box input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--hairline, #d2d2d7);
  border-radius: 8px;
  font: inherit;
}

.subscribe-box button {
  padding: 10px 18px;
  border: 0;
  border-radius: 980px;
  background: #0071e3;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--link, #0066cc);
  text-decoration: none;
  font-size: 14px;
}

.topo-wrap { margin-top: 8px; }

.topo-svg-wrap {
  position: relative;
  margin-top: 12px;
}

.topo-svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
}

.topo-node circle {
  fill: var(--bg-page, #f5f5f7);
  stroke: var(--text, #1d1d1f);
  stroke-width: 1.5;
}

.topo-node text {
  font-family: var(--font);
  font-size: 11px;
  text-anchor: middle;
  fill: var(--text, #1d1d1f);
}

.topo-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.topo-flow-arrows {
  pointer-events: none;
}

.topo-flow-arrow {
  fill: var(--status-up);
}

.topo-edge:not(.is-up) .topo-flow-arrows {
  display: none;
}

.topo-edge.is-up .topo-line {
  stroke: var(--status-up);
  stroke-dasharray: 8 12;
  animation: topo-flow 1.6s linear infinite;
  will-change: stroke-dashoffset;
}

.topo-edge.is-down .topo-line {
  stroke: var(--status-down);
}

.topo-edge.is-degraded .topo-line {
  stroke: var(--status-warn);
}

.topo-edge.is-down .topo-cross line {
  stroke: var(--status-down);
  stroke-width: 2;
}

.topo-edge.is-degraded .topo-cross line {
  stroke: var(--status-warn);
  stroke-width: 2;
}

.topo-edge.is-loading .topo-line {
  stroke: var(--status-unknown);
  stroke-dasharray: 4 6;
  animation: topo-pulse 1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .topo-edge.is-up .topo-line,
  .topo-edge.is-loading .topo-line {
    animation: none;
  }
  .topo-flow-arrows {
    display: none;
  }
}

.topo-latency {
  font-family: var(--font);
  font-size: 11px;
  text-anchor: middle;
  fill: var(--text-secondary, #6e6e73);
}

.topo-cross line {
  stroke: var(--status-down);
  stroke-width: 2;
}

.topo-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #f5f5f7;
  font-size: 12px;
  pointer-events: none;
}

@keyframes topo-flow {
  to { stroke-dashoffset: -20; }
}

@keyframes topo-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (prefers-color-scheme: dark) {
  .topo-node circle {
    fill: var(--surface, #1d1d1f);
    stroke: var(--text, #f5f5f7);
  }
  .subscribe-switch-ui {
    background: #3a3a3c;
  }
  .inc-flow-line {
    background: rgba(255, 255, 255, 0.14);
  }
}

.history-bar {
  margin: 0 0 28px;
}

.history-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.history-bar-head .dev-section-title {
  margin: 0;
}

.history-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary, #6e6e73);
}

.history-bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.history-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--status-up);
}
.history-swatch.is-minor { background: var(--status-warn); }
.history-swatch.is-major { background: var(--status-down); }

.history-bar-track {
  position: relative;
  padding-bottom: 22px;
}

.history-bar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.history-day {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  cursor: default;
  position: relative;
}

.history-day.is-minor,
.history-day.is-major {
  cursor: pointer;
}

.incident-title-link {
  color: inherit;
  text-decoration: none;
}

.incident-title-link:hover {
  text-decoration: underline;
}

.subscribe-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 0;
  cursor: pointer;
  user-select: none;
}

.subscribe-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.subscribe-switch-ui {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--fill-tertiary, #d2d2d7);
  transition: background 0.2s ease;
}

.subscribe-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.subscribe-switch input:checked + .subscribe-switch-ui {
  background: var(--status-up, #34c759);
}

.subscribe-switch input:checked + .subscribe-switch-ui::after {
  transform: translateX(18px);
}

.subscribe-switch input:focus-visible + .subscribe-switch-ui {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.subscribe-switch-label {
  font-size: 14px;
  color: var(--text, #1d1d1f);
}

.inc-flow {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.inc-flow-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 14px;
  padding-bottom: 22px;
}

.inc-flow-item:last-child {
  padding-bottom: 0;
}

.inc-flow-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--status-warn, #ff9f0a);
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.18);
  z-index: 1;
}

.inc-flow-item.is-start .inc-flow-dot {
  background: var(--status-warn, #ff9f0a);
}

.inc-flow-item.is-end .inc-flow-dot {
  background: var(--status-up, #34c759);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}

.inc-flow-line {
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--hairline-soft, rgba(0, 0, 0, 0.12));
}

.inc-flow-card {
  min-width: 0;
}

.inc-flow-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
}

.history-day-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--status-up);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.history-day.is-minor .history-day-fill { background: var(--status-warn); }
.history-day.is-major .history-day-fill { background: var(--status-down); }

.history-day:hover .history-day-fill,
.history-day:focus-visible .history-day-fill {
  transform: scaleY(1.12);
  opacity: 0.9;
}

.history-day:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.history-bar-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary, #86868b);
  pointer-events: none;
}

.history-bar-loading {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #6e6e73);
}

/* Shared result-page chrome (mirror ReportAProblem confirm.html) */
.rap-hint {
  margin: 8px 0 0;
  color: var(--text-tertiary, #86868b);
  font-size: 17px;
  line-height: 1.47;
  max-width: 640px;
}

.rap-error {
  margin: 12px 0;
  color: var(--danger, #ff3b30);
  font-size: 17px;
  line-height: 1.47;
  max-width: 640px;
}

.rap-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.status-snapshot-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 102, 204, 0.08);
  border: 1px solid rgba(0, 102, 204, 0.22);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary, #6e6e73);
}

.status-snapshot-banner.is-stale {
  background: rgba(255, 159, 10, 0.1);
  border-color: rgba(255, 159, 10, 0.35);
}

.status-snapshot-banner.is-down {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.35);
}

.status-snapshot-banner a {
  color: #0066cc;
}

@media (max-width: 734px) {
  .site-row {
    grid-template-columns: 1fr auto;
  }
  .site-open { display: none; }
  .history-bar-days {
    gap: 3px;
  }
  .history-day {
    height: 22px;
  }
}
