/* Shared styles: design tokens, forms, buttons, dialogs, toasts and the
   public site. The admin panel adds /admin/admin.css on top of this.

   Theme: follows the system setting; the admin's theme toggle forces one
   via <html data-theme="light|dark">. Rebrand by changing the tokens. */

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f0f2f5;
  --text: #16181d;
  --text-muted: #5d6470;
  --border: #e3e6ea;
  --border-strong: #cdd2d9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #1d4ed8;
  --on-accent: #ffffff;
  --error: #d92d20;
  --success: #15803d;
  --warning: #b45309;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 6px 16px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 20px 44px rgba(16, 24, 40, 0.18), 0 6px 12px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1115;
    --surface: #171a1f;
    --surface-raised: #1d2127;
    --surface-sunken: #12151a;
    --text: #eceef1;
    --text-muted: #9aa1ac;
    --border: #272b32;
    --border-strong: #3a3f48;
    --accent: #3b82f6;
    --accent-hover: #2f6fe0;
    --accent-text: #7fb0ff;
    --error: #f97066;
    --success: #4ade80;
    --warning: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a1f;
  --surface-raised: #1d2127;
  --surface-sunken: #12151a;
  --text: #eceef1;
  --text-muted: #9aa1ac;
  --border: #272b32;
  --border-strong: #3a3f48;
  --accent: #3b82f6;
  --accent-hover: #2f6fe0;
  --accent-text: #7fb0ff;
  --error: #f97066;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 200;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

:is(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* A thin progress hint while a client-side navigation is loading. */
body.is-navigating::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 300;
  background: var(--accent);
  animation: nav-progress 1.2s ease-out infinite;
  transform-origin: left;
}
@keyframes nav-progress {
  from { transform: scaleX(0); opacity: 1; }
  to { transform: scaleX(1); opacity: 0.2; }
}

a { color: var(--accent-text); }

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}

p { color: var(--text-muted); margin: 0 0 1rem; }

.muted { color: var(--text-muted); }
.error-text { color: var(--error); }

/* --- Forms --- */

form { display: flex; flex-direction: column; gap: 1rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

input, select, textarea {
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: var(--text-muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: not-allowed;
}
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; padding: 0; accent-color: var(--accent); flex-shrink: 0; }
textarea { resize: vertical; min-height: 4.5rem; }

input.invalid, select.invalid, textarea.invalid { border-color: var(--error); }
input.invalid:focus-visible, select.invalid:focus-visible, textarea.invalid:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 22%, transparent);
}

.field-error { color: var(--error); font-size: 0.8rem; font-weight: 400; margin: 0; }
.field-hint { font-size: 0.8rem; margin: -0.5rem 0 0; }
.optional { color: var(--text-muted); font-weight: 400; }

.field-row { display: flex; gap: 0.75rem; }
.field-row > * { flex: 1; min-width: 0; }

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 400;
}

/* --- Buttons --- */

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 550;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
button:hover, .button-link:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

button.small, .button-link.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

button.secondary, .button-link.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
button.secondary:hover, .button-link.secondary:hover { background: var(--surface-sunken); }

button.danger { background: var(--error); color: #fff; }
button.danger:hover { background: color-mix(in srgb, var(--error) 85%, black); }

button.is-loading { position: relative; color: transparent !important; }
button.is-loading::after, .spinner {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
button.is-loading::after {
  position: absolute;
  inset: 0;
  margin: auto;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
.spinner { display: inline-block; color: var(--text-muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
svg[viewBox="0 0 20 20"] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message { min-height: 1.3rem; font-size: 0.87rem; margin: 0; }
.message.error { color: var(--error); }
.message.success { color: var(--success); }

.form-footnote { margin: 1.25rem 0 0; font-size: 0.87rem; text-align: center; }

/* --- Public layout --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav, .site-nav-pages, .site-nav-auth {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.92rem;
}
.site-nav { min-width: 0; }
.site-nav-pages { overflow-x: auto; scrollbar-width: none; }
.site-nav a:not(.button-link) { color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.site-nav a:not(.button-link):hover { color: var(--text); }
.site-nav .button-link { padding: 0.4rem 0.8rem; font-size: 0.88rem; }

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1.25rem;
}
main.wide { max-width: 800px; }
main.card {
  flex: 0 0 auto;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
}

.hero { text-align: center; padding: 3rem 0; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 0.75rem; text-wrap: balance; }
.hero p { font-size: 1.1rem; text-wrap: balance; }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.75rem; }

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .topbar { padding: 0.75rem 1rem; }
  .site-nav, .site-nav-pages, .site-nav-auth { gap: 0.85rem; }
  main { margin: 1.5rem auto; }
  main.card { border-radius: 0; border-inline: none; padding: 1.5rem 1.25rem; }
}

/* --- Language switcher --- */

.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  user-select: none;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover, .lang-switch[open] summary { color: var(--text); border-color: var(--border-strong); }
.lang-switch-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 9rem;
  padding: 0.35rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lang-switch-menu a, .user-menu-dropdown a {
  padding: 0.45rem 0.7rem;
  color: var(--text) !important;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  white-space: nowrap;
}
.lang-switch-menu a:hover, .user-menu-dropdown a:hover { background: var(--surface-sunken); }
.lang-switch-menu a[aria-current] { font-weight: 600; color: var(--accent-text) !important; }

/* --- Site footer (links are admin-controlled) --- */

.site-footer {
  margin-top: auto;
  padding: 2.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto 2rem;
}
.footer-column { display: flex; flex-direction: column; gap: 0.5rem; min-width: 120px; flex: 1; }
.footer-column a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.footer-column a:hover { color: var(--text); }
.footer-copyright { max-width: 960px; margin: 0 auto; font-size: 0.8rem; color: var(--text-muted); }

/* --- CMS page content --- */

.page-content { line-height: 1.65; overflow-wrap: break-word; }
.page-content h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.page-content h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.page-content p, .page-content li { color: var(--text); }
.page-content ul, .page-content ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.page-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* --- Dialogs --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  animation: fade-in 0.15s ease;
}
.modal {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  animation: modal-in 0.16s ease;
}
.modal.wide { max-width: 560px; }
.modal h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }
.modal-divider { text-align: center; font-size: 0.8rem; color: var(--text-muted); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* --- Toasts --- */

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
}
.toast {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: modal-in 0.18s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.error { border-left-color: var(--error); }
.toast.leaving { opacity: 0; transform: translateY(4px); }

/* --- Account menu --- */

.user-menu { position: relative; display: inline-flex; }
.user-menu-trigger {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.3rem 0.2rem;
  font-weight: 500;
  white-space: nowrap;
}
.user-menu-trigger:hover { background: none; color: var(--accent-text); }

.user-menu-dropdown, .notif-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.user-menu-dropdown { display: flex; flex-direction: column; min-width: 160px; padding: 0.35rem; }
.user-menu-dropdown.closed, .notif-dropdown.closed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
}

/* --- Notifications --- */

.notif-menu { position: relative; display: inline-flex; }
.notif-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.3rem;
}
.notif-bell:hover { background: none; color: var(--text); }
.notif-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}
.notif-dropdown { width: 320px; max-width: 90vw; overflow: hidden; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.65rem 1.9rem 0.65rem 0.9rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  text-align: left;
  font-size: 0.87rem;
  font-weight: 400;
  color: var(--text);
  position: relative;
}
.notif-item:hover { background: var(--surface-sunken); }
.notif-item.unseen { font-weight: 600; }
.notif-item.unseen::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  right: 0.9rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}
.notif-item-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.notif-empty { padding: 1rem 0.9rem; font-size: 0.87rem; margin: 0; }
.notif-view-all {
  display: block;
  text-align: center;
  padding: 0.65rem;
  font-size: 0.87rem;
  text-decoration: none;
}
.notif-view-all:hover { background: var(--surface-sunken); }
.notif-modal-body { color: var(--text); white-space: pre-line; }
.notif-list-page .notif-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 0.5rem;
}

/* --- "Viewing the site as ..." bar (admin impersonation) --- */

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  font-size: 0.87rem;
}

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

/* ---------- CryWatch ---------- */

main.full { max-width: 1100px; }
.small { font-size: 0.87rem; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; word-break: break-all; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-compact { padding: 1.5rem 0 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel { margin: 1.25rem 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel h2 { margin-top: 0; font-size: 1.1rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
table.markets { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.markets th, .markets td { padding: 0.8rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.markets th { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; background: var(--surface-sunken); }
.markets tbody tr:last-child td { border-bottom: 0; }
.markets tr.clickable { cursor: pointer; }
.markets tr.clickable:hover td { background: var(--surface-sunken); }
.markets .num { text-align: right; }
.star-col { width: 2.5rem; padding-right: 0 !important; }
.coin-link { color: inherit; text-decoration: none; }
.star { padding: 0.2rem 0.35rem; font-size: 1.15rem; line-height: 1; color: var(--text-muted); background: none; border: 0; box-shadow: none; }
.star:hover { color: var(--warning); background: none; }
.star.on { color: #f5b301; }
.change.up { color: var(--success); }
.change.down { color: var(--error); }

.coin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.coin-head h1 { margin-bottom: 0.25rem; }
.coin-price { margin: 0; font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--text); }
.coin-price .change { font-size: 1rem; }
#coin-watch.on { color: #b88600; }
.chart-card { margin-top: 1.25rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ranges { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; padding: 0.25rem; width: max-content; background: var(--surface-sunken); border-radius: var(--radius); }
.ranges button { padding: 0.35rem 0.8rem; font-size: 0.85rem; color: var(--text-muted); background: none; border: 0; box-shadow: none; }
.ranges button[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.chart { position: relative; height: clamp(220px, 45vw, 380px); touch-action: pan-y; }
.chart canvas { display: block; width: 100%; height: 100%; }
.chart-tip { position: absolute; transform: translateX(-50%); padding: 0.3rem 0.55rem; font-size: 0.8rem; white-space: nowrap; pointer-events: none; color: var(--text); background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1rem 0 0; }
.stats dt { font-size: 0.8rem; color: var(--text-muted); }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.inline-form { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 14rem; }
.inline-form .message { flex-basis: 100%; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.swap-box { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 600; }

.alert-list, .device-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.alert-item, .device { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.alert-item p, .device p { margin: 0.25rem 0 0; }
.alert-item p.small { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; }
.alert-item.triggered { border-left: 4px solid var(--success); }
.alert-item.active { border-left: 4px solid var(--accent); }
.badge { display: inline-block; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 600; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); }
.badge.swap-confirmed { color: var(--success); border-color: currentColor; }
.badge.swap-failed { color: var(--error); border-color: currentColor; }
.badge.swap-waiting, .badge.swap-sent { color: var(--warning); border-color: currentColor; }

@media (max-width: 600px) {
  .markets th, .markets td { padding: 0.7rem 0.55rem; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alert-item, .device { flex-direction: column; }
}
.net-balance { display: block; }
