:root {
  --far-black: #050505;
  --far-ink: #151515;
  --far-muted: #6f6f68;
  --far-line: #e3e3df;
  --far-soft: #f6f6f4;
  --far-yellow: #ffca08;
  --far-yellow-dark: #e7b200;
  --far-success: #dff4dd;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: #efefec;
  color: var(--far-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.splash-lock {
  overflow: hidden;
}

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

svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.phone-stage {
  min-height: 100vh;
  background: var(--far-soft);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 202, 8, .16), transparent 28%),
    #050505;
  color: #fff;
  opacity: 1;
  transition: opacity .42s ease, visibility .42s ease;
}

.splash-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.splash-logo-wrap {
  position: relative;
  display: grid;
  width: min(62vw, 238px);
  aspect-ratio: 1;
  place-items: center;
}

.splash-logo-wrap::before,
.splash-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 202, 8, .45);
  border-radius: 50%;
  animation: splash-ring 1.55s ease-out infinite;
}

.splash-logo-wrap::after {
  animation-delay: .45s;
}

.splash-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  animation: splash-pulse 1.55s ease-in-out infinite;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .48);
}

.splash-screen strong {
  margin-top: 16px;
  color: #fff;
  font-size: 1.95rem;
  font-weight: 950;
  line-height: 1;
}

.splash-screen span {
  color: var(--far-yellow);
  font-size: .95rem;
  font-weight: 850;
}

@keyframes splash-pulse {
  0%,
  100% {
    transform: scale(.96);
  }

  50% {
    transform: scale(1.03);
  }
}

@keyframes splash-ring {
  0% {
    opacity: .7;
    transform: scale(.78);
  }

  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-logo,
  .splash-logo-wrap::before,
  .splash-logo-wrap::after {
    animation: none;
  }
}

.app-view,
.screen,
.auth-form {
  display: none;
}

.app-view.active,
.screen.active,
.auth-form.active {
  display: block;
}

.login-view {
  min-height: 100vh;
  padding: 28px 20px calc(22px + var(--safe-bottom));
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 70px),
    radial-gradient(circle at 50% 12%, rgba(255, 202, 8, .18), transparent 28%),
    var(--far-black);
}

.login-hero {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 12px 0 22px;
  text-align: center;
}

.login-logo {
  width: min(54vw, 220px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .42);
}

.login-hero h1 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 3.25rem;
  font-weight: 950;
  line-height: .9;
}

.login-hero p {
  max-width: 260px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: .92rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 auto 18px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  max-width: 420px;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-weight: 850;
}

.auth-tab.active {
  background: var(--far-yellow);
  color: #080808;
}

.install-button {
  display: flex;
  width: min(100%, 420px);
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 202, 8, .72);
  border-radius: 8px;
  background: rgba(255, 202, 8, .12);
  color: #fff;
  font-weight: 900;
}

.install-button[hidden] {
  display: none;
}

.install-button svg {
  color: var(--far-yellow);
}

.ios-hint {
  width: min(100%, 420px);
  margin: 0 auto 16px;
  padding: 12px;
  border: 1px solid rgba(255, 202, 8, .38);
  border-radius: 8px;
  background: rgba(255, 202, 8, .11);
  color: #fff;
  font-size: .86rem;
  font-weight: 750;
}

.auth-form {
  width: min(100%, 420px);
  margin: 0 auto;
}

.form-label {
  color: inherit;
  font-size: .86rem;
  font-weight: 850;
}

.form-control,
.form-select {
  min-height: 50px;
  border-color: #d9d9d4;
  border-radius: 8px;
  font-weight: 700;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--far-yellow);
  box-shadow: 0 0 0 .18rem rgba(255, 202, 8, .26);
}

.dark-control {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.dark-control::placeholder {
  color: rgba(255, 255, 255, .68);
}

.dark-control:focus {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.btn-far {
  border: 0;
  border-radius: 8px;
  background: var(--far-yellow);
  color: #050505;
  font-weight: 900;
}

.btn-far:hover,
.btn-far:active {
  background: var(--far-yellow-dark);
  color: #050505;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: rgba(255, 255, 255, .7);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid rgba(255, 255, 255, .28);
}

.app-main {
  min-height: 100vh;
  padding: 0 0 calc(86px + var(--safe-bottom));
  background: var(--far-soft);
}

.offline-banner {
  display: grid;
  gap: 2px;
  margin: 12px 14px 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 202, 8, .36);
  border-radius: 8px;
  background: #fff5d7;
  color: #4d3900;
  font-size: .84rem;
}

.offline-banner[hidden] {
  display: none;
}

.offline-banner strong {
  font-size: .9rem;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px;
  background: var(--far-black);
  color: #fff;
}

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

.brand-inline img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}

.brand-inline strong,
.brand-inline span {
  display: block;
}

.brand-inline strong {
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1;
}

.brand-inline span {
  color: rgba(255, 255, 255, .74);
  font-size: .72rem;
  font-weight: 700;
}

.icon-btn,
.back-btn {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.screen {
  padding: 18px 14px;
}

.hello-block h2 {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 920;
}

.hello-block p {
  margin: 4px 0 0;
  color: var(--far-muted);
  font-size: .95rem;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.feature-card,
.panel {
  border: 1px solid var(--far-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 9px 26px rgba(0, 0, 0, .05);
}

.feature-card {
  display: grid;
  min-height: 158px;
  place-items: center;
  padding: 18px 12px;
  color: var(--far-ink);
  text-align: center;
}

.feature-card strong {
  max-width: 120px;
  font-size: 1rem;
  line-height: 1.25;
}

.round-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
}

.round-icon.black {
  background: #050505;
  color: #fff;
}

.round-icon.yellow {
  background: var(--far-yellow);
  color: #050505;
}

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

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h3,
.panel h3 {
  position: relative;
  margin: 0;
  padding-left: 10px;
  font-size: 1.04rem;
  font-weight: 920;
}

.panel-title h3::before,
.panel h3::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 3px;
  border-radius: 99px;
  background: var(--far-yellow);
}

.mini-chart {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--far-line);
  border-radius: 8px;
}

.muted-label,
.small-muted,
.compact-row span,
.summary-split span,
.contribution-card span {
  color: var(--far-muted);
  font-size: .84rem;
}

.money {
  display: block;
  margin-top: 5px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.summary-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--far-line);
}

.summary-split div + div {
  border-left: 1px solid var(--far-line);
  padding-left: 12px;
}

.summary-split strong {
  display: block;
  margin-top: 4px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--far-ink);
  font-size: .82rem;
  font-weight: 800;
}

.compact-list,
.contribution-list {
  display: grid;
  gap: 10px;
}

.compact-row,
.contribution-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.compact-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--far-line);
}

.compact-row:last-child {
  border-bottom: 0;
}

.status-badge {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--far-success);
  color: #217b2e;
  font-size: .76rem;
  font-weight: 850;
}

.contribution-card {
  padding: 14px;
  border: 1px solid var(--far-line);
  border-radius: 8px;
}

.contribution-card strong {
  display: block;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-grid label {
  color: var(--far-muted);
  font-size: .78rem;
  font-weight: 850;
}

.filter-wide {
  grid-column: 1 / -1;
}

.finance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-chip {
  padding: 10px;
  border: 1px solid var(--far-line);
  border-radius: 8px;
  background: var(--far-soft);
}

.finance-chip span {
  display: block;
  color: var(--far-muted);
  font-size: .76rem;
  font-weight: 800;
}

.finance-chip strong {
  display: block;
  margin-top: 3px;
  font-size: .98rem;
}

.contribution-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.screen-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  margin: -18px -14px 16px;
  padding: 12px 14px;
  background: var(--far-black);
  color: #fff;
}

.screen-header h2 {
  margin: 0;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 900;
}

.contribution-form {
  padding-bottom: 18px;
}

.upload-box {
  display: grid;
  min-height: 148px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #bdbdb8;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.upload-box svg {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
}

.upload-box span,
.upload-box small {
  color: var(--far-muted);
}

.file-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--far-line);
  border-radius: 8px;
  font-weight: 800;
}

.notice {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff5d7;
  color: #4d3900;
  font-size: .84rem;
}

.submit-fixed {
  margin-top: 16px;
}

.profile-panel {
  text-align: center;
}

.profile-panel img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 16px;
}

.profile-panel h2 {
  margin: 12px 0 2px;
  font-size: 1.35rem;
  font-weight: 920;
}

.profile-panel p {
  color: var(--far-muted);
}

.profile-panel dl {
  margin: 18px 0 0;
  text-align: left;
}

.profile-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--far-line);
}

.profile-panel dt {
  color: var(--far-muted);
}

.profile-panel dd {
  margin: 0;
  font-weight: 850;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: #050505;
}

.nav-item {
  display: grid;
  gap: 3px;
  justify-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}

.nav-item svg {
  width: 1.35rem;
  height: 1.35rem;
}

.nav-item.active {
  color: var(--far-yellow);
}

.nav-plus svg {
  padding: 3px;
  border-radius: 50%;
  background: var(--far-yellow);
  color: #050505;
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
  }

  .phone-stage {
    width: 390px;
    min-height: min(844px, calc(100vh - 48px));
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .26);
  }

  .bottom-nav {
    left: 50%;
    width: 390px;
    transform: translateX(-50%);
  }
}
