:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-muted: #f0f3f2;
  --text: #17211d;
  --text-soft: #607068;
  --line: #dce4e0;
  --line-strong: #cbd6d1;
  --brand: #136f4a;
  --brand-strong: #0b5739;
  --brand-soft: #e7f4ed;
  --success: #168a59;
  --success-soft: #e6f6ee;
  --warning: #b86b0b;
  --warning-soft: #fff4df;
  --danger: #c84343;
  --danger-soft: #ffeded;
  --unknown: #6f7c76;
  --unknown-soft: #edf1ef;
  --shadow: 0 18px 50px rgba(22, 43, 33, 0.08);
  --shadow-soft: 0 8px 24px rgba(22, 43, 33, 0.06);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --shell: 1080px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111713;
  --surface: #18201c;
  --surface-muted: #202a25;
  --text: #edf4f0;
  --text-soft: #a7b5ad;
  --line: #2d3933;
  --line-strong: #3a4941;
  --brand: #65c99a;
  --brand-strong: #8edbb6;
  --brand-soft: #1b382a;
  --success: #62d19e;
  --success-soft: #173426;
  --warning: #f1b45f;
  --warning-soft: #3b2d18;
  --danger: #ff8989;
  --danger-soft: #432323;
  --unknown: #a7b5ad;
  --unknown-soft: #28322d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
}
.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-copy { display: grid; line-height: 1.08; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--text-soft); font-size: 12px; }
.top-nav { display: flex; align-items: center; gap: 5px; }
.top-nav a {
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.top-nav a:hover { background: var(--surface); color: var(--text); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-button, .refresh-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.icon-button:hover, .refresh-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.icon-button svg, .refresh-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: block; }
.refresh-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}
.refresh-button.is-refreshing svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { padding-top: 76px; text-align: center; }
.hero-copy { max-width: 720px; margin-inline: auto; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 16px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.048em;
}
.hero-description {
  max-width: 660px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: clamp(16px, 2vw, 18px);
}
.overall-card {
  max-width: 770px;
  min-height: 98px;
  margin: 38px auto 0;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color .25s ease, background .25s ease;
}
.overall-card.is-operational { border-color: color-mix(in srgb, var(--success) 36%, var(--line)); background: var(--success-soft); }
.overall-card.is-degraded { border-color: color-mix(in srgb, var(--warning) 38%, var(--line)); background: var(--warning-soft); }
.overall-card.is-outage { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: var(--danger-soft); }
.overall-card.is-unknown { border-color: var(--line); background: var(--unknown-soft); }
.status-symbol {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.status-symbol::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--unknown);
}
.is-operational .status-symbol::after { background: var(--success); box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 14%, transparent); }
.is-degraded .status-symbol::after { background: var(--warning); box-shadow: 0 0 0 7px color-mix(in srgb, var(--warning) 14%, transparent); }
.is-outage .status-symbol::after { background: var(--danger); box-shadow: 0 0 0 7px color-mix(in srgb, var(--danger) 14%, transparent); }
.status-symbol span { display: none; }
.is-loading .status-symbol { display: flex; gap: 4px; }
.is-loading .status-symbol::after { display: none; }
.is-loading .status-symbol span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: pulse 1s ease-in-out infinite;
}
.is-loading .status-symbol span:nth-child(2) { animation-delay: .14s; }
.is-loading .status-symbol span:nth-child(3) { animation-delay: .28s; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.overall-copy { display: grid; gap: 2px; }
.overall-copy strong { font-size: clamp(17px, 2vw, 20px); letter-spacing: -.015em; }
.overall-copy span { color: var(--text-soft); font-size: 14px; }
.check-meta {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.services-section, .history-section, .incidents-section, .help-section { padding-top: 88px; }
.section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.section-heading.compact { margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--text-soft); font-size: 14px; text-align: right; }
.services-grid { display: grid; gap: 13px; }
.service-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.service-card summary {
  min-height: 92px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  cursor: pointer;
  list-style: none;
}
.service-card summary::-webkit-details-marker { display: none; }
.service-card summary:hover { background: color-mix(in srgb, var(--surface-muted) 48%, transparent); }
.service-main { min-width: 0; display: flex; align-items: center; gap: 15px; }
.service-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 6px var(--unknown-soft);
}
.service-card[data-status="operational"] .service-icon { background: var(--success); box-shadow: 0 0 0 6px var(--success-soft); }
.service-card[data-status="degraded"] .service-icon { background: var(--warning); box-shadow: 0 0 0 6px var(--warning-soft); }
.service-card[data-status="outage"] .service-icon { background: var(--danger); box-shadow: 0 0 0 6px var(--danger-soft); }
.service-name-wrap { min-width: 0; display: grid; }
.service-name { font-size: 17px; letter-spacing: -.015em; }
.service-description { color: var(--text-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-result { display: flex; align-items: center; gap: 12px; }
.service-status {
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--unknown-soft);
  color: var(--unknown);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.service-card[data-status="operational"] .service-status { background: var(--success-soft); color: var(--success); }
.service-card[data-status="degraded"] .service-status { background: var(--warning-soft); color: var(--warning); }
.service-card[data-status="outage"] .service-status { background: var(--danger-soft); color: var(--danger); }
.chevron { width: 9px; height: 9px; border-right: 1.8px solid var(--text-soft); border-bottom: 1.8px solid var(--text-soft); transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.service-card[open] .chevron { transform: rotate(225deg) translate(-2px, -2px); }
.service-details {
  padding: 0 22px 22px 51px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}
.detail-item { padding-top: 17px; display: grid; gap: 2px; }
.detail-item span { color: var(--text-soft); font-size: 12px; }
.detail-item strong { font-size: 14px; }
.service-link {
  margin-top: 17px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}
.service-link:hover { background: var(--surface); }
.service-skeleton { height: 92px; position: relative; overflow: hidden; }
.service-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-muted) 88%, transparent), transparent);
  animation: shimmer 1.25s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.history-panel, .incident-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.empty-state, .empty-incident {
  min-height: 170px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.empty-state strong, .empty-incident strong { font-size: 16px; }
.empty-state p, .empty-incident p { margin: 3px 0 0; color: var(--text-soft); font-size: 14px; }
.empty-icon {
  width: 44px;
  height: 30px;
  margin-bottom: 13px;
  border-bottom: 2px solid var(--line-strong);
  background: linear-gradient(135deg, transparent 0 18%, var(--line-strong) 18% 22%, transparent 22% 42%, var(--line-strong) 42% 47%, transparent 47% 68%, var(--line-strong) 68% 73%, transparent 73%);
}
.history-table { overflow: hidden; }
.history-row {
  padding: 18px 21px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.history-row:last-child { border-bottom: 0; }
.history-name { display: grid; }
.history-name strong { font-size: 14px; }
.history-name span { color: var(--text-soft); font-size: 12px; }
.history-bars { height: 28px; display: flex; align-items: end; gap: 4px; }
.history-bar { flex: 1 1 0; min-width: 3px; height: 100%; border-radius: 4px; background: var(--unknown); opacity: .9; }
.history-bar.operational { background: var(--success); }
.history-bar.degraded { background: var(--warning); }
.history-bar.outage { background: var(--danger); }
.history-bar.unknown { background: var(--unknown); }
.history-summary { color: var(--text-soft); font-size: 12px; white-space: nowrap; }

.empty-incident { min-height: 130px; flex-direction: row; gap: 15px; text-align: left; }
.check-badge { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); font-weight: 900; }
.incident-item { padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 17px; border-bottom: 1px solid var(--line); }
.incident-item:last-child { border-bottom: 0; }
.incident-date { min-width: 72px; color: var(--text-soft); font-size: 12px; font-weight: 750; }
.incident-content h3 { margin: 0; font-size: 16px; }
.incident-content p { margin: 4px 0 0; color: var(--text-soft); font-size: 14px; }
.incident-state { display: inline-flex; margin-top: 10px; padding: 5px 9px; border-radius: 99px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 800; }

.help-section { padding-bottom: 90px; }
.help-card {
  padding: clamp(26px, 5vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-radius: var(--radius-lg);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow);
}
.help-card h2 { margin-bottom: 10px; font-size: clamp(25px, 4vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
.help-card p:not(.eyebrow) { max-width: 600px; margin-bottom: 0; color: color-mix(in srgb, var(--surface) 72%, transparent); }
.help-card .eyebrow { color: color-mix(in srgb, var(--surface) 64%, transparent); }
.help-actions { flex: 0 0 auto; display: flex; gap: 10px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border-radius: 12px; font-size: 14px; font-weight: 800; text-decoration: none; }
.button.primary { background: var(--surface); color: var(--text); }
.button.secondary { border: 1px solid color-mix(in srgb, var(--surface) 30%, transparent); color: var(--surface); }
.button:hover { transform: translateY(-1px); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 130px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.footer-inner strong { font-size: 14px; }
.footer-inner p { margin: 2px 0 0; color: var(--text-soft); font-size: 13px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-soft); font-size: 13px; font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .header-inner { min-height: 66px; grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .refresh-button span { display: none; }
  .refresh-button { width: 42px; padding: 0; justify-content: center; }
  .hero { padding-top: 52px; }
  h1 { font-size: clamp(34px, 11vw, 46px); }
  .overall-card { margin-top: 28px; padding: 20px; border-radius: 19px; }
  .check-meta { flex-wrap: wrap; }
  .services-section, .history-section, .incidents-section, .help-section { padding-top: 66px; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .service-card summary { min-height: 86px; padding: 18px; }
  .service-description { max-width: 190px; }
  .service-status { padding: 5px 8px; }
  .service-details { padding: 0 18px 18px; grid-template-columns: 1fr 1fr; }
  .service-link { grid-column: 1 / -1; }
  .history-row { grid-template-columns: 1fr; gap: 10px; }
  .history-bars { order: 3; }
  .history-summary { position: absolute; right: 36px; }
  .help-card { align-items: stretch; flex-direction: column; }
  .help-actions { width: 100%; }
  .help-actions .button { flex: 1; }
  .footer-inner { padding-block: 30px; align-items: start; flex-direction: column; }
}

@media (max-width: 430px) {
  .brand-copy small { display: none; }
  .header-actions { gap: 6px; }
  .hero-description { font-size: 16px; }
  .overall-card { align-items: flex-start; }
  .status-symbol { width: 43px; height: 43px; }
  .service-description { max-width: 135px; }
  .service-result { gap: 9px; }
  .service-status { font-size: 11px; }
  .chevron { display: none; }
  .service-details { grid-template-columns: 1fr; }
  .help-actions { flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* YT Conv ecosystem navigation */
.top-nav a.current{background:var(--text);color:var(--bg);pointer-events:none}
.footer-links a.current{font-weight:800;color:var(--text);pointer-events:none}
