:root {

  --spectra-surface: var(--spectra-color-surface-700, rgba(255, 255, 255, 0.92));
  --spectra-border: rgba(235, 194, 194, 0.65);
  --spectra-glow: 0 12px 32px rgba(159, 203, 183, 0.25);
  --spectra-accent: var(--spectra-color-brand-500, #ebc2c2);
  --spectra-accent-dark: var(--spectra-color-brand-600, #9fcbb7);
  --spectra-text: var(--spectra-color-text-primary, #2f2a32);
  --spectra-muted: var(--spectra-color-text-muted, rgba(47, 42, 50, 0.72));
  --spectra-header-height: 112px;
  --spectra-main-padding-top: calc(var(--spectra-header-height, 112px) + clamp(24px, 4vw, 56px));
  --spectra-main-padding-x: clamp(16px, 4vw, 48px);
  --spectra-main-padding-bottom: clamp(48px, 6vw, 96px);
}

* {
  box-sizing: border-box;
}

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

html {
  min-height: 100%;
}

body.spectra-layout {
  margin: 0;
  min-height: 100vh;
  font-family: var(--spectra-font-body, 'Poppins', 'Outfit', 'Segoe UI', sans-serif);
  background: var(--spectra-color-surface-1000, #fffcf9);
  color: var(--spectra-color-text-primary, #2f2a32);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

/* SweetAlert2 theming */
.swal2-popup {
  background: rgba(255, 252, 249, 0.95) !important;
  border: 1px solid rgba(235, 194, 194, 0.5) !important;
  box-shadow:
    0 18px 44px rgba(159, 203, 183, 0.25),
    0 10px 28px rgba(47, 42, 50, 0.12) !important;
  color: var(--spectra-text) !important;
  backdrop-filter: blur(6px);
}

.swal2-title {
  color: var(--spectra-text) !important;
  letter-spacing: 0.01em;
}

.swal2-html-container {
  color: var(--spectra-muted) !important;
}

.swal2-styled.swal2-confirm {
  background: var(--spectra-accent) !important;
  color: #2f2a32 !important;
  box-shadow: 0 10px 22px rgba(235, 194, 194, 0.3);
}

.swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-confirm:focus {
  background: var(--spectra-accent-dark) !important;
}

.swal2-styled.swal2-cancel {
  background: #fffcf9 !important;
  color: var(--spectra-text) !important;
  border: 1px solid rgba(235, 194, 194, 0.8) !important;
}

.swal2-styled.swal2-cancel:hover,
.swal2-styled.swal2-cancel:focus {
  background: #ebc2c2 !important;
}

.swal2-icon {
  box-shadow: 0 0 0 1px rgba(235, 194, 194, 0.35);
}

.swal2-timer-progress-bar {
  background: var(--spectra-accent) !important;
}

.spectra-main {
  width: 100%;
  flex: 1 0 auto;
  padding: var(--spectra-main-padding-top) var(--spectra-main-padding-x)
    var(--spectra-main-padding-bottom);
  transition: padding 0.3s ease;
}

.spectra-layout > .spectra-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(235, 194, 194, 0.5);
  box-shadow: var(--spectra-shadow-soft, 0 8px 26px rgba(62, 99, 97, 0.14));
  z-index: 1200;
  position: fixed;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.35s ease, opacity 0.35s ease;
  will-change: transform, opacity;
}

.spectra-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.header-toggle {
  position: fixed;
  top: calc(var(--spectra-header-height, 112px) - 18px);
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(159, 203, 183, 0.8);
  background: #9fcbb7;
  backdrop-filter: blur(14px);
  color: var(--spectra-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(30, 46, 50, 0.42);
  z-index: 1300;
  transition: top 0.3s ease, transform 0.3s ease, background 0.3s ease,
    border-color 0.3s ease, opacity 0.3s ease;
  padding: 0;
  touch-action: manipulation;
}

.header-toggle:hover,
.header-toggle:focus-visible {
  background: #ebc2c2;
  border-color: rgba(159, 203, 183, 0.9);
  outline: none;
}

.header-toggle-icon {
  width: 12px;
  height: 12px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 2px;
  transform: rotate(-135deg);
  transition: transform 0.3s ease;
}

.header-toggle[aria-expanded="false"] .header-toggle-icon {
  transform: rotate(45deg);
}

/* -------------------------------------------------------------------------- */
/* SweetAlert2 Theming                                                         */
/* -------------------------------------------------------------------------- */

.swal2-popup {
  background: #fffcf9 !important;
  border: 1px solid rgba(235, 194, 194, 0.45);
  box-shadow: 0 18px 44px rgba(159, 203, 183, 0.18);
  color: #2f2a32 !important;
  border-radius: 20px !important;
  padding: clamp(24px, 4vw, 32px) !important;
}

.swal2-title {
  color: #2f2a32 !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.swal2-html-container {
  color: rgba(47, 42, 50, 0.78) !important;
  font-size: 1.05rem;
}

.swal2-styled.swal2-confirm {
  background: var(--spectra-accent) !important;
  color: #2f2a32 !important;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(235, 194, 194, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-confirm:focus {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(159, 203, 183, 0.28);
}

.swal2-styled.swal2-cancel {
  background: #fffcf9 !important;
  color: #2f2a32 !important;
  border: 1px solid rgba(235, 194, 194, 0.8) !important;
  font-weight: 500;
}

.swal2-styled.swal2-cancel:hover,
.swal2-styled.swal2-cancel:focus {
  background: #ebc2c2 !important;
}

.swal2-icon {
  border-color: rgba(235, 194, 194, 0.55) !important;
  color: #9fcbb7 !important;
}

.swal2-actions {
  gap: 12px;
}

body.spectra-layout.header-collapsed .header-toggle {
  top: 14px;
}

body.spectra-layout.header-collapsed .spectra-main {
  padding-top: clamp(64px, 10vw, 128px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px clamp(16px, 4vw, 40px);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--spectra-muted);
  font-weight: 600;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.brand-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(250, 181, 218, 0.45));
}

.brand-title {
  font-size: 1.35rem;
  text-shadow: 0 0 28px rgba(250, 181, 218, 0.4);
  color: var(--spectra-muted);
}

.brand-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--spectra-muted);
  text-transform: none;
  letter-spacing: normal;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-actions .header-nav {
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  color: var(--spectra-muted);
  transition: all 0.3s ease;
  position: relative;
}

.nav-link--chat {
  background: var(--spectra-accent);
  color: var(--spectra-muted);
  border: 1px solid rgba(235, 194, 194, 0.8);
  box-shadow: 0 18px 35px rgba(235, 194, 194, 0.35);
}

.nav-link--button {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--spectra-muted);
  background: rgba(235, 194, 194, 0.2);
  box-shadow: 0 12px 28px rgba(235, 194, 194, 0.18);
}

.nav-link.active {
  color: var(--spectra-muted);
  background: rgba(235, 194, 194, 0.26);
  box-shadow: 0 18px 45px rgba(235, 194, 194, 0.24);
}

.nav-link--chat:hover,
.nav-link--chat:focus-visible,
.nav-link--chat.active {
  background: #f5d5d5;
  color: var(--spectra-muted);
}

.nav-link.locked {
  color: rgba(255, 255, 255, 0.55);
}

.nav-link.locked .lock-icon {
  margin-left: 6px;
  font-size: 0.85em;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
  flex: 1;
}

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

.chat-quick {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(235, 194, 194, 0.85);
  background: var(--spectra-accent);
  color: var(--spectra-muted);
  text-decoration: none;
  font-size: 1.25rem;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.chat-quick:hover,
.chat-quick:focus-visible {
  background: #f5d5d5;
  box-shadow: 0 10px 20px rgba(235, 194, 194, 0.3);
  outline: none;
}

.chat-quick .lock-icon {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-size: 0.7rem;
  background: rgba(3, 9, 28, 0.92);
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 4px 8px rgba(250, 181, 218, 0.3);
}

.chat-quick.locked {
  color: rgba(255, 255, 255, 0.8);
}

.motivation-quick {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(250, 181, 218, 0.25);
  background: rgba(250, 181, 218, 0.15);
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.motivation-quick:hover,
.motivation-quick:focus-visible {
  background: rgba(250, 181, 218, 0.25);
  box-shadow: 0 10px 20px rgba(250, 181, 218, 0.25);
  outline: none;
}

.motivation-quick__label {
  font-size: 0.85rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--spectra-accent);
  border: 1px solid rgba(235, 194, 194, 0.9);
  box-shadow: 0 10px 25px rgba(235, 194, 194, 0.25);
  text-decoration: none;
  color: var(--spectra-text);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(235, 194, 194, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #1e2e32;
  letter-spacing: 0.04em;
}


.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--spectra-muted);
}

.user-plan {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14rem;
  color: rgba(47, 42, 50, 0.85);
}

.dropdown {
  position: relative;
  z-index: 1100;
  margin-left: auto;
}

.dropbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: #ebc2c2;
  color: #1e2e32;
  box-shadow: 0 18px 35px rgba(159, 203, 183, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dropbtn:hover,
.dropbtn:focus-visible {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 24px 55px rgba(159, 203, 183, 0.45);
  outline: none;
}

.menu-label {
  font-size: 0.95rem;
}

.menu-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  background: rgba(35, 66, 71, 0.9);
  border: 1px solid var(--spectra-border);
  border-radius: 24px;
  padding: 28px clamp(18px, 4vw, 36px);
  width: min(860px, 92vw);
  box-shadow: 0 32px 68px rgba(30, 46, 50, 0.48);
  backdrop-filter: blur(18px);
  max-height: min(75vh, 720px);
  overflow-y: auto;
}

.dropdown-content.show {
  display: block;
}

.menu-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px 28px;
  margin-bottom: 24px;
}

.menu-heading {
  margin: 0 0 14px;
  font-size: 0.82rem;
  letter-spacing: 0.28rem;
  text-transform: uppercase;
  color: rgba(250, 181, 218, 0.85);
  font-weight: 600;
}

.dropdown-content .menu-item,
.dropdown-content form button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.dropdown-content .menu-item:hover,
.dropdown-content .menu-item:focus-visible,
.dropdown-content form button:hover,
.dropdown-content form button:focus-visible {
  background: rgba(250, 181, 218, 0.18);
  transform: translateX(4px);
  outline: none;
}

.dropdown-content .menu-item.active-link {
  background: rgba(250, 181, 218, 0.18);
  border: 1px solid rgba(250, 181, 218, 0.32);
  cursor: default;
  pointer-events: none;
}

.dropdown-content .menu-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: rgba(200, 224, 255, 0.65);
}

.logout-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
}

.menu-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-footer .menu-item,
.menu-footer .logout-btn {
  flex: 1 1 220px;
}

.menu-highlight {
  background: rgba(250, 181, 218, 0.12);
  border: 1px solid rgba(250, 181, 218, 0.2);
}

.lock-icon {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
}

.notification-badge {
  background: #ff4f6d;
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
  font-weight: 600;
}

/* Scrollbar */
.dropdown-content::-webkit-scrollbar {
  width: 8px;
}

.dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.dropdown-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}


.spectra-main--narrow {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.spectra-main--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(24px, 5vw, 48px);
}

.spectra-main--full-bleed {
  --spectra-main-padding-x: 0;
}

.spectra-main--immersive {
  --spectra-main-padding-top: calc(var(--spectra-header-height, 112px));
  --spectra-main-padding-x: 0;
  --spectra-main-padding-bottom: 0;
  min-height: calc(100vh - var(--spectra-header-height, 112px));
  position: relative;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 32px);
}

.spectra-main--immersive::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

}


@media (max-width: 768px) {
  .brand-tagline {
    font-size: 0.8rem;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions .header-nav {
    margin-left: 0;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-content {
    position: fixed;
    top: calc(var(--spectra-header-height, 112px) + 12px);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: min(540px, 92vw);
    max-height: calc(100vh - var(--spectra-header-height, 112px) - 24px);
    z-index: 1400;
  }
}

@media (max-width: 640px) {
  :root {
    --spectra-header-height: 76px;
  }

  .spectra-header .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 6vw, 24px);
  }

  .brand-block {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .brand-logo {
    gap: 10px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.1rem;
    letter-spacing: 0.12rem;
  }

  .brand-tagline {
    display: none;
  }

  .motivation-quick {
    display: inline-flex;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
  }

  .motivation-quick__label {
    display: none;
  }

  .chat-quick {
    display: inline-flex;
  }

  .header-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }

  .user-chip {
    display: none;
  }

  .dropbtn {
    padding: 10px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    justify-content: center;
  }

  .menu-label {
    display: none;
  }
}

@media (max-width: 520px) {
  .header-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: calc(100vw - 40px);
    padding-bottom: 6px;
  }

  .header-nav::-webkit-scrollbar {
    height: 4px;
  }

  .header-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
  }


  .dropdown-content {
    width: calc(100vw - 36px);
    padding: 24px 18px;
  }

  .menu-columns {
    gap: 18px;
  }
}
