:root {
  --bg: #111111;
  --bg-2: #161616;
  --surface: rgba(29, 29, 29, .9);
  --surface-strong: rgba(27, 27, 27, .96);
  --surface-soft: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .13);
  --line-soft: rgba(255, 255, 255, .075);
  --text: #f6f6f6;
  --muted: #a8a8a8;
  --faint: #707070;
  --green: #e8e8e8;
  --green-soft: rgba(255, 255, 255, .11);
  --yellow: #bdbdbd;
  --yellow-soft: rgba(210, 210, 210, .1);
  --red: #f1f1f1;
  --red-soft: rgba(255, 255, 255, .09);
  --blue: #ffffff;
  --blue-soft: rgba(255, 255, 255, .1);
  --shadow: 0 18px 60px rgba(0, 0, 0, .42);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, #232323 0%, #1d1d1d 38%, #111111 100%);
  color: var(--text);
  font-family: "Titillium Web", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(115deg, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(260deg, rgba(255,255,255,.045), transparent 30%),
    radial-gradient(circle at 52% 12%, rgba(255,255,255,.055), transparent 30%);
  animation: bgShift 18s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 82%);
}
@keyframes bgShift {
  from { filter: hue-rotate(0deg); opacity: .9; }
  to { filter: hue-rotate(18deg); opacity: 1; }
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, input { letter-spacing: 0; }
button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
  color: var(--text);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.085); }
button.primary, .primary {
  border-color: rgba(255,255,255,.86);
  background: linear-gradient(180deg, #ffffff, #dcdcdc);
  color: #111111;
  font-weight: 800;
}
button.danger, .danger { border-color: rgba(255,255,255,.34); color: #ffffff; background: rgba(255,255,255,.025); }
button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button .icon,
.side-nav .icon,
.mobile-nav .icon,
.ghost .icon,
.steam-link .icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}
.runtime-actions .icon,
.tool-btn .icon {
  animation: iconBreathe 2.8s ease-in-out infinite;
}
@keyframes iconBreathe {
  0%, 100% { opacity: .78; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}
input, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 7, 10, .68);
  color: var(--text);
  padding: 0 11px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(255,255,255,.56); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
canvas { width: 100%; height: 220px; display: block; }
#status-chart { height: 180px; }

.matrix-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.matrix-bg span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: rgba(196, 206, 214, .2);
  font: 700 var(--s)/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-shadow: 0 0 18px rgba(255,255,255,.12);
  animation: hackFloat var(--t) linear var(--d) infinite;
}
@keyframes hackFloat {
  0% { opacity: 0; transform: translate3d(0, 18px, 0); }
  12% { opacity: .55; }
  55% { opacity: .22; }
  100% { opacity: 0; transform: translate3d(18px, -120px, 0); }
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #08090b;
  transition: opacity .55s ease, visibility .55s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-text {
  color: transparent;
  font: 900 24px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 6px;
  text-transform: lowercase;
  background: linear-gradient(to right, #fff 50%, #222 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fillText 2.4s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes fillText {
  0% { background-position: 100% 0; }
  50% { background-position: 0 0; }
  100% { background-position: -100% 0; }
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.reveal.revealed { opacity: 1; transform: none; }

.auth-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.auth-card h1, .topbar h1, .panel h2 {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.08;
  font-weight: 850;
}
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.eyebrow {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.form-grid { display: grid; gap: 14px; margin-top: 22px; }
.steam-login {
  display: grid;
  place-items: center;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 13px;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 9, 12, .76);
  backdrop-filter: blur(16px);
}
.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 24px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.18);
  background:
    linear-gradient(135deg, #ffffff, #7e7e7e);
  box-shadow: inset 0 0 0 10px rgba(10,10,10,.76), 0 0 24px rgba(255,255,255,.08);
}
.brand strong { display: block; color: #fff; font-size: 15px; line-height: 1.2; }
.brand em { display: block; color: var(--faint); font-size: 11px; font-style: normal; margin-top: 2px; }
.side-nav { display: grid; gap: 6px; }
.side-nav a, .ghost {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.side-nav a:hover, .ghost:hover {
  border-color: var(--line);
  background: rgba(255,255,255,.05);
  color: #fff;
}
.side-status {
  display: grid;
  gap: 6px;
  margin: 22px 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035);
}
.side-status span { color: var(--faint); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.side-status strong { color: #fff; font-size: 18px; }
.ghost { width: 100%; justify-content: center; margin-top: auto; }

.workspace {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 76px;
}
.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  grid-template-areas:
    "title runtime"
    "controls controls";
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.title-stack { grid-area: title; min-width: 0; }
.title-stack span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}
.command-strip {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(132px, 160px) repeat(4, minmax(94px, auto));
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8,10,14,.55);
}
.search-box span { color: var(--faint); font-size: 10px; text-transform: uppercase; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.runtime-actions { grid-area: runtime; display: flex; gap: 8px; justify-content: flex-end; min-width: 0; }
.runtime-actions button {
  min-width: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-weight: 850;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.metric, .panel, .account {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.metric {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 6px;
}
.metric-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: #d8d8d8;
  background: rgba(255,255,255,.04);
}
.metric-icon .icon {
  width: 18px;
  height: 18px;
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.metric span, .metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.metric strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}
.metric i {
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}
.metric.good strong { color: var(--green); }
.metric.good i { background: var(--green); }
.metric.warn strong { color: var(--yellow); }
.metric.warn i { background: var(--yellow); }
.metric.bad strong { color: var(--red); }
.metric.bad i { background: var(--red); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
  gap: 12px;
}
.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
  gap: 12px;
  align-items: stretch;
}
.chart-main,
.chart-side {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
  padding: 12px;
}
.chart-side {
  display: grid;
  grid-template-rows: 180px auto;
  gap: 10px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stats-grid div {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}
.stats-grid span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.stats-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.stats-grid strong {
  color: #fff;
  font-size: 14px;
}
.dot-white { background: #f5f5f5; }
.dot-mid { background: #777; }
.dot-light { background: #d7d7d7; }
.dot-dark { background: #3f3f3f; }
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .72fr);
  gap: 12px;
}
.panel {
  margin-bottom: 12px;
  padding: 16px;
}
.panel-head { margin-bottom: 14px; }
.panel-head.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head span, #chart-caption, #log-count {
  color: var(--muted);
  font-size: 12px;
}
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.state-pill.good { color: var(--green); border-color: rgba(74,222,128,.45); background: var(--green-soft); }
.state-pill.bad { color: var(--red); border-color: rgba(251,113,133,.45); background: var(--red-soft); }

.sys-list { display: grid; gap: 10px; }
.sys-list.mini { gap: 8px; }
.sys-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  line-height: 1;
}
.sys-key { flex: 0 0 auto; color: var(--faint); font-weight: 800; }
.sys-dots {
  min-width: 20px;
  height: 1px;
  flex: 1 1 auto;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-2px);
}
.sys-val {
  max-width: 58%;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.insight-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.insight-list div {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255,255,255,.035);
}
.insight-list span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}
.insight-list strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounts-panel { min-height: 260px; }
.account-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account {
  position: relative;
  overflow: hidden;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, .95fr) minmax(190px, .8fr);
  gap: 12px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.account:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.2); }
.account.online { border-color: rgba(74,222,128,.34); box-shadow: 0 18px 60px rgba(0,0,0,.34), 0 0 28px rgba(74,222,128,.08); }
.account.error { border-color: rgba(251,113,133,.42); }
.account-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--faint);
}
.status-dot.good { background: var(--green); box-shadow: 0 0 0 4px rgba(74,222,128,.13), 0 0 18px rgba(74,222,128,.7); animation: pulseGood 1.8s ease-in-out infinite; }
.status-dot.warn { background: var(--yellow); box-shadow: 0 0 0 4px rgba(250,204,21,.12), 0 0 16px rgba(250,204,21,.45); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(251,113,133,.12), 0 0 16px rgba(251,113,133,.45); }
@keyframes pulseGood {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: .72; }
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: cover;
  background: #05070a;
}
.persona-link, .account-main strong {
  display: block;
  overflow: hidden;
  max-width: 100%;
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.persona-link:hover { color: var(--blue); }
.account-main span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-health {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.account-health span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
}
.account-message {
  grid-column: 1 / -1;
  min-height: 17px;
  margin: -2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.game-strip img {
  width: 100%;
  aspect-ratio: 231 / 87;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  object-fit: cover;
}
.empty-chip {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--faint);
  font-size: 12px;
}
.card-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.card-actions button, .steam-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
.steam-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(125,211,252,.38);
  border-radius: var(--radius);
  color: var(--blue);
  background: var(--blue-soft);
}
.row-view {
  grid-template-columns: 1fr;
}
.row-view .account {
  grid-template-columns: minmax(250px, .8fr) minmax(220px, .7fr) minmax(280px, 1fr) auto;
  align-items: center;
}
.row-view .account-health,
.row-view .account-message,
.row-view .card-actions { grid-column: auto; }
.row-view .game-strip { grid-template-columns: repeat(4, 86px); }

.log-list {
  max-height: 456px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(5,7,10,.5);
}
.log {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.log span { color: var(--faint); }
.log code { overflow-wrap: anywhere; color: var(--muted); }
.log code b {
  display: inline-flex;
  min-width: 54px;
  margin-right: 8px;
  font-size: 10px;
  text-transform: uppercase;
}
.log.good { background: rgba(74,222,128,.045); }
.log.good code b, .ansi-green { color: var(--green); }
.log.warn { background: rgba(250,204,21,.045); }
.log.warn code b, .ansi-yellow { color: var(--yellow); }
.log.bad { background: rgba(251,113,133,.055); }
.log.bad code b, .ansi-red { color: var(--red); }
.log.neutral code b { color: var(--faint); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-grid .check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--muted);
}
.settings-grid .check input {
  width: auto;
  min-height: 0;
}

.modal {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15,18,23,.98);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0,0,0,.66);
}
.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.modal form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 13px;
  padding: 18px;
}
.modal-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.modal h2 { margin: 4px 0 0; color: #fff; }
.game-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 350px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
  background: rgba(5,7,10,.35);
}
.game-picker button {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.game-picker button.on { border-color: var(--green); box-shadow: 0 0 0 2px rgba(74,222,128,.12); }
.game-picker img {
  width: 100%;
  aspect-ratio: 231 / 87;
  display: block;
  object-fit: cover;
}
.game-picker span {
  display: block;
  overflow: hidden;
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal .primary { grid-column: 1 / -1; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(74,222,128,.45);
  border-radius: var(--radius);
  background: #111827;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}
.toast.bad { border-color: rgba(251,113,133,.5); color: #fecdd3; }
.toast.hidden { display: none; }
.notice, .empty {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.notice.bad, .bad-state {
  border-color: rgba(251,113,133,.38);
  color: #fecdd3;
  background: rgba(251,113,133,.08);
}
.skeleton { overflow: hidden; position: relative; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.mobile-nav {
  display: none;
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 40;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8,10,14,.92);
  backdrop-filter: blur(16px);
}
.mobile-nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.mobile-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }

.dense-mode .workspace { padding: 14px; }
.dense-mode .panel, .dense-mode .account, .dense-mode .metric { padding: 12px; }
.dense-mode .metric { min-height: 82px; }
.dense-mode .avatar { width: 38px; height: 38px; }
.lite-mode *, .lite-mode *::before, .lite-mode *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
.lite-mode .matrix-bg,
.lite-mode body::after { display: none; }
.lite-mode .metric,
.lite-mode .panel,
.lite-mode .account,
.lite-mode .sidebar,
.lite-mode .mobile-nav {
  backdrop-filter: none;
  box-shadow: none;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "runtime"
      "controls";
  }
  .runtime-actions { justify-content: flex-start; }
  .command-strip { grid-template-columns: minmax(220px, 1fr) minmax(132px, 160px) repeat(4, minmax(92px, 1fr)); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
  .chart-layout { grid-template-columns: minmax(0, 1fr) minmax(230px, .55fr); }
  .account-list { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-nav, .side-status { display: none; }
  .ghost { width: auto; margin: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-strip { grid-template-columns: 1fr 128px 1fr 1fr; }
  .command-strip .search-box { grid-column: 1 / -1; }
  .chart-layout { grid-template-columns: 1fr; }
  .chart-side { grid-template-rows: 170px auto; }
  #density-toggle, #lite-toggle { display: none; }
  .row-view .account, .account { grid-template-columns: 1fr; }
  .row-view .account-health,
  .row-view .account-message,
  .row-view .card-actions { grid-column: 1 / -1; }
  .mobile-nav { display: grid; }
}

@media (max-width: 620px) {
  .workspace { padding: 12px; padding-bottom: 76px; }
  .auth-card { padding: 22px; }
  .topbar h1, .panel h2 { font-size: 21px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 78px; }
  .command-strip { grid-template-columns: 1fr 1fr; }
  .search-box, #status-filter { grid-column: 1 / -1; }
  .tool-btn { min-width: 0; padding: 0 8px; }
  .runtime-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .game-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-grid, .modal form, .game-picker { grid-template-columns: 1fr; }
}
