:root {
  --bg: #000;
  --panel: #090b0e;
  --panel-2: #101318;
  --line: #20242b;
  --line-soft: #151922;
  --text: #f4f7fb;
  --muted: #7d8592;
  --muted-2: #a8b0bd;
  --green: #a855f7;
  --red: #f05dff;
  --cyan: #c084fc;
  --amber: #7c3aed;
  --purple-deep: #12051f;
  --purple-line: #4c1d95;
  --purple-glow: rgba(168, 85, 247, .32);
  --radius: 8px;
  font-family: Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
body.modal-open { overflow: hidden; }
* {
  scrollbar-width: thin;
  scrollbar-color: var(--purple-line) #050607;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050607; }
::-webkit-scrollbar-thumb {
  background: var(--purple-line);
  border: 2px solid #050607;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--green); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(6px);
}

.walrus-loader {
  height: 54px;
  display: flex;
  align-items: end;
  gap: 7px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #050607;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
}
.walrus-loader span {
  width: 11px;
  height: 18px;
  display: block;
  border-radius: 999px 999px 4px 4px;
  background: #a855f7;
  animation: heavyWalrus 780ms ease-in-out infinite;
}
.walrus-loader span:nth-child(2) { animation-delay: 90ms; background: #c084fc; }
.walrus-loader span:nth-child(3) { animation-delay: 180ms; height: 34px; background: #7c3aed; }
.walrus-loader span:nth-child(4) { animation-delay: 270ms; background: #c084fc; }
.walrus-loader span:nth-child(5) { animation-delay: 360ms; background: #a855f7; }
@keyframes heavyWalrus {
  0%, 100% { transform: translateY(0) scaleY(.72); opacity: .58; }
  45% { transform: translateY(-13px) scaleY(1.18); opacity: 1; }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(124, 58, 237, .22), transparent 28%),
    linear-gradient(180deg, rgba(76, 29, 149, .16), transparent 42%),
    #000;
}
.login-panel {
  width: min(276px, 100%);
  border: 1px solid rgba(168, 85, 247, .22);
  border-radius: 8px;
  background: #08050d;
  padding: 28px 21px 24px;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, .08), 0 24px 90px rgba(76, 29, 149, .28);
}
.pin-panel {
  position: relative;
  overflow: hidden;
}
.pin-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), inset 0 -1px 0 rgba(0, 0, 0, .54);
}
.brand-lock {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  margin-bottom: 24px;
}
.brand-lock svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-panel h1 { margin: 0 0 22px; font-size: 30px; line-height: 1.1; letter-spacing: 0; }
.pin-form {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-height: 14px;
  margin: 8px 0 23px;
}
.pin-dot {
  width: 13px;
  height: 13px;
  display: block;
  border: 1px solid rgba(192, 132, 252, .82);
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .32);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.pin-dot.is-active {
  border-color: #c084fc;
  background: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, .38);
}
.pin-label {
  margin: 0 0 27px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  min-height: 18px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pin-message.is-error-message { color: var(--red); }
.pin-native-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.pin-numbers {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 14px 18px;
  justify-content: center;
}
.pin-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(168, 85, 247, .62);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  outline: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.pin-number:hover,
.pin-number:focus-visible {
  border-color: #c084fc;
  background: rgba(168, 85, 247, .12);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, .08);
  transform: scale(1.08);
}
.pin-number:active,
.pin-number.is-pressed {
  border-color: #f0abfc;
  background: #a855f7;
  color: #07000d;
  transform: scale(1.18);
}
.pin-panel.is-error .pin-dots {
  animation: pinShake 360ms ease;
}
.pin-panel.is-error .pin-dot {
  border-color: var(--red);
  background: rgba(240, 93, 255, .28);
  box-shadow: 0 0 18px rgba(240, 93, 255, .3);
}
.pin-panel.is-success .pin-dot {
  border-color: #c084fc;
  background: #c084fc;
  animation: pinSuccess 420ms ease both;
}
.pin-panel.is-submitting .pin-number {
  pointer-events: none;
  opacity: .72;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020304;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(168, 85, 247, .88);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}
label { display: grid; gap: 7px; color: var(--muted-2); font-size: 12px; font-weight: 700; }
label span { color: var(--muted); font-weight: 600; }

.primary-btn, .secondary-btn, .ghost-btn, .add-btn, .icon-btn, .nav-item {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  color: var(--text);
  background: transparent;
}
.primary-btn { background: var(--green); color: #07000d; font-weight: 800; }
.secondary-btn { background: #11161d; border-color: var(--line); font-weight: 700; }
.ghost-btn { border-color: var(--line); background: #050607; padding: 0 14px; font-weight: 700; }
.icon-btn {
  width: 40px;
  display: grid;
  place-items: center;
  border-color: var(--line);
  background: #050607;
  color: var(--text);
  position: relative;
}
.app-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  font-size: 18px;
  line-height: 1;
}
.tooltip-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border: 1px solid var(--purple-line);
  border-radius: 7px;
  background: #09030f;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 40;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.tooltip-btn:hover .tooltip-label,
.tooltip-btn:focus-visible .tooltip-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 13px; }

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-13px); }
  40% { transform: translateX(12px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(7px); }
}

@keyframes pinSuccess {
  0% { transform: scale(1); }
  45% { transform: scale(1.42); box-shadow: 0 0 22px rgba(192, 132, 252, .54); }
  100% { transform: scale(1); }
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
  background: #030105;
  padding: 22px 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
  user-select: none;
}
.sidebar-header,
.sidebar-main,
.sidebar-footer {
  min-width: 0;
}
.sidebar-main {
  overflow: auto;
  padding-top: 4px;
}
.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #07000d;
  font-weight: 900;
}
.brand strong { display: block; font-size: 15px; }
.brand span { color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 6px; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 0 12px;
  color: var(--muted-2);
  border-color: transparent;
  background: transparent;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.nav-item .app-icon {
  color: #6f5a8c;
  transition: color 140ms ease, transform 140ms ease;
}
.nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover,
.nav-item:focus,
.nav-item:focus-visible {
  background: #07030c;
  color: var(--text);
  border-color: rgba(168, 85, 247, .38);
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .08);
}
.nav-item:hover .app-icon,
.nav-item:focus-visible .app-icon {
  color: #c084fc;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, .2), rgba(168, 85, 247, .05));
  color: var(--text);
  border-color: var(--purple-line);
  box-shadow: inset 3px 0 0 #a855f7;
}
.nav-item.active .app-icon {
  color: #c084fc;
  transform: translateX(1px);
}
.add-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #050607;
  border-color: var(--line-soft);
  font-weight: 800;
}
.add-btn:hover,
.add-btn:focus,
.add-btn:focus-visible {
  background: #050607;
  border-color: var(--line-soft);
  outline: none;
  box-shadow: none;
}
.logout-sidebar-btn {
  color: var(--muted-2);
}
.logout-sidebar-btn:hover,
.logout-sidebar-btn:focus,
.logout-sidebar-btn:focus-visible {
  color: var(--text);
  border-color: var(--purple-line);
}

.workspace { min-width: 0; padding: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.topbar span { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-add-btn {
  min-width: 176px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-color: var(--purple-line);
  background: #050607;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, .1);
}
.top-add-btn:hover,
.top-add-btn:focus,
.top-add-btn:focus-visible {
  border-color: #a855f7;
  background: #0a0311;
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .16);
}
.top-add-btn .app-icon {
  color: #c084fc;
}
.app-shell:not([data-view="bots"]) .top-add-btn {
  display: none;
}

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  display: grid;
  align-content: space-between;
}
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { font-size: 28px; line-height: 1.05; letter-spacing: 0; }
.metric small { color: var(--muted-2); font-size: 12px; }
.metric.positive strong { color: var(--green); }
.metric.negative strong { color: var(--red); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.section-head h3 { margin: 0; font-size: 16px; }
.section-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bot-card, .market-card, .trade-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.bot-card { padding: 14px; min-height: 236px; display: grid; gap: 14px; }
.bot-top { display: flex; justify-content: space-between; gap: 10px; }
.bot-title strong { display: block; font-size: 17px; }
.bot-title span { color: var(--muted); font-size: 12px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #121820;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}
.status-pill.on { color: #07000d; background: var(--green); }
.bot-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px; background: #050607; min-width: 0; }
.kv span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.kv strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.bot-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.bot-actions .icon-btn {
  width: 100%;
}
.bot-log {
  width: 100%;
  min-height: 132px;
  max-height: 260px;
  overflow: auto;
  resize: vertical;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #020304;
  color: var(--muted-2);
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  padding: 10px;
  outline: none;
  white-space: pre;
}
.bot-log:focus {
  border-color: rgba(168, 85, 247, .62);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .12);
}

.side-column { display: grid; gap: 12px; }
.market-list { display: grid; gap: 10px; }
.market-card { padding: 12px; display: grid; gap: 8px; }
.market-line { display: flex; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 12px; }
.market-line strong { color: var(--text); }
.market-spread { font-size: 22px; font-weight: 800; color: var(--cyan); }
.market-card.stale .market-spread { color: var(--amber); }
.trade-head { margin-top: 8px; }
.trades-list { display: grid; gap: 8px; }
.trade-row {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
}
.trade-row strong { font-size: 13px; }
.trade-row span { color: var(--muted); font-size: 12px; }
.trade-row .pnl { font-weight: 800; }
.pnl.positive { color: var(--green); }
.pnl.negative { color: var(--red); }

.app-shell[data-view="bots"] .metrics-grid,
.app-shell[data-view="bots"] .side-column {
  display: none;
}
.app-shell[data-view="dashboard"] .main-column {
  display: none;
}
.app-shell[data-view="dashboard"] .content-grid,
.app-shell[data-view="bots"] .content-grid,
.app-shell[data-view="trades"] .content-grid {
  grid-template-columns: minmax(0, 1fr);
}
.app-shell[data-view="dashboard"] .market-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.app-shell[data-view="dashboard"] .side-column {
  min-width: 0;
}
.app-shell[data-view="bots"] .bot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.app-shell[data-view="trades"] .metrics-grid,
.app-shell[data-view="trades"] .main-column,
.app-shell[data-view="trades"] .market-section-head,
.app-shell[data-view="trades"] .market-list {
  display: none;
}
.app-shell[data-view="trades"] .side-column {
  display: grid;
}
.app-shell[data-view="trades"] .trade-head {
  margin-top: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(9px);
  overflow: hidden;
}
.modal {
  width: min(780px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #060708;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .7);
  scrollbar-gutter: stable;
}
.modal-head, .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.bot-form { padding: 16px; display: grid; gap: 13px; }
.form-row, .proxy-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: end; }
.toggle-line { display: flex; align-items: center; gap: 8px; color: var(--muted-2); }
.toggle-line input { width: 16px; min-height: 16px; }
.proxy-result { margin: -2px 0 0; min-height: 18px; color: var(--muted-2); font-size: 12px; }
.settings-block { border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; background: #040506; }
.settings-block h4 { margin: 0 0 12px; }
.settings-block .settings-grid { margin-top: 12px; }
.settings-toggle {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}
.settings-toggle span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.settings-toggle strong {
  font-size: 14px;
}
.settings-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.settings-toggle .app-icon {
  color: var(--muted-2);
  transition: transform 140ms ease, color 140ms ease;
}
.settings-toggle:hover .app-icon,
.settings-toggle:focus-visible .app-icon {
  color: #c084fc;
}
.settings-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}
.bot-settings-block.is-expanded .settings-toggle .app-icon {
  transform: rotate(180deg);
}
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bot-config-accordion {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.bot-config-accordion .settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.checkbox-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #040506;
  padding: 14px;
}
.checkbox-section h4 {
  margin: 0;
  font-size: 14px;
}
.slimy-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slimy-check {
  position: relative;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #020304;
  color: var(--muted-2);
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.slimy-check:hover {
  border-color: rgba(168, 85, 247, .5);
  background: #07030c;
}
.slimy-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.slimy-box {
  position: relative;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid #3b2a55;
  border-radius: 9px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, .12), transparent 22%),
    linear-gradient(145deg, #050607, #14051f);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, .32),
    inset 0 -10px 16px rgba(0, 0, 0, .58),
    0 0 0 rgba(168, 85, 247, 0);
  transition: transform 160ms ease, border-radius 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.slimy-box::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px 9px 999px 10px;
  background: rgba(192, 132, 252, .16);
  opacity: 0;
  transform: scale(.55);
  transition: opacity 160ms ease, transform 160ms ease;
}
.slimy-box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms ease;
}
.slimy-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
}
.slimy-check input:checked + .slimy-box {
  border-color: #c084fc;
  border-radius: 8px 13px 9px 14px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .28), transparent 18%),
    radial-gradient(circle at 76% 72%, rgba(240, 93, 255, .8), transparent 30%),
    linear-gradient(145deg, #a855f7, #5b21b6);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    inset 0 -8px 18px rgba(45, 0, 86, .56),
    0 0 22px rgba(168, 85, 247, .22);
  transform: translateY(-1px);
}
.slimy-check input:checked + .slimy-box::before {
  opacity: 1;
  transform: scale(1);
}
.slimy-check input:checked + .slimy-box::after {
  transform: rotate(-45deg) scale(1);
}
.slimy-check:focus-within {
  border-color: rgba(168, 85, 247, .88);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}
.modal-actions { border-bottom: 0; border-top: 1px solid var(--line-soft); justify-content: flex-end; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
  }
  .sidebar-main { overflow: visible; padding-top: 0; }
  .sidebar-footer { padding-top: 0; border-top: 0; }
  nav { display: flex; }
  .add-btn { margin-top: 0; margin-left: auto; padding: 0 12px; }
}

@media (max-width: 1280px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1040px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .workspace { padding: 16px; }
  .metrics-grid, .bot-grid, .settings-grid, .form-row, .proxy-row { grid-template-columns: 1fr; }
  .app-shell[data-view="bots"] .bot-grid { grid-template-columns: 1fr; }
  .slimy-checkbox-list { grid-template-columns: 1fr; }
  .sidebar { align-items: stretch; grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .login-view { padding: 18px; }
  .pin-form { grid-template-columns: 1fr; }
  .bot-values { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .walrus-loader span,
  .pin-panel.is-error .pin-dots,
  .pin-panel.is-success .pin-dot {
    animation: none;
  }
  .pin-dot,
  .pin-number {
    transition: none;
  }
}
