:root {
  color-scheme: dark;
  --bg: #06142b;
  --bg-soft: #0a1f43;
  --ink: #f6fbff;
  --muted: rgba(222, 239, 255, 0.72);
  --faint: rgba(222, 239, 255, 0.5);
  --line: rgba(212, 238, 255, 0.26);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --blue: #67d5ff;
  --blue-strong: #2da8ff;
  --mint: #73f2d3;
  --violet: #a9b8ff;
  --danger: #ff9cab;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 6%, rgba(75, 169, 255, 0.34), transparent 36%),
    radial-gradient(ellipse at 80% 16%, rgba(114, 242, 211, 0.2), transparent 34%),
    linear-gradient(145deg, #051126 0%, #081f44 48%, #031226 100%);
  color: var(--ink);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image: linear-gradient(rgba(2, 10, 28, 0.02), rgba(2, 10, 28, 0.52)), url("./crystal-background-hd.webp");
  background-size: cover;
  background-position: center;
  filter: saturate(1.16) contrast(1.04);
  opacity: 0.92;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 22%, transparent 72%, rgba(114, 213, 255, 0.08)),
    repeating-linear-gradient(130deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 118px);
  mix-blend-mode: screen;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1180px);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 14px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(103, 213, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 28px rgba(33, 164, 255, 0.18);
  color: white;
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup strong {
  font-size: 1rem;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.75rem;
}

.screen-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 251, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
}

.screen-frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  touch-action: pan-y;
}

.screen-track {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 100%);
  transition: transform 460ms cubic-bezier(0.2, 0.86, 0.22, 1);
  will-change: transform;
}

.screen {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0 18px;
  scrollbar-width: thin;
}

.screen::-webkit-scrollbar {
  width: 8px;
}

.screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
    rgba(8, 33, 71, 0.42);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.welcome-hero,
.screen-title {
  padding: 4px 2px;
}

.welcome-gate {
  min-height: 100dvh;
  width: min(100%, 620px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.login-panel {
  width: 100%;
  padding: 22px;
  overflow: hidden;
  position: relative;
  animation: panelIn 520ms ease both;
}

.login-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.24), transparent 36%, rgba(103, 213, 255, 0.12));
  pointer-events: none;
}

.login-panel > * {
  position: relative;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 1.15rem;
}

.login-brand small {
  color: var(--muted);
}

.large-mark {
  width: 54px;
  height: 54px;
  font-size: 1.2rem;
}

.gate-tip {
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.gate-tip p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.42;
}

.gate-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.gate-metrics div {
  min-width: 0;
  padding: 12px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.gate-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.gate-metrics strong {
  display: block;
  margin-top: 6px;
  color: white;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.gate-button {
  min-height: 56px;
  margin-top: 16px;
  font-size: 1rem;
}

.swipe-hint {
  margin: 14px 0 0;
  color: rgba(246, 251, 255, 0.72);
  text-align: center;
  font-size: 0.82rem;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow,
.mini-label {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.screen-title h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

h3 {
  font-size: 0.95rem;
  letter-spacing: 0;
}

.date-line {
  margin-bottom: 0;
  color: rgba(246, 251, 255, 0.82);
  font-size: 1rem;
}

.tip-card {
  padding: 18px;
}

.tip-card p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.stat-card {
  min-height: 116px;
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 42%);
  opacity: 0.55;
  pointer-events: none;
}

.stat-card > * {
  position: relative;
}

.stat-label,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-card strong {
  display: block;
  margin: 10px 0 6px;
  color: white;
  font-size: 1.55rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.tone-cool {
  border-color: rgba(103, 213, 255, 0.34);
}

.tone-green {
  border-color: rgba(115, 242, 211, 0.34);
}

.tone-violet {
  border-color: rgba(169, 184, 255, 0.34);
}

.form-panel {
  padding: 16px;
  margin: 14px 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.82rem;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: rgba(246, 251, 255, 0.82);
  font-size: 0.82rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  outline: none;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(230, 243, 255, 0.42);
}

select option {
  color: #0b2448;
  background: #f5fbff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(103, 213, 255, 0.78);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 4px rgba(45, 168, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.glass-button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  padding: 12px 18px;
  color: white;
  background:
    linear-gradient(145deg, rgba(103, 213, 255, 0.55), rgba(45, 168, 255, 0.22)),
    rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(45, 168, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.glass-button:active {
  transform: translateY(1px) scale(0.99);
}

.primary-button {
  width: 100%;
  margin-top: 14px;
  font-weight: 800;
}

.list-section,
.statement-section {
  margin-top: 18px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.list-header h2 {
  margin-bottom: 0;
}

.list-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.expense-list,
.statement-list {
  display: grid;
  gap: 10px;
}

.expense-card {
  padding: 14px;
}

.expense-main,
.expense-meta,
.metric-header,
.statement-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.expense-main h3,
.expense-main p {
  margin-bottom: 4px;
}

.expense-main p,
.expense-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.expense-main strong {
  flex: 0 0 auto;
}

.expense-meta {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.danger {
  color: var(--danger);
}

.empty-state {
  margin: 12px 0 0;
  color: var(--muted);
}

.delivery-screen {
  display: grid;
  align-content: center;
}

.delivery-card {
  margin-top: 4px;
}

.delivery-date {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.delivery-date span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-date strong {
  font-size: 1.2rem;
}

.delivery-grid,
.progress-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.delivery-metric,
.progress-panel,
.statement-card {
  padding: 15px;
}

.metric-header h3,
.metric-header strong,
.statement-top h3,
.statement-top strong {
  margin: 0;
}

.metric-header strong,
.statement-top strong {
  color: var(--mint);
  font-size: 1.15rem;
}

.metric-list,
.statement-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.metric-list div,
.statement-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 800;
}

.progress-row {
  display: grid;
  gap: 7px;
}

.progress-row + .progress-row {
  margin-top: 14px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-copy span,
.progress-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  box-shadow: 0 0 18px rgba(103, 213, 255, 0.45);
  transition: width 420ms ease;
}

.statement-grid {
  grid-template-columns: 1fr;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  padding-bottom: max(2px, env(safe-area-inset-bottom));
}

.bottom-nav button {
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(246, 251, 255, 0.66);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.bottom-nav button.active {
  color: white;
  border-color: rgba(103, 213, 255, 0.46);
  background: rgba(103, 213, 255, 0.18);
}

.nav-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 18px 22px 14px;
  }

  h1 {
    font-size: 2.75rem;
  }

  .screen-title h1 {
    font-size: 2.15rem;
  }

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

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

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

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

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

  .bottom-nav {
    width: min(520px, 100%);
    margin: 0 auto;
  }
}

@media (min-width: 920px) {
  .screen {
    padding: 18px 4px 24px;
  }

  .welcome-gate {
    width: min(100%, 720px);
  }

  .login-panel {
    padding: 30px;
  }
}

@media (max-width: 374px) {
  .brand-lockup small,
  .screen-pill {
    display: none;
  }

  .bottom-nav button {
    min-height: 52px;
    padding: 10px 6px;
  }

  .nav-dot {
    width: 9px;
    height: 9px;
  }
}
