* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --pfd-bg: #101126;
  --pfd-surface: #18192f;
  --pfd-surface-2: #202139;
  --pfd-paper: #f4ead8;
  --pfd-muted: rgba(244, 234, 216, .68);
  --pfd-faint: rgba(244, 234, 216, .44);
  --pfd-line: rgba(244, 234, 216, .12);
  --pfd-gold: #e7ad65;
  --pfd-coral: #ff7d64;
  --pfd-mint: #44d7a8;
  --pfd-blue: #8ec5ff;
  --pfd-red: #ff6868;
  --pfd-shadow: 0 18px 50px rgba(0, 0, 0, .32);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --pfd-bg: #f6f2e9;
  --pfd-surface: #fffaf0;
  --pfd-surface-2: #f0e7d7;
  --pfd-paper: #201b16;
  --pfd-muted: rgba(32, 27, 22, .68);
  --pfd-faint: rgba(32, 27, 22, .46);
  --pfd-line: rgba(32, 27, 22, .14);
  --pfd-shadow: 0 16px 34px rgba(54, 44, 31, .13);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--pfd-bg);
  color: var(--pfd-paper);
  font-family: inherit;
  font-size: 15px;
}

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

button,
input {
  font: inherit;
}

.pfd-shell {
  min-height: 100vh;
}

.pfd-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--pfd-line);
  background: color-mix(in srgb, var(--pfd-bg) 90%, transparent);
  backdrop-filter: blur(14px);
}

.pfd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  font-weight: 800;
  font-size: 21px;
}

.pfd-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.pfd-brand span span {
  color: var(--pfd-gold);
}

.pfd-topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.pfd-topnav a,
.pfd-button,
.pfd-icon-button {
  min-height: 40px;
  border-radius: 8px;
}

.pfd-topnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--pfd-muted);
  border: 1px solid transparent;
  white-space: nowrap;
}

.pfd-topnav a:hover,
.pfd-topnav a.is-current {
  color: var(--pfd-paper);
  border-color: var(--pfd-line);
  background: rgba(255, 255, 255, .05);
}

html[data-theme="light"] .pfd-topnav a:hover,
html[data-theme="light"] .pfd-topnav a.is-current {
  background: rgba(32, 27, 22, .05);
}

.pfd-topnav svg,
.pfd-button svg,
.pfd-icon-button svg,
.pfd-tab svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.pfd-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pfd-header-user {
  max-width: 240px;
  overflow: hidden;
  color: var(--pfd-muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pfd-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  border: 1px solid var(--pfd-line);
  color: var(--pfd-paper);
  background: var(--pfd-surface);
  cursor: pointer;
}

.pfd-moon,
html[data-theme="light"] .pfd-sun {
  display: none;
}

html[data-theme="light"] .pfd-moon {
  display: block;
}

.pfd-main {
  width: min(100% - 36px, 1180px);
  margin: 0 auto;
  padding: 28px 0 44px;
}

.pfd-hero,
.pfd-auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-surface);
  box-shadow: var(--pfd-shadow);
}

.pfd-auth-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 430px);
  align-items: stretch;
  margin-top: 18px;
}

.pfd-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.pfd-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--pfd-gold), var(--pfd-coral));
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(231, 173, 101, .24);
}

.pfd-eyebrow {
  margin: 0 0 7px;
  color: var(--pfd-gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pfd-hero h1,
.pfd-auth-copy h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.pfd-hero p,
.pfd-auth-copy p {
  margin: 8px 0 0;
  color: var(--pfd-muted);
  line-height: 1.6;
}

.pfd-hero-actions,
.pfd-auth-perks {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pfd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--pfd-line);
  color: var(--pfd-paper);
  background: var(--pfd-surface-2);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.pfd-button:hover,
.pfd-icon-button:hover {
  border-color: rgba(231, 173, 101, .48);
}

.pfd-button.is-primary {
  color: #21170f;
  border-color: transparent;
  background: var(--pfd-gold);
}

.pfd-button.is-danger {
  color: var(--pfd-red);
  border-color: rgba(255, 104, 104, .28);
  background: rgba(255, 104, 104, .08);
}

.pfd-button.is-compact {
  min-height: 34px;
  padding: 0 12px;
}

.pfd-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(231, 173, 101, .34);
  border-radius: 8px;
  background: rgba(231, 173, 101, .08);
}

.pfd-alert > svg {
  width: 24px;
  height: 24px;
  color: var(--pfd-gold);
}

.pfd-alert strong {
  display: block;
  margin-bottom: 4px;
}

.pfd-alert p,
.pfd-alert span {
  margin: 0;
  color: var(--pfd-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pfd-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.pfd-metric {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-surface);
}

.pfd-metric svg {
  width: 22px;
  height: 22px;
  color: var(--pfd-gold);
}

.pfd-metric strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
  line-height: 1.1;
}

.pfd-metric span {
  display: block;
  margin-top: 6px;
  color: var(--pfd-muted);
  font-size: 13px;
}

.pfd-metric.is-ok svg,
.pfd-benefit.is-active svg,
.pfd-table .is-plus {
  color: var(--pfd-mint);
}

.pfd-metric.is-warning svg {
  color: var(--pfd-coral);
}

.pfd-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pfd-sidebar {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-surface);
}

.pfd-support-widget {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid rgba(231, 173, 101, .28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(231, 173, 101, .1), rgba(255, 255, 255, .03));
}

html[data-theme="light"] .pfd-support-widget {
  border-color: rgba(231, 173, 101, .22);
  background: linear-gradient(180deg, rgba(231, 173, 101, .12), rgba(32, 27, 22, .03));
}

.pfd-support-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.pfd-support-head svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--pfd-gold);
  flex: 0 0 auto;
}

.pfd-support-head strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.pfd-support-head p {
  margin: 4px 0 0;
  color: var(--pfd-muted);
  font-size: 12px;
  line-height: 1.45;
}

.pfd-support-button {
  width: 100%;
}

.pfd-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--pfd-muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.pfd-tab:hover,
.pfd-tab.is-active {
  color: var(--pfd-paper);
  border-color: var(--pfd-line);
  background: var(--pfd-surface-2);
}

.pfd-content {
  min-width: 0;
}

.pfd-panel {
  padding: 22px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-surface);
  box-shadow: var(--pfd-shadow);
}

.pfd-section-heading {
  margin-bottom: 18px;
}

.pfd-section-heading.is-secondary {
  margin-top: 26px;
}

.pfd-section-heading h2,
.pfd-empty h2 {
  margin: 0;
  font-size: 22px;
}

.pfd-section-heading p {
  margin: 8px 0 0;
  color: var(--pfd-muted);
  line-height: 1.6;
}

.pfd-quota {
  padding: 16px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-surface-2);
}

.pfd-plan-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(68, 215, 168, .28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(68, 215, 168, .09), rgba(231, 173, 101, .055));
}

.pfd-plan-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pfd-plan-summary-head svg {
  width: 24px;
  height: 24px;
  color: var(--pfd-mint);
}

.pfd-plan-summary-head span,
.pfd-plan-details dt {
  color: var(--pfd-muted);
  font-size: 12px;
  font-weight: 800;
}

.pfd-plan-summary-head strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.pfd-plan-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.pfd-plan-details div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(244, 234, 216, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

html[data-theme="light"] .pfd-plan-details div {
  background: rgba(32, 27, 22, .035);
  border-color: rgba(32, 27, 22, .09);
}

.pfd-plan-details dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--pfd-paper);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.pfd-quota-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--pfd-muted);
}

.pfd-quota-head strong {
  color: var(--pfd-paper);
}

.pfd-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

html[data-theme="light"] .pfd-progress {
  background: rgba(32, 27, 22, .1);
}

.pfd-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pfd-mint), var(--pfd-gold), var(--pfd-coral));
}

.pfd-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.pfd-benefit {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

html[data-theme="light"] .pfd-benefit {
  background: rgba(32, 27, 22, .035);
}

.pfd-benefit svg {
  width: 20px;
  height: 20px;
  color: var(--pfd-faint);
}

.pfd-benefit strong,
.pfd-benefit span {
  display: block;
}

.pfd-benefit strong {
  margin-bottom: 4px;
}

.pfd-benefit span {
  color: var(--pfd-muted);
  font-size: 13px;
  line-height: 1.45;
}

.pfd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
}

.pfd-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.pfd-table th,
.pfd-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--pfd-line);
  text-align: left;
}

.pfd-table th {
  color: var(--pfd-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pfd-table tr:last-child td {
  border-bottom: 0;
}

.pfd-table .is-minus {
  color: var(--pfd-red);
}

.pfd-form {
  width: min(100%, 460px);
}

.pola-form-group {
  margin-bottom: 16px;
}

.pola-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--pfd-muted);
  font-size: 13px;
  font-weight: 800;
}

.pola-form-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-paper);
  background: var(--pfd-surface-2);
  outline: none;
}

.pola-form-control:focus {
  border-color: rgba(231, 173, 101, .7);
}

.pola-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.pola-btn-primary {
  color: #21170f;
  background: var(--pfd-gold);
}

.pola-btn:disabled,
.pfd-button:disabled {
  cursor: wait;
  opacity: .65;
}

.pfd-form-message,
.pola-auth-message {
  min-height: 21px;
  margin-top: 12px;
  color: var(--pfd-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pfd-form-message.success,
.pola-auth-message.success {
  color: var(--pfd-mint);
}

.pfd-form-message.error,
.pola-auth-message.error {
  color: var(--pfd-red);
}

.pfd-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  color: var(--pfd-muted);
  text-align: center;
}

.pfd-empty.is-compact {
  min-height: 140px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
}

.pfd-empty svg {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  color: var(--pfd-gold);
}

.pfd-empty p {
  max-width: 540px;
  margin: 8px 0 0;
  line-height: 1.6;
}

.pfd-auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
}

.pfd-auth-perks {
  justify-content: flex-start;
  margin-top: 22px;
}

.pfd-auth-perks span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-muted);
  background: var(--pfd-surface-2);
  font-size: 13px;
  font-weight: 800;
}

.pfd-auth-perks svg {
  width: 17px;
  height: 17px;
  color: var(--pfd-gold);
}

.pfd-auth-panel {
  overflow: hidden;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: var(--pfd-bg);
}

.pola-auth-header {
  padding: 24px 22px 18px;
  text-align: center;
}

.pola-auth-header h2 {
  margin: 0;
  font-size: 24px;
}

.pola-auth-header p {
  margin: 8px 0 0;
  color: var(--pfd-muted);
}

.pola-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 18px 14px;
}

.pola-auth-tab {
  min-height: 42px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-muted);
  background: var(--pfd-surface);
  font-weight: 800;
  cursor: pointer;
}

.pola-auth-tab.active {
  color: #21170f;
  background: var(--pfd-gold);
}

.pola-auth-register-tab span {
  display: inline-block;
  margin-left: 5px;
  color: inherit;
  font-size: 11px;
}

.pola-auth-body {
  padding: 18px;
  border-top: 1px solid var(--pfd-line);
}

.pola-auth-form {
  display: none;
}

.pola-auth-form.active {
  display: block;
}

.pfd-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pfd-label-row label {
  margin-bottom: 0;
}

.pfd-link-button {
  border: 0;
  padding: 0;
  color: var(--pfd-gold);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.pfd-link-button.is-centered {
  display: block;
  margin: 14px auto 0;
}

.pfd-checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--pfd-muted);
  font-size: 13px;
  font-weight: 700;
}

.pfd-checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--pfd-gold);
}

.cf-turnstile {
  min-height: 70px;
  margin-bottom: 14px;
}

@media (max-width: 940px) {
  .pfd-topbar {
    gap: 10px;
    min-height: 62px;
    padding: 10px 14px;
  }

  .pfd-brand {
    min-width: 0;
    font-size: 18px;
  }

  .pfd-brand img {
    width: 30px;
    height: 30px;
  }

  .pfd-topnav {
    justify-content: flex-end;
  }

  .pfd-topnav a span,
  .pfd-header-user {
    display: none;
  }

  .pfd-topnav a {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .pfd-main {
    width: min(100% - 24px, 1180px);
    padding: 18px 0 30px;
  }

  .pfd-hero,
  .pfd-auth-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .pfd-auth-copy {
    min-height: auto;
  }

  .pfd-hero h1,
  .pfd-auth-copy h1 {
    font-size: 27px;
  }

  .pfd-identity {
    align-items: flex-start;
  }

  .pfd-avatar {
    width: 58px;
    height: 58px;
    font-size: 24px;
  }

  .pfd-hero-actions {
    justify-content: flex-start;
  }

  .pfd-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pfd-layout {
    grid-template-columns: 1fr;
  }

  .pfd-sidebar {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .pfd-tab {
    justify-content: center;
    min-width: 92px;
    padding: 0 8px;
  }

  .pfd-tab span {
    display: none;
  }

  .pfd-benefits {
    grid-template-columns: 1fr;
  }

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

  .pfd-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pfd-alert .pfd-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .pfd-brand > span {
    display: none;
  }

  .pfd-metrics {
    grid-template-columns: 1fr;
  }

  .pfd-panel {
    padding: 16px;
  }

  .pfd-metric {
    min-height: 108px;
  }

  .pfd-metric strong {
    font-size: 22px;
  }

  .pfd-button {
    flex: 1 1 140px;
  }

  .pola-auth-tabs {
    grid-template-columns: 1fr;
  }
}

/* Dashboard header aligned with PolaFilm app topbar */
.pfd-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 72px;
  padding: 0 30px;
  color: var(--pfd-paper);
  background: rgba(16, 17, 38, .42);
  border-bottom: 1px solid rgba(217, 208, 189, .12);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .pfd-topbar {
  background: rgba(246, 242, 233, .78);
  border-bottom-color: rgba(32, 27, 22, .12);
}

.pfd-theme-toggle {
  grid-column: 1;
  justify-self: start;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(217, 208, 189, .2);
  border-radius: 999px;
  color: var(--pfd-paper);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.pfd-theme-toggle:hover,
.pfd-more-btn:hover,
.pfd-wallet:hover {
  border-color: rgba(231, 173, 101, .52);
}

.pfd-theme-toggle svg,
.pfd-more-btn svg,
.pfd-wallet svg {
  width: 18px;
  height: 18px;
}

.pfd-brand {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: var(--pfd-paper);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.pfd-brand-mark {
  display: none;
}

.pfd-brand .pfd-brand-logo {
  width: auto;
  height: 38px;
  object-fit: contain;
  display: inline-block;
}

.pfd-brand-title {
  font-size: 34px;
  font-style: italic;
}

.pfd-brand-by {
  transform: translateY(3px) rotate(-1.5deg);
  color: rgba(217, 208, 189, .88);
  font-family: "Caveat", "Brush Script MT", cursive;
  font-size: 21px;
  font-weight: 700;
  line-height: .9;
}

html[data-theme="light"] .pfd-brand-by {
  color: rgba(32, 27, 22, .74);
}

.pfd-top-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.pfd-user-account-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pfd-user-greeting {
  display: block;
  max-width: 170px;
  overflow: hidden;
  color: rgba(217, 208, 189, .72);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

html[data-theme="light"] .pfd-user-greeting {
  color: rgba(32, 27, 22, .68);
}

.pfd-user-greeting:hover {
  color: var(--pfd-paper);
}

.pfd-membership-badge {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 6px;
  max-width: 170px;
  padding: 5px 10px 5px 8px;
  min-height: 24px;
  overflow: hidden;
  color: #f8dce8;
  background: rgba(240, 44, 120, .18);
  border: 1px solid rgba(240, 44, 120, .42);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12), 0 0 0 0 rgba(240, 44, 120, 0);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  animation: pfd-membership-pulse 2.35s ease-in-out infinite;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.pfd-membership-badge::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
  opacity: .9;
}

.pfd-membership-badge[data-plan="free"] {
  color: var(--pfd-paper);
  background: rgba(217, 208, 189, .12);
  border-color: rgba(217, 208, 189, .28);
}

@keyframes pfd-membership-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, .12), 0 0 0 0 rgba(240, 44, 120, 0); }
  50% { box-shadow: 0 4px 14px rgba(240, 44, 120, .22), 0 0 0 5px rgba(240, 44, 120, .13); }
}

@media (prefers-reduced-motion: reduce) {
  .pfd-membership-badge {
    animation: none;
  }
}

.pfd-wallet,
.pfd-recharge,
.pfd-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 8px;
  white-space: nowrap;
}

.pfd-wallet {
  gap: 9px;
  padding: 0 12px;
  color: var(--pfd-paper);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(217, 208, 189, .18);
  font-size: 12px;
  font-weight: 700;
}

.pfd-recharge {
  padding: 0 12px;
  color: #2d2e5e;
  background: var(--pfd-paper);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.pfd-top-more-menu {
  position: relative;
}

.pfd-more-btn {
  width: 32px;
  color: var(--pfd-paper);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(217, 208, 189, .18);
  cursor: pointer;
}

.pfd-more-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: none;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(217, 208, 189, .16);
  border-radius: 8px;
  background: rgba(20, 21, 44, .96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}

html[data-theme="light"] .pfd-more-dropdown {
  background: rgba(255, 250, 240, .98);
  border-color: rgba(32, 27, 22, .12);
}

.pfd-more-dropdown.is-open {
  display: grid;
  gap: 4px;
}

.pfd-more-dropdown a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--pfd-muted);
  font-size: 13px;
  font-weight: 750;
}

.pfd-more-dropdown a:hover {
  color: var(--pfd-paper);
  background: rgba(255, 255, 255, .08);
}

html[data-theme="light"] .pfd-more-dropdown a:hover {
  background: rgba(32, 27, 22, .06);
}

@media (max-width: 940px) {
  .pfd-topbar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 60px;
    padding: 0 12px;
  }

  html:not([data-theme="light"]) .pfd-topbar {
    background: #101126;
    backdrop-filter: none;
  }

  html[data-theme="light"] .pfd-topbar {
    background: var(--pfd-surface);
    backdrop-filter: none;
  }

  .pfd-brand .pfd-brand-logo {
    height: 30px;
  }

  .pfd-brand-title {
    font-size: 28px;
  }

  .pfd-brand-by,
  .pfd-user-account-summary,
  .pfd-wallet {
    display: none;
  }

  .pfd-recharge {
    min-height: 34px;
    padding: 0 10px;
  }
}

@media (max-width: 560px) {
  .pfd-brand-title {
    display: inline;
    font-size: 24px;
  }

  .pfd-brand .pfd-brand-logo {
    height: 28px;
  }

  .pfd-more-btn {
    width: 34px;
  }
}


.pfd-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 12, .66);
  backdrop-filter: blur(10px);
}

.pfd-modal.is-open {
  display: flex;
}

body.pfd-modal-lock {
  overflow: hidden;
}

.pfd-modal-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(217, 208, 189, .2);
  border-radius: 10px;
  color: var(--pfd-paper);
  background: #151632;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .36);
}

html[data-theme="light"] .pfd-modal-dialog {
  color: var(--pfd-paper);
  background: var(--pfd-surface);
  border-color: rgba(32, 27, 22, .14);
  box-shadow: 0 18px 44px rgba(54, 44, 31, .18);
}

.pfd-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-muted);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.pfd-modal-close:hover {
  color: var(--pfd-paper);
  border-color: rgba(231, 173, 101, .52);
}

.pfd-modal-close svg {
  width: 17px;
  height: 17px;
}

.pfd-modal-head {
  padding-right: 34px;
}

.pfd-modal-head h2 {
  margin: 2px 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.pfd-modal-head p:last-child {
  margin: 0 0 18px;
  color: var(--pfd-muted);
  line-height: 1.55;
}

.pfd-recharge-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--pfd-muted);
  font-size: 13px;
  font-weight: 800;
}

.pfd-recharge-total {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-gold);
  background: rgba(255, 255, 255, .05);
  font-size: 24px;
  font-weight: 850;
}

.pfd-recharge-note {
  min-height: 22px;
  margin-top: 14px;
  color: var(--pfd-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pfd-recharge-note.error {
  color: var(--pfd-red);
}

.pfd-recharge-note.success {
  color: var(--pfd-mint);
}

.pfd-payment[hidden] {
  display: none;
}

.pfd-payment {
  display: grid;
  gap: 14px;
}

.pfd-qr-frame {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: #fff;
}

.pfd-qr-frame img {
  width: min(260px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
}

.pfd-payment-info {
  display: grid;
  gap: 8px;
}

.pfd-payment-info div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.pfd-payment-info span {
  flex: 0 0 auto;
  color: var(--pfd-muted);
  font-size: 12px;
  font-weight: 800;
}

.pfd-payment-info strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 13px;
}

.pfd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.pfd-modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--pfd-line);
  border-radius: 8px;
  color: var(--pfd-paper);
  background: rgba(255, 255, 255, .06);
  font-weight: 800;
  cursor: pointer;
}

.pfd-modal-button.is-primary {
  color: #21170f;
  background: var(--pfd-gold);
  border-color: transparent;
}

.pfd-modal-button:disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 560px) {
  .pfd-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .pfd-modal-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .pfd-modal-actions {
    flex-direction: column;
  }

  .pfd-modal-button {
    width: 100%;
  }
}


/* Light mode header contrast tune */
html[data-theme="light"] .pfd-topbar {
  background: rgba(250, 246, 237, .94);
  border-bottom-color: rgba(16, 17, 38, .16);
  box-shadow: 0 1px 0 rgba(16, 17, 38, .05);
}

html[data-theme="light"] .pfd-theme-toggle,
html[data-theme="light"] .pfd-wallet,
html[data-theme="light"] .pfd-more-btn {
  color: #101126;
  background: rgba(16, 17, 38, .055);
  border-color: rgba(16, 17, 38, .16);
}

html[data-theme="light"] .pfd-theme-toggle:hover,
html[data-theme="light"] .pfd-wallet:hover,
html[data-theme="light"] .pfd-more-btn:hover {
  background: rgba(16, 17, 38, .09);
  border-color: rgba(16, 17, 38, .28);
}

html[data-theme="light"] .pfd-user-greeting {
  color: rgba(16, 17, 38, .78);
}

html[data-theme="light"] .pfd-user-greeting:hover,
html[data-theme="light"] .pfd-more-dropdown a:hover {
  color: #101126;
}

html[data-theme="light"] .pfd-membership-badge {
  color: #b0145d;
  background: rgba(240, 44, 120, .14);
  border-color: rgba(240, 44, 120, .38);
}

html[data-theme="light"] .pfd-membership-badge[data-plan="free"] {
  color: #101126;
  background: rgba(16, 17, 38, .06);
  border-color: rgba(16, 17, 38, .16);
}

html[data-theme="light"] .pfd-recharge {
  color: #ffffff;
  background: #101126;
  border-color: #101126;
}

html[data-theme="light"] .pfd-recharge:hover {
  background: #24243f;
  border-color: #24243f;
}

html[data-theme="light"] .pfd-more-dropdown {
  background: rgba(255, 250, 240, .98);
  border-color: rgba(16, 17, 38, .16);
  box-shadow: 0 18px 38px rgba(54, 44, 31, .16);
}


/* Minimal membership feature tiles */
.pfd-benefits {
  gap: 10px;
}

.pfd-benefit {
  align-items: center;
  min-height: 58px;
  padding: 0 14px;
  color: var(--pfd-faint);
  background: rgba(255, 255, 255, .025);
  border-color: rgba(244, 234, 216, .09);
  opacity: .58;
  transition: background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease, transform .18s ease;
}

.pfd-benefit strong {
  margin: 0;
  color: currentColor;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
}

.pfd-benefit span {
  display: none;
}

.pfd-benefit svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: currentColor;
}

.pfd-benefit.is-active {
  color: var(--pfd-paper);
  background: linear-gradient(135deg, rgba(68, 215, 168, .13), rgba(231, 173, 101, .08));
  border-color: rgba(68, 215, 168, .34);
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.pfd-benefit.is-active svg {
  color: var(--pfd-mint);
  filter: drop-shadow(0 0 10px rgba(68, 215, 168, .18));
}

.pfd-benefit.is-muted {
  color: rgba(244, 234, 216, .36);
  background: rgba(255, 255, 255, .018);
  border-color: rgba(244, 234, 216, .07);
}

html[data-theme="light"] .pfd-benefit {
  color: rgba(16, 17, 38, .38);
  background: rgba(16, 17, 38, .025);
  border-color: rgba(16, 17, 38, .10);
}

html[data-theme="light"] .pfd-benefit.is-active {
  color: #101126;
  background: linear-gradient(135deg, rgba(68, 215, 168, .13), rgba(231, 173, 101, .14));
  border-color: rgba(29, 170, 124, .34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .48);
}

html[data-theme="light"] .pfd-benefit.is-active svg {
  color: #14a77a;
}

html[data-theme="light"] .pfd-benefit.is-muted {
  color: rgba(16, 17, 38, .34);
  background: rgba(16, 17, 38, .018);
  border-color: rgba(16, 17, 38, .08);
}
