:root {
  color-scheme: light;
  --app-bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(248, 250, 252, 0.86);
  --text: #101827;
  --text-soft: #64748b;
  --muted: #94a3b8;
  --border: rgba(203, 213, 225, 0.72);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.12);
  --green: #22c55e;
  --green-hover: #34d399;
  --green-pressed: #16a34a;
  --red: #ef4444;
  --red-hover: #f87171;
  --red-pressed: #dc2626;
  --yellow: #f59e0b;
  --gold: #8a6500;
  --brand-money: #0b0f19;
  --field: rgba(248, 250, 252, 0.9);
  --field-hover: rgba(238, 244, 255, 0.96);
  --field-border: rgba(203, 213, 225, 0.82);
  --field-ring: color-mix(in srgb, var(--focus) 22%, transparent);
  --control-h: 52px;
  --focus: #60a5fa;
  --radius: 24px;
  --radius-sm: 16px;
  --header-h: 96px;
  --tg-bg: var(--app-bg);
  --tg-text: var(--text);
  --tg-button: var(--blue);
  --tg-button-text: #ffffff;
  --tg-secondary-bg: var(--surface-strong);
  --tg-viewport-height: 100dvh;
  --tg-viewport-stable-height: 100dvh;
  --tg-safe-area-top: 0px;
  --tg-safe-area-right: 0px;
  --tg-safe-area-bottom: 0px;
  --tg-safe-area-left: 0px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #000000;
  --surface: rgba(16, 16, 20, 0.8);
  --surface-strong: rgba(11, 11, 13, 0.94);
  --surface-muted: rgba(18, 18, 22, 0.9);
  --text: #f5f5f7;
  --text-soft: #a1a1aa;
  --muted: #71717a;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 84px rgba(0, 0, 0, 0.55);
  --soft-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --gold: #e5c76b;
  --brand-money: #f5f5f7;
  --field: rgba(18, 18, 22, 0.92);
  --field-hover: rgba(24, 24, 31, 0.98);
  --field-border: rgba(255, 255, 255, 0.14);
  --field-ring: rgba(96, 165, 250, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--app-bg);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  background: var(--app-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #f8fafc;
  background-image: url("/src/assets/background-light.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  contain: strict;
}

.app-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 52% 18%, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(248, 250, 252, 0.28));
  opacity: 1;
}

body[data-theme="dark"] .app-background {
  background-color: #050506;
  background-image: url("/src/assets/background-dark.jpg");
}

body[data-theme="dark"] .app-background::after {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.04), transparent 38%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.32));
  opacity: 1;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

@supports (min-height: 100dvh) {
  .shell {
    min-height: 100dvh;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, auto) minmax(150px, 0.85fr);
  gap: 18px;
  align-items: center;
  min-height: var(--header-h);
  padding: 18px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px) saturate(1.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo-frame {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--border));
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 86%, transparent), color-mix(in srgb, var(--surface-muted) 82%, transparent));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

body[data-theme="dark"] .brand-logo-frame {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  filter: saturate(1.04) contrast(1.03);
}

.brand-title {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.05;
  font-weight: 800;
}

.brand .brand-title {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-size: clamp(1.52rem, 2vw, 2.18rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-money {
  color: var(--brand-money);
}

.brand-control {
  color: var(--gold);
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.96rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: min(100%, 880px);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px) saturate(1.12);
  overflow: visible;
}

.nav-spacer {
  min-width: 0;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 48px;
  max-width: 168px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-item:hover,
.icon-button:hover,
.avatar-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--focus) 34%, var(--border));
  background: var(--field-hover);
}

.nav-item.active {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 34%, transparent);
  background: var(--blue-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 32px rgba(37, 99, 235, 0.18);
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  line-height: 1;
}

.nav-svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  color: inherit;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 850;
  opacity: 0;
  transform: translateX(-5px);
  transition: max-width 190ms ease, margin-left 190ms ease, opacity 150ms ease, transform 190ms ease;
}

.nav-item:hover .nav-label,
.nav-item:focus-visible .nav-label,
.nav-item.active .nav-label {
  max-width: 128px;
  margin-left: 9px;
  opacity: 1;
  transform: translateX(0);
}

.nav-item:focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent), var(--soft-shadow);
}

.top-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.icon-button,
.avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--soft-shadow);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.feedback-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  max-width: 190px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--soft-shadow);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.feedback-trigger:hover {
  border-color: var(--focus);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible,
.feedback-trigger:focus-visible,
.icon-button:focus-visible,
.avatar-button:focus-visible,
.button:focus-visible,
.menu-button:focus-visible,
.calendar-day:focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--field-ring), var(--soft-shadow);
}

.avatar-button {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(145deg, #2563eb, #22c55e);
}

.avatar-button span,
.account-avatar span,
.profile-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.avatar-button img,
.account-avatar img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-button.has-photo {
  background: var(--surface-muted);
}

.account-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(300px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.12);
}

.account-summary {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.account-avatar {
  width: 54px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(145deg, #2563eb, #22c55e);
  box-shadow: var(--soft-shadow);
}

.account-menu strong {
  display: block;
  padding: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu span {
  display: block;
  color: var(--text-soft);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.menu-button:hover {
  background: var(--field-hover);
}

.avatar-settings {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-muted);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  color: #ffffff;
  font-size: 2.3rem;
  font-weight: 900;
  background: linear-gradient(145deg, #2563eb, #22c55e);
  box-shadow: var(--soft-shadow);
}

.profile-avatar.has-photo {
  background: var(--surface-muted);
}

.page {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px) 0 54px;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  font-weight: 850;
}

.page-subtitle {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 1.04rem;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid > *,
.card,
.row > *,
.toolbar > *,
.field-group {
  min-width: 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  position: relative;
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.12);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 48%);
  pointer-events: none;
}

.card > * {
  position: relative;
}

.card h2,
.modal h2,
.modal-card h2,
.toolbar h2,
.card-header-inline h2 {
  margin: 0;
  line-height: 1.25;
}

.card h2,
.modal h2,
.modal-card h2,
.toolbar h2 {
  font-size: 1.18rem;
}

.settings-wallets-block {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.settings-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

.settings-section-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.settings-section-header p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.data-security-card {
  overflow: visible;
}

.data-security-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.security-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
}

.security-action-row strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.security-action-row .row-meta {
  margin-top: 5px;
}

.security-action-row .actions {
  justify-content: flex-end;
}

.security-action-row.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface-muted));
}

.security-action-row.strongest {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--border));
}

.danger-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.4;
}

.danger-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.danger-modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.rate-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.rate-chip strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
  white-space: nowrap;
}

.crypto-hero-card {
  min-height: 260px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.crypto-hero-card h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.4rem);
  line-height: 1.08;
}

.crypto-hero-card .row-meta {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.65;
}

.crypto-hero-actions {
  margin-top: 4px;
}

.crypto-preview-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 180px;
}

.crypto-preview-card h2 {
  margin: 0;
}

.crypto-preview-card .row-icon {
  width: 50px;
  height: 50px;
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
}

.crypto-info-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.crypto-info-card h2 {
  margin: 12px 0 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.crypto-price-note {
  margin-top: 18px;
}

.crypto-location-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.crypto-assets-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.crypto-asset-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.5fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-muted);
}

.crypto-asset-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.crypto-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--border));
  border-radius: 18px;
  overflow: hidden;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-muted));
  font-weight: 950;
}

.crypto-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crypto-logo img + span {
  display: none;
}

.crypto-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.crypto-metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
}

.crypto-metrics span,
.crypto-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.crypto-metrics span {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.crypto-metrics strong {
  margin-top: 4px;
  font-size: 0.95rem;
}

.crypto-asset-actions {
  justify-content: flex-end;
}

.card-header-inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header-inline h2,
.card-header-inline h3 {
  margin: 0;
}

.card-header-inline .row-meta {
  margin-top: 6px;
}

.crypto-header-actions {
  justify-content: flex-end;
}

.crypto-market-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 750;
  backdrop-filter: blur(14px) saturate(1.08);
}

.crypto-market-status.error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  color: var(--danger);
}

.crypto-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
}

.crypto-secondary-grid {
  margin-top: 18px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
}

.crypto-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  backdrop-filter: blur(18px);
}

.crypto-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-soft);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.crypto-tab:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 56%, transparent);
}

.crypto-tab.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--gold) 46%, var(--border));
  background: color-mix(in srgb, var(--gold) 16%, var(--surface) 74%);
}

.crypto-chart-card {
  min-height: 360px;
}

.crypto-chart {
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 76%, transparent), color-mix(in srgb, var(--surface-muted) 82%, transparent));
  overflow: hidden;
}

.crypto-chart-intervals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.crypto-chart-interval {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  color: var(--text-soft);
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.crypto-chart-interval:hover,
.crypto-chart-interval.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--gold) 48%, var(--border));
  background: color-mix(in srgb, var(--gold) 18%, var(--surface-muted));
}

.crypto-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.crypto-chart-svg {
  width: var(--chart-width, 100%);
  max-width: none;
  height: 260px;
  display: block;
}

.crypto-chart-line {
  stroke: var(--gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--gold) 22%, transparent));
}

.crypto-chart-fill {
  fill: url(#crypto-chart-fill);
}

.crypto-chart-grid,
.crypto-chart-axis,
.crypto-chart-tick {
  vector-effect: non-scaling-stroke;
}

.crypto-chart-grid {
  stroke: color-mix(in srgb, var(--border) 72%, transparent);
  stroke-width: 1;
  stroke-dasharray: 5 7;
}

.crypto-chart-axis,
.crypto-chart-tick {
  stroke: color-mix(in srgb, var(--text-soft) 42%, transparent);
  stroke-width: 1;
}

.crypto-chart-axis-label {
  fill: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.crypto-chart-axis-label.y {
  text-anchor: end;
}

.crypto-chart-axis-label.x {
  text-anchor: middle;
}

.crypto-chart-point {
  fill: var(--surface);
  stroke: var(--gold);
  stroke-width: 3;
  filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--gold) 20%, transparent));
}

.crypto-chart-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  text-align: center;
  color: var(--text-soft);
}

.crypto-chart-empty strong {
  color: var(--text);
}

.allocation-list {
  display: grid;
  gap: 14px;
}

.allocation-row {
  display: grid;
  gap: 8px;
}

.allocation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 850;
}

.allocation-asset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.allocation-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 56%, transparent);
}

.allocation-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--accent) 70%, var(--gold)));
}

.crypto-holdings-card {
  min-width: 0;
}

.crypto-holdings-table {
  display: grid;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.crypto-market-list,
.crypto-transactions-list {
  display: grid;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.crypto-table-head,
.crypto-table-row,
.crypto-market-head,
.crypto-market-row,
.crypto-transaction-head,
.crypto-transaction-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.crypto-table-head,
.crypto-market-head,
.crypto-transaction-head {
  padding: 0 12px 4px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crypto-table-head,
.crypto-table-row {
  grid-template-columns: minmax(180px, 1.25fr) repeat(5, minmax(92px, 0.75fr)) minmax(140px, auto);
  min-width: 860px;
}

.crypto-market-head,
.crypto-market-row {
  grid-template-columns: 42px minmax(180px, 1.2fr) repeat(5, minmax(104px, .78fr)) minmax(120px, auto);
  min-width: 980px;
}

.crypto-transaction-head,
.crypto-transaction-row {
  grid-template-columns: minmax(92px, .55fr) minmax(170px, 1.15fr) repeat(5, minmax(92px, .72fr)) minmax(132px, auto);
  min-width: 980px;
}

.crypto-table-row,
.crypto-market-row,
.crypto-transaction-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}

.crypto-market-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  font-weight: 900;
}

.crypto-market-search {
  width: min(280px, 100%);
}

.crypto-market-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.crypto-sort-select {
  display: none;
  width: min(280px, 100%);
}

.crypto-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.crypto-sort-button span:last-child {
  color: var(--text-soft);
  font-size: 0.86em;
}

.crypto-sort-button:hover,
.crypto-sort-button.active {
  color: var(--gold);
}

.crypto-sort-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--focus) 58%, transparent);
  outline-offset: 4px;
}

.portfolio-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 26%, transparent);
}

.crypto-trade-hint {
  margin-top: 18px;
}

.crypto-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.crypto-table-row .crypto-cell:not(.crypto-coin-cell),
.crypto-market-row .crypto-cell:not(.crypto-coin-cell),
.crypto-transaction-row .crypto-cell:not(.crypto-coin-cell) {
  justify-items: end;
  text-align: right;
}

.crypto-cell small {
  display: none;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.crypto-cell strong,
.crypto-cell span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crypto-coin-cell {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.crypto-coin-cell span {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.crypto-row-actions {
  justify-content: flex-end;
}

.crypto-logo.small {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

.crypto-logo.tiny {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.crypto-asset-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.crypto-asset-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.crypto-asset-suggestion:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--gold) 42%, var(--border));
  background: color-mix(in srgb, var(--gold) 10%, var(--surface-muted));
}

.crypto-asset-suggestion:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--focus) 58%, transparent);
  outline-offset: 3px;
}

.crypto-asset-suggestion span:last-child {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.crypto-asset-suggestion strong,
.crypto-asset-suggestion small {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crypto-asset-suggestion small {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 750;
}

.crypto-modal {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 44px);
  overflow: auto;
}

.crypto-portfolio-toolbar {
  align-items: end;
}

.crypto-portfolio-list {
  display: grid;
  gap: 12px;
}

.crypto-portfolio-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}

.crypto-portfolio-card.active {
  border-color: color-mix(in srgb, var(--gold) 44%, var(--border));
  background: color-mix(in srgb, var(--gold) 10%, var(--surface-muted));
}

.portfolio-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.portfolio-card-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portfolio-card-head span,
.portfolio-mini-stats,
.portfolio-visibility-row,
.strategy-note p {
  color: var(--text-soft);
}

.portfolio-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--portfolio-color, var(--gold)) 20%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--portfolio-color, var(--gold)) 44%, var(--border));
  font-weight: 950;
}

.portfolio-mini-stats,
.portfolio-visibility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .84rem;
  font-weight: 800;
}

.portfolio-mini-stats span,
.portfolio-visibility-row label,
.toggle-row {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.toggle-row.compact {
  width: fit-content;
  max-width: 100%;
  color: var(--text-soft);
  font-size: .85rem;
  font-weight: 850;
}

.risk-warning-list {
  display: grid;
  gap: 10px;
}

.risk-warning {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--border));
  border-radius: 16px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  font-weight: 850;
}

.strategy-note {
  display: grid;
  gap: 8px;
}

.strategy-note p {
  margin: 0;
  line-height: 1.55;
}

.balance-card {
  min-height: 172px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.label {
  color: var(--text-soft);
  font-weight: 600;
}

.value {
  font-size: clamp(2rem, 4.5vw, 4.4rem);
  line-height: 1;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.stat-value {
  margin-top: 14px;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  line-height: 1;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.income-text {
  color: var(--green);
}

.expense-text {
  color: var(--red);
}

.accent-text {
  color: var(--blue);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-label {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.field,
select.field,
textarea.field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--control-h);
  padding: 13px 15px;
  border: 1px solid var(--field-border);
  border-radius: 17px;
  outline: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--field) 94%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  line-height: 1.25;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

select.field {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--text-soft) 88%, transparent) 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--text-soft) 88%, transparent) 50%, transparent 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 74%, transparent), color-mix(in srgb, var(--field-hover) 78%, transparent));
  background-position:
    calc(100% - 22px) 23px,
    calc(100% - 16px) 23px,
    right 9px center;
  background-size: 6px 6px, 6px 6px, 32px 32px;
  background-repeat: no-repeat;
  padding-right: 52px;
  color-scheme: light;
}

body[data-theme="dark"] select.field {
  color-scheme: dark;
}

select.field option {
  color: var(--text);
  background: var(--surface-strong);
}

textarea.field {
  min-height: 104px;
  resize: vertical;
}

.field:hover {
  background-color: var(--field-hover);
  border-color: color-mix(in srgb, var(--focus) 26%, var(--field-border));
}

.field:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--field-ring), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.card:has(.searchable-picker.open) {
  overflow: visible;
  z-index: 40;
}

.searchable-picker {
  position: relative;
  z-index: 1;
}

.searchable-picker.open {
  z-index: 70;
}

.picker-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main chevron"
    "meta chevron";
  align-items: center;
  width: 100%;
  min-height: var(--control-h);
  padding: 10px 15px;
  border: 1px solid var(--field-border);
  border-radius: 17px;
  color: var(--text);
  text-align: left;
  background: color-mix(in srgb, var(--field) 94%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.picker-trigger:hover,
.searchable-picker.open .picker-trigger {
  background-color: var(--field-hover);
  border-color: color-mix(in srgb, var(--focus) 30%, var(--field-border));
}

.picker-trigger:focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--field-ring), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.picker-trigger-main {
  grid-area: main;
  min-width: 0;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-trigger-meta {
  grid-area: meta;
  min-width: 0;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-chevron {
  grid-area: chevron;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

.picker-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 100;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.14);
}

.searchable-picker:not(.open) .picker-menu {
  display: none;
}

.picker-search {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  outline: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--field) 92%, transparent);
}

.picker-search:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--field-ring);
}

.picker-options {
  display: grid;
  gap: 6px;
  max-height: min(330px, 52vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.picker-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.picker-option:hover,
.picker-option.active {
  border-color: color-mix(in srgb, var(--focus) 24%, var(--border));
  background: color-mix(in srgb, var(--field-hover) 72%, transparent);
}

.picker-option.selected {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--border));
  background: color-mix(in srgb, var(--gold) 11%, var(--field-hover));
}

.picker-option-title,
.picker-option-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-option-title {
  font-weight: 820;
}

.picker-option-meta {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 0.83rem;
}

.picker-selected-mark {
  grid-row: 1 / 3;
  align-self: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 820;
  background: color-mix(in srgb, var(--gold) 13%, transparent);
}

.picker-empty {
  min-height: 56px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  text-align: center;
}

input[type="date"].field {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 13px 0 15px;
  line-height: normal;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}

input[type="date"].field::-webkit-calendar-picker-indicator {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0 0 0 8px;
  padding: 0;
  cursor: pointer;
  opacity: 0.74;
  filter: contrast(0.9);
}

input[type="date"].field::-webkit-date-and-time-value {
  min-height: calc(var(--control-h) - 2px);
  line-height: calc(var(--control-h) - 2px);
  text-align: left;
}

input[type="date"].field::-webkit-datetime-edit,
input[type="date"].field::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
}

input[type="date"].field::-webkit-inner-spin-button,
input[type="date"].field::-webkit-clear-button {
  display: none;
}

body[data-theme="dark"] input[type="date"].field::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8);
}

.type-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: var(--control-h);
  padding: 6px;
  border: 1px solid var(--field-border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 88%, transparent), color-mix(in srgb, var(--field) 92%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--soft-shadow);
}

.type-segment.compact {
  min-height: 48px;
}

.type-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-soft);
  background: transparent;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.type-option:hover {
  transform: translateY(-1px);
  background: var(--field-hover);
}

.type-option:focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--field-ring);
}

.type-option.active {
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.type-option.income.active {
  border-color: color-mix(in srgb, #15803d 62%, transparent);
  background: linear-gradient(145deg, #15803d, #166534);
}

.type-option.expense.active {
  border-color: color-mix(in srgb, #dc2626 62%, transparent);
  background: linear-gradient(145deg, #dc2626, #b91c1c);
}

.type-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
}

.type-option.active .type-dot {
  background: #ffffff;
  opacity: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #ffffff;
  background: #2563eb;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.2);
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.24);
}

.button:active {
  background: #1e40af;
  transform: translateY(0);
}

.button:disabled,
.button[disabled],
form[data-busy="true"] .button {
  cursor: wait;
  color: #ffffff;
  background: #475569;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.button.income {
  background: #15803d;
  box-shadow: 0 14px 34px rgba(21, 128, 61, 0.22);
}

.button.income:hover {
  background: #166534;
}

.button.income:active {
  background: #14532d;
}

.button.expense {
  background: #dc2626;
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.24);
}

.button.expense:hover {
  background: #b91c1c;
}

.button.expense:active {
  background: #991b1b;
}

.button.secondary {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: var(--soft-shadow);
}

.button.ghost {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text-soft);
  border-color: var(--border);
  background: transparent;
  box-shadow: none;
}

.button.danger {
  background: #dc2626;
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.24);
}

.button.danger:hover {
  background: #b91c1c;
}

.button.danger:active {
  background: #991b1b;
}

.button.income:disabled,
.button.income[disabled],
.button.expense:disabled,
.button.expense[disabled],
.button.danger:disabled,
.button.danger[disabled],
form[data-busy="true"] .button.income,
form[data-busy="true"] .button.expense,
form[data-busy="true"] .button.danger {
  color: #ffffff;
  background: #475569;
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-limit {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-soft);
  background: var(--surface-muted);
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.row-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.row-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.row-meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.row-amount {
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.row-amount .actions {
  white-space: normal;
}

.wallet-balance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-width: 0;
}

.wallet-balance-chip {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.wallet-balance-action {
  appearance: none;
  cursor: pointer;
  background: var(--surface-soft);
  font-family: inherit;
}

.wallet-balance-action:hover,
.wallet-balance-action:focus-visible {
  border-color: color-mix(in srgb, var(--focus) 34%, var(--border));
  background: var(--field-hover);
  outline: 0;
}

.wallet-balance-chip.muted,
.warning-text {
  color: var(--text-soft);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
  color: var(--text-soft);
}

.empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.3rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.badge.green {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}

.badge.red {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.landing-page {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 36px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 78px) 0 64px;
  display: grid;
  gap: clamp(24px, 4vw, 44px);
}

.landing-hero {
  min-height: min(540px, calc(100svh - var(--header-h) - 46px));
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.landing-hero h1 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  font-size: clamp(2.6rem, 10vw, 8.4rem);
  line-height: 0.94;
  font-weight: 950;
  letter-spacing: 0;
}

.landing-subtitle {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  line-height: 1.1;
  font-weight: 850;
}

.landing-copy {
  width: min(720px, 100%);
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  line-height: 1.65;
  font-weight: 650;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.landing-actions .button {
  min-width: 168px;
}

.landing-section {
  display: grid;
  justify-items: center;
}

.landing-feature-grid {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-feature-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-height: 186px;
}

.landing-feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--border));
  border-radius: 16px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 72%, var(--surface-muted));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 1.25rem;
  font-weight: 900;
}

.landing-feature-card h3 {
  margin: 0;
  font-size: 1.22rem;
}

.landing-feature-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-weight: 650;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h));
  padding: 32px 18px;
}

.auth-card {
  width: min(460px, 100%);
}

.localization-card {
  width: min(620px, 100%);
}

.auth-card .brand-title {
  font-size: 2rem;
}

.notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 13%, transparent);
  font-weight: 750;
  line-height: 1.5;
}

.success-message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--green) 36%, transparent);
  border-radius: 16px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  font-weight: 750;
  line-height: 1.5;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.legal-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 750;
  transition: color 150ms ease, opacity 150ms ease;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--blue);
}

.legal-page {
  max-width: 1040px;
}

.legal-header {
  align-items: center;
}

.legal-card {
  display: grid;
  gap: 22px;
}

.legal-meta {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

.legal-lead {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.04rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  font-weight: 650;
}

.legal-section {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.legal-section h2 {
  margin: 0;
  font-size: 1.18rem;
}

.legal-section p,
.legal-section li {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.legal-section ul {
  margin: 0;
  padding-left: 22px;
}

.support-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-muted) 86%, transparent);
}

.support-contact span {
  color: var(--text-soft);
  font-weight: 750;
}

.support-contact a {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.settings-legal-links {
  justify-content: flex-start;
  margin-top: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.auth-tab {
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  color: var(--text-soft);
  background: transparent;
  font-weight: 800;
}

.auth-tab.active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--soft-shadow);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-auth {
  display: grid;
  gap: 12px;
}

.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 54px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.social-button:hover {
  transform: translateY(-1px);
}

.social-button:focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 20%, transparent), var(--soft-shadow);
}

.social-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.social-button.google {
  border-color: rgba(17, 24, 39, 0.12);
  background: #ffffff;
  color: #111827;
}

.social-button.google::after {
  content: "";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.social-button.google:hover {
  border-color: rgba(17, 24, 39, 0.18);
  background: #f9fafb;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.social-button.apple {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, #151515, #050505);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.social-button.apple:hover {
  border-color: rgba(212, 175, 55, 0.34);
  background: linear-gradient(145deg, #1b1b1b, #080808);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.social-button.coming-soon,
.button.coming-soon,
.button.coming-soon:disabled {
  cursor: not-allowed;
}

.social-button.apple.coming-soon {
  opacity: 0.94;
}

.social-button.apple.coming-soon:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, #151515, #050505);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.social-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.social-logo {
  display: block;
  width: 24px;
  height: 24px;
}

.apple-logo {
  color: #ffffff;
}

.social-label {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.social-soon-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  color: #f4d77f;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

body[data-theme="dark"] .social-button.google {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.oauth-note {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-reset-link {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 8px 10px;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.auth-reset-link:hover {
  color: var(--red);
}

.auth-reset-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

.provider-panel {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-muted);
}

.provider-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.provider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.provider-row strong,
.provider-row span {
  display: block;
}

.provider-row span {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.provider-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.provider-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 900;
  margin-top: 0;
  text-align: center;
}

.provider-status.connected {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}

.error {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 700;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-head,
.calendar-day {
  min-height: 44px;
  border-radius: 14px;
}

.calendar-head {
  display: grid;
  place-items: center;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.calendar-day {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.calendar-day:hover {
  background: var(--field-hover);
  transform: translateY(-1px);
}

.calendar-day.outside {
  opacity: 0.34;
}

.calendar-day.today {
  border-color: var(--focus);
}

.calendar-day.selected {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(145deg, var(--blue), #34d399);
}

.calendar-day strong {
  font-size: 1rem;
}

.calendar-day span {
  color: inherit;
  opacity: 0.88;
  font-size: 0.84rem;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal-card {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.balance-adjustment-modal {
  width: min(420px, 100%);
}

.compact-form {
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}

.telegram-route .telegram-mini-notice,
.telegram-mini-auth-note {
  width: min(100% - 32px, 1180px);
  margin: 14px auto 0;
}

.telegram-mini-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px) saturate(1.12);
}

.telegram-mini-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.telegram-mini-notice p,
.telegram-mini-auth-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.telegram-mini-notice.active {
  border-color: color-mix(in srgb, var(--tg-button) 45%, var(--border));
  background: color-mix(in srgb, var(--tg-secondary-bg) 84%, var(--surface-strong));
}

.telegram-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.telegram-mini-auth-note {
  padding: 0 2px;
}

.telegram-mini-app body,
body.telegram-mini-app {
  min-height: var(--tg-viewport-stable-height);
  background: var(--tg-bg);
  color: var(--tg-text);
}

.telegram-mini-app .app-background {
  background-color: var(--tg-bg);
  background-image: none;
}

.telegram-mini-app .app-background::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.telegram-mini-app .shell {
  min-height: var(--tg-viewport-stable-height);
  padding-bottom: calc(var(--tg-safe-area-bottom) + env(safe-area-inset-bottom, 0px));
}

.telegram-mini-app .topbar {
  min-height: 68px;
  padding:
    calc(8px + var(--tg-safe-area-top) + env(safe-area-inset-top, 0px))
    calc(12px + var(--tg-safe-area-right) + env(safe-area-inset-right, 0px))
    8px
    calc(12px + var(--tg-safe-area-left) + env(safe-area-inset-left, 0px));
}

.telegram-mini-app .site-footer {
  display: none;
}

.telegram-mini-app .auth-wrap {
  min-height: calc(var(--tg-viewport-stable-height) - 72px);
  padding: 18px 10px calc(18px + var(--tg-safe-area-bottom));
}

.telegram-mini-app .landing-page,
.telegram-mini-app .page {
  width: min(100% - 20px, 1180px);
  padding-top: 18px;
  padding-bottom: calc(28px + var(--tg-safe-area-bottom));
}

.telegram-mini-app .modal-backdrop {
  padding:
    calc(10px + var(--tg-safe-area-top))
    calc(10px + var(--tg-safe-area-right))
    calc(10px + var(--tg-safe-area-bottom))
    calc(10px + var(--tg-safe-area-left));
}

.telegram-mini-app .modal,
.telegram-mini-app .modal-card {
  max-height: calc(var(--tg-viewport-height) - 24px - var(--tg-safe-area-top) - var(--tg-safe-area-bottom));
  overflow: auto;
}

.table-wrap {
  overflow-x: auto;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
}

.rates-table th,
.rates-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.rates-table th {
  color: var(--text-soft);
  font-size: 0.86rem;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    order: 3;
    justify-self: center;
    justify-content: center;
    max-width: 100%;
    flex-wrap: wrap;
    overflow: visible;
  }

  .nav-item {
    height: 46px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-h: 84px;
    --control-h: 50px;
  }

  html,
  body,
  .shell {
    min-height: 100svh;
  }

  @supports (min-height: 100dvh) {
    html,
    body,
    .shell {
      min-height: 100dvh;
    }
  }

  .app-background {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    height: 100vh;
    min-height: 100svh;
    background-position: center top;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    contain: strict;
  }

  @supports (height: 100lvh) {
    .app-background {
      height: 100lvh;
    }
  }

  .topbar {
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  }

  .brand-logo-frame {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    padding: 4px;
  }

  .brand-logo {
    border-radius: 14px;
  }

  .nav-item {
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
  }

  .nav-item:not(.active):not(:hover):not(:focus-visible) .nav-label {
    display: none;
  }

  .nav-item.active .nav-label,
  .nav-item:hover .nav-label,
  .nav-item:focus-visible .nav-label {
    max-width: 112px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .page {
    width: min(100% - 24px, 1500px);
    padding-top: 22px;
    padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }

  .landing-page {
    width: min(100% - 24px, 1280px);
    padding-top: 28px;
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    gap: 34px;
  }

  .landing-hero {
    min-height: auto;
    padding: 18px 0 12px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    gap: 14px;
  }

  .field,
  select.field,
  textarea.field,
  input[type="date"].field,
  .type-segment {
    width: 100%;
    max-width: 100%;
  }

  .field,
  select.field,
  input[type="date"].field {
    font-size: 16px;
  }

  .page-header {
    display: block;
  }

  .crypto-info-card,
  .crypto-asset-card,
  .crypto-asset-main {
    grid-template-columns: 1fr;
  }

  .crypto-info-card,
  .crypto-asset-card {
    display: grid;
  }

  .crypto-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crypto-asset-actions {
    justify-content: stretch;
  }

  .crypto-header-actions,
  .card-header-inline,
  .crypto-market-status {
    align-items: stretch;
    flex-direction: column;
  }

  .crypto-market-controls {
    justify-content: stretch;
  }

  .crypto-market-search,
  .crypto-sort-select {
    display: grid;
    width: 100%;
  }

  .crypto-dashboard-layout,
  .crypto-secondary-grid {
    grid-template-columns: 1fr;
  }

  .crypto-table-head,
  .crypto-market-head,
  .crypto-transaction-head {
    display: none;
  }

  .crypto-table-row,
  .crypto-market-row,
  .crypto-transaction-row {
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
  }

  .crypto-table-row .crypto-cell:not(.crypto-coin-cell),
  .crypto-market-row .crypto-cell:not(.crypto-coin-cell),
  .crypto-transaction-row .crypto-cell:not(.crypto-coin-cell) {
    justify-items: stretch;
    text-align: left;
  }

  .crypto-market-rank {
    width: 100%;
    justify-content: start;
    place-items: center start;
    padding: 0 10px;
  }

  .crypto-cell {
    grid-template-columns: minmax(92px, .45fr) minmax(0, 1fr);
    align-items: center;
  }

  .crypto-cell small {
    display: block;
  }

  .crypto-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .crypto-tab {
    flex: 0 0 auto;
  }

  .crypto-coin-cell {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crypto-row-actions {
    justify-content: stretch;
  }

  .crypto-chart-card {
    min-height: 0;
  }

  .site-footer,
  .legal-links,
  .support-contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer,
  .legal-links {
    justify-content: flex-start;
  }

  .actions .button,
  .toolbar .button,
  .toolbar .field {
    width: 100%;
  }

  .security-action-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .security-action-row .actions,
  .danger-modal-actions {
    justify-content: stretch;
  }

  .row {
    grid-template-columns: auto 1fr;
  }

  .provider-row,
  .provider-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .provider-actions {
    display: grid;
    justify-content: stretch;
  }

  .provider-status {
    width: 100%;
  }

  .avatar-settings {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .row-amount {
    grid-column: 1 / -1;
    text-align: left;
  }

  .calendar-grid {
    gap: 6px;
  }

  .calendar-day {
    min-height: 72px;
    padding: 8px;
  }

  .card {
    border-radius: 22px;
    backdrop-filter: blur(14px) saturate(1.08);
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal,
  .modal-card {
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
    overflow: auto;
  }

  .telegram-mini-notice {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .telegram-mini-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .telegram-mini-actions .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .guest-topbar .nav-spacer {
    display: none;
  }

  .brand {
    gap: 10px;
  }

  .brand .brand-title {
    font-size: 1.22rem;
  }

  .brand-subtitle {
    font-size: 0.82rem;
  }

  .theme-toggle,
  .icon-button,
  .avatar-button {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .feedback-trigger {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 16px;
    font-size: 0;
  }

  .feedback-trigger::before {
    content: "!";
    font-size: 1rem;
  }

  .avatar-button {
    border-radius: 999px;
  }

  .nav {
    gap: 6px;
    padding: 7px;
  }

  .nav-item {
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 0;
  }

  .nav-label,
  .nav-item.active .nav-label,
  .nav-item:hover .nav-label,
  .nav-item:focus-visible .nav-label {
    display: none;
  }

  .value {
    font-size: clamp(1.75rem, 14vw, 3rem);
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .row-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .row-amount {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
  }

  .type-option {
    padding-inline: 8px;
    font-size: 0.92rem;
  }

  .social-button {
    min-height: 52px;
    gap: 10px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: 0.95rem;
  }

  .social-icon,
  .social-logo,
  .social-button.google::after {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }

  .social-soon-badge {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .landing-hero {
    gap: 14px;
  }

  .landing-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-actions .button {
    width: 100%;
    min-width: 0;
  }

  .landing-feature-card {
    min-height: 0;
  }

  .crypto-metrics {
    grid-template-columns: 1fr;
  }

  .crypto-asset-card {
    padding: 14px;
  }
}

@media (max-width: 380px) {
  .brand-subtitle {
    display: none;
  }

  .brand-logo-frame {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    padding: 4px;
  }

  .brand-logo {
    border-radius: 12px;
  }

  .top-actions {
    gap: 6px;
  }
}
