:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #191d23;
  --panel-2: #202631;
  --text: #edf1f8;
  --muted: #9ca8ba;
  --line: rgba(255,255,255,.1);
  --brand-pink: #ee5577;
  --brand-rgb: 238, 85, 119;
  --brand-readable: #b83c5a;
  --brand-contrast: #ffffff;
  --brand: var(--brand-pink);
  --ok: #43c69a;
  --warn: #f4b860;
  --down: #ef6b73;
  --unknown: #8792a5;
}

:root[data-profile="miyako"] { --brand-pink: #9977cc; --brand-rgb: 153, 119, 204; --brand-readable: #6d4ba3; --brand-contrast: #ffffff; }
:root[data-profile="yuno"] { --brand-pink: #ee5577; --brand-rgb: 238, 85, 119; --brand-readable: #b83c5a; --brand-contrast: #ffffff; }
:root[data-profile="ritsu"] { --brand-pink: #4477cc; --brand-rgb: 68, 119, 204; --brand-readable: #2e5da7; --brand-contrast: #ffffff; }
:root[data-profile="arale"] { --brand-pink: #ffee55; --brand-rgb: 255, 238, 85; --brand-readable: #7c6b00; --brand-contrast: #2f2900; }
:root[data-profile="nonoka"] { --brand-pink: #ffbbcc; --brand-rgb: 255, 187, 204; --brand-readable: #a65c72; --brand-contrast: #4a1f2a; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f0f3f8;
  --text: #202837;
  --muted: #687487;
  --line: rgba(40,55,76,.13);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-2: #f0f3f8;
    --text: #202837;
    --muted: #687487;
    --line: rgba(40,55,76,.13);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% -12%, rgba(var(--brand-rgb), .18), transparent 32rem),
    radial-gradient(circle at 96% 100%, rgba(var(--brand-rgb), .09), transparent 34rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, "Microsoft YaHei", system-ui, sans-serif;
  transition: background-color .36s ease, color .24s ease;
}

.status-shell {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 30px 0 30px;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 30px;
  max-width: 178px;
  object-fit: contain;
  object-position: left center;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.home-link, footer a { color: var(--muted); text-decoration: none; font-weight: 650; }
.home-link:hover, footer a:hover { color: var(--brand-readable); }
select, input, button { font: inherit; }
select, input { color: var(--text); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 10px; }
button { border: 0; border-radius: 10px; padding: 9px 13px; background: var(--brand); color: var(--brand-contrast); cursor: pointer; font-weight: 750; }

.overall-card, .component, .incident, .admin-login, .admin-section {
  background: color-mix(in srgb, var(--panel) 93%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0,0,0,.12);
}

.overall-card { display: flex; align-items: flex-start; gap: 15px; padding: 24px; margin-bottom: 32px; }
.status-orb { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 9px; border-radius: 50%; background: var(--unknown); box-shadow: 0 0 0 6px color-mix(in srgb, var(--unknown) 16%, transparent); }
[data-status="operational"] .status-orb { background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 16%, transparent); }
[data-status="degraded"], [data-status="maintenance"] { --status: var(--warn); }
[data-status="outage"] { --status: var(--down); }
[data-status="degraded"] .status-orb, [data-status="maintenance"] .status-orb, [data-status="outage"] .status-orb { background: var(--status); box-shadow: 0 0 0 6px color-mix(in srgb, var(--status) 16%, transparent); }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; font-weight: 750; }
h1 { margin: 2px 0 4px; font-size: 28px; letter-spacing: -.5px; }
h2 { margin: 0; font-size: 17px; }
#overallDescription { margin: 0; color: var(--muted); }

.section { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 12px; }
time { color: var(--muted); font-size: 12px; }
.component-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.component { padding: 16px; }
.component-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.component-name { font-weight: 800; }
.badge { border-radius: 999px; padding: 3px 8px; color: var(--muted); background: var(--panel-2); font-size: 12px; font-weight: 800; }
.badge.operational { color: var(--ok); }
.badge.degraded, .badge.maintenance { color: var(--warn); }
.badge.outage { color: var(--down); }
.component-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.component-message { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.incident-list { display: grid; gap: 10px; max-height: min(60vh, 860px); overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.incident { padding: 15px 16px; border-left: 3px solid var(--unknown); }
.incident.degraded, .incident.maintenance { border-left-color: var(--warn); }
.incident.outage { border-left-color: var(--down); }
.incident.operational { border-left-color: var(--ok); }
.incident h3 { margin: 0; font-size: 15px; }
.incident p { margin: 5px 0 0; color: var(--muted); }
.incident small { display: block; margin-top: 7px; color: var(--muted); }
.empty { margin: 0; padding: 17px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }

.admin-section, .admin-login { margin-top: 30px; padding: 18px; }
.admin-hint { margin: 8px 0 14px; color: var(--muted); }
.diagnostic-grid { display: grid; gap: 9px; }
.diagnostic { display: grid; grid-template-columns: minmax(120px,1fr) auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; }
.diagnostic code { color: var(--muted); }
.admin-login form { display: grid; gap: 12px; max-width: 360px; }
.admin-login label { display: grid; gap: 6px; font-weight: 700; }
#adminError { min-height: 1.2em; margin: 0; color: var(--down); }

.status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 38px;
  padding: 18px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  color: var(--muted);
  font-size: 12px;
}

.footer-meta { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.footer-orb { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .14); }

.status-character-stage {
  position: fixed;
  right: max(18px, calc((100vw - 1280px) / 2 - 320px));
  bottom: 0;
  z-index: 0;
  width: clamp(230px, 30vw, 430px);
  height: min(71vh, 660px);
  overflow: hidden;
  pointer-events: none;
  opacity: .54;
  filter: blur(0);
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition: opacity .62s ease, filter .62s ease, transform .62s ease, visibility 0s linear;
}

.status-character-stage::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg), transparent 28%), linear-gradient(0deg, var(--bg), transparent 24%);
  content: "";
}

.status-character-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 18px 34px rgba(var(--brand-rgb), .18));
  transition: opacity .42s ease, filter .42s ease;
}

.status-character-stage img.is-changing { opacity: 0; filter: blur(14px) drop-shadow(0 18px 34px rgba(var(--brand-rgb), .14)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 860px) {
  .status-character-stage {
    visibility: hidden;
    opacity: 0;
    filter: blur(14px);
    transform: translate3d(24px, 18px, 0) scale(.98);
    transition: opacity .46s ease, filter .46s ease, transform .46s ease, visibility 0s linear .46s;
  }
}

@media (max-width: 620px) {
  .status-shell { width: min(100% - 28px, 920px); padding-top: 20px; padding-bottom: 24px; }
  .status-header { align-items: flex-start; margin-bottom: 24px; }
  .brand img { height: 27px; max-width: 152px; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
  .component-grid { grid-template-columns: 1fr; }
  .incident-list { max-height: 55vh; padding-right: 2px; }
  h1 { font-size: 23px; }
  .overall-card { padding: 18px; }
  .diagnostic { grid-template-columns: 1fr auto; }
  .diagnostic code { grid-column: 1 / -1; }
  .status-footer { align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 30px; padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* Status brand and content layering */
:root { --brand-ink: #48484a; }
.status-header, .overall-card, .section, .admin-section, .admin-login, .status-footer { position: relative; z-index: 1; }
.brand {
  gap: 8px;
  min-height: 31px;
  color: var(--brand-pink);
  font-size: 23px;
  font-weight: 850;
  letter-spacing: 0;
}
.brand .brand-logo {
  width: 31px;
  height: 31px;
  max-width: none;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand span {
  background: linear-gradient(90deg, var(--brand-ink) 0%, var(--brand-ink) 46%, var(--brand-pink) 54%, var(--brand-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (max-width: 620px) {
  .brand { font-size: 21px; }
  .brand .brand-logo { width: 27px; height: 27px; max-width: none; }
}