:root {
  color-scheme: dark;
  --portal-bg: #eef6f5;
  --portal-surface: rgba(255, 255, 255, 0.94);
  --portal-surface-strong: #ffffff;
  --portal-surface-soft: #f2faf9;
  --portal-border: rgba(18, 54, 57, 0.09);
  --portal-border-strong: rgba(18, 54, 57, 0.15);
  --portal-text: #10242b;
  --portal-text-soft: #4f6971;
  --portal-primary: #2ea7ac;
  --portal-primary-strong: #0f6f75;
  --portal-primary-soft: rgba(46, 167, 172, 0.12);
  --portal-accent: #157f86;
  --portal-download: #7ddedb;
  --portal-download-strong: #0f7f85;
  --portal-download-soft: rgba(125, 222, 219, 0.16);
  --portal-success: #1a9d68;
  --portal-warn: #d18a21;
  --portal-danger: #cf5252;
  --portal-shadow: 0 26px 80px rgba(24, 61, 67, 0.12);
  --portal-card-shadow: 0 16px 42px rgba(24, 61, 67, 0.08);
}

.portal-theme-dark {
  color-scheme: dark;
  --portal-bg: #111a1d;
  --portal-surface: rgba(15, 25, 29, 0.94);
  --portal-surface-strong: #132126;
  --portal-surface-soft: #16252a;
  --portal-border: rgba(141, 230, 227, 0.08);
  --portal-border-strong: rgba(141, 230, 227, 0.14);
  --portal-text: #edf8f5;
  --portal-text-soft: #98b2b1;
  --portal-primary: #75ddd8;
  --portal-primary-strong: #c8fff8;
  --portal-primary-soft: rgba(117, 221, 216, 0.12);
  --portal-accent: #8ff3ee;
  --portal-download: #95efea;
  --portal-download-strong: #d5fffb;
  --portal-download-soft: rgba(149, 239, 234, 0.16);
  --portal-success: #79e3af;
  --portal-warn: #ffca73;
  --portal-danger: #ff9a9a;
  --portal-shadow: 0 28px 84px rgba(0, 0, 0, 0.36);
  --portal-card-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Verdana, "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.34;
  color: var(--portal-text);
  background:
    radial-gradient(circle at top left, rgba(149, 239, 234, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(46, 167, 172, 0.1), transparent 30%),
    linear-gradient(180deg, var(--portal-bg) 0%, color-mix(in srgb, var(--portal-bg) 90%, #ffffff 10%) 100%);
}

body.portal-modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.portal-shell {
  width: 100%;
  max-width: 100%;
  padding: 0 0 36px;
}

.portal-header {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto 14px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--portal-border);
  border-top: 0;
  border-radius: 0 0 28px 28px;
  background: var(--portal-surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--portal-shadow);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-brand strong {
  font-size: 0.92rem;
}

.portal-brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(46, 167, 172, 0.24);
}

.portal-brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-brand-copy small {
  color: var(--portal-text-soft);
  font-size: 0.66rem;
}

.portal-brand-copy:has(strong:only-child) {
  display: flex;
  align-items: center;
}

.portal-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  justify-self: end;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: var(--portal-surface-strong);
  padding: 8px;
}

.portal-menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: var(--portal-text);
}

.portal-menu {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.portal-header-side {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.portal-nav,
.portal-tools,
.portal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.portal-actions {
  margin-left: auto;
}

.portal-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--portal-text-soft);
  white-space: nowrap;
  transition: 140ms ease;
}

.portal-nav {
  flex: 1 1 auto;
  margin-right: 0;
  min-width: 0;
}

.portal-nav-count {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--portal-primary-strong);
  background: var(--portal-primary-soft);
}

.portal-nav-count.is-alert {
  color: #fff;
  background: var(--portal-danger);
}

.portal-nav-link:hover,
.portal-nav-link.is-active {
  color: var(--portal-text);
  background: var(--portal-primary-soft);
}

.portal-tools {
  justify-content: flex-end;
}

.portal-chip-group {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  background: var(--portal-surface-strong);
}

.portal-chip-group form {
  margin: 0;
}

.portal-chip {
  border: 0;
  color: var(--portal-text-soft);
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.92rem;
  white-space: nowrap;
  background: transparent;
}

.portal-chip.is-active {
  color: var(--portal-text);
  background: var(--portal-primary-soft);
}

.portal-chip-icon {
  min-width: 38px;
  min-height: 32px;
  padding: 5px 9px;
}

.portal-theme-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.portal-theme-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-user {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--portal-border);
  color: var(--portal-text-soft);
  font-size: 0.92rem;
  white-space: nowrap;
  background: var(--portal-surface-strong);
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 11px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: 160ms ease;
}

.portal-button:hover {
  transform: translateY(-1px);
}

.portal-button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--portal-primary), color-mix(in srgb, var(--portal-download) 72%, var(--portal-primary) 28%));
  box-shadow: 0 16px 28px rgba(46, 167, 172, 0.22);
}

.portal-button-download {
  color: #fff;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-download));
  box-shadow: 0 16px 28px rgba(46, 167, 172, 0.24);
}

.portal-theme-dark .portal-button-primary,
.portal-theme-dark .portal-button-download {
  color: #f5fffd;
  background: linear-gradient(135deg, #2b8b90, #49aeb0);
  box-shadow: 0 12px 22px rgba(37, 121, 123, 0.24);
}

.portal-button-secondary,
.portal-button-ghost {
  border-color: var(--portal-border-strong);
  background: var(--portal-surface-strong);
}

.portal-button-secondary {
  color: var(--portal-text);
}

.portal-button-ghost {
  color: var(--portal-text-soft);
}

.portal-main {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.portal-highlight-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--portal-surface) 92%, #ffffff 8%) 0%, var(--portal-surface) 100%);
  border-color: color-mix(in srgb, var(--portal-primary) 18%, var(--portal-border));
}

.portal-highlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--portal-primary-soft) 85%, transparent 15%), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 55%);
}

.portal-highlight-card > * {
  position: relative;
  z-index: 1;
}

.portal-card,
.portal-hero,
.portal-auth-card,
.portal-table-card {
  min-width: 0;
  border: 1px solid var(--portal-border);
  border-radius: 30px;
  background: var(--portal-surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--portal-card-shadow);
}

.portal-card,
.portal-table-card,
.portal-auth-card {
  padding: 20px;
}

.portal-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.86fr);
  gap: 16px;
  padding: 24px;
}

.portal-hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -140px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--portal-primary-soft), transparent 66%);
}

.portal-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.62rem, 3.2vw, 3.05rem);
  line-height: 1.02;
}

.portal-hero p,
.portal-muted {
  color: var(--portal-text-soft);
}

.portal-hero-copy p {
  margin: 0;
  max-width: 720px;
}

.portal-eyebrow {
  margin: 0 0 10px;
  color: var(--portal-primary-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-hero-actions,
.portal-inline,
.plan-actions,
.portal-ticket-meta,
.portal-ticket-files {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-hero-actions {
  margin-top: 18px;
}

.portal-feature-list,
.portal-link-list,
.portal-faq-list,
.portal-form,
.portal-ticket-list,
.portal-ticket-thread {
  display: grid;
  gap: 14px;
}

.portal-feature,
.portal-link-card,
.portal-faq-item,
.portal-ticket-card,
.portal-ticket-message {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
}

.portal-ticket-card:hover {
  border-color: color-mix(in srgb, var(--portal-primary) 26%, transparent);
}

.portal-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.portal-ticket-text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.portal-link {
  color: var(--portal-primary-strong);
}

.portal-ticket-list-wide {
  min-height: 280px;
}

.portal-faq-item {
  overflow: hidden;
}

.portal-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.portal-faq-item summary::-webkit-details-marker {
  display: none;
}

.portal-faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--portal-primary-strong);
  background: var(--portal-primary-soft);
  font-size: 1.05rem;
}

.portal-faq-item[open] summary::after {
  content: "−";
}

.portal-faq-item h3 {
  margin: 0;
  font-size: 0.98rem;
}

.portal-faq-answer {
  margin-top: 12px;
  color: var(--portal-text-soft);
  white-space: pre-wrap;
}

.portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.portal-section-head h1,
.portal-section-head h2,
.portal-section-head h3 {
  margin: 0;
}

.portal-section-head > * {
  min-width: 0;
}

.plan-carousel {
  display: grid;
  gap: 10px;
}

.plan-carousel-track,
.plan-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.plan-carousel-track {
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  overflow: visible;
  padding-bottom: 0;
  scrollbar-width: none;
}

.plan-carousel-track::-webkit-scrollbar {
  display: none;
}

.plan-grid {
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  justify-content: stretch;
}

.plan-card {
  scroll-snap-align: start;
  display: grid;
  gap: 12px;
  min-height: 100%;
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
  transition: 150ms ease;
}

.plan-price-stack {
  display: grid;
  gap: 4px;
}

.plan-price-old {
  color: var(--portal-text-soft);
  text-decoration: line-through;
}

.plan-discount-line {
  color: var(--portal-accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.plan-card.is-selected {
  border-color: color-mix(in srgb, var(--portal-primary) 42%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-primary) 12%, transparent);
}

.plan-picker-card {
  cursor: pointer;
}

.plan-picker-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.plan-from-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: lowercase;
  background: var(--portal-primary-soft);
  color: var(--portal-primary-strong);
}

.plan-title-row h3 {
  margin: 0;
  font-size: 1.34rem;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-price strong {
  font-size: 1.72rem;
}

.plan-duration-list,
.duration-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-duration-pill,
.duration-switch span {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
}

.plan-duration-pill strong,
.duration-switch span strong {
  font-size: 0.9rem;
}

.plan-duration-pill small,
.duration-switch span small {
    color: var(--portal-text-soft);
}

.plan-duration-discount,
.duration-discount {
  color: var(--portal-accent);
  font-weight: 700;
}

.duration-current {
  display: inline-flex;
}

.duration-switch label {
  cursor: pointer;
}

.duration-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.duration-switch input:checked + span {
  border-color: color-mix(in srgb, var(--portal-download) 42%, transparent);
  background: var(--portal-download-soft);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--portal-primary-soft);
  color: var(--portal-primary-strong);
}

.portal-badge[data-status="active"],
.portal-badge[data-status="paid"],
.portal-badge[data-status="activated"],
.portal-badge[data-status="toppedUp"] {
  background: color-mix(in srgb, var(--portal-success) 18%, transparent);
  color: var(--portal-success);
}

.portal-badge[data-status="expired"],
.portal-badge[data-status="pending"],
.portal-badge[data-status="scheduled"],
.portal-badge[data-status="available"],
.portal-badge[data-status="waiting_for_user"] {
  background: color-mix(in srgb, var(--portal-warn) 18%, transparent);
  color: var(--portal-warn);
}

.portal-badge[data-status="blocked"],
.portal-badge[data-status="cancelled"],
.portal-badge[data-status="failed"],
.portal-badge[data-status="closed"] {
  background: color-mix(in srgb, var(--portal-danger) 18%, transparent);
  color: var(--portal-danger);
}

.portal-badge[data-status="new"],
.portal-badge[data-status="in_progress"] {
  background: var(--portal-download-soft);
  color: var(--portal-download-strong);
}

.plan-carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.carousel-arrow {
  width: 38px;
  height: 38px;
  border: 1px solid var(--portal-border-strong);
  border-radius: 50%;
  color: var(--portal-text);
  background: var(--portal-surface-strong);
}

.portal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.portal-grid-2 > * {
  min-width: 0;
}

.portal-auth-card {
  width: min(560px, 100%);
  margin: 0 auto;
  overflow: hidden;
}

.portal-auth-stage {
  position: relative;
  width: min(560px, 100%);
  padding: 26px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--portal-surface) 98%, #ffffff 2%) 0%, color-mix(in srgb, var(--portal-surface-strong) 95%, #edf9f8 5%) 100%);
  margin-top: 12px;
  border-color: color-mix(in srgb, var(--portal-primary) 18%, var(--portal-border));
  box-shadow:
    0 30px 72px rgba(24, 61, 67, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.portal-auth-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--portal-primary) 82%, #ffffff 18%), color-mix(in srgb, var(--portal-download) 84%, #ffffff 16%));
}

.portal-auth-stage::after {
  content: "";
  position: absolute;
  inset: auto -100px -118px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--portal-primary-soft) 80%, transparent 20%), transparent 70%);
}

.portal-auth-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.58rem, 2.8vw, 2.02rem);
}

.portal-auth-stage .portal-form {
  margin-top: 16px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--portal-primary) 12%, var(--portal-border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--portal-surface-strong) 97%, #ffffff 3%), color-mix(in srgb, var(--portal-surface-soft) 94%, #ffffff 6%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 12px 28px rgba(18, 54, 57, 0.06);
}

.portal-auth-stage .portal-form-row {
  gap: 7px;
}

.portal-auth-stage .portal-form input:not([type="checkbox"]) {
  min-height: 46px;
  background: color-mix(in srgb, var(--portal-surface-strong) 95%, #f7ffff 5%);
}

.portal-auth-stage .portal-inline {
  margin-top: 2px;
}

.portal-auth-stage .portal-button {
  min-width: 132px;
}

.portal-auth-stage .portal-link {
  font-weight: 700;
}

.portal-auth-help {
  margin-top: -2px;
}

.portal-checkbox-row {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.portal-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.portal-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 18px;
}

.portal-checkbox-text {
  color: var(--portal-text-soft);
  line-height: 1.45;
}

.portal-form-row {
  display: grid;
  gap: 8px;
}

.portal-form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-form label {
  font-weight: 700;
}

.portal-form input:not([type="checkbox"]),
.portal-form select,
.portal-form textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid var(--portal-border-strong);
  color: var(--portal-text);
  background: var(--portal-surface-strong);
}

.portal-form textarea {
  min-height: 100px;
  resize: vertical;
}

.portal-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  justify-content: flex-start;
}

.portal-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  min-height: 18px;
  padding: 0;
  appearance: none;
  border: 1px solid var(--portal-border-strong);
  border-radius: 6px;
  background: var(--portal-surface-strong);
  display: inline-grid;
  place-content: center;
  position: relative;
  flex: 0 0 18px;
}

.portal-check input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-download));
  transform: scale(0);
  transition: transform 140ms ease;
}

.portal-check input[type="checkbox"]:checked::after {
  transform: scale(1);
}

.portal-check span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-inline-hint {
  color: var(--portal-text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.portal-support-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-certificate-stage {
  min-height: 100%;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--portal-surface) 95%, #ffffff 5%) 0%, color-mix(in srgb, var(--portal-surface-strong) 92%, #eafaf8 8%) 100%);
  border-color: color-mix(in srgb, var(--portal-primary) 18%, var(--portal-border));
}

.portal-certificate-stage .portal-hint,
.portal-certificate-stage .portal-note,
.portal-certificate-stage form {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--portal-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--portal-surface-strong) 96%, #ffffff 4%), color-mix(in srgb, var(--portal-surface-soft) 90%, #ffffff 10%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.portal-certificate-stage .portal-note {
  margin-bottom: 0;
}

.portal-certificate-stage form {
  margin-top: 12px;
}

.portal-support-ticket-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-file-picker {
  display: grid;
  gap: 10px;
}

.portal-file-list {
  display: grid;
  gap: 6px;
}

.portal-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
}

.portal-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-file-remove {
  flex: 0 0 auto;
  min-width: auto;
  padding: 6px 10px;
}

.portal-file-empty {
  color: var(--portal-text-soft);
  font-size: 0.86rem;
}

.field-validation-error,
.validation-summary-errors {
  color: var(--portal-danger);
}

.portal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-summary-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-summary-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.portal-summary-compact .portal-metric {
  padding: 13px;
}

.portal-metric {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
}

.portal-metric-label {
  color: var(--portal-text-soft);
  font-size: 0.8rem;
}

.portal-metric-value {
  margin-top: 4px;
  font-size: 0.98rem;
  font-weight: 800;
}

.portal-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--portal-border);
  text-align: left;
  vertical-align: top;
}

.portal-table th {
  color: var(--portal-text-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-hint,
.portal-warning,
.portal-note {
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
}

.portal-note {
  margin-top: 16px;
  border-color: color-mix(in srgb, var(--portal-primary) 22%, transparent);
  background: color-mix(in srgb, var(--portal-primary) 8%, var(--portal-surface-strong));
}

.portal-action-note {
  margin: 10px 0 0;
}

.portal-legal-copy {
  white-space: pre-line;
  line-height: 1.6;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
}

.portal-warning {
  border-color: color-mix(in srgb, var(--portal-warn) 34%, transparent);
  background: color-mix(in srgb, var(--portal-warn) 10%, var(--portal-surface-strong));
}

.portal-upgrade-panel[hidden] {
  display: none !important;
}

.portal-secret {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-secret code {
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--portal-surface-soft);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-icon-button {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  background: var(--portal-surface-soft);
  color: var(--portal-text-soft);
  font-size: 0;
}

.portal-icon-button.is-active,
.portal-icon-button.is-success {
  color: var(--portal-text);
  border-color: var(--portal-border-strong);
}

.portal-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-footer {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 4px 0;
  color: var(--portal-text-soft);
}

.alert {
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
}

.alert-success {
  border-color: color-mix(in srgb, var(--portal-success) 34%, transparent);
}

.alert-warning {
  border-color: color-mix(in srgb, var(--portal-warn) 34%, transparent);
}

.alert-danger {
  border-color: color-mix(in srgb, var(--portal-danger) 34%, transparent);
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.portal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.portal-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 24px));
  margin: 8vh auto 0;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-strong);
  box-shadow: var(--portal-shadow);
}

.portal-modal-card h3 {
  margin: 0 32px 12px 0;
}

.portal-modal-body {
  display: grid;
  gap: 10px;
}

.portal-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.portal-modal-actions .portal-button {
  min-width: 122px;
}

.portal-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--portal-border);
  border-radius: 50%;
  background: var(--portal-surface-soft);
  color: var(--portal-text);
}

.portal-modal-info {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-footer {
  width: min(1240px, calc(100% - 24px));
  margin: 18px auto 0;
  padding: 20px 22px;
  border: 1px solid var(--portal-border);
  border-radius: 26px;
  background: var(--portal-surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--portal-card-shadow);
}

.portal-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.portal-footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.portal-footer-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}

.portal-footer-brand strong,
.portal-footer-column h3 {
  display: block;
  margin: 0 0 8px;
}

.portal-footer-brand p,
.portal-footer-column p {
  margin: 0;
  color: var(--portal-text-soft);
}

.portal-footer-column {
  display: grid;
  gap: 6px;
  align-content: start;
}

.portal-footer-column a {
  color: var(--portal-text-soft);
}

.portal-footer-column a:hover {
  color: var(--portal-text);
}

.portal-footer-bottom {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--portal-border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--portal-text-soft);
  font-size: 0.86rem;
}

@media (max-width: 1180px) {
  .portal-menu {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .portal-header-side {
    margin-left: 0;
    justify-self: start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .portal-nav,
  .portal-tools,
  .portal-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .portal-shell {
    width: 100%;
  }

  .portal-grid-2,
  .portal-hero,
  .portal-form-row-2,
  .portal-summary,
  .portal-summary-4,
  .portal-summary-5,
  .portal-support-links,
  .portal-footer-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .plan-carousel-track {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .portal-header {
    grid-template-columns: auto auto;
  }

  .portal-menu-toggle {
    display: inline-block;
  }

  .portal-menu {
    display: none;
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .portal-shell.is-nav-open .portal-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .portal-nav,
  .portal-tools,
  .portal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-header-side {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-menu {
    width: 100%;
  }

  .portal-chip-group {
    width: 100%;
    justify-content: center;
    max-width: 100%;
  }

  .portal-actions form,
  .portal-actions a,
  .portal-actions span,
  .portal-actions button {
    width: 100%;
  }

  .portal-user {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .portal-card,
  .portal-table-card,
  .portal-auth-card,
  .portal-hero {
    padding: 18px;
    border-radius: 22px;
  }

  .portal-header {
    padding: 10px 12px;
    border-radius: 0 0 22px 22px;
  }

  .plan-carousel-track {
    grid-auto-flow: column;
    grid-auto-columns: minmax(258px, 86vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .portal-hero h1 {
    font-size: 1.56rem;
  }

  .portal-button,
  .portal-chip,
  .portal-nav-link {
    width: 100%;
    justify-content: center;
  }

  .portal-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-carousel-controls {
    justify-content: center;
  }

  .portal-modal-card {
    margin-top: 4vh;
    padding: 16px;
  }

  .portal-footer {
    padding: 18px;
    border-radius: 24px;
  }

  .portal-footer-brand {
    align-items: center;
  }

  .portal-ticket-head,
  .portal-ticket-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.turnstile-shell {
  display: flex;
  align-items: center;
  min-height: 70px;
}
