:root {
  --gg-green: #12bf68;
  --gg-green-dark: #07964d;
  --gg-green-soft: #daf8e8;
  --gg-ink: #121923;
  --gg-muted: #8f8b82;
  --gg-paper: #f6f4ee;
  --gg-card: #ffffff;
  --gg-sand: #eeeae1;
  --gg-danger: #ed3f3f;
  --gg-navy: #151e2b;
  --shadow: 0 8px 24px rgba(32, 35, 29, .07);
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--gg-ink);
  background: var(--gg-paper);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--gg-paper); }
body { font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(18, 191, 104, .32);
  outline-offset: 2px;
}

.app-shell { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding-bottom: 104px; }
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 14px 18px 10px; background: rgba(246, 244, 238, .94); backdrop-filter: blur(14px); }
.brand { width: 104px; justify-self: start; grid-column: 2; }
.icon-button { grid-row: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--gg-card); color: var(--gg-ink); text-decoration: none; box-shadow: var(--shadow); font-weight: 800; cursor: pointer; }
.back-button { grid-column: 1; font-size: 22px; box-shadow: none; background: transparent; }
.topbar > a { grid-column: 3; }
.is-hidden { visibility: hidden !important; }
.screen { padding: 8px 16px 24px; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.05; letter-spacing: -.04em; margin-bottom: 8px; }
h2 { font-size: 21px; letter-spacing: -.025em; margin-bottom: 14px; }
h3 { font-size: 16px; margin-bottom: 6px; }
.muted { color: var(--gg-muted); }
.eyebrow { margin: 22px 4px 10px; color: #aaa398; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 12px; }
.section-title h2 { margin: 0; }
.text-action { border: 0; background: none; color: var(--gg-green-dark); font-weight: 800; cursor: pointer; }

.card { background: var(--gg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 12px; }
.hero { position: relative; overflow: hidden; min-height: 210px; padding: 24px; border-radius: 28px; background: var(--gg-navy); color: white; box-shadow: 0 18px 38px rgba(17, 27, 40, .18); }
.hero::after { content: "G"; position: absolute; right: -18px; bottom: -64px; color: rgba(18, 191, 104, .35); font-size: 220px; font-weight: 900; line-height: 1; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 330px; margin-top: 18px; }
.hero p { max-width: 290px; color: #d4d9df; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 11px; background: var(--gg-green-soft); color: var(--gg-green-dark); font-size: 12px; font-weight: 800; }
.hero .pill { background: var(--gg-green); color: white; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 52px; border: 0; border-radius: 16px; padding: 12px 18px; background: var(--gg-green); color: white; font-weight: 800; cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .55; cursor: wait; }
.button-light { width: auto; background: white; color: var(--gg-ink); }
.button-secondary { background: var(--gg-sand); color: var(--gg-ink); }
.button-danger { border: 1px solid var(--gg-danger); background: white; color: var(--gg-danger); }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-action { min-height: 112px; padding: 14px 8px; border: 0; border-radius: 20px; background: var(--gg-card); box-shadow: var(--shadow); color: var(--gg-ink); font-weight: 750; cursor: pointer; }
.quick-action span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px; background: var(--gg-sand); font-size: 24px; }

.balance-value { margin: 5px 0 14px; font-size: 32px; font-weight: 900; letter-spacing: -.04em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--gg-sand); color: #676158; font-weight: 750; cursor: pointer; }
.chip.is-active { background: var(--gg-green); color: white; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { min-height: 92px; padding: 16px; border-radius: 18px; background: var(--gg-card); box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 24px; margin-bottom: 7px; }
.stat small { color: var(--gg-muted); }

.list { overflow: hidden; padding: 0; }
.list-row { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 68px; padding: 13px 16px; border: 0; border-bottom: 1px solid #eeeae3; background: var(--gg-card); color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 13px; background: var(--gg-sand); font-size: 20px; }
.list-row-copy { min-width: 0; flex: 1; }
.list-row-copy strong, .list-row-copy small { display: block; }
.list-row-copy small { margin-top: 4px; color: var(--gg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { color: #aaa398; font-size: 22px; }

.gift-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 10px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: none; }
.gift-strip::-webkit-scrollbar { display: none; }
.gift-card { overflow: hidden; min-height: 180px; border-radius: 18px; background: var(--gg-navy); color: white; box-shadow: var(--shadow); }
.gift-card img { width: 100%; height: 116px; object-fit: cover; background: #d6cf9d; }
.gift-card div { padding: 10px; }
.gift-card strong, .gift-card small { display: block; }
.gift-card small { margin-top: 4px; color: #b8efcf; }
.create-preview { margin-bottom: 14px; }
.create-preview img { height: 210px; }

.review-card { display: grid; grid-template-columns: 42px 1fr; gap: 12px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--gg-green-soft); color: var(--gg-green-dark); font-weight: 900; }
.stars { color: #f2a917; letter-spacing: 1px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: var(--gg-sand); margin-bottom: 14px; }
.tab { border: 0; border-radius: 14px; padding: 12px; background: transparent; font-weight: 800; cursor: pointer; }
.tab.is-active { background: var(--gg-green); color: white; }
.deal-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.deal-thumb { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 14px; background: var(--gg-sand); font-size: 24px; }
.deal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.deal-meta strong, .deal-meta small { display: block; }
.deal-meta small { color: var(--gg-muted); margin-top: 3px; }
.status { justify-self: end; border-radius: 999px; padding: 7px 10px; background: #fff3d8; color: #9a6914; font-size: 11px; font-weight: 850; }
.status.completed { background: var(--gg-green-soft); color: var(--gg-green-dark); }
.status.cancelled { background: #ffe6e6; color: var(--gg-danger); }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 800; }
.input { width: 100%; min-height: 52px; border: 1px solid #dedbd4; border-radius: 15px; padding: 13px 14px; background: white; color: var(--gg-ink); }
textarea.input { min-height: 112px; resize: vertical; }
.choice-grid { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px; border: 2px solid transparent; border-radius: 18px; background: var(--gg-card); box-shadow: var(--shadow); cursor: pointer; }
.choice.is-selected { border-color: var(--gg-green); background: #f0fff7; }
.choice input { accent-color: var(--gg-green); margin-left: auto; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 20px; }
.stepper span { width: 9px; height: 9px; border-radius: 50%; background: #d7d3ca; }
.stepper span.is-active { width: 28px; border-radius: 999px; background: var(--gg-green); }

.profile-head { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; }
.profile-head .avatar { width: 62px; height: 62px; font-size: 24px; background: var(--gg-green); color: white; }
.profile-head h1 { margin: 0 0 4px; font-size: 21px; }
.profile-head p { margin: 0; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eeeae3; }
.summary-line:last-child { border-bottom: 0; }
.timeline { margin: 8px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 20px 34px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 4px; width: 14px; height: 14px; border: 3px solid var(--gg-card); border-radius: 50%; background: #ccc7bc; box-shadow: 0 0 0 1px #ccc7bc; }
.timeline li::after { content: ""; position: absolute; left: 11px; top: 21px; width: 2px; height: calc(100% - 14px); background: #ddd8ce; }
.timeline li:last-child::after { display: none; }
.timeline li.is-done::before { background: var(--gg-green); box-shadow: 0 0 0 1px var(--gg-green); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; width: min(100%, 520px); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: rgba(255,255,255,.96); box-shadow: 0 -8px 26px rgba(25, 30, 24, .08); backdrop-filter: blur(16px); }
.nav-item { display: grid; place-items: center; gap: 3px; min-height: 58px; border: 0; border-radius: 17px; background: transparent; color: #827e76; cursor: pointer; }
.nav-item span { font-size: 22px; line-height: 1; }
.nav-item small { font-size: 10px; }
.nav-item.is-active { background: #e6f8ef; color: var(--gg-green-dark); }
.nav-create { align-self: start; width: 60px; height: 60px; min-height: 60px; margin: -25px auto 0; border-radius: 50%; background: var(--gg-green); color: white; box-shadow: 0 10px 22px rgba(18,191,104,.32); }
.nav-create span { font-size: 36px; font-weight: 300; }
.nav-create.is-active { background: var(--gg-green-dark); color: white; }

.empty-state, .loading-state, .error-state { display: grid; place-items: center; min-height: 330px; padding: 40px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 16px; border-radius: 22px; background: var(--gg-sand); font-size: 34px; }
.spinner { width: 34px; height: 34px; border: 4px solid #d9d5cc; border-top-color: var(--gg-green); border-radius: 50%; animation: spin .8s linear infinite; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 104px; transform: translate(-50%, 18px); width: min(calc(100% - 32px), 460px); padding: 14px 16px; border-radius: 15px; background: var(--gg-navy); color: white; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.dialog { width: min(calc(100% - 32px), 430px); border: 0; border-radius: 24px; padding: 22px; color: var(--gg-ink); }
.dialog::backdrop { background: rgba(16, 23, 31, .48); backdrop-filter: blur(3px); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-tile { min-height: 104px; padding: 16px; border: 0; border-radius: 18px; background: var(--gg-card); color: var(--gg-ink); text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.admin-tile strong, .admin-tile small { display: block; }
.admin-tile small { margin-top: 7px; color: var(--gg-muted); line-height: 1.3; }
.admin-actions { display: flex; gap: 6px; }
.admin-actions button, .mini-button { min-width: 34px; min-height: 34px; border: 0; border-radius: 10px; background: var(--gg-sand); color: var(--gg-ink); font-weight: 800; cursor: pointer; }
.mini-button { margin-top: 8px; padding: 7px 10px; }
.mini-button.danger { margin: 0; color: var(--gg-danger); }
.broadcast-preview { min-height: 86px; background: var(--gg-paper); box-shadow: none; white-space: normal; overflow-wrap: anywhere; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 350px) {
  .quick-grid { gap: 7px; }
  .quick-action { font-size: 12px; }
  .screen { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
