/* =========================================================
   AlertKube - page styles. Composes DS tokens only.
   Severity maps to DS status colors; spark = "firing/live".
   ========================================================= */

:root {
  --ak-critical: var(--danger);          /* #E11D48 */
  --ak-warning:  var(--warning);         /* #F59E0B */
  --ak-info:     var(--wk-blue-500);
  --ak-resolved: var(--wk-green-500);
  --ak-critical-wash: rgba(225,29,72,0.08);
  --ak-warning-wash:  rgba(245,158,11,0.10);
  --ak-info-wash:     rgba(30,100,230,0.08);
  --ak-code-bg: #0E1320;
}
[data-theme="dark"] {
  --ak-code-bg: #0B101D;
  --ak-critical-wash: rgba(225,29,72,0.14);
  --ak-warning-wash:  rgba(245,158,11,0.14);
  --ak-info-wash:     rgba(74,156,255,0.12);
}

/* ---------- scroll progress ---------- */
.ak-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--wk-gradient); transform-origin: 0 50%;
}

/* ---------- shared bits ---------- */
.ak-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ak-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--wk-spark-500);
  box-shadow: 0 0 0 0 rgba(249,115,22,0.5);
  animation: ak-pulse 1.6s var(--ease-out-quint) infinite;
}
@keyframes ak-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(249,115,22,0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(249,115,22,0); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}
@media (prefers-reduced-motion: reduce) { .ak-live { animation: none; } }

.ak-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11px/1 var(--font-sans); padding: 4px 9px; border-radius: var(--r-tag);
  background: var(--bg-muted); color: var(--fg-muted); border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.ak-iconbtn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: none; background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: background var(--d-hover) var(--ease-out-quint), color var(--d-hover) var(--ease-out-quint);
}
.ak-iconbtn:hover { background: var(--bg-muted); color: var(--fg); }
.ak-ver {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px var(--font-mono); padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--fg-muted); background: var(--bg-elevated);
  text-decoration: none; white-space: nowrap;
  transition: color var(--d-hover) var(--ease-out-quint),
              border-color var(--d-hover) var(--ease-out-quint),
              background var(--d-hover) var(--ease-out-quint);
}
.ak-ver:hover { color: var(--fg); border-color: var(--wk-blue-300, #4a9cff); background: var(--bg-muted); }
.ak-ver:focus-visible { outline: 2px solid var(--wk-blue-300, #4a9cff); outline-offset: 2px; }
.ak-ver__dot {
  width: 6px; height: 6px; border-radius: 999px; flex: 0 0 auto;
  background: #2EB67D; box-shadow: 0 0 0 3px rgba(46,182,125,0.18);
}
/* Dark mode: hero pill needs sufficient contrast - blue tint on #0B1220 is near-invisible */
[data-theme="dark"] .wk-hero__pill {
  background: rgba(74,156,255,0.12);
  color: var(--wk-blue-300);
  border-color: rgba(74,156,255,0.28);
}
/* Hero frame: add a subtle glow halo on dark to ground the floating card */
[data-theme="dark"] .wk-hero__frame {
  box-shadow:
    0 0 0 1px rgba(74,156,255,0.12),
    0 60px 120px -40px rgba(0,0,0,0.55),
    0 24px 48px -16px rgba(30,100,230,0.22),
    0 0 80px -20px rgba(30,100,230,0.18);
}
/* Hero orbs: on dark they should be more vibrant */
[data-theme="dark"] .wk-hero__orb { opacity: 0.70; }
/* Notification cards on dark: slightly more elevated */
[data-theme="dark"] .wk-hero__notif {
  background: var(--bg-elevated);
  border-color: rgba(74,156,255,0.14);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.60), 0 0 0 1px rgba(74,156,255,0.10);
}

/* ---------- hero feed (inside the tilted frame) ---------- */
.ak-feed { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.ak-feed__head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--border-soft); font-size: 13px; font-weight: 600; color: var(--fg);
}
.ak-feed__head .cluster { font: 500 11.5px var(--font-mono); color: var(--fg-muted); }
.ak-feed__list { flex: 1; overflow: hidden; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ak-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-soft);
  border-radius: var(--r-card); box-shadow: var(--shadow-xs);
}
.ak-row--resolved { opacity: 0.72; }
.ak-row__main { flex: 1; min-width: 0; }
.ak-row__title { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-row__meta { font: 400 11px var(--font-mono); color: var(--fg-muted); margin-top: 3px; }
.ak-row__sinks { display: flex; gap: 5px; flex-shrink: 0; }

/* ---------- pipeline (inset section) ---------- */
.ak-inset {
  background: var(--bg-muted); border-radius: 32px; margin: 0 32px;
  padding: 96px 0; position: relative; overflow: clip;
  /* Gradient border to separate from background */
  box-shadow: 0 0 0 1px var(--border-soft);
}
[data-theme="dark"] .ak-inset {
  background: #0d1729;
  box-shadow: 0 0 0 1px rgba(74,156,255,0.08), 0 40px 80px -32px rgba(0,0,0,0.35);
}
.ak-inset::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 540px; height: 540px;
  /* Light: slightly more visible against cream bg */
  background: radial-gradient(circle at 50% 50%, rgba(30,100,230,0.18), transparent 58%); pointer-events: none;
}
.ak-inset::after {
  content: ""; position: absolute; inset: auto auto -12% -10%; width: 480px; height: 480px;
  background: radial-gradient(circle at 50% 50%, rgba(34,197,94,0.16), transparent 58%); pointer-events: none;
}
[data-theme="dark"] .ak-inset::before {
  background: radial-gradient(circle at 50% 50%, rgba(74,156,255,0.18), transparent 58%);
}
[data-theme="dark"] .ak-inset::after {
  background: radial-gradient(circle at 50% 50%, rgba(74,222,128,0.14), transparent 58%);
}
@media (max-width: 880px) { .ak-inset { margin: 0 16px; padding: 64px 0; border-radius: 24px; } }

.ak-stages { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 40px; align-items: stretch; position: relative; }
.ak-stagelist { display: flex; flex-direction: column; gap: 8px; }
.ak-stage {
  display: flex; gap: 16px; align-items: flex-start; text-align: left;
  padding: 15px 18px; border-radius: 14px; cursor: pointer;
  border: 1px solid transparent; background: transparent; font-family: inherit;
  opacity: 0.55; position: relative; overflow: hidden; width: 100%;
  transition: opacity var(--d-layout) var(--ease-out-quint), background var(--d-layout) var(--ease-out-quint),
              border-color var(--d-layout) var(--ease-out-quint), box-shadow var(--d-layout) var(--ease-out-quint);
}
.ak-stage:hover { opacity: 0.85; }
.ak-stage.active { opacity: 1; background: var(--bg-elevated); border-color: var(--border); box-shadow: var(--shadow-sm); }
.ak-stage__num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font: 500 11.5px var(--font-mono); color: var(--fg-muted);
  transition: all var(--d-layout) var(--ease-out-quint);
}
.ak-stage.active .ak-stage__num { background: var(--wk-gradient); color: #fff; border-color: transparent; }
.ak-stage__t { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg); }
.ak-stage__d { font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); margin-top: 3px; }
.ak-stage__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--wk-gradient); }
.ak-stage.active .ak-stage__bar.run { animation: ak-fill 5000ms linear forwards; }
@keyframes ak-fill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .ak-stage.active .ak-stage__bar.run { animation: none; } }

.ak-stagepanel {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  padding: 36px; min-height: 460px; position: relative; overflow: hidden;
}
[data-theme="dark"] .ak-stagepanel {
  background: #111c2e;
  border-color: rgba(74,156,255,0.10);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(74,156,255,0.05);
}
@media (max-width: 980px) {
  .ak-stages { grid-template-columns: 1fr; }
  .ak-stagepanel { min-height: 380px; order: -1; }
}

/* pipeline stage mini-mocks */
.pv { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.pv-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-xs);
}
.pv-card--off { opacity: 0.45; }
.pv-card--off .pv-name { text-decoration: line-through; }
.pv-name { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.pv-sub { font: 400 11px var(--font-mono); color: var(--fg-muted); margin-top: 2px; }
.pv-mono { font: 500 12.5px var(--font-mono); color: var(--fg-muted); }
.pv-hash {
  align-self: center; font: 600 14px var(--font-mono); color: #fff; letter-spacing: 0.04em;
  background: var(--wk-gradient); padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 10px 22px -8px rgba(30,100,230,0.45);
}
.pv-arrow { align-self: center; color: var(--fg-subtle); line-height: 1; }
.pv-note { align-self: center; font-size: 12px; color: var(--fg-muted); }
.pv-rule {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 12px 16px; font: 500 12.5px var(--font-mono); color: var(--fg-muted);
  display: flex; align-items: center; gap: 10px; position: relative;
}
.pv-rule--hit { color: var(--fg); border-color: transparent; }
.pv-rule--hit::before {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: var(--r-card);
  background: var(--wk-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

/* ---------- architecture workflow ---------- */
.ak-arch-section {
  overflow: hidden;
}
.ak-arch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 22px;
  align-items: stretch;
}
.ak-arch-board,
.ak-arch-side {
  min-width: 0;
}
.ak-arch-board {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg-elevated) 92%, transparent), color-mix(in srgb, var(--bg-muted) 88%, transparent)),
    radial-gradient(circle at 18% 14%, rgba(30,100,230,0.14), transparent 34%),
    radial-gradient(circle at 82% 86%, rgba(34,197,94,0.14), transparent 32%);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .ak-arch-board {
  background:
    linear-gradient(135deg, rgba(17,28,46,0.96), rgba(13,23,41,0.94)),
    radial-gradient(circle at 18% 14%, rgba(74,156,255,0.16), transparent 34%),
    radial-gradient(circle at 82% 86%, rgba(74,222,128,0.14), transparent 32%);
  border-color: rgba(74,156,255,0.12);
  box-shadow: var(--shadow-xl), inset 0 0 0 1px rgba(74,156,255,0.04);
}
.ak-arch-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.24;
  pointer-events: none;
}
.ak-arch-glow--blue {
  top: -72px;
  left: 12%;
  background: var(--wk-blue-300);
}
.ak-arch-glow--green {
  right: -64px;
  bottom: 12%;
  background: var(--wk-green-300);
}
.ak-arch-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
  box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .ak-arch-row {
  background: rgba(11,18,32,0.44);
  border-color: rgba(232,238,248,0.07);
}
.ak-arch-row::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -15px;
  width: 2px;
  height: 15px;
  background: linear-gradient(180deg, var(--wk-blue-300), var(--wk-green-300));
  opacity: 0.55;
}
.ak-arch-row--storage::after {
  display: none;
}
.ak-arch-band-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.ak-arch-band-label span {
  display: inline-flex;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--wk-gradient);
  color: #fff;
  font: 700 11px/1 var(--font-mono);
}
.ak-arch-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ak-arch-arrow {
  position: relative;
  flex: 0 0 38px;
  height: 2px;
  border-radius: 2px;
  background: var(--wk-gradient);
}
.ak-arch-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--wk-green-500);
  border-right: 2px solid var(--wk-green-500);
  transform: translateY(-50%) rotate(45deg);
}
.ak-arch-node {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.ak-arch-node--compact {
  padding: 10px 12px;
}
.ak-arch-node__icon {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--ak-info-wash);
  color: var(--wk-blue-700);
}
[data-theme="dark"] .ak-arch-node__icon {
  color: var(--wk-blue-300);
}
.ak-arch-node--kube .ak-arch-node__icon {
  background: rgba(30,100,230,0.13);
}
.ak-arch-node--critical .ak-arch-node__icon {
  background: var(--ak-critical-wash);
  color: var(--ak-critical);
}
.ak-arch-node--security .ak-arch-node__icon {
  background: var(--wk-spark-wash);
  color: var(--wk-spark-text);
}
.ak-arch-node__title,
.ak-arch-node__sub {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ak-arch-node__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--fg);
}
.ak-arch-node__sub {
  margin-top: 2px;
  font: 500 11px var(--font-mono);
  color: var(--fg-muted);
}
.ak-arch-resource-cloud {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -4px;
}
.ak-arch-chip,
.ak-arch-sink,
.ak-arch-state__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--fg-muted);
  font: 700 11px/1 var(--font-sans);
  padding: 7px 10px;
  white-space: nowrap;
}
.ak-arch-row--controller {
  grid-template-columns: 142px 0.7fr 1.3fr;
  align-items: stretch;
}
.ak-arch-receiver {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.ak-arch-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ak-arch-steps::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--wk-gradient);
  opacity: 0.5;
}
.ak-arch-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 148px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
  animation: ak-arch-lift 5.8s var(--ease-in-out) infinite;
  animation-delay: calc(var(--i) * 220ms);
}
.ak-arch-step__num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--wk-gradient);
  color: #fff;
  font: 800 10px/1 var(--font-mono);
  box-shadow: 0 10px 20px -10px rgba(30,100,230,0.65);
}
.ak-arch-step__title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--fg);
}
.ak-arch-step__sub {
  display: block;
  margin-top: 5px;
  color: var(--fg-muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.ak-arch-sweeper {
  grid-column: 2 / 4;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  margin-top: 2px;
  color: var(--wk-green-700);
  font: 700 12px var(--font-sans);
}
[data-theme="dark"] .ak-arch-sweeper {
  color: var(--wk-green-300);
}
.ak-arch-row--storage {
  grid-template-columns: 142px minmax(0, 1fr);
}
.ak-arch-sinks,
.ak-arch-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ak-arch-state {
  grid-column: 2;
  margin-top: -2px;
}
.ak-arch-sink {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--wk-spark-500) 26%, var(--border));
  background: color-mix(in srgb, var(--wk-spark-wash) 54%, var(--bg-elevated));
  animation: ak-arch-sink-pop 5.8s var(--ease-in-out) infinite;
  animation-delay: calc(1.7s + var(--i) * 80ms);
}
.ak-arch-state__item {
  border-radius: 12px;
  background: var(--bg-elevated);
}
.ak-arch-packet {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--wk-spark-500);
  box-shadow: 0 0 0 6px rgba(249,115,22,0.14), 0 0 24px rgba(249,115,22,0.5);
  opacity: 0;
  pointer-events: none;
}
.ak-arch-packet--one {
  top: 19%;
  left: 23%;
  animation: ak-arch-packet-one 4.8s linear infinite;
}
.ak-arch-packet--two {
  top: 50%;
  left: 35%;
  animation: ak-arch-packet-two 5.2s linear infinite 0.8s;
}
.ak-arch-packet--three {
  bottom: 22%;
  left: 55%;
  animation: ak-arch-packet-three 5.4s linear infinite 1.3s;
}
.ak-arch-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ak-arch-ref,
.ak-arch-posture {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .ak-arch-ref,
[data-theme="dark"] .ak-arch-posture {
  border-color: rgba(74,156,255,0.11);
}
.ak-arch-ref__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg);
  font-size: 12px;
  font-weight: 800;
}
.ak-arch-ref__bar a {
  color: var(--wk-blue-700);
  font-weight: 700;
}
[data-theme="dark"] .ak-arch-ref__bar a {
  color: var(--wk-blue-300);
}
.ak-arch-ref img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  background: var(--bg-muted);
}
.ak-arch-posture {
  padding: 20px;
}
.ak-arch-posture h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.012em;
}
.ak-arch-posture ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.ak-arch-posture li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.42;
}
.ak-arch-posture li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--wk-green-500);
}
@keyframes ak-arch-lift {
  0%, 70%, 100% { transform: translateY(0); border-color: var(--border); }
  14%, 24% { transform: translateY(-5px); border-color: rgba(30,100,230,0.35); }
}
@keyframes ak-arch-sink-pop {
  0%, 68%, 100% { transform: translateY(0); }
  76%, 84% { transform: translateY(-3px); }
}
@keyframes ak-arch-packet-one {
  0% { opacity: 0; transform: translate(0, 0); }
  12% { opacity: 1; }
  58% { opacity: 1; transform: translate(260px, 0); }
  72% { opacity: 0; transform: translate(300px, 88px); }
  100% { opacity: 0; transform: translate(300px, 88px); }
}
@keyframes ak-arch-packet-two {
  0% { opacity: 0; transform: translate(0, 0); }
  14% { opacity: 1; }
  64% { opacity: 1; transform: translate(300px, 0); }
  86% { opacity: 0; transform: translate(360px, 90px); }
  100% { opacity: 0; transform: translate(360px, 90px); }
}
@keyframes ak-arch-packet-three {
  0% { opacity: 0; transform: translate(0, 0); }
  16% { opacity: 1; }
  72% { opacity: 1; transform: translate(220px, 0); }
  90% { opacity: 0; transform: translate(260px, 0); }
  100% { opacity: 0; transform: translate(260px, 0); }
}
@media (max-width: 1120px) {
  .ak-arch-layout {
    grid-template-columns: 1fr;
  }
  .ak-arch-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .ak-arch-row,
  .ak-arch-row--controller,
  .ak-arch-row--storage {
    grid-template-columns: 1fr;
  }
  .ak-arch-resource-cloud,
  .ak-arch-sweeper,
  .ak-arch-state {
    grid-column: auto;
  }
  .ak-arch-steps {
    grid-template-columns: 1fr;
  }
  .ak-arch-steps::before {
    left: 24px;
    right: auto;
    top: 24px;
    bottom: 24px;
    width: 2px;
    height: auto;
  }
  .ak-arch-step {
    min-height: auto;
    flex-direction: row;
  }
  .ak-arch-entry {
    flex-wrap: wrap;
  }
}
@media (max-width: 680px) {
  .ak-arch-board {
    padding: 12px;
    border-radius: 18px;
  }
  .ak-arch-row {
    padding: 13px;
  }
  .ak-arch-side {
    grid-template-columns: 1fr;
  }
  .ak-arch-node,
  .ak-arch-entry {
    width: 100%;
  }
  .ak-arch-arrow {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ak-arch-step,
  .ak-arch-sink,
  .ak-arch-packet {
    animation: none;
  }
  .ak-arch-packet {
    display: none;
  }
}

/* ---------- severity cards ---------- */
.ak-sev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 880px) { .ak-sev-grid { grid-template-columns: 1fr; } }
.ak-sev {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px;
  padding: 26px; position: relative; overflow: hidden; height: 100%;
  display: flex; flex-direction: column;
  transition: transform var(--d-hover) var(--ease-out-quint), box-shadow var(--d-hover) var(--ease-out-quint);
}
/* Severity color top bar accent */
.ak-sev::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 20px 20px 0 0;
}
.ak-sev--critical::before { background: var(--ak-critical); }
.ak-sev--warning::before  { background: var(--ak-warning); }
.ak-sev--info::before     { background: var(--ak-info); }

/* Light mode: colored shadows need more opacity to show on white surfaces */
.ak-sev--critical { box-shadow: 0 18px 44px -18px rgba(225,29,72,0.40); }
.ak-sev--warning  { box-shadow: 0 18px 44px -18px rgba(245,158,11,0.40); }
.ak-sev--info     { box-shadow: 0 18px 44px -18px rgba(30,100,230,0.36); }
.ak-sev:hover { transform: translateY(-4px); }
.ak-sev--critical:hover { box-shadow: 0 28px 60px -18px rgba(225,29,72,0.58); }
.ak-sev--warning:hover  { box-shadow: 0 28px 60px -18px rgba(245,158,11,0.58); }
.ak-sev--info:hover     { box-shadow: 0 28px 60px -18px rgba(30,100,230,0.55); }

/* Dark mode: stronger colored shadow since bg is nearly black */
[data-theme="dark"] .ak-sev--critical { box-shadow: 0 20px 50px -18px rgba(225,29,72,0.48); }
[data-theme="dark"] .ak-sev--warning  { box-shadow: 0 20px 50px -18px rgba(245,158,11,0.45); }
[data-theme="dark"] .ak-sev--info     { box-shadow: 0 20px 50px -18px rgba(74,156,255,0.40); }
[data-theme="dark"] .ak-sev--critical:hover { box-shadow: 0 30px 64px -18px rgba(225,29,72,0.62); }
[data-theme="dark"] .ak-sev--warning:hover  { box-shadow: 0 30px 64px -18px rgba(245,158,11,0.58); }
[data-theme="dark"] .ak-sev--info:hover     { box-shadow: 0 30px 64px -18px rgba(74,156,255,0.55); }
.ak-sev__head { display: flex; align-items: center; gap: 10px; }
.ak-sev__name { font: 700 12px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; }
.ak-sev__hex { margin-left: auto; font: 500 11.5px var(--font-mono); color: var(--fg-subtle); }
.ak-sev__tagline { font-size: 13.5px; color: var(--fg-muted); margin-top: 10px; }
.ak-sev__list { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ak-sev__list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; color: var(--fg); }
.ak-sev__list li .ak-dot { width: 6px; height: 6px; }
.ak-sev__route {
  margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--border);
  font: 500 12px var(--font-mono); color: var(--fg-muted);
  display: flex; align-items: center; gap: 8px;
}
.ak-sev__list { padding-bottom: 20px; }

/* ---------- watchers grid ---------- */
.ak-wgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.ak-wtile {
  grid-column: span 2;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--d-hover) var(--ease-out-quint), box-shadow var(--d-hover) var(--ease-out-quint);
}
.ak-wtile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ak-wtile::before {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(30,100,230,0.40), rgba(34,197,94,0.40));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 220ms; pointer-events: none;
}
[data-theme="dark"] .ak-wtile::before {
  background: linear-gradient(135deg, rgba(74,156,255,0.42), rgba(74,222,128,0.38));
}
.ak-wtile:hover::before { opacity: 1; }
.ak-wtile--feat { grid-column: span 3; }
.ak-wtile--wide { grid-column: span 4; }
.ak-wtile--dash { border-style: dashed; }
.ak-wtile h3 { font-weight: 700; font-size: 19px; letter-spacing: -0.012em; line-height: 1.15; margin: 12px 0 6px; }
.ak-wtile p { font-size: 13.5px; color: var(--fg-muted); margin: 0; line-height: 1.5; }
.ak-wtile .thead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ak-wtile .file { font: 500 11px var(--font-mono); color: var(--fg-subtle); }
.ak-wtile .ic-chip {
  width: 32px; height: 32px; border-radius: 10px; background: var(--bg-muted);
  display: inline-flex; align-items: center; justify-content: center; color: var(--fg);
}
.ak-wtile .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ak-wtile--feat .tags, .ak-wtile .tags { margin-top: auto; padding-top: 14px; }
.ak-wtile .minis { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
@media (max-width: 980px) {
  .ak-wgrid { grid-template-columns: repeat(2, 1fr); }
  .ak-wtile, .ak-wtile--wide { grid-column: span 1; }
  .ak-wtile--feat { grid-column: span 2; }
}
@media (max-width: 640px) {
  .ak-wgrid { grid-template-columns: 1fr; }
  .ak-wtile, .ak-wtile--feat, .ak-wtile--wide { grid-column: span 1; }
}

/* ---------- sinks table ---------- */
.ak-tablewrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
.ak-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 760px; }
.ak-table th {
  text-align: left; font: 600 11px/1 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted); padding: 14px 18px; background: var(--bg-muted); border-bottom: 1px solid var(--border);
}
.ak-table td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); vertical-align: top; color: var(--fg-muted); }
.ak-table td:first-child { font-weight: 700; color: var(--fg); }
.ak-table tr:last-child td { border-bottom: 0; }
.ak-table tbody tr { transition: background var(--d-hover) var(--ease-out-quint); }
.ak-table tbody tr:hover { background: color-mix(in srgb, var(--bg-muted) 55%, transparent); }
.ak-table .env { font: 400 12px var(--font-mono); color: var(--fg-subtle); }

/* ---------- code cards ---------- */
.ak-code {
  background: var(--ak-code-bg); border-radius: 16px;
  border: 1px solid rgba(232,234,242,0.10);
  overflow: hidden; box-shadow: var(--shadow-md);
}
[data-theme="dark"] .ak-code {
  border-color: rgba(74,156,255,0.12);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(74,156,255,0.06);
}
.ak-code__bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(232,234,242,0.08);
  background: rgba(0,0,0,0.18);
}
.ak-code__file { font: 500 12px var(--font-mono); color: rgba(232,234,242,0.55); margin-right: auto; }
.ak-code__copy {
  font: 600 11.5px var(--font-sans); color: rgba(232,234,242,0.75); background: rgba(244,244,238,0.08);
  border: none; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: background var(--d-hover) var(--ease-out-quint), color var(--d-hover) var(--ease-out-quint);
}
.ak-code__copy:hover { background: rgba(244,244,238,0.16); color: #fff; }
.ak-code pre { margin: 0; padding: 18px 20px; overflow-x: auto; }
.ak-code code { font: 400 13px/1.7 var(--font-mono); color: #E8EAF2; }
.y-k { color: #4A9CFF; } .y-v { color: #8FE9AE; } .y-c { color: rgba(232,234,242,0.40); }
.sh-v { color: #4ADE80; } .sh-cmd { color: #4A9CFF; font-weight: 600; } .sh-c { color: rgba(232,234,242,0.40); }

/* config key list */
.ak-keys { margin: 24px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ak-keys li {
  display: flex; align-items: baseline; gap: 14px; padding: 10px 12px; border-radius: 10px;
  transition: background var(--d-hover) var(--ease-out-quint);
}
.ak-keys li:hover { background: var(--bg-muted); }
.ak-keys .k { font: 600 13px var(--font-mono); color: var(--wk-blue-700); min-width: 110px; }
[data-theme="dark"] .ak-keys .k { color: var(--wk-blue-300); }
.ak-keys .v { font-size: 14px; color: var(--fg-muted); }

/* ---------- changelog ---------- */
.ak-timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 36px; display: flex; flex-direction: column; gap: 20px; }
.ak-timeline::before {
  content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px;
  background: var(--wk-gradient); opacity: 0.40; border-radius: 2px;
}
[data-theme="dark"] .ak-timeline::before { opacity: 0.55; }
.ak-release { position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px; padding: 24px 28px;
  transition: transform var(--d-hover) var(--ease-out-quint), box-shadow var(--d-hover) var(--ease-out-quint); }
.ak-release:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ak-release__dot {
  position: absolute; left: -36px; top: 28px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-elevated); border: 2px solid var(--wk-green-500);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.14);
}
.ak-release--latest .ak-release__dot { border-color: var(--wk-spark-500); box-shadow: 0 0 0 4px rgba(249,115,22,0.16); }
.ak-release__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ak-release__v { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.ak-release__date { font: 500 12px var(--font-mono); color: var(--fg-subtle); }
.ak-release ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.ak-release ul li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--fg-muted); }
.ak-release ul li svg { color: var(--wk-green-500); flex-shrink: 0; margin-top: 2px; }
@media (max-width: 720px) { .ak-release ul { grid-template-columns: 1fr; } }

/* ---------- install grid ---------- */
.ak-install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 880px) { .ak-install-grid { grid-template-columns: 1fr; } }

/* ---------- config grid ---------- */
.ak-config-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
@media (max-width: 980px) { .ak-config-grid { grid-template-columns: 1fr; gap: 36px; } }
