/* =========================================================================
   Paritr - Design System
   Eigenstaendiges, mobil optimiertes Stylesheet (kein CSS-Framework noetig).
   ========================================================================= */

:root {
  color-scheme: light;

  --bg: #f4f6f9;
  --bg-rgb: 244, 246, 249;
  --bg-soft: #eceff4;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --surface-2: #f8fafc;
  --surface-2-rgb: 248, 250, 252;
  --surface-3: #f1f5f9;
  --surface-3-rgb: 241, 245, 249;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #7c8aa0;

  --accent: #059669;
  --accent-hover: #047857;
  --accent-soft: rgba(5, 150, 105, 0.10);
  --accent-text: #047857;

  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.10);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 18px 48px -18px rgba(15, 23, 42, 0.28);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 28px;

  /* Glas-Optik: Deckkraft und Unschaerfe zentral steuerbar */
  --glass: 0.67;
  --glass-strong: 0.82;
  --blur-sm: 8px;
  --blur: 14px;
  --blur-lg: 22px;

  --header-h: 62px;
  --nav-h: 64px;
  --maxw: 1140px;
  --overlay-opacity: 0.8;
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark {
  color-scheme: dark;

  --bg: #0a0e16;
  --bg-rgb: 10, 14, 22;
  --bg-soft: #070a11;
  --surface: #121826;
  --surface-rgb: 18, 24, 38;
  --surface-2: #171f2f;
  --surface-2-rgb: 23, 31, 47;
  --surface-3: #1d2637;
  --surface-3-rgb: 29, 38, 55;
  --border: #232c3d;
  --border-strong: #313c52;
  --text: #e8eef7;
  --text-soft: #b3c0d1;
  --text-muted: #8494a9;

  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.13);
  --accent-text: #34d399;

  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 18px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 52px -20px rgba(0, 0, 0, 0.8);
  --overlay-opacity: 0.67;
}

/* ------------------------------------------------------------------ Basis */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

#background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  opacity: var(--overlay-opacity);
  transition: opacity var(--transition);
  z-index: -1;
}

/* ------------------------------------------------------------- Glas-Optik */

/*
 * Zentrale Stelle fuer alle durchscheinenden Flaechen. Der -webkit-Präfix ist
 * fuer Safari (Desktop und iOS) zwingend, sonst bleibt die Flaeche transparent
 * ohne Unschaerfe. Browser ohne backdrop-filter erhalten weiter unten eine
 * deckende Rückfallfarbe.
 */
.glass,
.card,
.app-header,
.nav-mobile,
.stat,
.note,
.netbar,
.tuner,
.segmented,
.badge,
.code,
.toast,
.modal,
.balance,
.avatar,
.qr-frame,
.address-box,
.progress,
.input,
.select,
.textarea,
.btn,
.icon-btn,
.card__foot,
.modal__foot,
.switch__track {
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

/* Ohne Unschaerfe-Unterstuetzung (aeltere Firefox-Versionen): deckend fuellen */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .app-header, .nav-mobile, .modal, .toast, .balance { background: var(--surface); }
  .stat, .note, .tuner, .segmented, .code, .address-box, .card__foot, .modal__foot {
    background: var(--surface-2);
  }
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-ligatures: none;
}
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-all { word-break: break-all; }
.hidden { display: none !important; }
.center { text-align: center; }
.right { text-align: right; }

.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 0.8125rem; }
.tiny { font-size: 0.75rem; }
.bold { font-weight: 650; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  user-select: none;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ----------------------------------------------------------------- Layout */

.app-shell { display: flex; flex-direction: column; min-height: 100dvh; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(var(--surface-rgb), var(--glass));
  border-bottom: 1px solid var(--border);
}

.app-header__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -0.02em; }
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent), var(--info));
  color: #fff;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.brand__name { font-size: 1.02rem; }

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 28px);
}

@media (min-width: 900px) {
  .app-header { padding: 0 24px; }
  .app-main { padding: 26px 24px 48px; }
}

/* ------------------------------------------------------------- Navigation */

.nav-desktop { display: none; gap: 4px; margin-left: auto; }
@media (min-width: 900px) { .nav-desktop { display: flex; } }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition);
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item .material-symbols-rounded { font-size: 19px; }

.nav-mobile {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  background: rgba(var(--surface-rgb), var(--glass-strong));
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) { .nav-mobile { display: none; } }

.nav-mobile__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  padding: 0 2px;
}
.nav-mobile__item .material-symbols-rounded { font-size: 23px; }
.nav-mobile__item.is-active { color: var(--accent-text); }
.nav-mobile__item.is-active .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-3-rgb), var(--glass-strong));
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn:hover { background: var(--border); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .material-symbols-rounded { font-size: 18px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 11px; font-size: 0.8125rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 12px 22px; font-size: 0.9375rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), var(--glass));
  color: var(--text-soft);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.icon-btn .material-symbols-rounded { font-size: 19px; }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-sm .material-symbols-rounded { font-size: 17px; }

/* ----------------------------------------------------------------- Karten */

.card {
  background: rgba(var(--surface-rgb), var(--glass));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.card__title { display: flex; align-items: center; gap: 9px; font-size: 0.9375rem; font-weight: 650; }
.card__title .material-symbols-rounded { font-size: 19px; color: var(--text-muted); }
.card__body { padding: 18px; }
.card__body--tight { padding: 12px 18px; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); background: rgba(var(--surface-2-rgb), var(--glass)); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Einzelne Restkachel auf schmalen Displays voll ausnutzen */
@media (max-width: 759px) {
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 760px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1.35fr 1fr; }
  .grid-1-2 { grid-template-columns: 1fr 1.6fr; }
}

/* ------------------------------------------------------------- Guthaben */

.balance {
  position: relative;
  padding: 26px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%),
    linear-gradient(150deg, rgba(var(--surface-2-rgb), var(--glass)), rgba(var(--surface-rgb), var(--glass)));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.balance__label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.balance__value {
  margin-top: 6px;
  font-size: clamp(2.1rem, 9vw, 3.1rem);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.balance__decimals { color: var(--text-muted); font-weight: 600; font-size: 0.667em; top: -0.36em; }
.balance__unit { font-size: 0.5em; font-weight: 650; color: var(--text-muted); margin-left: 0.6em; letter-spacing: normal; top: -0.72em; }
.balance__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.balance__meta-item { font-size: 0.8125rem; color: var(--text-soft); }
.balance__meta-item b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.balance__actions { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.balance__actions .btn { flex: 1 1 130px; }

/* --------------------------------------------------------------- Kennzahl */

.stat {
  padding: 14px 15px;
  background: rgba(var(--surface-rgb), var(--glass));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 550; color: var(--text-muted);
}
.stat__label .material-symbols-rounded { font-size: 15px; }
.stat__value {
  margin-top: 5px;
  font-size: 1.2rem; font-weight: 680; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__hint { margin-top: 2px; font-size: 0.75rem; color: var(--text-muted); }
.stat--accent .stat__value { color: var(--accent-text); }
.stat--info .stat__value { color: var(--info); }
.stat--warn .stat__value { color: var(--warn); }

/* --------------------------------------------------------------- Formular */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--text-soft); }
.field__hint { font-size: 0.75rem; color: var(--text-muted); }
.field__error { font-size: 0.75rem; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), var(--glass));
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  transition: var(--transition);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .select:disabled { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }
.textarea { min-height: 84px; resize: vertical; }
.input-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8aa0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 42px; height: 24px; flex: none;
  border-radius: 99px;
  background: var(--border-strong);
  transition: var(--transition);
  position: relative;
}
.switch__track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- Badges */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.01em;
  background: rgba(var(--surface-3-rgb), var(--glass-strong)); color: var(--text-soft);
  white-space: nowrap;
}
.badge .material-symbols-rounded { font-size: 13px; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: rgba(var(--surface-3-rgb), var(--glass)); color: var(--text-muted); }

/* Brand logo: the light and dark artwork swap with the colour scheme. */
.brand__logo { display: block; width: auto; }
.brand__logo--dark { display: none; }
.dark .brand__logo { display: none; }
.dark .brand__logo--dark { display: block; }

/* Language switch - shared by the wallet, the public site and the docs. */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.lang-switch__btn {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn.is-active {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Mining: one self-contained card per node
   ========================================================================== */

.area__heading {
  margin: 4px 2px -6px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.node-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(var(--surface-rgb), var(--glass-strong));
  backdrop-filter: blur(var(--blur));
  overflow: hidden;
}

.node-card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}

.node-card__identity { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.node-card__name { display: block; font-weight: 650; font-size: 0.9375rem; }
.node-card__url {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.node-card__body { padding: 15px 17px; }

.node-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}

.node-card__stat { display: flex; flex-direction: column; gap: 2px; }
.node-card__stat-label { font-size: 0.6875rem; color: var(--text-muted); }
.node-card__stat-value {
  font-size: 1.0625rem; font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.node-card__system {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 15px; padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-soft);
}

/* Connection quality is intentionally quieter than the headline figures. */
.node-card__quality {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 8px;
  font-size: 0.6875rem; color: var(--text-muted);
}
.node-card__quality .material-symbols-rounded { font-size: 14px; }
.node-card__quality.quality-good { color: var(--accent-text); }
.node-card__quality.quality-ok { color: var(--text-muted); }
.node-card__quality.quality-poor { color: var(--warn); }
.node-card__quality.quality-offline { color: var(--danger); }

.node-card__error {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 15px 17px;
  font-size: 0.8125rem; color: var(--danger);
}
.node-card__error .material-symbols-rounded { font-size: 18px; flex: none; }

.node-card__settings { margin-top: auto; border-top: 1px solid var(--border); }

/* Amber strip explaining why a connected node is producing nothing. */
.node-card__warn {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 14px; padding: 9px 11px;
  border-radius: var(--radius-xs);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.75rem; line-height: 1.5;
}
.node-card__warn .material-symbols-rounded { font-size: 16px; flex: none; }

/* Tabbed dialogs (node settings) */
.dialog-tabs {
  display: flex; gap: 3px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.dialog-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px;
  border: 0; border-radius: 9px;
  background: transparent;
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.dialog-tab:hover { color: var(--text); }
.dialog-tab.is-active {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}
.dialog-tab .material-symbols-rounded { font-size: 17px; }

.dialog-panel { display: flex; flex-direction: column; gap: 16px; }
.dialog-panel.hidden { display: none; }

/* Radio-style option rows (language picker) */
.option-list { display: flex; flex-direction: column; gap: 8px; }

.option {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.option:hover { border-color: var(--border-strong); }
.option.is-active { border-color: var(--accent); background: var(--accent-soft); }

.option__code {
  flex: none;
  min-width: 34px; padding: 5px 0;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  text-align: center; color: var(--text-muted);
}
.option.is-active .option__code { color: var(--accent-text); }

.option__text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.option__name { font-size: 0.875rem; font-weight: 600; }
.option__hint { font-size: 0.75rem; color: var(--text-muted); }
.option__check { color: var(--text-muted); font-size: 20px; }
.option.is-active .option__check { color: var(--accent); }

.offline-banner { margin-bottom: 16px; }

@media (max-width: 480px) {
  .dialog-tab span:not(.material-symbols-rounded) { display: none; }
}

.node-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 10px;
}

.node-tab {
  padding: 6px 11px;
  border: 0; border-radius: var(--radius-xs);
  background: transparent;
  font: inherit; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.node-tab:hover { background: var(--surface-3); color: var(--text); }
.node-tab.is-active { background: var(--accent-soft); color: var(--accent-text); }

/* The add tile matches a node card so the grid keeps an even rhythm. */
.node-card--add {
  align-items: center; justify-content: center; gap: 7px;
  min-height: 210px; padding: 26px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.node-card--add:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}
.node-card--add .material-symbols-rounded { font-size: 30px; }
.node-card--add__title { font-weight: 650; font-size: 0.9375rem; }
.node-card--add__hint { font-size: 0.75rem; text-align: center; max-width: 24ch; }

@media (max-width: 560px) {
  .node-grid { grid-template-columns: 1fr; }
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-muted); }
.dot-online { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-offline { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-pending { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* ------------------------------------------------------------ Netzwerk-Bar */

.netbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}
.netbar--warn { background: var(--warn-soft); }
.netbar--down { background: var(--danger-soft); }
.netbar__state { font-weight: 600; color: var(--text-soft); }
.netbar__nodes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  color: var(--text-soft);
}
.netbar__nodes .material-symbols-rounded { font-size: 16px; color: var(--text-muted); }
.netbar__nodes b { color: var(--text); }

/* --------------------------------------------------------- Hardware-Regler */

.tuner {
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-2-rgb), var(--glass));
  border: 1px solid var(--border);
  overflow: hidden;
}

.tuner__head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.tuner__head:hover { background: rgba(var(--surface-3-rgb), 0.5); }
.tuner__head .material-symbols-rounded { font-size: 18px; color: var(--text-muted); }
.tuner__chevron { transition: transform var(--transition); }
.tuner.is-open .tuner__chevron { transform: rotate(180deg); }

/* 0fr -> 1fr animiert die Hoehe ohne feste max-height-Schaetzung */
.tuner__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tuner.is-open .tuner__body { grid-template-rows: 1fr; }
.tuner__inner { overflow: hidden; min-height: 0; }

.tuner__grid {
  display: grid;
  gap: 14px 22px;
  padding: 2px 13px 0;
}
@media (min-width: 700px) { .tuner__grid { grid-template-columns: 1fr 1fr; } }

.tuner__row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tuner__row-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.75rem; font-weight: 600; color: var(--text-soft);
}
.tuner__value { font-size: 0.75rem; font-weight: 700; color: var(--accent-text); }
.tuner__scale { display: flex; justify-content: space-between; margin-top: -2px; }
.tuner__auto { margin-top: -1px; }
.tuner__auto .switch__track { width: 30px; height: 18px; }
.tuner__auto .switch__track::after { width: 12px; height: 12px; top: 3px; left: 3px; }
.tuner__auto input:checked + .switch__track::after { transform: translateX(12px); }
.tuner__hint { padding: 10px 13px 12px; margin: 0; }

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.range:disabled { opacity: 0.45; cursor: not-allowed; }
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.range::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.range:hover:not(:disabled)::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* ----------------------------------------------------------------- Listen */

.list { display: flex; flex-direction: column; }
.list__item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.list__item:last-child { border-bottom: 0; }
.list__item--link { cursor: pointer; }
.list__item--link:hover { background: var(--surface-2); }

.avatar {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-3-rgb), var(--glass-strong));
  color: var(--text-soft);
}
.avatar .material-symbols-rounded { font-size: 20px; }
.avatar-in { background: var(--accent-soft); color: var(--accent-text); }
.avatar-out { background: var(--info-soft); color: var(--info); }
.avatar-reward { background: var(--warn-soft); color: var(--warn); }

.amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-in { color: var(--accent-text); }
.amount-out { color: var(--text); }

/*
 * Coin fractions step back and sit flush with the top of the whole amount.
 * They are set at two thirds of the size of the full coins. The shift uses
 * position/top instead of vertical-align so the line height stays untouched
 * (no jumping layout). At 2/3 size the cap heights differ by
 * capHeight (~0.72em) * (1 - 0.667) = 0.24 parent-em, which is 0.36em in the
 * fraction's own font size.
 */
.frac, .unit, .balance__decimals, .balance__unit {
  position: relative;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
}
.frac {
  font-size: 0.667em;
  font-weight: 550;
  opacity: 0.72;
  top: -0.36em;
  margin-left: 0.1em;
}
.unit {
  font-size: 0.667em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.5em;
  top: -0.36em;
}

/* Amounts read as figures, so they never get the display tracking. */
.amount, .stat__value, .node-card__stat-value { letter-spacing: normal; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 42px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty .material-symbols-rounded { font-size: 38px; opacity: 0.5; }
.empty__title { font-weight: 600; color: var(--text-soft); }

.skeleton {
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --------------------------------------------------------------- Segmente */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: rgba(var(--surface-3-rgb), var(--glass-strong));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__btn {
  border: 0;
  padding: 6px 13px;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------- Hinweise */

.note {
  display: flex; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-2-rgb), var(--glass));
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-soft);
  line-height: 1.5;
}
.note .material-symbols-rounded { font-size: 19px; flex: none; margin-top: 1px; }
.note-info { background: var(--info-soft); border-color: transparent; color: var(--text-soft); }
.note-info .material-symbols-rounded { color: var(--info); }
.note-warn { background: var(--warn-soft); border-color: transparent; }
.note-warn .material-symbols-rounded { color: var(--warn); }
.note-danger { background: var(--danger-soft); border-color: transparent; }
.note-danger .material-symbols-rounded { color: var(--danger); }
.note-accent { background: var(--accent-soft); border-color: transparent; }
.note-accent .material-symbols-rounded { color: var(--accent-text); }
.note b { color: var(--text); }

.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--info)); transition: width 500ms ease; }

.code {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(var(--bg-rgb), var(--glass-strong));
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-soft);
  overflow-x: auto;
  white-space: pre;
}
html.dark .code { background: rgba(5, 7, 12, 0.72); }

.steps { display: flex; flex-direction: column; gap: 16px; counter-reset: step; }
.step { display: flex; gap: 13px; }
.step__num {
  counter-increment: step;
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.78rem; font-weight: 700;
}
.step__num::before { content: counter(step); }
.step__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.step__title { font-weight: 620; font-size: 0.9375rem; }

/* ---------------------------------------------------------------- Dialoge */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  background: rgba(8, 12, 20, 0.45);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  animation: fade 160ms ease;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 24px; } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: rgba(var(--surface-rgb), var(--glass-strong));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: slide-up 220ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
@media (min-width: 640px) { .modal { border-radius: var(--radius-lg); } }
.modal--wide { max-width: 620px; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 9px; background: rgba(var(--surface-2-rgb), var(--glass)); }
.modal__foot .btn { flex: 1; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ----------------------------------------------------------------- Toasts */

.toasts {
  position: fixed;
  z-index: 70;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { left: auto; right: 24px; bottom: 24px; width: 380px; } }

.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), var(--glass-strong));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  pointer-events: auto;
  animation: slide-up 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast .material-symbols-rounded { font-size: 19px; flex: none; }
.toast--success { border-left: 3px solid var(--accent); }
.toast--success > .material-symbols-rounded { color: var(--accent-text); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--error > .material-symbols-rounded { color: var(--danger); }
.toast--info { border-left: 3px solid var(--info); }
.toast--info > .material-symbols-rounded { color: var(--info); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: 220ms ease; }

/* ------------------------------------------------------------ Auth-Ansicht */

.auth {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.auth__card { width: 100%; max-width: 420px; }
.auth__hero { text-align: center; margin-bottom: 22px; }
.auth__hero-mark {
  width: 54px; height: 54px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--info));
  color: #fff;
  box-shadow: var(--shadow);
}
.auth__hero-mark .material-symbols-rounded { font-size: 28px; }

.strength { display: flex; gap: 4px; margin-top: 6px; }
.strength__seg { height: 4px; flex: 1; border-radius: 99px; background: var(--border); transition: var(--transition); }
.strength__seg.is-on-1 { background: var(--danger); }
.strength__seg.is-on-2 { background: var(--warn); }
.strength__seg.is-on-3 { background: var(--info); }
.strength__seg.is-on-4 { background: var(--accent); }

/* ---------------------------------------------------- Turnstile (Bot-Schutz) */

.turnstile { width: 100%; min-height: 65px; display: flex; }
.turnstile:empty { display: none; }
.turnstile > div,
.turnstile iframe { width: 100% !important; max-width: 100% !important; }

/* ------------------------------------------------------------- Farbschema */

.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.theme-option {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(var(--surface-rgb), var(--glass));
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.theme-option:hover { border-color: var(--border-strong); }
.theme-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.theme-option__preview {
  position: relative;
  display: block;
  height: 46px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  overflow: hidden;
}
.theme-option__preview--light { background: #f4f6f9; }
.theme-option__preview--dark { background: #0a0e16; }
.theme-option__preview--system { background: linear-gradient(105deg, #f4f6f9 50%, #0a0e16 50%); }

.theme-option__bar {
  position: absolute; inset: 7px 8px auto 8px;
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--info));
}
.theme-option__dot {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  height: 13px; border-radius: 5px;
}
.theme-option__preview--light .theme-option__dot { background: #ffffff; border: 1px solid #e2e8f0; }
.theme-option__preview--dark .theme-option__dot { background: #121826; border: 1px solid #232c3d; }
.theme-option__preview--system .theme-option__dot {
  background: linear-gradient(105deg, #ffffff 50%, #121826 50%);
  border: 1px solid #94a3b8;
}

.theme-option__name {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 0.8125rem; font-weight: 600;
}
.theme-option__name .material-symbols-rounded { font-size: 16px; }

/* ------------------------------------------------------------------- QR */

.qr-frame {
  display: grid;
  place-items: center;
  padding: 14px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: fit-content;
  margin: 0 auto;
}
.qr-frame img, .qr-frame canvas { display: block; }

.address-box {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: rgba(var(--surface-2-rgb), var(--glass));
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  word-break: break-all;
}

/* ------------------------------------------------------------ Hilfsklassen */

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
