@import url('./plan-capital.css');
@import url('/assets/fonts/fonts.css');

/* HORSE.BIZ — light premium design system */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #f0eee8;
  --line: #e8e5de;
  --line-2: #d9d5cb;
  --line-strong: #c7dcc9;
  --text: #17181b;
  --text-2: #3c3f45;
  --muted: #6b6f77;
  --dim: #9a9ea6;
  --gold: #198754;
  --gold-bright: #86cba5;
  --gold-deep: #126448;
  --gold-soft: #e7f2eb;
  --wine: #8e2232;
  --wine-soft: #f8e9eb;
  --success: #15845a;
  --success-soft: #e5f4ec;
  --danger: #c13a47;
  --danger-soft: #fbeaec;
  --warning: #9a6210;
  --warning-soft: #fcf1df;
  --info: #2f67b1;
  --info-soft: #e8f0fa;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow-sm: 0 1px 2px rgba(23,24,27,.05);
  --shadow: 0 1px 2px rgba(23,24,27,.04), 0 10px 30px rgba(23,24,27,.06);
  --shadow-lg: 0 24px 60px rgba(23,24,27,.16);
  --gold-gradient: linear-gradient(180deg, #42a875 0%, #126448 100%);
  --rail-width: 260px;
  --rail-collapsed: 84px;
  --font: Manrope, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); font: 500 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
img { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--text); letter-spacing: -.02em; }
::selection { color: var(--text); background: var(--gold-bright); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-deep); font-size: 11px; font-weight: 800; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.muted { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-deep); font-size: 14px; font-weight: 700; white-space: nowrap; }
.text-link .icon { width: 16px; height: 16px; }
.text-link:hover { color: var(--text); }

/* Buttons */
.button, .icon-button { border: 1px solid transparent; transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, filter .16s ease; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; font-size: 15px; font-weight: 700; letter-spacing: -.005em; white-space: nowrap; }
.button .icon { width: 18px; height: 18px; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:focus-visible, .icon-button:focus-visible, .nav-link:focus-visible, .tab:focus-visible, .quick-action:focus-visible, a:focus-visible { outline: 3px solid rgba(18,100,72,.48); outline-offset: 2px; }
.button-gold { color: #fff; border-color: #126448; background: var(--gold-gradient); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 16px rgba(18,100,72,.2); }
.button-gold:hover:not(:disabled) { filter: brightness(1.03); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 22px rgba(18,100,72,.28); }
.button-light { color: var(--text); background: #fff; border-color: rgba(255,255,255,.8); box-shadow: var(--shadow-sm); }
.button-outline { color: var(--text); border-color: var(--line-2); background: var(--surface); box-shadow: var(--shadow-sm); }
.button-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-deep); }
.button-ghost { color: var(--gold-deep); background: transparent; padding: 0 12px; }
.button-ghost:hover:not(:disabled) { background: var(--gold-soft); }
.button-danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.button-danger:hover:not(:disabled) { filter: brightness(1.05); }
.button-small { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.button-small .icon { width: 16px; height: 16px; }
.button-wide { width: 100%; }
.button-disabled { color: var(--dim); border-color: var(--line); background: var(--surface-3); box-shadow: none; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; color: var(--text-2); border-radius: 12px; background: transparent; }
.icon-button:hover { color: var(--text); background: var(--surface-3); }
.topbar-actions .icon-button { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.brand { display: block; width: 158px; }
.brand-logo { width: 100%; height: auto; }
.brand-compact { width: 138px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); font-size: 14px; font-weight: 700; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 18px; }

/* App shell */
.app-frame { display: flex; min-height: 100vh; }
.rail { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--rail-width); padding: 22px 14px 18px; border-right: 1px solid var(--line); background: var(--surface); transition: width .22s ease, transform .22s ease; }
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 8px 22px; }
.rail-toggle { display: grid; }
.rail-caption { padding: 4px 12px 8px; color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rail-nav, .rail-bottom { display: grid; gap: 2px; }
.rail-nav { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.rail-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 600; transition: color .16s ease, background .16s ease; }
.nav-link .icon { color: var(--muted); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: #4f3810; background: var(--gold-soft); font-weight: 800; }
.nav-link.is-active .icon { color: var(--gold-deep); }
.nav-button { width: 100%; border: 0; text-align: left; background: transparent; }
.main-column { min-width: 0; width: calc(100% - var(--rail-width)); margin-left: var(--rail-width); transition: margin .22s ease, width .22s ease; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px clamp(18px, 3vw, 40px); border-bottom: 1px solid var(--line); background: rgba(245,244,240,.88); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); }
.topbar-title { min-width: 0; margin-right: auto; }
.topbar-title .eyebrow { display: none; }
.topbar-title h1 { margin: 0; overflow: hidden; font-size: 24px; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; color: #2b1f08; border: 2px solid #fff; border-radius: 50%; background: var(--gold-gradient); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm); font-size: 13px; font-weight: 800; }
.mobile-menu, .bottom-nav { display: none; }
.page-content { width: min(1280px, 100%); margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.home-grid, .section-block, .admin-content { display: grid; gap: 20px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-soft { padding: clamp(18px, 2.4vw, 26px); }
.panel-dark { overflow: hidden; border-color: var(--line-strong); background: radial-gradient(120% 140% at 100% 0%, #f7ebd2 0%, rgba(247,235,210,0) 58%), var(--surface); }
.app-frame.rail-collapsed { --rail-width: var(--rail-collapsed); }
.app-frame.rail-collapsed .rail .brand { width: 44px; overflow: hidden; }
.app-frame.rail-collapsed .rail-caption, .app-frame.rail-collapsed .rail .nav-link span { display: none; }
.app-frame.rail-collapsed .rail-top { flex-direction: column; padding-inline: 0; }
.app-frame.rail-collapsed .nav-link { justify-content: center; padding-inline: 0; }

/* Headings */
.page-intro, .section-heading, .card-header, .admin-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-intro { align-items: flex-end; }
.page-intro h2, .admin-page-header h2 { margin: 4px 0 0; font-size: clamp(26px, 2.6vw, 32px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.page-intro p, .admin-page-header p { max-width: 640px; margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.section-heading h2, .card-header h2 { margin: 2px 0 0; font-size: 18px; font-weight: 800; line-height: 1.3; letter-spacing: -.015em; }
.section-heading p, .card-header p { max-width: 560px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-heading .eyebrow, .card-header .eyebrow { font-size: 10px; }
.section-heading > .button, .section-heading > .text-link { align-self: center; }
.section-heading > strong { font-size: 18px; font-weight: 800; }
.section-split, .home-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.narrow-content { width: min(760px, 100%); margin: 0 auto; }
.button-cluster { display: flex; flex-wrap: wrap; gap: 10px; }

/* Home */
.home { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.home > .home-wide { grid-column: 1 / -1; }
.balance-card { position: relative; overflow: hidden; isolation: isolate; padding: 24px; border: 1px solid var(--line-strong); border-radius: 24px; background: radial-gradient(130% 120% at 100% 0%, #f5e6c6 0%, rgba(245,230,198,0) 56%), linear-gradient(180deg, #ffffff, #fffdf8); box-shadow: var(--shadow); }
.balance-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.balance-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 800; }
.sync-dot, .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.sync-dot { background: var(--success); animation: pulseDot 1.8s ease-in-out infinite; }
.status-dot.is-on { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.balance-number { position: relative; z-index: 2; display: block; margin: 10px 0 0; color: var(--text); font-size: clamp(36px, 5vw, 50px); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.balance-stage { position: relative; z-index: 2; height: 138px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: linear-gradient(120deg, #fffaf1 0%, #f5e6c6 100%); }
.balance-scene { position: absolute; inset: 0; }
.balance-live { position: absolute; z-index: 2; top: 12px; bottom: 12px; left: 12px; display: grid; align-content: center; gap: 2px; width: min(50%, 250px); padding: 10px 12px; border: 1px solid rgba(255,255,255,.9); border-radius: 14px; background: rgba(255,255,255,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.balance-live-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.balance-live strong { color: var(--success); font-size: 19px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance-live small { color: var(--dim); font-size: 11px; line-height: 1.35; }
.mining-bar { display: block; height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.mining-bar i { display: block; width: 38%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(18,100,72,0), var(--gold), rgba(18,100,72,0)); animation: mining 1.9s linear infinite; }
.balance-metrics { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.balance-metrics > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(250,249,246,.92); }
.balance-metrics span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.balance-metrics strong { display: block; margin-top: 3px; overflow: hidden; font-size: 15px; font-weight: 800; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quick-actions { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.quick-action { display: grid; justify-items: center; gap: 7px; min-width: 0; padding: 4px 2px; border-radius: 14px; color: var(--text-2); font-size: 12px; font-weight: 700; text-align: center; }
.quick-action > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-icon { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 17px; color: var(--gold-deep); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease; }
.qa-icon .icon { width: 22px; height: 22px; }
.quick-action:hover .qa-icon { transform: translateY(-2px); border-color: var(--gold); }
.quick-action-gold .qa-icon { color: #fff; border-color: #126448; background: var(--gold-gradient); box-shadow: 0 6px 14px rgba(18,100,72,.22); }
.campaign-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 230px; overflow: hidden; padding: 26px; border: 1px solid var(--line-strong); border-radius: 24px; background: linear-gradient(120deg, #fbf5e9 0%, #f2e3c3 100%); box-shadow: var(--shadow); }
.campaign-copy { position: relative; z-index: 2; max-width: 56%; }
.campaign-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 99px; color: var(--gold-deep); background: rgba(255,255,255,.85); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.campaign-copy h2 { margin: 12px 0 6px; font-size: clamp(21px, 2.3vw, 27px); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.campaign-copy p { margin: 0 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.hero-glow { display: none; }
.home-section { display: grid; gap: 14px; min-width: 0; }
.home-section > .section-heading { align-items: center; }
.card-row { display: grid; grid-auto-columns: minmax(252px, 290px); grid-auto-flow: column; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.card-row > * { min-width: 0; scroll-snap-align: start; }
.checkin-card { display: grid; align-content: start; gap: 14px; min-width: 0; }
.checkin-mini { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(120deg, #fffaf0, #f7ecd6); }
.checkin-mini-icon { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; color: #fff; background: var(--gold-gradient); }
.checkin-mini > div { flex: 1; min-width: 0; }
.checkin-mini small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.checkin-mini strong { display: block; font-size: 18px; font-weight: 800; }
.checkin-card p { margin: 0; color: var(--muted); font-size: 14px; }
.checkin-card p strong { color: var(--text); }
.notification-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notification-strip h2 { margin: 2px 0; font-size: 18px; }
.notification-strip p { margin: 0; color: var(--muted); font-size: 14px; }

/* Plan cards */
.horse-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.horse-card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(23,24,27,.04), 0 18px 40px rgba(23,24,27,.1); }
.horse-card-image { position: relative; display: grid; place-items: end center; height: 176px; overflow: hidden; background: radial-gradient(110% 90% at 50% 100%, #ecdcb9 0%, #f6efe1 55%, #fbf8f1 100%); }
.horse-card-image img { width: 94%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 14px 14px rgba(23,24,27,.2)); transition: transform .4s ease; }
.horse-card:hover .horse-card-image img { transform: scale(1.04); }
.horse-card-tag { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px); overflow: hidden; padding: 5px 10px; border: 1px solid rgba(255,255,255,.9); border-radius: 99px; color: var(--gold-deep); background: rgba(255,255,255,.88); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.horse-card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 18px 18px; }
.horse-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.horse-title .eyebrow { display: none; }
.horse-title h3, .owned-horse-content h3 { margin: 0; overflow: hidden; font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: -.015em; text-overflow: ellipsis; }
.plan-price { margin-top: 10px; }
.plan-price span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.plan-price strong { display: block; font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 16px; }
.data-grid > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.data-grid dt { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.data-grid dd { margin: 2px 0 0; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-grid .is-positive { color: var(--success); }
.card-description { margin: -4px 0 14px; color: var(--muted); font-size: 13px; }
.horse-card-body .button { margin-top: auto; }

/* Status */
.status { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; color: var(--text-2); background: var(--surface-3); font-size: 11px; font-weight: 800; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active, .status-completed, .status-paid, .status-enabled, .status-approved, .status-confirmed, .status-credited, .status-released { color: var(--success); background: var(--success-soft); }
.status-pending, .status-processing, .status-submitted, .status-requested, .status-review, .status-under_review, .status-created, .status-waiting { color: var(--warning); background: var(--warning-soft); }
.status-blocked, .status-rejected, .status-archived, .status-expired, .status-failed, .status-cancelled, .status-canceled, .status-reversed { color: var(--danger); background: var(--danger-soft); }

/* Lists */
.mini-list, .transaction-list, .notification-list { display: grid; margin-top: 6px; }
.horse-mini, .goal-mini, .transaction-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.horse-mini:last-child, .goal-mini:last-child, .transaction-row:last-child { border-bottom: 0; }
.horse-mini > span:nth-child(2), .goal-mini > span:nth-child(2), .transaction-row > span:nth-child(2) { flex: 1; min-width: 0; }
.horse-mini strong, .goal-mini strong, .transaction-row strong { display: block; overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.horse-mini small, .goal-mini small, .transaction-row small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.horse-mini > b, .transaction-row > b { font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.horse-mini > b { color: var(--success); }
.transaction-row > b.is-credit { color: var(--success); }
.horse-mini > .icon, .goal-mini > .icon { width: 16px; color: var(--dim); }
.mini-horse-image { display: grid; place-items: center; flex: 0 0 auto; width: 50px; height: 50px; overflow: hidden; border-radius: 14px; background: var(--gold-soft); }
.mini-horse-image img { width: 100%; height: 100%; object-fit: contain; }
.goal-mini { flex-wrap: wrap; }
.goal-mini .progress { flex: 1 1 100%; margin-left: 52px; }
.goal-icon, .transaction-icon, .notification-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; color: var(--gold-deep); background: var(--gold-soft); }
.goal-icon .icon, .transaction-icon .icon, .notification-icon .icon { width: 18px; height: 18px; }
.transaction-icon.credit { color: var(--success); background: var(--success-soft); }
.transaction-icon.debit { color: var(--danger); background: var(--danger-soft); }
.transaction-icon.debit .icon { transform: rotate(90deg); }
.progress, .progress-line { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress i, .progress-line i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #42a875, #126448); }
.progress-line { margin-top: 14px; }
.progress-line.large { height: 10px; }
.progress-caption { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }

/* Horses, details, team, goals */
.tabs { display: inline-flex; justify-self: start; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; border-radius: 14px; background: var(--surface-3); }
.tab { padding: 9px 16px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tab.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.horse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.owned-horse-card { display: grid; grid-template-columns: 140px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.owned-horse-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.owned-horse-image { display: grid; place-items: center; min-height: 170px; background: radial-gradient(110% 90% at 50% 100%, #ecdcb9 0%, #f8f2e6 70%); }
.owned-horse-image img { width: 100%; height: 100%; object-fit: contain; }
.owned-horse-content { min-width: 0; padding: 16px; }
.owned-horse-content .eyebrow { margin-bottom: 4px; font-size: 10px; }
.horse-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 2px; }
.horse-stats span { min-width: 0; }
.horse-stats small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.horse-stats b { display: block; margin-top: 2px; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.detail-hero { display: grid; grid-template-columns: minmax(240px, 40%) minmax(0, 1fr); min-height: 300px; }
.detail-image { display: grid; place-items: end center; min-height: 300px; overflow: hidden; background: radial-gradient(110% 90% at 50% 100%, #ecdcb9 0%, #f8f2e6 70%); }
.detail-image img { width: 92%; height: 100%; object-fit: contain; object-position: center bottom; }
.detail-copy { align-self: center; padding: clamp(22px, 4vw, 44px); }
.detail-copy h2 { margin: 6px 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.detail-copy p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.detail-separator { color: var(--dim); }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.detail-metrics > div { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.detail-metrics small, .detail-metrics strong { display: block; }
.detail-metrics small { color: var(--muted); font-size: 12px; font-weight: 600; }
.detail-metrics strong { margin-top: 3px; font-size: 18px; font-weight: 800; }
.metric-pair { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.metric-pair b { color: var(--text); font-weight: 800; }
.referral-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; }
.referral-card > div { min-width: 0; }
.referral-card h3 { margin: 6px 0 2px; font-size: 28px; font-weight: 800; letter-spacing: .03em; }
.referral-url { max-width: 560px; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.stat-grid { display: grid; gap: 12px; }
.stat-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-card strong { margin-top: 6px; overflow: hidden; font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-card-featured { border-color: var(--line-strong); background: radial-gradient(120% 140% at 100% 0%, #f5e6c6 0%, rgba(245,230,198,0) 60%), var(--surface); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.goal-card { display: flex; flex-direction: column; gap: 8px; }
.goal-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.goal-card h3 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; }
.goal-value { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.goal-value strong { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.goal-value span { color: var(--muted); font-size: 14px; }
.goal-card .button { margin-top: auto; }

/* Forms & payments */
.method-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.method-switch label { position: relative; }
.method-switch input { position: absolute; opacity: 0; pointer-events: none; }
.method-switch span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border: 1.5px solid var(--line-2); border-radius: 14px; color: var(--text-2); background: var(--surface); font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.method-switch input:checked + span { color: #12583f; border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(18,100,72,.15); }
.method-switch input:checked + span .icon { color: var(--gold-deep); }
.method-switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: var(--text-2); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 13px; outline: 0; color: var(--text); background: var(--surface); font-size: 15px; transition: border-color .16s ease, box-shadow .16s ease; }
.field textarea { min-height: 110px; padding-top: 12px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:disabled { background: var(--surface-3); }
.field small { color: var(--muted); font-size: 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(18,100,72,.16); }
.check-field { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.check-field input { width: 18px; height: 18px; accent-color: var(--gold-deep); }
.stack-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-feedback { min-height: 18px; color: var(--muted); font-size: 13px; font-weight: 600; }
.form-feedback:empty { min-height: 0; }
.form-feedback.error { color: var(--danger); }
.form-feedback.success { color: var(--success); }
.is-busy { opacity: .7; pointer-events: none; }
.form-hint { display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; color: #6a5122; background: var(--gold-soft); font-size: 13px; line-height: 1.45; }
.hint-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--gold-deep); }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--text-2); background: var(--surface); font-size: 14px; }
.notice .icon { color: var(--gold-deep); }
.notice-warning { color: #74490b; border-color: #f0dbb3; background: var(--warning-soft); }
.notice-warning .icon { color: var(--warning); }
.payment-result { padding: clamp(20px, 3vw, 28px); }
.payment-status { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.payment-status.completed, .payment-status.paid { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.payment-status.rejected, .payment-status.failed { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.payment-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.payment-data > div { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.payment-data span, .payment-data strong { display: block; }
.payment-data span { color: var(--muted); font-size: 12px; font-weight: 600; }
.payment-data strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 15px; font-weight: 800; }
.copy-field { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.copy-field span { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.copy-field code { flex: 1; overflow: hidden; padding: 0; color: var(--text); background: none; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.qr-wrap { display: grid; place-items: center; width: 210px; height: 210px; margin: 18px auto; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.fee-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.fee-preview strong { color: var(--text); font-weight: 800; text-align: right; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 22px; }
.profile-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 66px; height: 66px; color: #2b1f08; border: 3px solid #fff; border-radius: 50%; background: var(--gold-gradient); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm); font-size: 24px; font-weight: 800; }
.profile-hero > div:nth-child(2) { min-width: 0; }
.profile-hero h2 { margin: 2px 0; overflow: hidden; font-size: 22px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.profile-status { margin-left: auto; }
.profile-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-meta span { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 12px; font-weight: 600; }
.profile-meta b { display: block; margin-top: 2px; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.profile-links { display: grid; align-content: start; gap: 0; padding-block: 8px; }
.profile-links a, .profile-links button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; font-size: 15px; font-weight: 700; text-align: left; }
.profile-links > :last-child { border-bottom: 0; }
.profile-links .icon:first-child { color: var(--gold-deep); }
.profile-links a .icon:last-child, .profile-links button .icon:last-child { width: 16px; margin-left: auto; color: var(--dim); }
.profile-links button[data-action="logout"] { color: var(--danger); }
.profile-links button[data-action="logout"] .icon:first-child { color: var(--danger); }
.notification-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread h3::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.notification-item h3 { margin: 0; font-size: 15px; font-weight: 800; }
.notification-item p { margin: 3px 0; color: var(--text-2); font-size: 14px; }
.notification-item small { color: var(--dim); font-size: 12px; }
.support-card { display: grid; justify-items: start; gap: 10px; padding: clamp(24px, 4vw, 40px); }
.support-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; color: var(--gold-deep); background: var(--gold-soft); }
.support-card h3 { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
.support-card p { max-width: 520px; margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.legal-page { width: min(860px, 100%); margin: 0 auto; }
.legal-copy { padding: clamp(22px, 4vw, 40px); }
.legal-copy h3 { margin: 26px 0 6px; font-size: 18px; font-weight: 800; }
.legal-copy h3:first-child { margin-top: 0; }
.legal-copy p { max-width: 720px; margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.notice-inline { display: inline-block; padding: 8px 12px; border-radius: 10px; color: #74490b !important; background: var(--warning-soft); font-size: 13px !important; }

/* Admin */
.admin-frame .page-content { width: min(1440px, 100%); }
.admin-page-header { align-items: flex-end; }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-metric { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.admin-metric span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.admin-metric strong { display: block; overflow: hidden; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-wrap { height: 210px; padding-top: 12px; color: var(--gold-deep); }
.chart-wrap svg { display: block; width: 100%; height: 168px; overflow: visible; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 41px, #efede7 41px 42px); }
.chart-labels { display: flex; justify-content: space-between; padding-top: 8px; color: var(--muted); font-size: 12px; }
.chart-empty { display: grid; place-items: center; align-content: center; min-height: 200px; color: var(--muted); text-align: center; }
.chart-empty .icon { width: 28px; height: 28px; margin-bottom: 8px; color: var(--gold); }
.chart-empty p { max-width: 260px; margin: 0; font-size: 13px; }
.admin-note { display: flex; align-items: flex-start; gap: 14px; }
.admin-note-icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; color: var(--gold-deep); background: var(--gold-soft); }
.admin-note h3 { margin: 0; font-size: 16px; font-weight: 800; }
.admin-note p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filter-bar .field { flex: 1 1 170px; }
.filter-bar.panel { padding: 16px; }
.table-wrap { margin: 8px -4px -4px; padding: 0 4px 4px; overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-2); font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
th:first-child { border-top-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; }
tbody tr:hover td { background: #fcfbf8; }
tbody tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); font-size: 14px; }
td strong, td small { display: block; }
td strong { color: var(--text); }
td small { margin-top: 2px; color: var(--muted); font-size: 12px; }
code { padding: 2px 6px; border-radius: 6px; color: #6a4c16; background: var(--gold-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 180px; }
.admin-plan-list { display: grid; }
.admin-plan-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-plan-row:last-child { border-bottom: 0; }
.admin-plan-thumb { width: 64px; height: 52px; overflow: hidden; border-radius: 12px; background: var(--gold-soft); }
.admin-plan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.admin-plan-main { min-width: 0; }
.admin-plan-main h3 { margin: 0; overflow: hidden; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.admin-plan-main p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.commission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.commission-row { display: grid; grid-template-columns: 1fr 80px 16px 22px; align-items: center; gap: 6px; min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-2); background: var(--surface); font-size: 13px; font-weight: 600; }
.commission-row input[type=number] { width: 100%; min-height: 34px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); background: var(--surface); font-size: 14px; }
.commission-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold-deep); }
.commission-row small { color: var(--muted); font-size: 11px; }
.config-warning { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border: 1px solid #f2c9ce; border-radius: 12px; color: var(--danger); background: var(--danger-soft); font-size: 13px; }
.config-warning strong { font-weight: 800; }
.admin-frame .bottom-nav { display: none !important; }

/* Auth */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); min-height: 100vh; background: var(--bg); }
.auth-visual { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(18px, 4vh, 40px); min-height: calc(100vh - 32px); margin: 16px; padding: clamp(24px, 4vw, 48px); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 28px; color: var(--text); background: linear-gradient(180deg, #fdfaf3, #f3e4c4); }
.auth-visual > :not(canvas) { position: relative; z-index: 1; }
.auth-visual-top .brand { width: 172px; }
.auth-brand { display: grid; gap: 10px; max-width: 480px; }
.auth-brand strong { color: var(--text); font-size: clamp(34px, 4vw, 48px); font-weight: 800; line-height: 1.06; letter-spacing: -.035em; }
.auth-brand small { max-width: 400px; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.auth-kicker { display: none; }
.auth-visual-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; color: rgba(255,255,255,.7); font-size: 12px; }
.auth-panel { display: grid; place-items: center; min-width: 0; padding: 40px clamp(24px, 6vw, 80px); }
.auth-panel-inner { width: min(100%, 420px); }
.auth-mobile-brand { display: none; margin-bottom: 24px; }
.auth-heading { margin-bottom: 26px; }
.auth-heading .eyebrow { margin-bottom: 8px; }
.auth-heading h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 34px); font-weight: 800; line-height: 1.12; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.auth-panel .button-gold { margin-top: 6px; }
.auth-recover { display: block; margin-top: 16px; color: var(--gold-deep); font-size: 14px; font-weight: 700; text-align: center; }
.auth-switch { margin: 22px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.auth-switch a, .legal-micro a { color: var(--gold-deep); font-weight: 700; }
.legal-micro { margin: 26px 0 0; color: var(--dim); font-size: 12px; line-height: 1.5; text-align: center; }
.full-panel { grid-column: 1 / -1; }

/* Empty, loading, errors, modals, toast */
.empty-state { display: grid; justify-items: center; align-content: center; min-height: 160px; padding: 28px 20px; border: 1.5px dashed var(--line-2); border-radius: 16px; color: var(--muted); background: var(--surface-2); text-align: center; }
.empty-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 15px; color: var(--gold-deep); background: var(--gold-soft); }
.empty-state strong { color: var(--text); font-size: 15px; font-weight: 800; }
.empty-state p { max-width: 340px; margin: 4px 0 0; font-size: 13px; }
.loading-screen, .error-screen { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 100vh; padding: 24px; color: var(--muted); background: var(--bg); text-align: center; }
.loading-screen .eyebrow, .error-screen .eyebrow { display: none; }
.loading-screen strong, .error-screen h1 { margin: 0; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.error-screen p { max-width: 360px; margin: 0 0 10px; font-size: 14px; }
.loading-mark { width: 60px; height: 60px; margin-bottom: 6px; border-radius: 18px; box-shadow: var(--shadow); animation: pulse 1.8s ease-in-out infinite; }
.loading-bar { display: block; width: 160px; height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.loading-bar i { display: block; width: 45%; height: 100%; border-radius: inherit; background: var(--gold); animation: load 1.2s ease-in-out infinite; }
.toast-root { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--gold); }
.modal-backdrop { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(23,24,27,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { position: relative; width: min(100%, 460px); max-height: min(760px, calc(100vh - 36px)); overflow-y: auto; padding: clamp(22px, 4vw, 30px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-card .eyebrow { margin-bottom: 4px; }
.modal-card h2 { margin: 4px 0 8px; padding-right: 36px; font-size: 22px; font-weight: 800; line-height: 1.2; }
.modal-card > p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal-close { position: absolute; top: 14px; right: 14px; color: var(--muted); font-size: 24px; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.force-password { z-index: 80; }
.force-password .modal-card { border-top: 4px solid var(--gold); }
.one-time-token { display: block; margin: 14px 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; }

/* Check-in stage */
.checkin-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); min-height: 340px; overflow: hidden; }
.track { position: relative; min-height: 340px; overflow: hidden; background: linear-gradient(180deg, #fdf9f1 0%, #f3e6c9 62%, #e9d6ad 100%); }
.track::before { content: ''; position: absolute; inset: 8% 20% auto auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,255,255,0) 70%); }
.track-lane { position: absolute; right: -10%; bottom: 24%; left: -8%; height: 2px; background: linear-gradient(90deg, transparent, rgba(18,100,72,.5), transparent); transform: rotate(-3deg); }
.track-lane::after { content: ''; position: absolute; inset: 12px 0 auto; height: 1px; background: rgba(18,100,72,.2); }
.track-lane.lane-two { bottom: 17%; opacity: .7; transform: rotate(2deg); }
.finish-line { position: absolute; top: 0; right: 18%; bottom: 0; width: 12px; opacity: .45; background: repeating-linear-gradient(180deg, #17181b 0 10px, #ffffff 10px 20px); transform: skewX(-8deg); }
.checkin-stage-copy { display: grid; align-content: center; gap: 10px; padding: 28px clamp(20px, 4vw, 40px); border-left: 1px solid var(--line); background: var(--surface); }
.checkin-stage-copy h3 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.checkin-stage-copy h3 strong { color: var(--gold-deep); }
.checkin-stage-copy p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.checkin-mini-art, .track-lines { display: none; }
.r1-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 99px; color: var(--gold-deep); background: var(--gold-soft); font-size: 12px; font-weight: 800; }
.race-sprite { position: absolute; left: 6%; bottom: 14%; width: min(420px, 66%); height: auto; transform-origin: 50% 100%; animation: gallop 1.05s ease-in-out infinite; filter: drop-shadow(0 14px 8px rgba(80,56,16,.25)); }
.race-sprite [fill="#d8b46b"] { fill: #2a2420; }
.race-sprite [stroke="#d8b46b"] { stroke: #2a2420; }
.race-sprite circle[fill="#0a0b0d"] { fill: #f3e6c9; }
.race-sprite .runner-dust circle { fill: rgba(140,102,36,.45); }
.race-sprite .horse-body { transform-origin: 72px 65px; animation: horse-bob .52s ease-in-out infinite alternate; }
.race-sprite .runner-dust { animation: dust .9s ease-out infinite; }
.race-sprite .leg { transform-box: fill-box; transform-origin: 50% 0; }
.race-sprite .leg-a, .race-sprite .leg-c { animation: leg-front .52s ease-in-out infinite alternate; }
.race-sprite .leg-b, .race-sprite .leg-d { animation: leg-back .52s ease-in-out -.25s infinite alternate; }
.checkin-stage.is-complete .race-sprite { animation: race-finish .8s cubic-bezier(.2,.8,.2,1) both; }
.checkin-stage.is-complete .track::after { content: ''; position: absolute; right: 20%; bottom: 26%; left: 5%; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 16px var(--gold); animation: trajectory .8s ease-out both; }

/* Motion */
@keyframes floatHorse { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes mining { from { transform: translateX(-120%); } to { transform: translateX(300%); } }
@keyframes pulseDot { 0%,100% { box-shadow: 0 0 0 0 rgba(21,132,90,.35); } 50% { box-shadow: 0 0 0 5px rgba(21,132,90,0); } }
@keyframes gallop { 0%,100% { transform: translateX(0) scaleY(1); } 50% { transform: translateX(8px) scaleY(.98); } }
@keyframes horse-bob { from { transform: translateY(1px); } to { transform: translateY(-3px); } }
@keyframes dust { from { opacity: .8; transform: translateX(0); } to { opacity: 0; transform: translateX(-28px); } }
@keyframes pulse { 0%,100% { opacity: .7; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.02); } }
@keyframes load { from { transform: translateX(-180%); } to { transform: translateX(400%); } }
@keyframes leg-front { from { transform: rotate(22deg); } to { transform: rotate(-28deg); } }
@keyframes leg-back { from { transform: rotate(-27deg); } to { transform: rotate(23deg); } }
@keyframes race-finish { from { transform: translateX(0) scale(1); } to { transform: translateX(58%) scale(1.05); } }
@keyframes trajectory { from { opacity: 0; transform: scaleX(.2); transform-origin: left; } to { opacity: .85; transform: scaleX(1); transform-origin: left; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* Responsive */
@media (max-width: 1180px) {
  :root { --rail-width: 236px; }
  .stat-grid-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .commission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .balance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .home { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --rail-width: var(--rail-collapsed); }
  .rail { padding-inline: 12px; }
  .rail .brand { width: 44px; overflow: hidden; }
  .rail .rail-caption, .rail .nav-link span { display: none; }
  .rail-top { justify-content: center; padding-inline: 0; }
  .rail-toggle { display: none; }
  .nav-link { justify-content: center; padding-inline: 0; }
  .detail-hero { grid-template-columns: minmax(200px, 36%) minmax(0, 1fr); }
  .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --rail-width: 0px; }
  body { font-size: 15px; }
  .rail { top: 0; bottom: 0; width: 284px; padding: 20px 14px; transform: translateX(-104%); box-shadow: var(--shadow-lg); }
  .rail.is-open { transform: translateX(0); }
  .rail .brand { width: 150px; }
  .rail .rail-caption, .rail .nav-link span { display: inline; }
  .rail-top { justify-content: space-between; padding-inline: 8px; }
  .rail-toggle { display: none; }
  .nav-link { justify-content: flex-start; padding-inline: 12px; }
  .main-column { width: 100%; margin-left: 0; }
  .topbar { min-height: 64px; gap: 8px; padding: 10px 14px; }
  .mobile-menu { display: grid; margin-left: -6px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .icon-button, .avatar { width: 40px; height: 40px; }
  .install-button span { display: none; }
  .install-button { padding: 0 10px; }
  .bottom-nav { position: fixed; z-index: 35; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 0; padding: 6px max(6px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); box-shadow: 0 -8px 24px rgba(23,24,27,.05); }
  .bottom-nav .nav-link { isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 28px 16px; justify-content: stretch; justify-items: center; align-content: center; align-items: center; gap: 2px; width: 100%; min-width: 0; height: 58px; min-height: 58px; margin: 0; padding: 6px 2px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
  .bottom-nav .nav-link span { display: block; width: 100%; min-width: 0; margin: 0; overflow: hidden; line-height: 16px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav .nav-link .icon { display: block; justify-self: center; align-self: center; width: 24px; height: 24px; margin: 0; }
  .bottom-nav .nav-link.is-active { color: #4f3810; background: transparent; }
  .bottom-nav .nav-link.is-active::before { content: ''; position: absolute; z-index: -1; top: 6px; left: 50%; width: min(52px, calc(100% - 8px)); height: 28px; border-radius: 99px; background: var(--gold-soft); transform: translateX(-50%); }
  .page-content { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .admin-frame .page-content { padding-bottom: 40px; }
  .home, .section-block, .home-grid, .admin-content { gap: 16px; }
  .balance-card { padding: 20px 18px; border-radius: 22px; }
  .balance-number { font-size: clamp(34px, 10.5vw, 44px); }
  .balance-stage { height: 126px; }
  .balance-live { width: 52%; padding: 8px 10px; }
  .balance-live strong { font-size: 17px; }
  .balance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .balance-metrics > div { padding: 10px 12px; }
  .quick-actions { gap: 4px; margin-top: 16px; }
  .qa-icon { width: 50px; height: 50px; border-radius: 16px; }
  .campaign-hero { min-height: 190px; padding: 20px; border-radius: 22px; }
  .campaign-copy { max-width: 64%; }
  .campaign-copy h2 { font-size: 20px; }
  .campaign-copy p { font-size: 13px; }
  .card-row { grid-auto-columns: 80%; margin-inline: -14px; padding-inline: 14px; scroll-padding-inline: 14px; }
  .section-split, .home-columns, .horse-grid, .goal-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .page-intro, .admin-page-header { display: grid; align-items: start; gap: 14px; }
  .page-intro h2, .admin-page-header h2 { font-size: 26px; }
  .page-intro p, .admin-page-header p { font-size: 14px; }
  .page-intro .button-cluster .button { flex: 1; }
  .stat-grid-four, .stat-grid-five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-grid-five .stat-card:last-child { grid-column: 1 / -1; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 19px; }
  .referral-card { display: grid; padding: 20px; }
  .referral-card .button { width: 100%; }
  .referral-url { max-width: calc(100vw - 80px); }
  .detail-hero { grid-template-columns: minmax(0, 1fr); }
  .detail-image { min-height: 210px; max-height: 240px; }
  .detail-copy { padding: 20px; }
  .detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .detail-metrics > div { padding: 10px; }
  .detail-metrics strong { font-size: 15px; }
  .owned-horse-card { grid-template-columns: 110px minmax(0, 1fr); }
  .owned-horse-image { min-height: 0; }
  .owned-horse-content { padding: 14px; }
  .horse-stats b { font-size: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full { grid-column: auto; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .profile-hero { align-items: center; flex-wrap: wrap; padding: 20px; }
  .profile-status { margin-left: 82px; margin-top: -10px; width: 100%; }
  .profile-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-meta span:last-child { grid-column: 1 / -1; }
  .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .admin-metric { padding: 14px; }
  .admin-metric strong { font-size: 21px; }
  .commission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-plan-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .admin-plan-row > .status, .admin-plan-row > .button { grid-column: 2; justify-self: start; }
  .admin-plan-row > .button:last-child { grid-column: 3; grid-row: 2; }
  .auth-layout { display: block; min-height: 100vh; }
  .auth-visual { min-height: 0; height: 330px; gap: 14px; margin: 0; padding: calc(18px + env(safe-area-inset-top)) 20px 40px; border: 0; border-radius: 0; }
  .auth-visual-top .brand { width: 148px; }
  .auth-brand strong { max-width: 290px; font-size: 25px; line-height: 1.12; }
  .auth-brand small { font-size: 13px; }
  .auth-visual-footer { display: none; }
  .auth-panel { position: relative; z-index: 2; display: block; min-height: calc(100vh - 306px); margin-top: -24px; box-shadow: 0 -10px 30px rgba(23,24,27,.06); padding: 30px 20px 44px; border-radius: 28px 28px 0 0; background: var(--bg); }
  .auth-panel-inner { margin: 0 auto; }
  .auth-heading { margin-bottom: 22px; }
  .auth-heading h1 { font-size: 28px; }
  .full-panel { min-height: 100vh; margin-top: 0; border-radius: 0; }
  .checkin-stage { grid-template-columns: minmax(0, 1fr); }
  .track { min-height: 230px; }
  .checkin-stage-copy { border-top: 1px solid var(--line); border-left: 0; padding: 22px 20px 24px; }
  .race-sprite { width: 76%; bottom: 16%; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 88vh; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toast-root { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
}
@media (max-width: 380px) {
  .quick-action { font-size: 11px; }
  .qa-icon { width: 46px; height: 46px; }
  .balance-live { width: 56%; }
  .stat-card strong { font-size: 17px; }
  .commission-grid { gap: 6px; }
  .commission-row { grid-template-columns: 1fr 60px 14px 20px; padding-inline: 6px; }
}

/* Animated race scenes (canvas) */
.race-scene-canvas { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.campaign-hero.has-scene { padding: 22px; background: linear-gradient(180deg, #fdfaf3, #f3e4c4); }
.campaign-scene { position: absolute; z-index: 0; inset: 0; }
.campaign-hero.has-scene .campaign-copy { align-self: flex-start; max-width: 60%; }
.track { position: relative; }
.loading-scene { position: relative; width: 170px; height: 104px; }
.topbar-title small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.2; }
.rail-close, .rail-scrim { display: none; }
.rail-user { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.rail-user .avatar { width: 38px; height: 38px; flex: 0 0 auto; }
.rail-user span:last-child { min-width: 0; }
.rail-user strong, .rail-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user strong { font-size: 14px; font-weight: 800; }
.rail-user small { color: var(--muted); font-size: 12px; }
.app-frame.rail-collapsed .rail-user { justify-content: center; padding: 8px; }
.app-frame.rail-collapsed .rail-user span:last-child { display: none; }
@media (max-width: 900px) { .rail-user { justify-content: center; padding: 8px; } .rail-user span:last-child { display: none; } }
@media (max-width: 680px) {
  .rail-user { justify-content: flex-start; padding: 12px; }
  .rail-user span:last-child { display: block; }
  .rail-close { display: grid; }
  .rail.is-open + .rail-scrim { position: fixed; z-index: 39; inset: 0; display: block; border: 0; background: rgba(23,24,27,.36); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .campaign-hero.has-scene { min-height: 210px; padding: 18px; }
  .campaign-hero.has-scene .campaign-copy { max-width: 66%; }
  .topbar-bell { display: none !important; }
}

/* ===== Home v3: thin banner, horizontal balance card, quick grid ===== */
.home-v3 { display: grid; gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.home-v3 > * { min-width: 0; }
.top-banner.campaign-hero { display: flex; align-items: center; gap: 12px; min-height: 0; height: 104px; padding: 0 14px 0 16px; border-radius: 20px; background: linear-gradient(180deg, #fdfaf3, #f3e4c4); }
.top-banner .campaign-scene { position: absolute; z-index: 0; inset: 0; }
.top-banner .campaign-copy, .top-banner.has-scene .campaign-copy { position: relative; z-index: 2; flex: 1; align-self: center; max-width: 62%; }
.top-banner .campaign-tag { height: 20px; padding: 0 8px; font-size: 10px; }
.top-banner .campaign-copy h2 { margin: 6px 0 2px; overflow: hidden; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.top-banner .campaign-copy p { margin: 0; overflow: hidden; color: var(--text-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.top-banner .rotating-banner-image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.top-banner:not(.has-scene)::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(253,250,243,.95) 0%, rgba(253,250,243,.78) 50%, rgba(253,250,243,0) 85%); }
.top-banner-cta { position: relative; z-index: 2; display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; margin-left: auto; align-self: flex-end; margin-bottom: 12px; border-radius: 50%; color: #fff; background: var(--gold-gradient); box-shadow: 0 6px 14px rgba(18,100,72,.28); }
.top-banner-cta .icon { width: 18px; height: 18px; }

.bal-card { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 44%); align-items: center; min-height: 172px; padding: 20px 0 20px 20px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 24px; background: radial-gradient(120% 140% at 88% 50%, #f3e2bb 0%, rgba(243,226,187,0) 55%), linear-gradient(135deg, #ffffff 0%, #fbf5e8 60%, #f6e9cc 100%); box-shadow: 0 1px 2px rgba(23,24,27,.04), 0 16px 36px rgba(140,102,36,.12); }
.bal-card::before { content: ""; position: absolute; z-index: 0; right: -40px; bottom: -60px; width: 240px; height: 240px; border: 1px solid rgba(18,100,72,.2); border-radius: 50%; box-shadow: 0 0 0 26px rgba(18,100,72,.06), 0 0 0 54px rgba(18,100,72,.04); }
.bal-coins { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.bal-info { position: relative; z-index: 3; display: grid; gap: 4px; min-width: 0; }
.bal-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.bal-card .balance-number { margin: 2px 0 6px; overflow: hidden; font-size: clamp(30px, 8.6vw, 44px); text-overflow: ellipsis; white-space: nowrap; }
.bal-live { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.bal-live b { color: var(--success); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal-card .mining-bar { width: min(100%, 200px); margin-top: 8px; background: rgba(18,100,72,.16); }
.bal-horse { position: relative; z-index: 2; justify-self: end; width: 118%; max-width: 330px; height: auto; margin-right: -14%; filter: drop-shadow(0 16px 16px rgba(23,24,27,.22)); pointer-events: none; user-select: none; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.qg-item { display: grid; justify-items: center; gap: 7px; min-width: 0; padding: 6px 2px; border-radius: 14px; color: var(--text-2); text-align: center; -webkit-tap-highlight-color: transparent; }
.qg-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: var(--gold-deep); background: linear-gradient(180deg, #f6fbf2, #e3efdf); box-shadow: inset 0 0 0 1px rgba(18,100,72,.2); transition: transform .18s ease, box-shadow .18s ease; }
.qg-icon .icon { width: 22px; height: 22px; }
.qg-item.is-gold .qg-icon { color: #fff; background: var(--gold-gradient); box-shadow: 0 8px 16px rgba(18,100,72,.25), inset 0 1px 0 rgba(255,255,255,.2); }
.qg-item:active .qg-icon { transform: scale(.94); }
.qg-item:hover .qg-icon { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(18,100,72,.18), inset 0 0 0 1px rgba(18,100,72,.28); }
.qg-label { max-width: 100%; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.stats-card { padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.stats-head strong { font-size: 16px; font-weight: 800; }
.stats-head small { color: var(--muted); font-size: 11px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stats-grid > div { min-width: 0; padding: 10px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.stats-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.stats-grid strong { display: block; margin-top: 3px; overflow: hidden; font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.checkin-strip { position: relative; isolation: isolate; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px 14px 12px 104px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--text); background: linear-gradient(90deg, #f6ead0, #fffaf0 70%); }
.checkin-strip-scene { position: absolute; z-index: 0; top: 8px; bottom: 8px; left: 8px; width: 92px; }
.checkin-strip-copy { display: grid; flex: 1; min-width: 0; }
.checkin-strip-copy small { color: var(--gold-deep); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.checkin-strip-copy strong { overflow: hidden; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.checkin-strip-cta { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 99px; color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; font-weight: 800; }
.checkin-strip.is-ready .checkin-strip-cta { color: #fff; background: var(--gold-gradient); box-shadow: 0 6px 12px rgba(18,100,72,.24); }
.checkin-strip-cta .icon { width: 15px; height: 15px; }

@media (min-width: 1024px) {
  .home-v3 { max-width: 1080px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .home-v3 > .top-banner, .home-v3 > .home-section, .home-v3 > .checkin-strip { grid-column: 1 / -1; }
  .top-banner.campaign-hero { height: 128px; padding: 0 22px 0 26px; }
  .top-banner .campaign-copy h2 { font-size: 22px; }
  .top-banner .campaign-copy p { font-size: 14px; }
  .quick-grid { align-content: center; }
}
@media (max-width: 680px) {
  .home-v3 { gap: 14px; }
  .bal-card { min-height: 158px; padding: 18px 0 18px 18px; grid-template-columns: minmax(0, 1fr) 42%; }
  .bal-horse { width: 128%; margin-right: -20%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .qg-icon { width: 44px; height: 44px; border-radius: 14px; }
  .qg-label { font-size: 11px; }
}

/* Home v3 refinements */
.top-banner.campaign-hero { color: var(--text); text-decoration: none; }
.top-banner .campaign-copy, .top-banner.has-scene .campaign-copy { max-width: 58%; }
.top-banner .campaign-copy h2 { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bal-card { grid-template-columns: minmax(0, 1fr) minmax(140px, 46%); padding-right: 8px; }
.bal-horse { width: 106%; max-width: 360px; margin-right: 0; }
@media (max-width: 680px) {
  .top-banner.campaign-hero { height: 100px; }
  .top-banner .campaign-copy h2 { margin-top: 7px; font-size: 15px; line-height: 1.22; }
  .top-banner .campaign-copy p { display: none; }
  .bal-card { grid-template-columns: minmax(0, 1fr) 46%; padding-right: 6px; }
  .bal-horse { width: 108%; margin-right: 0; }
}


/* PAYMENT CHECKOUT PAGE */
body.payment-checkout-active { background: #fff; }
body.payment-checkout-active .user-frame { display: block; min-height: 100svh; }
body.payment-checkout-active .user-frame .rail,
body.payment-checkout-active .user-frame .rail-scrim,
body.payment-checkout-active .user-frame .topbar,
body.payment-checkout-active .user-frame .bottom-nav { display: none !important; }
body.payment-checkout-active .user-frame .main-column { width: 100%; min-height: 100svh; margin: 0; }
body.payment-checkout-active .user-frame .page-content { width: 100%; max-width: none; margin: 0; padding: 0; }
.payment-checkout-page { min-height: 100svh; color: #15231b; background: linear-gradient(180deg,#0d5d3d 0%,#0d6543 20%,#dceee5 43%,#f7faf8 57%,#fff 100%); padding-bottom: max(28px,env(safe-area-inset-bottom)); }
.payment-checkout-topbar { min-height: 76px; padding: max(12px,env(safe-area-inset-top)) 22px 12px; display: grid; grid-template-columns: 48px minmax(0,1fr) 48px; align-items: center; background: rgba(255,255,255,.98); border-bottom: 1px solid rgba(12,55,37,.08); }
.payment-checkout-topbar h1 { margin: 0; text-align: center; font-size: clamp(21px,4vw,28px); font-weight: 650; letter-spacing: -.025em; }
.payment-checkout-back { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 16px; color: #126448; background: #e8f4ec; cursor: pointer; }
.payment-checkout-back svg { width: 24px; height: 24px; }
.payment-checkout-stage { width: min(700px,calc(100% - 32px)); margin: 0 auto; padding: clamp(34px,7vh,76px) 0 38px; }
.payment-checkout-hero { margin: 0 auto 34px; text-align: center; color: #fff; }
.payment-checkout-kicker { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.76); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.payment-checkout-hero h2 { margin: 14px 0 8px; color: #fff; font-family: Georgia,serif; font-size: clamp(27px,5.7vw,40px); line-height: 1.12; font-weight: 700; text-wrap: balance; }
.payment-checkout-hero p { margin: 0; color: rgba(255,255,255,.84); font-size: 15px; }
.payment-checkout-card { position: relative; max-width: 620px; margin: 0 auto; padding: clamp(22px,5vw,40px); overflow: hidden; border: 1px solid rgba(18,71,48,.08); border-radius: 22px; background: #fff; box-shadow: 0 22px 70px rgba(14,55,38,.16); }
.payment-checkout-card::before { position: absolute; top: 0; right: 24px; left: 24px; height: 5px; border-radius: 0 0 8px 8px; background: linear-gradient(90deg,#42a875,#126448); content: ''; }
.payment-checkout-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; min-height: 34px; color: #196343; }
.payment-checkout-status strong { font-size: 14px; font-weight: 800; }
.payment-checkout-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a334; box-shadow: 0 0 0 4px #fbf3df; }
.payment-checkout-status-dot.is-success { background: #1d9b63; box-shadow: 0 0 0 4px #e5f4ec; }
.payment-checkout-updated { flex-basis: 100%; color: #7a817d; font-size: 12px; text-align: center; }
.payment-checkout-total { display: grid; justify-items: center; gap: 8px; margin: 26px 0 22px; text-align: center; }
.payment-checkout-total > span { color: #6c746f; font-size: 13px; font-weight: 700; }
.payment-checkout-total > strong { color: #101713; font-family: Georgia,serif; font-size: clamp(34px,8vw,54px); font-weight: 800; line-height: 1.06; letter-spacing: -.04em; overflow-wrap: anywhere; }
.payment-checkout-total small { color: #6c746f; font-size: 13px; font-weight: 700; }
.payment-checkout-credit { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 1px solid #e8eee9; border-radius: 12px; background: #f8fbf9; color: #626c65; font-size: 13px; }
.payment-checkout-credit strong { color: #284b38; font-size: 14px; text-align: right; }
.payment-checkout-divider { height: 1px; margin: 24px 0; border-top: 1px dashed #d8dfda; }
.payment-checkout-qr { width: min(320px,76vw); aspect-ratio: 1; margin: 0 auto 20px; display: grid; place-items: center; overflow: hidden; border: 1px solid #edf0ed; border-radius: 16px; background: #fff; }
.payment-checkout-qr img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.payment-checkout-qr-pending { min-height: 250px; display: grid; justify-items: center; align-content: center; gap: 12px; padding: 28px; text-align: center; color: #315a43; }
.payment-checkout-qr-pending strong { font-size: 17px; }
.payment-checkout-qr-pending p { max-width: 340px; margin: 0; color: #69756e; font-size: 14px; line-height: 1.55; }
.payment-checkout-spinner { width: 32px; height: 32px; border: 3px solid #dce9e0; border-top-color: #18764e; border-radius: 50%; animation: checkout-spin .8s linear infinite; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
.payment-checkout-copy { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 18px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg,#16734c,#0f5b3c); box-shadow: 0 8px 22px rgba(16,91,60,.18); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.payment-checkout-copy:hover { filter: brightness(1.05); }
.payment-checkout-copy svg { width: 19px; height: 19px; }
.payment-checkout-address { margin: 0 0 18px; padding: 14px; border: 1px solid #e6ece7; border-radius: 14px; background: #f8fbf9; }
.payment-checkout-address > div { display: grid; gap: 8px; margin-bottom: 12px; }
.payment-checkout-address > div span { color: #6c746f; font-size: 12px; font-weight: 700; }
.payment-checkout-address code { display: block; max-height: 78px; overflow: auto; color: #253a2d; font: 12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap: anywhere; user-select: all; }
.payment-checkout-instructions { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 0; color: #626c65; }
.payment-checkout-instructions-mark { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #176746; background: #e8f4ec; font: 700 13px/1 system-ui,sans-serif; }
.payment-checkout-instructions p { margin: 0; font-size: 14px; line-height: 1.6; }
.payment-checkout-alert { margin-top: 16px; padding: 13px 15px; border: 1px solid #f0dcae; border-radius: 12px; color: #805619; background: #fff9eb; font-size: 13px; line-height: 1.5; }
.payment-checkout-actions { display: grid; gap: 14px; margin-top: 24px; }
.payment-checkout-actions .button { min-height: 54px; }
.payment-checkout-wallet { color: #657069; font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.payment-checkout-wallet:hover { color: #145e3d; text-decoration: underline; }
.deposit-create-card { max-width: 720px; margin-inline: auto; }
@media (max-width: 600px) {
  .payment-checkout-topbar { min-height: 68px; grid-template-columns: 42px minmax(0,1fr) 42px; padding-inline: 14px; }
  .payment-checkout-back { width: 42px; height: 42px; border-radius: 14px; }
  .payment-checkout-stage { width: min(100% - 22px,620px); padding-top: 30px; }
  .payment-checkout-hero { margin-bottom: 24px; }
  .payment-checkout-card { padding: 24px 18px 22px; border-radius: 20px; }
  .payment-checkout-card::before { right: 18px; left: 18px; }
  .payment-checkout-divider { margin: 20px 0; }
  .payment-checkout-qr { width: min(290px,76vw); }
  .payment-checkout-copy { min-height: 54px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .payment-checkout-spinner { animation-duration: 2s; } }

/* AFFILIATES COMPACT AND ADMIN LIGHT */
.affiliates-page { min-width:0; }
.affiliates-page > * { min-width:0; }
.affiliates-network-badge { display:flex; align-items:center; gap:8px; padding:10px 14px; border:1px solid #dbe7df; border-radius:999px; color:#315b43; background:#edf5ef; font-size:12px; font-weight:700; white-space:nowrap; }
.referral-card.referral-card-compact { display:flex !important; flex-direction:row; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px !important; background:#fff; border:1px solid #e2e8e4; box-shadow:0 4px 16px #23352b08; }
.referral-card-compact .referral-copy { flex:1 1 0; min-width:0; }
.referral-card-compact .eyebrow { font-size:10px; color:#617167; letter-spacing:.08em; }
.referral-inline { display:flex; align-items:center; gap:14px; min-width:0; margin-top:5px; }
.referral-code { flex-shrink:0; color:#315c43; font-size:14px; font-weight:800; }
.referral-card-compact .referral-url { min-width:0; max-width:none !important; margin:0; color:#657369; font-size:12px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.referral-card-compact .referral-copy-button { flex:0 0 auto; width:auto !important; min-height:40px; padding:9px 14px; font-size:12px; white-space:nowrap; }
.affiliate-metrics .stat-card { min-width:0; padding:17px; }
.affiliate-metrics .stat-card strong { font-size:clamp(19px,2vw,27px); overflow-wrap:anywhere; white-space:normal; }
.affiliates-network-panel { min-width:0; }
.affiliate-filter.filter-bar { display:grid; grid-template-columns:minmax(130px,.9fr) minmax(180px,1.5fr) minmax(130px,.9fr) auto; gap:12px; align-items:end; padding:16px; margin:18px 0; border:1px solid #e2e8e4; border-radius:16px; background:#f8faf8; min-width:0; }
.affiliate-filter .field { display:flex; flex-direction:column; gap:7px; min-width:0; width:100%; margin:0; }
.affiliate-filter .field > span { font-size:12px; color:#546257; }
.affiliate-filter input,.affiliate-filter select { box-sizing:border-box; width:100%; min-width:0; height:44px; min-height:44px; padding:10px 12px; background:#fff; }
.affiliate-filter-actions { display:flex; align-items:center; gap:8px; min-width:0; }
.affiliate-filter-actions .button { height:44px; min-height:44px; margin:0; padding:10px 14px; font-size:13px; white-space:nowrap; }
.affiliate-results-label { padding:0 4px 8px; color:#647169; font-size:12px; }
.affiliate-table { max-width:100%; margin:0; padding:0; border:1px solid #e8ede9; border-radius:14px; }
.affiliate-table table { min-width:680px; }
.affiliate-level { display:inline-grid; place-items:center; min-width:30px; height:30px; border-radius:9px; color:#315b43; background:#edf4ee; font-weight:800; }
html[data-area="admin"], html[data-area="admin"] body { background:#f4f6f8; color:#273649; }
.admin-frame { --carbon:#f4f6f8; --ink:#273649; --panel:#fff; --panel-2:#f7f9fb; --panel-3:#edf2f6; --text:#273649; --muted:#58697b; --dim:#637385; --gold-bright:#805d23; --line:#dce3ea; color:#273649; background:#f4f6f8; }
.admin-frame .rail { background:#fff; border-color:#dce3ea; }
.admin-frame .topbar { background:#ffffffed; border-color:#dce3ea; }
.admin-frame .panel,.admin-frame .panel-dark,.admin-frame .admin-metric,.admin-frame .modal-card { background:#fff; color:#273649; border-color:#dce3ea; box-shadow:0 4px 20px #26394d08; }
.admin-frame h1,.admin-frame h2,.admin-frame h3,.admin-frame strong { color:#273649; }
.admin-frame .nav-link { color:#526477; }
.admin-frame .nav-link.is-active { color:#126448; background:#e7f2eb; }
.admin-frame .nav-link:hover { background:#f0f4f8; color:#273649; }
.admin-frame input,.admin-frame select,.admin-frame textarea { color:#273649; background:#fff; border-color:#9baaba; }
.admin-frame input::placeholder,.admin-frame textarea::placeholder { color:#67788a; opacity:1; }
.admin-frame th { color:#526477; background:#f1f5f8; }
.admin-frame td { color:#273649; border-color:#e1e7ed; }
.admin-frame tbody tr:hover td { background:#f7fafc; }
.admin-frame .button-outline,.admin-frame .button-ghost,.admin-frame .icon-button { color:#42576a; border-color:#cbd5df; background:#fff; }
.admin-frame :focus-visible { outline:3px solid rgba(18,100,72,.48); outline-offset:3px; }
@media(max-width:1100px) { .affiliate-filter.filter-bar { grid-template-columns:repeat(3,minmax(0,1fr)); } .affiliate-filter-actions { grid-column:1/-1; justify-content:flex-end; } }
@media(max-width:700px) { .affiliates-page .page-intro { gap:12px; } .affiliates-network-badge { width:fit-content; font-size:11px; padding:8px 12px; } .affiliate-filter.filter-bar { grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; gap:10px; } .affiliate-filter .field:nth-child(2) { grid-column:1/-1; grid-row:1; } .affiliate-filter-actions { justify-content:stretch; } .affiliate-filter-actions .button { flex:1; } .affiliate-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .affiliate-metrics .stat-card:first-child { grid-column:1/-1; } .referral-card.referral-card-compact { padding:12px !important; gap:10px; } .referral-inline { display:block; } .referral-code { font-size:12px; } .referral-card-compact .referral-url { font-size:11px; margin-top:3px; } .referral-card-compact .referral-copy-button { padding:10px; min-height:40px; } .referral-card-compact .referral-copy-button .icon { width:16px; height:16px; } }

.referral-card-compact .eyebrow { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.referral-card-compact .referral-code { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* SLIM PAYMENT CHECKOUT: exact amount on one line */
.payment-checkout-page { font-family:Manrope,Inter,system-ui,-apple-system,"Segoe UI",sans-serif; background:linear-gradient(180deg,#eaf3ed 0%,#f7faf8 45%,#fff 100%); }
.payment-checkout-topbar { min-height:64px; }
.payment-checkout-topbar h1 { font-size:20px; font-weight:700; }
.payment-checkout-stage { width:min(500px,calc(100% - 24px)); padding:24px 0; }
.payment-checkout-card { padding:24px; border-radius:18px; box-shadow:0 10px 36px #1c493014; }
.payment-checkout-card::before { height:3px; }
.payment-checkout-status { min-height:20px; gap:8px; }
.payment-checkout-status strong { font-size:12px; font-weight:600; }
.payment-checkout-total { display:flex; flex-direction:column; align-items:center; min-width:0; width:100%; gap:7px; margin:18px 0 20px; }
.payment-checkout-total > span { font-size:12px; font-weight:500; }
.payment-checkout-total > strong { flex:0 0 auto; display:block; width:max-content; max-width:none; font-family:Manrope,Inter,system-ui,-apple-system,"Segoe UI",sans-serif; font-size:38px; font-weight:750; line-height:1.18; letter-spacing:-.035em; white-space:nowrap; overflow-wrap:normal; word-break:normal; overflow:visible; text-overflow:clip; font-variant-numeric:tabular-nums; }
.payment-checkout-total small { font-size:11px; font-weight:600; }
.payment-checkout-qr { width:min(260px,100%); margin:0 auto 18px; border-radius:12px; }
.payment-checkout-copy { min-height:48px; border-radius:11px; font-size:14px; font-weight:650; box-shadow:none; }
.payment-checkout-address { padding:12px; background:#f6f9f7; margin:0; }
.payment-checkout-address > div { margin-bottom:10px; gap:4px; }
.payment-checkout-address code { font-size:11px; }
.payment-checkout-instructions { display:block; margin-top:15px; text-align:center; }
.payment-checkout-instructions p { font-size:12px; line-height:1.5; color:#657269; }
.payment-checkout-actions { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:18px; margin-top:20px; padding-top:16px; border-top:1px solid #e9eee9; }
.payment-checkout-new { border:0; padding:0; background:transparent; color:#236346; font:600 12px/1.5 Manrope,Inter,system-ui,sans-serif; cursor:pointer; }
.payment-checkout-wallet { font-size:12px; font-weight:500; }
.payment-checkout-qr-pending { min-height:200px; padding:20px; }
.payment-checkout-qr-pending strong { font-size:14px; }
@media(max-width:600px) { .payment-checkout-stage { padding:18px 0; } .payment-checkout-card { padding:22px 18px; } .payment-checkout-total > strong { font-size:34px; } .payment-checkout-qr { width:min(240px,100%); } .payment-checkout-copy { min-height:46px; } }

/* FILTER FIELDS AND ACTIONS ARE SEPARATE ROWS */
.affiliates-page .affiliate-filter.filter-bar { display:block; padding:16px; margin:18px 0; min-width:0; }
.affiliate-filter-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 12px; align-items:start; min-width:0; }
.affiliate-filter-fields > .field { display:flex; flex-direction:column; position:static; width:100%; min-width:0; margin:0; flex:none; grid-column:auto; grid-row:auto; }
.affiliate-filter-fields > .field:nth-child(2) { grid-column:auto; grid-row:auto; }
.affiliate-filter-fields .field > span { min-height:18px; line-height:18px; }
.affiliate-filter-fields input,.affiliate-filter-fields select { display:block; position:static; box-sizing:border-box; height:46px; min-height:46px; width:100%; max-width:100%; min-width:0; font-size:16px; line-height:24px; }
.affiliates-page .affiliate-filter-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:12px; margin:18px 0 0; padding:16px 0 0; border-top:1px solid #e3e9e5; }
.affiliates-page .affiliate-filter-actions > .button { display:flex; position:static; align-items:center; justify-content:center; min-width:0; width:100%; height:46px; min-height:46px; padding:10px 12px; margin:0; font-size:14px; flex:none; }
.affiliate-metrics.stat-grid-four { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.horse-page-tabs.tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; max-width:100%; gap:8px; padding:6px; overflow:visible; box-sizing:border-box; }
.horse-page-tabs.tabs > .tab { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:100%; min-width:0; min-height:52px; padding:12px 8px; text-align:center; font-size:14px; line-height:20px; font-weight:700; white-space:normal; }
@media(max-width:700px) {
  .affiliates-page .affiliate-filter.filter-bar { padding:12px; }
  .affiliate-filter-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 10px; }
  .affiliate-filter-fields > .field:nth-child(2) { grid-column:1/-1; grid-row:1; }
  .affiliate-filter-fields input[type=date] { padding-inline:8px; }
  .affiliates-page .affiliate-filter-actions { gap:10px; margin-top:16px; padding-top:14px; }
  .affiliate-metrics.stat-grid-four { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .affiliate-metrics.stat-grid-four .stat-card:first-child { grid-column:auto; }
  .horse-page-tabs.tabs { gap:6px; padding:5px; }
  .horse-page-tabs.tabs > .tab { font-size:13px; min-height:50px; padding:10px 5px; }
}

/* ADMIN INVOICES */
.invoice-tabs.tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; margin-bottom:18px; }
.invoice-tabs .tab { text-align:center; }
.invoice-search { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px; margin-bottom:20px; }
.invoice-search .button { min-height:50px; }
.invoice-table { margin:0; }
.invoice-table table { min-width:840px; }
.invoice-table td:first-child { max-width:250px; }
.invoice-id { display:block; margin-top:6px; font-size:11px; overflow-wrap:anywhere; }
.invoice-paid-mark { display:flex; align-items:center; gap:7px; color:#24734e; font-weight:700; }
.invoice-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; font-size:12px; color:#637487; }
.invoice-pagination > div { display:flex; gap:8px; }
.invoice-approval-modal { max-width:520px; width:calc(100% - 24px); background:#fff; color:#273649; max-height:90svh; overflow-y:auto; }
.invoice-approval-summary { display:grid; gap:8px; padding:16px; border:1px solid #e2e8e4; border-radius:12px; background:#f8fbf9; margin:16px 0; }
.invoice-approval-summary b { font-size:24px; }
.invoice-approval-summary code { font-size:11px; overflow-wrap:anywhere; }
.invoice-approval-modal p { font-size:13px; line-height:1.6; color:#5a6b7c; }
@media(max-width:600px) { .invoice-search { grid-template-columns:minmax(0,1fr); } .invoice-tabs .tab { padding:10px 4px; font-size:13px; } .invoice-pagination { flex-wrap:wrap; } }

.admin-invoices-page > .stat-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.admin-invoices-page > .stat-grid .stat-card { padding:14px; min-width:0; }
.admin-invoices-page > .stat-grid .stat-card strong { font-size:26px; }
.invoice-user-paid { display:grid; place-items:center; gap:12px; padding:28px 16px; text-align:center; color:#246b49; }
.invoice-user-paid > .icon { width:48px; height:48px; }
.invoice-user-paid p { margin:0; font-size:14px; }

/* Spanish referral flyer and compact sharing card */
.referral-share-card { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(245px,.65fr); gap:18px; align-items:stretch; margin:12px 0 20px; padding:0; border:1px solid #cfe2d5; border-radius:20px; background:#f4fbf6; box-shadow:0 12px 30px rgba(24,78,48,.08); }
.referral-flyer { display:grid; gap:14px; min-width:0; padding:22px; border-radius:19px; color:#173b29; background:linear-gradient(145deg,#eaf8ed 0%,#f8fcf8 56%,#dff2e4 100%); }
.referral-flyer-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.referral-flyer-kicker { display:block; color:#236b49; font-size:10px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.referral-flyer h3 { margin:4px 0 3px; color:#123b26; font-size:clamp(20px,2.2vw,28px); font-weight:850; line-height:1.08; letter-spacing:-.04em; }
.referral-flyer-head p { max-width:430px; margin:0; color:#567263; font-size:12px; line-height:1.45; }
.referral-flyer-date { flex:0 0 auto; padding:6px 9px; border:1px solid #b8d8c0; border-radius:999px; color:#236b49; background:rgba(255,255,255,.7); font-size:10px; font-weight:800; white-space:nowrap; }
.referral-flyer-bonus { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; padding:10px 12px; border-radius:14px; color:#fff; background:linear-gradient(110deg,#257b51,#12583f); box-shadow:0 8px 16px rgba(18,88,63,.18); }
.referral-flyer-bonus span { font-size:11px; font-weight:700; }
.referral-flyer-bonus strong { font-size:25px; font-weight:850; line-height:1; letter-spacing:-.04em; }
.referral-flyer-bonus small { color:#d6f2dd; font-size:10px; font-weight:700; }
.referral-flyer-meta { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.referral-flyer-meta span { min-width:0; padding:9px 10px; border:1px solid #cfe5d4; border-radius:11px; background:rgba(255,255,255,.65); }
.referral-flyer-meta small, .referral-flyer-meta strong { display:block; }
.referral-flyer-meta small { color:#668174; font-size:9px; font-weight:700; overflow-wrap:anywhere; }
.referral-flyer-meta strong { margin-top:2px; overflow-wrap:anywhere; color:#174d31; font-size:13px; font-weight:850; line-height:1.2; }
.referral-flyer-section-title { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:6px; color:#245d3b; font-size:11px; font-weight:850; }
.referral-flyer-section-title small { color:#799286; font-size:9px; font-weight:700; }
.referral-flyer-plans ul { display:grid; gap:5px; margin:0; padding:0; list-style:none; }
.referral-flyer-plan { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; padding:7px 9px; border:1px solid #d5e8d9; border-radius:10px; background:rgba(255,255,255,.72); }
.referral-flyer-plan span { min-width:0; }
.referral-flyer-plan strong, .referral-flyer-plan small { display:block; overflow-wrap:anywhere; }
.referral-flyer-plan strong { color:#214c32; font-size:11px; font-weight:800; }
.referral-flyer-plan small { margin-top:1px; color:#71877a; font-size:10px; }
.referral-flyer-plan b { flex:0 0 auto; color:#18814f; font-size:12px; font-weight:850; }
.referral-flyer-more { display:block; margin-top:5px; color:#397151; font-size:10px; font-weight:800; text-align:right; }
.referral-flyer-empty { padding:8px; color:#71877a; font-size:11px; }
.referral-flyer-levels { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding-top:11px; border-top:1px solid #cfe5d4; color:#557564; font-size:10px; font-weight:700; }
.referral-flyer-levels strong { color:#236b49; font-size:11px; font-weight:850; text-align:right; }
.referral-share-controls { display:grid; align-content:center; gap:10px; min-width:0; padding:20px 18px 20px 0; }
.referral-share-copy { min-width:0; }
.referral-share-controls-title { color:#426351; font-size:12px; font-weight:800; }
.referral-share-preview { display:block; box-sizing:border-box; width:100%; min-height:132px; padding:11px 12px; border:1px solid #d3e5d8; border-radius:12px; outline:none; color:#415b4b; background:#fff; font:500 11px/1.5 Inter,system-ui,sans-serif; overflow-wrap:anywhere; white-space:pre-line; }
.referral-share-preview:focus { border-color:#81b695; box-shadow:0 0 0 3px #dcefe2; }
.referral-share-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.referral-share-button { display:flex; align-items:center; justify-content:center; gap:5px; min-width:0; min-height:44px; padding:7px 4px; border:1px solid #d6e5da; border-radius:11px; color:#26382d; background:#fff; font-size:11px; font-weight:800; text-decoration:none; transition:transform .15s ease,box-shadow .15s ease; }
.referral-share-button span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.referral-share-button:hover { transform:translateY(-1px); box-shadow:0 5px 14px rgba(24,56,37,.1); }
.referral-share-button img { flex:0 0 17px; width:17px; height:17px; }
.share-whatsapp img { filter:invert(39%) sepia(62%) saturate(562%) hue-rotate(86deg) brightness(94%) contrast(88%); }
.share-telegram img { filter:invert(48%) sepia(48%) saturate(656%) hue-rotate(162deg) brightness(91%) contrast(91%); }
.share-facebook img { filter:invert(27%) sepia(70%) saturate(1434%) hue-rotate(195deg) brightness(94%) contrast(95%); }
.referral-share-copy-message { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:42px; border:0; border-radius:11px; color:#fff; background:#236b49; font:700 12px/1.3 Inter,system-ui,sans-serif; cursor:pointer; }
.referral-share-copy-message:hover { background:#185738; }
.referral-share-copy-message .icon { width:17px; height:17px; }
.referral-share-facebook-note { color:#758078; font-size:10px; line-height:1.4; text-align:center; }
@media(max-width:900px) { .referral-share-card { grid-template-columns:minmax(0,1fr) minmax(220px,.72fr); gap:12px; } .referral-flyer { padding:18px; } .referral-share-controls { padding:18px 14px 18px 0; } .referral-flyer-meta { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) { .referral-share-card { grid-template-columns:minmax(0,1fr); gap:0; } .referral-flyer { border-radius:19px 19px 0 0; padding:17px 15px; } .referral-share-controls { padding:15px; } .referral-flyer-head { display:grid; gap:7px; } .referral-flyer-date { justify-self:start; } .referral-flyer-bonus { grid-template-columns:auto 1fr; } .referral-flyer-bonus small { grid-column:2; margin-top:-7px; } .referral-flyer-meta { gap:6px; } .referral-flyer-meta span { padding:8px; } .referral-flyer-levels { align-items:flex-start; flex-direction:column; gap:4px; } .referral-flyer-levels strong { text-align:left; } .referral-share-buttons { gap:6px; } .referral-share-button { min-height:42px; padding-inline:3px; font-size:10px; } .referral-share-button img { width:16px; height:16px; flex-basis:16px; } }


/* ===== GREEN ACCENT NORMALIZATION ===== */
.button:focus-visible, .icon-button:focus-visible, .nav-link:focus-visible, .tab:focus-visible, .quick-action:focus-visible, a:focus-visible { outline-color: rgba(18,100,72,.48); }
.button-gold { color: #fff; border-color: #126448; background: var(--gold-gradient); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 16px rgba(18,100,72,.2); }
.button-gold:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 22px rgba(18,100,72,.28); }
.button-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-deep); }
.button-ghost { color: var(--gold-deep); }
.button-ghost:hover:not(:disabled) { background: var(--gold-soft); }
.nav-link.is-active { color: #12583f; background: var(--gold-soft); }
.nav-link.is-active .icon { color: var(--gold-deep); }
.avatar, .profile-avatar { color: #fff; }
.quick-action-gold .qa-icon { color: #fff; border-color: #126448; background: var(--gold-gradient); box-shadow: 0 6px 14px rgba(18,100,72,.22); }
.quick-action:hover .qa-icon { border-color: var(--gold); }
.mining-bar i, .progress i, .progress-line i { background: linear-gradient(90deg, rgba(18,100,72,0), #198754, rgba(18,100,72,0)); }
.progress i, .progress-line i { background: linear-gradient(90deg, #42a875, #126448); }
.method-switch input:checked + span { color: #12583f; border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(18,100,72,.15); }
.method-switch input:checked + span .icon { color: var(--gold-deep); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(18,100,72,.16); }
.check-field input, .commission-row input[type=checkbox] { accent-color: var(--gold-deep); }
.form-hint { color: #315a43; background: var(--gold-soft); }
.hint-dot, .notice .icon { background: var(--gold-deep); color: var(--gold-deep); }
.notice .icon { background: transparent; }
.payment-status { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.profile-links .icon:first-child, .support-icon, .empty-mark, .admin-note-icon { color: var(--gold-deep); }
.notification-item.is-unread h3::after { background: var(--gold); }
.chart-wrap { color: var(--gold-deep); }
.chart-empty .icon { color: var(--gold); }
code { color: #315b43; background: var(--gold-soft); }
.loading-bar i { background: var(--gold); }
.force-password .modal-card { border-top-color: var(--gold); }
.checkin-stage-copy h3 strong, .r1-badge { color: var(--gold-deep); }
.r1-badge { background: var(--gold-soft); }
.track-lane { background: linear-gradient(90deg, transparent, rgba(18,100,72,.5), transparent); }
.track-lane::after { background: rgba(18,100,72,.2); }
.checkin-stage.is-complete .track::after { background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 16px var(--gold); }
.bottom-nav .nav-link.is-active { color: #12583f; }
.bottom-nav .nav-link.is-active::before { background: var(--gold-soft); }
.top-banner-cta { color: #fff; background: var(--gold-gradient); box-shadow: 0 6px 14px rgba(18,100,72,.28); }
.qg-icon { color: var(--gold-deep); background: linear-gradient(180deg, #f6fbf2, #e3efdf); box-shadow: inset 0 0 0 1px rgba(18,100,72,.2); }
.qg-item.is-gold .qg-icon { color: #fff; background: var(--gold-gradient); box-shadow: 0 8px 16px rgba(18,100,72,.25), inset 0 1px 0 rgba(255,255,255,.2); }
.qg-item:hover .qg-icon { box-shadow: 0 8px 16px rgba(18,100,72,.18), inset 0 0 0 1px rgba(18,100,72,.28); }
.bal-card .mining-bar { background: rgba(18,100,72,.16); }
.checkin-strip-copy small { color: var(--gold-deep); }
.checkin-strip.is-ready .checkin-strip-cta { color: #fff; background: var(--gold-gradient); box-shadow: 0 6px 12px rgba(18,100,72,.24); }
.payment-checkout-back { color: #126448; background: #e8f4ec; }
.payment-checkout-card::before { background: linear-gradient(90deg, #42a875, #126448); }
.payment-checkout-status-dot.is-success { background: #198754; box-shadow: 0 0 0 4px #e7f2eb; }

/* The admin area stays light, high-contrast, and uses green only for accents. */
.admin-frame { --gold: #198754; --gold-bright: #86cba5; --gold-deep: #126448; --gold-soft: #e7f2eb; --gold-gradient: linear-gradient(180deg,#42a875 0%,#126448 100%); --line-strong: #c7dcc9; }
.admin-frame .nav-link.is-active { color: #126448; background: #e7f2eb; }
.admin-frame .nav-link.is-active .icon { color: #126448; }
.admin-frame .button-gold { color: #fff; border-color: #126448; background: var(--gold-gradient); box-shadow: 0 6px 16px rgba(18,100,72,.18); }
.admin-frame .button-gold:hover:not(:disabled) { box-shadow: 0 10px 22px rgba(18,100,72,.24); }
.admin-frame :focus-visible { outline-color: rgba(18,100,72,.48); }

/* Official support groups: compact, light, and readable on narrow screens. */
.official-support { display: grid; gap: 18px; }
.official-support > .panel { padding: 16px; }
.official-support .section-heading { align-items: center; margin-bottom: 2px; }
.official-support .section-heading h2 { margin: 0; color: #153c2c; font-size: 19px; font-weight: 800; line-height: 1.25; }
.official-support > .button { justify-self: start; }
.official-support .button-wide { min-height: 46px; }
.official-support .button.is-unavailable, .official-group .button.is-unavailable { color: #66766c; border-color: #d7e1d8; background: #f2f6f2; box-shadow: none; cursor: not-allowed; }
.official-groups { display: grid; gap: 10px; }
.official-groups > h2 { margin: 0 0 2px; color: #153c2c; font-size: 19px; font-weight: 800; line-height: 1.25; }
.official-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 11px 12px; border: 1px solid #d7e5d7; border-radius: 14px; color: #1d3327; background: linear-gradient(135deg, #fbfef9, #f0f7ef); box-shadow: 0 2px 8px rgba(18,100,72,.06); }
.official-country { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; font-weight: 800; }
.country-flag { display: inline-grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 9px; background: #e7f2eb; font-size: 18px; line-height: 1; }
.official-group .button { flex: 0 0 auto; min-height: 38px; padding: 0 13px; border-radius: 10px; font-size: 12px; }
.official-group.is-unavailable { border-style: dashed; color: #66766c; background: #f6faf6; box-shadow: none; }
.official-group.is-unavailable .country-flag { opacity: .72; }
.group-unavailable { color: #6a786e; font-size: 12px; font-weight: 700; }
@media (max-width: 520px) {
  .official-support { gap: 14px; }
  .official-groups { gap: 8px; }
  .official-groups > h2 { font-size: 18px; }
  .official-group { min-height: 56px; padding: 10px; }
  .official-country { font-size: 13px; }
  .official-group .button { min-height: 36px; padding-inline: 11px; }
}

/* Payment loading overlay: local real gallop strips, no external assets. */
html.payment-loading-active, body.payment-loading-active { overflow: hidden; overscroll-behavior: none; }
.payment-loading-overlay { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 24px; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.98) 0 16%, rgba(231,242,235,.97) 58%, rgba(205,229,213,.98) 100%); opacity: 0; visibility: hidden; pointer-events: none; touch-action: none; transition: opacity .18s ease, visibility .18s ease; }
.payment-loading-overlay::before, .payment-loading-overlay::after { position: absolute; border: 1px solid rgba(18,100,72,.1); border-radius: 50%; content: ''; pointer-events: none; }
.payment-loading-overlay::before { width: min(78vw, 620px); aspect-ratio: 1; box-shadow: 0 0 0 28px rgba(18,100,72,.035), 0 0 0 58px rgba(18,100,72,.025); }
.payment-loading-overlay::after { width: min(48vw, 360px); aspect-ratio: 1; border-color: rgba(66,168,117,.15); }
.payment-loading-overlay:not([hidden]).is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.payment-loading-panel { position: relative; z-index: 1; display: grid; justify-items: center; gap: 9px; width: min(100%, 360px); padding: 22px 24px 20px; border: 1px solid rgba(18,100,72,.12); border-radius: 24px; background: rgba(255,255,255,.82); box-shadow: 0 18px 48px rgba(18,72,43,.13), inset 0 1px 0 rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.payment-loading-horse-stage { position: relative; width: min(100%, 290px); height: 150px; overflow: hidden; }
.payment-loading-horse { position: absolute; bottom: 16px; display: block; height: auto; aspect-ratio: 1.5674; background-repeat: no-repeat; background-position: 0 0; background-size: 1400% 100%; filter: drop-shadow(0 9px 5px rgba(18,72,43,.18)); will-change: background-position, transform; }
.payment-loading-horse--front { right: 1%; width: 178px; background-image: url('/assets/horses/negro-run-sm.webp'); animation: payment-loading-negro .583333s steps(14) infinite, payment-loading-bob 1.166666s ease-in-out infinite; }
.payment-loading-horse--back { left: 0; bottom: 25px; width: 132px; aspect-ratio: 1.6375; background-image: url('/assets/horses/castanho-run-sm.webp'); background-size: 1000% 100%; animation: payment-loading-castanho .416666s steps(10) infinite, payment-loading-bob .833333s ease-in-out -.18s infinite; opacity: .88; }
.payment-loading-message { color: #126448; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
@keyframes payment-loading-negro { from { background-position: 0 0; } to { background-position: 107.6923077% 0; } }
@keyframes payment-loading-castanho { from { background-position: 0 0; } to { background-position: 111.1111111% 0; } }
@keyframes payment-loading-bob { 0%,100% { transform: translateY(1px); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .payment-loading-horse--front, .payment-loading-horse--back { animation-play-state: paused; }
  .payment-loading-overlay { transition: none; }
}
@media (max-width: 420px) {
  .payment-loading-overlay { padding: 16px; }
  .payment-loading-panel { padding: 18px 16px 17px; border-radius: 20px; }
  .payment-loading-horse-stage { height: 130px; }
  .payment-loading-horse--front { width: 156px; }
  .payment-loading-horse--back { width: 116px; }
  .payment-loading-message { font-size: 16px; }
}

.signup-bonus-note { padding:14px 16px; margin:0 0 18px; border:1px solid #cce3d5; border-radius:14px; background:#eef7f1; color:#145d40; }
.signup-bonus-note strong { display:block; font-size:15px; }
.signup-bonus-note p { margin:5px 0 0; font-size:13px; line-height:1.5; }
.withdrawal-requirements h3 { margin:0; font-size:18px; }
.withdrawal-requirements p { margin:6px 0 16px; font-size:14px; color:var(--muted); }
.withdrawal-requirement { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid #e0e9e3; font-size:13px; }
.withdrawal-requirement strong { color:#145d40; }
.withdrawal-requirements .button-cluster { margin-top:16px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.withdrawal-requirements .button-cluster .button { padding-inline:10px; font-size:13px; }
