@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700&display=swap");

:root {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color-scheme: light;
  line-height: 1.45;
  --bg: #eff3f8;
  --bg-accent: #dde9ff;
  --card: #ffffffd9;
  --card-solid: #ffffff;
  --border: #d3dceb;
  --text: #142033;
  --muted: #5f6f88;
  --primary: #0f62fe;
  --primary-strong: #0043ce;
  --positive: #0f8c68;
  --negative: #d83c46;
  --warning: #d49000;
  --shadow: 0 20px 55px rgba(17, 40, 77, 0.09);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgba(15, 98, 254, 0.14), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(10, 143, 224, 0.14), transparent 34%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 34%, var(--bg) 100%);
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.payment-ticker {
  position: sticky;
  top: 0;
  z-index: 40;
  overflow: hidden;
  border-bottom: 1px solid #c6d6ee;
  background: linear-gradient(90deg, #0f2340 0%, #163663 100%);
  color: #f0f6ff;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
}

.payment-ticker.hidden {
  display: none !important;
}

.payment-ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  padding-right: 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  animation: ticker-scroll 28s linear infinite;
}

.auth-portal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 98, 254, 0.2), transparent 34%),
    radial-gradient(circle at 90% 85%, rgba(10, 143, 224, 0.17), transparent 38%),
    linear-gradient(160deg, #e9f0fd 0%, #edf3ff 45%, #f5f9ff 100%);
}

.auth-card {
  width: min(460px, 100%);
  padding: 1.4rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #ffffffeb;
  box-shadow: 0 24px 60px rgba(20, 32, 51, 0.13);
}

.auth-card h2 {
  margin: 0.2rem 0 0.6rem;
  font-family: "Sora", "Manrope", sans-serif;
}

.auth-card > p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: #f7faff;
  color: #345074;
  font-size: 0.86rem;
  font-weight: 700;
}

img {
  max-width: 100%;
}

header,
section,
article {
  width: 100%;
}

main {
  padding: 2.2rem clamp(1rem, 2.6vw, 2.6rem) 3.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  max-width: 100%;
  margin: 0 auto;
}

.page-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mobile-layout-toggle {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.mobile-layout-toggle .btn {
  min-width: 140px;
}

.page-tab.active {
  color: #fff;
}

.app-page {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ledger-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(280px, 0.85fr);
  gap: 2rem;
  padding: 2.2rem clamp(1rem, 4vw, 2.8rem);
  background: linear-gradient(130deg, #f8fbff 0%, #eef4ff 58%, #eaf1ff 100%);
  border-bottom: 1px solid #c9d7ee;
  animation: rise-in 360ms ease-out;
}

.app-shell.mobile-ui .hero {
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.1rem 0.95rem;
}

.app-shell.mobile-ui .hero h1 {
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.app-shell.mobile-ui main {
  padding: 1rem 0.75rem 2rem;
  gap: 1rem;
}

.app-shell.mobile-ui .page-nav {
  position: sticky;
  top: 2.2rem;
  z-index: 30;
  background: rgba(239, 243, 248, 0.95);
  border: 1px solid #d4deee;
  border-radius: 0.85rem;
  padding: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.app-shell.mobile-ui .card {
  padding: 1rem;
  border-radius: 0.95rem;
}

.app-shell.mobile-ui .layout,
.app-shell.mobile-ui .card-grid,
.app-shell.mobile-ui .ledger-split,
.app-shell.mobile-ui .form-grid {
  grid-template-columns: 1fr;
}

.app-shell.mobile-ui .btn {
  min-height: 46px;
}

.app-shell.mobile-ui .timeline-days {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.45rem;
}

.app-shell.mobile-ui .timeline-day {
  min-height: 54px;
}

.hero h1 {
  font-family: "Sora", "Manrope", sans-serif;
  margin: 0.25rem 0 1rem;
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  max-width: 24ch;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 58ch;
}

.hero-card {
  padding: 1.5rem;
  border-radius: 1.2rem;
  background: linear-gradient(150deg, #0f2340 0%, #112f57 52%, #164178 100%);
  color: #f1f6ff;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  box-shadow: 0 22px 45px rgba(9, 28, 54, 0.35);
}

.hero-card h2 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  letter-spacing: -0.02em;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
  color: rgba(241, 246, 255, 0.95);
}

.hero-stats > div {
  border: 1px solid rgba(241, 246, 255, 0.18);
  border-radius: 0.8rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.hero-stats p {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(241, 246, 255, 0.92);
}

.hero-stats strong {
  display: block;
  margin-top: 0.3rem;
  color: #ffffff;
  font-size: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1c56d7;
}

.cta-row {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.privacy-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.app-shell.privacy-on .privacy-toggle {
  border-color: rgba(15, 98, 254, 0.45);
  background: rgba(15, 98, 254, 0.12);
}

.btn {
  border: none;
  border-radius: 0.85rem;
  padding: 0.72rem 1.15rem;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 180ms ease, background 180ms ease,
    border-color 180ms ease, color 180ms ease;
}

.btn.primary {
  background: linear-gradient(140deg, var(--primary) 0%, #2a8df8 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 98, 254, 0.27);
}

.btn.primary:hover {
  background: linear-gradient(140deg, var(--primary-strong) 0%, #1f76e4 100%);
  transform: translateY(-1px);
}

.btn.ghost {
  background: #ffffffb8;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f3f8ff;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.83rem;
}

.card {
  background: var(--card);
  border-radius: 1.15rem;
  padding: 1.35rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: rise-in 330ms ease-out;
}

.timeline-card {
  gap: 0.95rem;
  background:
    radial-gradient(circle at 92% 8%, rgba(15, 98, 254, 0.14), transparent 40%),
    linear-gradient(145deg, #f9fbff 0%, #f0f5ff 55%, #eef4ff 100%);
  border-color: #c7d7f0;
}

.timeline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.timeline-controls label {
  min-width: 240px;
}

#timeline-month {
  border-radius: 0.9rem;
  background: #ffffffcc;
  font-weight: 700;
}

#timeline-full-month {
  border-radius: 0.9rem;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.timeline-summary article {
  border: 1px solid #ccd9ef;
  border-radius: 0.9rem;
  padding: 0.72rem 0.78rem;
  background: #ffffffd8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.timeline-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.timeline-summary strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.14rem;
  font-family: "Sora", "Manrope", sans-serif;
}

#timeline-net.negative {
  color: var(--negative);
}

.timeline-days {
  display: grid;
  grid-template-columns: repeat(var(--timeline-columns, 16), minmax(62px, 1fr));
  gap: 0.5rem;
  border: 1px solid #cad9ef;
  border-radius: 1rem;
  padding: 0.6rem;
  background: #f7fbff;
}

.timeline-day {
  position: relative;
  border: 1px solid #bfd0e9;
  background: #ffffff;
  color: #2a4062;
  border-radius: 0.72rem;
  font-weight: 700;
  min-height: 62px;
  padding: 0.35rem 0.15rem 0.28rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 0.05rem;
  transition: all 0.18s ease;
  box-shadow: 0 1px 0 rgba(17, 40, 77, 0.05);
}

.timeline-day:hover {
  background: #edf4ff;
  transform: translateY(-1px);
}

.timeline-weekday {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a7e9f;
}

.timeline-date {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.timeline-day.active {
  background: linear-gradient(150deg, #0f62fe 0%, #1d8cf6 100%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(15, 98, 254, 0.28);
}

.timeline-day.active .timeline-weekday {
  color: rgba(255, 255, 255, 0.78);
}

.timeline-day.today {
  border: 2px solid #1f8f5d;
  background: linear-gradient(180deg, #ffffff 0%, #ecfff6 100%);
  box-shadow:
    0 0 0 3px rgba(31, 143, 93, 0.22),
    0 8px 18px rgba(31, 143, 93, 0.2),
    inset 0 0 0 1px rgba(58, 165, 113, 0.2);
  transform: translateY(-1px);
}

.timeline-day.today::before {
  content: "Heute";
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  font-size: 0.56rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: #1f8f5d;
  border-radius: 999px;
  padding: 0.15rem 0.35rem;
  box-shadow: 0 3px 8px rgba(31, 143, 93, 0.34);
  animation: today-pulse 1.7s ease-in-out infinite;
  pointer-events: none;
}

.timeline-day.today .timeline-weekday,
.timeline-day.today .timeline-date {
  color: #1f8f5d;
}

.timeline-day.has-expense:not(.active) {
  border-color: #df9fa5;
  background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
}

.timeline-day.has-expense::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d83c46;
  box-shadow: 0 0 0 2px rgba(216, 60, 70, 0.12);
}

.timeline-day.active.has-expense::after {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.timeline-day.active.today {
  box-shadow:
    0 10px 20px rgba(15, 98, 254, 0.28),
    0 0 0 3px rgba(72, 206, 136, 0.34),
    inset 0 0 0 1px rgba(72, 206, 136, 0.9);
}

.app-shell.privacy-on #hero-balance,
.app-shell.privacy-on #hero-income,
.app-shell.privacy-on #hero-expense,
.app-shell.privacy-on #hero-debt-remaining,
.app-shell.privacy-on #timeline-income,
.app-shell.privacy-on #timeline-expense,
.app-shell.privacy-on #timeline-net,
.app-shell.privacy-on #summary-balance,
.app-shell.privacy-on #summary-income,
.app-shell.privacy-on #summary-expense,
.app-shell.privacy-on #debt-total-remaining,
.app-shell.privacy-on .post-amount,
.app-shell.privacy-on .frame-ratio,
.app-shell.privacy-on .timeline-date,
.app-shell.privacy-on #transaction-table td:nth-child(4),
.app-shell.privacy-on .debt-table td:nth-child(2),
.app-shell.privacy-on .debt-table td:nth-child(3),
.app-shell.privacy-on .debt-table td:nth-child(4),
.app-shell.privacy-on .debt-table td:nth-child(5),
.app-shell.privacy-on .distribution-hint {
  filter: blur(12px);
  opacity: 0.3;
  user-select: none;
  pointer-events: none;
}

.app-shell.privacy-on .income-side .frame-post-list,
.app-shell.privacy-on .income-side .frame-status,
.app-shell.privacy-on .income-side .frame-title,
.app-shell.privacy-on .expense-side .frame-post-list,
.app-shell.privacy-on .expense-side .frame-status,
.app-shell.privacy-on .expense-side .frame-title {
  filter: blur(12px);
  opacity: 0.3;
  user-select: none;
  pointer-events: none;
}

.card h2 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.card header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.income-side {
  background:
    radial-gradient(circle at 8% 10%, rgba(15, 140, 104, 0.08), transparent 42%),
    linear-gradient(165deg, #ffffff 0%, #f6fffa 100%);
  border-color: #cce6db;
}

.expense-side {
  background:
    radial-gradient(circle at 12% 12%, rgba(216, 60, 70, 0.07), transparent 42%),
    linear-gradient(165deg, #ffffff 0%, #fff7f8 100%);
  border-color: #ebc9ce;
}

.figure {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: clamp(1.4rem, 2.7vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.figure.positive {
  color: var(--positive);
}

.figure.negative {
  color: var(--negative);
}

.layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.payments-layout {
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
}

.payment-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.payment-actions .btn {
  flex: 1;
  min-width: 180px;
}

.full-span {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

label {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.6rem 0.82rem;
  font-size: 0.98rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: #ffffff;
  color: var(--text);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bdcbe3;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.15);
}

.full-width {
  grid-column: 1 / -1;
}

.budget-form {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.budget-form label {
  flex: 1;
  min-width: 150px;
}

.budget-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.budget-item {
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  padding: 0.85rem;
  background: var(--card-solid);
}

.account-frame {
  border: 2px solid #273247;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%),
    repeating-linear-gradient(
      -45deg,
      rgba(39, 50, 71, 0.03),
      rgba(39, 50, 71, 0.03) 6px,
      transparent 6px,
      transparent 12px
    );
  box-shadow:
    3px 3px 0 #273247,
    0 8px 22px rgba(20, 32, 51, 0.1);
}

.frame-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.frame-title {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 1.02rem;
}

.frame-ratio {
  font-weight: 700;
  color: #32476b;
}

.frame-status {
  display: block;
  margin-top: 0.45rem;
}

.frame-post-list {
  margin: 0.8rem 0 0;
  padding: 0.75rem;
  border: 1px dashed #9eb2d1;
  border-radius: 0.7rem;
  background: #f6f9ff;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.frame-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #dde7f7;
}

.frame-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.frame-post.empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 0;
}

.post-title {
  font-weight: 700;
}

.post-meta {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

.post-amount {
  font-weight: 800;
  color: #213351;
  white-space: nowrap;
}

.recurring-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.recurring-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  background: #f8fbff;
  border-radius: 0.75rem;
  padding: 0.58rem 0.65rem;
}

.recurring-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.recurring-actions .btn {
  flex: 1;
  min-width: 180px;
}

.recurring-item-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  background: #f8fbff;
  border-radius: 0.75rem;
  padding: 0.58rem 0.65rem;
}

.salary-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.distribution-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.3rem;
}

.distribution-row {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0.6rem;
  background: #f7faff;
}

.distribution-row span {
  display: block;
  font-weight: 700;
  margin-bottom: 0.32rem;
  color: var(--text);
}

.distribution-row input {
  width: 100%;
}

.distribution-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.distribution-hint.error {
  color: var(--negative);
  font-weight: 700;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-status.error {
  color: var(--negative);
  font-weight: 700;
}

.progress {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(15, 98, 254, 0.12);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.progress span.warning {
  background: var(--warning);
}

.progress span.danger {
  background: var(--negative);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: var(--card-solid);
}

.payment-qr-card {
  align-self: start;
}

.payment-qr-frame {
  min-height: 260px;
  border: 1px dashed #9eb2d1;
  border-radius: 0.95rem;
  display: grid;
  place-items: center;
  background: #f8fbff;
  padding: 0.9rem;
}

.payment-qr-frame::before {
  content: "Noch kein QR-Code erzeugt.";
  color: var(--muted);
  font-size: 0.95rem;
}

.payment-qr-frame.ready::before {
  display: none;
}

#payment-qr-image {
  width: min(100%, 320px);
  height: auto;
  display: none;
  border-radius: 0.5rem;
  border: 1px solid #d7e2f4;
  background: #fff;
}

#payment-qr-image.visible {
  display: block;
}

#payment-epc-payload {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.35;
}

table {
  width: 100%;
  border-spacing: 0;
  min-width: 780px;
}

th,
td {
  text-align: left;
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid #e3eaf5;
}

th {
  position: sticky;
  top: 0;
  background: #f3f7ff;
  z-index: 1;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #445674;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f5f9ff;
}

.debt-table th,
.debt-table td {
  padding: 0.62rem 0.48rem;
}

.chip {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.chip.income {
  background: rgba(15, 140, 104, 0.15);
  color: var(--positive);
}

.chip.expense {
  background: rgba(216, 60, 70, 0.15);
  color: var(--negative);
}

footer {
  text-align: center;
  padding: 1.75rem 1rem 2.2rem;
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes today-pulse {
  0% {
    box-shadow: 0 3px 8px rgba(31, 143, 93, 0.28);
  }
  50% {
    box-shadow: 0 4px 12px rgba(31, 143, 93, 0.48);
  }
  100% {
    box-shadow: 0 3px 8px rgba(31, 143, 93, 0.28);
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 700px) {
  main {
    padding: 1.3rem 0.75rem 2rem;
    gap: 1rem;
  }

  .hero {
    padding: 1.3rem 0.95rem;
    gap: 1.2rem;
  }

  .layout,
  .card-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .payments-layout {
    grid-template-columns: 1fr;
  }

  .ledger-split {
    grid-template-columns: 1fr;
  }

  .timeline-summary {
    grid-template-columns: 1fr;
  }

  .hero-card {
    order: -1;
  }

  .timeline-controls {
    align-items: stretch;
  }

  .timeline-controls label {
    min-width: 100%;
  }

  .frame-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .frame-post {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .recurring-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
  }

  .cta-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .timeline-days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.4rem;
  }

  .timeline-day {
    min-height: 56px;
  }

  .payment-actions {
    flex-direction: column;
  }

  .recurring-actions {
    flex-direction: column;
  }
}
