/* ============================================================
   HL-Bot Panel — style.css
   Dark + Light theme, glassmorphism, responsive dashboard
   ============================================================ */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --accent: #6c8cff;
  --accent-2: #a06bff;
  --green: #1fd286;
  --green-soft: rgba(31, 210, 134, 0.14);
  --red: #ff5d6c;
  --red-soft: rgba(255, 93, 108, 0.14);

  --radius: 18px;
  --radius-sm: 12px;
  --transition: 0.25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- DARK (default) ---------- */
[data-theme="dark"] {
  --bg: #0a0c14;
  --bg-grad-1: #141a30;
  --bg-grad-2: #0a0c14;
  --surface: rgba(22, 27, 45, 0.66);
  --surface-solid: #161b2d;
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1fb;
  --text-muted: #8b93ad;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(22px);
  --orb-1: #2f3df0;
  --orb-2: #8a37ff;
  --orb-3: #00d4a0;
}

/* ---------- LIGHT ---------- */
[data-theme="light"] {
  --bg: #eef1f8;
  --bg-grad-1: #ffffff;
  --bg-grad-2: #e6ebf6;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: rgba(15, 23, 42, 0.03);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #121627;
  --text-muted: #647089;
  --shadow: 0 18px 45px -22px rgba(40, 50, 90, 0.4);
  --glass-blur: blur(20px);
  --orb-1: #6c8cff;
  --orb-2: #b08bff;
  --orb-3: #38e0b0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(1000px 600px at -10% 110%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

[hidden] { display: none !important; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); font-size: 0.85rem; }

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--accent) 80%, transparent); }

.btn-danger { background: linear-gradient(135deg, #ff5d6c, #ff8a5d); }
.btn-danger:hover:not(:disabled) { transform: translateY(-2px); }

.btn-success { background: linear-gradient(135deg, var(--green), #2fe0c0); color: #06231a; }
.btn-success:hover:not(:disabled) { transform: translateY(-2px); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-control { font-size: 1.05rem; padding: 1rem; letter-spacing: 0.02em; }

.ghost-icon {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.ghost-icon:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--border-strong); transform: rotate(12deg); }
[data-theme="dark"] .ico-sun { display: block; }
[data-theme="dark"] .ico-moon { display: none; }
[data-theme="light"] .ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: block; }

/* ---------- Spinner ---------- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; z-index: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 14s ease-in-out infinite;
}
.orb-a { width: 420px; height: 420px; background: var(--orb-1); top: -120px; left: -80px; }
.orb-b { width: 380px; height: 380px; background: var(--orb-2); bottom: -120px; right: -60px; animation-delay: -4s; }
.orb-c { width: 300px; height: 300px; background: var(--orb-3); top: 50%; left: 55%; animation-delay: -8s; opacity: 0.4; }
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.08); }
}

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  border-radius: var(--radius);
  padding: 2.2rem;
  display: flex; flex-direction: column; gap: 1.3rem;
  animation: rise 0.6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.login-card.shake { animation: shake 0.45s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-9px); }
  40%,80% { transform: translateX(9px); }
}

.brand { display: flex; align-items: center; gap: 0.9rem; }
.brand-mark {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem; color: #fff;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 0.95rem; }
.brand-text h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text p { color: var(--text-muted); font-size: 0.85rem; }

.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.field-input { position: relative; display: flex; align-items: center; }
.field-input input {
  width: 100%;
  font-family: inherit; font-size: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.85rem 3rem 0.85rem 1rem;
  transition: var(--transition);
}
.field-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field-input .ghost-icon { position: absolute; right: 6px; width: 34px; height: 34px; background: transparent; border: none; }

.login-error {
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  margin-top: -0.4rem;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.2rem;
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-title { display: flex; align-items: center; gap: 0.6rem; }
.topbar-title strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.mode-pill {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.topbar-right { display: flex; align-items: center; gap: 0.55rem; }

.status-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.status-badge.running .status-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); animation: pulse 2s infinite; }
.status-badge.running { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.status-badge.stopped .status-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.status-badge.stopped { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px var(--green-soft); } 50% { box-shadow: 0 0 0 7px transparent; } }

.content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 1.2rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  transition: transform var(--transition), border-color var(--transition);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1rem; gap: 0.5rem;
}
.card-head h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
}
.kpi {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.35rem;
  animation: rise 0.5s both;
}
.kpi::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 55%);
  pointer-events: none;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.kpi-ico { font-size: 1.1rem; opacity: 0.8; }
.kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1.1; }
.kpi-value-xl { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Balance headline card (spans full first column) ---------- */
.kpi-balance {
  grid-column: span 2;
  gap: 0.6rem;
}
.kpi-balance .kpi-label { font-size: 0.9rem; }
.balance-spark { position: relative; height: 44px; margin: -0.1rem 0 0.2rem; }

.kpi-substats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.substat {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.substat-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
.substat-value { font-size: 1.02rem; font-weight: 700; }

/* ---------- 1h / 4h / 24h PnL chips ---------- */
.pnl-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.78rem;
  transition: var(--transition);
}
.chip-k { font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.chip-v { font-weight: 700; font-size: 0.82rem; }
.chip.pos { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); }
.chip.pos .chip-v, .chip.pos .chip-k { color: var(--green); }
.chip.neg { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.chip.neg .chip-v, .chip.neg .chip-k { color: var(--red); }
.chip.flat .chip-v { color: var(--text-muted); }

/* ---------- Layout rows ---------- */
.row-2 { display: grid; grid-template-columns: 340px 1fr; gap: 1.2rem; }
.row-1 { display: grid; grid-template-columns: 1fr; }

/* ---------- Control ---------- */
.control-card { display: flex; flex-direction: column; }
.control-body { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.control-ring {
  width: 140px; height: 140px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--text-muted) 0 100%);
  position: relative;
  transition: var(--transition);
}
.control-ring.running { background: conic-gradient(var(--green) 0 100%); }
.control-ring.stopped { background: conic-gradient(var(--red) 0 100%); }
.control-ring-inner {
  width: 116px; height: 116px; border-radius: 50%;
  background: var(--surface-solid);
  display: grid; place-items: center; text-align: center;
  gap: 0.2rem;
}
.control-ring-inner span { font-size: 2.1rem; line-height: 1; }
.control-ring-inner small { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }
.control-hint { font-size: 0.74rem; color: var(--text-muted); text-align: center; }

/* ---------- Control meta (Letzter Scan / Läuft seit) ---------- */
.control-meta { width: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.meta-label { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.meta-value { font-size: 0.92rem; font-weight: 700; }

/* ---------- Live-Logs feed ---------- */
.logs-card { display: flex; flex-direction: column; }
.logs-feed {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0.5rem 0.6rem;
}
.log-line {
  display: flex; gap: 0.6rem; align-items: baseline;
  padding: 0.16rem 0.2rem;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-line + .log-line { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.log-ts { color: var(--text-muted); flex: 0 0 auto; font-size: 0.72rem; }
.log-text { flex: 1 1 auto; }
.log-opened .log-text { color: var(--green); font-weight: 600; }
.log-closed .log-text { color: var(--accent); font-weight: 600; }
.log-reject .log-text { color: var(--red); }
.log-skip .log-text   { color: #e0a23c; }
.log-wait .log-text   { color: var(--text-muted); }
.log-info .log-text   { color: var(--text); }

/* ---------- Charts ---------- */
.chart-card { display: flex; flex-direction: column; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.tall { height: 260px; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll.cap { max-height: 420px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table thead th {
  position: sticky; top: 0;
  text-align: left;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.6rem 0.7rem;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.num-col, td.num-col { text-align: right; }
.coin-cell { font-weight: 700; }

/* side / badges */
.tag {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  border: 1px solid transparent;
}
.tag-long { color: var(--green); background: var(--green-soft); }
.tag-short { color: var(--red); background: var(--red-soft); }
.tag-neutral { color: var(--text-muted); background: var(--surface-2); border-color: var(--border); }
.tag-tp { color: var(--green); background: var(--green-soft); }
.tag-sl { color: var(--red); background: var(--red-soft); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

/* ---------- Optimizations ---------- */
.opt-list { display: flex; flex-direction: column; gap: 0.7rem; }
.opt-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.opt-meta { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.opt-desc { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; }
.opt-sub { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Coverage / verpasste Trades ---------- */
.coverage-body { display: flex; flex-direction: column; gap: 0.9rem; }
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.coverage-stat {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.coverage-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.coverage-value { font-size: 1.35rem; font-weight: 800; }
.coverage-note {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.45;
}
@media (max-width: 560px) {
  .coverage-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-muted);
  padding: 0.5rem 0.2rem 0.2rem;
}

/* ============================================================
   OVERLAY / CONFIRM
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade 0.2s both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.confirm-card {
  width: 100%; max-width: 420px;
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex; flex-direction: column; gap: 0.8rem;
  animation: rise 0.3s both;
}
.confirm-card h3 { font-size: 1.15rem; font-weight: 800; }
.confirm-card p { color: var(--text-muted); font-size: 0.95rem; }
.confirm-actions { display: flex; gap: 0.7rem; margin-top: 0.5rem; }
.confirm-actions .btn { flex: 1; }

/* ============================================================
   TOASTS
   ============================================================ */
.toasts {
  position: fixed; z-index: 200;
  bottom: 1.2rem; right: 1.2rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem; font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(.2,.8,.2,1) both;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast-ok { border-left: 3px solid var(--green); }
.toast-err { border-left: 3px solid var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* number flash on update */
.flash { animation: flash 0.6s ease; }
@keyframes flash { 0% { color: var(--accent); } 100% {} }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-balance { grid-column: span 2; }
  .row-2 { grid-template-columns: 1fr; }
  .control-card { order: 2; }
}

@media (max-width: 560px) {
  .content { padding: 1rem; gap: 1rem; }
  .kpi-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .kpi-balance { grid-column: span 1; }
  .kpi { padding: 1rem; }
  .kpi-value { font-size: 1.5rem; }
  .kpi-value-xl { font-size: 2rem; }
  .card { padding: 1.05rem; }
  .topbar { padding: 0.6rem 0.85rem; }
  .mode-pill { display: none; }
  .status-badge { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
  .login-card { padding: 1.8rem 1.4rem; }
  .chart-wrap { height: 190px; }
  .toasts { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
  /* logs: smaller font + capped height so it doesn't dominate the phone screen */
  .logs-feed { font-size: 0.72rem; max-height: 240px; padding: 0.4rem 0.45rem; }
  .log-ts { font-size: 0.66rem; }
  /* tables already scroll-x; keep numeric cells from wrapping awkwardly */
  .data-table { font-size: 0.8rem; }
  .data-table thead th, .data-table tbody td { padding: 0.45rem 0.5rem; white-space: nowrap; }
  .control-ring { width: 110px; height: 110px; }
  .control-ring-inner { width: 90px; height: 90px; }
  .control-ring-inner span { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
