: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;
  --field: rgba(248, 250, 252, 0.9);
  --field-hover: rgba(238, 244, 255, 0.96);
  --focus: #60a5fa;
  --radius: 24px;
  --radius-sm: 16px;
  --header-h: 96px;
}

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);
  --field: rgba(18, 18, 22, 0.92);
  --field-hover: rgba(24, 24, 31, 0.98);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  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;
}

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

button {
  cursor: pointer;
}

.app-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(122deg, transparent 0 10%, rgba(121, 129, 136, 0.13) 14%, rgba(255, 255, 255, 0.96) 21%, transparent 31%),
    linear-gradient(122deg, transparent 32%, rgba(132, 136, 140, 0.11) 39%, rgba(255, 255, 255, 0.98) 47%, transparent 58%),
    radial-gradient(circle at 42% 42%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(135deg, #ffffff, #eef0f1);
}

.app-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    repeating-linear-gradient(122deg, rgba(255, 255, 255, 0.9) 0 94px, rgba(208, 212, 216, 0.15) 126px, rgba(92, 100, 108, 0.1) 154px, rgba(255, 255, 255, 0.84) 218px);
  opacity: 0.22;
  transform: translate3d(-2%, 0, 0) scale(1.04);
  animation: shaderFallbackDrift 22s ease-in-out infinite alternate;
}

.app-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 48% 32%, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08));
  opacity: 0.16;
}

body[data-theme="dark"] .app-background {
  background:
    linear-gradient(122deg, transparent 0 10%, rgba(255, 255, 255, 0.08) 14%, rgba(18, 18, 20, 0.92) 21%, transparent 31%),
    linear-gradient(122deg, transparent 32%, rgba(255, 255, 255, 0.07) 39%, rgba(20, 20, 22, 0.96) 47%, transparent 58%),
    radial-gradient(circle at 42% 42%, rgba(35, 35, 37, 0.5), transparent 44%),
    #000000;
}

body[data-theme="dark"] .app-background::before {
  background:
    repeating-linear-gradient(122deg, rgba(20, 20, 22, 0.92) 0 94px, rgba(55, 55, 58, 0.28) 126px, rgba(0, 0, 0, 0.92) 154px, rgba(18, 18, 20, 0.84) 218px);
  opacity: 0.34;
}

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

.background-shader-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.app-background.no-webgl .background-shader-canvas {
  display: none;
}

@keyframes shaderFallbackDrift {
  from {
    transform: translate3d(-2%, 0, 0) scale(1.04);
  }

  to {
    transform: translate3d(2%, -1%, 0) scale(1.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-background::before {
    animation: none;
  }
}

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

.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 12px 36px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(22px) saturate(1.25);
}

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

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
}

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

.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(20px);
  overflow: visible;
}

.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;
}

.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(20px);
}

.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.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(24px) saturate(1.18);
  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;
}

.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;
}

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

.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%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: 0;
  color: var(--text);
  background: var(--field);
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

select.field {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
    linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 21px,
    calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

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

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

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

.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: var(--blue);
  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 {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.24);
}

.button:active {
  transform: translateY(0);
}

.button:disabled,
.button[disabled],
form[data-busy="true"] .button {
  cursor: wait;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.button.income {
  background: var(--green);
  box-shadow: 0 14px 34px rgba(34, 197, 94, 0.22);
}

.button.income:hover {
  background: var(--green-hover);
}

.button.income:active {
  background: var(--green-pressed);
}

.button.expense {
  background: var(--red);
  box-shadow: 0 14px 34px rgba(239, 68, 68, 0.24);
}

.button.expense:hover {
  background: var(--red-hover);
}

.button.expense:active {
  background: var(--red-pressed);
}

.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: var(--red);
}

.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;
}

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

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

.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);
}

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

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

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

.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 h3 {
  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: 10px;
}

.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
  box-shadow: var(--soft-shadow);
  font-weight: 850;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.social-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--focus) 32%, var(--border));
  background: var(--field-hover);
}

.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.62;
  transform: none;
}

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

.social-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 950;
}

.google-icon {
  background: conic-gradient(from 45deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
}

.apple-icon {
  background: linear-gradient(145deg, #111827, #000000);
}

body[data-theme="dark"] .apple-icon {
  background: linear-gradient(145deg, #f5f5f7, #a1a1aa);
  color: #050505;
}

.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);
}

.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);
}

.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;
  }

  .topbar {
    padding: 14px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .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: 24px;
  }

  .page-header {
    display: block;
  }

  .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%;
  }

  .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;
  }
}

@media (max-width: 560px) {
  .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;
  }
}
