:root {
  --basalt: #14212a; --stone: #eceeed; --slate: #56666e;
  --verdigris: #2b7a6e; --line: #cfd5d4;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--stone); color: var(--basalt);
  font-family: "Public Sans", system-ui, sans-serif; font-size: 15px; line-height: 1.5;
}
h1, .brand { font-family: "Bricolage Grotesque", system-ui, sans-serif; margin: 0; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.strata {
  background: linear-gradient(to bottom,
    #1b2c36 0 22%, #18262f 22% 31%, #22363f 31% 52%,
    #2b7a6e 52% 55%, #1b2c36 55% 70%, #c8992e 70% 72%, #14212a 72% 100%);
  color: #fff; padding: 28px 24px 56px;
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.strata h2, .strata p { display: none; }
.panel { display: flex; justify-content: center; padding: 32px 24px 48px; }
.box { width: 100%; max-width: 380px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.sub { margin: 8px 0 28px; color: var(--slate); }
button, input { font: inherit; }
label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; font-weight: 400;
}
.hint { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--slate); }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 6px;
  background: var(--basalt); color: #fff; font-weight: 500; cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-out {
  padding: 10px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; font-weight: 500; cursor: pointer;
}
a, .link {
  color: var(--basalt); font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
}
.link { background: none; border: 0; padding: 0; cursor: pointer; }
.msg { padding: 10px 12px; border-radius: 6px; font-size: 14px; margin: 0 0 16px; }
.msg.error { background: #fdecec; color: #8a1f1f; }
.msg.ok { background: #e6f4ee; color: #17513f; }
.switch { margin-top: 28px; color: var(--slate); }
.hidden { display: none !important; }
.banner { background: #8a1f1f; color: #fff; padding: 12px 16px; text-align: center; font-size: 14px; }
.dash { max-width: 640px; margin: 0 auto; padding: 56px 24px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--verdigris); outline-offset: 2px; }
@media (min-width: 800px) {
  .layout { grid-template-columns: 1.1fr 1fr; }
  .strata { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
  .strata h2 { display: block; margin: 0; font-family: "Bricolage Grotesque", sans-serif; font-size: 36px; font-weight: 600; line-height: 1.15; max-width: 440px; }
  .strata p { display: block; margin: 16px 0 0; color: rgba(255,255,255,.7); max-width: 400px; }
  .panel { align-items: center; padding: 48px 24px; }
}

/* ---------- password eye ---------- */
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-btn { position: absolute; right: 2px; top: 6px; bottom: 0; width: 42px; display: grid; place-items: center; background: none; border: 0; color: var(--slate); cursor: pointer; border-radius: 6px; }
.pw-btn:hover { color: var(--basalt); }
.pw-btn:focus-visible { outline: 2px solid var(--verdigris); }
select { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-weight: 400; color: var(--basalt); }
select:focus-visible { outline: 2px solid var(--verdigris); outline-offset: 2px; }
input[readonly] { background: #f5f6f5; color: var(--slate); }

/* ---------- investment dashboard ---------- */
html { scroll-padding-top: 110px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.head { position: sticky; top: 0; z-index: 5; }
.bar { background: var(--basalt); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.bar .brand { color: #fff; }
.bar .btn-out { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); padding: 7px 16px; }
.bar .btn-out:hover { background: rgba(255,255,255,.1); }
.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.subnav a { color: var(--slate); text-decoration: none; padding: 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--basalt); }
.subnav a.on { color: var(--basalt); border-bottom-color: var(--verdigris); }
.main { padding-top: 28px; padding-bottom: 56px; }
.top { margin-bottom: 20px; }
.top h1 { font-size: 26px; }
.top .sub { margin: 4px 0 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.stats { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 14px; font: 600 16px "Bricolage Grotesque", sans-serif; }
.lbl { color: var(--slate); font-size: 13px; }
.mid { font: 600 22px "Bricolage Grotesque", sans-serif; margin-top: 4px; overflow-wrap: anywhere; }
.code { display: flex; gap: 8px; margin: 10px 0 14px; }
.code input { margin: 0; font: 600 18px "Bricolage Grotesque", sans-serif; letter-spacing: .12em; text-align: center; }
.code .btn-out { white-space: nowrap; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: min(92vw, 380px); color: var(--basalt); }
dialog::backdrop { background: rgba(20,33,42,.5); }
dialog h3 { margin: 0 0 12px; font: 600 20px "Bricolage Grotesque", sans-serif; }
.prow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0ef; font-size: 14px; }
.prow span:first-child { color: var(--slate); }
.prow span:last-child { text-align: right; overflow-wrap: anywhere; }
.dlg-actions { display: flex; gap: 10px; margin-top: 20px; }
.dlg-actions .btn-primary { flex: 1; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px) { .cols { grid-template-columns: 2fr 1fr; } }

/* ---------- shared pages: invest + profile ---------- */
a.btn-out { display: inline-block; text-decoration: none; }
a.btn-out:hover { background: #f5f6f5; }
.bar .btn-out:hover { background: rgba(255,255,255,.1); }
.conv { margin-top: 2px; font-size: 14px; color: var(--slate); overflow-wrap: anywhere; }
.narrow { max-width: 640px; }
.card + .card { margin-top: 16px; }
.card .btn-primary { width: auto; padding: 12px 24px; }
.field-note { min-height: 20px; }
.empty { margin: 0; color: var(--slate); }

/* ---------- deposit ---------- */
a.btn-primary { display: inline-block; text-align: center; text-decoration: none; color: #fff; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 12px 16px; color: var(--slate); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--basalt); }
.tab[aria-selected="true"] { color: var(--basalt); border-bottom-color: var(--verdigris); }
.tab:focus-visible { outline: 2px solid var(--verdigris); outline-offset: -2px; }
.qr { display: block; width: 100%; max-width: 240px; margin: 4px auto 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.addr { display: flex; gap: 8px; margin: 6px 0 12px; }
.addr input { margin: 0; font-size: 14px; }
.addr .btn-out { white-space: nowrap; }
.apps { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; }
.apps legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.app { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; }
.app input { width: auto; margin: 0; accent-color: var(--verdigris); }
.app:has(input:checked) { border-color: var(--verdigris); box-shadow: 0 0 0 1px var(--verdigris); }
.app:has(input:focus-visible) { outline: 2px solid var(--verdigris); outline-offset: 2px; }

/* ---------- loading spinner ---------- */
.spin { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spin.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* ---------- admin ---------- */
.arow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0ef; font-size: 14px; }
.arow:last-child { border-bottom: 0; }
.arow small { display: block; color: var(--slate); margin-top: 2px; overflow-wrap: anywhere; }
.arow .btns { display: flex; gap: 6px; flex-shrink: 0; }
.arow .btn-out { padding: 6px 12px; font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #e6f4ee; color: #17513f; font-size: 12px; margin-left: 6px; }
.tag.off { background: #eceeed; color: var(--slate); }

/* ---------- live dot ---------- */
.live-dot { display: inline-block; width: 9px; height: 9px; margin: 0 2px; border-radius: 50%; background: #22c55e; vertical-align: middle; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; box-shadow: 0 0 6px #22c55e; } 50% { opacity: .2; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation-duration: 3s; } }

/* ---------- sign out (red) ---------- */
.btn-danger { padding: 10px 16px; background: #c62828; color: #fff; border: 1px solid #c62828; border-radius: 6px; font-weight: 500; cursor: pointer; }
.btn-danger:hover { background: #a61f1f; border-color: #a61f1f; }
.btn-danger:focus-visible { outline: 2px solid #c62828; outline-offset: 2px; }

/* ---------- referral rules ---------- */
.rules { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 10px; }
.reward { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font: 600 28px "Bricolage Grotesque", sans-serif; }
.reward small { font: 400 14px "Public Sans", sans-serif; color: var(--slate); }
