/* ===== Client Portal Styles ===== */
:root {
  --cp-primary: #5B3CC4;
  --cp-primary-dark: #472ea0;
  --cp-accent: #18D4FF;
  --cp-bg: #0d0b1f;
  --cp-card: #171430;
  --cp-card-2: #1d1838;
  --cp-border: rgba(255,255,255,.09);
  --cp-text: #f2f0ff;
  --cp-muted: #a29ec4;
  --cp-green: #28a745;
  --cp-red: #dc3545;
  --cp-radius: 12px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, Helvetica, sans-serif; background: var(--cp-bg); color: var(--cp-text); }

a { color: var(--cp-primary); text-decoration: none; }
.muted { color: var(--cp-muted); font-size: 13px; line-height: 1.6; }
.mt { margin-top: 12px; }

.portal-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Topbar ── */
.portal-topbar { background: #191428; color: #fff; padding: 12px 0; position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; }
.topbar-logo img { display: block; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions .portal-link { color: #cfc8f0; font-size: 14px; }
.topbar-actions .portal-link:hover { color: #fff; }
@media (max-width: 520px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topbar-actions { gap: 10px; }
  .topbar-actions .portal-btn-sm { padding: 6px 10px; font-size: 12px; }
  .topbar-actions .portal-link { font-size: 13px; }
  .portal-shell { padding: 18px 14px 30px; }
  .auth-card { padding: 26px 20px; }
  .chat-bubble { max-width: 90%; }
  .chat-inputbar { padding: 10px 12px; }
  .chat-header { padding: 12px 14px; }
}

/* ── Shell ── */
.portal-shell { max-width: 1100px; margin: 0 auto; padding: 28px 20px 40px; }
.portal-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
@media (max-width: 860px) { .portal-grid { grid-template-columns: 1fr; } }

/* ── Cards ── */
.portal-card { background: var(--cp-card); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); padding: 22px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(26,26,46,.06); }
.portal-card h2 { margin: 0 0 8px; font-size: 22px; color: var(--cp-text); }
.portal-card h3 { margin: 0 0 10px; font-size: 16px; }
.portal-card p { margin: 6px 0; }

/* ── Hero card ── */
.hero-card { background: linear-gradient(135deg, #5B3CC4 0%, #7c5cdb 55%, #18D4FF 130%); color: #fff; }
.hero-card h2 { color: #fff; }
.hero-card p { color: #ece7ff; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.18); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 2px; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; text-transform: uppercase; }
.hero-hints { margin: 14px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.portal-chip { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer; transition: background .15s; }
.portal-chip:hover { background: rgba(255,255,255,.3); }

/* ── Buttons ── */
.portal-btn { display: inline-block; border: none; border-radius: 8px; padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center; transition: background .15s, opacity .15s; }
.portal-btn-primary { background: var(--cp-primary); color: #fff; }
.portal-btn-primary:hover { background: var(--cp-primary-dark); color: #fff; }
.portal-btn-ghost { background: transparent; color: var(--cp-primary); border: 1px solid var(--cp-primary); }
.portal-btn-ghost:hover { background: #f0edfa; }
.portal-btn-danger { background: #E63946; color: #fff; }
.portal-btn-danger:hover { background: #c92f3b; color: #fff; }
.v2-settings-form label { display: block; font-size: 13px; font-weight: 700; color: var(--cp-muted); margin-bottom: 6px; }
.v2-settings-input { border: 2px solid #e6e1f7; border-radius: 10px; padding: 10px 12px; font-size: 13px; background: #faf9ff; color: var(--cp-text); }
.v2-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.v2-settings-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--cp-text); cursor: pointer; padding: 6px 0; }
.v2-settings-check input { width: 16px; height: 16px; accent-color: var(--cp-primary); }
body.portal-v2 .v2-settings-input { background: #171430; border-color: rgba(255,255,255,.14); color: #ece7ff; }
.vault-stat-link { color: var(--cp-primary); text-decoration: none; }
.vault-stat-link:hover { background: rgba(255,255,255,.25); }
.cp-client-files { list-style: none; margin: 10px 0 0; padding: 0; }
.cp-client-files li { border-bottom: 1px dashed #eceaf4; padding: 8px 0; }
.cp-client-files li:last-child { border-bottom: 0; }
.cp-file-name { font-size: 13px; font-weight: 700; color: var(--cp-primary); text-decoration: none; word-break: break-all; }
.cp-file-name:hover { text-decoration: underline; }
.cp-file-note { margin: 2px 0 0; font-size: 12px; }
body.portal-v2 .cp-client-files li { border-bottom-color: rgba(255,255,255,.07); }
.portal-btn-google { background: #fff; color: #333; border: 1px solid #d0d0d8; display: flex; align-items: center; justify-content: center; gap: 10px; }
.portal-btn:disabled { opacity: .55; cursor: not-allowed; }
.portal-btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.coming-soon { background: #fff2cc; color: #8a6d1a; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Alerts ── */
.portal-alert { border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.portal-alert-error { background: #fdecea; border: 1px solid #f5c6c2; color: #a3312b; }
.portal-alert-success { background: #e9f9ee; border: 1px solid #b8e6c6; color: #1e7a35; }
.portal-alert-info { background: #eef2ff; border: 1px solid #cdd8ff; color: #3347a0; }
.portal-alert-warn { background: #fff8e6; border: 1px solid #f2dd9e; color: #7a5b12; }
.cp-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #555; cursor: pointer; background: #f2effb; border: 1px solid #e3dcf5; transition: background .15s; }
.cp-bell:hover, .cp-bell.open { background: #e6e0fa; }
.cp-bell svg { pointer-events: none; }
.cp-bell.has-unread { color: #5B3CC4; }
.cp-bell-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 100px; background: #E63946; color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; }
.cp-bell-drop { display: none; position: absolute; top: 46px; right: 0; width: 320px; max-width: 84vw; background: #fff; border: 1px solid #e6e1f7; border-radius: 14px; box-shadow: 0 18px 44px rgba(30,20,70,.18); z-index: 90; overflow: hidden; }
.cp-bell.open .cp-bell-drop { display: block; }
.cp-bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eee9f9; }
.cp-bell-head strong { font-size: 13px; color: var(--cp-text); }
.cp-bell-head button { border: 0; background: none; color: var(--cp-primary,#5B3CC4); font-size: 12px; font-weight: 700; cursor: pointer; }
.cp-bell-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.cp-bell-list li { border-bottom: 1px solid #f3f0fb; }
.cp-bell-list li:last-child { border-bottom: none; }
.cp-bell-list li a, .cp-bell-list li > div { display: block; padding: 11px 16px; text-decoration: none; color: inherit; }
.cp-bell-list li a:hover { background: #faf9ff; }
.cp-bell-list li.unread { background: #f5f1ff; }
.cp-bell-list li.unread a:hover { background: #efeafd; }
.cp-bell-list strong { display: block; font-size: 12.5px; color: var(--cp-text); }
.cp-bell-list .cp-bell-body { display: block; margin: 2px 0; font-size: 12px; color: #6b6490; line-height: 1.45; }
.cp-bell-list em { display: block; font-size: 10.5px; font-style: normal; color: #a9a2c4; }
.cp-bell-list .cp-bell-empty { padding: 22px 16px; text-align: center; color: #8b84ad; font-size: 12.5px; }
.cp-bell-list .cp-bell-seeall { border-bottom: none; border-top: 1px solid #eee9f9; }
.cp-bell-list .cp-bell-seeall a { display: block; padding: 10px 16px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--cp-primary,#5B3CC4); text-decoration: none; }
.cp-bell-list .cp-bell-seeall a:hover { background: #faf9ff; }
body.portal-v2 .cp-bell-list .cp-bell-seeall { border-top-color: rgba(255,255,255,.08); }
body.portal-v2 .cp-bell-list .cp-bell-seeall a { color: #8fb6ff; }
body.portal-v2 .cp-bell-list .cp-bell-seeall a:hover { background: rgba(255,255,255,.05); }

/* Notification popup modal */
.cp-notif-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(8,6,20,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s ease; padding: 20px; }
.cp-notif-overlay.show { opacity: 1; }
.cp-notif-modal { position: relative; width: min(420px, 92vw); background: #fff; border-radius: 18px; padding: 26px 24px 22px; box-shadow: 0 24px 60px rgba(20,12,46,.35); transform: translateY(10px) scale(.97); transition: transform .2s ease; text-align: center; }
.cp-notif-overlay.show .cp-notif-modal { transform: none; }
.cp-notif-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 22px; line-height: 1; color: #9b96ad; cursor: pointer; }
.cp-notif-modal-ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #5B3CC4; background: rgba(91,60,196,.1); }
.cp-notif-modal h4 { margin: 0 0 8px; font-size: 16px; font-weight: 800; color: var(--cp-text); }
.cp-notif-modal p { margin: 0 0 8px; font-size: 13.5px; color: #6b6490; line-height: 1.6; }
.cp-notif-modal em { font-size: 11px; font-style: normal; color: #a9a2c4; display: block; margin-bottom: 16px; }
.cp-notif-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
body.portal-v2 .cp-notif-modal { background: #16122b; border: 1px solid rgba(255,255,255,.12); }
body.portal-v2 .cp-notif-modal h4 { color: #ece7ff; }
body.portal-v2 .cp-notif-modal p { color: #b7aee0; }
body.portal-v2 .cp-notif-modal em { color: #7d75a5; }
body.portal-v2 .cp-notif-modal-ic { background: rgba(139,92,246,.18); color: #c3b6ff; }

/* Notifications page rows */
.cp-notif-row { display: flex !important; align-items: flex-start; gap: 14px; cursor: pointer; }
.cp-notif-row.unread { background: rgba(139,92,246,.1); }
.cp-notif-row-ic { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; background: linear-gradient(135deg, #5B3CC4, #7c5fe0); box-shadow: 0 8px 18px rgba(91,60,196,.35); }
.cp-notif-row-body { flex: 1; min-width: 0; }
.cp-notif-row-body strong { display: block; font-size: 13.5px; color: var(--cp-text); }
.cp-notif-row-body .cp-notif-row-text { font-size: 12.5px; color: #9b96ad; line-height: 1.55; margin: 2px 0 4px; }
.cp-notif-row-body em { font-size: 11px; font-style: normal; color: #a9a2c4; }
.cp-notif-row-open { flex-shrink: 0; align-self: center; }
@media (max-width: 480px) { .cp-notif-row { flex-wrap: wrap; } .cp-notif-row-open { width: 100%; } }
body.portal-v2 .cp-bell { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #cfc8f0; }body.portal-v2 .cp-bell:hover, body.portal-v2 .cp-bell.open { background: rgba(255,255,255,.12); }
body.portal-v2 .cp-bell.has-unread { color: #ffd75e; }
@keyframes cpBellPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 94, .55); }
  70% { box-shadow: 0 0 0 12px rgba(255, 215, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 94, 0); }
}
body.portal-v2 .cp-bell.has-unread { animation: cpBellPulse 2.2s ease-out infinite; }
body.portal-v2 .cp-bell.has-unread .cp-bell-badge { background: #E63946; animation: cpBellPulse 2.2s ease-out infinite; }
body.portal-v2 .cp-bell.bell-nudge { animation: cpBellNudge .5s ease; }
@keyframes cpBellNudge {
  0% { transform: rotate(0); }
  25% { transform: rotate(-14deg); }
  50% { transform: rotate(12deg); }
  75% { transform: rotate(-8deg); }
  100% { transform: rotate(0); }
}
body.portal-v2 .cp-bell-drop { background: #151226; border-color: rgba(255,255,255,.12); box-shadow: 0 18px 44px rgba(0,0,0,.5); }
body.portal-v2 .cp-bell-head { border-bottom-color: rgba(255,255,255,.08); }
body.portal-v2 .cp-bell-head button { color: #8fb6ff; }
body.portal-v2 .cp-bell-list li { border-bottom-color: rgba(255,255,255,.06); }
body.portal-v2 .cp-bell-list li a:hover { background: rgba(255,255,255,.05); }
body.portal-v2 .cp-bell-list li.unread { background: rgba(139,92,246,.14); }
body.portal-v2 .cp-bell-list li.unread a:hover { background: rgba(139,92,246,.22); }
body.portal-v2 .cp-bell-list strong { color: #ece7ff; }
body.portal-v2 .cp-bell-list .cp-bell-body { color: #b7aee0; }
body.portal-v2 .cp-bell-list em { color: #7d75a5; }
body.portal-v2 .cp-bell-list .cp-bell-empty { color: #8b84ad; }
.portal-alert a { color: inherit; text-decoration: underline; }

/* ── Forms ── */
.profile-form label, .auth-form label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; color: #444; }
.profile-form input, .auth-form input { width: 100%; padding: 11px 13px; border: 1px solid #d4d0e6; border-radius: 8px; font-size: 14px; background: #fff; }
.profile-form input:focus, .auth-form input:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(91,60,196,.15); }
.profile-form .portal-btn { margin-top: 16px; }
.otp-input { letter-spacing: 8px; text-align: center; font-size: 22px !important; font-weight: 800; }
.otp-row { display: flex; gap: 10px; }
.otp-row .otp-input { flex: 1; }
.otp-send-wrap { margin-top: 12px; }
.otp-send-wrap .portal-btn:disabled { opacity: .55; cursor: not-allowed; }
.otp-send-note { font-size: 12px; color: var(--cp-muted); text-align: center; margin: 8px 0 0 !important; }

/* ── Auth pages ── */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #191428 0%, #2a2144 60%, #3a2f5e 100%); }
.auth-shell { padding: 40px 20px; }
.auth-card { background: #fff; border-radius: 16px; padding: 34px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }

/* ── Split auth layout (login/register only) ── */
.auth-split-body { background: #f4f3fb; align-items: stretch; justify-content: center; padding: 0; overflow-x: hidden; }
.auth-split { display: flex; width: 100%; min-height: 100vh; overflow-x: hidden; }

.auth-visual { flex: 0 0 46%; max-width: 46%; position: relative; overflow: hidden; display: flex; flex-direction: column; color: #fff; background: linear-gradient(155deg, #191428 0%, #2a2144 55%, #4b3a86 100%); }
.auth-visual::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(circle at 15% 20%, rgba(24,212,255,.14) 0, transparent 42%),
  radial-gradient(circle at 85% 80%, rgba(124,92,219,.35) 0, transparent 48%),
  radial-gradient(circle at 70% 15%, rgba(255,255,255,.06) 0, transparent 35%);
  pointer-events: none; }
.auth-visual::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(24,212,255,.16), transparent 62%); top: -120px; right: -140px; animation: authOrb 10s ease-in-out infinite; pointer-events: none; }
@keyframes authOrb { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,40px) scale(1.15); } }
.auth-visual-inner { position: relative; z-index: 2; display: flex; flex-direction: column; flex: 1; padding: 34px 40px 30px; }
.auth-visual-logo img { display: block; height: 46px; width: auto; }
.auth-visual-content { margin: auto 0; padding: 40px 0; }
.auth-visual-badge { display: inline-block; background: rgba(24,212,255,.12); border: 1px solid rgba(24,212,255,.35); color: #8fe8ff; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 7px 16px; border-radius: 30px; margin-bottom: 22px; }
.auth-visual-badge b { color: #fff; }
.auth-visual-content h2 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.18; margin: 0 0 16px; letter-spacing: -.5px; }
.auth-visual-content > p { color: #cfc8f0; font-size: 15px; line-height: 1.7; max-width: 430px; margin: 0 0 26px; }
.auth-visual-points { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-visual-points li { display: flex; gap: 14px; align-items: flex-start; }
.auth-visual-ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 2px; box-shadow: 0 4px 14px rgba(24,212,255,.3); }
.auth-visual-points strong { display: block; font-size: 14.5px; }
.auth-visual-points em { font-style: normal; color: #b9b0e0; font-size: 12.5px; line-height: 1.5; display: block; margin-top: 2px; }
.auth-visual-services { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.auth-visual-services span { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); color: #d8d1f5; font-size: 11.5px; font-weight: 600; padding: 6px 13px; border-radius: 20px; }
.auth-visual-stats { display: flex; gap: 28px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 22px; }
.auth-visual-stats strong { display: block; font-size: 24px; background: linear-gradient(90deg, #fff, #18D4FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-visual-stats span { color: #b9b0e0; font-size: 12px; }

/* decorative floating cards on the visual */
.auth-visual-art { position: absolute; bottom: 110px; right: 0; width: 240px; height: 150px; pointer-events: none; z-index: 1; opacity: .85; }
.auth-visual-art .art-card { position: absolute; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(6px); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.auth-visual-art .art-card b { display: block; font-size: 12px; margin-bottom: 8px; color: #e6e1ff; }
.auth-visual-art .art-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); margin-bottom: 6px; }
.auth-visual-art .art-bar.hot { background: linear-gradient(90deg, #5B3CC4, #18D4FF); }
.auth-visual-art .art-bubble { border-radius: 12px; padding: 6px 10px; font-size: 11px; width: fit-content; margin-bottom: 6px; }
.auth-visual-art .art-bubble.user { background: rgba(24,212,255,.22); margin-left: auto; }
.auth-visual-art .art-bubble.ai { background: rgba(124,92,219,.45); }
.auth-visual-art .art-card-a { top: 0; left: 0; width: 150px; animation: authArtFloat 5.5s ease-in-out infinite; }
.auth-visual-art .art-card-b { bottom: 0; right: 0; width: 170px; animation: authArtFloat 7s ease-in-out infinite reverse; }
@keyframes authArtFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.auth-visual-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; overflow: hidden; }
.auth-visual-main::before { content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(91,60,196,.08), transparent 65%); top: -140px; left: -160px; pointer-events: none; }
.auth-visual-main::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(24,212,255,.07), transparent 65%); bottom: -140px; right: -120px; pointer-events: none; }
.auth-split-card { position: relative; z-index: 2; background: #fff; border-radius: 22px; padding: 38px 40px; width: 100%; max-width: 470px; box-shadow: 0 24px 70px rgba(26,26,46,.14); border: 1px solid #ece9f6; overflow: hidden; }
.auth-split-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #5B3CC4, #18D4FF); }
.auth-split-card::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(91,60,196,.05), transparent 65%); bottom: -150px; right: -150px; pointer-events: none; }
.auth-split-brand { text-align: center; margin-bottom: 24px; }
.auth-split-brand h2 { margin: 0 0 6px; font-size: 24px; color: #191428; }
.auth-split-brand p { margin: 0; color: var(--cp-muted); font-size: 13px; }

/* form fields with icons */
.auth-split-card .auth-form { display: flex; flex-direction: column; }
.auth-field { margin: 0 0 18px; }
.auth-field:last-child { margin-bottom: 0; }
.auth-field label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 7px; color: #444; }
.auth-field label small { font-weight: 600; color: #9a93bd; font-size: 11.5px; margin-left: 4px; }
.auth-input-wrap { position: relative; }
.auth-input-wrap input { padding-left: 42px !important; height: 46px; }
.auth-input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #9a93bd; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.auth-input-icon svg { width: 16px; height: 16px; }
.auth-input-wrap input:focus ~ .auth-input-icon { color: var(--cp-primary); }
.auth-split-card .auth-form .portal-btn { margin-top: 14px; }
.auth-note { margin-top: 14px !important; }

/* cancel (start over) */
.inline-cancel { margin: 16px 0 0; text-align: center; }
.auth-cancel-btn { background: none; border: none; color: var(--cp-muted); font-size: 12.5px; cursor: pointer; text-decoration: none; padding: 6px 10px; }
.auth-cancel-btn:hover { color: var(--cp-primary); text-decoration: underline; }

/* inline OTP step */
.auth-otp-step { text-align: center; }
.auth-otp-head { margin-bottom: 18px; }
.auth-otp-mail { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(91,60,196,.35); }
.auth-otp-mail svg { width: 24px; height: 24px; }
.auth-otp-head h3 { margin: 0 0 6px; font-size: 19px; color: #191428; }
.auth-otp-head p { margin: 0; color: var(--cp-muted); font-size: 13px; line-height: 1.6; }
.auth-otp-head b { color: var(--cp-primary); }
.auth-otp-back { margin-top: 14px !important; font-size: 12.5px; }

.auth-visual .auth-card, .auth-visual .auth-shell { display: none; }

@media (max-width: 900px) {
  .auth-split { flex-direction: column; }
  .auth-visual { flex: none; max-width: 100%; width: 100%; }
  .auth-visual-inner { padding: 24px 24px 18px; }
  .auth-visual-content { padding: 26px 0 16px; }
  .auth-visual-content h2 { font-size: 26px; }
  .auth-visual-points li:nth-child(n+3) { display: none; }
  .auth-visual-services span:nth-child(n+5) { display: none; }
  .auth-visual-stats { padding-top: 14px; gap: 20px; }
  .auth-visual-stats strong { font-size: 20px; }
  .auth-visual-art { display: none; }
  .auth-visual-main { padding: 26px 16px; }
  .auth-split-card { padding: 30px 20px; }
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand h1 { margin: 14px 0 4px; font-size: 24px; }
.auth-brand p { margin: 0; color: var(--cp-muted); font-size: 13px; }
.auth-brand img {
  background: #191428;
  border-radius: 12px;
  padding: 10px 18px;
  box-shadow: 0 6px 18px rgba(26,26,46,.18);
}
.auth-tabs { display: flex; border-bottom: 2px solid var(--cp-border); margin-bottom: 20px; }
.auth-tab { flex: 1; background: none; border: none; padding: 12px 0; font-size: 15px; font-weight: 700; color: var(--cp-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--cp-primary); border-bottom-color: var(--cp-primary); }
.auth-row { display: flex; justify-content: flex-end; margin: 8px 0 16px; }
.auth-row a { font-size: 13px; }
.auth-note { font-size: 12px; color: var(--cp-muted); text-align: center; margin-top: 10px !important; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #aaa; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--cp-border); }
.auth-back { text-align: center; margin-top: 18px !important; font-size: 13px; }
.auth-form { margin: 0; }

/* ── Auth benefits ── */
.auth-benefits { margin-top: 24px; border-top: 1px solid var(--cp-border); padding-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.auth-benefit { display: flex; gap: 12px; align-items: flex-start; }
.auth-benefit-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: #f0edfa; color: var(--cp-primary); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.auth-benefit strong { display: block; font-size: 13.5px; color: var(--cp-text); }
.auth-benefit span { display: block; font-size: 12px; color: var(--cp-muted); line-height: 1.5; margin-top: 2px; }

/* ── Services chip list ── */
.services-chip-list { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.services-chip-list li { background: #f4f3f9; border: 1px solid var(--cp-border); border-radius: 16px; padding: 5px 12px; font-size: 12px; color: #444; }

/* ── Support card ── */
.support-card .muted { margin-bottom: 6px; }

/* ── History list ── */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { border-bottom: 1px solid #f0eef7; }
.history-list li:last-child { border-bottom: none; }
.history-list a { display: block; padding: 9px 6px; font-size: 13px; color: var(--cp-text); border-radius: 6px; }
.history-list a:hover { background: #f6f4fc; }
.history-list small { color: var(--cp-muted); font-size: 11px; }
.history-list li.active a { background: #f0edfa; color: var(--cp-primary); font-weight: 700; }

/* ── Chat layout ── */
.chat-shell { max-width: 1200px; }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; background: #fff; border: 1px solid var(--cp-border); border-radius: 14px; overflow: hidden; min-height: 72vh; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; } .chat-sidebar { display: none; } }

.chat-sidebar { background: #f7f6fc; border-right: 1px solid var(--cp-border); padding: 16px 0; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.chat-sidebar h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--cp-muted); }

.chat-main { display: flex; flex-direction: column; height: 72vh; }
@media (max-width: 760px) { .chat-main { height: 76vh; } }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--cp-border); }
.chat-header h2 { margin: 0; font-size: 16px; }
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--cp-primary), var(--cp-accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.ai-icon { font-style: normal; }
.chat-status { font-size: 12px; color: var(--cp-muted); display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cp-green); display: inline-block; }

.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }
.chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user .chat-bubble { background: var(--cp-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot .chat-bubble { background: #f1eff8; color: var(--cp-text); border-bottom-left-radius: 4px; }
.typing-bubble { background: #f1eff8 !important; color: #888 !important; font-style: italic; }

.chat-inputbar { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--cp-border); background: #fff; }
.chat-inputwrap { position: relative; flex: 1; display: flex; align-items: center; }
.chat-inputwrap textarea { flex: 1; resize: none; border: 1px solid #d4d0e6; border-radius: 10px; padding: 11px 13px 26px; font-size: 14px; font-family: inherit; max-height: 120px; }
.chat-inputwrap textarea:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(91,60,196,.12); }
.chat-charcount { position: absolute; right: 10px; bottom: 6px; font-size: 10.5px; color: #b9b4cc; pointer-events: none; }
.chat-charcount.over { color: #E63946; font-weight: 700; }
.chat-footnote { text-align: center; color: #64748b; font-size: 11px; margin: 6px 0 0; }
.chat-footnote a { color: #818cf8; }

/* Chat empty state */
.chat-empty { margin: auto; max-width: 460px; text-align: center; padding: 40px 20px; }
.chat-empty-icon { font-size: 44px; margin-bottom: 10px; }
.chat-empty h3 { margin: 0 0 8px; font-size: 17px; color: var(--cp-text); }
.chat-empty p { margin: 0 0 18px; color: var(--cp-muted); font-size: 13px; line-height: 1.6; }
.chat-empty-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chat-chip { border: 1px solid #d9d3ef; background: #f6f4fc; color: var(--cp-primary); border-radius: 30px; padding: 8px 15px; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.chat-chip:hover { background: var(--cp-primary); color: #fff; border-color: var(--cp-primary); }

/* Token/badge note under a bot answer */
.chat-bubble-note { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d5cfea; color: #8b83ad; font-size: 11px; }

/* ── Footer ── */
.portal-footer { text-align: center; color: var(--cp-muted); font-size: 12px; padding: 20px; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PORTAL V2 — PREMIUM DASHBOARD (scoped to body.portal-v2 only)
   All existing pages are untouched by this block.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
body.portal-v2 {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(91,60,196,.08), transparent 60%),
    radial-gradient(900px 420px at -10% 15%, rgba(24,212,255,.07), transparent 60%),
    #f6f5fb;
}

/* ── Topbar nav ── */
body.portal-v2 .topbar-nav { display: flex; align-items: center; gap: 6px; }
body.portal-v2 .topbar-link {
  color: #cfc8f0; font-size: 14px; padding: 8px 14px; border-radius: 9px;
  transition: background .15s, color .15s;
}
body.portal-v2 .topbar-link:hover { color: #fff; background: rgba(255,255,255,.08); }
body.portal-v2 .topbar-link.active { color: #fff; background: linear-gradient(135deg, rgba(91,60,196,.55), rgba(24,212,255,.25)); }
body.portal-v2 .topbar-link.topbar-logout { color: #ff9d9d; }
body.portal-v2 .topbar-link.topbar-logout:hover { background: rgba(255,90,90,.14); color: #ffb3b3; }

/* ── Welcome hero ── */
.v2-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 34px 38px;
  background: linear-gradient(135deg, #241b3f 0%, #3b2a6e 45%, #5B3CC4 78%, #2f8fb0 125%);
  color: #fff; margin-bottom: 22px;
  box-shadow: 0 24px 60px rgba(59,42,110,.28);
  border: 1px solid rgba(255,255,255,.08);
}
.v2-hero-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.v2-hero-orb-a { width: 380px; height: 380px; background: radial-gradient(circle, rgba(24,212,255,.22), transparent 62%); top: -140px; right: 6%; animation: v2OrbA 11s ease-in-out infinite; }
.v2-hero-orb-b { width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 60%); bottom: -160px; left: 8%; animation: v2OrbB 14s ease-in-out infinite; }
@keyframes v2OrbA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-36px,26px) scale(1.12); } }
@keyframes v2OrbB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-22px) scale(1.08); } }
.v2-hero-inner { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.v2-hero-copy { flex: 1 1 380px; min-width: 280px; }
.v2-hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: 2px;
  color: #8fe8ff; background: rgba(24,212,255,.1); border: 1px solid rgba(24,212,255,.35);
  padding: 6px 14px; border-radius: 30px; text-transform: uppercase; margin-bottom: 18px;
}
.v2-dot { width: 7px; height: 7px; border-radius: 50%; background: #18D4FF; box-shadow: 0 0 10px #18D4FF; }
.v2-hero-copy h1 { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -.5px; font-weight: 800; }
.v2-hero-sub { color: #d9d2f5; font-size: 15px; line-height: 1.7; margin: 0 0 20px; max-width: 560px; }
.v2-hero-sub strong { color: #fff; }
.v2-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.v2-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ── Buttons ── */
.v2-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; }
.v2-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s; }
.v2-btn:hover::after { transform: translateX(120%); }
.v2-btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.v2-btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.v2-btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.v2-btn-ghost.v2-btn-lg { border-radius: 12px; }
.v2-spark { color: #18D4FF; }
.v2-arrow { transition: transform .2s; }
.v2-btn:hover .v2-arrow { transform: translateX(4px); }

/* ── Hero art ── */
.v2-hero-art { position: relative; flex: 0 0 220px; height: 190px; }
.v2-art-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); }
.v2-art-ring-1 { width: 180px; height: 180px; top: 5px; left: 20px; animation: v2Spin 26s linear infinite; }
.v2-art-ring-2 { width: 220px; height: 220px; top: -15px; left: 0; border-style: dashed; animation: v2Spin 40s linear infinite reverse; }
@keyframes v2Spin { to { transform: rotate(360deg); } }
.v2-art-core {
  position: absolute; top: 55px; left: 80px; width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(24,212,255,.12), 0 18px 40px rgba(0,0,0,.35);
  animation: v2Float 6s ease-in-out infinite;
}
@keyframes v2Float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.v2-art-chip {
  position: absolute; font-size: 11.5px; font-weight: 700; color: #e6e1ff;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  padding: 7px 13px; border-radius: 20px; backdrop-filter: blur(4px);
}
.v2-art-chip-a { top: 8px; right: 0; animation: v2Float 5s ease-in-out infinite; }
.v2-art-chip-b { bottom: 26px; left: 0; animation: v2Float 7s ease-in-out infinite reverse; }

/* ── Stats ── */
.v2-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .v2-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .v2-stats { grid-template-columns: 1fr; } }
.stat-v2 {
  background: #fff; border: 1px solid var(--cp-border); border-radius: 16px; padding: 18px 20px;
  position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 10px rgba(26,26,46,.05);
}
.stat-v2:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26,26,46,.1); }
.stat-v2::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--stat-c, var(--cp-primary)); }
.stat-v2-ic {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 12px;
}
.ic-purple { background: linear-gradient(135deg, #7c5cdb, #5B3CC4); }
.ic-green  { background: linear-gradient(135deg, #34d399, #059669); }
.ic-blue   { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.ic-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.stat-v2-val { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -1px; color: var(--cp-text); }
.stat-v2-lbl { font-size: 13.5px; font-weight: 700; margin-top: 8px; color: #333; }
.stat-v2-hint { font-size: 11.5px; color: var(--cp-muted); margin-top: 2px; }

/* ── V2 cards ── */
.v2-card {
  border-radius: 16px; border: 1px solid #ece9f6;
  box-shadow: 0 4px 18px rgba(26,26,46,.05);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
.v2-card:hover { box-shadow: 0 14px 34px rgba(26,26,46,.09); }
.v2-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.v2-card-head h3 { margin: 0; }
.v2-card-head .portal-link { font-size: 13px; font-weight: 700; }

/* ── AI card ── */
.v2-card-ai { position: relative; background: linear-gradient(135deg, #ffffff 0%, #f7f4ff 100%); }
.v2-card-ai-glow {
  position: absolute; top: -70px; right: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91,60,196,.14), transparent 65%); pointer-events: none;
}
.v2-card-ai-head { position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.v2-ai-avatar {
  width: 48px; height: 48px; border-radius: 14px; font-size: 15px; flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(91,60,196,.35);
}
.v2-card-ai-title h3 { margin: 0 0 2px; font-size: 17px; }
.v2-card-ai-title .muted { margin: 0; }
.v2-hints { margin: 16px 0 18px; }
.v2-hints .portal-chip {
  background: #f0edfa; color: #4b3a86; border-color: #ddd6f5; font-weight: 600;
}
.v2-hints .portal-chip:hover { background: #e5ddfa; }
.v2-card-ai-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.v2-online { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--cp-muted); font-weight: 600; }
.v2-card-ai-head .v2-online { margin-left: auto; flex-shrink: 0; }
.v2-card-head-sub {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid rgba(91,60,196,.15);
}
body.portal-v2 .v2-card-head-sub { border-top-color: rgba(255,255,255,.1); }
.v2-card-head-sub h3 { font-size: 15px; }

/* ── History ── */
.v2-history li { border-bottom: 1px solid #f2eff9; }
.v2-history a { display: flex; align-items: center; gap: 12px; padding: 11px 6px; }
.v2-history-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: linear-gradient(135deg, #f0edfa, #e3dcf7); }
.v2-history-body { flex: 1; min-width: 0; }
.v2-history-body strong { display: block; font-size: 13.5px; color: var(--cp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-history-body small { color: var(--cp-muted); font-size: 11.5px; }
.v2-history-arrow { color: #c4bce4; font-weight: 700; }
.v2-history li:hover .v2-history-arrow { color: var(--cp-primary); transform: translateX(3px); }
.v2-history-arrow { transition: transform .15s, color .15s; }

/* ── Services grid ── */
.v2-services { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
@media (max-width: 600px) { .v2-services { grid-template-columns: 1fr; } }
.v2-services li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #333; padding: 6px 2px; }
.v2-svc-ic { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #5B3CC4, #18D4FF); }

/* ── Account ── */
.v2-account { list-style: none; margin: 0 0 16px; padding: 0; }
.v2-account li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #eee9f9; font-size: 13px; }
.v2-account li:last-child { border-bottom: none; }
.v2-acct-lbl { color: var(--cp-muted); flex-shrink: 0; }
.v2-account strong { color: var(--cp-text); text-align: right; word-break: break-word; }
.v2-account .cp-countdown { margin: 0; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; }
.v2-account .cp-cd-timer { font-size: 12.5px; }
.v2-pay-hint { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #fff8e6; border: 1px solid #f2dd9e; font-size: 12.5px; }
.v2-pay-hint strong { display: block; margin-bottom: 3px; color: #7a5b12; }
.v2-pay-hint .muted { margin: 0 0 10px; font-size: 12px; }
.v2-pay-hint .portal-btn { margin-right: 8px; padding: 7px 14px; font-size: 12px; }
.v2-milestones { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.v2-milestones li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eee9f9; }
.v2-milestones li:last-child { border-bottom: none; }
.v2-milestones .v2-ms-paid span:first-child::after { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #1e7a35; margin-left: 4px; }
.v2-milestones .v2-ms-overdue span:last-child { color: #a3312b; font-weight: 700; }

/* ── Contact ── */
.v2-contact { list-style: none; margin: 12px 0; padding: 0; }
.v2-contact li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #444; padding: 5px 0; word-break: break-all; }
.v2-contact-ic { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, #5B3CC4, #18D4FF); }

/* ── Profile form polish ── */
.v2-form input { border-radius: 10px; }
.v2-form .portal-btn { border-radius: 10px; padding: 12px 24px; }

/* ── Tip card ── */
.v2-card-tip { background: linear-gradient(135deg, #fdfbff, #f3efff); border-color: #e4ddf7; }
.v2-card-tip .muted em { color: var(--cp-primary); font-style: normal; font-weight: 600; }

/* ── Entrance animations ── */
body.portal-v2 .v2-hero, body.portal-v2 .stat-v2, body.portal-v2 .v2-card {
  opacity: 0; transform: translateY(16px);
  animation: v2Reveal .55s cubic-bezier(.22,.61,.36,1) forwards;
}
body.portal-v2 .stat-v2:nth-child(1) { animation-delay: .05s; }
body.portal-v2 .stat-v2:nth-child(2) { animation-delay: .12s; }
body.portal-v2 .stat-v2:nth-child(3) { animation-delay: .19s; }
body.portal-v2 .stat-v2:nth-child(4) { animation-delay: .26s; }
body.portal-v2 .portal-col-main .v2-card:nth-child(1) { animation-delay: .18s; }
body.portal-v2 .portal-col-main .v2-card:nth-child(2) { animation-delay: .26s; }
body.portal-v2 .portal-col-main .v2-card:nth-child(3) { animation-delay: .34s; }
body.portal-v2 .portal-col-main .v2-card:nth-child(4) { animation-delay: .42s; }
body.portal-v2 .portal-col-side .v2-card:nth-child(1) { animation-delay: .24s; }
body.portal-v2 .portal-col-side .v2-card:nth-child(2) { animation-delay: .32s; }
body.portal-v2 .portal-col-side .v2-card:nth-child(3) { animation-delay: .4s; }
body.portal-v2 .v2-gig { opacity: 0; transform: translateY(16px); animation: v2Reveal .55s cubic-bezier(.22,.61,.36,1) forwards; }
body.portal-v2 .v2-gig:nth-child(1) { animation-delay: .1s; }
body.portal-v2 .v2-gig:nth-child(2) { animation-delay: .17s; }
body.portal-v2 .v2-gig:nth-child(3) { animation-delay: .24s; }
body.portal-v2 .v2-gig:nth-child(4) { animation-delay: .31s; }
@keyframes v2Reveal { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  body.portal-v2 .v2-hero, body.portal-v2 .stat-v2, body.portal-v2 .v2-card, body.portal-v2 .v2-gig { opacity: 1; transform: none; animation: none; }
}

/* ── V2 topbar right + user chip ── */
body.portal-v2 .topbar-right { display: flex; align-items: center; gap: 18px; }
body.portal-v2 .topbar-user { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 30px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
body.portal-v2 .topbar-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; }
body.portal-v2 .topbar-avatar-text { background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; font-size: 13px; font-weight: 800; }

/* Hamburger + mobile nav (shared topbar) */
body.portal-v2 .topbar-hamburger { display: none; }
.topbar-mobile-nav {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 96;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 14px;
  background: #151226;
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  max-height: 72vh;
  overflow-y: auto;
}
body.portal-v2 .topbar-mobile-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #cfc8f0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 11px;
  transition: background .15s, color .15s;
}
body.portal-v2 .topbar-mobile-link i { width: 18px; text-align: center; color: #8b83b8; }
body.portal-v2 .topbar-mobile-link.active i { color: #22d3ee; }
body.portal-v2 .topbar-mobile-link:hover { background: rgba(255,255,255,.06); color: #fff; }
body.portal-v2 .topbar-mobile-link.active { color: #fff; background: linear-gradient(135deg, rgba(91,60,196,.55), rgba(24,212,255,.25)); }
body.portal-v2 .topbar-mobile-nav[hidden] { display: none; }

@media (max-width: 1279px) {
  body.portal-v2 .topbar-nav { display: none; }
  body.portal-v2 .topbar-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #cfc8f0;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s;
  }
  body.portal-v2 .topbar-hamburger:hover { background: rgba(255,255,255,.12); color: #fff; }
  body.portal-v2 .topbar-hamburger:active { transform: scale(.96); }
}
body.portal-v2 .topbar-user-name { color: #eee9ff; font-size: 13px; font-weight: 600; }
body.portal-v2 .topbar-logout { color: #ff9d9d; display: inline-flex; align-items: center; padding: 6px; border-radius: 50%; }
body.portal-v2 .topbar-logout:hover { background: rgba(255,90,90,.14); color: #ffb3b3; }
@media (max-width: 700px) {
  body.portal-v2 .topbar-user-name { display: none; }
  body.portal-v2 .topbar-nav { gap: 2px; }
  body.portal-v2 .topbar-link { font-size: 12.5px; padding: 7px 9px; }
}

/* ── V2 Recommended gigs ── */
.v2-gigs { margin-bottom: 24px; }
.v2-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.v2-section-head h2 { margin: 0 0 3px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.v2-section-head .muted { margin: 0; }
.v2-section-head .portal-link { font-size: 13px; font-weight: 700; }
.v2-gig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .v2-gig-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .v2-gig-grid { grid-template-columns: 1fr; } }
.v2-gig {
  background: #fff; border: 1px solid var(--cp-border); border-radius: 16px; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.v2-gig:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(26,26,46,.12); }
.v2-gig-media { display: block; height: 130px; overflow: hidden; background: linear-gradient(135deg, #2a2144, #4b3a86); }
.v2-gig-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.v2-gig:hover .v2-gig-media img { transform: scale(1.06); }
.v2-gig-body { padding: 13px 15px 15px; }
.v2-gig-cat { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #6a53c9; background: #f0edfa; padding: 3px 9px; border-radius: 20px; margin-bottom: 8px; }
.v2-gig-title { display: block; font-size: 14px; font-weight: 700; color: var(--cp-text); line-height: 1.35; margin-bottom: 10px; min-height: 38px; }
.v2-gig-title:hover { color: var(--cp-primary); }
.v2-gig-foot { display: flex; align-items: center; justify-content: space-between; }
.v2-gig-price { font-size: 15px; font-weight: 800; color: var(--cp-primary); }
.v2-gig-cta { font-size: 12.5px; font-weight: 700; color: var(--cp-primary); }
.v2-gig-cta:hover { text-decoration: underline; }

/* ── V2 Growth tips ── */
.v2-tip { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px dashed #eee9f9; }
.v2-tip:first-of-type { padding-top: 6px; }
.v2-tip:last-child { border-bottom: none; }
.v2-tip-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #5B3CC4, #18D4FF); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(91,60,196,.28);
}
.v2-tip-body strong { display: block; font-size: 13.5px; color: var(--cp-text); margin-bottom: 2px; }
.v2-tip-body p { margin: 0; font-size: 12.5px; color: var(--cp-muted); line-height: 1.55; }

/* ── V2 Avatar picker + account avatar ── */
.v2-avatar-pick { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.v2-avatar-preview { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid #f0edfa; }
.v2-avatar-preview-text { background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.v2-avatar-preview.v2-avatar-preview-img { display: block; }
.v2-avatar-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.v2-avatar-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #f0eef7; }
.v2-big-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid #f0edfa; flex-shrink: 0; }
.v2-avatar-text { background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; font-size: 21px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.v2-avatar-head-info { min-width: 0; }
.v2-avatar-head-info strong { display: block; font-size: 14.5px; color: var(--cp-text); }
.v2-avatar-head-info .muted { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── V2 Advanced footer ── */
.v2-footer { background: #171228; color: #cfc8f0; text-align: left; padding: 0; margin-top: 26px; }
.v2-footer .portal-container { padding-top: 34px; padding-bottom: 20px; }
.v2-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 26px; }
@media (max-width: 860px) { .v2-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .v2-footer-grid { grid-template-columns: 1fr; } }
.v2-footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; margin: 0 0 13px; }
.v2-footer-col ul { list-style: none; margin: 0; padding: 0; }
.v2-footer-col ul li { margin-bottom: 9px; }
.v2-footer-col ul a { color: #b9b0e0; font-size: 13px; }
.v2-footer-col ul a:hover { color: #18D4FF; }
.v2-footer-brand p { margin: 12px 0 0; font-size: 12.5px; line-height: 1.7; max-width: 300px; }
.v2-footer-contact li { font-size: 13px; color: #b9b0e0; word-break: break-all; }
.v2-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 26px; padding-top: 16px; flex-wrap: wrap; }
.v2-footer-bottom p { margin: 0; font-size: 12px; color: #8f86b5; }
.v2-footer-legal { display: flex; gap: 10px; font-size: 12px; }
.v2-footer-legal a { color: #b9b0e0; }
.v2-footer-legal a:hover { color: #18D4FF; }
.v2-footer-legal span { color: #6a6190; }

/* V2 chat: markdown rendering inside bubbles */
.chat-bubble p { margin: 4px 0; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0; padding-left: 20px; }
.chat-bubble code { background: rgba(91, 60, 196, 0.08); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.chat-bubble a { color: var(--cp-primary); font-weight: 600; }
.chat-bubble h4 { margin: 6px 0 4px; font-size: 13.5px; color: #4a2fb0; }

/* V2 Orders page */
.v2-page-title { margin: 4px 0 2px; font-size: 22px; color: var(--cp-text); }
.v2-back { display: inline-block; color: var(--cp-primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.v2-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.v2-order-status { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.v2-ostatus-pending { background: #f3f0e0; color: #8a6d00; }
.v2-ostatus-paid { background: #e3edff; color: #1d4ed8; }
.v2-ostatus-progress { background: #e6e9ff; color: #4338ca; }
.v2-ostatus-delivered { background: #e2f6ec; color: #0e7a4d; }
.v2-ostatus-completed { background: #dff3df; color: #15803d; }
.v2-ostatus-cancelled { background: #fde8e8; color: #b91c1c; }
.v2-grid-order { align-items: start; }
.v2-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.v2-card-head h3 { margin: 0; font-size: 15px; }
.v2-progress-bar { height: 8px; border-radius: 8px; background: #eceaf4; overflow: hidden; margin: 12px 0 18px; }
.v2-progress-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #7B5ED4, #18D4FF); transition: width .6s ease; }
.v2-progress-pct { font-size: 13px; font-weight: 700; color: var(--cp-primary); }
.v2-steps { list-style: none; margin: 0; padding: 0; }
.v2-step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.v2-step:not(:last-child)::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: #e2dff0; }
.v2-step-dot { width: 16px; height: 16px; min-width: 16px; border-radius: 50%; background: #d9d4ec; margin-top: 3px; }
.v2-step-completed .v2-step-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.v2-step-in_progress .v2-step-dot { background: var(--cp-primary); box-shadow: 0 0 0 4px rgba(123,94,212,.15); animation: v2Pulse 1.6s infinite; }
@keyframes v2Pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(123,94,212,.2); } 50% { box-shadow: 0 0 0 6px rgba(123,94,212,.08); } }
.v2-step-skipped .v2-step-dot { background: #a8a4b8; }
.v2-step-body { flex: 1; }
.v2-step-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.v2-step-title strong { font-size: 13.5px; }
.v2-step-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 12px; background: #eeeaf7; color: #6b6580; }
.v2-step-status-completed { background: #dff3df; color: #15803d; }
.v2-step-status-in_progress { background: #e6e9ff; color: #4338ca; }
.v2-step-status-skipped { background: #efefef; color: #888; }
.v2-step-desc { margin: 3px 0 0; font-size: 12.5px; }
.v2-step-date { margin: 3px 0 0; font-size: 11.5px; color: #9b96ad; }
.v2-delivery { border: 1px solid #e8e5f2; border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.v2-delivery-approved { border-color: #b9e4c2; }
.v2-delivery-rejected { border-color: #f3c9c9; }
.v2-delivery-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.v2-delivery-files { margin: 8px 0 0; padding-left: 18px; }
.v2-delivery-files a { color: var(--cp-primary); font-size: 13px; font-weight: 600; }
.v2-delivery-feedback { margin: 8px 0 0; font-size: 12.5px; background: #faf9fe; padding: 8px 10px; border-radius: 8px; }
.v2-delivery-actions { margin-top: 10px; }
.v2-delivery-fb { width: 100%; border: 1px solid #d9d4ec; border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; resize: vertical; }
.v2-delivery-btnrow { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.v2-activity { list-style: none; margin: 0; padding: 0; }
.v2-activity-item { position: relative; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #eceaf4; }
.v2-activity-item:last-child { border-bottom: 0; }
.v2-activity-dot { width: 10px; height: 10px; min-width: 10px; border-radius: 50%; margin-top: 5px; background: #b9b3cd; }
.v2-activity-client .v2-activity-dot { background: #18b8a6; }
.v2-activity-admin .v2-activity-dot { background: var(--cp-primary); }
.v2-activity-item strong { font-size: 13px; }
.v2-activity-item p { margin: 2px 0 0; font-size: 12.5px; }
.v2-activity-time { font-size: 11px; color: #9b96ad; }
.v2-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); animation: v2Pulse 1.6s infinite; }
.v2-req-title { margin: 12px 0 4px; font-size: 12px; font-weight: 700; }
.v2-req { margin: 0; font-size: 12.5px; background: #faf9fe; padding: 10px; border-radius: 8px; white-space: pre-wrap; }
.v2-orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.v2-order-card { background: #fff; border: 1px solid #e8e5f2; border-radius: 14px; padding: 16px; text-decoration: none; color: var(--cp-text); transition: transform .15s ease, box-shadow .15s ease; }
.v2-order-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(76,48,138,.12); }
.v2-order-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.v2-order-card-top strong { font-size: 14px; }
.v2-order-card-top p { margin: 2px 0 0; font-size: 12px; }
.v2-order-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: #6b6580; border-top: 1px dashed #eceaf4; padding-top: 10px; }
.v2-order-card-go { color: var(--cp-primary); font-weight: 700; }
.v2-empty { text-align: center; padding: 34px 20px; }
.v2-empty p { margin: 0 0 14px; font-size: 15px; }
@media (max-width: 640px) { .v2-order-head { flex-direction: column; } }

/* V2 Meeting page */
.v2-meet-form label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--cp-text); }
.v2-meet-form input[type=text], .v2-meet-form input[type=date], .v2-meet-form select, .v2-meet-form textarea { width: 100%; border: 1px solid #d9d4ec; border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 13.5px; background: #fff; color: var(--cp-text); box-sizing: border-box; }
.v2-meet-form textarea { resize: vertical; }
.v2-meet-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .v2-meet-row { grid-template-columns: 1fr; } }
.v2-meet-note { margin: 12px 0 0; font-size: 12px; color: #6b6580; }
.v2-meet-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #eceaf4; }
.v2-meet-item:last-child { border-bottom: 0; }
.v2-meet-date { width: 46px; min-width: 46px; text-align: center; background: #f1eff8; border-radius: 10px; padding: 8px 4px; }
.v2-meet-date strong { display: block; font-size: 17px; color: var(--cp-primary); }
.v2-meet-date span { font-size: 11px; color: #6b6580; text-transform: uppercase; }
.v2-meet-body { flex: 1; font-size: 13.5px; }
.v2-meet-body p { margin: 3px 0 6px; font-size: 12.5px; }
.v2-meet-past { opacity: .55; }
.v2-meet-join { margin-top: 8px; display: inline-block; }
.v2-meet-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.v2-meet-actions form { margin: 0; }

/* ===== R2+ Rewards: tokens, packages, wheel ===== */
.rk-tokens-card { background: linear-gradient(135deg,#1b1130,#33206b 55%,#0e2f47); border:none; color:#fff; border-radius:18px; padding:26px 26px; display:flex; gap:26px; align-items:center; flex-wrap:wrap; box-shadow:0 18px 40px rgba(24,212,255,.12); }
.rk-balance-main { flex:1 1 260px; }
.rk-balance-label { font-size:12px; letter-spacing:2px; text-transform:uppercase; color:#8fe8ff; font-weight:700; }
.rk-balance-value { font-size:56px; font-weight:800; line-height:1; margin:6px 0 4px; background:linear-gradient(90deg,#fff,#18D4FF); -webkit-background-clip:text; background-clip:text; color:transparent; }
.rk-balance-sub { font-size:13px; color:#b9b0e3; }
.rk-balance-meter { flex:1 1 280px; }
.rk-meter-track { height:12px; border-radius:20px; background:rgba(255,255,255,.14); overflow:hidden; margin-bottom:16px; }
.rk-meter-fill { height:100%; border-radius:20px; background:linear-gradient(90deg,#18D4FF,#5B3CC4); transition:width .5s; }
.rk-balance-actions { display:flex; gap:10px; flex-wrap:wrap; }
.rk-packages { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.rk-package { position:relative; background:#fff; border:2px solid #e6e1f7; border-radius:16px; padding:22px 20px; text-align:center; transition:transform .15s, box-shadow .15s; }
.rk-package:hover { transform:translateY(-3px); box-shadow:0 14px 34px rgba(91,60,196,.14); }
.rk-package-best { border-color:var(--cp-primary,#5B3CC4); box-shadow:0 0 0 4px rgba(91,60,196,.10), 0 18px 44px rgba(24,212,255,.18); }
.rk-package-ribbon { position:absolute; top:-12px; left:50%; transform:translateX(-50%); background:linear-gradient(90deg,#24C6FF,#18D4FF); color:#04243a; font-size:11px; font-weight:800; letter-spacing:1px; text-transform:uppercase; padding:4px 14px; border-radius:20px; white-space:nowrap; }
.rk-package-name { font-size:13px; font-weight:800; letter-spacing:2px; text-transform:uppercase; color:#6a53c9; }
.rk-package-tokens { font-size:38px; font-weight:800; color:var(--cp-text,#0d0b1f); margin:8px 0 2px; }
.rk-package-tokens span { font-size:15px; font-weight:600; color:#9a93bd; }
.rk-package-price { font-size:17px; font-weight:800; color:var(--cp-primary,#5B3CC4); margin-bottom:4px; }
.rk-package-tip { font-size:12px; color:#7d76a5; min-height:16px; margin-bottom:14px; }
.rk-package-btn { width:100%; }
.rk-package-btn-alt { margin-top:8px; }
.rk-method { display:flex; align-items:flex-start; gap:12px; padding:14px 16px; border:2px solid #e4e0f2; border-radius:12px; margin-bottom:10px; cursor:pointer; background:#fff; transition:border-color .15s, background .15s; }
.rk-method:hover { border-color:#c9c0ea; }
.rk-method:has(input:checked) { border-color:var(--cp-primary,#5B3CC4); background:#f6f3ff; }
.rk-method input[type="radio"] { margin-top:3px; accent-color:var(--cp-primary,#5B3CC4); }
.rk-method-body { display:flex; flex-direction:column; gap:2px; }
.rk-method-body strong { color:#0d0b1f; }
.rk-method-body small { color:#7d76a5; font-size:12.5px; line-height:1.45; }
.rk-method-group { margin-bottom:10px; }
.rk-sub { display:none; margin:-4px 0 12px; padding:14px 16px 6px; border:1px dashed #ddd; border-radius:0 0 12px 12px; background:#faf9ff; }
.rk-sub.rk-open { display:block; }
.rk-sub-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:#8b84ad; margin-bottom:10px; }
.rk-sub-badges { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.rk-sub-badge { font-size:11.5px; font-weight:700; color:#4a3f86; background:#eef0fb; border:1px solid #dfe1f5; border-radius:8px; padding:5px 10px; }
.rk-sub-note { font-size:12px; color:#7d76a5; line-height:1.5; margin-bottom:8px; }
.rk-sub-opt { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1.5px solid #e8e5f2; border-radius:10px; margin-bottom:8px; cursor:pointer; background:#fff; transition:border-color .15s, background .15s; }
.rk-sub-opt:hover { border-color:#c9c0ea; }
.rk-sub-opt:has(input:checked) { border-color:var(--cp-primary,#5B3CC4); background:#f6f3ff; }
.rk-sub-opt input[type="radio"] { margin-top:3px; accent-color:var(--cp-primary,#5B3CC4); }
.rk-sub-opt span { display:flex; flex-direction:column; gap:1px; }
.rk-sub-opt strong { font-size:13px; color:#0d0b1f; }
.rk-sub-opt small { font-size:11.5px; color:#7d76a5; line-height:1.4; }
body.portal-v2 .rk-sub { border-color: rgba(255,255,255,.14); background: rgba(13,11,31,.55); }
body.portal-v2 .rk-sub-badge { color:#cfc8f0; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
body.portal-v2 .rk-sub-note { color:#a29ec4; }
body.portal-v2 .rk-sub-opt { background: rgba(23,20,48,.55); border-color: rgba(255,255,255,.1); }
body.portal-v2 .rk-sub-opt:hover { border-color: rgba(255,255,255,.22); }
body.portal-v2 .rk-sub-opt:has(input:checked) { border-color: var(--cp-primary,#5B3CC4); background: rgba(91,60,196,.18); }
body.portal-v2 .rk-sub-opt strong { color: var(--cp-text,#f2f0ff); }
body.portal-v2 .rk-sub-opt small { color: var(--cp-muted,#a29ec4); }
body.portal-v2 .rk-method { background: rgba(23,20,48,.72); border-color: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
body.portal-v2 .rk-method:hover { border-color: rgba(255,255,255,.2); }
body.portal-v2 .rk-method:has(input:checked) { border-color: var(--cp-primary,#5B3CC4); background: rgba(91,60,196,.18); }
body.portal-v2 .rk-method-body strong { color: var(--cp-text,#f2f0ff); }
body.portal-v2 .rk-method-body small { color: var(--cp-muted,#a29ec4); }
.rk-pay-steps { margin:8px 0 0; padding-left:20px; font-size:14px; color:#444; line-height:1.7; }
.rk-pay-help { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:14px; padding-top:14px; border-top:1px dashed #ddd; font-size:14px; color:#444; }
.rk-pay-help .portal-btn { padding:8px 16px; font-size:13px; }
.rk-status-pending { background:#fff2cc; color:#8a6d1a; }
.rk-status-confirmed { background:#e3fbea; color:#167a3d; }
.rk-status-paid { background:#e3fbea; color:#167a3d; }
.rk-status-cancelled { background:#ffe9e9; color:#b01f1f; }
@media (max-width:820px){ .rk-packages{grid-template-columns:1fr;} .rk-package{max-width:420px;margin:0 auto;width:100%;} }

/* ===== Rewards wheel page ===== */
.rk-chance-badge { background:linear-gradient(135deg,#5B3CC4,#18D4FF); color:#fff; font-weight:800; font-size:14px; padding:10px 18px; border-radius:30px; box-shadow:0 8px 22px rgba(91,60,196,.3); white-space:nowrap; }
.rk-pending-coupon { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; background:#fdf6e3; border:2px solid #ffd166; border-radius:14px; padding:14px 18px; margin-bottom:22px; font-size:14px; color:#5a4a12; }
.rk-code { font-family:ui-monospace,Consolas,monospace; font-weight:800; color:#8a6d1a; background:#fff; border:1px dashed #e2c15c; padding:2px 10px; border-radius:8px; letter-spacing:1px; }
.rk-wheel-wrap { display:grid; grid-template-columns:minmax(320px,1fr) minmax(300px,1fr); gap:26px; align-items:start; }
.rk-wheel-stage { position:relative; width:min(100%,420px); margin:0 auto; }
.rk-wheel-stage canvas { width:100%; height:auto; display:block; filter:drop-shadow(0 18px 34px rgba(91,60,196,.35)); }
.rk-pointer { position:absolute; top:-10px; left:50%; transform:translateX(-50%); width:0; height:0; border-left:16px solid transparent; border-right:16px solid transparent; border-top:26px solid #E63946; z-index:3; filter:drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.rk-hub { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:72px; height:72px; border-radius:50%; background:linear-gradient(135deg,#fff,#e8e2ff); color:#5B3CC4; font-weight:800; font-size:15px; letter-spacing:1px; display:flex; align-items:center; justify-content:center; box-shadow:0 6px 18px rgba(0,0,0,.25); z-index:2; border:4px solid #fff; }
.rk-spin-btn { width:100%; font-size:16px; padding:14px 22px; }
.rk-spin-btn:disabled { opacity:.5; cursor:not-allowed; }
.rk-how h4 { margin:18px 0 8px; font-size:14px; font-weight:800; color:var(--cp-text); }
.rk-how ul { margin:0; padding-left:18px; font-size:13.5px; color:#555; line-height:1.8; }
.rk-coupon-row { display:flex; gap:8px; margin-top:14px; }
.rk-coupon-row input { flex:1; min-width:0; border:2px solid #e6e1f7; border-radius:10px; padding:10px 12px; font-size:14px; text-transform:uppercase; letter-spacing:1px; }
.rk-coupon-row input:focus { outline:none; border-color:var(--cp-primary); }
.rk-credits-btn { width:100%; margin-top:10px; }
.rk-credits-btn:disabled { opacity:.5; cursor:not-allowed; }
.rk-spin-result { margin-top:14px; background:linear-gradient(135deg,#f0edfa,#e6f9ff); border:2px solid var(--cp-primary); border-radius:12px; padding:14px 16px; font-size:14px; color:#33205b; }
@media (max-width:860px){ .rk-wheel-wrap{grid-template-columns:1fr;} }

/* ===== Referral page ===== */
.rk-ref-wrap { display:grid; grid-template-columns:1.2fr 1fr; gap:22px; align-items:start; }
.rk-ref-fan { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; background:linear-gradient(135deg,#f6f3ff,#e9f9ff); border-radius:18px; padding:26px; }
.rk-ref-card { border-radius:16px; padding:18px 22px; font-weight:800; font-size:15px; line-height:1.6; text-align:center; box-shadow:0 10px 26px rgba(91,60,196,.14); }
.rk-ref-card span { display:block; font-size:12.5px; font-weight:600; opacity:.85; }
.rk-ref-card-a { background:linear-gradient(135deg,#5B3CC4,#7c5fe0); color:#fff; }
.rk-ref-card-f { background:linear-gradient(135deg,#18D4FF,#24C6FF); color:#04243a; }
.rk-ref-arrow { font-size:28px; font-weight:800; color:var(--cp-primary); }
.rk-ref-plus { width:100%; text-align:center; font-weight:700; color:#6a53c9; font-size:13.5px; }
.rk-ref-link-row { display:flex; gap:8px; }
.rk-ref-link-row input { flex:1; min-width:0; border:2px solid #e6e1f7; border-radius:10px; padding:10px 12px; font-size:13px; font-family:ui-monospace,Consolas,monospace; background:#faf9ff; }
.rk-ref-share { display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; }
.rk-share-btn { flex:1; min-width:150px; text-align:center; background:#f0edfa; color:#5B3CC4; font-weight:700; font-size:13px; padding:11px 14px; border-radius:10px; text-decoration:none; border:2px solid #e0d9f5; transition:background .15s; }
.rk-share-btn:hover { background:#e6e0fa; }
.rk-ref-how { margin:6px 0 16px; padding-left:18px; font-size:14px; color:#444; line-height:1.9; }
.rk-ref-clicks { font-size:12px; font-weight:700; color:var(--cp-primary,#5B3CC4); background:#f0edfa; border:1px solid #e0d9f5; padding:5px 12px; border-radius:100px; }
body.portal-v2 .rk-ref-clicks { color:#c3b6ff; background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.12); }
.rk-ref-banner { background:#eefdf4; border:2px solid #b9ecd0; color:#166b3a; padding:12px 14px; border-radius:12px; margin-bottom:14px; font-size:13.5px; }
@media (max-width:860px){ .rk-ref-wrap{grid-template-columns:1fr;} }

/* ===== Dashboard purpose-first (R6) ===== */
.rk-paths { margin-bottom:22px; }
.rk-path-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.rk-path { display:flex; align-items:center; gap:14px; background:#fff; border:2px solid #e6e1f7; border-radius:16px; padding:18px; text-decoration:none; transition:transform .15s, box-shadow .15s, border-color .15s; }
.rk-path:hover { transform:translateY(-3px); box-shadow:0 16px 38px rgba(91,60,196,.16); }
.rk-path-ai:hover { border-color:#5B3CC4; }
.rk-path-buy:hover { border-color:#18D4FF; }
.rk-path-order:hover { border-color:#2EC4B6; }
.rk-path-ic { flex-shrink:0; width:52px; height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center; color:#fff; }
.rk-path-ai .rk-path-ic { background:linear-gradient(135deg,#5B3CC4,#7c5fe0); }
.rk-path-buy .rk-path-ic { background:linear-gradient(135deg,#18D4FF,#0e8fb4); }
.rk-path-order .rk-path-ic { background:linear-gradient(135deg,#2EC4B6,#1d8f85); }
.rk-path-body { flex:1; min-width:0; }
.rk-path-body strong { display:block; font-size:15px; color:var(--cp-text); margin-bottom:3px; }
.rk-path-body span { font-size:12.5px; color:#7d76a5; line-height:1.4; display:block; }
.rk-path-go { font-size:12px; font-weight:800; color:var(--cp-primary); white-space:nowrap; }
.rk-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; background:linear-gradient(135deg,#1b1130,#33206b 55%,#0e2f47); border-radius:18px; padding:20px 22px; color:#fff; box-shadow:0 16px 38px rgba(24,212,255,.12); margin-bottom:26px; }
.rk-strip-item { border-right:1px solid rgba(255,255,255,.12); padding:0 18px; }
.rk-strip-item:last-child { border-right:none; }
.rk-strip-label { font-size:11px; letter-spacing:2px; text-transform:uppercase; color:#8fe8ff; font-weight:700; }
.rk-strip-val { font-size:30px; font-weight:800; line-height:1.1; margin:4px 0 6px; }
.rk-strip-meter { height:8px; border-radius:20px; background:rgba(255,255,255,.16); overflow:hidden; margin-bottom:8px; }
.rk-strip-fill { height:100%; border-radius:20px; background:#18D4FF; }
.rk-tone-good { background:linear-gradient(90deg,#18D4FF,#5B3CC4); }
.rk-tone-low { background:linear-gradient(90deg,#FFD166,#FF9F1C); }
.rk-tone-empty { background:#E63946; }
.rk-strip-sub { font-size:12px; color:#b9b0e3; margin-bottom:6px; min-height:16px; }
.rk-strip-link { font-size:12px; font-weight:800; color:#fff; text-decoration:underline; text-underline-offset:3px; }
@media (max-width:820px){ .rk-path-grid{grid-template-columns:1fr;} .rk-strip{grid-template-columns:1fr;} .rk-strip-item{border-right:none;border-bottom:1px solid rgba(255,255,255,.12);padding:12px 0;} .rk-strip-item:last-child{border-bottom:none;} }

/* ===== Chat token bar ===== */
.chat-token-bar { display:flex; align-items:center; gap:8px; padding:10px 14px; margin:0 12px 10px; background:#f4f1fd; border-radius:12px; border:1px solid #e6e1f7; flex-wrap:wrap; }
.chat-token-label { font-size:11.5px; font-weight:800; color:#4b3a86; }
.chat-token-track { flex:1; min-width:60px; height:6px; border-radius:10px; background:#ddd6f5; overflow:hidden; }
.chat-token-fill { display:block; height:100%; border-radius:10px; background:linear-gradient(90deg,#18D4FF,#5B3CC4); }
.chat-token-bar.rk-tone-low .chat-token-fill { background:linear-gradient(90deg,#FFD166,#FF9F1C); }
.chat-token-bar.rk-tone-empty { background:#ffe9e9; border-color:#f5b9b9; }
.chat-token-bar.rk-tone-empty .chat-token-fill { background:#E63946; }
.chat-tokenbar-mobile { display:none; align-items:center; gap:8px; padding:9px 14px; margin:0 0 10px; background:#f4f1fd; border-radius:12px; border:1px solid #e6e1f7; font-size:13px; color:var(--cp-muted); flex-wrap:wrap; }
.chat-tokenbar-mobile .chat-mcost { font-size:12px; opacity:.8; }
.chat-tokenbar-mobile a.chat-mtopup { margin-left:auto; color:var(--cp-primary,#5B3CC4); font-weight:700; text-decoration:none; }
.chat-tokenbar-mobile.rk-tone-low { background:#fff8e6; border-color:#f2dd9e; }
.chat-tokenbar-mobile.rk-tone-empty { background:#ffe9e9; border-color:#f5b9b9; }
@media (max-width: 760px) { .chat-tokenbar-mobile { display:flex; } }
.chat-token-get { font-size:11.5px; font-weight:800; color:#5B3CC4; text-decoration:none; white-space:nowrap; }

/* ===== Topbar (links) ===== */
body.portal-v2 .topbar-inner { gap: 14px; }
body.portal-v2 .topbar-link { flex: 0 0 auto; white-space: nowrap; font-size: 13px; padding: 8px 11px; }
.topbar-min-hide { }
@media (max-width: 1060px) { body.portal-v2 .topbar-min-hide { display: none; } }
@media (max-width: 700px) {
  body.portal-v2 .topbar-nav { gap: 2px; }
  body.portal-v2 .topbar-link { font-size: 12px; padding: 7px 8px; }
}

/* ================================================================
   DARK PREMIUM THEME (portal matches landing-page grade)
   Scoped under body.portal-v2 so auth/login pages stay untouched.
   ================================================================ */
body.portal-v2 {
  background:
    radial-gradient(1100px 480px at 88% -8%, rgba(91,60,196,.16), transparent 60%),
    radial-gradient(900px 460px at -8% 12%, rgba(24,212,255,.10), transparent 60%),
    linear-gradient(180deg, #0d0b1f 0%, #12102a 55%, #0b0918 100%);
  background-attachment: fixed;
  color: var(--cp-text);
}
body.portal-v2 a { color: #8fb6ff; }
body.portal-v2 .muted { color: var(--cp-muted); }

/* ── Cards ── */
body.portal-v2 .portal-card,
body.portal-v2 .rk-package,
body.portal-v2 .rk-path,
body.portal-v2 .v2-order-card,
body.portal-v2 .v2-delivery {
  background: rgba(23,20,48,.72);
  border-color: rgba(255,255,255,.09);
  box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
}
body.portal-v2 .portal-card h2 { color: var(--cp-text); }
body.portal-v2 .portal-card p, body.portal-v2 .portal-card li { color: #c9c3ea; }

/* ── Stats + v2 cards ── */
body.portal-v2 .stat-v2,
body.portal-v2 .v2-card,
body.portal-v2 .v2-gig {
  background: rgba(23,20,48,.72);
  border-color: rgba(255,255,255,.09);
  box-shadow: 0 4px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}
body.portal-v2 .stat-v2:hover { box-shadow: 0 14px 34px rgba(0,0,0,.5); }
body.portal-v2 .stat-v2-lbl { color: #e8e4ff; }
body.portal-v2 .v2-card-ai {
  background: linear-gradient(135deg, rgba(43,34,82,.75) 0%, rgba(24,20,48,.75) 100%);
}
body.portal-v2 .v2-card-tip { background: linear-gradient(135deg, rgba(43,34,82,.7), rgba(27,23,60,.7)); border-color: rgba(24,212,255,.16); }
body.portal-v2 .v2-card-head h3 { color: var(--cp-text); }
body.portal-v2 .v2-section-head h2 { color: var(--cp-text); }

/* ── Hero stays vibrant ── */
body.portal-v2 .v2-hero {
  background: linear-gradient(135deg, #241b3f 0%, #3b2a6e 45%, #5B3CC4 78%, #2f8fb0 125%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

/* ── Inputs / selects / textareas ── */
body.portal-v2 .profile-form input,
body.portal-v2 .auth-form input,
body.portal-v2 .auth-split-card .auth-form input,
body.portal-v2 .v2-meet-form input[type=text],
body.portal-v2 .v2-meet-form input[type=date],
body.portal-v2 .v2-meet-form input[type=email],
body.portal-v2 .v2-meet-form input[type=password],
body.portal-v2 .v2-meet-form select,
body.portal-v2 .v2-meet-form textarea,
body.portal-v2 .rk-ref-link-row input,
body.portal-v2 .rk-coupon-row input,
body.portal-v2 .v2-delivery-fb,
body.portal-v2 .rk-wheel-wrap input,
body.portal-v2 .chat-inputbar input {
  background: #12101f !important;
  border-color: rgba(255,255,255,.13) !important;
  color: var(--cp-text) !important;
}
body.portal-v2 select option { background: #171430; color: var(--cp-text); }
body.portal-v2 input::placeholder, body.portal-v2 textarea::placeholder { color: #6b6490; }
body.portal-v2 .profile-form label, body.portal-v2 .auth-form label, body.portal-v2 .auth-field label,
body.portal-v2 .v2-meet-form label { color: #d8d1f5; }
body.portal-v2 .auth-field label { color: #d8d1f5; }
body.portal-v2 .auth-input-wrap input { background: #12101f; border-color: rgba(255,255,255,.13); color: var(--cp-text); }
body.portal-v2 .auth-input-icon { color: #7d76a5; }

/* ── Buttons ── */
body.portal-v2 .portal-btn-ghost { color: #8fb6ff; border-color: rgba(24,212,255,.4); }
body.portal-v2 .portal-btn-ghost:hover { background: rgba(24,212,255,.1); }
body.portal-v2 .portal-btn-google { background: #1b1833; color: #e8e4ff; border-color: rgba(255,255,255,.14); }
body.portal-v2 .coming-soon { background: rgba(255,209,102,.14); color: #ffd166; }

/* ── Alerts ── */
body.portal-v2 .portal-alert-error { background: rgba(220,53,69,.12); border-color: rgba(245,108,108,.4); color: #ff9d9d; }
body.portal-v2 .portal-alert-success { background: rgba(40,167,69,.12); border-color: rgba(76,209,128,.4); color: #7ddf9d; }
body.portal-v2 .portal-alert-warn { background: rgba(255,193,7,.1); border-color: rgba(255,193,7,.4); color: #ffd75e; }
body.portal-v2 .portal-alert-info { background: rgba(93,125,255,.12); border-color: rgba(120,148,255,.4); color: #a8b8ff; }

/* ── Chat ── */
body.portal-v2 .chat-layout { background: #12101f; border-color: rgba(255,255,255,.1); }
body.portal-v2 .chat-sidebar {
  background: #0f0d21;
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.portal-v2 .chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  background: rgba(15, 13, 33, .95);
}

body.portal-v2 .chat-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.portal-v2 .chat-sidebar-title i {
  color: #8b5cf6;
  font-size: 12px;
}

body.portal-v2 .chat-sidebar-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

body.portal-v2 .chat-sidebar-close:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.08);
}

body.portal-v2 .chat-new-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 10px 10px 6px;
  background: linear-gradient(135deg, rgba(109, 77, 240, .2), rgba(34, 211, 238, .15));
  border: 1px solid rgba(109, 77, 240, .3);
  border-radius: 10px;
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  flex-shrink: 0;
}

body.portal-v2 .chat-new-btn:hover {
  background: linear-gradient(135deg, rgba(109, 77, 240, .3), rgba(34, 211, 238, .25));
  border-color: rgba(109, 77, 240, .5);
  color: #fff;
}

body.portal-v2 .chat-token-bar {
  margin: 6px 10px;
  padding: 8px 10px;
  background: rgba(30, 41, 59, .6);
  border: 1px solid rgba(75, 85, 99, .4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.portal-v2 .chat-token-label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

body.portal-v2 .chat-token-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}

body.portal-v2 .chat-token-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6d4df0, #22d3ee);
  border-radius: 2px;
  transition: width .3s;
}

body.portal-v2 .chat-token-get {
  font-size: 10px;
  color: #818cf8;
  text-decoration: none;
  padding: 3px 8px;
  background: rgba(129, 140, 248, .15);
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

body.portal-v2 .chat-token-get:hover {
  background: rgba(129, 140, 248, .25);
}

body.portal-v2 .history-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px;
  flex: 1;
  overflow-y: auto;
}

body.portal-v2 .history-list li {
  position: relative;
  margin-bottom: 2px;
}

body.portal-v2 .history-list li a {
  display: block;
  padding: 9px 10px;
  font-size: 12.5px;
  color: #94a3b8;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: all .15s;
}

body.portal-v2 .history-list li a:hover {
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
}

body.portal-v2 .history-list li.active a {
  background: rgba(109, 77, 240, .2);
  color: #c4b5fd;
  border-left: 2px solid #6d4df0;
  padding-left: 8px;
}

body.portal-v2 .history-list small {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-top: 3px;
}

body.portal-v2 .history-list li:hover .chat-rename-btn {
  opacity: 1;
}

body.portal-v2 .chat-hist-empty {
  padding: 20px 14px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.portal-v2 .chat-inputbar { background: #12101f; border-color: rgba(255,255,255,.1); }
body.portal-v2 .chat-msg.bot .chat-bubble, body.portal-v2 .typing-bubble { background: #1d1838 !important; color: #e4e0ff !important; border-bottom-left-radius: 4px !important; }
body.portal-v2 .chat-msg.user .chat-bubble { background: linear-gradient(135deg, #5B3CC4, #473090) !important; color: #fff !important; }
body.portal-v2 .chat-bubble code { background: rgba(255,255,255,.1); color: #8fe8ff; }
body.portal-v2 .chat-bubble h4 { color: #a78bfa; }
body.portal-v2 .chat-bubble a { color: #8fb6ff; }
body.portal-v2 .chat-charcount { color: #6b658c; }
body.portal-v2 .chat-charcount.over { color: #ff8fa3; }
body.portal-v2 .chat-empty h3 { color: #fff; }
body.portal-v2 .chat-empty p { color: #b5aee0; }
body.portal-v2 .chat-chip { border-color: #3a3158; background: rgba(255,255,255,.06); color: #c3b6ff; }
body.portal-v2 .chat-chip:hover { background: linear-gradient(135deg, #5B3CC4, #473090); color: #fff; border-color: transparent; }
body.portal-v2 .chat-bubble-note { border-top-color: #352e55; color: #8d85b8; }
body.portal-v2 .chat-inputwrap textarea { background: #0f0d21; border-color: #332a52; color: #e4e0ff; }
body.portal-v2 .chat-inputwrap textarea:focus { border-color: #5B3CC4; box-shadow: 0 0 0 3px rgba(91,60,196,.25); }
body.portal-v2 .chat-inputwrap textarea::placeholder { color: #6b658c; }

/* ── History / lists / account ── */
body.portal-v2 .v2-history li { border-bottom-color: rgba(255,255,255,.07); }
body.portal-v2 .v2-history-ic { background: linear-gradient(135deg, #2a2148, #3b2f66); }
body.portal-v2 .v2-history-body small { color: var(--cp-muted); }
body.portal-v2 .v2-history-arrow { color: #6b6490; }
body.portal-v2 .v2-services li { color: #d8d1f5; }
body.portal-v2 .v2-account li { border-bottom-color: rgba(255,255,255,.07); }
body.portal-v2 .v2-pay-hint { background: rgba(255,193,7,.08); border-color: rgba(255,193,7,.35); }
body.portal-v2 .v2-pay-hint strong { color: #ffd75e; }
body.portal-v2 .v2-milestones li { border-bottom-color: rgba(255,255,255,.07); }
body.portal-v2 .v2-milestones .v2-ms-paid span:first-child::after { color: #34d399; }
body.portal-v2 .v2-milestones .v2-ms-overdue span:last-child { color: #ff9d9d; }
body.portal-v2 .v2-contact li { color: #d8d1f5; }
body.portal-v2 .v2-hints .portal-chip { background: #241d47; color: #c3b6ff; border-color: rgba(24,212,255,.25); }
body.portal-v2 .v2-hints .portal-chip:hover { background: #2f2560; }
body.portal-v2 .history-list a:hover { background: rgba(255,255,255,.05); }
body.portal-v2 .history-list li.active a { background: rgba(91,60,196,.25); color: #c3b6ff; }
body.portal-v2 .services-chip-list li { background: rgba(255,255,255,.04); color: #cfc8f0; border-color: rgba(255,255,255,.1); }

/* ── Tips / avatars / gigs ── */
body.portal-v2 .v2-tip { border-bottom-color: rgba(255,255,255,.07); }
body.portal-v2 .v2-gig-cat { background: rgba(91,60,196,.25); color: #b7a6ff; }
body.portal-v2 .v2-avatar-preview, body.portal-v2 .v2-big-avatar { border-color: #33295c; }
body.portal-v2 .v2-avatar-head { border-bottom-color: rgba(255,255,255,.08); }

/* ── Meeting ── */
body.portal-v2 .v2-meet-note { color: #9b96ad; }
body.portal-v2 .v2-meet-date { background: rgba(255,255,255,.07); }
body.portal-v2 .v2-meet-date strong { color: #8fb6ff; }
body.portal-v2 .v2-meet-item { border-bottom-color: rgba(255,255,255,.07); }

/* ── Orders ── */
body.portal-v2 .v2-ostatus-pending { background: rgba(255,209,102,.14); color: #ffd166; }
body.portal-v2 .v2-ostatus-paid { background: rgba(93,125,255,.16); color: #a8b8ff; }
body.portal-v2 .v2-ostatus-progress { background: rgba(93,125,255,.14); color: #b1bdff; }
body.portal-v2 .v2-ostatus-delivered { background: rgba(40,167,69,.14); color: #7ddf9d; }
body.portal-v2 .v2-ostatus-completed { background: rgba(40,167,69,.16); color: #8fe3ab; }
body.portal-v2 .v2-ostatus-cancelled { background: rgba(220,53,69,.14); color: #ff9d9d; }
body.portal-v2 .v2-progress-bar { background: rgba(255,255,255,.1); }
body.portal-v2 .v2-steps .v2-step:not(:last-child)::before { background: rgba(255,255,255,.12); }
body.portal-v2 .v2-step-dot { background: #3a3450; }
body.portal-v2 .v2-step-skipped .v2-step-dot { background: #2a2540; }
body.portal-v2 .v2-step-status { background: rgba(255,255,255,.07); color: #c9c3ea; }
body.portal-v2 .v2-step-status-completed { background: rgba(40,167,69,.16); color: #8fe3ab; }
body.portal-v2 .v2-step-status-in_progress { background: rgba(93,125,255,.16); color: #b1bdff; }
body.portal-v2 .v2-step-status-skipped { background: rgba(255,255,255,.07); color: #9b96ad; }
body.portal-v2 .v2-delivery-approved { border-color: rgba(40,167,69,.4); }
body.portal-v2 .v2-delivery-rejected { border-color: rgba(220,53,69,.4); }
body.portal-v2 .v2-delivery-feedback, body.portal-v2 .v2-req { background: rgba(255,255,255,.05); color: #cfc8f0; }
body.portal-v2 .v2-activity-item { border-bottom-color: rgba(255,255,255,.07); }
body.portal-v2 .v2-activity-dot { background: #4a4568; }
body.portal-v2 .v2-order-card-meta { color: #9b96ad; border-top-color: rgba(255,255,255,.08); }

/* ── Reward tokens/packages/wheel/referral/paths ── */
body.portal-v2 .rk-package-tokens { color: var(--cp-text); }
body.portal-v2 .rk-package-price { color: #8fb6ff; }
body.portal-v2 .rk-package-tip { color: #9b96ad; }
body.portal-v2 .rk-pay-steps { color: #cfc8f0; }
body.portal-v2 .rk-pay-help { color: #cfc8f0; border-top-color: rgba(255,255,255,.12); }
body.portal-v2 .rk-pending-coupon { background: rgba(255,209,102,.1); border-color: rgba(255,209,102,.4); color: #ffdf85; }
body.portal-v2 .rk-code { background: #171430; color: #ffd166; border-color: rgba(255,209,102,.4); }
body.portal-v2 .rk-spin-result { background: linear-gradient(135deg, rgba(91,60,196,.25), rgba(24,212,255,.15)); border-color: rgba(143,182,255,.5); color: #eef1ff; }
body.portal-v2 .rk-hub { background: linear-gradient(135deg, #2a2148, #171430); color: #fff; border-color: #5B3CC4; }
body.portal-v2 .rk-ref-fan { background: linear-gradient(135deg, rgba(43,34,82,.7), rgba(24,40,60,.7)); border: 1px solid rgba(255,255,255,.09); }
body.portal-v2 .rk-ref-plus { color: #c3b6ff; }
body.portal-v2 .rk-share-btn { background: #241d47; color: #c3b6ff; border-color: rgba(24,212,255,.25); }
body.portal-v2 .rk-share-btn:hover { background: #2f2560; }
body.portal-v2 .rk-ref-how { color: #cfc8f0; }
body.portal-v2 .rk-ref-banner { background: rgba(40,167,69,.1); border-color: rgba(76,209,128,.35); color: #8fe3ab; }
body.portal-v2 .rk-status-pending { background: rgba(255,209,102,.14); color: #ffd166; }
body.portal-v2 .rk-status-confirmed { background: rgba(40,167,69,.16); color: #8fe3ab; }
body.portal-v2 .rk-status-paid { background: rgba(40,167,69,.16); color: #8fe3ab; }
body.portal-v2 .rk-status-cancelled { background: rgba(220,53,69,.14); color: #ff9d9d; }
body.portal-v2 .rk-path-body span { color: #9b96ad; }
body.portal-v2 .rk-path-go { color: #8fb6ff; }

/* ── Chat token bar ── */
body.portal-v2 .chat-token-bar { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
body.portal-v2 .chat-token-label { color: #c3b6ff; }
body.portal-v2 .chat-token-track { background: rgba(255,255,255,.12); }
body.portal-v2 .chat-token-bar.rk-tone-empty { background: rgba(220,53,69,.12); border-color: rgba(245,108,108,.4); }
body.portal-v2 .chat-tokenbar-mobile { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: #cfc8f0; }
body.portal-v2 .chat-tokenbar-mobile a.chat-mtopup { color: #8fb6ff; }
body.portal-v2 .chat-tokenbar-mobile.rk-tone-low { background: rgba(255,193,7,.08); border-color: rgba(255,193,7,.35); }
body.portal-v2 .chat-tokenbar-mobile.rk-tone-empty { background: rgba(220,53,69,.12); border-color: rgba(245,108,108,.4); }
body.portal-v2 .chat-token-get { color: #8fb6ff; }

/* ── Auth split (portal login/register) ── */
body.portal-v2.auth-split-body { background: #0d0b1f; }
body.portal-v2 .auth-split-card { background: rgba(23,20,48,.85); border-color: rgba(255,255,255,.1); box-shadow: 0 24px 70px rgba(0,0,0,.5); backdrop-filter: blur(10px); }
body.portal-v2 .auth-split-brand h2 { color: var(--cp-text); }
body.portal-v2 .auth-otp-head h3 { color: var(--cp-text); }
body.portal-v2 .auth-card { background: rgba(23,20,48,.9); color: var(--cp-text); }

/* ── Selection + scrollbar polish ── */
body.portal-v2 ::selection { background: rgba(91,60,196,.55); color: #fff; }
body.portal-v2 ::-webkit-scrollbar { width: 10px; height: 10px; }
body.portal-v2 ::-webkit-scrollbar-track { background: #0d0b1f; }
body.portal-v2 ::-webkit-scrollbar-thumb { background: #33295c; border-radius: 10px; border: 2px solid #0d0b1f; }
body.portal-v2 ::-webkit-scrollbar-thumb:hover { background: #473090; }
@media (prefers-color-scheme: dark) { }

/* ================================================================
   REWARDS IMMERSIVE ARENA (full-screen spin experience)
   ================================================================ */
.rk-arena {
  position: relative;
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 20px 80px;
  background:
    radial-gradient(800px 480px at 50% -10%, rgba(91,60,196,.28), transparent 60%),
    radial-gradient(700px 420px at 8% 88%, rgba(24,212,255,.12), transparent 60%),
    radial-gradient(600px 400px at 94% 70%, rgba(124,92,219,.14), transparent 62%),
    linear-gradient(180deg, #0d0b1f 0%, #140f2e 55%, #0b0918 100%);
}
.rk-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(30px); }
.rk-orb-a { width: 480px; height: 480px; background: radial-gradient(circle, rgba(91,60,196,.5), transparent 65%); top: -160px; right: 12%; animation: rkDrift 14s ease-in-out infinite; }
.rk-orb-b { width: 380px; height: 380px; background: radial-gradient(circle, rgba(24,212,255,.35), transparent 62%); bottom: -120px; left: 4%; animation: rkDrift 18s ease-in-out infinite reverse; }
.rk-orb-c { width: 260px; height: 260px; background: radial-gradient(circle, rgba(255,209,102,.18), transparent 62%); top: 38%; left: 46%; animation: rkDrift 22s ease-in-out infinite; }
@keyframes rkDrift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-42px,30px) scale(1.12); } }
.rk-starfield { position: absolute; inset: 0; pointer-events: none; }
.rk-starfield span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .25; animation: rkTwinkle 6s ease-in-out infinite; }
@keyframes rkTwinkle { 0%,100% { opacity: .12; } 50% { opacity: .7; } }

.rk-arena-inner { position: relative; z-index: 2; width: min(100%, 980px); margin: 0 auto; text-align: center; }
.rk-arena-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; text-align: left; margin-bottom: 26px; }
.rk-arena-title { margin: 0; font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.5px; color: #fff; }
.rk-arena-sub { margin: 6px 0 0; max-width: 560px; color: #b9b0e0; font-size: 14.5px; line-height: 1.6; }
.rk-floatbadge { font-size: 15px; padding: 12px 22px; box-shadow: 0 10px 30px rgba(91,60,196,.45), 0 0 0 4px rgba(24,212,255,.12); }

.rk-pending-card {
  position: relative; max-width: 640px; margin: 0 auto 30px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(43,34,82,.85), rgba(24,40,74,.85));
  border: 1px solid rgba(24,212,255,.35); border-radius: 16px; padding: 18px 22px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  text-align: left;
}
.rk-pc-inner { flex: 1; min-width: 220px; }
.rk-pc-label { font-size: 10.5px; font-weight: 800; letter-spacing: 2px; color: #8fe8ff; text-transform: uppercase; }
.rk-pc-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 20px; letter-spacing: 2px; color: #ffd166; margin: 4px 0 2px; }
.rk-pc-meta { font-size: 12px; color: #b9b0e0; }
.rk-pc-btn { flex-shrink: 0; }

.rk-wheel-stage { position: relative; width: min(100%, 500px); margin: 0 auto 26px; }
.rk-wheel-stage::before {
  content: ''; position: absolute; inset: -34px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(24,212,255,.25), rgba(91,60,196,.35), rgba(255,209,102,.18), rgba(24,212,255,.25));
  filter: blur(28px); animation: rkSpinSlow 16s linear infinite;
}
@keyframes rkSpinSlow { to { transform: rotate(360deg); } }
.rk-wheel-stage canvas {
  width: 100%; height: auto; display: block; position: relative; z-index: 2;
  filter: drop-shadow(0 24px 50px rgba(91,60,196,.5));
}
.rk-pointer { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 19px solid transparent; border-right: 19px solid transparent; border-top: 32px solid #E63946; z-index: 4; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.rk-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(135deg, #f4f0ff, #c7bcff); color: #37216e; font-weight: 800; font-size: 17px; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 2px 6px rgba(255,255,255,.8); z-index: 3; border: 5px solid rgba(255,255,255,.9);
  cursor: pointer; user-select: none; animation: rkHubGlow 3s ease-in-out infinite;
}
@keyframes rkHubGlow { 0%,100% { box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 0 rgba(24,212,255,.35); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 12px rgba(24,212,255,0); } }

.rk-spin-cta { position: relative; z-index: 2; margin: 0 auto 26px; width: min(100%, 420px); }
.rk-spin-btn { width: 100%; font-size: 18px; font-weight: 800; padding: 17px 26px; border-radius: 14px; letter-spacing: 1px; background: linear-gradient(135deg, #5B3CC4, #18D4FF); box-shadow: 0 14px 40px rgba(24,212,255,.35); }
.rk-spin-btn:hover { background: linear-gradient(135deg, #6b4bd8, #43dcff); }
.rk-spin-btn:disabled { opacity: .55; cursor: not-allowed; }

.rk-arena-actions { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 760px) { .rk-arena-actions { grid-template-columns: 1fr; } }
.rk-chip-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; text-align: left;
  background: rgba(23,20,48,.7); border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.rk-chip-ic { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.rk-ic-coupon { background: linear-gradient(135deg, #5B3CC4, #7c5fe0); box-shadow: 0 8px 20px rgba(91,60,196,.4); }
.rk-ic-credits { background: linear-gradient(135deg, #18D4FF, #0e8fb4); box-shadow: 0 8px 20px rgba(24,212,255,.4); }
.rk-chip-body { flex: 1; min-width: 0; }
.rk-chip-body strong { display: block; font-size: 13.5px; color: var(--cp-text); }
.rk-chip-body span { font-size: 12px; color: #9b96ad; }
.rk-chip-form { display: flex; gap: 8px; flex-shrink: 0; }
.rk-chip-form input { width: 150px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #ffd166 !important; }
@media (max-width: 520px) { .rk-chip-form { width: 100%; } .rk-chip-form input { flex: 1; width: auto; } }

.rk-how-box { position: relative; z-index: 2; max-width: 460px; margin: 0 auto 26px; text-align: left; background: rgba(23,20,48,.6); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 18px; }
.rk-how-box summary { cursor: pointer; font-weight: 800; font-size: 13.5px; color: #c3b6ff; list-style: none; position: relative; padding-right: 20px; }
.rk-how-box summary::-webkit-details-marker { display: none; }
.rk-how-box summary::after { content: "\f067"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 0; top: 0; font-size: 14px; color: #8fb6ff; }
.rk-how-box[open] summary::after { content: "\f068"; }
.rk-how-box ul { margin: 12px 0 2px; padding-left: 18px; }
.rk-how-box li { font-size: 13px; color: #c9c3ea; line-height: 1.9; }

.v2-how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 24px; }
.v2-how-step { position: relative; padding: 15px 16px 14px 48px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); }
.v2-how-step .v2-how-num { position: absolute; left: 13px; top: 14px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7c5cff, #4f9dff); box-shadow: 0 6px 16px rgba(91,60,196,.4); }
.v2-how-step b { display: block; font-size: 13.5px; font-weight: 800; color: var(--cp-text); margin-bottom: 3px; }
.v2-how-step span { display: block; font-size: 12.5px; line-height: 1.55; color: #9d95c9; }
@media (max-width: 640px) { .v2-how-steps { grid-template-columns: 1fr; } }

.rk-history { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; text-align: left; }
.rk-history-head { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #8fe8ff; margin-bottom: 10px; text-align: center; }
.rk-history-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rk-history-item { flex: 1 1 150px; max-width: 190px; background: rgba(10,9,24,.6); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px; text-align: center; }
.rk-history-item strong { display: block; font-size: 12.5px; color: var(--cp-text); }
.rk-history-item span { display: block; font-size: 12px; font-weight: 700; color: #8fb6ff; margin: 2px 0; }
.rk-history-item small { font-size: 10.5px; color: #6b6490; }

.rk-top-alert { max-width: 980px; margin: 18px auto 0; position: relative; z-index: 3; width: calc(100% - 40px); }

/* ── Gift-card coupon reveal overlay ── */
.rk-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(5,4,15,.72); backdrop-filter: blur(6px); padding: 20px; }
.rk-overlay[hidden] { display: none; }
.rk-giftcard {
  position: relative; width: min(92vw, 430px); border-radius: 20px; padding: 30px 30px 34px; overflow: hidden; text-align: center;
  background: linear-gradient(150deg, #241b4d 0%, #3b2a6e 45%, #5B3CC4 80%, #2f8fb0 125%);
  border: 1px solid rgba(255,255,255,.22); color: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(24,212,255,.25);
  transform: translateY(24px) scale(.92); opacity: 0; transition: transform .5s cubic-bezier(.22,.61,.36,1), opacity .5s;
}
.rk-show .rk-giftcard { transform: translateY(0) scale(1); opacity: 1; }
.rk-gc-shine { position: absolute; top: 0; left: -80%; width: 60%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.22), transparent); transform: skewX(-18deg); animation: rkShine 2.6s ease-in-out 1s infinite; }
@keyframes rkShine { 0% { left: -80%; } 55%,100% { left: 130%; } }
.rk-gc-lights { position: absolute; top: 14px; left: 0; right: 0; display: flex; justify-content: space-around; padding: 0 22px; }
.rk-gc-lights i { width: 6px; height: 6px; border-radius: 50%; background: #8fe8ff; box-shadow: 0 0 10px #8fe8ff; animation: rkTicker 1.6s ease-in-out infinite; }
.rk-gc-lights i:nth-child(2n) { animation-delay: .8s; }
@keyframes rkTicker { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.rk-gc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.rk-gc-brand { font-size: 13px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: #d9d2f5; }
.rk-gc-chip { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #18D4FF, #24C6FF); color: #04243a; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(24,212,255,.4); }
.rk-gc-title { font-size: 11px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: #8fe8ff; }
.rk-gc-big {
  font-size: clamp(42px, 10vw, 58px); font-weight: 800; letter-spacing: -.5px; line-height: 1.05; margin: 8px 0 20px;
  background: linear-gradient(90deg, #fff, #18D4FF); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 6px 30px rgba(24,212,255,.3);
}
.rk-gc-code { display: flex; flex-direction: column; gap: 4px; margin: 0 auto 14px; max-width: 320px; }
.rk-gc-code-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #b9b0e0; }
.rk-gc-code-value { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 24px; letter-spacing: 3px; color: #ffd166; background: rgba(0,0,0,.28); border: 1px dashed rgba(255,209,102,.5); padding: 8px 14px; border-radius: 10px; }
.rk-gc-meta { margin: 0 0 18px; font-size: 12.5px; color: #d9d2f5; }
.rk-gc-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(90deg, #18D4FF, #24C6FF); color: #04243a; font-weight: 800; font-size: 14px; padding: 12px 26px; border-radius: 12px; text-decoration: none; box-shadow: 0 10px 26px rgba(24,212,255,.4); }
.rk-gc-close { display: block; margin: 14px auto 0; background: none; border: none; color: #c9c3ea; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rk-gc-notch { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #08070f; top: 48%; }
.rk-gc-notch-l { left: -13px; }
.rk-gc-notch-r { right: -13px; }

/* Confetti */
.rk-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: 20px; }
.rk-confetti i { position: absolute; top: -12px; animation: rkFall linear forwards; }
@keyframes rkFall { 0% { transform: translate(0,-10px) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--dx), 140px) rotate(720deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rk-orb { animation: none; }
  .rk-starfield span { animation: none; opacity: .25; }
  .rk-wheel-stage::before { animation: none; }
}

/* ================================================================
   LUCKY COUPON WHEEL — full-page, no-scroll, 6 gift-cards ring
   ================================================================ */
.rk2-arena {
  position: relative;
  height: calc(100vh - 60px);
  min-height: 560px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8px 20px 14px;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(91,60,196,.32), transparent 60%),
    radial-gradient(720px 460px at 4% 92%, rgba(24,212,255,.14), transparent 60%),
    radial-gradient(640px 440px at 96% 76%, rgba(230,57,70,.12), transparent 62%),
    radial-gradient(520px 380px at 50% 55%, rgba(124,92,219,.08), transparent 66%),
    linear-gradient(180deg, #0d0b1f 0%, #150f30 55%, #0b0918 100%);
}
.rk2-inner {
  position: relative; z-index: 2; width: min(100%, 900px);
  margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ── Floating mini coupon cards ── */
.rk2-minicards { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rk2-mini { position: absolute; animation: rk2MiniFloat 10s ease-in-out infinite; opacity: .55; }
.rk2-mini b {
  display: block; padding: 6px 10px; border-radius: 10px; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.3);
}
@keyframes rk2MiniFloat {
  0%,100% { transform: translate(0,0) rotate(-4deg); }
  50% { transform: translate(10px,-22px) rotate(5deg); }
}
@media (max-width: 640px) { .rk2-minicards { display: none; } }

/* ── Head ── */
.rk2-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rk2-title { margin: 0; font-size: clamp(21px, 3vw, 32px); font-weight: 800; letter-spacing: -.5px; color: #fff;
  background: linear-gradient(90deg, #fff, #18D4FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rk2-sub { margin: 4px 0 0; color: #b9b0e0; font-size: 13.5px; }
.rk2-head .rk-floatbadge { font-size: 13.5px; padding: 10px 18px; }

/* ── Pending coupon strip ── */
.rk2-pending {
  width: 100%; max-width: 680px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(43,34,82,.85), rgba(24,40,74,.85));
  border: 1px solid rgba(24,212,255,.4); border-radius: 14px; padding: 10px 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
}
.rk2-pending-label { font-size: 9.5px; font-weight: 800; letter-spacing: 2px; color: #8fe8ff; }
.rk2-pending-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 18px; letter-spacing: 2px; color: #ffd166; }
.rk2-pending-meta { font-size: 12px; color: #b9b0e0; }
.rk2-pending-btn { padding: 8px 16px; font-size: 12.5px; }

/* ── Stage ── */
.rk2-stage { position: relative; width: min(62vh, 640px, 94vw); aspect-ratio: 1/1; }
@media (max-height: 760px) { .rk2-stage { width: min(52vh, 640px, 94vw); } }
.rk2-stage-aura {
  position: absolute; inset: -26px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(24,212,255,.3), rgba(91,60,196,.4), rgba(255,209,102,.2), rgba(230,57,70,.2), rgba(24,212,255,.3));
  filter: blur(30px); animation: rkSpinSlow 18s linear infinite; z-index: 0;
}
.rk2-ring { position: absolute; inset: 0; will-change: transform; z-index: 1; }

/* ── Coupon cards (gift-card design, colourful) ── */
.rk2-card {
  position: absolute; left: 50%; top: 50%;
  width: 28%; height: 38%; margin-left: -14%; margin-top: -19%;
  border-radius: 13px;
  transform: rotate(calc(var(--ci) * 60deg)) translateY(-82%) rotate(calc(var(--ci) * -60deg));
  transition: transform .15s ease;
}
.rk2-card:hover { filter: brightness(1.12); }
.rk2-card-in {
  position: absolute; inset: 0; border-radius: 13px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.28); color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 7% 9% 8%;
}
.rk2-card-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.22) 45%, transparent 58%);
  transform: translateX(-130%); animation: rk2Shine 6s ease-in-out infinite;
}
@keyframes rk2Shine { 0%, 60% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.rk2-card-top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.rk2-card-brand { font-size: clamp(6px, 1.05vmin, 10px); font-weight: 800; letter-spacing: 2px; opacity: .92; }
.rk2-card-chip {
  width: 17px; height: 17px; border-radius: 5px; background: rgba(255,255,255,.85); color: #37216e;
  font-weight: 800; font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.rk2-card-val {
  font-size: clamp(13px, 3.4vmin, 28px); font-weight: 800; letter-spacing: -.5px; line-height: 1.05;
  text-align: center; text-shadow: 0 3px 14px rgba(0,0,0,.4);
}
.rk2-card-val.small { font-size: clamp(9px, 1.8vmin, 14px); letter-spacing: .5px; }
.rk2-card-cat { font-size: clamp(6px, 1.05vmin, 9px); letter-spacing: 1.5px; opacity: .85; font-weight: 700; }
.rk2-card-code {
  margin-top: 5px; padding-top: 6px; border-top: 2px dashed rgba(255,255,255,.55);
  font-family: ui-monospace, Consolas, monospace; font-size: clamp(7px, 1.25vmin, 10px);
  letter-spacing: 2px; opacity: .9; white-space: nowrap;
}
.rk2-notch { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #0d0b1f; top: 50%; margin-top: -5px; z-index: 3; }
.rk2-notch-l { left: -5px; }
.rk2-notch-r { right: -5px; }

/* colourful gradients */
.rk2-c0 .rk2-card-in { background: linear-gradient(155deg, #8B5CF6 0%, #5B3CC4 100%); }
.rk2-c1 .rk2-card-in { background: linear-gradient(155deg, #22D3EE 0%, #1D4ED8 100%); }
.rk2-c2 .rk2-card-in { background: linear-gradient(155deg, #FFB347 0%, #F97316 100%); }
.rk2-c3 .rk2-card-in { background: linear-gradient(155deg, #2DD4BF 0%, #0F766E 100%); }
.rk2-c4 .rk2-card-in { background: linear-gradient(155deg, #F472B6 0%, #C026D3 100%); }
.rk2-c5 .rk2-card-in { background: linear-gradient(155deg, #FFD166 0%, #E76F51 100%); }

/* ── Pointer ── */
.rk2-pointer { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; }
.rk2-pointer span {
  display: block; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 30px solid #E63946;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
}
.rk2-pointer::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: #fff; margin-top: 2px;
  box-shadow: 0 0 12px #fff, 0 0 22px #18D4FF; animation: rkHubGlow 2.4s ease-in-out infinite;
}

/* ── Hub ── */
.rk2-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 24%; aspect-ratio: 1/1; border-radius: 50%; z-index: 4;
  background: radial-gradient(circle at 30% 25%, #fdfbff, #cfc4ff);
  color: #37216e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 2px 6px rgba(255,255,255,.9);
  border: 5px solid rgba(255,255,255,.92);
  cursor: pointer; user-select: none;
  animation: rk2HubPulse 3s ease-in-out infinite;
}
.rk2-hub::before {
  content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.4);
  animation: rkSpinSlow 14s linear infinite;
}
.rk2-hub b { font-size: clamp(15px, 3vmin, 24px); font-weight: 800; letter-spacing: 1px; }
.rk2-hub span { font-size: clamp(6px, 1.2vmin, 9px); font-weight: 700; letter-spacing: 2px; opacity: .7; }
@keyframes rk2HubPulse { 0%,100% { box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 2px 6px rgba(255,255,255,.9); transform: translate(-50%,-50%) scale(1); } 50% { box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 0 10px rgba(24,212,255,0), inset 0 2px 6px rgba(255,255,255,.9); transform: translate(-50%,-50%) scale(1.04); } }
.rk2-hub:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ── Spin button ── */
.rk2-spinrow { width: min(100%, 430px); position: relative; z-index: 3; }
.rk2-spinbtn {
  width: 100%; font-size: 17px; font-weight: 800; letter-spacing: 1px; padding: 15px 26px; border-radius: 14px;
  background: linear-gradient(135deg, #5B3CC4, #18D4FF);
  box-shadow: 0 14px 44px rgba(24,212,255,.38), 0 0 0 4px rgba(91,60,196,.15);
}
.rk2-spinbtn:hover { background: linear-gradient(135deg, #6b4bd8, #43dcff); }
.rk2-spinbtn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Action chips ── */
.rk2-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; z-index: 3; }
@media (max-width: 640px) { .rk2-actions { grid-template-columns: 1fr; } }
.rk2-chip {
  background: rgba(23,20,48,.7); border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 12px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.rk2-chip-form { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rk2-chip-form input {
  flex: 1; min-width: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  color: #ffd166 !important; letter-spacing: 1px; text-align: center;
}
.rk2-chip-btn { padding: 9px 16px; font-size: 12.5px; white-space: nowrap; }
.rk2-chip-info { font-size: 12px; color: #c9c3ea; white-space: nowrap; }

/* ── History strip ── */
.rk2-history { width: 100%; max-width: 760px; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.rk2-history::-webkit-scrollbar { display: none; }
.rk2-h-item {
  flex: 0 0 auto; background: rgba(10,9,24,.6); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 6px 12px; font-size: 12px; color: #b9b0e0; white-space: nowrap;
}
.rk2-h-item b { color: #8fb6ff; }

/* ── Overlay enhancements: fan + copy ── */
.rk-gc-fan { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.rk-gc-fan i {
  position: absolute; left: 50%; top: 50%; width: 110px; height: 70px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25); color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  animation: rk2FanFloat 5.5s ease-in-out infinite;
}
@keyframes rk2FanFloat { 0%,100% { opacity: .4; } 50% { opacity: .85; } }
.rk-giftcard { z-index: 2; }
.rk-gc-btnrow { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rk-gc-copy {
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); color: #fff;
  font-weight: 700; font-size: 14px; padding: 12px 22px; border-radius: 12px; cursor: pointer; transition: background .15s;
}
.rk-gc-copy:hover { background: rgba(255,255,255,.16); }
@media (min-width: 720px) and (min-height: 700px) {
  .rk-giftcard { transform-origin: center; }
}

/* ================================================================
   SPIN WHEEL v3 — premium canvas wheel, clean full-page stage
   ================================================================ */
.rk3-arena {
  position: relative;
  height: calc(100vh - 60px);
  min-height: 560px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 8px 20px 14px;
  background:
    radial-gradient(1000px 520px at 50% -8%, rgba(91,60,196,.34), transparent 62%),
    radial-gradient(760px 480px at 6% 94%, rgba(24,212,255,.12), transparent 60%),
    radial-gradient(700px 460px at 95% 80%, rgba(139,92,246,.14), transparent 62%),
    linear-gradient(180deg, #0d0b1f 0%, #150f30 55%, #0b0918 100%);
}
.rk3-inner {
  position: relative; z-index: 2; width: min(100%, 900px);
  margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* ── Head ── */
.rk3-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  animation: rk3In .5s ease-out both; }
.rk3-eyebrow { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 3px; color: #8fe8ff; text-transform: uppercase;
  background: rgba(24,212,255,.09); border: 1px solid rgba(24,212,255,.3); padding: 5px 14px; border-radius: 30px; margin-bottom: 10px; }
.rk3-title { margin: 0; font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.5px; color: #fff; }
.rk3-sub { margin: 5px 0 0; color: #b9b0e0; font-size: 14px; }
.rk3-badge {
  display: flex; align-items: center; gap: 10px; background: rgba(23,20,48,.7);
  border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 10px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}
.rk3-badge b { font-size: 30px; font-weight: 800; line-height: 1; color: #fff;
  background: linear-gradient(135deg, #5B3CC4, #18D4FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rk3-badge span { font-size: 11.5px; font-weight: 700; color: #c3b6ff; text-transform: uppercase; letter-spacing: 1px; }

/* ── Stage ── */
.rk3-stage { position: relative; width: min(62vh, 560px, 94vw); aspect-ratio: 1/1;
  animation: rk3In .6s ease-out .08s both; }
@media (max-height: 760px) { .rk3-stage { width: min(52vh, 560px, 94vw); } }
.rk3-aura {
  position: absolute; inset: -30px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: conic-gradient(from 0deg, rgba(24,212,255,.28), rgba(91,60,196,.4), rgba(255,209,102,.18), rgba(230,57,70,.16), rgba(24,212,255,.28));
  filter: blur(34px); animation: rkSpinSlow 20s linear infinite;
}
.rk3-stage canvas {
  position: relative; z-index: 2; width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 26px 50px rgba(0,0,0,.55));
}

/* ── Pointer (gold gem) ── */
.rk3-pointer { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center;
  animation: rk3Ptr 1.6s ease-in-out infinite; }
.rk3-pointer i {
  display: block; width: 40px; height: 34px;
  background: linear-gradient(180deg, #FFF3C4, #FFD166 45%, #F59E0B);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
}
.rk3-pointer b {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 20px #FFD166, 0 0 34px #FFD166;
}
@keyframes rk3Ptr { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(3px); } }

/* ── Hub ── */
.rk3-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 21%; aspect-ratio: 1/1; border-radius: 50%; z-index: 5;
  background: radial-gradient(circle at 32% 26%, #ffffff, #d9d0ff 70%, #b9a9f2);
  color: #37216e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 5px solid rgba(255,255,255,.94);
  box-shadow: 0 14px 36px rgba(0,0,0,.5), inset 0 2px 8px rgba(255,255,255,.95);
  cursor: pointer; user-select: none;
  animation: rk3HubPulse 3s ease-in-out infinite;
}
.rk3-hub::before {
  content: ''; position: absolute; inset: -13px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.35); animation: rkSpinSlow 16s linear infinite;
}
.rk3-hub b { font-size: clamp(15px, 3vmin, 24px); font-weight: 800; letter-spacing: 1.5px; }
.rk3-hub span { font-size: clamp(6px, 1.15vmin, 9px); font-weight: 700; letter-spacing: 2.5px; opacity: .65; }
@keyframes rk3HubPulse {
  0%,100% { box-shadow: 0 14px 36px rgba(0,0,0,.5), inset 0 2px 8px rgba(255,255,255,.95); transform: translate(-50%,-50%) scale(1); }
  50% { box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 12px rgba(24,212,255,0), inset 0 2px 8px rgba(255,255,255,.95); transform: translate(-50%,-50%) scale(1.05); }
}
.rk3-hub:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ── Spin row ── */
.rk3-spinrow { width: min(100%, 440px); position: relative; z-index: 3; animation: rk3In .6s ease-out .16s both; }
.rk2-spinbtn {
  width: 100%; font-size: 17px; font-weight: 800; letter-spacing: 1.5px; padding: 16px 26px; border-radius: 16px;
  background: linear-gradient(135deg, #5B3CC4, #18D4FF);
  box-shadow: 0 16px 46px rgba(24,212,255,.4), 0 0 0 5px rgba(91,60,196,.16), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .15s, box-shadow .15s;
}
.rk2-spinbtn:hover { transform: translateY(-2px); box-shadow: 0 20px 54px rgba(24,212,255,.5), 0 0 0 5px rgba(91,60,196,.2), inset 0 1px 0 rgba(255,255,255,.25); }
.rk2-spinbtn:active { transform: translateY(0) scale(.99); }
.rk2-spinbtn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Action chips + history (entrance) ── */
.rk2-actions { animation: rk3In .6s ease-out .24s both; }
.rk2-history { animation: rk3In .6s ease-out .32s both; }

@keyframes rk3In { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .rk3-aura { animation: none; }
  .rk3-pointer, .rk3-hub { animation: none; }
  .rk3-head, .rk3-stage, .rk3-spinrow, .rk2-actions, .rk2-history { animation: none; }
}

/* ================================================================
   GROWTH SYSTEM — automated next-step checklist (dashboard)
   ================================================================ */
.rk-system { margin-bottom: 24px; }
.rk-sys-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.rk-sys-progress { display: flex; align-items: center; gap: 12px; }
.rk-sys-pct { font-size: 12.5px; font-weight: 800; color: #c3b6ff; white-space: nowrap; }
.rk-sys-bar { width: 150px; height: 8px; border-radius: 20px; background: rgba(255,255,255,.1); overflow: hidden; }
.rk-sys-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, #18D4FF, #5B3CC4); transition: width .6s ease; }
.rk-sys-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .rk-sys-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .rk-sys-steps { grid-template-columns: 1fr; } }
.rk-sys-step {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: rgba(23,20,48,.7); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 16px;
  text-decoration: none; color: var(--cp-text); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.rk-sys-step:hover { transform: translateY(-2px); border-color: rgba(24,212,255,.35); }
.rk-sys-num {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.09); color: #c3b6ff;
  font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.rk-sys-step strong { font-size: 13.5px; line-height: 1.3; }
.rk-sys-step > span:last-child { font-size: 12px; color: #9b96ad; line-height: 1.45; }
.rk-sys-done { border-color: rgba(40,167,69,.35); background: rgba(40,167,69,.07); }
.rk-sys-done .rk-sys-num { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 4px 12px rgba(52,211,153,.35); }
.rk-sys-done strong { text-decoration: line-through; text-decoration-color: rgba(255,255,255,.35); color: #8fe3ab; }
.rk-sys-next {
  border-color: rgba(24,212,255,.55);
  background: linear-gradient(135deg, rgba(43,34,82,.75), rgba(24,40,74,.75));
  box-shadow: 0 0 0 3px rgba(24,212,255,.12), 0 10px 30px rgba(24,212,255,.15);
  animation: rkSysPulse 2.4s ease-in-out infinite;
}
@keyframes rkSysPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(24,212,255,.1), 0 10px 30px rgba(24,212,255,.12); } 50% { box-shadow: 0 0 0 6px rgba(24,212,255,.16), 0 10px 34px rgba(24,212,255,.22); } }
.rk-sys-flag {
  position: absolute; top: -9px; right: 12px; background: linear-gradient(90deg, #18D4FF, #24C6FF); color: #04243a;
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.5px; padding: 3px 10px; border-radius: 12px; text-transform: uppercase;
}

/* ================================================================
   LUCKY SPIN — cinematic full-screen discount spin overlay
   Glassmorphism card + giant 800px SVG wheel (top semicircle only)
   ================================================================ */
.spin-body { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.spin-bg {
  position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 25%, #1d1238, #030107);
}
.spin-bg::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(91,60,196,.10), transparent 62%),
    radial-gradient(700px 480px at 8% 100%, rgba(91,60,196,.16), transparent 60%),
    radial-gradient(640px 460px at 94% 90%, rgba(139,92,246,.12), transparent 62%);
}
.spin-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(36px); }
.spin-orb-a { width: 460px; height: 460px; background: radial-gradient(circle, rgba(91,60,196,.10), transparent 65%); top: -160px; right: 12%; animation: rkDrift 16s ease-in-out infinite; }
.spin-orb-b { width: 380px; height: 380px; background: radial-gradient(circle, rgba(24,212,255,.14), transparent 62%); bottom: -120px; left: 2%; animation: rkDrift 20s ease-in-out infinite reverse; }
.spin-starfield { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.spin-starfield span { position: absolute; color: rgba(255,255,255,.3); text-shadow: 0 0 8px rgba(255,255,255,.45); animation: rk4Twinkle 6s ease-in-out infinite; }

/* ── Floating topbar ── */
.spin-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 40; background: linear-gradient(180deg, rgba(3,0,7,.72), rgba(3,0,7,0)); }
.spin-topbar-in { max-width: 1180px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.spin-logo { display: block; }
.spin-logo img { filter: drop-shadow(0 4px 14px rgba(0,0,0,.5)); }
.spin-top-right { display: flex; align-items: center; gap: 12px; }
.spin-badge {
  display: flex; align-items: center; gap: 9px; background: rgba(29,18,56,.72); border: 1px solid rgba(91,60,196,.4);
  border-radius: 30px; padding: 7px 16px 7px 10px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
}
.spin-badge b {
  min-width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #ffffff;
  background: linear-gradient(145deg, #B7A6F0, #2D8CFF 55%, #18D4FF);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 4px 12px rgba(24,212,255,.45);
}
.spin-badge span { font-size: 10.5px; font-weight: 800; color: #B7A6F0; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.spin-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.35); box-shadow: 0 4px 14px rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.spin-avatar-text { background: linear-gradient(135deg, #5B3CC4, #18D4FF); color: #fff; font-size: 15px; font-weight: 800; text-decoration: none; }

/* ── Toast ── */
.spin-toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; max-width: min(92vw, 560px);
  background: rgba(29,18,56,.95); border: 1px solid rgba(91,60,196,.45); color: #c9bfe8;
  font-size: 13.5px; line-height: 1.5; font-weight: 600; padding: 13px 22px; border-radius: 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 4px rgba(91,60,196,.08); text-align: center;
  animation: spinToastIn .35s cubic-bezier(.22,.61,.36,1) both;
}
.spin-toast[hidden] { display: none; }
@keyframes spinToastIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ── Glassmorphism card (floats over the wheel centre) ── */
.spin-card {
  --card-from: translate(-50%, -44%) scale(.97);
  --card-to: translate(-50%, -50%) scale(1);
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  width: min(92vw, 620px); text-align: center;
  background: linear-gradient(160deg, rgba(58,36,110,.38), rgba(14,7,32,.62));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(91,60,196,.34); border-radius: 26px;
  padding: 24px 30px 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.14), 0 0 34px rgba(91,60,196,.07);
  animation: spinCardIn .7s cubic-bezier(.22,.61,.36,1);
}
@keyframes spinCardIn { from { opacity: 0; transform: var(--card-from); } to { opacity: 1; transform: var(--card-to); } }
.spin-eyebrow {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 2.5px; color: #A78BFA; text-transform: uppercase;
  background: rgba(91,60,196,.1); border: 1px solid rgba(91,60,196,.35); padding: 5px 15px; border-radius: 30px; margin-bottom: 12px;
  box-shadow: 0 0 22px rgba(91,60,196,.14);
}
.spin-title {
  margin: 0; font-size: clamp(26px, 4.6vw, 42px); font-weight: 900; letter-spacing: -1px; color: #fff;
  text-transform: uppercase;
  text-shadow: 0 8px 34px rgba(0,0,0,.55);
}
.spin-title em {
  font-style: normal;
  background: linear-gradient(120deg, #A78BFA, #7B5ED4 45%, #5B3CC4 75%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(91,60,196,.4));
}
.spin-sub { margin: 8px auto 0; color: #c9bfe8; font-size: clamp(12.5px, 1.6vw, 14.5px); max-width: 480px; line-height: 1.55; }

/* ── Steps ── */
.spin-steps { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.spin-step {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(10,5,22,.5);
  border: 1px solid rgba(255,255,255,.14); border-radius: 30px; padding: 7px 14px 7px 8px;
  font-size: 11.5px; font-weight: 700; color: #e5ddfc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.spin-step i {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal;
  background: linear-gradient(145deg, #A78BFA, #5B3CC4); box-shadow: 0 3px 10px rgba(91,60,196,.4);
}
.spin-step i svg { width: 14px; height: 14px; }
.spin-step-sep { color: rgba(91,60,196,.55); font-size: 13px; }

/* ── CTA button ── */
.spin-cta-wrap { margin-top: 18px; }
.spin-btn .spin-btn-shine {
  position: absolute; inset: 0; border-radius: 60px; overflow: hidden; pointer-events: none;
}
.spin-btn .spin-btn-shine::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.65), transparent);
  animation: spinShine 2.8s ease-in-out infinite;
}
@keyframes spinShine { 0% { left: -60%; } 55%,100% { left: 130%; } }
/* ── Chances line (clean, static) ── */
.spin-chances { margin-top: 12px; font-size: 13px; color: #8f87b8; font-weight: 600; }
.spin-chances b { color: #ffffff; font-size: 15px; font-weight: 800; display: inline-block; }
.spin-chances b.pop { animation: spinPop .45s cubic-bezier(.22,.61,.36,1); }

/* ── Stats line (tokens · credits · spins) ── */
.spin-stats { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.spin-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #8f87b8; font-weight: 600; }
.spin-stat i { font-style: normal; font-size: 13px; }
.spin-stat b { font-size: 14px; font-weight: 800; color: #fff; display: inline-block; }
.spin-stat b.pop { animation: spinPop .5s cubic-bezier(.22,.61,.36,1); }
.spin-stat em { font-style: normal; font-weight: 600; }
@keyframes spinPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.spin-badge b.pop { animation: spinPop .45s cubic-bezier(.22,.61,.36,1); }

/* ── Pending coupon strip ── */
.spin-pending {
  margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  background: rgba(91,60,196,.09); border: 1px solid rgba(91,60,196,.35); border-radius: 14px; padding: 10px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.spin-pending-label { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: #A78BFA; }
.spin-pending-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 16px; letter-spacing: 2px; color: #B7A6F0; }
.spin-pending-meta { font-size: 11px; color: #c9bfe8; }
.spin-pending a { text-decoration: none; }

/* ── Mini row (earn more spins) ── */
.spin-mini-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.spin-mini-chip {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(10,5,22,.45);
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 7px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.spin-mini-chip span { font-size: 11px; color: #c9bfe8; font-weight: 700; white-space: nowrap; }
.spin-mini-chip input {
  width: 128px; background: rgba(3,0,7,.7); border: 1px solid rgba(91,60,196,.4); border-radius: 8px;
  padding: 8px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: 1px;
  color: #B7A6F0 !important; text-align: center;
}
.spin-mini-chip input:focus { outline: none; box-shadow: 0 0 0 3px rgba(91,60,196,.14); }
.spin-mini-btn {
  border: 1px solid rgba(91,60,196,.5); background: rgba(91,60,196,.12); color: #c9bfe8; cursor: pointer;
  font-size: 11px; font-weight: 800; padding: 8px 12px; border-radius: 9px; white-space: nowrap; text-decoration: none;
  transition: background .15s, transform .15s;
}
.spin-mini-btn:hover { background: rgba(91,60,196,.24); transform: translateY(-1px); }
.spin-mini-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Wheel stage: wide arc, top half only, breathing room at the top ── */
.spin-stage {
  position: absolute; inset: 0; z-index: 20; pointer-events: none;
  --wheel: min(88vw, 125dvh);
}
.spin-disc-wrap {
  position: absolute; left: 50%; bottom: calc(var(--wheel) / -2);
  width: var(--wheel); height: var(--wheel); transform: translateX(-50%);
  pointer-events: auto;
}
.spin-disc-shadow { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; filter: drop-shadow(0 40px 70px rgba(0,0,0,.65)); }
.spin-disc {
  width: 100%; height: 100%; display: block;
  transform-origin: 50% 50%; will-change: transform;
  backface-visibility: hidden;
}
.spin-disc svg { width: 100%; height: 100%; display: block; }
.spin-disc.spinning { transition: transform 5s cubic-bezier(.14,.72,.08,.99); }
.spin-disc svg .spin-slice { transition: filter .3s; }
.spin-disc.landed .spin-slice.win { filter: brightness(1.5) drop-shadow(0 0 22px rgba(24,212,255,.9)); }

/* ── Gold pointer above the arc ── */
.spin-pointer {
  position: absolute; left: 50%; bottom: calc(var(--wheel) / 2 + 18px); transform: translateX(-50%);
  z-index: 22; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  animation: spinPtrBob 1.8s ease-in-out infinite;
}
@keyframes spinPtrBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(4px); } }
.spin-pointer-label {
  font-size: 8.5px; font-weight: 900; letter-spacing: 3px; color: #c9bfe8; text-transform: uppercase;
  background: rgba(20,12,2,.6); border: 1px solid rgba(91,60,196,.55); border-radius: 20px; padding: 3px 10px; margin-bottom: 5px;
  box-shadow: 0 0 18px rgba(91,60,196,.45);
}
.spin-pointer-tip {
  display: block; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 28px solid #7B5ED4;
  filter: drop-shadow(0 0 10px rgba(91,60,196,.9)) drop-shadow(0 4px 8px rgba(0,0,0,.55));
}
.spin-pointer-beam {
  position: absolute; top: 34px; left: 50%; width: 34px; height: calc(var(--wheel) * 0.44); transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(91,60,196,.55), rgba(91,60,196,.12) 55%, transparent 85%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: blur(3px);
  animation: spinBeam 1.4s ease-in-out infinite;
}
@keyframes spinBeam { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

/* ── Victory modal ── */
.spin-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3,0,7,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.spin-modal[hidden] { display: none; }
.spin-modal-card {
  position: relative; width: min(94vw, 440px); text-align: center; border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, #241540, #120a26 60%, #0b0618);
  border: 1px solid rgba(91,60,196,.4);
  box-shadow: 0 40px 110px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.12), 0 0 60px rgba(91,60,196,.08);
  transform: translateY(26px) scale(.94); opacity: 0;
  transition: transform .45s cubic-bezier(.22,.61,.36,1), opacity .4s;
  padding: 34px 30px 28px;
}
.spin-modal.show .spin-modal-card { transform: translateY(0) scale(1); opacity: 1; }
.spin-modal-shine { position: absolute; top: 0; left: -80%; width: 55%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.12), transparent); transform: skewX(-18deg); animation: spinShine 2.8s ease-in-out 1s infinite; pointer-events: none; }
.spin-modal-badge {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: radial-gradient(circle at 32% 26%, #A78BFA, #5B3CC4 65%, #2D8CFF);
  box-shadow: 0 12px 34px rgba(91,60,196,.5), inset 0 2px 0 rgba(255,255,255,.8);
  animation: spinModalPop .6s cubic-bezier(.22,.61,.36,1) .1s both;
}
@keyframes spinModalPop { from { transform: scale(0); } to { transform: scale(1); } }
.spin-modal-title { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: 2.5px; color: #A78BFA; text-transform: uppercase; }
.spin-modal-big { margin: 8px 0 2px; font-size: clamp(38px, 8vw, 56px); font-weight: 900; letter-spacing: -1px; color: #fff; line-height: 1.05; text-shadow: 0 10px 34px rgba(0,0,0,.5); }
.spin-modal-big.gold { background: linear-gradient(120deg, #A78BFA, #7B5ED4 45%, #5B3CC4 80%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 6px 20px rgba(91,60,196,.35)); }
.spin-modal-meta { margin: 6px auto 0; font-size: 12.5px; color: #c9bfe8; max-width: 330px; line-height: 1.5; }
.spin-code {
  margin: 18px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 330px;
  background: rgba(3,0,7,.65); border: 2px dashed rgba(91,60,196,.55); border-radius: 14px; padding: 13px 16px;
  font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 20px; letter-spacing: 3px; color: #B7A6F0;
}
.spin-phone-row { margin: 12px auto 0; max-width: 330px; display: flex; align-items: center; gap: 8px; }
.spin-phone-row input {
  flex: 1; background: rgba(3,0,7,.65); border: 1px solid rgba(255,255,255,.16); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: #fff !important;
}
.spin-phone-row input:focus { outline: none; border-color: rgba(91,60,196,.5); }
.spin-phone-row span { font-size: 11px; color: #8f87b8; white-space: nowrap; }
.spin-modal-actions { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.spin-modal-btn {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; text-decoration: none;
  font-size: 13.5px; font-weight: 800; padding: 13px 24px; border-radius: 13px; color: #fff; transition: transform .15s, filter .15s, background .15s;
}
.spin-modal-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.spin-modal-btn-gold { background: linear-gradient(135deg, #A78BFA, #5B3CC4); color: #ffffff; box-shadow: 0 10px 28px rgba(91,60,196,.45); }
.spin-modal-btn-ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.28); color: #e5ddfc; }
.spin-modal-btn-copy { background: linear-gradient(135deg, #18D4FF, #0B5BD3); box-shadow: 0 10px 28px rgba(24,212,255,.3); }
.spin-modal-close { display: block; margin: 18px auto 0; background: none; border: none; color: #9a92bd; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ── Confetti canvas (canvas-confetti) ── */
#confetti-canvas { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ── Modern glass card ── */
.spin-card { box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.14), 0 0 34px rgba(91,60,196,.12); }

/* ── CTA button: clean brand gradient, static glow ── */
.spin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: none; cursor: pointer;
  font-size: 16.5px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase;
  padding: 17px 44px; border-radius: 60px; color: #ffffff; text-decoration: none; position: relative;
  background: linear-gradient(135deg, #A78BFA 0%, #7B5ED4 40%, #5B3CC4 100%);
  box-shadow: 0 14px 44px rgba(91,60,196,.45), 0 0 0 5px rgba(91,60,196,.14), inset 0 2px 0 rgba(255,255,255,.85), inset 0 -8px 18px rgba(0,0,0,.25);
  transition: transform .15s, box-shadow .2s;
}
.spin-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 56px rgba(91,60,196,.6), 0 0 0 7px rgba(91,60,196,.2), inset 0 2px 0 rgba(255,255,255,.85), inset 0 -8px 18px rgba(0,0,0,.25); }
.spin-btn:active { transform: translateY(0) scale(.98); }
.spin-btn:disabled { opacity: .6; cursor: not-allowed; }
.spin-btn.is-busy { filter: saturate(.7); }
@media (max-width: 720px) {
  .spin-topbar-in { padding: 10px 14px; }
  .spin-logo img { width: 138px; }
  .spin-badge span { display: none; }
  .spin-badge { padding: 6px 12px 6px 8px; }
  .spin-card { padding: 22px 20px 18px; }
  .spin-btn { font-size: 14px; padding: 15px 34px; }
  .spin-step { font-size: 10.5px; padding: 6px 11px 6px 7px; }
  .spin-mini-chip { width: 100%; justify-content: center; }
  .spin-mini-chip input { flex: 1; min-width: 0; }
}
/* Portrait & near-square screens: card at top so the arc stays visible */
@media (max-aspect-ratio: 12/10) {
  .spin-card {
    --card-from: translateX(-50%) translateY(-14px) scale(.97);
    --card-to: translateX(-50%) translateY(0) scale(1);
    top: 70px; transform: translateX(-50%);
  }
  .spin-sub { display: none; }
  .spin-steps { display: none; }
  .spin-stage { --wheel: min(165vw, 115dvh); }
}
/* Tiny phones: drop the mini-row too so the card stays compact */
@media (max-width: 340px) {
  .spin-mini-row { display: none; }
  .spin-stage { --wheel: min(150vw, 100dvh); }
}
@media (max-height: 560px) {
  .spin-card {
    --card-from: translate(-50%, -56%) scale(.97);
    --card-to: translate(-50%, -62%) scale(1);
    top: 62%; transform: translate(-50%, -62%);
  }
  .spin-steps { display: none; }
  .spin-mini-row { display: none; }
  .spin-chances { display: none; }
  .spin-stage { --wheel: min(115vw, 135dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .spin-orb, .spin-starfield span, .spin-btn, .spin-btn .spin-btn-shine::after,
  .spin-pointer, .spin-pointer-beam { animation: none !important; }
  .spin-disc.spinning { transition: transform .4s linear; }
  .spin-modal-card { transition: none; }
  .spin-modal.show .spin-modal-card { transform: none; opacity: 1; }
}

/* ================================================================
   RESPONSIVE POLISH (v7) — every portal page, every screen size
   Appended last so these rules win by cascade.
   ================================================================ */

/* ── Topbar: shrink first, restructure under 860px ── */
@media (max-width: 1100px) {
  body.portal-v2 .topbar-link { font-size: 12.5px; padding: 8px 9px; }
}
@media (max-width: 480px) {
  body.portal-v2 .topbar-logo img { width: 112px; }
  body.portal-v2 .topbar-user { gap: 6px; padding: 3px 8px 3px 3px; }
  body.portal-v2 .cp-bell { width: 33px; height: 33px; }
}

/* ── Welcome hero ── */
@media (max-width: 820px) {
  .v2-hero { padding: 24px 20px; }
  .v2-hero-art { display: none; }
}
@media (max-width: 480px) {
  .v2-hero { padding: 20px 16px; border-radius: 16px; margin-bottom: 16px; }
  .v2-hero-sub { font-size: 14px; margin-bottom: 14px; }
  .v2-hero-badge { margin-bottom: 14px; letter-spacing: 1.5px; }
  .v2-hero-actions .v2-btn-lg { padding: 11px 16px; font-size: 14px; }
  .v2-hero-actions .v2-btn-ghost.v2-btn-lg { padding: 11px 16px; }
  .cp-countdown { font-size: 12px; }
}

/* ── Mission / perk / quest grids: smooth 3→2→1 ── */
@media (max-width: 992px) {
  .cp-mission-grid { grid-template-columns: repeat(2, 1fr); }
  .cp-perk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cp-mission-grid { grid-template-columns: 1fr; }
  .cp-perk-grid { grid-template-columns: 1fr; }
  .cp-quest-grid { grid-template-columns: 1fr; }
  .cp-mission-inner { padding: 16px 14px 18px; }
  .cp-quest { padding: 14px; }
  .cp-mission-head { align-items: flex-start; }
  .cp-mission-progress { width: 100%; }
}

/* ── Dashboard purpose paths + status strip ── */
@media (max-width: 1060px) { .rk-path-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .rk-path-grid { grid-template-columns: 1fr; } }
@media (max-width: 1000px) {
  .rk-strip { grid-template-columns: repeat(2, 1fr); }
  .rk-strip-item { border-right: none; }
  .rk-strip-item:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .rk-strip { grid-template-columns: 1fr; padding: 18px 18px; }
  .rk-strip-item:nth-child(3) { grid-column: auto; }
}

/* ── Token packages ── */
@media (max-width: 1000px) { .rk-packages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .rk-packages { grid-template-columns: 1fr; } }

/* ── Meeting form rows ── */
@media (max-width: 900px) and (min-width: 701px) {
  .v2-meet-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tokens balance + packages scale-down ── */
@media (max-width: 560px) {
  .rk-tokens-card { padding: 20px 16px; gap: 18px; }
  .rk-balance-value { font-size: 40px; }
  .rk-package-tokens { font-size: 30px; }
  .rk-balance-actions .portal-btn { padding: 10px 16px; font-size: 13px; }
}

/* ── Dashboard cards / typography on phones ── */
@media (max-width: 560px) {
  .portal-card { padding: 16px; }
  .v2-card-ai-head { flex-wrap: wrap; }
  .v2-card-ai-head .v2-online { margin-left: 0; }
  .v2-hints { margin: 12px 0 14px; }
  .v2-section-head h2, .v2-section-title { font-size: 18px; }
  .v2-page-title { font-size: 19px; }
  .v2-history-arrow { display: none; }
  .v2-gig-media { height: 150px; }
  .v2-tip-num { width: 24px; height: 24px; font-size: 12px; }
}

/* ── Orders page ── */
@media (max-width: 640px) {
  .v2-orders-grid { grid-template-columns: 1fr; }
  .v2-order-card { padding: 14px; }
}
@media (max-width: 480px) {
  .v2-delivery-head { flex-direction: column; align-items: flex-start; }
  .v2-delivery-btnrow .portal-btn { width: 100%; }
  .v2-step-title { align-items: flex-start; flex-direction: column; }
}

/* ── Chat page on small phones ── */
@media (max-width: 480px) {
  .chat-header h2 { font-size: 14.5px; }
  .chat-status { font-size: 11px; }
  .chat-empty-icon { font-size: 36px; }
  .chat-bubble { max-width: 94%; }
}

/* ── Perk Vault (rewards.php) ── */
@media (max-width: 900px) {
  .vault-logo img { width: 124px; }
  .vault-stat-link { display: none; }
  .vault-container { padding: 30px 16px 64px; }
}
@media (max-width: 576px) {
  .vault-topbar-in { padding: 0 14px; }
  .vault-logo img { width: 106px; }
  .vault-top-right { gap: 8px; }
  .vault-stat { padding: 7px 11px; font-size: 12.5px; }
  .vault-avatar { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
  .vault-hero { margin-bottom: 26px; }
  .vault-sub { font-size: 14px; }
  .vault-grid { grid-template-columns: 1fr; }
  .vault-card { padding: 22px 18px 20px; }
  .vault-ico { width: 50px; height: 50px; font-size: 23px; }
}

/* ── Auth pages (login / forgot / reset / verify) ── */
@media (max-width: 576px) {
  .auth-shell { padding: 24px 14px; }
  .auth-card { padding: 26px 18px; border-radius: 14px; }
  .auth-split-card { padding: 24px 16px; border-radius: 18px; }
  .auth-visual-inner { padding: 18px 16px 14px; }
  .auth-visual-stats { gap: 14px; }
  .auth-visual-stats strong { font-size: 18px; }
  .auth-input-wrap input { height: 44px; }
  .auth-tab { font-size: 14px; }
  .otp-row { gap: 6px; }
  .otp-input { font-size: 18px !important; }
}


/* ===== HORIZONTAL OVERFLOW SAFETY ===== */
html, body {
  overflow-x: clip;
}

/* ===== AI CHAT: conversation rename (ChatGPT-style) ===== */
.history-list li { position: relative; }
.history-list li a { padding-right: 36px; }
.chat-rename-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--cp-muted);
  font-size: 11px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
}
.history-list li:hover .chat-rename-btn,
.chat-rename-btn:focus-visible { opacity: 1; }
.chat-rename-btn:hover {
  color: var(--cp-primary);
  background: rgba(91, 60, 196, 0.08);
  opacity: 1;
}
body.portal-v2 .chat-rename-btn { color: rgba(255, 255, 255, 0.5); }
body.portal-v2 .chat-rename-btn:hover { color: #c3b6ff; background: rgba(255, 255, 255, 0.06); }
@media (hover: none) {
  .chat-rename-btn { opacity: 0.9; }
}

/* Inline rename editor (no browser popup) — rendered as a sibling of the link, never inside it */
.history-list li.renaming a { display: none; }
.chat-rename-wrap { display: none; align-items: center; gap: 5px; padding: 9px 6px; flex-wrap: wrap; }
.chat-rename-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 8px;
  border: 1px solid var(--cp-primary);
  border-radius: 6px;
  background: #fff;
  color: #0d0b1f;
  outline: none;
}
.chat-rename-input:focus { box-shadow: 0 0 0 3px rgba(91, 60, 196, 0.15); }
.chat-rename-save,
.chat-rename-cancel {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  padding: 0;
}
.chat-rename-save { background: var(--cp-primary); color: #fff; }
.chat-rename-save:hover { background: #4a2fb0; }
.chat-rename-save:disabled { opacity: 0.6; cursor: default; }
.chat-rename-cancel { background: transparent; color: var(--cp-muted); }
.chat-rename-cancel:hover { color: #dc3545; background: rgba(220, 53, 69, 0.08); }
.chat-rename-err { font-size: 11px; color: #dc3545; padding: 4px 6px 2px; width: 100%; }
body.portal-v2 .chat-rename-input { background: #171233; border-color: rgba(91, 60, 196, 0.7); color: #fff; }
body.portal-v2 .chat-rename-input:focus { box-shadow: 0 0 0 3px rgba(91, 60, 196, 0.25); }
/* ===== Meeting Calendar (v2) ===== */
.meet-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.meet-tz-box { display: flex; align-items: center; gap: 8px; }
.meet-tz-box label { font-size: 12px; color: var(--cp-muted); font-weight: 700; white-space: nowrap; }
.meet-tz-select { border: 1px solid var(--cp-border); border-radius: 10px; background: var(--cp-card-2); color: var(--cp-text); font-size: 12.5px; padding: 9px 12px; max-width: 260px; }

.meet-resched-banner { background: rgba(255,193,7,.1); border: 1px solid rgba(255,193,7,.45); color: #ffd75e; border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.meet-banner-x { background: transparent; border: 0; color: #ffd75e; text-decoration: underline; cursor: pointer; font-size: 12.5px; }

.meet-cal-card { padding: 24px; }
.meet-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.meet-cal-nav { display: flex; align-items: center; gap: 8px; }
.meet-cal-title { margin: 0 !important; font-size: 19px !important; font-weight: 800; min-width: 165px; text-align: center; }
.meet-nav-btn { background: rgba(255,255,255,.06); color: var(--cp-text); border: 1px solid var(--cp-border); border-radius: 10px; width: 38px; height: 38px; font-size: 19px; line-height: 1; cursor: pointer; transition: background .15s, transform .12s; }
.meet-nav-btn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.meet-nav-today { width: auto; padding: 0 14px; font-size: 12.5px; font-weight: 800; }
.meet-cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--cp-muted); align-items: center; }
.meet-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.meet-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.meet-legend-free { background: #2ecc71; }
.meet-legend-partial { background: #f1c40f; }
.meet-legend-full { background: #e74c3c; }
.meet-legend-mine { background: var(--cp-accent); }
.meet-legend-past { background: rgba(255,255,255,.18); }

.meet-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.meet-cal-weekday { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cp-muted); text-align: center; padding: 6px 0 10px; }
.meet-day-cell { position: relative; min-height: 82px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: var(--cp-card-2); padding: 9px 10px 8px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: border-color .15s, transform .12s, box-shadow .15s, background .15s; }
.meet-day-cell:hover { transform: translateY(-2px); border-color: rgba(24,212,255,.55); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.meet-day-off { border-color: transparent !important; background: transparent !important; cursor: default; transform: none !important; box-shadow: none !important; }
.meet-day-past { opacity: .34; cursor: not-allowed; }
.meet-day-past:hover { transform: none; border-color: rgba(255,255,255,.08); box-shadow: none; }
.meet-day-free:hover { border-color: rgba(46,204,113,.6); }
.meet-day-partial:hover { border-color: rgba(241,196,15,.6); }
.meet-day-full { background: rgba(231,76,60,.08); }
.meet-day-full:hover { border-color: rgba(231,76,60,.5); }
.meet-day-selected { border-color: var(--cp-accent) !important; box-shadow: 0 0 0 2px rgba(24,212,255,.3) !important; }
.meet-day-num { font-size: 15px; font-weight: 800; line-height: 1; }
.meet-day-today .meet-day-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--cp-primary), var(--cp-primary-dark)); color: #fff; }
.meet-day-bar { display: flex; gap: 3px; }
.meet-day-bar i { display: block; height: 4px; flex: 1; border-radius: 4px; background: rgba(255,255,255,.1); }
.meet-day-free .meet-day-bar i:first-child { background: #2ecc71; }
.meet-day-partial .meet-day-bar i { background: #f1c40f; }
.meet-day-partial .meet-day-bar i:nth-child(3) { background: rgba(255,255,255,.1); }
.meet-day-full .meet-day-bar i { background: #e74c3c; }
.meet-day-mine-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--cp-accent); box-shadow: 0 0 8px rgba(24,212,255,.8); }
.meet-cal-hint { margin: 14px 2px 0; font-size: 12px; }
.meet-cal-loading, .meet-cal-error { grid-column: 1 / -1; text-align: center; padding: 40px 10px; color: var(--cp-muted); font-size: 13.5px; }
.meet-cal-error { color: #ff9d9d; }
.meet-cal-error .portal-btn { margin-left: 10px; }

.meet-mine-card { padding: 22px 24px; }
.meet-mine-empty { color: var(--cp-muted); font-size: 13px; padding: 8px 0 4px; }

/* -- Modal -- */
.meet-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(5,4,16,.72); backdrop-filter: blur(3px); animation: meetFade .18s ease; }
.meet-modal[hidden] { display: none; }
@keyframes meetFade { from { opacity: 0; } to { opacity: 1; } }
.meet-modal-box { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--cp-card); border: 1px solid var(--cp-border); border-radius: 18px; padding: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.6); animation: meetPop .2s ease; }
@keyframes meetPop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.meet-modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--cp-border); background: rgba(255,255,255,.06); color: var(--cp-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.meet-modal-x:hover { background: rgba(255,255,255,.14); color: var(--cp-text); }
.meet-modal-head { margin-bottom: 14px; padding-right: 40px; }
.meet-modal-head h3 { margin: 0 0 4px !important; font-size: 18px !important; }
.meet-modal-sub { margin: 0 !important; font-size: 12.5px; color: var(--cp-muted); }
.meet-modal-section-label { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cp-muted); margin: 16px 0 10px; }

.meet-slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.meet-slot-chip { position: relative; text-align: center; padding: 11px 6px 9px; border-radius: 11px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.04); color: var(--cp-text); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; transition: border-color .15s, background .15s, transform .12s; }
.meet-slot-chip:hover { border-color: rgba(46,204,113,.65); background: rgba(46,204,113,.08); transform: translateY(-1px); }
.meet-slot-chip .chip-sub { display: block; font-size: 10px; font-weight: 600; color: var(--cp-muted); margin-top: 3px; }
.meet-slot-chip.taken { opacity: .5; cursor: not-allowed; }
.meet-slot-chip.taken:hover { border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.04); transform: none; }
.meet-slot-chip.past { opacity: .32; cursor: not-allowed; }
.meet-slot-chip.past:hover { border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.04); transform: none; }
.meet-slot-chip.mine { border-color: rgba(24,212,255,.55); background: rgba(24,212,255,.1); }
.meet-slot-chip.selected { border-color: var(--cp-accent) !important; box-shadow: 0 0 0 2px rgba(24,212,255,.3); background: rgba(24,212,255,.14); }
.meet-slot-chip .chip-flag { position: absolute; top: -7px; right: -6px; font-size: 9px; font-weight: 800; padding: 3px 7px; border-radius: 20px; letter-spacing: .4px; text-transform: uppercase; }
.meet-slot-chip.mine .chip-flag { background: rgba(24,212,255,.2); color: #8feaff; }
.meet-slot-chip.taken .chip-flag { background: rgba(231,76,60,.2); color: #ff9d9d; }

.meet-modal-mine { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.meet-mine-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid rgba(24,212,255,.3); background: rgba(24,212,255,.06); border-radius: 11px; padding: 9px 13px; font-size: 12.5px; }
.meet-mine-row strong { color: #8feaff; }
.meet-mine-row .row-actions { display: flex; gap: 6px; align-items: center; }
.meet-mine-row .btn-xs { font-size: 11px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--cp-border); background: rgba(255,255,255,.06); color: var(--cp-text); cursor: pointer; }
.meet-mine-row .btn-xs:hover { background: rgba(255,255,255,.12); }
.meet-mine-row .btn-xs.danger { color: #ff9d9d; border-color: rgba(245,108,108,.4); }
.meet-mine-row .btn-xs.join { color: #6fe3a4; border-color: rgba(76,209,128,.45); }

.meet-form-box { margin-top: 6px; }
.meet-ajax-msg { margin-top: 14px; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; }
.meet-ajax-ok { background: rgba(40,167,69,.14); border: 1px solid rgba(76,209,128,.45); color: #7ddf9d; }
.meet-ajax-bad { background: rgba(220,53,69,.12); border: 1px solid rgba(245,108,108,.45); color: #ff9d9d; }
.meet-ajax-msg[hidden] { display: none; }

.meet-slot-summary { display: flex; align-items: center; gap: 10px; background: rgba(24,212,255,.09); border: 1px solid rgba(24,212,255,.35); border-radius: 11px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.meet-slot-summary strong { color: #8feaff; }
.meet-slot-summary-sub { font-size: 11.5px; color: var(--cp-muted); }

/* -- Toast -- */
.meet-toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(92%, 420px); }
.meet-toast { border-radius: 12px; padding: 12px 16px; font-size: 13px; text-align: center; box-shadow: 0 10px 34px rgba(0,0,0,.5); animation: meetPop .22s ease; }
.meet-toast.ok { background: rgba(23,70,40,.95); border: 1px solid rgba(76,209,128,.5); color: #7ddf9d; }
.meet-toast.bad { background: rgba(80,24,28,.95); border: 1px solid rgba(245,108,108,.5); color: #ff9d9d; }

@media (max-width: 900px) {
  .meet-cal-grid { gap: 5px; }
  .meet-day-cell { min-height: 58px; padding: 7px 7px 6px; border-radius: 10px; }
  .meet-day-num { font-size: 13px; }
  .meet-cal-legend { font-size: 10px; gap: 9px; }
  .meet-cal-title { font-size: 16px !important; min-width: 130px; }
  .meet-slot-grid { grid-template-columns: repeat(3, 1fr); }
  .meet-tz-box { width: 100%; }
  .meet-tz-select { flex: 1; }
}

/* Intelligent-assistant cues: transparent live progress, research, and evidence mode. */
body.portal-v2 .chat-intelligence-strip {
  display:flex; flex-wrap:wrap; gap:7px; padding:9px 20px;
  background:linear-gradient(90deg,rgba(91,60,196,.13),rgba(45,140,255,.08));
  border-bottom:1px solid rgba(255,255,255,.08); color:#bcb3e9; font-size:11px;
}
body.portal-v2 .chat-intelligence-strip span {
  display:inline-flex; align-items:center; gap:5px; padding:4px 8px;
  border:1px solid rgba(167,139,250,.23); border-radius:999px; background:rgba(15,13,33,.45);
}
body.portal-v2 .chat-intelligence-strip i { color:#8fe8ff; font-size:10px; }
body.portal-v2 .chat-live-progress { color:#bfb7eb !important; font-style:italic; position:relative; overflow:hidden; }
body.portal-v2 .chat-live-progress::after {
  content:''; display:inline-block; width:5px; height:5px; margin-left:6px; border-radius:50%;
  background:#8fe8ff; animation:bb-live-pulse 1s ease-in-out infinite;
}
@keyframes bb-live-pulse { 0%,100%{opacity:.25;transform:scale(.75)}50%{opacity:1;transform:scale(1)} }
@media (max-width:760px) {
  body.portal-v2 .chat-intelligence-strip { padding:8px 14px; }
  body.portal-v2 .chat-intelligence-strip span { font-size:10px; }
}

/* â•â•â• Chat v2 — Premium human redesign (override/augment) â•â•â• */
body.portal-v2 .chat-shell { max-width: 1320px; }
.chat-layout { position: relative; }

/* Header */
.chat-header { padding: 14px 20px; }
body.portal-v2 .chat-header { background: rgba(18,16,31,.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); }
.chat-header .chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); color: #fff; box-shadow: 0 0 0 2px rgba(139,92,246,.35), 0 4px 14px rgba(91,60,196,.4);
  animation: bbAvatarPulse 3.2s ease-in-out infinite;
}
@keyframes bbAvatarPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(139,92,246,.35), 0 4px 14px rgba(91,60,196,.4); } 50% { box-shadow: 0 0 0 5px rgba(139,92,246,.18), 0 4px 18px rgba(91,60,196,.55); } }
body.portal-v2 .chat-header h2 { color: #fff; font-size: 15px; margin: 0; letter-spacing: .2px; }
body.portal-v2 .chat-status { color: #a9a1d4; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.chat-status-sep { opacity: .4; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: bbStatusBlink 2s infinite; }
@keyframes bbStatusBlink { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5);} 70% { box-shadow: 0 0 0 6px rgba(52,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0);} }

/* Hamburger (mobile only) */
.chat-hamburger { display: none; position: absolute; top: 20px; right: 14px; z-index: 6; width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #c3b6ff; font-size: 15px; cursor: pointer; }
.chat-hamburger:active { transform: scale(.96); }

/* Intelligence strip */
body.portal-v2 .chat-intelligence-strip { background: linear-gradient(90deg, rgba(91,60,196,.14), rgba(34,211,238,.1), rgba(91,60,196,.14)); border-bottom: 1px solid rgba(255,255,255,.07); }
body.portal-v2 .chat-intelligence-strip span { background: rgba(18,16,31,.7); border: 1px solid rgba(255,255,255,.08); color: #cfc7f5; }
body.portal-v2 .chat-intelligence-strip i { color: #7f7ffa; }

/* Research / live activity panel */
.chat-research-panel { margin: 10px 20px 0; border-radius: 14px; overflow: hidden; }
.chat-research-panel[hidden] { display: none; }
body.portal-v2 .chat-research-panel { background: rgba(29,24,56,.6); border: 1px solid rgba(139,92,246,.25); }
.chat-research-title { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; }
body.portal-v2 .chat-research-title { color: #c3b6ff; border-bottom: 1px solid rgba(139,92,246,.18); }
.chat-research-spin { margin-left: auto; font-size: 11px; color: #22d3ee; animation: bbSpin 1.4s linear infinite; }
@keyframes bbSpin { to { transform: rotate(360deg); } }
.chat-research-list { list-style: none; margin: 0; padding: 8px 12px; }
.chat-research-list li { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; font-size: 12.5px; }
body.portal-v2 .chat-research-list li { color: #bdb4e8; }
.chat-research-list li .rk { margin-top: 2px; color: #22d3ee; font-size: 11px; }
.chat-research-list li.ok .rk { color: #34d399; }
.chat-research-list li .chat-research-sub { display: block; font-size: 11px; color: #7d76a5; }

/* Messages area + bubbles */
.chat-messages { position: relative; }
.chat-msg { animation: bbMsgIn .28s ease-out both; }
@keyframes bbMsgIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }
body.portal-v2 .chat-msg.bot .chat-bubble, body.portal-v2 .typing-bubble { background: #1d1838 !important; border: 1px solid rgba(255,255,255,.06); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
body.portal-v2 .chat-msg.user .chat-bubble { background: linear-gradient(135deg, #6d4df0, #8b5cf6) !important; box-shadow: 0 3px 12px rgba(91,60,196,.35); }
.chat-bubble { max-width: 82% !important; }
.chat-msg.bot { display: flex; }
.chat-msg.bot .chat-bubble { border-top-left-radius: 4px !important; }

/* Streaming caret */
.chat-msg.bot .chat-bubble.chat-streaming-caret::after { content: 'â–'; display: inline-block; color: #8fe8ff; animation: bbCaret 1s steps(1) infinite; }
@keyframes bbCaret { 0%,100% { opacity: 1;} 50% { opacity: 0; } }

/* Chat live progress stage */
.chat-live-progress { opacity: .75; font-style: italic; }

/* Empty state */
body.portal-v2 .chat-empty-icon { color: #8b5cf6; font-size: 46px; animation: bbFloat 3s ease-in-out infinite; }
@keyframes bbFloat { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px); } }
.chat-empty-hint { font-size: 12px !important; margin-top: 12px !important; }
body.portal-v2 .chat-empty-hint { color: #8d85b8 !important; }
.chat-empty-hint i { color: #22d3ee; }

/* Token bars */
body.portal-v2 .chat-token-bar { background: rgba(18,16,31,.6); border: 1px solid rgba(255,255,255,.08); }
body.portal-v2 .chat-token-track { background: rgba(255,255,255,.12); }
body.portal-v2 .chat-token-fill { background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
body.portal-v2 .chat-mtoken-label { color: #e9e4ff; }

/* Model bar */
body.portal-v2 .chat-modelbar { padding: 10px 20px 0; border-top: 1px solid rgba(255,255,255,.1); }
.chat-modelbar { display: flex; align-items: center; gap: 10px; }
.chat-modelbar label { font-size: 12px; color: #8d85b8; white-space: nowrap; }
.chat-modelbar select { flex: 1; min-width: 0; background: #0f0d21; border: 1px solid #332a52; border-radius: 10px; color: #e4e0ff; font-size: 12.5px; padding: 8px 10px; font-family: inherit; }

/* Input bar + attach */
body.portal-v2 .chat-inputbar { padding: 12px 20px 16px; gap: 10px; }
.chat-attach { flex-shrink: 0; align-self: end; width: 40px; height: 42px; border-radius: 12px; border: 1px solid #332a52; background: #0f0d21; color: #8d85b8; font-size: 15px; cursor: pointer; transition: all .18s; }
.chat-attach:hover { color: #fff; border-color: #8b5cf6; background: #241d47; }
.chat-attach.has-image { color: #fff; background: linear-gradient(135deg, #6d4df0, #8b5cf6); border-color: transparent; }

/* Attach preview */
.chat-attach-preview { display: flex; align-items: center; gap: 10px; padding: 6px 20px 2px; }
.chat-attach-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); }
.chat-attach-name { font-size: 12px; color: #8d85b8; flex: 1; }
.chat-attach-preview button { border: none; background: rgba(255,255,255,.1); color: #ddd6ff; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.chat-attach-preview button:hover { background: rgba(255,255,255,.2); }

body.portal-v2 .chat-attach-preview {
  max-width: 850px;
  margin: 0 auto 8px;
  padding: 8px 14px;
  background: rgba(27, 28, 36, .95);
  border: 1px solid rgba(75, 85, 99, .5);
  border-radius: 14px;
}
body.portal-v2 .chat-attach-preview img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform .15s, box-shadow .15s;
}
body.portal-v2 .chat-attach-preview img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
body.portal-v2 .chat-attach-preview .chat-attach-name {
  color: #94a3b8;
  font-size: 12px;
}
body.portal-v2 .chat-attach-preview button {
  background: rgba(100, 116, 139, .3);
  color: #94a3b8;
  width: 22px;
  height: 22px;
}
body.portal-v2 .chat-attach-preview button:hover {
  background: rgba(239, 68, 68, .3);
  color: #fca5a5;
}

/* Attach preview: hidden must win over display:flex (ChatGPT-style chip) */
.chat-attach-preview[hidden] { display: none !important; }
.chat-attach-fname { display: block; color: #e2e8f0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-attach-desc { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Balo brand label in the chat header */
.chat-brand-sub { font-size: 10.5px; font-weight: 600; color: #8b5cf6; background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.3); padding: 2px 8px; border-radius: 30px; letter-spacing: .4px; margin-left: 2px; }

/* Send button */
body.portal-v2 .chat-inputbar .portal-btn-primary { border-radius: 12px; padding: 10px 18px; }
.chat-inputbar .portal-btn-primary i { margin-right: 6px; }

/* Contextual suggestion chips after a bot reply */
.chat-suggest-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 2px 20px 6px; }
.chat-suggest-row .chat-chip { font-size: 12px; padding: 6px 12px; }
.chat-suggest-label { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #8a7fb8; margin-right: 4px; }
body.portal-v2 .chat-suggest-label { color: #8d7fd6; }
.chat-chip-ind { max-width: 100%; white-space: normal; text-align: left; line-height: 1.35; }
.chat-empty-chips { align-items: stretch; }

/* Sidebar enh */
body.portal-v2 .history-list li.active { background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(139,92,246,.05)); border-left: 3px solid #8b5cf6; }
.history-list li { position: relative; }
.chat-sidebar-close { display: none; border: none; background: rgba(255,255,255,.1); color: #c3b6ff; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; }
.chat-sidebar-backdrop { display: none; }

/* Mobile — sidebar becomes a slide-in drawer */
@media (max-width: 860px) {
  .chat-layout { display: block; }
  .chat-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 320px; z-index: 50; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .chat-sidebar.open { transform: translateX(0); }
  .chat-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 49; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.chat-drawer-open .chat-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .chat-hamburger { display: flex; align-items: center; justify-content: center; }
  .chat-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .chat-sidebar-head { position: sticky; top: 0; z-index: 2; padding: 14px 16px; display: flex; align-items: center; gap: 8px; }
  .chat-sidebar-head h3 { flex: 1; }
  .chat-main { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h, 118px)); }
  .chat-messages { flex: 1; }
  .chat-header { padding-left: 56px; padding-top: 16px; }
  .chat-bubble { max-width: 88% !important; }
  .chat-tokenbar-mobile, .chat-modelbar { padding-left: 14px !important; padding-right: 14px !important; }
  .chat-inputbar { padding: 10px 12px 12px !important; }
  .chat-attach-preview { padding: 6px 12px 2px; }
  .chat-header-actions { margin-right: 46px; }
  body.portal-v2 .chat-intelligence-strip span { font-size: 11px; }
}
@media (min-width: 861px) {
  .chat-suggest-row, .chat-research-panel { padding-left: 20px; padding-right: 20px; }
}

/* ── Chat v3: confidence badges + linked citations (VERIFIED / LIKELY / TO VERIFY) ── */
.rk-badge { display: inline-block; vertical-align: baseline; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin: 0 3px; line-height: 1.5; }
.rk-verify-ok { background: rgba(52,211,153,.16); color: #6fe3a4; border: 1px solid rgba(52,211,153,.4); }
.rk-verify-mid { background: rgba(245,180,84,.16); color: #f5c56d; border: 1px solid rgba(245,180,84,.4); }
.rk-verify-low { background: rgba(148,163,184,.16); color: #a8b4c8; border: 1px solid rgba(148,163,184,.35); }
.chat-bubble a { color: #8feaff; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }

/* v4 Premium chat polish (chat.php) */
.chat-header { gap: 14px; }
.chat-ai-avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg,#7c5cff,#22d3ee); display: flex; align-items: center; justify-content: center; color:#fff; font-size:17px; box-shadow: 0 4px 18px rgba(124,92,255,.45); animation: bbAvatarPulse 3s ease-in-out infinite; flex-shrink:0; }
.chat-ai-avatar::after { content:''; position:absolute; inset:-5px; border-radius:50%; border:1.5px dashed rgba(139,92,246,.5); animation: bbSpin 9s linear infinite; }
@keyframes bbAvatarPulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.06);} }
.chat-header-info h2 { font-size: 16px; letter-spacing: .2px; }
.chat-header-actions { margin-left:auto; }
.chat-secure-pill { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:#8fe8ff; background:rgba(34,211,238,.1); border:1px solid rgba(34,211,238,.3); padding:5px 11px; border-radius:30px; white-space:nowrap; }
.chat-secure-pill i { font-size:11px; }
.status-dot.status-busy { background:#f59e0b; animation: bbStatusBusy .9s ease-in-out infinite; }
@keyframes bbStatusBusy { 0%,100% { opacity:1; transform:scale(1);} 50% { opacity:.55; transform:scale(.85);} }

.chat-msg-avatar { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,#6d4df0,#8b5cf6); color:#fff; font-size:13px; display:flex; align-items:center; justify-content:center; margin-right:10px; flex-shrink:0; box-shadow:0 3px 10px rgba(91,60,196,.4); align-self:flex-end; }
.chat-msg.bot { align-items: flex-start; }
.chat-msg.user .chat-bubble { border-bottom-right-radius: 6px; }
body.portal-v2 .chat-msg.bot .chat-bubble { border-top-left-radius: 6px !important; }

.typing-dots { display:inline-flex; gap:4px; margin-right:8px; vertical-align:middle; }
.typing-dots i { width:6px; height:6px; border-radius:50%; background:#8b5cf6; animation: bbDot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay:.18s; }
.typing-dots i:nth-child(3) { animation-delay:.36s; }
@keyframes bbDot { 0%,60%,100% { transform:translateY(0); opacity:.45; } 30% { transform:translateY(-5px); opacity:1; } }
.typing-bubble { font-style: normal !important; }

.chat-activity { display:flex; align-items:center; gap:9px; max-width:850px; margin:8px auto 0; padding:9px 14px; border-radius:12px; font-size:12.5px; color:#c9c2f2; background:rgba(29,24,56,.65); border:1px solid rgba(139,92,246,.3); animation: bbMsgIn .25s ease-out both; box-sizing:border-box; }
.chat-activity-spin { color:#22d3ee; font-size:12px; animation: bbSpin 1.1s linear infinite; flex-shrink:0; }
.chat-activity[hidden] { display:none; }
.chat-activity-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }

.chat-empty-orb { position:relative; width:92px; height:92px; margin:0 auto 18px; border-radius:50%; background:radial-gradient(circle at 30% 25%, rgba(139,92,246,.55), rgba(34,211,238,.25) 60%, rgba(18,16,31,0)); display:flex; align-items:center; justify-content:center; color:#8b5cf6; font-size:34px; }
.chat-empty-orb i { filter: drop-shadow(0 0 12px rgba(139,92,246,.8)); animation: bbFloat 3.2s ease-in-out infinite; }
.chat-orb-ring { position:absolute; inset:0; border-radius:50%; border:1.5px solid rgba(139,92,246,.45); animation: bbSpin 7s linear infinite; }
.chat-orb-ring.ring-2 { inset:9px; border-style:dashed; border-color:rgba(34,211,238,.5); animation-duration:11s; animation-direction:reverse; }
.chat-empty-chips { gap:9px; }
body.portal-v2 .chat-empty h3 { font-size:19px; }
.chat-chip i { margin-right:6px; font-size:11px; color:#22d3ee; }
.chat-chip:hover i { color:#fff; }

body.portal-v2 .chat-inputbar .chat-inputwrap textarea { background:rgba(15,13,33,.9); border:1px solid rgba(139,92,246,.35); border-radius:14px; padding:12px 15px 26px; box-shadow:inset 0 1px 0 rgba(255,255,255,.03); transition:border-color .18s, box-shadow .18s; }
body.portal-v2 .chat-inputbar .chat-inputwrap textarea:focus { border-color:#8b5cf6; box-shadow:0 0 0 3px rgba(139,92,246,.18); }
.chat-send-btn { background:linear-gradient(135deg,#6d4df0,#22d3ee) !important; border:none; box-shadow:0 4px 14px rgba(109,77,240,.45); transition:transform .15s, box-shadow .15s; }
.chat-send-btn:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(109,77,240,.6); }
.chat-send-btn:active { transform:translateY(0) scale(.97); }
.chat-send-btn:disabled { opacity:.55; transform:none; }
.chat-send-btn span { margin-left:6px; }

.chat-modelbar select { background:#171430; border-color:rgba(139,92,246,.4); cursor:pointer; transition:border-color .18s; }
.chat-modelbar select:focus { outline:none; border-color:#22d3ee; }
.chat-modelbar label i { margin-right:5px; color:#22d3ee; font-size:11px; }

.chat-sidebar-head h3 i { margin-right:6px; color:#8b5cf6; font-size:12px; }
.history-list li a { transition:background .15s; }
.history-list li:not(.active):hover { background:rgba(139,92,246,.08); }
.chat-rename-btn { opacity:.55; transition:opacity .15s; }
.history-list li:hover .chat-rename-btn { opacity:1; }

@media (max-width: 760px) {
  .chat-secure-pill { display:none; }
  .chat-activity { margin:8px 12px 0; }
  .chat-research-list { padding:6px 12px; }
  .chat-research-list li { font-size:12px; }
  .chat-research-title { padding:8px 12px; font-size:12px; }
}


/* ═══════════════════════════════════════════════════════════════
   CHATGPT-STYLE UI — Centered Column, Clean Borders, Modern
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Unified Center Column ── */
body.portal-v2 .chat-shell { max-width: 100% !important; }
body.portal-v2 .chat-layout { grid-template-columns: 280px 1fr; }

/* ── Header: Professional AI Assistant bar ── */
body.portal-v2 .chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(15, 13, 33, .98);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

body.portal-v2 .chat-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

body.portal-v2 .chat-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

body.portal-v2 .chat-header h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d4df0, #22d3ee);
  box-shadow: 0 0 8px rgba(109, 77, 240, .7);
  animation: headerPulse 2.5s ease-in-out infinite;
}

@keyframes headerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .75; transform: scale(1.15); }
}

body.portal-v2 .chat-status {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 760px) {
  body.portal-v2 .chat-status { max-width: 34vw; font-size: 10.5px; }
}

body.portal-v2 .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, .6);
}

body.portal-v2 .chat-new-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #64748b;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  transition: all .15s;
  flex-shrink: 0;
}

body.portal-v2 .chat-new-top:hover {
  color: #c4b5fd;
  background: rgba(109, 77, 240, .2);
  border-color: rgba(109, 77, 240, .4);
}

body.portal-v2 .chat-collapse-btn {
  display: none !important;
}
@media (min-width: 861px) {
  body.portal-v2 .chat-hamburger {
    display: none !important;
  }
}

body.portal-v2 .chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--topbar-h));
  position: relative;
}

body.portal-v2 .chat-research-panel {
  flex-shrink: 0;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(139,92,246,.15);
}

body.portal-v2 .chat-header {
  position: sticky;
  top: 0;
  z-index: 10;
}

body.portal-v2 .chat-research-panel {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(15, 13, 33, .8);
  flex-shrink: 0;
}

body.portal-v2 .chat-research-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.portal-v2 .chat-research-title i {
  color: #8b5cf6;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.portal-v2 .chat-research-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── 2. Borderless AI Messages ── */
body.portal-v2 .chat-messages {
  padding: 24px 20px 20px;
  gap: 16px;
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
}

body.portal-v2 .chat-msg.bot .chat-bubble {
  background: rgba(30, 41, 59, .6) !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 14px 18px !important;
  box-shadow: none !important;
  max-width: 100% !important;
  color: #e2e8f0 !important;
}

body.portal-v2 .chat-msg.bot .chat-bubble h1,
body.portal-v2 .chat-msg.bot .chat-bubble h2,
body.portal-v2 .chat-msg.bot .chat-bubble h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5em 0 .5em;
  color: #f8fafc;
  line-height: 1.3;
}
body.portal-v2 .chat-msg.bot .chat-bubble h1 { font-size: 1.5rem; }
body.portal-v2 .chat-msg.bot .chat-bubble h2 { font-size: 1.35rem; }
body.portal-v2 .chat-msg.bot .chat-bubble h3 { font-size: 1.2rem; }

body.portal-v2 .chat-msg.bot .chat-bubble p {
  margin: 0 0 1em;
  line-height: 1.75;
  color: #cbd5e1;
}
body.portal-v2 .chat-msg.bot .chat-bubble p:last-child { margin-bottom: 0; }

body.portal-v2 .chat-msg.bot .chat-bubble ul,
body.portal-v2 .chat-msg.bot .chat-bubble ol {
  padding-left: 1.5em;
  margin: .75em 0;
  color: #cbd5e1;
}
body.portal-v2 .chat-msg.bot .chat-bubble li { margin-bottom: .5em; line-height: 1.7; }

body.portal-v2 .chat-msg.bot .chat-bubble code {
  background: rgba(15, 23, 42, .8);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .875em;
  color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
}
body.portal-v2 .chat-msg.bot .chat-bubble pre {
  background: #0f172a;
  border: 1px solid rgba(75, 85, 99, .3);
  border-radius: 8px;
  padding: 16px;
  margin: 1em 0;
  overflow-x: auto;
}
body.portal-v2 .chat-msg.bot .chat-bubble pre code { background: transparent; padding: 0; color: #e2e8f0; }
body.portal-v2 .chat-msg.bot .chat-bubble blockquote {
  border-left: 3px solid #6d4df0;
  padding-left: 16px;
  margin: 1em 0;
  color: #94a3b8;
  font-style: italic;
}
body.portal-v2 .chat-msg.bot .chat-bubble a { color: #818cf8; text-decoration: none; }
body.portal-v2 .chat-msg.bot .chat-bubble a:hover { text-decoration: underline; }
body.portal-v2 .chat-msg.bot .chat-bubble strong { color: #f1f5f9; font-weight: 600; }

/* ── 3. Refined User Message ── */
body.portal-v2 .chat-msg.user { justify-content: flex-end; }
body.portal-v2 .chat-msg.user .chat-bubble {
  background: #1E293B !important;
  border: none !important;
  border-radius: 18px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.3) !important;
  max-width: 75% !important;
  color: #f1f5f9 !important;
  font-size: 15px;
  line-height: 1.6;
}

/* ── 4. ChatGPT-Style Input Box ── */
body.portal-v2 .chat-composer {
  width: 100%;
  padding: 8px 0 10px;
  flex-shrink: 0;
  background: transparent;
}

body.portal-v2 .chat-modelbar {
  max-width: 850px;
  margin: 0 auto 12px;
  padding: 0;
  display: flex;
  justify-content: center;
}
body.portal-v2 .chat-modelbar select {
  background: rgba(31, 41, 55, .95);
  border: 1px solid rgba(75, 85, 99, .5);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  cursor: pointer;
  outline: none;
  transition: border-color .2s, color .2s;
}
body.portal-v2 .chat-modelbar select:hover,
body.portal-v2 .chat-modelbar select:focus {
  border-color: rgba(139, 92, 246, .5);
  color: #c4b5fd;
}

body.portal-v2 .chat-inputbar {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  background: #1b1c24 !important;
  border: 1px solid rgba(75, 85, 99, .6) !important;
  border-radius: 20px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255,255,255,.04);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  transition: border-color .2s, box-shadow .2s;
}
body.portal-v2 .chat-inputbar:focus-within {
  border-color: rgba(139, 92, 246, .5) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .4), 0 0 0 3px rgba(139, 92, 246, .15);
}

body.portal-v2 .chat-inputwrap { flex: 1; display: flex; align-items: stretch; }
body.portal-v2 .chat-inputwrap textarea {
  background: transparent !important;
  border: none !important;
  color: #e2e8f0 !important;
  font-size: 15px;
  line-height: 1.6;
  padding: 8px 12px !important;
  box-shadow: none !important;
  resize: none;
  min-height: 24px;
  max-height: 160px;
  width: 100%;
  outline: none;
}
body.portal-v2 .chat-inputwrap textarea::placeholder { color: #64748b; }

body.portal-v2 .chat-attach {
  color: #64748b;
  transition: color .15s, background .15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
body.portal-v2 .chat-attach:hover { color: #94a3b8; background: rgba(255, 255, 255, .06) !important; }

.chat-send-btn {
  background: linear-gradient(135deg, #6d4df0, #8b5cf6) !important;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(109, 77, 240, .4);
}
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(109, 77, 240, .6); }
.chat-send-btn:active { transform: scale(.95); }
.chat-send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.chat-send-btn i { font-size: 16px; color: #fff; }

.chat-char-count {
  font-size: 12px;
  color: #64748b;
  padding: 0 8px;
  align-self: flex-end;
  margin-bottom: 4px;
}

/* ── 5. Welcome/Contact Card ── */
body.portal-v2 .chat-intelligence-strip {
  background: transparent;
  border: none;
  padding: 0 0 16px;
  margin: 0 auto 16px;
  max-width: 850px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
body.portal-v2 .chat-intelligence-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(75, 85, 99, .4);
  border-radius: 999px;
  background: rgba(30, 41, 59, .6);
  color: #94a3b8;
  font-size: 12px;
  backdrop-filter: blur(8px);
}
body.portal-v2 .chat-intelligence-strip i { color: #818cf8; font-size: 12px; }

/* ── 6. Avatar & Message Layout ── */
body.portal-v2 .chat-msg {
  width: 100%;
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
body.portal-v2 .chat-msg.bot { justify-content: flex-start; }
body.portal-v2 .chat-msg.user { justify-content: flex-end; }

body.portal-v2 .chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d4df0, #22d3ee);
  box-shadow: 0 2px 8px rgba(109, 77, 240, .3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}
body.portal-v2 .chat-msg.user .chat-msg-avatar { background: #1E293B; box-shadow: none; }

/* ── 7. Mobile Responsiveness ── */
@media (max-width: 768px) {
  body.portal-v2 .chat-shell { max-width: 100%; }
  body.portal-v2 .chat-layout { grid-template-columns: 1fr; }
  
  body.portal-v2 .chat-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 85%; max-width: 300px;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .3s ease;
    background: #101118;
    box-shadow: 0 0 50px rgba(0,0,0,.7);
  }
  body.portal-v2 .chat-sidebar.open { transform: translateX(0); }
  
  body.portal-v2 .chat-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }
  body.chat-drawer-open .chat-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  
  body.portal-v2 .chat-messages { padding: 20px 16px 32px; gap: 16px; }
  body.portal-v2 .chat-bubble { max-width: 90% !important; font-size: 14px; padding: 12px 14px !important; }
  body.portal-v2 .chat-composer { padding: 12px 16px 16px; }
  body.portal-v2 .chat-inputbar { border-radius: 16px !important; padding: 10px 12px !important; }
  body.portal-v2 .chat-header { padding: 12px 16px; }
  
  .chat-collapse-btn { display: none !important; }
  body.portal-v2 .chat-hamburger { display: flex !important; }
  
  body.portal-v2 .chat-modelbar { margin-bottom: 8px; }
  body.portal-v2 .chat-modelbar select { font-size: 11px; padding: 5px 12px; }
  body.portal-v2 .chat-intelligence-strip { padding: 0 0 12px; }
  body.portal-v2 .chat-intelligence-strip span { font-size: 11px; padding: 5px 10px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body.portal-v2 .chat-messages { padding: 24px 20px 40px; }
  body.portal-v2 .chat-bubble { max-width: 85% !important; }
}

/* ── 8. Smooth Scrollbar ── */
body.portal-v2 .chat-messages::-webkit-scrollbar { width: 6px; }
body.portal-v2 .chat-messages::-webkit-scrollbar-track { background: transparent; }
body.portal-v2 .chat-messages::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .4); border-radius: 3px; }
body.portal-v2 .chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .6); }

/* ── 9. Animation ── */
@keyframes bbMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body.portal-v2 .chat-msg { animation: bbMsgIn .25s ease-out both; }
body.portal-v2 .chat-msg:nth-child(1) { animation-delay: .05s; }
body.portal-v2 .chat-msg:nth-child(2) { animation-delay: .1s; }
body.portal-v2 .chat-msg:nth-child(3) { animation-delay: .15s; }
body.portal-v2 .chat-msg:nth-child(4) { animation-delay: .2s; }
body.portal-v2 .chat-msg:nth-child(5) { animation-delay: .25s; }

/* ── 10. ChatGPT-style locked layout ──
   History sidebar + composer stay fixed; only the message
   thread (chat-messages) scrolls. The --topbar-h value is
   measured at runtime from the real topbar (see chat.php). */
body.portal-v2 { --topbar-h: 84px; }

body.portal-v2 .chat-layout {
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  min-height: 0;
}

body.portal-v2 .chat-main {
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  min-height: 0;
  overflow: hidden;
}

body.portal-v2 .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

body.portal-v2 .chat-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

body.portal-v2 .history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.portal-v2 .chat-composer {
  position: relative;
  z-index: 5;
}

/* ── 11. Mode switcher tabs (Chat / Research / Website Audit / Leads) ── */
body.portal-v2 .chat-modebar {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body.portal-v2 .chat-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, .45);
  background: rgba(30, 41, 59, .55);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
  white-space: nowrap;
}
body.portal-v2 .chat-mode-btn i { font-size: 11px; color: #818cf8; }
body.portal-v2 .chat-mode-btn:hover {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, .55);
  background: rgba(109, 77, 240, .12);
}
body.portal-v2 .chat-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(109, 77, 240, .92), rgba(34, 211, 238, .78));
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(109, 77, 240, .35);
}
body.portal-v2 .chat-mode-btn.active i { color: #fff; }
.chat-mode-hint {
  width: 100%;
  font-size: 10.5px;
  color: #64748b;
  padding: 1px 2px 0;
  letter-spacing: .2px;
}
@media (max-width: 768px) {
  body.portal-v2 .chat-modebar { padding: 0 2px 8px; gap: 5px; }
  body.portal-v2 .chat-mode-btn { font-size: 11px; padding: 5px 11px; }
  .chat-mode-hint { font-size: 10px; }
}

/* Hide the raw char counter (it showed as a stray digit under the circular
   send button) — maxlength 1500 still enforces it via the send guard */
body.portal-v2 .chat-charcount { display: none !important; }

/* ─── Chat: Pro Prompts (button + popup library) ─── */
.chat-prompt-count { color: rgba(125, 227, 245, .75); font-weight: 600; }

.chat-prompt-hint {
  margin-bottom: 10px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(139, 92, 246, .12);
  border: 1px solid rgba(139, 92, 246, .3);
  color: #cbb9ff;
  font-size: 12px;
  line-height: 1.5;
  animation: bbFadeIn .25s ease;
}

.chat-prompt-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, .35);
  background: rgba(139, 92, 246, .12);
  color: #c9b8ff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
  align-self: center;
  white-space: nowrap;
}
.chat-prompt-btn:hover { background: rgba(139, 92, 246, .22); border-color: rgba(139, 92, 246, .6); color: #fff; transform: translateY(-1px); }
.chat-prompt-btn:active { transform: translateY(0) scale(.97); }
.chat-prompt-btn i { font-size: 12px; }

.chat-prompt-overlay[hidden],
.chat-prompt-pop[hidden] { display: none !important; }

.chat-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 4, 16, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: bbFadeIn .18s ease-out both;
}
.chat-prompt-pop {
  width: min(600px, 94vw);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: #161229;
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  overflow: hidden;
  animation: bbMsgIn .22s ease-out both;
}
.chat-prompt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(139, 92, 246, .22);
  background: linear-gradient(135deg, rgba(109, 77, 240, .14), rgba(34, 211, 238, .07));
}
.chat-prompt-head-tx strong { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; }
.chat-prompt-head-tx strong i { color: #a78bfa; }
.chat-prompt-sub { display: block; margin-top: 5px; color: #9aa0c7; font-size: 12.5px; line-height: 1.5; }
.chat-prompt-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, .06);
  color: #b7b2dd;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chat-prompt-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* Prompt search */
.chat-prompt-search { position: relative; padding: 12px 16px 0; }
.chat-prompt-search i {
  position: absolute;
  left: 27px; top: 22px;
  color: #6f6796;
  font-size: 12px;
  pointer-events: none;
}
.chat-prompt-search input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, .32);
  background: rgba(255, 255, 255, .04);
  color: #e4e0ff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-prompt-search input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.chat-prompt-search input::placeholder { color: #6f6796; }
.chat-prompt-search input::-webkit-search-cancel-button { cursor: pointer; filter: invert(.5); }
.chat-prompt-empty { padding: 26px 16px; text-align: center; color: #8b84ad; font-size: 13px; line-height: 1.6; }

.chat-prompt-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 6px 14px 16px; }
.chat-prompt-grp h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 2px 8px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8f86c9;
}
.chat-prompt-cat-ic { color: #a78bfa; font-size: 12px; }
.chat-prompt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  margin-bottom: 7px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, .18);
  background: rgba(255, 255, 255, .025);
  color: #e6e1ff;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.chat-prompt-item:hover { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .5); transform: translateX(2px); }
.chat-prompt-item-ic {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(139, 92, 246, .16);
  color: #b8a5ff;
  font-size: 14px;
}
.chat-prompt-item-tx { flex: 1 1 auto; min-width: 0; }
.chat-prompt-item-tx strong { display: block; font-size: 13.5px; color: #fff; }
.chat-prompt-item-tx em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: #8d93b8; line-height: 1.4; }
.chat-prompt-item-plus {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, .25);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

@keyframes bbFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Chat: markdown tables + Excel download ─── */
.bb-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 6px;
  font-size: 12.5px;
  line-height: 1.45;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, .28);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.bb-table thead th {
  background: rgba(139, 92, 246, .18);
  color: #e6e1ff;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(139, 92, 246, .35);
}
.bb-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(139, 92, 246, .12);
  background: rgba(255, 255, 255, .02);
}
.bb-table tbody tr:last-child td { border-bottom: none; }
.bb-table tbody tr:hover td { background: rgba(139, 92, 246, .08); }

.bb-table-dl { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.bb-table-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34, 211, 238, .35);
  background: rgba(34, 211, 238, .1);
  color: #7ee8fa;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.bb-table-dl-btn:hover { background: rgba(34, 211, 238, .2); border-color: rgba(34, 211, 238, .6); color: #fff; }
.bb-table-dl-btn i { font-size: 11px; }

@media (max-width: 520px) {
  .chat-prompt-btn { padding: 0 9px; font-size: 0; gap: 0; width: 36px; }
  .chat-prompt-btn i { font-size: 14px; margin: 0; }
  .chat-prompt-overlay { padding: 10px; align-items: flex-end; }
  .chat-prompt-pop { width: 100%; max-height: 84vh; border-radius: 18px 18px 0 0; }
  .chat-prompt-item-tx em { font-size: 11.5px; }
}

/* ─── Chat: small-screen polish ─── */
@media (max-width: 760px) {
  .chat-main { height: 76vh; height: 76dvh; }
  .chat-shell { max-width: none; }
}
@media (max-width: 380px) {
  .chat-inputbar { padding: 8px; gap: 6px; }
  .chat-attach, .chat-send-btn { width: 38px; height: 40px; }
  .chat-inputwrap textarea { padding-left: 10px; font-size: 13px; }
  .chat-prompt-hint { font-size: 11.5px; padding: 8px 10px; }
  .chat-prompt-item { padding: 11px 12px; }
  .chat-prompt-grp h4 { font-size: 12px; }
  .chat-messages { padding: 14px; }
  .chat-bubble { max-width: 94% !important; font-size: 13px; }
  .chat-prompt-overlay { padding: 6px; }
  .chat-prompt-pop { max-height: 88vh; }
}

/* ─── Topbar v3 — one clean system (no wrap, no scroll, nothing half-shown) ───
   ≥1200px: all 11 links in one row inside a wider topbar container.
   <1200px: hamburger dropdown with all links — the only two states. */
.portal-topbar .portal-container { max-width: 1320px; }
body.portal-v2 .topbar-inner { flex-wrap: nowrap; gap: 14px; }
body.portal-v2 .topbar-right { gap: 12px; }
body.portal-v2 .topbar-nav { display: flex; align-items: center; gap: 3px; flex-wrap: nowrap; overflow: visible; }
body.portal-v2 .topbar-link { font-size: 12px; padding: 6px 8px; }
body.portal-v2 .topbar-logo img { width: 146px; max-height: 44px; }

@media (min-width: 1280px) {
  body.portal-v2 .topbar-hamburger { display: none; }
}
@media (max-width: 1279px) {
  .portal-topbar { padding: 10px 0; }
  body.portal-v2 .topbar-hamburger { display: inline-flex; }
  body.portal-v2 .topbar-nav { display: none; }
}
@media (max-width: 480px) {
  body.portal-v2 .topbar-logo img { width: 116px; }
  body.portal-v2 .topbar-user { gap: 6px; padding: 3px 8px 3px 3px; }
  body.portal-v2 .topbar-user-name { display: none; }
  body.portal-v2 .topbar-right { gap: 8px; }
  .topbar-mobile-link { font-size: 13.5px; padding: 11px 13px; }
}

/* ─── Mobile responsive hotfixes (v27) — win over inline logo width, no half-shown content ─── */
@media (max-width: 700px) {
  body.portal-v2 .topbar-logo img { width: 138px !important; max-height: 44px !important; height: auto !important; }
}
@media (max-width: 480px) {
  body.portal-v2 .topbar-logo img { width: 108px !important; max-height: 38px !important; }
}
@media (max-width: 360px) {
  body.portal-v2 .topbar-logo img { width: 90px !important; }
  body.portal-v2 .topbar-hamburger { width: 34px; height: 34px; }
  body.portal-v2 .topbar-right { gap: 6px; }
  body.portal-v2 .topbar-user { gap: 4px; padding: 2px 6px 2px 2px; }
  body.portal-v2 .cp-bell { width: 32px; height: 32px; }
}

/* Grid columns + card text: never let content push the page wider than the screen */
.portal-col-main, .portal-col-side { min-width: 0; }
.v2-tip-body, .v2-tip-body p, .v2-contact, .cp-notif-row-text, .v2-card-ai-desc, .cp-mission-head p { overflow-wrap: break-word; min-width: 0; }

/* Hero copy: no clipping on very narrow screens */
@media (max-width: 480px) {
  .v2-hero-copy { flex: 1 1 100%; min-width: 0; }
}

/* Chat composer: align modebar/modelbar/inputbar on the same edge, uniform icon buttons */
@media (max-width: 860px) {
  body.portal-v2 .chat-modebar { padding-left: 14px !important; padding-right: 14px !important; }
}
@media (max-width: 480px) {
  .chat-attach, .chat-send-btn, .chat-prompt-btn { height: 40px; }
  .chat-inputbar { align-items: flex-end; }
  .chat-mode-btn { padding: 5px 9px; gap: 5px; }
}
