:root {
  --bg: #f6f7f4;
  --ink: #101820;
  --muted: #61706b;
  --surface: #ffffff;
  --soft: #edf2ef;
  --line: #dce4df;
  --mint: #22c59b;
  --mint-dark: #0d7d66;
  --coral: #ff6b5f;
  --blue: #3278c7;
  --amber: #f1b84a;
  --danger: #d64a4a;
  --shadow: 0 16px 48px rgba(16, 24, 32, 0.12);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(246, 247, 244, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  font-weight: 950;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.topnav a {
  padding: 9px 12px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 750;
}

.topnav a:hover,
.topnav a.active {
  color: var(--ink);
  background: var(--soft);
}

.top-cta,
.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 850;
  white-space: nowrap;
}

.top-cta,
.primary {
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.secondary,
.ghost {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.section {
  padding: clamp(36px, 7vw, 86px) clamp(16px, 4vw, 44px);
}

.section.white {
  background: #fff;
}

.inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 72px);
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.15;
}

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

.hero-copy p {
  max-width: 590px;
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-visual,
.profile-cover,
.wish-media {
  position: relative;
  overflow: hidden;
  background: var(--soft);
}

.hero-visual {
  min-height: 560px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-visual img,
.profile-cover img,
.wish-media img,
.wish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual::after,
.profile-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(16, 24, 32, 0.04), rgba(16, 24, 32, 0.58));
}

.hero-chip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: #fff;
  background: rgba(16, 24, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
}

.avatar,
.mini-avatar,
.comment-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--blue));
  border-radius: var(--radius);
  font-weight: 950;
}

.hero-chip .avatar {
  width: 52px;
  height: 52px;
}

.hero-chip span,
.hero-chip strong {
  display: block;
}

.hero-chip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.hero-chip strong {
  font-size: 19px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.good {
  color: #075c4a;
  background: #d9f8ef;
}

.pill.warn {
  color: #7a4a00;
  background: #fff2ce;
}

.pill.danger {
  color: #8f2222;
  background: #ffe0df;
}

.pill.info {
  color: #174f87;
  background: #e2f0ff;
}

.pill.neutral {
  color: var(--muted);
  background: var(--soft);
}

.stats-strip,
.metric-grid,
.ops-grid,
.wish-meta,
.profile-stats,
.balance-grid {
  display: grid;
  gap: 12px;
}

.stats-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat,
.metric,
.ops-card,
.wish-card,
.profile-panel,
.funding-preview,
.donation,
.comments,
.policy,
.reaction,
.tool-panel,
.list-panel,
.timeline,
.admin-table,
.return-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat,
.metric,
.ops-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
}

.stat span,
.metric span,
.ops-card span,
.wish-meta span,
.profile-stats span,
.balance-grid span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong,
.metric strong {
  font-size: 26px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.65fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.feature-list span {
  min-height: 38px;
  padding: 9px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 760;
}

.funding-preview {
  padding: 24px;
  box-shadow: var(--shadow);
}

.row-between,
.wish-card-meta,
.wish-card-footer,
.panel-title,
.mini-title,
.admin-top,
.wish-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funding-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.funding-row strong {
  font-size: 24px;
}

.funding-row.large strong {
  font-size: clamp(30px, 5vw, 48px);
}

.funding-row span {
  color: var(--muted);
}

.progress {
  height: 10px;
  overflow: hidden;
  background: #dce5e1;
  border-radius: 999px;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), #7be0c8);
  border-radius: inherit;
}

.heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.grid-wishes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wish-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1fr);
  min-height: 300px;
  overflow: hidden;
}

.wish-card.compact {
  min-height: 240px;
}

.wish-card-img {
  min-height: 240px;
  background: var(--soft);
}

.wish-card-body {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.wish-card-title {
  margin: 14px 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.12;
}

.wish-card p {
  display: -webkit-box;
  min-height: 76px;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.wish-card-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
}

.profile-cover {
  min-height: 480px;
}

.profile-cover-content {
  position: absolute;
  right: clamp(16px, 5vw, 64px);
  bottom: clamp(24px, 5vw, 64px);
  left: clamp(16px, 5vw, 64px);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  color: #fff;
}

.profile-cover .avatar {
  width: 92px;
  height: 92px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  font-size: 28px;
}

.profile-cover p,
.profile-cover span {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
  padding: 22px;
}

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

.profile-stats div,
.wish-meta div,
.balance-grid div {
  padding: 12px;
  background: var(--soft);
  border-radius: var(--radius);
}

.profile-stats strong,
.profile-stats span,
.wish-meta strong,
.wish-meta span,
.balance-grid strong,
.balance-grid span {
  display: block;
}

.profile-links {
  display: grid;
  gap: 8px;
}

.profile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  background: var(--soft);
  border-radius: var(--radius);
  font-weight: 850;
}

.trust,
.risk,
.policy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  color: var(--muted);
  background: #edf8f5;
  border-radius: var(--radius);
}

.wish-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.86fr);
  min-height: calc(100vh - 72px);
  background: #fff;
}

.wish-media {
  min-height: 520px;
}

.wish-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
}

.back {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  color: var(--mint-dark);
  font-weight: 900;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.tags span {
  padding: 7px 10px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.wish-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.wish-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  align-items: start;
}

.comments,
.policy,
.reaction {
  margin-bottom: 16px;
  padding: 22px;
}

.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.comment:first-of-type {
  border-top: 0;
}

.comment-avatar {
  width: 42px;
  height: 42px;
}

.comment strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comment strong span,
.comment small {
  color: var(--muted);
}

.reaction {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.reaction span {
  padding: 7px 10px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  font-weight: 850;
}

.donation {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.amount-grid button {
  min-height: 42px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 900;
}

.amount-grid button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.field textarea {
  resize: vertical;
}

.switches {
  display: grid;
  gap: 10px;
}

.switches label,
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 780;
}

.switches input,
.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint-dark);
}

.quote {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--soft);
  border-radius: var(--radius);
}

.quote div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quote span {
  color: var(--muted);
}

.quote .total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
}

.notice.show {
  display: flex;
}

.notice.good {
  color: #075c4a;
  background: #ddf8ef;
}

.notice.bad {
  color: #8f2222;
  background: #ffe0df;
}

.console,
.admin {
  display: grid;
  width: min(100%, 1280px);
  min-height: calc(100vh - 104px);
  margin: 24px auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.console {
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar,
.admin-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  color: #fff;
  background: var(--ink);
}

.sidebar .avatar {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--coral), var(--blue));
}

.sidebar span {
  color: rgba(255, 255, 255, 0.66);
}

.side-tabs,
.admin-rail {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.side-tabs button,
.admin-rail button {
  min-height: 42px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  text-align: left;
}

.side-tabs button.active,
.admin-rail button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.console-main,
.admin-main {
  min-width: 0;
  padding: 24px;
}

.metric-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.tool-panel,
.list-panel,
.timeline {
  padding: 18px;
}

.panel-title {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.upload {
  display: grid;
  place-items: center;
  min-height: 110px;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed #aebdb7;
  border-radius: var(--radius);
  font-weight: 850;
}

.list-row,
.timeline article,
.admin-table article,
.mini-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.list-row:first-child,
.timeline article:first-child,
.admin-table article:first-child {
  border-top: 0;
}

.list-row strong,
.list-row span,
.timeline strong,
.timeline span,
.timeline time,
.mini-list-row strong,
.mini-list-row span {
  display: block;
}

.list-row span,
.timeline span,
.timeline time,
.mini-list-row span {
  color: var(--muted);
  font-size: 13px;
}

.mini-page {
  min-height: calc(100vh - 72px);
  padding: 28px 16px;
  background: linear-gradient(135deg, rgba(34, 197, 155, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(255, 107, 95, 0.16), transparent 36%), #e8eeeb;
}

.phone {
  display: flex;
  flex-direction: column;
  width: min(100%, 420px);
  min-height: 760px;
  margin: 0 auto;
  overflow: hidden;
  background: #f9fbfa;
  border: 10px solid #111820;
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.mini-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
}

.mini-avatar {
  width: 44px;
  height: 44px;
}

.mini-header div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.mini-header strong,
.mini-header span {
  display: block;
}

.mini-header span {
  color: var(--muted);
  font-size: 13px;
}

.mini-content {
  flex: 1;
  padding: 0 14px 12px;
  overflow: auto;
}

.mini-hero,
.mini-card {
  margin-bottom: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mini-hero {
  color: #fff;
  background: var(--ink);
}

.mini-hero h1 {
  margin: 8px 0 4px;
  font-size: 38px;
}

.mini-hero p {
  color: rgba(255, 255, 255, 0.7);
}

.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick button {
  display: grid;
  place-items: center;
  min-height: 74px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 850;
}

.mini-tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.mini-tabbar button {
  display: grid;
  place-items: center;
  min-height: 56px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 850;
}

.mini-tabbar button.active {
  color: #fff;
  background: var(--ink);
}

.admin {
  grid-template-columns: 170px minmax(0, 1fr);
}

.admin-rail {
  margin-top: 0;
}

.admin-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--ink);
  background: #fff;
  border-radius: var(--radius);
  font-weight: 950;
}

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

.admin-table {
  display: grid;
  padding: 10px 18px;
}

.admin-table article {
  min-height: 70px;
}

.admin-table article > div:first-child {
  flex: 1;
}

.admin-table span {
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.row-actions button {
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ledger article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px 150px;
}

.return-panel {
  display: grid;
  justify-items: start;
  gap: 12px;
  width: min(100%, 560px);
  margin: 40px auto;
  padding: 28px;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero,
  .split,
  .profile-layout,
  .wish-hero,
  .wish-detail,
  .console,
  .admin {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 420px;
  }

  .stats-strip,
  .metric-grid.four,
  .ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-panel,
  .donation {
    position: static;
  }

  .wish-media {
    min-height: 420px;
  }

  .admin-rail {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .admin-rail button {
    min-width: max-content;
  }
}

@media (max-width: 720px) {
  .brand {
    min-width: 0;
  }

  .brand small,
  .top-cta {
    display: none;
  }

  h1 {
    font-size: 40px;
    line-height: 1.02;
  }

  h2 {
    font-size: 30px;
  }

  .section {
    padding: 34px 14px;
  }

  .stats-strip,
  .metric-grid.four,
  .profile-stats,
  .wish-meta,
  .balance-grid,
  .grid-wishes,
  .console-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .wish-card {
    grid-template-columns: 1fr;
  }

  .wish-card-img {
    min-height: 220px;
  }

  .profile-cover {
    min-height: 430px;
  }

  .profile-cover-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .wish-media {
    min-height: 300px;
  }

  .wish-title,
  .admin-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .console-main,
  .admin-main {
    padding: 16px;
  }

  .admin-table article,
  .ledger article {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .phone {
    min-height: calc(100vh - 116px);
    border-width: 6px;
    border-radius: 24px;
  }

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