.portal-nav {
  position: relative;
}

.portal-menu-toggle {
  display: none;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: #e9effb;
  padding: 8px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.license-key-block {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.license-key-block .license-key {
  min-width: 0;
  overflow: visible;
  color: #9ac0ff;
  font: 700 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: normal;
}

.copy-key {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid #2d4975;
  border-radius: 9px;
  background: rgba(57, 125, 255, .09);
  color: #a9c8ff;
  padding: 6px 9px;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.copy-key:hover,
.copy-key:focus-visible,
.portal-menu-toggle:focus-visible {
  border-color: #5d95ff;
  color: #fff;
  outline: 2px solid rgba(81, 215, 255, .35);
  outline-offset: 2px;
}

.customer-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 0 0 24px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid #345c9d;
  border-radius: 22px;
  background: radial-gradient(circle at 95% 10%, rgba(81, 215, 255, .15), transparent 18rem), linear-gradient(125deg, #142d55, #0e182a 72%);
}

.customer-welcome h2 { max-width: 660px; margin: 0 0 10px; font-size: clamp(25px, 3vw, 35px); letter-spacing: -.03em; }
.customer-welcome p { max-width: 650px; margin: 0 0 13px; color: #c2d3ef; line-height: 1.55; }
.customer-welcome small { color: #9cbae9; overflow-wrap: anywhere; }
.customer-welcome-actions { display: flex; flex: 0 0 auto; flex-direction: column; gap: 10px; }
.portal-section .actions { display: flex; flex-wrap: wrap; gap: 9px; }
.game-card .mod-install-warning { max-width: 38rem; color: #ffcb80; line-height: 1.4; }
.payment-finished .mod-install-warning { color: #ffcb80; }
.license-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.license-actions a { color: #9ac0ff; font-size: 11px; font-weight: 800; text-decoration: none; }
.license-actions a:hover { text-decoration: underline; }

.reset-quota {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 15px;
  padding: 22px 24px;
  border: 1px solid #345c9d;
  border-radius: 17px;
  background: linear-gradient(115deg, rgba(41, 86, 153, .3), rgba(13, 19, 31, .95));
}
.reset-quota .portal-eyebrow { margin-bottom: 5px; }
.reset-quota strong { display: block; font-size: clamp(20px, 3vw, 28px); }
.reset-quota p { max-width: 410px; margin: 0; color: #bed0eb; font-size: 13px; line-height: 1.5; }
.reset-warning { margin-bottom: 25px; padding: 15px 18px; border: 1px solid #735a32; border-radius: 12px; background: rgba(115, 79, 30, .16); }
.reset-warning strong { color: #ffd288; }
.reset-warning p { margin: 5px 0 0; color: #d5c8b5; font-size: 13px; line-height: 1.5; }
.reset-license-list { display: grid; gap: 17px; }
.reset-license { scroll-margin-top: 95px; }
.reset-license-heading p { margin: 6px 0 0; color: var(--portal-muted); font-size: 12px; }
.reset-license-count { color: var(--portal-muted); font-size: 13px; }
.reset-license-count strong { color: #fff; font-size: 19px; }
.reset-no-devices { color: var(--portal-muted); font-size: 13px; }
.reset-device-list { display: grid; gap: 8px; margin-top: 18px; }
.reset-device-row { padding: 13px 14px; border: 1px solid var(--portal-line); border-radius: 12px; background: #090f19; }
.reset-device-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reset-device-summary strong { font-size: 13px; }
.reset-device-summary small { display: block; margin-top: 4px; color: var(--portal-muted); font-size: 11px; }
.reset-action { margin-top: 13px; border: 1px solid #31548a; border-radius: 11px; background: rgba(49, 84, 138, .11); }
.reset-action.individual { border-color: var(--portal-line); background: transparent; }
.reset-action summary { padding: 12px 14px; color: #a9c8ff; font-size: 12px; font-weight: 850; cursor: pointer; }
.reset-action summary:focus-visible { outline: 2px solid #5d95ff; outline-offset: 2px; }
.reset-action-body { padding: 3px 14px 15px; border-top: 1px solid var(--portal-line); }
.reset-action-body p { margin: 11px 0 14px; color: #b7c5dd; font-size: 12px; line-height: 1.5; }
.reset-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.reset-form label { display: grid; gap: 6px; color: #c5cee0; font-size: 11px; font-weight: 700; }
.reset-form label strong { color: #fff; }
.reset-form input { width: 180px; min-height: 38px; padding: 8px 10px; border: 1px solid #40536e; border-radius: 9px; background: #080d16; color: #fff; font: inherit; font-size: 12px; }
.reset-form input:focus-visible { outline: 2px solid #5d95ff; outline-offset: 2px; }
.reset-form :disabled { cursor: not-allowed; opacity: .48; }

.topup-pix-layout {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-top: 18px;
}

.topup-qr {
  width: 100%;
  aspect-ratio: 1;
  border: 10px solid #fff;
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
}

#topup-result textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--portal-line);
  border-radius: 11px;
  background: #080d16;
  color: #d8e7ff;
  padding: 13px;
}

#pending-payment textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--portal-line);
  border-radius: 11px;
  background: #080d16;
  color: #d8e7ff;
  padding: 13px;
}

.pending-payment-card { max-width: 900px; margin-inline: auto; padding: 28px; }
.pending-payment-card > p { color: var(--portal-muted); }
.payment-finished { display: grid; justify-items: start; gap: 13px; }
.payment-finished > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: rgba(69,221,160,.14); color: var(--portal-green); font-size: 26px; }
.payment-finished h2,.payment-finished p { margin: 0; }
.payment-finished p { color: var(--portal-muted); }
.payment-finished code { max-width: 100%; padding: 12px 14px; border: 1px solid var(--portal-line); border-radius: 10px; background: #080d16; color: #9ac0ff; overflow-wrap: anywhere; }

#topup-status {
  color: var(--portal-muted);
  font-size: 13px;
}

/* In-page actions must land below the sticky account navigation. */
#jogos, #minhas-keys, .reset-license { scroll-margin-top: 94px; }

@media (max-width: 850px) {
  .customer-welcome { align-items: flex-start; flex-direction: column; }
  .customer-welcome-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .reset-quota { align-items: flex-start; flex-direction: column; }
  .portal-menu-toggle { display: inline-flex; margin-left: auto; }

  .portal-nav nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--portal-line);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: rgba(7, 10, 17, .98);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  }

  .portal-nav nav.open { display: flex; }
  .portal-nav nav > a:not(.portal-nav-cta) { display: inline-flex; }
  .portal-nav nav > a,
  .portal-nav nav form,
  .portal-nav nav form button { width: 100%; }
  .portal-nav nav form button { justify-content: flex-start; }
  .license-key-block { align-items: stretch; flex-direction: column; }
  .copy-key { align-self: flex-start; }
}

@media (max-width: 560px) {
  .portal-shell { width: min(100% - 32px, 1160px); }
  .portal-nav { height: 60px; gap: 10px; }
  .portal-menu-toggle { min-height: 36px; padding: 7px 11px; }
  .portal-main { padding-block: 22px 50px; }
  .dashboard-hero { gap: 17px; margin-bottom: 18px; }
  .dashboard-hero h1 { margin-bottom: 9px; font-size: clamp(32px, 9vw, 40px); line-height: 1.1; }
  .dashboard-hero p { font-size: 13px; line-height: 1.55; }
  .dashboard-hero > .portal-button { width: 100%; }
  .portal-eyebrow { margin-bottom: 7px; font-size: 10px; }
  .portal-card { border-radius: 17px; }
  .portal-section { padding: 17px; }
  .portal-grid { gap: 12px; }
  .section-heading { gap: 8px; margin-bottom: 14px; }
  .section-heading h2 { font-size: 19px; }
  .customer-welcome { gap: 17px; margin-bottom: 16px; padding: 19px; border-radius: 17px; }
  .customer-welcome h2 { margin-bottom: 8px; font-size: 23px; line-height: 1.16; }
  .customer-welcome p { margin-bottom: 10px; font-size: 13px; line-height: 1.5; }
  .customer-welcome small { font-size: 11px; overflow-wrap: anywhere; }
  .customer-welcome-actions { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .customer-welcome-actions .portal-button { width: 100%; min-height: 42px; padding: 8px; font-size: 11px; text-align: center; }
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
  .portal-stats article { min-width: 0; padding: 14px; border-radius: 13px; }
  .portal-stats article:last-child { grid-column: 1 / -1; }
  .portal-stats span { margin-bottom: 5px; font-size: 10px; line-height: 1.35; }
  .portal-stats strong { font-size: 23px; }
  .portal-section .actions { gap: 8px; }
  .portal-section .actions .portal-button { min-height: 39px; }
  .license-row { gap: 12px; padding: 13px; }
  .license-row > div:first-child { min-width: 0; }
  .license-row strong, .game-card strong { overflow-wrap: anywhere; }
  .game-card { grid-template-columns: 39px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .game-icon { width: 39px; height: 39px; }
  .game-card .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card .actions .portal-button { width: 100%; text-align: center; }
  .order-list > div { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .order-list > div > .portal-badge { grid-column: 1 / -1; }
  #jogos, #minhas-keys, .reset-license { scroll-margin-top: 77px; }
  .reset-quota { padding: 18px; }
  .reset-device-summary { align-items: flex-start; flex-direction: column; }
  .reset-form { align-items: stretch; flex-direction: column; }
  .reset-form label,.reset-form input,.reset-form button { width: 100%; }
  .topup-pix-layout { grid-template-columns: 1fr; }
  .topup-qr { width: min(100%, 260px); justify-self: center; }
}

@media (max-width: 360px) {
  .customer-welcome-actions, .game-card .actions { grid-template-columns: 1fr; }
  .portal-stats article { padding: 12px; }
}
