:root {
  --ink: #17201d;
  --muted: #64716c;
  --line: #dfe6e1;
  --panel: #f7faf7;
  --card: #ffffff;
  --green: #147d64;
  --green-dark: #0d5748;
  --amber: #d99024;
  --red: #c5493d;
  --blue: #3867c8;
  --violet: #7657c6;
  --shadow: 0 24px 70px rgba(23, 32, 29, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(20, 125, 100, 0.16), transparent 34%),
    linear-gradient(230deg, rgba(56, 103, 200, 0.14), transparent 38%),
    #eef3ef;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 430px);
  gap: 36px;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  align-items: center;
}

.desktop-panel {
  display: grid;
  gap: 22px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  color: white;
  font-weight: 800;
  background: var(--green-dark);
}

.eyebrow,
.label {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.collector-visual {
  position: relative;
  min-height: 260px;
}

.mail-window {
  width: min(100%, 560px);
  padding: 14px;
  border: 1px solid rgba(23, 32, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.window-bar {
  display: flex;
  gap: 7px;
  padding-bottom: 14px;
}

.window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #c6d3cb;
}

.mail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.mail-row strong,
.mail-row small {
  display: block;
}

.mail-row small {
  color: var(--muted);
}

.mail-row.active {
  border-radius: 8px;
  border-top: 0;
  color: white;
  background: var(--green);
}

.mail-row.active small {
  color: rgba(255, 255, 255, 0.78);
}

.scan-card {
  position: absolute;
  right: 16px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: min(300px, 82%);
  padding: 16px;
  border: 1px solid rgba(23, 32, 29, 0.08);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 44px rgba(23, 32, 29, 0.18);
}

.scan-card small {
  display: block;
  color: var(--muted);
}

.pulse {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: var(--amber);
  box-shadow: 0 0 0 10px rgba(217, 144, 36, 0.16);
}

.collector-card,
.scan-status,
.privacy-note {
  padding: 20px;
  border: 1px solid rgba(23, 32, 29, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

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

.collector-card p {
  margin-bottom: 0;
}

.secondary-button,
.primary-button,
.text-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.secondary-button {
  min-width: 96px;
  padding: 12px 16px;
  color: var(--green-dark);
  background: #dceee8;
}

.primary-button {
  width: 100%;
  padding: 15px 18px;
  color: white;
  background: var(--green-dark);
}

.text-button {
  width: 100%;
  padding: 12px 18px;
  color: var(--green-dark);
  background: transparent;
}

.status-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 800;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 99px;
  background: #dbe5df;
}

.progress-fill {
  width: 82%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.4s ease;
}

.scan-status ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.scan-status li {
  display: flex;
  gap: 10px;
  align-items: center;
}

.scan-status li span {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
}

.privacy-note p {
  margin-bottom: 0;
}

.phone {
  position: relative;
  height: min(860px, calc(100vh - 48px));
  min-height: 720px;
  overflow: hidden;
  border: 10px solid #101512;
  border-radius: 34px;
  background: #f8faf8;
  box-shadow: 0 28px 80px rgba(23, 32, 29, 0.28);
}

.phone-status {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  padding: 14px 22px 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.phone-status div {
  display: flex;
  gap: 5px;
  align-items: center;
}

.phone-status div span {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--ink);
}

.onboarding,
.app-screen {
  height: calc(100% - 38px);
}

.onboarding {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.onboarding.hidden,
.app-screen.hidden,
.toast.hidden {
  display: none;
}

.onboarding-art {
  position: relative;
  height: 230px;
  margin: 10px 0 28px;
}

.card-stack {
  position: absolute;
  width: 260px;
  height: 150px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(23, 32, 29, 0.2);
}

.card-one {
  top: 36px;
  left: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    var(--green-dark);
  transform: rotate(-8deg);
}

.card-two {
  top: 54px;
  right: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 45%),
    var(--blue);
  transform: rotate(8deg);
}

.card-three {
  top: 82px;
  left: 46px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 44%),
    #202925;
}

.onboarding h2 {
  max-width: 320px;
  font-size: 2rem;
  line-height: 1.05;
}

.permission-box {
  display: grid;
  gap: 4px;
  margin: auto 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.permission-box span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.app-screen {
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

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

.content {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 92px;
}

.hero-metric {
  padding: 20px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 44%),
    #183b34;
}

.hero-metric .amount {
  margin: 6px 0;
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 0;
}

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

.metric-chip {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.metric-chip span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
}

.section-title h3 {
  margin: 0;
}

.section-title button {
  border: 0;
  color: var(--green-dark);
  font-weight: 800;
  background: transparent;
}

.category-list,
.transaction-list,
.insight-list,
.card-list {
  display: grid;
  gap: 10px;
}

.category-item,
.transaction-item,
.insight-item,
.source-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.category-item {
  padding: 14px;
}

.category-top,
.transaction-item,
.source-top,
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 99px;
  background: #e8eee9;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.transaction-item {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.transaction-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.amount-negative {
  font-weight: 900;
}

.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill,
.search-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.pill {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.pill.active {
  color: white;
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.search-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 14px;
}

.insight-item {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.insight-top {
  display: flex;
  gap: 12px;
}

.insight-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: white;
  font-weight: 900;
}

.insight-item p {
  margin-bottom: 0;
}

.action-link {
  justify-self: start;
  border: 0;
  color: var(--green-dark);
  font-weight: 900;
  background: transparent;
}

.source-card {
  padding: 16px;
}

.source-card p {
  margin-bottom: 0;
}

.source-card .issuer {
  margin: 10px 0;
  font-size: 1.7rem;
  font-weight: 900;
}

.source-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.source-meta div {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel);
}

.source-meta span,
.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.detail-row {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.empty-state {
  padding: 28px 18px;
  text-align: center;
}

.tabbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(23, 32, 29, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(23, 32, 29, 0.16);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  background: transparent;
}

.tab svg {
  width: 19px;
  height: 19px;
}

.tab.active {
  color: var(--green-dark);
  background: #e1f0eb;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 8px;
  color: white;
  font-weight: 800;
  background: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .desktop-panel {
    order: 2;
  }

  .phone {
    width: min(430px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .desktop-panel {
    padding: 0 16px 24px;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .collector-card {
    align-items: stretch;
    flex-direction: column;
  }
}
