:root {
  --bg: #f3f5f8;
  --panel: rgba(255, 255, 255, 0.8);
  --text: #101828;
  --muted: #667085;
  --line: rgba(16, 24, 40, 0.08);
  --accent: #0a84ff;
  --accent-strong: #005fcc;
  --success: #0f9d58;
  --danger: #d92d20;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 153, 0.55), transparent 22%),
    linear-gradient(180deg, #f9fbff 0%, #eef2f7 100%);
}
button, input, textarea, select { font: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.96);
}
textarea { min-height: 100px; resize: vertical; }
a { color: inherit; }
.page-shell, .app-shell {
  width: min(1240px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  display: grid;
  gap: 1rem;
}
.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: var(--panel);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  border-radius: 30px;
  padding: 1.2rem;
}
.hero-card {
  min-height: 240px;
  display: grid;
  align-content: end;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.72)),
    linear-gradient(135deg, #dceeff, #fff4d9);
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
h1, h2, h3 { margin: 0.2rem 0 0.45rem; }
p, .muted, .field span { color: var(--muted); }
.topbar, .hero-meta, .button-row, .chip-row, .status-row, .section-head {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.topbar, .section-head { justify-content: space-between; align-items: flex-start; }
.button {
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.button.primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }
.button.secondary { color: var(--accent-strong); background: rgba(10, 132, 255, 0.12); }
.button.ghost { color: var(--text); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); }
.button.success { color: #fff; background: linear-gradient(135deg, #16a34a, #0f9d58); }
.button.danger { color: #fff; background: linear-gradient(135deg, #ef4444, #d92d20); }
.button:disabled { opacity: 0.48; cursor: not-allowed; }
.field { display: grid; gap: 0.45rem; margin-bottom: 0.8rem; }
.view-switch {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent-strong);
}
.status-pill.success { background: rgba(15, 157, 88, 0.12); color: var(--success); }
.status-pill.danger { background: rgba(217, 45, 32, 0.12); color: var(--danger); }
.grid.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stack-list { display: grid; gap: 0.8rem; }
.task-card, .list-row, .wallet-item, .summary-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 24px;
  padding: 1rem;
}
.task-head, .list-row {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.wallet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.wallet-item strong { display: block; margin-top: 0.4rem; font-size: 1.35rem; }
.inline-form { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input { width: auto; min-width: 120px; }
.split-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.link-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.empty-state {
  padding: 1rem;
  border: 1px dashed rgba(16, 24, 40, 0.12);
  border-radius: 20px;
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: rgba(16, 24, 40, 0.94);
  color: #fff;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  max-width: min(320px, calc(100vw - 2rem));
  z-index: 40;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 30;
}
.modal-card {
  width: min(420px, calc(100vw - 2rem));
}
.modal-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(10, 132, 255, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin-top: 0.5rem;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1040px) {
  .grid.two-up, .grid.three-up, .wallet-grid, .split-form { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-shell, .app-shell { width: min(100vw - 1rem, 100%); }
  .topbar, .section-head { flex-direction: column; }
  .inline-form { width: 100%; }
  .inline-form select, .inline-form input { width: 100%; }
}
