/* Write2Earn design system — mobile first. Navy + orange on clean white. */
:root {
  --navy-900: #0b1736;
  --navy-800: #13224a;
  --navy-700: #1c2f60;
  --navy-100: #e7ebf5;
  --orange: #f26b1d;
  --orange-600: #d9560c;
  --orange-50: #fff3eb;
  --ink: #142037;
  --ink-2: #4a5670;
  --ink-3: #7a849a;
  --line: #e4e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #138a4f;
  --ok-bg: #e6f6ee;
  --warn: #a35f00;
  --warn-bg: #fff4dc;
  --bad: #c4302b;
  --bad-bg: #fdecec;
  --info: #1f5fbf;
  --info-bg: #e8f0fd;
  --muted-bg: #eef1f6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 28, 61, .06), 0 4px 16px rgba(16, 28, 61, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; color: var(--navy-900); }
h1 { font-size: 1.5rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid rgba(242, 107, 29, .45); outline-offset: 2px; border-radius: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-900); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d0dd; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f2c4c2; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--ink-2); }
.badge-orange { background: var(--orange-50); color: var(--orange-600); }

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.stack > * + * { margin-top: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-label { color: var(--ink-3); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: .4rem; }
.stat-value { font-size: 1.45rem; font-weight: 750; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .82rem; color: var(--ink-3); }
.stat-accent .stat-value { color: var(--orange-600); }

.hero-card { background: var(--navy-800); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card h1, .hero-card h2, .hero-card .stat-value { color: #fff; }
.hero-card .stat-label, .hero-card .muted { color: #b8c2dc; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(242, 107, 29, .18); }

/* Progress */
.progress { height: 10px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--orange); border-radius: 99px; transition: width .6s ease; }
.hero-card .progress { background: rgba(255, 255, 255, .15); }
.steps { display: flex; gap: .4rem; }
.steps span { flex: 1; height: 8px; border-radius: 99px; background: var(--muted-bg); }
.steps span.on { background: var(--orange); }

/* Alerts */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .92rem; margin-bottom: 1rem; }
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--ok-bg); border-color: #bfe6d1; color: #0e5e37; }
.alert-error { background: var(--bad-bg); border-color: #f5c6c4; color: #8f1f1b; }
.alert-info { background: var(--info-bg); border-color: #c7d9f7; color: #17478f; }
.alert-warn { background: var(--warn-bg); border-color: #f3dca6; color: #6e4200; }

/* Forms */
.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; }
.field .err { font-size: .82rem; color: var(--bad); margin-top: .3rem; }
.input, select, textarea { width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1px solid #cfd6e3; border-radius: 10px; font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 107, 29, .18); }
.has-error .input, .has-error select, .has-error textarea { border-color: var(--bad); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--orange); flex: none; }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { flex: 1 1 140px; }
.filters .field label { font-size: .78rem; color: var(--ink-3); }

/* Tables (cards on mobile) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.1rem; padding: 0 1.1rem; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 650; padding: .6rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .75rem; margin-bottom: .6rem; background: #fff; }
  .table.responsive td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--ink-3); font-size: .78rem; font-weight: 600; text-align: left; flex: none; }
  .table.responsive td.num { justify-content: space-between; }
  .table-wrap { margin: 0; padding: 0; }
}

.kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .45rem 1rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-3); }
.empty .ic { width: 40px; height: 40px; margin: 0 auto .5rem; color: #b5bdcc; }
.empty p { margin: .25rem 0 .9rem; }

/* App shell */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--navy-900); color: #cfd6ea; display: flex; flex-direction: column; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; }
.sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; color: #fff; font-weight: 800; font-size: 1.1rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }
.brand-name b { color: var(--orange); }
.nav { padding: .4rem .7rem 1rem; overflow-y: auto; flex: 1; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7d89a8; padding: .9rem .6rem .35rem; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .7rem; border-radius: 9px; color: #cfd6ea; font-weight: 550; font-size: .93rem; text-decoration: none; min-height: 42px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(242, 107, 29, .16); color: #fff; }
.nav a.active .ic { color: var(--orange); }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .45rem; font-weight: 700; }
.sidebar-foot { padding: .9rem 1.2rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.scrim { position: fixed; inset: 0; background: rgba(8, 15, 35, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 60px; }
.topbar .title { font-weight: 700; color: var(--navy-900); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; position: relative; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-100); color: var(--navy-800); display: grid; place-items: center; font-weight: 750; font-size: .9rem; flex: none; }
.content { padding: 1rem; max-width: 1200px; margin: 0 auto; padding-bottom: 5.5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--ink-3); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: .7rem; color: var(--ink-3); font-weight: 600; text-decoration: none; min-height: 56px; justify-content: center; }
.bottom-nav a.active { color: var(--orange-600); }
.bottom-nav .ic { width: 22px; height: 22px; }
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .main { margin-left: 260px; }
  .menu-toggle, .bottom-nav, .sidebar .close-nav { display: none !important; }
  .scrim { display: none; }
  .content { padding: 1.5rem 2rem 3rem; }
  h1 { font-size: 1.7rem; }
}
.admin .sidebar { background: #0f1a2e; }
.admin .content { padding-bottom: 2rem; }

/* Public site */
.pub-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pub-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.pub-header .brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--navy-900); font-size: 1.1rem; text-decoration: none; margin-right: auto; }
.pub-nav { display: none; gap: 1.4rem; }
.pub-nav a { color: var(--ink-2); font-weight: 600; }
@media (min-width: 800px) { .pub-nav { display: flex; } }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.hero { background: var(--navy-900); color: #fff; padding: 3rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(242, 107, 29, .16); right: -140px; top: -160px; }
.hero h1 { color: #fff; font-size: 2rem; max-width: 640px; letter-spacing: -.01em; }
.hero h1 span { color: var(--orange); }
.hero p.lead { color: #c3cbe0; font-size: 1.05rem; max-width: 560px; margin-bottom: 1.5rem; }
.hero .eyebrow { display: inline-block; background: rgba(242, 107, 29, .18); color: #ffb98e; padding: .25rem .7rem; border-radius: 99px; font-size: .8rem; font-weight: 700; margin-bottom: 1rem; }
@media (min-width: 800px) { .hero { padding: 5rem 0; } .hero h1 { font-size: 2.8rem; } }
.section { padding: 3rem 0; }
.section-head { max-width: 640px; margin-bottom: 1.6rem; }
.section-head .kicker { color: var(--orange-600); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange-600); flex: none; }
.product-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.product-media { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--navy-100), #fff); display: grid; place-items: center; color: var(--navy-700); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .ic { width: 64px; height: 64px; opacity: .55; }
.product-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.price { font-size: 1.4rem; font-weight: 800; color: var(--navy-900); }
.pub-footer { background: var(--navy-900); color: #aeb8d3; padding: 2.2rem 0; font-size: .9rem; }
.pub-footer a { color: #fff; }
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.45rem; }
.rank-table td, .rank-table th { white-space: nowrap; }
.rank-row-current { background: var(--orange-50); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.timeline li:last-child { border: 0; }
.dotm { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); margin-top: .4rem; flex: none; }

/* Modal / popup */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; background: rgba(8, 15, 35, .55); padding: 0; animation: fade .2s ease; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 1.3rem; max-height: 90vh; overflow-y: auto; animation: rise .25s ease; }
@media (min-width: 640px) { .modal { place-items: center; padding: 1rem; } .modal-card { border-radius: 18px; } }
.modal-card img { border-radius: 12px; margin-bottom: 1rem; max-height: 220px; width: 100%; object-fit: cover; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.tabs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: 2px; }
.tabs a { padding: .5rem .9rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .86rem; white-space: nowrap; text-decoration: none; min-height: 38px; display: inline-flex; align-items: center; }
.tabs a.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.pager-btns { display: flex; gap: .4rem; }
.copybox { display: flex; gap: .5rem; }
.copybox .input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
details.more summary { cursor: pointer; color: var(--orange-600); font-weight: 600; font-size: .9rem; min-height: 32px; }
.inline-form { display: inline; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; border: 0; }
.legal h2 { margin-top: 1.5rem; }
.req::after { content: " *"; color: var(--bad); }

/* ---- Member area: legacy-style plan layout ---- */
.nav-sub summary { list-style: none; display: flex; align-items: center; gap: .7rem; padding: .62rem .7rem; border-radius: 9px; color: #cfd6ea; font-weight: 550; font-size: .93rem; cursor: pointer; min-height: 42px; }
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid #7d89a8; border-bottom: 2px solid #7d89a8; transform: rotate(-45deg); transition: transform .15s; }
.nav-sub[open] summary::after { transform: rotate(45deg); }
.nav-sub summary:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-sub summary .count { margin-left: auto; margin-right: .4rem; }
.nav-sub a { padding-left: 2.75rem; min-height: 38px; font-size: .88rem; position: relative; }
.nav-sub a::before { content: ""; position: absolute; left: 1.55rem; width: 6px; height: 6px; border-radius: 50%; background: #4b587a; }
.nav-sub a.active::before { background: var(--orange); }

.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 1.4rem 0 .6rem; }
.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.stat-card { display: flex; align-items: center; gap: .8rem; padding: .95rem; text-decoration: none !important; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 28, 61, .1); }
.stat-card .stat-value { font-size: 1.15rem; }
.stat-card .stat-label { font-size: .72rem; }
@media (min-width: 768px) { .stat-card .stat-value { font-size: 1.3rem; } }
.sc-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.sc-ic .ic { width: 22px; height: 22px; }
.sc-orange { background: #fff1e7; color: #e2600f; } .sc-blue { background: #e8f0fd; color: #1f5fbf; } .sc-green { background: #e6f6ee; color: #138a4f; }
.sc-pink { background: #fde8f1; color: #c2185b; } .sc-amber { background: #fff4dc; color: #a35f00; } .sc-teal { background: #e0f6f4; color: #0f7f74; }
.sc-purple { background: #efe9fc; color: #6a3fc8; } .sc-navy { background: #e7ebf5; color: #13224a; }

.welcome { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; border: 0; }
.welcome h1, .welcome .mono { color: #fff; }
.welcome .muted { color: #b8c2dc; }
.welcome-main { display: flex; gap: .9rem; align-items: center; }
.avatar-lg { width: 54px; height: 54px; font-size: 1.3rem; background: var(--orange); color: #fff; }
.welcome-ref { flex: 1 1 320px; max-width: 520px; }
.welcome-ref .input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.activate-banner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--orange-50); border: 1px solid #f7c9a9; }
.activate-banner p { color: var(--ink-2); }

.pay-box { text-align: center; }
.pay-amount { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .8rem; }
.pay-amount b { font-size: 1.9rem; color: var(--navy-900); }
.qr-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem; border: 2px dashed #f2b48a; border-radius: 16px; background: #fff; margin-bottom: .9rem; }
.qr, .qr img, .qr canvas { width: 220px; height: 220px; display: block; }
.upi-app-btn { margin-bottom: .2rem; }
@media (min-width: 1024px) { .upi-app-btn { display: none; } }
.steps-text { background: var(--bg); padding: .6rem .8rem; border-radius: 10px; }
.how-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .8rem; }
.how-steps li b { display: block; }
.how-steps li span { color: var(--ink-3); font-size: .88rem; }
.product-line { display: flex; gap: 1rem; align-items: center; }
.activation-ok { display: flex; gap: .9rem; align-items: center; }

.team-head { text-align: center; }
.team-total { font-size: 2rem; font-weight: 800; color: var(--navy-900); }
.team-total span { font-size: 1.1rem; font-weight: 650; color: var(--ink-2); }
.team-split { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; justify-content: center; margin: .3rem 0 .9rem; font-size: .92rem; }
.ts { display: inline-flex; align-items: center; gap: .3rem; }
.ts .ic { width: 16px; height: 16px; }
.ts-ok { color: var(--ok); } .ts-bad { color: var(--bad); }
.team-tabs { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.team-tabs a { padding: .45rem .95rem; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .86rem; text-decoration: none; }
.team-tabs a.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.level-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: 4px; }
.level-chip { flex: none; display: flex; flex-direction: column; min-width: 92px; padding: .55rem .75rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none !important; color: var(--ink); }
.level-chip span { font-size: .72rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }
.level-chip b { font-size: 1.2rem; color: var(--navy-900); }
.level-chip small { color: var(--ok); font-size: .74rem; }
.level-chip.active { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(242, 107, 29, .2); }

.tree-scroll { overflow: auto; padding: .5rem 0 1rem; }
.tree { display: inline-block; min-width: 100%; text-align: center; white-space: nowrap; }
.tree ul { position: relative; display: flex; justify-content: center; padding: 20px 0 0; margin: 0; }
.tree li { list-style: none; position: relative; padding: 20px 6px 0; text-align: center; }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 20px; border-top: 2px solid #cfd6e3; }
.tree li::after { right: auto; left: 50%; border-left: 2px solid #cfd6e3; }
.tree li:only-child::before, .tree li:only-child::after { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0; }
.tree li:last-child::before { border-right: 2px solid #cfd6e3; border-radius: 0 6px 0 0; }
.tree li:first-child::after { border-radius: 6px 0 0 0; }
.tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid #cfd6e3; }
.tree > ul { padding-top: 0; }
.tnode { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: .55rem .7rem; min-width: 108px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none !important; color: var(--ink); }
.tnode:hover { border-color: var(--orange); }
.tav { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.tnode.on .tav { background: var(--ok); } .tnode.off .tav { background: #c3cad8; }
.tname { font-weight: 650; font-size: .8rem; } .tid { font-size: .72rem; font-family: ui-monospace, Consolas, monospace; color: var(--ink-2); } .tmeta { font-size: .66rem; color: var(--ink-3); }
.tnode.more { min-width: 0; font-size: .8rem; color: var(--orange-600); font-weight: 650; }
.tree-legend { display: flex; gap: .5rem; align-items: center; color: var(--ink-3); }
.tdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: .5rem; } .tdot.on { background: var(--ok); } .tdot.off { background: #c3cad8; }

/* ---- Pools ---- */
.pool-status { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.pool-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .pool-grid { grid-template-columns: repeat(3, 1fr); } }
.pool-card { display: flex; flex-direction: column; gap: .7rem; border-top: 3px solid #d7dceb; }
.pool-card.pool-in { border-top-color: var(--orange); }
.pool-top { display: flex; align-items: center; gap: .7rem; }
.pool-top .badge { margin-left: auto; }
.pool-no { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--navy-700), #3b4fa0); flex: none; }
.pool-in .pool-no { background: linear-gradient(135deg, #f26b1d, #ff9a4d); }
.pool-kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: 0; font-size: .88rem; }
.pool-kv dt { color: var(--ink-3); } .pool-kv dd { margin: 0; text-align: right; font-weight: 650; }
.pool-actions { margin-top: auto; }
.entry-list { display: grid; gap: .5rem; }
.entry-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; justify-content: space-between; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.slots { display: flex; align-items: center; gap: .35rem; }
.slot { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed #c3cad8; }
.slot.on { border: 0; background: linear-gradient(135deg, #f26b1d, #ff9a4d); }

/* ---- News ticker, admin view bar, banner popup ---- */
.news-ticker { display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; font-size: .88rem; }
.news-label { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; background: var(--orange); color: #fff; font-weight: 700; flex: none; }
.news-label .ic { width: 16px; height: 16px; }
.news-track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.news-items { display: inline-flex; white-space: nowrap; animation: news-scroll 30s linear infinite; }
.news-ticker:hover .news-items { animation-play-state: paused; }
.news-item { padding: 0 2.2rem 0 0; color: var(--navy-800); font-weight: 550; }
.news-item::before { content: "◆"; color: var(--orange); margin-right: .6rem; font-size: .7em; }
@keyframes news-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .news-items { animation: none; } .news-track { overflow-x: auto; } }
.admin-view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .5rem 1rem; background: #fff4dc; color: #6e4200; border-bottom: 1px solid #f3dca6; font-size: .88rem; }
.admin-view-bar form { margin-left: auto; }
.banner-card { position: relative; padding-top: 1.1rem; }
.banner-card img { max-height: 340px; }
.modal-x { position: absolute; top: .6rem; right: .6rem; width: 36px; height: 36px; background: rgba(255, 255, 255, .9); z-index: 1; }

/* ---- Colour refresh for the member panel ---- */
body { background: #f3f5fb; }
.sidebar { background: linear-gradient(180deg, #0b1736 0%, #16265a 55%, #24307a 100%); }
.nav a.active, .nav-sub a.active { background: linear-gradient(90deg, rgba(242, 107, 29, .28), rgba(242, 107, 29, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.topbar { border-bottom: 0; box-shadow: 0 1px 0 var(--line), 0 3px 0 -1px rgba(242, 107, 29, .25); }
.page-head h1 { position: relative; padding-bottom: .35rem; }
.page-head h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--orange), #ffb27a); }
.stat-card { border-top: 3px solid transparent; }
.stat-card:has(.sc-orange) { border-top-color: #f26b1d; } .stat-card:has(.sc-blue) { border-top-color: #3d7be0; }
.stat-card:has(.sc-green) { border-top-color: #1fa463; } .stat-card:has(.sc-pink) { border-top-color: #e04a8a; }
.stat-card:has(.sc-amber) { border-top-color: #e3a21a; } .stat-card:has(.sc-teal) { border-top-color: #17a497; }
.stat-card:has(.sc-purple) { border-top-color: #7c4fe0; } .stat-card:has(.sc-navy) { border-top-color: #1c2f60; }
.welcome { background: linear-gradient(120deg, #0b1736 0%, #1c2f60 60%, #3a2a6e 100%); }
.btn-primary { background: linear-gradient(135deg, #f26b1d, #ff8a3d); }
.btn-primary:hover { background: linear-gradient(135deg, #d9560c, #f26b1d); }
.bottom-nav a.active { color: var(--orange-600); }
.bottom-nav a.active .ic { filter: drop-shadow(0 2px 4px rgba(242, 107, 29, .35)); }
.table th { background: #f7f8fc; }
.ad-banner img { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.task-card { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; border-left: 4px solid #e04a8a; }
.task-body { flex: 1 1 200px; }

/* ---- Dashboard journey & pool infographics ---- */
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; position: relative; }
.journey::before { content: ""; position: absolute; top: 21px; left: 10%; right: 10%; height: 3px; background: var(--line); z-index: 0; }
.journey li { position: relative; z-index: 1; text-align: center; }
.journey a { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-decoration: none !important; color: var(--ink); }
.jdot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #fff; border: 3px solid var(--line); color: var(--ink-3); }
.jdot .ic { width: 20px; height: 20px; }
.journey b { font-size: .82rem; } .journey small { font-size: .72rem; color: var(--ink-3); }
.journey li.done .jdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.journey li.now .jdot { border-color: var(--orange); color: var(--orange-600); box-shadow: 0 0 0 5px rgba(242, 107, 29, .15); }
.journey li.now b { color: var(--orange-600); }
@media (max-width: 560px) { .journey { grid-template-columns: 1fr; gap: .2rem; } .journey::before { display: none; } .journey a { flex-direction: row; text-align: left; gap: .7rem; } .jdot { width: 36px; height: 36px; flex: none; } .journey small { margin-left: auto; } }
.legs { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .6rem 0 .8rem; }
.leg, .leg-me { width: 74px; height: 74px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; }
.leg { border: 2px dashed #c3cad8; color: var(--ink-3); }
.leg.on { border: 0; background: var(--ok); color: #fff; }
.leg-me { background: linear-gradient(135deg, var(--navy-800), #3a2a6e); color: #fff; }
.leg small, .leg-me small { font-size: .65rem; font-weight: 600; opacity: .85; }
.pn-row { display: flex; align-items: center; gap: 1rem; }
.slots.big .slot { width: 34px; height: 34px; }
.pool-table .pool-name { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--navy-900); }
.pool-table .pool-no { width: 30px; height: 30px; font-size: .85rem; border-radius: 9px; }
.pool-row.pool-locked td { color: var(--ink-3); }
.pool-row.pool-running { background: #fff7f1; }
.pool-row.pool-running .pool-no { background: linear-gradient(135deg, #f26b1d, #ff9a4d); }
.pool-row.pool-done .pool-no { background: var(--ok); }
/* Cards inside grids must line up: the stacked-card spacing applies only outside grids. */
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card, .stat-grid > .card, .pool-grid > .card, .grid > .card { margin-top: 0; }
.grid-2, .grid-3, .grid-4 { align-items: stretch; }
