/* AOM local console — standard CSS only, no external fonts or assets. */

:root {
  color-scheme: dark;
  --bg: #080b10;
  --bg-soft: #0c1118;
  --panel: rgba(16, 22, 30, 0.84);
  --panel-solid: #10161e;
  --panel-2: #141c26;
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.22);
  --text: #edf2f7;
  --text-soft: #c1ccd9;
  --muted: #7f8ea3;
  --muted-2: #5c6b7e;
  --mint: #72f1b8;
  --mint-dim: rgba(114, 241, 184, 0.12);
  --blue: #7db7ff;
  --blue-dim: rgba(125, 183, 255, 0.12);
  --amber: #f6c76a;
  --amber-dim: rgba(246, 199, 106, 0.12);
  --rose: #ff8b9b;
  --rose-dim: rgba(255, 139, 155, 0.12);
  --red: #ff5d6c;
  --red-deep: #d93e50;
  --red-dim: rgba(255, 93, 108, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 16px;
  --radius-sm: 10px;
  --font-sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
               "Hiragino Sans GB", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono",
               Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(52, 211, 153, 0.07), transparent 60%),
    radial-gradient(900px 520px at 0% 20%, rgba(59, 130, 246, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 78%);
  z-index: 0;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: .6;
}
.ambient-a { width: 360px; height: 360px; background: rgba(114, 241, 184, .06); top: 80px; right: 8%; }
.ambient-b { width: 300px; height: 300px; background: rgba(125, 183, 255, .05); bottom: 5%; left: 2%; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
code {
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--text-soft);
  background: rgba(148, 163, 184, .09);
  border: 1px solid rgba(148, 163, 184, .10);
  padding: 1px 5px;
  border-radius: 5px;
  word-break: break-all;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================== top bar ============================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 208px; }
.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #1b2a25, #0f171f);
  border: 1px solid rgba(114, 241, 184, .28);
  color: var(--mint);
  font: 700 17px/1 var(--font-mono);
  letter-spacing: -1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.3);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(114, 241, 184, .12);
  border-radius: 8px;
}
.brand-mark span { color: var(--text-soft); }
.brand-copy h1 { margin: 0; font-size: 16px; letter-spacing: .02em; line-height: 1.35; font-weight: 650; }
.brand-copy h1 span { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .12em; margin-left: 4px; }
.brand-copy p { margin: 2px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .03em; }

.status-strip {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.status-chip {
  min-width: 84px;
  padding: 7px 12px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}
.status-chip.wide { min-width: 132px; }
.chip-label {
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: .11em;
  text-transform: uppercase;
  font-weight: 600;
}
.utc-tag { font-size: 8px; padding: 1px 3px; border-radius: 3px; background: rgba(148,163,184,.09); color: var(--muted); letter-spacing: .04em; }
.chip-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-value { color: var(--mint); }
#daily-loss.neg { color: var(--rose); }
#daily-loss.pos { color: var(--mint); }
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(148,163,184,.06);
}
.dot.live { background: var(--mint); box-shadow: 0 0 0 3px rgba(114,241,184,.10); animation: pulse 1.8s infinite; }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(246,199,106,.10); }
.dot.error { background: var(--red); box-shadow: 0 0 0 3px rgba(255,93,108,.10); }
.dot.done { background: var(--blue); box-shadow: 0 0 0 3px rgba(125,183,255,.10); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.server-clock { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.045); }
.icon-btn.spinning .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== kill banner ============================== */
.kill-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 93, 108, .32);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,93,108,.14), rgba(255,93,108,.045));
  color: #ffc9ce;
  font-size: 12.5px;
}
.kill-banner .icon { color: var(--red); width: 18px; height: 18px; }
.kill-banner strong { margin-right: 8px; color: #ffe2e5; }
.kill-banner > div { display: flex; flex-wrap: wrap; gap: 4px 10px; flex: 1; }
.banner-link { color: #ffd6da; font-size: 12px; text-decoration: none; border-bottom: 1px dashed rgba(255,214,218,.4); }

/* ============================== tabs ============================== */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 14px 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}
.tab .icon { width: 15px; height: 15px; opacity: .85; }
.tab:hover { color: var(--text-soft); }
.tab.is-active { color: var(--text); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--mint), rgba(114,241,184,.2));
  box-shadow: 0 0 16px rgba(114,241,184,.25);
}

.content { padding: 28px 0 52px; }

/* ============================== pages ============================== */
.view { display: none; animation: rise .24s ease; }
.view.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--mint);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .78;
}
.page-head h2 { margin: 0; font-size: clamp(22px, 2.2vw, 29px); line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
.page-sub { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; max-width: 760px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.data-badge .icon { width: 13px; height: 13px; }
.danger-badge { color: var(--rose); border-color: rgba(255,139,155,.2); background: var(--red-dim); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid rgba(246,199,106,.20);
  border-radius: 12px;
  background: rgba(246,199,106,.07);
  color: #f8dca2;
  font-size: 12.5px;
}
.alert .icon { margin-top: 2px; color: var(--amber); width: 17px; height: 17px; }
.alert > div { display: flex; flex-direction: column; gap: 2px; }
.alert strong { color: #ffe8b9; }
.alert span { color: rgba(248,220,162,.78); }
#kill-alert { border-color: rgba(255,93,108,.24); background: var(--red-dim); color: #ffc9ce; }
#kill-alert .icon { color: var(--red); }
#kill-alert strong { color: #ffe2e5; }

/* ============================== panels ============================== */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(21, 29, 39, .9), rgba(13, 19, 26, .84));
  box-shadow: 0 1px 0 rgba(255,255,255,.025), 0 16px 44px rgba(0,0,0,.16);
  padding: 19px;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  pointer-events: none;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-kicker { margin: 0 0 3px; color: var(--muted-2); font: 600 9px/1.2 var(--font-mono); letter-spacing: .14em; }
.panel h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.soft-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(148,163,184,.07);
  border: 1px solid rgba(148,163,184,.10);
  color: var(--muted);
  font: 600 9px/1.4 var(--font-mono);
  letter-spacing: .08em;
  white-space: nowrap;
}
.text-link { color: var(--mint); text-decoration: none; font-size: 11.5px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .9fr); gap: 16px; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ============================== performance ============================== */
.performance-panel { min-height: 364px; padding: 22px; background: linear-gradient(155deg, rgba(20, 34, 31, .92), rgba(12, 18, 24, .88) 58%); }
.big-number { margin: 10px 0 16px; font: 500 clamp(34px, 4vw, 48px)/1.05 var(--font-mono); letter-spacing: -.045em; color: var(--text); }
.big-number span { color: var(--muted); font-size: 12px; letter-spacing: .04em; margin-left: 4px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.metric { padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.022); border: 1px solid rgba(255,255,255,.045); }
.metric-label { display: block; color: var(--muted-2); font-size: 9.5px; letter-spacing: .04em; margin-bottom: 3px; }
.metric strong { font: 600 14px/1.2 var(--font-mono); }
.curve-wrap { position: relative; margin-top: 8px; }
.curve { display: block; width: 100%; height: 136px; overflow: visible; }
.curve-line { fill: none; stroke: var(--mint); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 8px rgba(114,241,184,.25)); }
.curve-area { fill: url(#curve-fill); stroke: none; }
.curve-empty { position: absolute; inset: 28px 0 30px; display: grid; place-items: center; color: var(--muted-2); font-size: 11.5px; border: 1px dashed rgba(148,163,184,.12); border-radius: 8px; }
.curve-axis { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 9px; margin-top: 8px; letter-spacing: .04em; }

/* ============================== engine ============================== */
.engine-panel { display: flex; flex-direction: column; }
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(148,163,184,.05);
  font: 600 9.5px/1.3 var(--font-mono);
  white-space: nowrap;
}
.state-pill.live { color: var(--mint); background: var(--mint-dim); border-color: rgba(114,241,184,.22); }
.state-pill.warn { color: var(--amber); background: var(--amber-dim); border-color: rgba(246,199,106,.22); }
.state-pill.error { color: var(--rose); background: var(--rose-dim); border-color: rgba(255,139,155,.22); }
.state-pill.done { color: var(--blue); background: var(--blue-dim); border-color: rgba(125,183,255,.22); }

.engine-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 13px; }
.engine-meta > div { padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.022); border: 1px solid rgba(255,255,255,.04); }
.engine-meta span { display: block; color: var(--muted-2); font-size: 9.5px; margin-bottom: 2px; }
.engine-meta strong { font-size: 11.5px; color: var(--text-soft); font-weight: 600; word-break: break-word; }
.engine-reason { margin: 0 0 12px; padding: 9px 11px; border: 1px solid rgba(246,199,106,.18); border-radius: 8px; background: var(--amber-dim); color: #f8dca2; font-size: 11.5px; }
.field.compact { margin-bottom: 11px; }
.field.compact input { padding: 8px 10px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.engine-panel .button-row { margin-top: auto; }
.hint { margin: 10px 0 0; color: var(--muted-2); font-size: 10.5px; line-height: 1.6; }

/* ============================== buttons / fields ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 35px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.btn .icon { width: 14px; height: 14px; }
.btn:hover:not(:disabled) { background: rgba(255,255,255,.065); border-color: rgba(148,163,184,.34); color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary {
  color: #062318;
  border-color: transparent;
  background: linear-gradient(180deg, #8ff8c8, #67dfa7);
  box-shadow: 0 8px 22px rgba(72, 224, 160, .13), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #a7ffda, #7aefb9); color: #041b12; border-color: transparent; }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-danger { color: #2b060a; border-color: transparent; background: linear-gradient(180deg, #ff8d98, #ff5d6c); box-shadow: 0 8px 24px rgba(255,93,108,.16); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(180deg, #ffa8b1, #ff7080); color: #260408; border-color: transparent; }
.btn-block { width: 100%; margin-top: 14px; }
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 13px; height: 13px; border: 2px solid rgba(0,0,0,.22); border-top-color: rgba(0,0,0,.65); border-radius: 50%; animation: spin .7s linear infinite; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.optional { color: var(--muted-2); font-size: 9.5px; font-weight: 400; margin-left: 3px; }
.field-hint { color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 8, 12, .34);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
input::placeholder { color: var(--muted-2); opacity: .72; }
input:focus, select:focus { border-color: rgba(114,241,184,.45); background: rgba(4,8,12,.5); box-shadow: 0 0 0 3px rgba(114,241,184,.07); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.readonly-field { min-height: 37px; display: flex; align-items: center; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; background: rgba(255,255,255,.015); }

/* ============================== stats ============================== */
.stat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  row-gap: 3px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  min-height: 96px;
}
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; grid-row: span 2; align-self: center; }
.stat-icon .icon { width: 15px; height: 15px; }
.stat-icon.mint { color: var(--mint); background: var(--mint-dim); }
.stat-icon.blue { color: var(--blue); background: var(--blue-dim); }
.stat-icon.amber { color: var(--amber); background: var(--amber-dim); }
.stat-icon.rose { color: var(--rose); background: var(--rose-dim); }
.stat-label { color: var(--muted); font-size: 9.5px; letter-spacing: .02em; }
.stat-card strong { font: 600 18px/1.15 var(--font-mono); letter-spacing: -.025em; color: var(--text); }
.stat-card strong em { color: var(--muted-2); font-size: 11px; font-style: normal; font-weight: 500; }
.stat-foot { grid-column: 2; color: var(--muted-2); font-size: 9px; line-height: 1.35; }
.stat-card strong.neg { color: var(--rose); }
.stat-card strong.pos { color: var(--mint); }

/* ============================== tables ============================== */
.table-panel { padding: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.data-table th {
  padding: 11px 13px;
  text-align: left;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.data-table td { padding: 11px 13px; border-bottom: 1px solid rgba(148,163,184,.065); color: var(--text-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(255,255,255,.017); }
.data-table .empty-cell { padding: 34px 16px; text-align: center; color: var(--muted-2); font-size: 11px; }
.compact-table td, .compact-table th { padding: 9px 12px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; }
.table-foot span:first-child { color: var(--muted); font-family: var(--font-mono); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  white-space: nowrap;
}
.tag.long { color: var(--mint); border-color: rgba(114,241,184,.22); background: var(--mint-dim); }
.tag.short { color: var(--rose); border-color: rgba(255,139,155,.22); background: var(--rose-dim); }
.tag.blue { color: var(--blue); border-color: rgba(125,183,255,.22); background: var(--blue-dim); }
.tag.amber { color: var(--amber); border-color: rgba(246,199,106,.22); background: var(--amber-dim); }
.tag.red { color: var(--rose); border-color: rgba(255,139,155,.22); background: var(--rose-dim); }
.tag.muted { color: var(--muted-2); }
.pnl-pos { color: var(--mint) !important; font-family: var(--font-mono); }
.pnl-neg { color: var(--rose) !important; font-family: var(--font-mono); }
.pnl-flat { color: var(--muted) !important; font-family: var(--font-mono); }
.cell-time { white-space: nowrap; font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.muted-cell { color: var(--muted) !important; }
.unit { color: var(--muted-2); font-size: .82em; margin-left: 1px; }

/* ============================== positions preview ============================== */
.position-list { display: flex; flex-direction: column; gap: 7px; }
.position-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.018);
}
.position-row .pos-main { display: flex; flex-direction: column; gap: 1px; }
.position-row .pos-main strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.position-row .pos-main span { color: var(--muted-2); font-size: 9px; }
.position-row .pos-pnl { text-align: right; font: 600 12px/1.2 var(--font-mono); }
.empty-block { padding: 30px 16px; text-align: center; color: var(--muted-2); font-size: 11px; border: 1px dashed rgba(148,163,184,.10); border-radius: 9px; }

/* ============================== risk summary ============================== */
.risk-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0; }
.risk-summary-item { padding: 15px 18px; border-right: 1px solid var(--line); }
.risk-summary-item:last-child { border-right: 0; }
.risk-summary-item span { display: block; color: var(--muted-2); font-size: 9.5px; margin-bottom: 4px; }
.risk-summary-item strong { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* ============================== settings ============================== */
.form-section { margin-bottom: 14px; padding: 21px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-head > div { display: flex; align-items: center; gap: 10px; }
.section-head h3 { font-size: 14px; }
.section-head p { margin: 1px 0 0; max-width: 380px; text-align: right; color: var(--muted-2); font-size: 10.5px; }
.section-no { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--mint); font: 600 9px/1 var(--font-mono); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.trade-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 17px; }
.mode-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
  color: var(--text-soft);
  font-family: var(--font-sans);
  cursor: default;
}
.mode-card.is-selected { border-color: rgba(114,241,184,.25); background: rgba(114,241,184,.055); }
.mode-card.is-disabled { opacity: .57; }
.mode-card > div { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.mode-card strong { font-size: 11.5px; font-weight: 600; }
.mode-card small { color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.mode-card.is-selected .mode-dot { background: var(--mint); box-shadow: 0 0 0 3px rgba(114,241,184,.10); }
.mode-tag { font: 600 8px/1.4 var(--font-mono); color: var(--muted-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; white-space: nowrap; }
.mode-card.is-selected .mode-tag { color: var(--mint); border-color: rgba(114,241,184,.2); }
.toggle-list { margin-top: 17px; border-top: 1px solid var(--line); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid rgba(148,163,184,.06); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.toggle-row strong { font-size: 11.5px; font-weight: 600; }
.toggle-row small { color: var(--muted-2); font-size: 9.5px; }
.toggle-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { position: relative; width: 34px; height: 19px; border-radius: 20px; background: rgba(148,163,184,.16); border: 1px solid rgba(148,163,184,.14); flex: none; transition: .18s ease; }
.switch::after { content: ""; position: absolute; width: 13px; height: 13px; top: 2px; left: 2px; border-radius: 50%; background: #8794a7; transition: .18s ease; }
.toggle-row input:checked + .switch { background: rgba(114,241,184,.25); border-color: rgba(114,241,184,.3); }
.toggle-row input:checked + .switch::after { left: 17px; background: var(--mint); box-shadow: 0 0 8px rgba(114,241,184,.35); }
.toggle-row.is-disabled { opacity: .48; cursor: not-allowed; }
.save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(12, 17, 24, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.save-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10.5px; }
.save-note .icon { color: var(--mint); width: 14px; height: 14px; }
.save-note.dirty { color: var(--amber); }
.save-note.dirty .icon { color: var(--amber); }
.footnote { color: var(--muted-2); font-size: 10px; line-height: 1.7; margin: 16px 4px 0; }

/* ============================== secrets ============================== */
.security-banner {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(114,241,184,.16);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(114,241,184,.07), rgba(114,241,184,.02));
}
.security-banner .icon { width: 21px; height: 21px; color: var(--mint); margin-top: 1px; }
.security-banner > div { display: flex; flex-direction: column; gap: 3px; }
.security-banner strong { font-size: 12.5px; color: #d7ffee; }
.security-banner span { color: #a8c9ba; font-size: 11px; line-height: 1.65; max-width: 980px; }
.secrets-layout { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; }
.env-select { display: inline-flex; padding: 3px; margin-bottom: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.18); }
.env-btn { border: 0; border-radius: 6px; padding: 7px 13px; background: transparent; color: var(--muted); font-family: var(--font-sans); font-size: 11px; font-weight: 600; cursor: pointer; }
.env-btn.is-active { background: rgba(255,255,255,.07); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.env-btn[data-env="live"].is-active { background: rgba(255,139,155,.10); color: #ffc4cc; }
#secrets-form { margin-top: 14px; display: flex; flex-direction: column; gap: 13px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 55px; }
.reveal-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 9px; border: 0; border-radius: 5px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 9.5px; cursor: pointer; }
.reveal-btn:hover { background: rgba(255,255,255,.07); color: var(--text-soft); }
.stored-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--line); }
.stored-strip > div { background: #0e141b; padding: 9px 10px; min-width: 0; }
.stored-strip span { display: block; color: var(--muted-2); font-size: 8.5px; margin-bottom: 3px; }
.stored-strip strong { font-size: 10.5px; color: var(--text-soft); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-result { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.18); font-size: 11px; }
.test-result.is-ok { border-color: rgba(114,241,184,.20); background: var(--mint-dim); color: #c5f5df; }
.test-result.is-fail { border-color: rgba(255,139,155,.20); background: var(--rose-dim); color: #ffd0d6; }
.test-result.is-warn { border-color: rgba(246,199,106,.20); background: var(--amber-dim); color: #f8dca2; }
.test-line { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.test-line .icon { width: 13px; height: 13px; margin-top: 2px; }
.test-line strong { font-weight: 600; }
.test-meta { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.07); color: var(--muted); font-size: 9.5px; font-family: var(--font-mono); }
.security-panel { position: sticky; top: 108px; }
.security-panel h3 { margin-bottom: 13px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.check-list .icon { color: var(--mint); width: 13px; height: 13px; margin-top: 2px; flex: none; }
.check-list .danger-item .icon { color: var(--rose); }
.api-note { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.api-note span { color: var(--text-soft); font-size: 10.5px; font-weight: 600; }
.api-note p { margin: 4px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.65; }

/* ============================== filters / summaries ============================== */
.filter-select { width: auto; min-width: 118px; min-height: 34px; font-size: 11px; padding-top: 6px; padding-bottom: 6px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.18); }
.segment { border: 0; border-radius: 5px; padding: 5px 11px; background: transparent; color: var(--muted); font-family: var(--font-sans); font-size: 10.5px; cursor: pointer; }
.segment.is-active { background: rgba(255,255,255,.07); color: var(--text); }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--line); }
.mini-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: #0e141b; }
.mini-stats span { color: var(--muted-2); font-size: 9.5px; }
.mini-stats strong { font: 600 14px/1.2 var(--font-mono); color: var(--text-soft); }

/* ============================== logs ============================== */
.log-panel { padding: 0; background: #090d12; }
.log-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted-2); font: 9.5px/1.3 var(--font-mono); }
.log-head span:nth-child(2) { flex: 1; }
.terminal-dots { display: inline-flex; gap: 4px; }
.terminal-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(148,163,184,.18); }
.terminal-dots i:first-child { background: rgba(255,139,155,.4); }
.terminal-dots i:nth-child(2) { background: rgba(246,199,106,.35); }
.terminal-dots i:nth-child(3) { background: rgba(114,241,184,.35); }
.log-list { min-height: 210px; max-height: 610px; overflow-y: auto; padding: 7px 0; }
.log-row { display: grid; grid-template-columns: 148px 64px 1fr; gap: 10px; padding: 6px 15px; font: 10.5px/1.6 var(--font-mono); border-left: 2px solid transparent; }
.log-row:hover { background: rgba(255,255,255,.018); }
.log-ts { color: var(--muted-2); white-space: nowrap; }
.log-level { font-size: 9px; font-weight: 700; letter-spacing: .04em; padding-top: 1px; }
.log-level.INFO { color: var(--blue); }
.log-level.WARN { color: var(--amber); }
.log-level.ERROR, .log-level.CRITICAL { color: var(--rose); }
.log-msg { color: var(--text-soft); word-break: break-word; white-space: pre-wrap; }
.log-row.level-ERROR, .log-row.level-CRITICAL { background: rgba(255,93,108,.035); border-left-color: rgba(255,93,108,.34); }
.log-row.level-WARN { border-left-color: rgba(246,199,106,.22); }

/* ============================== takeover ============================== */
.takeover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.danger-panel { border-color: rgba(255,93,108,.20); background: linear-gradient(155deg, rgba(46, 18, 24, .6), rgba(15, 18, 24, .88)); }
.danger-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.danger-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 11px; color: var(--red); background: var(--red-dim); border: 1px solid rgba(255,93,108,.20); }
.danger-icon .icon { width: 20px; height: 20px; }
.danger-head .panel-kicker { color: rgba(255,139,155,.55); }
.danger-head h3 { font-size: 18px; }
.danger-copy { margin: 0 0 13px; color: #e7b8bd; font-size: 11.5px; line-height: 1.65; }
.plain-list { margin: 0 0 5px; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.plain-list li { position: relative; padding-left: 12px; color: var(--muted); font-size: 10px; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: var(--rose); }
.takeover-status { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.takeover-status > div { padding: 10px 12px; border: 1px solid rgba(148,163,184,.07); border-radius: 8px; background: rgba(255,255,255,.018); }
.takeover-status span { display: block; color: var(--muted-2); font-size: 9px; margin-bottom: 3px; }
.takeover-status strong { color: var(--text-soft); font-size: 11.5px; font-weight: 600; word-break: break-word; }
.divider { height: 1px; background: var(--line); margin: 15px 0 2px; }
.checklist-panel { padding: 21px; }
.runbook { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.runbook li { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid rgba(148,163,184,.07); border-radius: 9px; background: rgba(255,255,255,.015); }
.runbook li > span { color: var(--mint); font: 600 10px/1.4 var(--font-mono); }
.runbook strong { display: block; color: var(--text-soft); font-size: 10.5px; font-weight: 600; margin-bottom: 2px; }
.runbook div { color: var(--muted-2); font-size: 9.5px; line-height: 1.55; }

/* ============================== footer / toast / dialog ============================== */
.footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 22px 0 28px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; letter-spacing: .02em; }
.footer-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); opacity: .5; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: min(380px, calc(100vw - 34px));
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(15, 21, 29, .96);
  color: var(--text-soft);
  box-shadow: var(--shadow);
  font-size: 11px;
  pointer-events: auto;
  animation: toast-in .2s ease;
}
.toast .icon { margin-top: 1px; width: 14px; height: 14px; color: var(--mint); }
.toast.error { border-color: rgba(255,139,155,.25); background: rgba(35, 15, 20, .97); }
.toast.error .icon { color: var(--rose); }
.toast.warn .icon { color: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255,139,155,.22);
  border-radius: 15px;
  background: #11161e;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}
.confirm-dialog::backdrop { background: rgba(3, 6, 10, .72); backdrop-filter: blur(4px); }
.dialog-inner { padding: 22px; }
.dialog-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; background: var(--red-dim); color: var(--rose); border: 1px solid rgba(255,139,155,.18); margin-bottom: 13px; }
.dialog-icon .icon { width: 19px; height: 19px; }
.dialog-icon.safe { background: var(--mint-dim); color: var(--mint); border-color: rgba(114,241,184,.18); }
.confirm-dialog h2 { margin: 0 0 7px; font-size: 17px; font-weight: 650; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.7; white-space: pre-line; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-actions .btn { min-width: 82px; }

/* ============================== responsive ============================== */
@media (max-width: 1180px) {
  .app-shell { padding: 0 18px; }
  .topbar { grid-template-columns: auto 1fr; gap: 10px 20px; }
  .status-strip { justify-content: flex-end; grid-column: 2; }
  .topbar-actions { position: absolute; right: 0; top: 14px; }
  .server-clock { display: none; }
  .status-chip { border-left: 0; padding: 5px 8px; min-width: 0; }
  .status-strip { gap: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid.three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hero-grid, .two-col, .secrets-layout, .takeover-grid { grid-template-columns: 1fr; }
  .security-panel { position: static; }
  .risk-summary { grid-template-columns: 1fr 1fr; }
  .risk-summary-item:nth-child(2) { border-right: 0; }
  .risk-summary-item:nth-child(1), .risk-summary-item:nth-child(2) { border-bottom: 1px solid var(--line); }
  .runbook { grid-template-columns: 1fr 1fr; }
  .trade-mode-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 7px; }
  .section-head p { text-align: left; }
  .topbar { position: relative; }
  .tabs { position: sticky; top: 0; z-index: 30; background: rgba(8,11,16,.92); backdrop-filter: blur(14px); }
}

@media (max-width: 720px) {
  .app-shell { padding: 0 13px; }
  .topbar { min-height: auto; padding: 13px 0 9px; grid-template-columns: 1fr auto; }
  .status-strip { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 1px; }
  .status-chip { padding: 3px 10px 3px 0; border-right: 1px solid var(--line); margin-right: 6px; }
  .status-chip:nth-child(3) { flex: 1 1 100%; border-right: 0; margin-right: 0; padding-bottom: 0; }
  .status-chip:nth-child(3) .chip-value { font-size: 11px; }
  .topbar-actions { position: static; }
  .icon-btn { width: 31px; height: 31px; }
  .brand { min-width: 0; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-copy h1 { font-size: 15px; }
  .brand-copy p { font-size: 10px; }
  .tab { padding: 11px 10px; gap: 5px; font-size: 11.5px; }
  .tab .icon { width: 14px; height: 14px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .head-actions { justify-content: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .field-grid, .field-grid.three, .metric-row { grid-template-columns: 1fr; }
  .hero-grid { gap: 12px; }
  .performance-panel { min-height: auto; padding: 18px; }
  .panel { padding: 16px; }
  .form-section { padding: 16px; }
  .big-number { font-size: 36px; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stats > div { padding: 10px 12px; }
  .stored-strip { grid-template-columns: 1fr 1fr; }
  .save-bar { position: static; flex-direction: column; align-items: stretch; gap: 10px; }
  .save-bar .button-row { justify-content: flex-end; }
  .log-row { grid-template-columns: 86px 52px 1fr; padding: 6px 10px; font-size: 9.5px; }
  .runbook { grid-template-columns: 1fr; }
  .takeover-status { grid-template-columns: 1fr; }
  .plain-list { grid-template-columns: 1fr; }
  .risk-summary { grid-template-columns: 1fr; }
  .risk-summary-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .risk-summary-item:last-child { border-bottom: 0; }
  .section-head > div { align-items: flex-start; }
  .footer { justify-content: flex-start; gap: 7px; line-height: 1.6; }
}

@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
  .status-chip.wide { flex-basis: auto; }
  .tab span { display: none; }
  .tab { padding: 12px 13px; }
  .tab .icon { width: 17px; height: 17px; }
  .tabs { justify-content: space-between; }
  .head-actions { width: 100%; }
  .filter-select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ */
/* P2-B: single-user login layer + ops console                         */
/* ------------------------------------------------------------------ */
.auth-user {
  color: var(--text-soft);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.auth-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 11, 0.78);
  backdrop-filter: blur(8px);
}

.auth-card {
  width: min(400px, 100%);
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.auth-card h2 { margin: 0; font-size: 20px; }

.auth-card .hint { margin: 0; color: var(--muted); font-size: 12px; }

.auth-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--mint-dim);
  background: var(--mint-dim);
  color: var(--mint);
}
.auth-icon .icon { width: 22px; height: 22px; }

.auth-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--red-dim);
  background: var(--red-dim);
  color: var(--rose);
  font-size: 12px;
}

body.auth-locked .content,
body.auth-locked .tabs,
body.auth-locked .status-strip { pointer-events: none; }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.ops-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ops-card.ops-action { border-color: rgba(255, 93, 108, 0.24); }

.ops-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ops-card-head h3 { margin: 2px 0 0; font-size: 15px; }
.ops-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.ops-desc { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.ops-meta { margin: 0; color: var(--muted); font-size: 11.5px; }

.ops-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.ops-param { display: grid; gap: 4px; }
.ops-param label { font-size: 11.5px; color: var(--muted); }
.ops-param input,
.ops-param select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.ops-console-panel { margin-top: 4px; }

.ops-output {
  margin: 0;
  padding: 16px;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: 1px solid var(--line);
  background: #060a0f;
  color: #b9c9dd;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .ops-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px; }
}
