/* ==============================================================
   QKAuth modal + QKProfile flyout — pop-up auth and profile menu
   styles. Loaded via shell.js after stake.css and overhaul.css.
   ============================================================== */

/* ===== Auth modal (login + register popup) ===== */
.qk-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.qk-auth-overlay.visible {
  opacity: 1;
}
.qk-auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #0c1014 0%, #050608 100%);
  border: 1px solid rgba(127, 248, 0, 0.32);
  border-radius: 16px;
  padding: 22px 22px 24px;
  color: var(--s-text, #fff);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 0 36px rgba(127, 248, 0, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.qk-auth-overlay.visible .qk-auth-card {
  transform: translateY(0) scale(1);
}
.qk-auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.qk-auth-brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}
.qk-auth-brand .s-brand-dot {
  color: var(--s-green, #7ff800);
}
.qk-auth-close {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--s-muted, #9aa6b4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.qk-auth-close:hover {
  background: rgba(239, 60, 78, 0.16);
  color: var(--s-red-2, #ff5d6c);
  border-color: rgba(239, 60, 78, 0.4);
}
.qk-auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.qk-auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--s-muted, #9aa6b4);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.qk-auth-tab:hover {
  color: var(--s-text, #fff);
}
.qk-auth-tab.active {
  background: var(--s-green, #7ff800);
  color: #001a00;
  box-shadow: 0 6px 16px rgba(127, 248, 0, 0.32);
}
.qk-auth-panel {
  display: none;
  animation: qkAuthFadeIn 0.22s ease-out;
}
.qk-auth-panel.active {
  display: block;
}
@keyframes qkAuthFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.qk-auth-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #fff;
}
.qk-auth-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--s-muted, #9aa6b4);
}
.qk-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qk-auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qk-auth-field label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
}
.qk-auth-field .qk-auth-opt {
  text-transform: none;
  letter-spacing: 0;
  color: var(--s-muted-2, #6a7483);
  font-weight: 600;
}
.qk-auth-field input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qk-auth-field input:focus {
  outline: 0;
  border-color: var(--s-green, #7ff800);
  box-shadow: 0 0 0 3px rgba(127, 248, 0, 0.18);
}
.qk-auth-submit {
  margin-top: 4px;
  padding: 12px 18px;
  background: var(--s-green, #7ff800);
  color: #001a00;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 22px rgba(127, 248, 0, 0.36), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: filter 0.15s, transform 0.15s, opacity 0.15s;
}
.qk-auth-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.qk-auth-submit:disabled,
.qk-auth-submit.busy {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.qk-auth-error {
  min-height: 16px;
  color: var(--s-red-2, #ff5d6c);
  font-size: 12px;
  font-weight: 700;
}
.qk-auth-foot {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--s-muted, #9aa6b4);
  text-align: center;
}
.qk-auth-foot a {
  color: var(--s-green, #7ff800);
  text-decoration: none;
  font-weight: 700;
}
.qk-auth-foot a:hover {
  text-decoration: underline;
}

/* ===== Profile flyout (right of sidebar) ===== */
.qk-pf-root {
  position: fixed;
  z-index: 600;
  display: flex;
  gap: 0;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.qk-pf-root.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
/* When the inner pane is open and the viewport is narrow, stack vertically. */
.qk-pf-root.stacked {
  flex-direction: column;
  align-items: stretch;
  width: 320px;
}

/* Outer menu pane */
.qk-pf-menu {
  width: 280px;
  background: linear-gradient(180deg, #0c1014 0%, #050608 100%);
  border: 1px solid rgba(127, 248, 0, 0.28);
  border-radius: 14px;
  padding: 8px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(127, 248, 0, 0.12);
  color: var(--s-text, #fff);
}
.qk-pf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
}
.qk-pf-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
}
.qk-pf-close {
  background: transparent;
  border: 0;
  color: var(--s-muted, #9aa6b4);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.qk-pf-close:hover {
  color: var(--s-text, #fff);
  background: rgba(255, 255, 255, 0.04);
}
.qk-pf-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qk-pf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: transparent;
  border: 0;
  color: var(--s-text, #fff);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s, transform 0.15s;
}
.qk-pf-item:hover {
  background: rgba(127, 248, 0, 0.08);
  transform: translateX(2px);
}
.qk-pf-item.active {
  background: linear-gradient(90deg, rgba(127, 248, 0, 0.16), rgba(127, 248, 0, 0.02));
  box-shadow: inset 2px 0 0 var(--s-green, #7ff800);
}
.qk-pf-item-ico {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}
.qk-pf-item-label {
  flex: 1;
}
.qk-pf-item-caret {
  color: var(--s-muted, #9aa6b4);
  font-size: 18px;
  line-height: 1;
}

/* Inner content pane */
.qk-pf-content {
  width: 360px;
  max-height: min(620px, calc(100vh - 40px));
  background: linear-gradient(180deg, #0c1014 0%, #050608 100%);
  border: 1px solid rgba(127, 248, 0, 0.22);
  border-radius: 14px;
  margin-left: 10px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(127, 248, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--s-text, #fff);
}
.qk-pf-root.stacked .qk-pf-content {
  width: 100%;
  margin-left: 0;
  margin-top: 8px;
}
.qk-pf-content[hidden] {
  display: none;
}
.qk-pf-content-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.qk-pf-back {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--s-text, #fff);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.qk-pf-back:hover {
  background: rgba(127, 248, 0, 0.12);
  border-color: var(--s-green, #7ff800);
  color: var(--s-green, #7ff800);
}
.qk-pf-content-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}
.qk-pf-content-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.qk-pf-loading {
  padding: 18px;
  text-align: center;
  color: var(--s-muted, #9aa6b4);
  font-size: 13px;
}
.qk-pf-err {
  padding: 18px;
  color: var(--s-red-2, #ff5d6c);
  font-size: 13px;
  font-weight: 700;
}
.qk-pf-note {
  margin: 0 0 14px;
  color: var(--s-muted, #9aa6b4);
  font-size: 13px;
  line-height: 1.5;
}

/* ---- Wallet sub-panel ---- */
.qk-pf-wallets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qk-pf-wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.qk-pf-wallet:hover {
  border-color: rgba(127, 248, 0, 0.4);
  background: rgba(127, 248, 0, 0.04);
}
.qk-pf-wallet.connected {
  border-color: rgba(127, 248, 0, 0.42);
  background: rgba(127, 248, 0, 0.06);
}
.qk-pf-wallet-emoji {
  font-size: 28px;
  line-height: 1;
  flex: 0 0 32px;
  text-align: center;
}
.qk-pf-wallet-meta {
  flex: 1;
  min-width: 0;
}
.qk-pf-wallet-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.qk-pf-wallet-addr {
  font-size: 11px;
  color: var(--s-muted, #9aa6b4);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.qk-pf-wallet-addr .muted {
  color: var(--s-muted-2, #6a7483);
  font-style: italic;
}
.qk-pf-wallet-btn {
  background: rgba(127, 248, 0, 0.12);
  border: 1px solid rgba(127, 248, 0, 0.4);
  color: var(--s-green, #7ff800);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.qk-pf-wallet-btn:hover {
  background: rgba(127, 248, 0, 0.22);
}
.qk-pf-wallet.connected .qk-pf-wallet-btn {
  background: rgba(239, 60, 78, 0.12);
  border-color: rgba(239, 60, 78, 0.42);
  color: var(--s-red-2, #ff5d6c);
}

/* ---- Affiliate sub-panel ---- */
.qk-pf-code {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(127, 248, 0, 0.06);
  border: 1px solid rgba(127, 248, 0, 0.32);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.qk-pf-code-value {
  flex: 1;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--s-green, #7ff800);
  text-shadow: 0 0 12px rgba(127, 248, 0, 0.4);
}
.qk-pf-code-copy {
  background: var(--s-green, #7ff800);
  color: #001a00;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s;
}
.qk-pf-code-copy:hover {
  filter: brightness(1.08);
}
.qk-pf-more {
  display: inline-block;
  color: var(--s-green, #7ff800);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  margin-top: 4px;
}
.qk-pf-more:hover {
  text-decoration: underline;
}

/* ---- Statistics sub-panel ---- */
.qk-pf-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qk-pf-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 10px;
}
.qk-pf-stat-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
  margin-bottom: 6px;
}
.qk-pf-stat-val {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.qk-pf-stat-green .qk-pf-stat-val {
  color: var(--s-green, #7ff800);
  text-shadow: 0 0 14px rgba(127, 248, 0, 0.4);
}
.qk-pf-stat-red .qk-pf-stat-val {
  color: var(--s-red-2, #ff5d6c);
  text-shadow: 0 0 14px rgba(239, 60, 78, 0.32);
}

/* ---- Settings sub-panel ---- */
.qk-pf-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.qk-pf-section:first-child {
  padding-top: 0;
}
.qk-pf-section:last-of-type {
  border-bottom: 0;
}
.qk-pf-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
}
.qk-pf-readonly {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.qk-pf-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qk-pf-form label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
}
.qk-pf-form input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.qk-pf-form input:focus {
  outline: 0;
  border-color: var(--s-green, #7ff800);
  box-shadow: 0 0 0 3px rgba(127, 248, 0, 0.18);
}
.qk-pf-btn {
  align-self: flex-start;
  padding: 9px 14px;
  border-radius: 8px;
  border: 0;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s, background 0.15s;
}
.qk-pf-btn.primary {
  background: var(--s-green, #7ff800);
  color: #001a00;
  box-shadow: 0 8px 18px rgba(127, 248, 0, 0.32), inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.qk-pf-btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.qk-pf-btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--s-text, #fff);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.qk-pf-btn.ghost:hover {
  background: rgba(127, 248, 0, 0.1);
  border-color: var(--s-green, #7ff800);
  color: var(--s-green, #7ff800);
}
.qk-pf-form-msg {
  min-height: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--s-muted, #9aa6b4);
}
.qk-pf-form-msg.ok {
  color: var(--s-green, #7ff800);
}
.qk-pf-form-msg.err {
  color: var(--s-red-2, #ff5d6c);
}
.qk-pf-logout {
  margin-top: 14px;
  width: 100%;
  text-align: center;
  align-self: stretch;
}

/* Avatar uploader inside Settings */
.qk-pf-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.qk-pf-avatar-preview {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #0a1f05, #050608);
  border: 2px solid var(--s-green, #7ff800);
  box-shadow:
    0 0 0 4px rgba(127, 248, 0, 0.08),
    inset 0 0 12px rgba(127, 248, 0, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 78px;
}
.qk-pf-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qk-pf-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.qk-pf-avatar-ctl {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.qk-pf-avatar-ctl .qk-pf-btn {
  align-self: flex-start;
}
.qk-pf-file-hidden {
  display: none;
}
.qk-pf-avatar-msg {
  min-height: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--s-muted, #9aa6b4);
}
.qk-pf-avatar-msg.ok {
  color: var(--s-green, #7ff800);
}
.qk-pf-avatar-msg.err {
  color: var(--s-red-2, #ff5d6c);
}

/* ===== Mobile breakpoints ===== */
@media (max-width: 640px) {
  .qk-auth-card {
    max-width: none;
    padding: 18px;
    border-radius: 14px;
  }
  .qk-auth-title {
    font-size: 19px;
  }
  /* Profile flyout: full-width sheet that slides up from the bottom */
  .qk-pf-root {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    transform: translateY(8px);
    flex-direction: column;
    align-items: stretch;
    max-height: 92vh;
  }
  .qk-pf-root.visible {
    transform: translateY(0);
  }
  .qk-pf-menu,
  .qk-pf-content {
    width: auto;
    max-width: none;
    border-radius: 14px 14px 0 0;
    margin: 0;
  }
  .qk-pf-content {
    margin-top: 6px;
  }
}

/* ==============================================================
   QKReferralRequest modal — custom 2-field dialog used by the
   profile flyout's Affiliate tab AND /affiliates.html. Styled to
   match the auth modal above (dark card, green accent).
   ============================================================== */
.qk-ref-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.qk-ref-overlay.qk-ref-visible {
  opacity: 1;
}
.qk-ref-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #0c1014 0%, #050608 100%);
  border: 1px solid rgba(127, 248, 0, 0.32);
  border-radius: 16px;
  padding: 20px 22px 22px;
  color: var(--s-text, #fff);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 0 36px rgba(127, 248, 0, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.qk-ref-overlay.qk-ref-visible .qk-ref-card {
  transform: translateY(0) scale(1);
}
.qk-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.qk-ref-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #fff;
}
.qk-ref-close {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--s-muted, #9aa6b4);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.qk-ref-close:hover {
  background: rgba(239, 60, 78, 0.16);
  color: var(--s-red-2, #ff5d6c);
  border-color: rgba(239, 60, 78, 0.4);
}
.qk-ref-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.qk-ref-field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--s-muted, #9aa6b4);
}
.qk-ref-field input,
.qk-ref-field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--s-text, #fff);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.qk-ref-field input {
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.qk-ref-field textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.45;
}
.qk-ref-field input:focus,
.qk-ref-field textarea:focus {
  border-color: rgba(127, 248, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(127, 248, 0, 0.12);
}
.qk-ref-help {
  font-size: 11px;
  color: var(--s-muted, #9aa6b4);
}
.qk-ref-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.qk-ref-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}
.qk-ref-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.qk-ref-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.qk-ref-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--s-muted, #9aa6b4);
  border-color: rgba(255, 255, 255, 0.1);
}
.qk-ref-btn-cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.qk-ref-btn-send {
  background: linear-gradient(180deg, #8fff12 0%, #6ad700 100%);
  color: #050608;
  box-shadow: 0 6px 18px rgba(127, 248, 0, 0.3);
}
.qk-ref-btn-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(127, 248, 0, 0.38);
}

@media (max-width: 520px) {
  .qk-ref-card {
    max-width: 100%;
    padding: 18px 16px 20px;
  }
  .qk-ref-btns {
    flex-direction: column-reverse;
  }
  .qk-ref-btn {
    width: 100%;
  }
}

/* ----- Level sub-panel (profile flyout) ----- */
.qk-pf-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.qk-pf-level-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.qk-pf-level-badge .qk-pf-level-num {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #7ff800 0%, #fce403 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(127,248,0,.35);
}
.qk-pf-level-badge .qk-pf-level-word {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
  margin-top: 2px;
}
.qk-pf-level-next {
  font-size: 12px;
  color: var(--s-muted, #9aa6b4);
  letter-spacing: .04em;
}
.qk-pf-level-next strong {
  color: var(--s-text, #fff);
  font-weight: 900;
}
.qk-pf-level-bar-wrap { margin: 4px 0 8px; }
.qk-pf-level-bar {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.qk-pf-level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3aa700 0%, #7ff800 60%, #fce403 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(127,248,0,.5);
  transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.qk-pf-level-sub {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--s-muted, #9aa6b4);
  margin-bottom: 14px;
}
.qk-pf-level-sub strong {
  color: var(--s-text, #fff);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.qk-pf-level-daily {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qk-pf-level-daily-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 10px;
}
.qk-pf-level-daily-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--s-muted, #9aa6b4);
  margin-bottom: 6px;
}
.qk-pf-level-daily-val {
  font-size: 20px;
  font-weight: 900;
  color: var(--s-green, #7ff800);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(127,248,0,.35);
}
.qk-pf-level-daily-val.qk-pf-level-daily-next {
  color: var(--s-gold, #fce403);
  text-shadow: 0 0 14px rgba(252,228,3,.4);
}
.qk-pf-level-daily-unit {
  font-size: 12px;
  color: var(--s-muted, #9aa6b4);
  text-shadow: none;
  font-weight: 700;
  margin-left: 4px;
}
