:root {
  --bg: #ffffff;
  --bg-soft: #f7f8f9;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --ink: #111827;
  --ink-dim: #4b5563;
  --ink-faint: #9ca3af;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* HEADER */
header { padding: 24px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--ink); }
.brand-mark { width: 24px; height: 24px; display: grid; place-items: center; color: var(--ink-dim); }
.brand-mark svg { width: 20px; height: 20px; }
.brand span { color: var(--ink-faint); font-weight: 400; }

/* BANNER */
.banner { margin: 32px 0; padding: 20px 24px; border: 1px solid; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.banner-ok   { background: var(--green-soft); border-color: #bbf7d0; }
.banner-warn { background: var(--amber-soft); border-color: #fde68a; }
.banner-down { background: var(--red-soft);   border-color: #fecaca; }
.banner-left { display: flex; align-items: center; gap: 12px; }
.banner-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: white; flex-shrink: 0; }
.banner-icon svg { width: 18px; height: 18px; }
.icon-ok   { background: var(--green); }
.icon-warn { background: var(--amber); }
.icon-down { background: var(--red); }
.banner-text { font-size: 16px; font-weight: 600; }
.banner-ok   .banner-text { color: #14532d; }
.banner-warn .banner-text { color: #78350f; }
.banner-down .banner-text { color: #7f1d1d; }
.banner-meta { font-size: 13px; }
.banner-ok   .banner-meta { color: #166534; }
.banner-warn .banner-meta { color: #92400e; }
.banner-down .banner-meta { color: #991b1b; }

/* SECTIONS */
section { margin: 40px 0; }
h2 { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }

/* SERVICE CARDS */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.service { padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 10px; }
.service-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.service-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.service-desc { font-size: 12px; color: var(--ink-dim); margin-top: 1px; }
.service-response { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.service-response .stat-label { margin-bottom: 0; }
.service-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.stat-label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.stat-value { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.stat-value.warn { color: var(--amber); }
.stat-value.crit { color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-up   { background: var(--green-soft); color: #166534; }
.badge-down { background: var(--red-soft);   color: #991b1b; }
.badge-none { background: var(--bg-soft);    color: var(--ink-dim); }
.badge-up::before, .badge-down::before, .badge-none::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-up::before   { background: var(--green); }
.badge-down::before { background: var(--red); }
.badge-none::before { background: var(--ink-faint); }

/* TIMELINE */
.timeline-card { border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.timeline-row { margin-bottom: 20px; }
.timeline-row:last-of-type { margin-bottom: 0; }
.timeline-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.timeline-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.timeline-summary { font-size: 12px; color: var(--ink-dim); font-family: var(--mono); }
.timeline-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 28px; position: relative; }
.tb { border-radius: 2px; cursor: pointer; transition: opacity 0.12s, transform 0.12s; }
.tb:hover { opacity: 0.75; transform: scaleY(1.04); }
.tb-up   { background: var(--green); }
.tb-warn { background: var(--amber); }
.tb-down { background: var(--red); }
.tb-none { background: #e5e7eb; }
.tl-tooltip { position: fixed; background: var(--ink); color: #fff; border-radius: 6px; padding: 8px 12px; font-size: 12px; line-height: 1.4; pointer-events: none; opacity: 0; transform: translate(-50%, -100%) translateY(-10px); transition: opacity 0.12s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); white-space: nowrap; z-index: 99; }
.tl-tooltip.visible { opacity: 1; }
.tl-tooltip::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: var(--ink); }
.tl-tooltip-date { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-bottom: 2px; }
.tl-tooltip-status { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tl-tooltip-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.tl-tooltip-status.s-up::before   { background: var(--green); }
.tl-tooltip-status.s-warn::before { background: var(--amber); }
.tl-tooltip-status.s-down::before { background: var(--red); }
.tl-tooltip-status.s-none::before { background: var(--ink-faint); }
.tl-tooltip-meta { color: var(--ink-faint); font-size: 11px; margin-top: 4px; }
.timeline-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-faint); }
.legend { display: flex; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; }

/* CHART */
.chart-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 8px 8px; }
#chart { width: 100%; min-height: 260px; }
.bb svg { font-family: var(--sans); }
.bb-axis text { font-family: var(--mono); font-size: 10px; fill: var(--ink-faint); }
.bb-axis path, .bb-axis line { stroke: var(--line); shape-rendering: crispEdges; }
.bb-grid line { stroke: var(--line); stroke-dasharray: 0 !important; }
.bb-legend-item text { font-size: 12px; fill: var(--ink-dim); }
.bb-line { stroke-width: 1.75px; }
.bb-tooltip-container { z-index: 10; }
.bb-tooltip { background: var(--ink); color: #000; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.12); font-family: var(--sans); font-size: 12px; overflow: hidden; opacity: 1; }
.bb-tooltip th { background: transparent; color: var(--ink-faint); font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 8px 12px 4px; text-align: left; border: none; }
.bb-tooltip td { padding: 4px 12px; border: none; font-size: 12px; }
.bb-tooltip td.name { color: #000; }
.bb-tooltip td.name > span { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.bb-tooltip td.value { font-family: var(--mono); color: #000; text-align: right; padding-left: 24px; }
.bb-tooltip tr:last-child td { padding-bottom: 8px; }
.bb-circle._expanded_ { stroke-width: 2px; stroke: #fff; }

/* FOOTER */
footer { padding: 32px 0; margin-top: 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-faint); }
footer a { color: var(--ink-dim); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 700px) { .services { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .wrap { padding: 0 16px; } .banner-text { font-size: 15px; } }
