/*
 * style.css – Giao diện Trợ lý đầu tư & Kỷ luật Bybit
 * Phong cách: Dark Modern Glassmorphism, Micro-animations, Typography chuẩn Outfit
 */
:root {
  --bg: #0b0e14;
  --card: rgba(18, 24, 38, 0.72);
  --card-solid: #121826;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  --input: rgba(11, 14, 20, 0.85);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --primary-text: #ffffff;
  --accent: #8b5cf6;
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.3);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.12);
  --bad-border: rgba(239, 68, 68, 0.3);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.3);
  --long: #10b981;
  --short: #ef4444;
  --spot: #a855f7;
  --spot-bg: rgba(168, 85, 247, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

:root[data-theme="light"] {
  --bg: #f1f5f9;
  --card: rgba(255, 255, 255, 0.85);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(37, 99, 235, 0.5);
  --input: #ffffff;
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.25);
  --primary-text: #ffffff;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --long: #059669;
  --short: #dc2626;
  --spot: #7c3aed;
  --spot-bg: #f5f3ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.55 var(--font-main);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-main); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
h2.sec { margin: 18px 0 12px; }
code { font-family: var(--font-mono); font-size: 12.5px; background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.num { font-family: var(--font-mono); }

/* --- Topbar --- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px;
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.top-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand-icon { font-size: 18px; filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.4)); }
.macro-pills { display: flex; gap: 6px; }
.pill {
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap; transition: all 0.2s;
}
.pill.greed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.pill.fear { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.pill.up { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.pill.down { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }

.kpis { display: flex; gap: 16px; align-items: center; font-family: var(--font-mono); font-size: 13.5px; }
.kpis > span { display: flex; align-items: center; gap: 5px; }
.kpis .lbl { color: var(--muted); font-size: 11.5px; font-family: var(--font-main); text-transform: uppercase; letter-spacing: 0.04em; }

.top-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; color: var(--text); font-size: 14px;
  transition: all 0.2s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; box-shadow: 0 0 6px currentColor; }
.dot.ok { background: var(--ok); color: var(--ok); }
.dot.bad { background: var(--bad); color: var(--bad); }

/* --- Wrapper & Containers --- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 14px 20px 60px; }
.glass-panel {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  min-width: 0;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: rgba(255, 255, 255, 0.14); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid2 > .card { margin-bottom: 0; }

/* --- Banners & Alerts --- */
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); background: var(--card); }
.banner.bad { background: var(--bad-bg); border: 2px solid var(--bad); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.banner.ok { background: var(--ok-bg); border-color: var(--ok-border); }
.banner-title { font-weight: 800; font-size: 15px; }
.banner.bad .banner-title { color: var(--bad); }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.alert-item { border-radius: var(--radius); padding: 12px 16px; border-left: 5px solid; background: var(--card); border: 1px solid var(--border); border-left-width: 5px; }
.alert-item.critical { border-left-color: var(--bad); background: var(--bad-bg); animation: glowCritical 2s infinite ease-in-out; }
.alert-item.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.alert-item .t { font-weight: 700; font-size: 15px; }
.alert-item.critical .t { color: var(--bad); }
.alert-item .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
@keyframes glowCritical {
  0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.35); }
}

/* --- Tabs --- */
.tabs {
  display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all 0.2s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .badge {
  background: var(--bad); color: #fff; border-radius: 12px;
  padding: 1px 7px; font-size: 11px; margin-left: 6px; font-weight: 700;
}
.tab { display: none; }
.tab.active { display: block; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* --- Tiles --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; min-width: 0; transition: transform 0.2s ease, border-color 0.2s;
}
.tile:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.16); }
.tile .lbl { color: var(--muted); font-size: 12px; font-weight: 500; }
.tile .val { font-size: 22px; font-weight: 700; font-family: var(--font-mono); margin: 4px 0 2px; }
.tile .sub { font-size: 12px; color: var(--muted); }
.bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--bad); }

/* --- Positions Card --- */
.pos-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; transition: all 0.2s;
}
.pos-card.has-critical { border: 2px solid var(--bad); box-shadow: 0 0 16px rgba(239, 68, 68, 0.2); }
.pos-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pos-head .sym { font-size: 18px; font-weight: 800; }
.pos-head .push { margin-left: auto; }
.pos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px 16px; font-family: var(--font-mono); font-size: 13.5px;
}
.pos-grid .k { color: var(--muted); font-size: 11.5px; font-family: var(--font-main); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 14px; background: rgba(255,255,255,0.05); color: var(--muted); font-weight: 600; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.chip.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-border); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); }
details.ev { margin-top: 10px; font-size: 13px; }
details.ev summary { cursor: pointer; color: var(--muted); }
details.ev ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* --- Tags --- */
.tag {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,0.06); color: var(--muted);
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em;
}
.tag.long { background: var(--ok-bg); color: var(--long); border: 1px solid var(--ok-border); }
.tag.short { background: var(--bad-bg); color: var(--short); border: 1px solid var(--bad-border); }
.tag.spot { background: var(--spot-bg); color: var(--spot); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.okt { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); font-weight: 800; }
.tag.warnt { background: var(--warn-bg); color: var(--warn); }
.tag.ai { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }

/* --- Idea Grid & Cards --- */
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.idea {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 8px;
  transition: all 0.25s ease;
}
.idea:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.3); }
.idea.qualified { border: 2px solid var(--ok); box-shadow: 0 0 18px rgba(16, 185, 129, 0.2); }
.idea.dim { opacity: 0.85; }
.idea-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.idea-head .sym { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.idea ul { margin: 6px 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.plan {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 14px;
  font-size: 13.5px; font-family: var(--font-mono); margin: 6px 0;
  background: rgba(0,0,0,0.2); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.plan dt { color: var(--muted); font-family: var(--font-main); font-size: 12px; }
.plan dd { margin: 0; }
.idea-ai-box {
  background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px;
}
.idea-ai-box .ai-title { font-weight: 700; color: #c4b5fd; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.idea-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* --- Buttons & Inputs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text);
  transition: all 0.2s ease;
}
.btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-text);
  box-shadow: 0 2px 10px var(--primary-glow);
}
.btn.primary:hover { background: #2563eb; box-shadow: 0 4px 16px var(--primary-glow); }
.btn-glow { box-shadow: 0 0 20px rgba(59, 130, 246, 0.45); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.link { background: none; border: 0; text-decoration: underline; padding: 6px 0; font-weight: 500; }
.btn.danger { color: var(--bad); }

label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  width: 100%; min-width: 0; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input[type=radio], input[type=checkbox] { width: auto; cursor: pointer; }

.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline label { flex: 1 1 180px; }
.form-stacked { display: flex; flex-direction: column; gap: 10px; }

/* --- Rules Form --- */
.rule-group { margin-bottom: 14px; }
.rule-row {
  display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.rule-row:last-child { border-bottom: 0; }
.rule-row .name { font-size: 14px; font-weight: 600; }
.rule-row .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rule-row .ctl { display: flex; align-items: center; gap: 6px; }
.rule-row .ctl span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rule-row.changed { background: var(--warn-bg); padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.sticky-save {
  position: sticky; bottom: 0; background: var(--card-solid); padding: 12px 16px;
  border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center;
  border-radius: 0 0 var(--radius) var(--radius); z-index: 10;
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; font-family: var(--font-main); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.note-cell { min-width: 220px; font-family: var(--font-main); }
td.note-cell textarea { font-size: 12.5px; padding: 5px 8px; }
td.note-cell select { font-size: 12.5px; padding: 4px 6px; margin-bottom: 4px; }
.activity, .plain { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.activity li:last-child { border-bottom: 0; }
.activity .when { color: var(--muted); font-size: 11.5px; margin-right: 6px; font-family: var(--font-mono); }
.plain li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.seg-filter { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 14px; font-size: 14px; }
.seg-filter label { display: flex; flex-direction: row; gap: 6px; align-items: center; cursor: pointer; color: var(--text); }

/* --- AI Tab & Coach View --- */
.coach-container { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.coach-card {
  background: rgba(139, 92, 246, 0.07); border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius); padding: 14px;
}
.coach-headline { font-size: 15px; font-weight: 700; color: #ddd6fe; margin-bottom: 8px; }
.coach-section { margin-top: 8px; font-size: 13px; }
.coach-section h4 { font-size: 13px; color: var(--muted); margin: 6px 0 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.coach-actions { padding-left: 20px; margin: 4px 0; }

.ai-provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.provider-card {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.provider-card.enabled { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.04); }
.provider-head { display: flex; justify-content: space-between; align-items: center; }
.provider-name { font-weight: 700; font-size: 15px; }

/* --- Password Lock Screen Modal --- */
.lock-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding: 20px;
}
.lock-overlay.hidden { display: none; }
.lock-card {
  width: 100%; max-width: 420px; padding: 32px 28px;
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  text-align: center; animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.lock-brand { margin-bottom: 24px; }
.shield-badge {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}
.lock-brand h1 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.lock-sub { font-size: 13px; color: var(--muted); margin: 0; }
.lock-form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.pwd-input-wrap { position: relative; }
.pwd-input-wrap input { padding-right: 42px; font-size: 15px; }
.pass-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px;
}
.remember-row { display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.lock-msg { font-size: 13px; text-align: center; min-height: 20px; font-weight: 600; }

/* --- Position Sizer Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px); padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 520px; padding: 22px;
  background: var(--card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.close-btn { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; padding: 0 4px; line-height: 1; }
.close-btn:hover { color: var(--text); }
.calc-box {
  background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-top: 10px; font-family: var(--font-mono); font-size: 13.5px;
}

/* --- Toasts --- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; width: min(92vw, 380px); }
.toast {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--border);
  padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.45);
  transition: opacity .4s ease, transform .4s ease; font-size: 13.5px;
}
.toast.critical { background: var(--bad); color: #fff; border-color: transparent; }
.toast.ok { background: var(--ok); color: #fff; border-color: transparent; }
.toast.warn { background: var(--warn); color: #fff; border-color: transparent; }
.toast.hide { opacity: 0; transform: translateY(10px); }

/* --- Responsive adjustments --- */
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpis { margin-left: 0; width: 100%; order: 3; gap: 10px; padding-top: 6px; }
  .rule-row { grid-template-columns: 1fr; }
  .idea-grid { grid-template-columns: 1fr; }
  #toasts { left: 16px; right: 16px; width: auto; }
}
