/* Qadya status page. Self-contained: no app bundle, no external fonts or scripts.
   Colours follow the app's dark theme tokens (src/styles/tokens-v2.ts). */
:root {
  --bg: #0B1329;
  --surface: #121E3E;
  --border: #6B82B0;
  --text: #EAF2FF;
  --text-2: #C4D2EA;
  --muted: #9FB3D4;
  --link: #9EEBFF;
  --ok: #3DD39B;
  --ok-bg: #0C2A2B;
  --warn: #F6CF86;
  --warn-bg: #2A2110;
  --bad: #F2B8C6;
  --bad-bg: #33131C;
  --info: #9EEBFF;
  --info-bg: #0B2236;
  --none: #9FB3D4;
  --none-bg: #1A2748;
  --bar-empty: #6B82B0;
  --focus: #FFFFFF;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem; line-height: 1.5;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--text); padding: .5rem 1rem; }
.skip:focus { left: .5rem; top: .5rem; z-index: 2; }
.top, main, .foot { width: 100%; max-width: 52rem; margin: 0 auto; padding: 0 1rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.brand__mark { width: 1.75rem; height: 1.75rem; color: var(--link); }
.brand__page { color: var(--muted); font-weight: 400; }
.lang { display: inline-flex; gap: .25rem; }
.lang__button {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-2); font: inherit; font-size: .875rem; cursor: pointer;
}
.lang__button[aria-pressed="true"] { background: var(--surface); color: var(--text); border-color: var(--text); font-weight: 600; }

.overall { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.overall__title { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.overall__detail { margin: .25rem 0 0; color: var(--text-2); }
.overall__detail:empty { display: none; }
.overall__icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 3px solid var(--none); }
.overall--operational { background: var(--ok-bg); border-color: var(--ok); }
.overall--operational .overall__icon { background: var(--ok); border-color: var(--ok); }
.overall--degraded { background: var(--warn-bg); border-color: var(--warn); }
.overall--degraded .overall__icon { background: var(--warn); border-color: var(--warn); border-radius: 6px; }
.overall--outage { background: var(--bad-bg); border-color: var(--bad); }
.overall--outage .overall__icon { background: var(--bad); border-color: var(--bad); border-radius: 0; }
.overall--maintenance { background: var(--info-bg); border-color: var(--info); }
.overall--maintenance .overall__icon { border-color: var(--info); border-style: dashed; }
.overall--unknown .overall__icon, .overall--loading .overall__icon { border-style: dotted; }

.block { margin-top: 2rem; }
.block h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
.hint, .foot { color: var(--muted); font-size: .875rem; }
.notice { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }

.components { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.component { padding: 1rem; border-top: 1px solid rgba(107, 130, 176, .45); }
.component:first-child { border-top: 0; }
.component__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.component__name { margin: 0; font-size: 1rem; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: .375rem; padding: .125rem .625rem; border-radius: 999px; font-size: .875rem; font-weight: 600; border: 1px solid currentColor; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.badge--operational { color: var(--ok); background: var(--ok-bg); }
.badge--degraded { color: var(--warn); background: var(--warn-bg); }
.badge--degraded::before { border-radius: 2px; }
.badge--outage { color: var(--bad); background: var(--bad-bg); }
.badge--outage::before { border-radius: 0; }
.badge--maintenance { color: var(--info); background: var(--info-bg); }
.badge--unknown { color: var(--none); background: var(--none-bg); }
.badge--unknown::before { background: transparent; border: 1px solid currentColor; }

.bars { display: flex; align-items: flex-end; gap: 1px; height: 1.75rem; margin: .75rem 0 .5rem; }
/* A day without data is a short bar: the difference is shape, not colour alone. */
.bar { flex: 1 1 0; min-width: 1px; height: 30%; border-radius: 1px; background: var(--bar-empty); }
.bar--ok, .bar--warn, .bar--bad { height: 100%; }
.bar--warn { height: 80%; }
.bar--bad { height: 60%; }
.bar--ok { background: var(--ok); }
.bar--warn { background: var(--warn); }
.bar--bad { background: var(--bad); }
.uptime { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; color: var(--text-2); font-size: .875rem; }
.uptime div { display: inline-flex; gap: .375rem; }
.uptime dt { color: var(--muted); }
.uptime dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--text); }

.incident { padding: 1rem; margin-bottom: .75rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.incident--open { border-color: var(--warn); }
.incident__title { margin: 0 0 .375rem; font-size: 1rem; }
.incident__meta { margin: 0 0 .5rem; color: var(--text-2); font-size: .875rem; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.updates { list-style: none; margin: .5rem 0 0; padding: 0 0 0 .875rem; border-left: 2px solid var(--border); }
.updates li { margin: 0 0 .625rem; }
.updates time, .incident__meta time { color: var(--muted); font-size: .8125rem; }
.updates p { margin: .125rem 0 0; }
.empty { color: var(--text-2); margin: 0; }
.foot { margin-top: 2.5rem; padding-bottom: 2rem; }
.foot p { margin: .25rem 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 40rem) {
  .overall__title { font-size: 1.75rem; }
  .component { padding: 1.125rem 1.25rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .overall--loading .overall__icon { animation: pulse 1.2s ease-in-out infinite alternate; }
  @keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
}
