:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #111;
  --panel-2: #191919;
  --line: #252525;
  --text: #f7f8fb;
  --muted: #8d929a;
  --muted-2: #5d626b;
  --blue: #0098ff;
  --green: #42d77d;
  --red: #ff5a63;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 10px 116px;
  background: #000;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  border-bottom: 1px solid var(--line);
}

.screen {
  animation: screen-in 180ms ease both;
}

.screen[hidden] {
  display: none;
}

.utility-screen {
  padding: 24px 0;
}

.utility-screen h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 850;
}

.utility-screen p {
  max-width: 330px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #2c2c2c;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #454545, #090909 62%);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.ghost-icon,
.round-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.tab[hidden] {
  display: none;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  font-weight: 650;
}

.tab.active {
  color: #fff;
}

.balance-section {
  padding: 18px 0 16px;
}

.muted-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.ghost-icon {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.balance-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.balance-row strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 850;
  text-shadow: 2px 2px 0 #0057aa;
}

.currency-pill {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 800;
}

.currency-control {
  position: relative;
  display: inline-grid;
  align-items: center;
}

.currency-menu {
  position: absolute;
  z-index: 3;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 74px;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.currency-menu[hidden] {
  display: none;
}

.currency-menu button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.currency-menu button.active {
  background: #2b2b2b;
  color: #fff;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  min-width: 0;
  border: 0;
  border-radius: var(--radius);
  background: #2a2a2a;
  cursor: pointer;
  padding: 6px 12px 6px 6px;
  text-align: left;
}

.action-icon {
  display: grid;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: #202020;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.action-card.accent .action-icon {
  background: #0d3a63;
  color: #f5fbff;
}

.action-card span:last-child {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.form-panel {
  margin-top: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0a0a;
}

.panel-title-row,
.assets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title-row h1,
.assets-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
}

.round-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #1f1f1f;
  color: var(--muted);
  font-size: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border-radius: var(--radius);
  background: #171717;
}

.segment {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segment.active {
  background: #2b2b2b;
  color: #fff;
}

.field {
  display: block;
  margin-top: 12px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.field input {
  height: 44px;
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 0 12px;
}

.field input::placeholder,
.search-box input::placeholder {
  color: var(--muted-2);
}

.chip-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
  padding-bottom: 1px;
}

.chip-row button,
.filter-pill {
  flex: 0 0 auto;
  border: 1px solid #2b2b2b;
  border-radius: 999px;
  background: #070707;
  color: var(--muted);
  cursor: pointer;
}

.chip-row button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: #242424;
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.primary-button.danger {
  background: var(--red);
}

.error-text {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.assets-head {
  margin-top: 28px;
}

.filter-pill {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  min-height: 40px;
  margin-top: 14px;
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 0 13px;
  color: var(--muted-2);
}

.month-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.month-summary div {
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: #0d0d0d;
}

.month-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.month-summary strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.transaction-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.transaction-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-radius: var(--radius);
  background: #0b0b0b;
  padding: 9px 10px;
}

.transaction-logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: #1b1b1b;
  font-weight: 900;
}

.transaction-logo.plus {
  color: var(--green);
}

.transaction-logo.minus {
  color: var(--red);
}

.transaction-main {
  min-width: 0;
}

.transaction-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.transaction-meta {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.transaction-amount {
  text-align: right;
  font-size: 14px;
  font-weight: 850;
}

.transaction-amount.plus {
  color: var(--green);
}

.transaction-amount.minus {
  color: var(--red);
}

.transaction-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.transaction-tools button {
  border: 0;
  border-radius: 6px;
  background: #1d1d1d;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 750;
}

.empty-state {
  padding: 34px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.confirm-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 16px 10px max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.62);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(100%, 410px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101010;
  padding: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.confirm-details {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--radius);
  background: #0a0a0a;
}

.confirm-details strong,
.confirm-details span {
  overflow-wrap: anywhere;
}

.confirm-details strong {
  font-size: 15px;
}

.confirm-details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.confirm-question {
  margin: 14px 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bottom-nav {
  --nav-padding-x: 8px;
  --active-circle-size: 62px;
  position: fixed;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 28px), 400px);
  height: 70px;
  margin: 0 auto;
  padding: 0 var(--nav-padding-x);
  border: 1px solid #15151c;
  border-radius: 10px;
  background: #080711;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  overflow: visible;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -33px;
  left: calc(
    var(--nav-padding-x) + ((100% - (var(--nav-padding-x) * 2)) / 4) * var(--active-index) +
      ((100% - (var(--nav-padding-x) * 2)) / 8) - (var(--active-circle-size) / 2) + 1px
  );
  width: var(--active-circle-size);
  height: var(--active-circle-size);
  border-radius: 50%;
  background: #f8f8fa;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.32);
  transition: left 320ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.bottom-nav::after {
  content: none;
  position: absolute;
  z-index: 0;
  top: -15px;
  left: calc((100% / 4) * var(--active-index) + (100% / 8) - 50px);
  width: 100px;
  height: 44px;
  border-radius: 0 0 42px 42px;
  background: #000;
  transition: left 320ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.bottom-item {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.bottom-item .nav-icon,
.bottom-item small {
  display: block;
}

.bottom-item .nav-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  transition:
    transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.bottom-item .nav-icon img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: invert(1);
  opacity: 0.78;
  transition:
    filter 220ms ease,
    opacity 220ms ease;
}

.bottom-item small {
  position: absolute;
  bottom: 11px;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition:
    color 200ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.bottom-item.active {
  color: #fff;
}

.bottom-item.active .nav-icon {
  transform: translateY(-37px);
}

.bottom-item.active .nav-icon img {
  filter: none;
  opacity: 1;
}

.bottom-item.active small {
  color: #fff;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 360px) {
  .tabs {
    gap: 16px;
  }

  .quick-actions {
    gap: 7px;
  }

  .action-card span:last-child {
    font-size: 13px;
  }
}
