:root {
  color-scheme: dark;
  --paper:        #0a0f12;
  --surface:      #111820;
  --surface-2:    #18232b;
  --ink:          #e8f0f2;
  --ink-2:        #c4d4d9;
  --muted:        #7a9099;
  --line:         #1e2e35;
  --line-2:       #253540;
  --ice:          #152028;
  --ocean:        #3db8bb;
  --ocean-dim:    #2a8a8c;
  --ocean-bright: #72dfe0;
  --coral:        #f06b55;
  --sun:          #f0b432;
  --green:        #3dbf82;
  --focus:        #5ddcde;
  --shadow-sm:    0 2px 8px rgba(0,0,0,.28);
  --shadow:       0 8px 32px rgba(0,0,0,.38);
  --shadow-lg:    0 20px 60px rgba(0,0,0,.5);
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --sidebar-w:    228px;
  --topbar-h:     60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); line-height: 1.5; }
button, input, textarea, select { font: inherit; letter-spacing: 0; color: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--ocean-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 2px; border-radius: 4px; }
.hidden { display: none !important; }
p { margin: 0; }

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }

/* ── Icons ─────────────────────────────────────────────────────────────── */
.icon { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* ── Icon button ───────────────────────────────────────────────────────── */
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.active { color: var(--ocean-bright); }

/* ── Brand ─────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand-penguin { width: 32px; height: 36px; border-radius: 50% 50% 42% 42%; background: var(--ink); position: relative; flex: none; }
.brand-penguin::before { content: ''; position: absolute; width: 17px; height: 21px; border-radius: 50%; background: white; left: 7px; top: 7px; }
.brand-penguin::after { content: ''; position: absolute; width: 9px; height: 5px; background: var(--coral); clip-path: polygon(0 0,100% 50%,0 100%); left: 14px; top: 12px; }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); flex: none; }
.brand-text { min-width: 0; }
.brand-name { font-size: 17px; font-weight: 700; line-height: 1.1; letter-spacing: -.3px; color: var(--ink); }
.brand-tagline { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 1px; }

/* ── Pill badges ───────────────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 8px; }
.pill-unread { background: var(--ocean); color: #fff; min-width: 20px; justify-content: center; padding: 3px 6px; }
.pill-premium { background: linear-gradient(135deg, #f0b432, #e87c3e); color: #000; }
.pill-free { background: var(--surface-2); color: var(--muted); }
.pill-ok { background: rgba(61,191,130,.15); color: var(--green); }
.pill-err { background: rgba(240,107,85,.15); color: var(--coral); }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH SCREENS
══════════════════════════════════════════════════════════════════════════ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left { background: var(--ice); border-right: 1px solid var(--line-2); padding: clamp(32px,5vw,72px); display: flex; flex-direction: column; min-height: 100vh; }
.auth-left-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; max-width: 480px; }
.auth-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ocean-bright); margin-bottom: 16px; }
.auth-left h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 800; line-height: 1.0; letter-spacing: -.04em; margin: 0 0 20px; color: var(--ink); }
.auth-left p { color: var(--ink-2); font-size: 15px; line-height: 1.7; max-width: 38ch; }
.auth-features { margin-top: 36px; display: flex; flex-direction: column; gap: 12px; }
.auth-feature { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.auth-feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ocean); flex: none; }
.auth-online { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--green); margin-top: 40px; }
.auth-online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(61,191,130,.2); flex: none; }

.auth-right { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 32px; min-height: 100vh; }
.auth-box { width: min(420px, 100%); }
.auth-box h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.auth-box .auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 4px; background: var(--paper); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 28px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 4px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.auth-tab.active { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-tab:hover:not(.active) { color: var(--ink-2); }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.field input { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 14px; background: var(--paper); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--ocean); outline: none; box-shadow: 0 0 0 3px rgba(61,184,187,.12); }
.field input::placeholder { color: var(--muted); }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

.address-row { display: flex; gap: 0; }
.address-row input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; min-width: 0; }
.address-suffix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: 13px; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; padding: 11px 20px; cursor: pointer; transition: opacity .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ocean); color: #000; font-weight: 700; }
.btn-primary:hover { opacity: .9; box-shadow: 0 4px 16px rgba(61,184,187,.3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--ocean); color: var(--ocean-bright); }
.btn-danger { background: rgba(240,107,85,.12); color: var(--coral); border: 1px solid rgba(240,107,85,.2); }
.btn-danger:hover { background: rgba(240,107,85,.2); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.cf-wrap { margin-top: 4px; }
.form-actions { display: flex; gap: 10px; flex-direction: column; margin-top: 4px; }
.form-error { background: rgba(240,107,85,.1); border: 1px solid rgba(240,107,85,.25); border-radius: var(--radius-sm); color: var(--coral); font-size: 13px; padding: 10px 14px; }
.form-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.form-switch button { background: none; border: 0; color: var(--ocean-bright); font-weight: 600; cursor: pointer; padding: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   MAIL SHELL — three-column layout
══════════════════════════════════════════════════════════════════════════ */
.mail-shell { display: grid; grid-template-columns: var(--sidebar-w) 320px 1fr; grid-template-rows: 100vh; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--line); }
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-section { margin-bottom: 6px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; transition: background .15s, color .15s; position: relative; }
.nav-item:hover { background: var(--surface-2); color: var(--ink-2); }
.nav-item.active { background: rgba(61,184,187,.1); color: var(--ocean-bright); font-weight: 600; }
.nav-item .nav-badge { margin-left: auto; }
.sidebar-footer { border-top: 1px solid var(--line); padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user { padding: 10px; border-radius: var(--radius-sm); }
.sidebar-addr { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-plan { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tux-display { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 10px 8px; }
.tux-display strong { color: var(--ink-2); font-weight: 700; }

/* ── List pane ──────────────────────────────────────────────────────────── */
.list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.list-topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.search-wrap { flex: 1; position: relative; }
.search-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { width: 100%; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px 7px 34px; font-size: 13px; color: var(--ink); transition: border-color .15s; }
.search-wrap input:focus { border-color: var(--ocean); outline: none; }
.search-wrap input::placeholder { color: var(--muted); }

.list-heading { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.list-heading h2 { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); text-transform: capitalize; }
.list-count { font-size: 12px; color: var(--muted); }
.msg-list { flex: 1; overflow-y: auto; }
.msg-row { padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; transition: background .1s; position: relative; }
.msg-row:hover { background: var(--surface-2); }
.msg-row.active { background: rgba(61,184,187,.08); border-left: 3px solid var(--ocean); }
.msg-row.unread .msg-subject { font-weight: 700; color: var(--ink); }
.msg-row.unread::before { content: ''; position: absolute; top: 18px; right: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--ocean); }
.msg-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ocean); margin-top: 4px; flex: none; }
.msg-sender { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.msg-subject { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 2; }
.msg-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 2; }
.msg-row.unread .msg-sender { color: var(--ink); }
.msg-star { grid-column: 3; grid-row: 1 / 3; display: flex; align-items: center; color: var(--muted); }
.msg-star.starred { color: var(--sun); }
.msg-icons { display: flex; align-items: center; gap: 4px; margin-top: 3px; grid-column: 2; }
.msg-clip { color: var(--muted); }

.list-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 40px 20px; text-align: center; }
.list-empty .icon-xl { opacity: .25; }
.list-empty p { font-size: 14px; line-height: 1.6; max-width: 24ch; }

/* ── Viewer ─────────────────────────────────────────────────────────────── */
.viewer { background: var(--paper); display: flex; flex-direction: column; overflow: hidden; }
.viewer-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; padding: 40px; }
.viewer-empty .icon-xl { opacity: .2; }
.viewer-empty h3 { font-size: 16px; font-weight: 600; color: var(--ink-2); margin: 0; }
.viewer-empty p { font-size: 13px; max-width: 26ch; line-height: 1.6; }
.viewer-toolbar { height: var(--topbar-h); display: flex; align-items: center; gap: 6px; padding: 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.viewer-toolbar-sep { flex: 1; }
.viewer-head { padding: 28px 28px 20px; border-bottom: 1px solid var(--line); flex: none; }
.viewer-subject { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 16px; color: var(--ink); }
.viewer-meta { display: flex; flex-direction: column; gap: 5px; }
.viewer-meta-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.viewer-meta-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; width: 34px; flex: none; }
.viewer-meta-val { color: var(--ink-2); }
.viewer-body { flex: 1; overflow-y: auto; padding: 24px 28px 40px; }
.viewer-body iframe { width: 100%; min-height: 400px; border: none; background: white; border-radius: var(--radius-sm); display: block; }
.viewer-body .text-body { font-size: 14px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.viewer-attachments { padding: 0 28px 24px; flex: none; }
.viewer-attachments h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-item { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; color: var(--ink-2); text-decoration: none; transition: border-color .15s; }
.attachment-item:hover { border-color: var(--ocean); color: var(--ocean-bright); text-decoration: none; }
.attachment-size { color: var(--muted); font-size: 11px; }

/* ── Top bar (mobile overlay) ───────────────────────────────────────────── */
.mobile-topbar { display: none; height: var(--topbar-h); align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toast-region { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); pointer-events: auto; animation: toast-in .2s ease; max-width: 340px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════════════════
   ACCOUNT PAGES
══════════════════════════════════════════════════════════════════════════ */
.account-shell { min-height: 100vh; background: var(--paper); }
.account-topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.account-topbar-sep { flex: 1; }
.account-body { max-width: 780px; margin: 0 auto; padding: 32px 24px; }
.account-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.account-tab { border: 0; background: transparent; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.account-tab.active { color: var(--ocean-bright); border-bottom-color: var(--ocean); }
.account-tab:hover:not(.active) { color: var(--ink-2); }

.section-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.section-card-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-card-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.section-card-header p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.section-card-body { padding: 20px 22px; }

/* Wallet */
.tux-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tux-big-num { font-size: 52px; font-weight: 800; letter-spacing: -.04em; color: var(--ocean-bright); line-height: 1; }
.tux-big-label { font-size: 16px; font-weight: 600; color: var(--muted); }
.tux-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.ledger { margin-top: 16px; }
.ledger-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ledger-row:last-child { border: 0; }
.ledger-reason { color: var(--ink-2); }
.ledger-delta { font-weight: 700; }
.ledger-delta.pos { color: var(--green); }
.ledger-delta.neg { color: var(--coral); }
.ledger-date { font-size: 11px; color: var(--muted); }

/* Premium */
.premium-hero { text-align: center; padding: 32px 20px; }
.premium-badge { width: 64px; height: 64px; background: linear-gradient(135deg,#f0b432,#e87c3e); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 28px; }
.premium-hero h3 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.premium-hero p { font-size: 14px; color: var(--muted); max-width: 34ch; margin: 0 auto; line-height: 1.7; }
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.payment-card { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px; }
.payment-card h4 { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.payment-card p { font-size: 12px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; }
.payment-price { font-size: 24px; font-weight: 800; color: var(--ink); margin-bottom: 16px; }
.payment-price small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Addresses */
.address-list { display: flex; flex-direction: column; gap: 10px; }
.address-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.address-item-addr { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.address-item-actions { display: flex; gap: 6px; align-items: center; }

/* Settings */
.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border: 0; }
.settings-row-label { font-size: 14px; font-weight: 600; }
.settings-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-inline-form { display: flex; gap: 8px; align-items: center; }
.settings-inline-form input { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; color: var(--ink); flex: 1; min-width: 0; }
.settings-inline-form input:focus { border-color: var(--ocean); outline: none; }

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════════════════════════ */
.admin-shell { min-height: 100vh; background: var(--paper); }
.admin-topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-body { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
.admin-heading { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.stat-card-value { font-size: 36px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.stat-card-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-card.ocean .stat-card-value { color: var(--ocean-bright); }
.stat-card.coral .stat-card-value { color: var(--coral); }
.stat-card.sun .stat-card-value { color: var(--sun); }
.stat-card.green .stat-card-value { color: var(--green); }

.admin-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-card-header h3 { font-size: 14px; font-weight: 700; margin: 0; }
.panel-search { position: relative; }
.panel-search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.panel-search input { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px 7px 32px; font-size: 12px; color: var(--ink); width: 180px; }
.panel-search input:focus { border-color: var(--ocean); outline: none; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table td strong { display: block; font-weight: 600; }
.data-table td small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.table-wrap { overflow-x: auto; }
.status-active { color: var(--green); font-size: 11px; font-weight: 700; }
.status-disabled { color: var(--coral); font-size: 11px; font-weight: 700; }
.admin-tag { display: inline-block; background: rgba(240,180,50,.12); color: var(--sun); border-radius: 99px; font-size: 10px; font-weight: 700; padding: 2px 7px; margin-left: 6px; }
.tbl-action { background: none; border: 0; color: var(--ocean-bright); font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.tbl-action:hover { text-decoration: underline; }
.tbl-action:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.panel-empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Storage bar ────────────────────────────────────────────────────────── */
.storage-bar-wrap { margin-top: 16px; }
.storage-bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.storage-bar { height: 4px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.storage-bar-fill { height: 100%; background: var(--ocean); border-radius: 99px; transition: width .4s ease; }
.storage-bar-fill.warn { background: var(--sun); }
.storage-bar-fill.danger { background: var(--coral); }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .mail-shell { grid-template-columns: var(--sidebar-w) 280px 1fr; }
}
@media (max-width: 900px) {
  .mail-shell { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 100; transform: translateX(-110%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .list-pane { grid-column: 1; grid-row: 2; border-right: 0; }
  .viewer { position: fixed; inset: 0; z-index: 50; transform: translateX(100%); transition: transform .22s ease; }
  .viewer.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .payment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { min-height: 100vh; padding: 28px 20px; }
  .admin-stats { grid-template-columns: 1fr; }
  .account-body { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── TUX balance chip ─────────────────────────────────────────────────── */
.tux-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.tux-chip:hover { background: var(--line); border-color: var(--ocean); color: var(--ocean-bright); }
.tux-chip .tux-amt { color: var(--ocean-bright); font-weight: 800; }
/* Chip in sidebar footer */
#tux-chip-btn { width: 100%; justify-content: center; margin: 4px 0 2px; }
/* Chip in mobile topbar */
.mob-tux-chip { font-size: 11px; padding: 4px 10px; }

/* ── Top-up modal ───────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.topup-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.topup-amt-btn { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: border-color .15s, background .15s; }
.topup-amt-btn small { font-size: 10px; font-weight: 400; color: var(--muted); }
.topup-amt-btn:hover, .topup-amt-btn.active { border-color: var(--ocean); background: rgba(var(--ocean-rgb,0,188,212),.08); color: var(--ocean-bright); }

/* ── Admin broadcast bar ────────────────────────────────────────────────── */
.admin-broadcast-bar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-broadcast-bar input { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px; color: var(--ink); font-size: 13px; }

/* ── Admin table danger action ──────────────────────────────────────────── */
.tbl-action-danger { color: var(--coral) !important; }
.tbl-action-danger:hover { background: rgba(255,90,90,.12) !important; }
.tbl-action:disabled { opacity: .4; pointer-events: none; }

/* ── Sidebar copy address button ────────────────────────────────────────── */
.sidebar-copy-addr { color: var(--muted); font-size: 11px; }
.sidebar-copy-addr:hover { color: var(--ocean-bright); }

/* ── Address list improvements ──────────────────────────────────────────── */
.address-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-1); flex-wrap: wrap; }
.address-item:last-child { border-bottom: none; }
.address-item-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.address-item-addr { font-size: 14px; font-weight: 600; color: var(--ink); font-family: var(--font-mono, monospace); word-break: break-all; }
.address-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.addr-copy-btn { color: var(--muted) !important; min-width: 32px; }
.addr-copy-btn:hover { color: var(--ocean-bright) !important; }
.add-addr-row { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.add-addr-row .address-row { display: flex; align-items: stretch; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-2); flex: 1; min-width: 200px; }
.add-addr-row .address-row input { border: none !important; border-radius: 0 !important; flex: 1; }
.add-addr-row .address-row input:focus { outline: none; box-shadow: none; }
.add-addr-row .address-suffix { background: var(--paper-2, var(--paper)); border-left: 1px solid var(--line-2); border-radius: 0; padding: 9px 10px; font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; }

/* ── Wallet top-up section ──────────────────────────────────────────────── */
.topup-card { border: 1px solid rgba(0,188,212,.18) !important; }
.topup-quick-btns { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 18px; }
.topup-q-btn { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: border-color .15s, background .15s; }
.topup-q-btn small { font-size: 10px; font-weight: 400; color: var(--muted); }
.topup-q-btn:hover, .topup-q-btn.active { border-color: var(--ocean); background: rgba(0,188,212,.08); color: var(--ocean-bright); }
.topup-form-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.topup-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 120px; }
.topup-field label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.topup-field input { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; color: var(--ink); font-size: 13px; width: 100%; }
.topup-pay-btn { flex-shrink: 0; height: 40px; padding: 0 20px; align-self: flex-end; }
.topup-result { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid transparent; }
.topup-result.hidden { display: none; }
.topup-ok { background: rgba(61,191,130,.1); border-color: rgba(61,191,130,.3); color: #3dbf82; }
.topup-err { background: rgba(255,90,90,.08); border-color: rgba(255,90,90,.25); color: #ff7070; }
.premium-nudge { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--ocean-bright); text-decoration: none; }
.premium-nudge:hover { text-decoration: underline; }

/* ── Premium upgrade page ───────────────────────────────────────────────── */
.premium-upgrade-card { overflow: hidden; }
.premium-hero { background: linear-gradient(135deg, rgba(0,188,212,.12), rgba(120,100,255,.12)); padding: 36px 28px 28px; text-align: center; border-bottom: 1px solid var(--line-2); }
.premium-badge { font-size: 48px; margin-bottom: 10px; }
.premium-hero-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; color: var(--ink); }
.premium-hero-sub { color: var(--muted); font-size: 15px; margin: 0; }
.premium-features { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 10px; }
.premium-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.pf-check { color: #3dbf82; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.polar-checkout-box { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-md, 10px); padding: 22px; text-align: center; }
.polar-checkout-price { margin-bottom: 6px; }
.polar-price-amt { font-size: 36px; font-weight: 900; color: var(--ink); }
.polar-price-per { font-size: 15px; color: var(--muted); margin-left: 4px; }
.polar-checkout-note { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.polar-cta-btn { font-size: 16px !important; padding: 14px 24px !important; font-weight: 800 !important; letter-spacing: .02em; }
.polar-disclaimer { color: var(--muted); font-size: 12px; margin-top: 18px; text-align: center; }
.polar-disclaimer a { color: var(--ocean-bright); }

/* ── Premium active page ────────────────────────────────────────────────── */
.premium-active-body { text-align: center; padding: 48px 24px; }
.premium-star-big { font-size: 56px; margin-bottom: 14px; }
.premium-active-title { font-size: 24px; font-weight: 800; margin: 0 0 10px; }
