:root {
  --bg: #08090c;
  --bg-grid: rgba(255, 255, 255, 0.018);
  --panel: #10131a;
  --panel-2: #161b24;
  --panel-hover: #1b222d;
  --border: #1e2632;
  --border-strong: #2a3444;
  --text: #e8eef6;
  --text-dim: #aab4c2;
  --muted: #7a8595;
  --accent: #6aa6ff;
  --green: #3fd084;
  --green-glow: rgba(63, 208, 132, 0.5);
  --yellow: #ffb83d;
  --yellow-glow: rgba(255, 184, 61, 0.45);
  --red: #ff5964;
  --red-glow: rgba(255, 89, 100, 0.5);
  --red-bg: rgba(255, 89, 100, 0.1);
  --red-bg-strong: rgba(255, 89, 100, 0.18);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 20% 0%, rgba(255, 89, 100, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, .topbar { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 19, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pulse 1.6s infinite;
}

.brand .title {
  font-size: 15px;
  font-family: var(--mono);
}
.brand .title .sub {
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.tagline {
  color: var(--text-dim);
  font-size: 13px;
  text-align: right;
  min-height: 1.5em;
  font-style: italic;
  letter-spacing: 0.01em;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--red-glow); opacity: 1; }
  70%  { box-shadow: 0 0 0 10px rgba(255, 89, 100, 0); opacity: 0.8; }
  100% { box-shadow: 0 0 0 0 rgba(255, 89, 100, 0); opacity: 1; }
}

/* ---------- Layout ---------- */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 28px 48px;
}

.section-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10.5px;
  font-weight: 600;
  margin: 0 0 12px 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  margin: 8px 0 36px;
  padding: 40px 32px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 120% at 0% 0%, rgba(255, 89, 100, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(255, 89, 100, 0.06), transparent 70%),
    linear-gradient(180deg, var(--panel), #0d1017);
  border-radius: 12px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.7;
}

.hero .tyler-wrap {
  position: absolute;
  top: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 5;
}

.hero .tyler {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--panel-2) center / cover no-repeat;
  background-image: url("images/tyler.png");
  box-shadow:
    0 0 0 4px rgba(255, 89, 100, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.hero-reboot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(180deg, #ff5964, #e63e49);
  color: white;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: default;
  box-shadow:
    0 4px 14px rgba(255, 89, 100, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateY(-8px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.35s,
    transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.2),
    filter 0.15s,
    box-shadow 0.2s;
  position: relative;
}
.hero-reboot.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: hero-reboot-pulse 2s infinite;
}
@keyframes hero-reboot-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(255, 89, 100, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
  50%      { box-shadow: 0 4px 28px rgba(255, 89, 100, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
}
.hero-reboot.hover { filter: brightness(1.12); }
.hero-reboot.clicked {
  transform: scale(0.94);
  filter: brightness(0.82);
  animation: none;
}
.hr-icon { width: 14px; height: 14px; flex-shrink: 0; }

.hero .tyler::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--red);
  opacity: 0.5;
  animation: pulse-ring 2.4s infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0;   }
}

.hero .tyler-badge {
  position: absolute;
  bottom: -6px; right: -6px;
  background: var(--red);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(255, 89, 100, 0.4);
}

.hero .answer {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 8px 0 0;
  color: var(--red);
  text-shadow: 0 0 48px rgba(255, 89, 100, 0.35);
  font-family: var(--sans);
}

.hero .answer-sub {
  color: var(--text-dim);
  font-size: 18px;
  margin-top: 10px;
  margin-bottom: 0;
  font-weight: 500;
}

.hero .answer-meta {
  display: flex;
  gap: 20px;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.hero .answer-meta span::before {
  content: "●";
  color: var(--red);
  margin-right: 6px;
  font-size: 8px;
  vertical-align: middle;
}

/* ---------- KPIs ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.kpi {
  position: relative;
  background: linear-gradient(180deg, var(--panel), #0e121a);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--muted);
}
.kpi.red::before    { background: var(--red);    box-shadow: 0 0 12px var(--red-glow); }
.kpi.yellow::before { background: var(--yellow); box-shadow: 0 0 12px var(--yellow-glow); }
.kpi.green::before  { background: var(--green);  box-shadow: 0 0 12px var(--green-glow); }

.k-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.k-label {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.k-trend {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.k-trend.up   { color: var(--red); }
.k-trend.down { color: var(--yellow); }

.k-value {
  font-size: 30px;
  font-weight: 800;
  margin-top: 10px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-family: var(--mono);
  transition: color 0.3s;
}
.k-value.k-name {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--sans);
}

.kpi.red    .k-value { color: var(--red); }
.kpi.green  .k-value { color: var(--green); }
.kpi.yellow .k-value { color: var(--yellow); }

.k-spark {
  margin-top: 8px;
  height: 28px;
}
.k-spark svg { width: 100%; height: 100%; display: block; }

.k-sub {
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 6px;
  font-family: var(--mono);
}

/* ---------- Statuses ---------- */

.statuses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 36px;
}

.svc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 6px;
  transition: background 0.15s;
}
.svc:hover { background: var(--panel-2); }

.svc .light {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.svc .light.operational { background: var(--green);  box-shadow: 0 0 8px var(--green-glow); }
.svc .light.degraded    { background: var(--yellow); box-shadow: 0 0 8px var(--yellow-glow); }
.svc .light.outage {
  background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse-light 1.4s infinite;
}
@keyframes pulse-light {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.svc-icon {
  width: 14px; height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.svc .svc-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
.svc .svc-label {
  color: var(--muted);
  font-size: 11.5px;
  margin-left: auto;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Chart ---------- */

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px 12px;
  margin-bottom: 36px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.leg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.leg-dot.sev-1 { background: var(--red);    box-shadow: 0 0 6px var(--red-glow); }
.leg-dot.sev-2 { background: var(--yellow); box-shadow: 0 0 6px var(--yellow-glow); }
.leg-dot.sev-3 { background: var(--accent); }

.chart-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}
.chart-meta strong { color: var(--text); font-weight: 600; }

.chart {
  width: 100%;
  height: 260px;
}

/* ---------- Incident table ---------- */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.table-head h2 {
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
  font-weight: 700;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border: 1px solid rgba(255, 89, 100, 0.3);
  border-radius: 20px;
  background: var(--red-bg);
}
.live-dot::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
  box-shadow: 0 0 8px var(--red-glow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 20px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  font-weight: 600;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
tbody tr:not(.expand):nth-of-type(4n+1) { background: rgba(255, 255, 255, 0.01); }
tbody tr:hover:not(.expand) { background: var(--panel-hover); }
tbody tr.new { animation: flashIn 1.4s ease-out; }

@keyframes flashIn {
  0%   { background: var(--red-bg-strong); transform: translateY(-6px); }
  60%  { background: var(--red-bg); }
  100% { background: transparent; transform: translateY(0); }
}

tbody td {
  padding: 13px 20px;
  vertical-align: middle;
}

.time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}
.sev::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
}
.sev-1 {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(255, 89, 100, 0.3);
}
.sev-1::before { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.sev-2 {
  background: rgba(255, 184, 61, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(255, 184, 61, 0.3);
}
.sev-2::before { background: var(--yellow); box-shadow: 0 0 6px var(--yellow-glow); }
.sev-3 {
  background: rgba(106, 166, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(106, 166, 255, 0.3);
}
.sev-3::before { background: var(--accent); }

.svc-col {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.summary {
  color: var(--text);
  font-weight: 500;
}

.eta {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.owner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}
.owner::before {
  content: "";
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--red) url("images/tyler.png") center / cover no-repeat;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.expand {
  display: none;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.expand.open { display: table-row; }
.expand td {
  padding: 14px 20px 16px 20px;
  font-size: 12.5px;
}
.expand .row { display: flex; flex-wrap: wrap; gap: 32px; }
.expand .label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 600;
  margin-right: 10px;
}
.expand .value {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ---------- Footer ---------- */

.footer {
  margin: 32px 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-family: var(--mono);
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer span strong { color: var(--text-dim); font-weight: 600; }

/* ---------- Responsive ---------- */

/* ---------- Tyler remote-access request (first step, centered modal) ---------- */

.tyler-request-wrap {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.35s;
}
.tyler-request-wrap.show {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
}

.tyler-request {
  width: 420px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 18px;
  background: linear-gradient(180deg, #1b2332, #10131a);
  border: 1px solid rgba(255, 89, 100, 0.5);
  border-radius: 12px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 50px rgba(255, 89, 100, 0.28);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s, transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}
.tyler-request-wrap.show .tyler-request {
  opacity: 1;
  transform: scale(1);
}

.tyler-request.shake {
  animation: tr-shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97), tr-flash 0.55s ease-out;
}
@keyframes tr-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  8%       { transform: translate(-16px, -4px) rotate(-1.2deg); }
  18%      { transform: translate(15px, 5px) rotate(1.1deg); }
  30%      { transform: translate(-13px, -5px) rotate(-1deg); }
  42%      { transform: translate(12px, 4px) rotate(0.9deg); }
  55%      { transform: translate(-10px, -3px) rotate(-0.7deg); }
  68%      { transform: translate(9px, 3px) rotate(0.6deg); }
  80%      { transform: translate(-5px, -2px) rotate(-0.3deg); }
  92%      { transform: translate(4px, 1px) rotate(0.2deg); }
}
@keyframes tr-flash {
  0%, 100% {
    border-color: rgba(255, 89, 100, 0.5);
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.6),
      0 0 0 1px rgba(255, 255, 255, 0.03),
      0 0 40px rgba(255, 89, 100, 0.22);
  }
  40% {
    border-color: rgba(255, 89, 100, 1);
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.6),
      0 0 0 2px rgba(255, 89, 100, 0.8),
      0 0 100px rgba(255, 89, 100, 0.75);
  }
}

.tr-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tr-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #333 url("images/tyler.png") center / 100% no-repeat;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: background-size 0.28s cubic-bezier(0.3, 0.1, 0.3, 1), box-shadow 0.28s;
  z-index: 2;
}
.tr-avatar::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 14px; height: 14px;
  background: var(--red);
  border: 2px solid #10131a;
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse-light 1.2s infinite;
}

.tr-body {
  flex: 1;
  min-width: 0;
}
.tr-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}
.tr-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.tr-msg {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 2px;
}

.tr-sub {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.tr-attempts {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  min-height: 14px;
}

.tr-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.tr-btn {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s, transform 0.08s, background 0.15s;
}
.tr-btn:hover  { filter: brightness(1.1); }
.tr-btn:active { transform: scale(0.97); }

.tr-deny {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.tr-deny:hover { background: rgba(255, 255, 255, 0.04); }

.tr-accept {
  background: var(--green);
  color: #062b15;
  border-color: var(--green);
  font-weight: 700;
}

/* ---------- Tyler presence (big center-top banner) ---------- */

.tyler-presence-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 199;
  pointer-events: none;
  transition: background 0.35s;
}
.tyler-presence-backdrop.show {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.tyler-presence {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%) scale(0.92);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, #1b2332, #10131a);
  border: 1px solid rgba(255, 89, 100, 0.4);
  border-radius: 14px;
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 60px rgba(255, 89, 100, 0.25);
  min-width: 460px;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.2), opacity 0.3s;
}

.tp-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ---------- Windows-style "Restart required" dialog ---------- */

.reboot-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%) scale(0.94);
  z-index: 180;
  width: 440px;
  background: #f3f3f3;
  color: #1f1f1f;
  border-radius: 10px;
  overflow: hidden;
  font-family: "Segoe UI", var(--sans);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.reboot-dialog.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.rd-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 8px 12px;
  background: #e8e8e8;
  border-bottom: 1px solid #d5d5d5;
  font-size: 12px;
}

.rd-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}
.rd-tb-icon {
  width: 14px; height: 14px;
  color: #0078d4;
}
.rd-title {
  font-weight: 600;
  font-size: 12px;
}

.rd-controls {
  display: flex;
  align-items: center;
}
.rd-ctl {
  width: 40px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #555;
  cursor: default;
}
.rd-ctl:hover { background: #dcdcdc; }
.rd-close:hover { background: #c42b1c !important; color: white; }

.rd-body {
  display: flex;
  gap: 16px;
  padding: 22px 24px 8px;
}

.rd-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff4e5;
  color: #f0a020;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rd-icon.rd-icon-danger {
  background: #fde7e9;
  color: #c42b1c;
}
.rd-icon svg { width: 22px; height: 22px; }

.rd-warn { color: #c42b1c !important; }

.rd-text {
  flex: 1;
  min-width: 0;
}
.rd-heading {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.rd-message {
  font-size: 13px;
  color: #3a3a3a;
  line-height: 1.45;
}
.rd-meta {
  font-size: 11.5px;
  color: #6a6a6a;
  margin-top: 10px;
  font-family: var(--mono);
}
.rd-meta strong { color: #1a1a1a; letter-spacing: 0.05em; }

.rd-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 20px;
}

.rd-btn {
  padding: 8px 18px;
  font-family: "Segoe UI", var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid #c7c7c7;
  cursor: default;
  min-width: 96px;
  transition: transform 0.08s, background 0.15s, box-shadow 0.15s, filter 0.12s;
}

.rd-btn-secondary {
  background: #fdfdfd;
  color: #1f1f1f;
}

.rd-btn-primary {
  background: #0078d4;
  color: white;
  border-color: #0078d4;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.25);
  animation: rd-primary-pulse 2.2s infinite;
}
@keyframes rd-primary-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(0, 120, 212, 0.25); }
  50%      { box-shadow: 0 4px 18px rgba(0, 120, 212, 0.65); }
}

.rd-btn-primary.hover {
  filter: brightness(1.08);
}
.rd-btn-primary.clicked {
  transform: scale(0.96);
  filter: brightness(0.9);
  animation: none;
}

.rd-btn-danger {
  background: #c42b1c;
  color: white;
  border-color: #c42b1c;
  position: relative;
  box-shadow: 0 2px 6px rgba(196, 43, 28, 0.3);
  animation: rd-danger-pulse 2.2s infinite;
}
@keyframes rd-danger-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(196, 43, 28, 0.3); }
  50%      { box-shadow: 0 4px 20px rgba(196, 43, 28, 0.7); }
}
.rd-btn-danger.hover { filter: brightness(1.1); }
.rd-btn-danger.clicked {
  transform: scale(0.96);
  filter: brightness(0.88);
  animation: none;
}

.rd-btn-secondary.hover {
  background: #eaeaea;
}

.rd-ripple {
  position: absolute;
  right: 90px;
  bottom: 36px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(196, 43, 28, 0.7);
  opacity: 0;
  transform: translate(50%, 50%) scale(1);
  pointer-events: none;
}
.rd-ripple.fire {
  animation: rd-ripple-anim 0.75s ease-out forwards;
}
@keyframes rd-ripple-anim {
  0%   { opacity: 1; transform: translate(50%, 50%) scale(0.4); }
  100% { opacity: 0; transform: translate(50%, 50%) scale(8);   }
}

/* ---------- Fake cursor ---------- */

.fake-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 300;
  width: 22px; height: 22px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  transition: opacity 0.25s;
}
.fake-cursor.show { opacity: 1; }
.fake-cursor.clicking svg {
  transform: scale(0.75);
  transition: transform 0.12s ease-out;
}
.fake-cursor svg {
  display: block;
  transform-origin: 10% 10%;
  transition: transform 0.18s ease-out;
}
.tyler-presence.show {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  animation: tp-shake 0.6s 0.45s ease-out;
}

@keyframes tp-shake {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  25%      { transform: translateX(calc(-50% - 6px)) translateY(0) scale(1); }
  50%      { transform: translateX(calc(-50% + 6px)) translateY(0) scale(1); }
  75%      { transform: translateX(calc(-50% - 3px)) translateY(0) scale(1); }
}

.tp-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #333 url("images/tyler.png") center / cover no-repeat;
  border: 3px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.tp-avatar::after {
  content: "";
  position: absolute;
  right: -3px; bottom: -3px;
  width: 18px; height: 18px;
  background: var(--green);
  border: 3px solid #10131a;
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green-glow);
  animation: pulse-light 1.2s infinite;
}

.tp-body { flex: 1; min-width: 0; }
.tp-title {
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tp-live {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
  animation: pulse-light 1.2s infinite;
}
.tp-sub {
  color: var(--text-dim);
  font-size: 12.5px;
  margin-top: 6px;
  font-family: var(--mono);
}
.tp-accept {
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* ---------- Remote-session warning banner ---------- */

.remote-banner {
  position: fixed;
  top: -60px;
  left: 0; right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(255, 89, 100, 0.15), rgba(255, 89, 100, 0.25), rgba(255, 89, 100, 0.15));
  border-bottom: 1px solid rgba(255, 89, 100, 0.5);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: top 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
  box-shadow: 0 0 40px rgba(255, 89, 100, 0.3);
  animation: rb-glow 1.8s infinite;
}
.remote-banner.show { top: 0; }

@keyframes rb-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 89, 100, 0.3); }
  50%      { box-shadow: 0 0 60px rgba(255, 89, 100, 0.55); }
}

.rb-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
  animation: pulse-light 1s infinite;
}
.rb-text {
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
}
.rb-meta {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: none;
  font-weight: 400;
}
.rb-meta strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Tyler-action toast variant (blue info) ---------- */

.toast.tyler-action {
  background: linear-gradient(180deg, #1a2332, #10131a);
  border-color: rgba(106, 166, 255, 0.35);
}
.toast.tyler-action::before {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(106, 166, 255, 0.6);
}
.toast.tyler-action::after { background: var(--accent); }
.toast.tyler-action .toast-avatar::after {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}
.toast.tyler-action .toast-svc {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Tyler update (fake Windows Update fullscreen) ---------- */

.tyler-update {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #0078d4;
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", var(--sans);
  opacity: 0;
  transition: opacity 0.4s;
}
.tyler-update.show {
  display: flex;
  opacity: 1;
}

.tu-inner {
  text-align: center;
  max-width: 560px;
  padding: 0 24px;
}

.tu-spinner {
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  animation: tu-spin 1s linear infinite;
}
@keyframes tu-spin {
  to { transform: rotate(360deg); }
}

.tu-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.tu-pct {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 12px;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

.tu-stage {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 28px;
  min-height: 1.4em;
}

.tu-warn {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 16px;
}

.tu-footer {
  position: absolute;
  bottom: 28px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  opacity: 0.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--mono);
}

/* ---------- BSOD ---------- */

.bsod {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #0078d4;
  color: white;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 8vw;
  font-family: "Segoe UI", var(--sans);
  opacity: 0;
  transition: opacity 0.18s;
  cursor: pointer;
  overflow: auto;
}
.bsod.show {
  display: flex;
  opacity: 1;
  animation: bsod-flash 0.4s;
}
@keyframes bsod-flash {
  0%   { background: #000; }
  50%  { background: #000; }
  100% { background: #0078d4; }
}

.bsod-inner {
  max-width: 720px;
  width: 100%;
  font-weight: 300;
}

.bsod-face {
  font-size: 140px;
  line-height: 1;
  margin-bottom: 28px;
  font-weight: 100;
}

.bsod-text {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 32px;
  font-weight: 300;
}

.bsod-pct {
  font-size: 22px;
  margin-bottom: 36px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.bsod-meta {
  display: flex;
  gap: 32px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.bsod-qr {
  width: 112px; height: 112px;
  flex-shrink: 0;
  background: white;
  padding: 8px;
  position: relative;
}

/* Generate a faux-QR pattern using radial gradients / background layers */
.bsod-qr::before {
  content: "";
  position: absolute;
  inset: 8px;
  background:
    /* Top-left finder */
    linear-gradient(black, black) 0 0 / 28px 28px no-repeat,
    linear-gradient(white, white) 4px 4px / 20px 20px no-repeat,
    linear-gradient(black, black) 8px 8px / 12px 12px no-repeat,
    /* Top-right finder */
    linear-gradient(black, black) 68px 0 / 28px 28px no-repeat,
    linear-gradient(white, white) 72px 4px / 20px 20px no-repeat,
    linear-gradient(black, black) 76px 8px / 12px 12px no-repeat,
    /* Bottom-left finder */
    linear-gradient(black, black) 0 68px / 28px 28px no-repeat,
    linear-gradient(white, white) 4px 72px / 20px 20px no-repeat,
    linear-gradient(black, black) 8px 76px / 12px 12px no-repeat,
    /* data cells as a checker-ish pattern */
    repeating-conic-gradient(black 0% 25%, white 25% 50%) 32px 32px / 32px 32px,
    white;
}

.bsod-info > div { margin-bottom: 4px; }
.bsod-url {
  margin-bottom: 12px !important;
  opacity: 0.95;
}
.bsod-section { margin-top: 16px !important; }
.bsod-info strong { font-weight: 600; }

.bsod-hint {
  margin-top: 20px;
  font-size: 12px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: var(--mono);
}

/* ---------- Toasts ---------- */

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  background: linear-gradient(180deg, #161b24, #10131a);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  color: var(--text);
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(380px);
  animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

.toast.leaving { animation: toast-out 0.3s ease-in forwards; }

@keyframes toast-in {
  0%   { opacity: 0; transform: translateX(380px); }
  60%  { opacity: 1; transform: translateX(-8px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(380px); }
}

.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.toast.sev-1::before {
  background: var(--red);
  box-shadow: 0 0 16px var(--red-glow);
}
.toast.sev-2::before {
  background: var(--yellow);
  box-shadow: 0 0 16px var(--yellow-glow);
}
.toast.sev-3::before {
  background: var(--accent);
}

.toast::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: var(--red);
  opacity: 0.5;
  animation: toast-timer 5s linear forwards;
}
.toast.sev-2::after { background: var(--yellow); }
.toast.sev-3::after { background: var(--accent); }

@keyframes toast-timer {
  0%   { width: 100%; }
  100% { width: 0; }
}

.toast-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red) url("images/tyler.png") center / cover no-repeat;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
}
.toast-avatar::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 12px; height: 12px;
  background: var(--red);
  border: 2px solid #10131a;
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse-light 1.4s infinite;
}

.toast-body { flex: 1; min-width: 0; }

.toast-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.toast-head .toast-sev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 8px;
  border: 1px solid transparent;
}
.toast.sev-1 .toast-sev {
  color: var(--red);
  border-color: rgba(255, 89, 100, 0.3);
  background: var(--red-bg);
}
.toast.sev-2 .toast-sev {
  color: var(--yellow);
  border-color: rgba(255, 184, 61, 0.3);
  background: rgba(255, 184, 61, 0.1);
}
.toast.sev-3 .toast-sev {
  color: var(--accent);
  border-color: rgba(106, 166, 255, 0.3);
  background: rgba(106, 166, 255, 0.1);
}

.toast-head .toast-svc {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.toast-head .toast-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  margin-left: auto;
}

.toast-summary {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.toast-owner {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  font-family: var(--mono);
}
.toast-owner strong { color: var(--text-dim); font-weight: 600; }

@media (max-width: 720px) {
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .toast { transform: translateY(100px); }
  @keyframes toast-in {
    0%   { opacity: 0; transform: translateY(100px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  @keyframes toast-out {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(100px); }
  }
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 28px 20px; }
  .hero .answer { font-size: 64px; }
  .hero .tyler { width: 90px; height: 90px; }
  .hero .tyler-wrap { top: 20px; right: 20px; gap: 10px; }
  .hero-reboot { padding: 7px 12px; font-size: 11px; }
  main { padding: 20px 16px 40px; }
  thead th, tbody td { padding: 10px 12px; }
  .topbar { padding: 12px 16px; }
  .tagline { font-size: 11px; }
}
