/* PureSpective shared shell (landing + Demo) */

@import url("./fonts/fonts.css");

:root {
  --ps-navy: #061428;
  --ps-navy-deep: #020b18;
  --ps-glass: rgba(8, 24, 48, 0.55);
  --ps-glass-strong: rgba(6, 18, 38, 0.72);
  --ps-border: rgba(120, 190, 255, 0.35);
  --ps-border-soft: rgba(120, 190, 255, 0.18);
  --ps-cyan: #3db8ff;
  --ps-cyan-bright: #5ec8ff;
  --ps-cyan-glow: rgba(61, 184, 255, 0.55);
  --ps-text: #f4f8ff;
  --ps-muted: #9bb8d4;
  --ps-muted-soft: #7a97b3;
  --ps-radius: 1.35rem;
  --ps-radius-pill: 999px;
  --ps-font: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --ps-display: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  --ps-italic: "Instrument Serif", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

body.ps-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ps-font);
  color: var(--ps-text);
  background-color: var(--ps-navy-deep);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(20, 70, 140, 0.45), transparent 60%),
    linear-gradient(180deg, rgba(2, 10, 24, 0.35) 0%, rgba(2, 10, 24, 0.55) 45%, rgba(2, 8, 20, 0.88) 100%),
    url("./images/bg-mountains.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

@supports not (height: 100dvh) {
  body.ps-body {
    min-height: 100vh;
  }
}

.ps-body * {
  box-sizing: border-box;
}

.ps-hidden {
  display: none !important;
}

/* Hide protected pages until auth-gate unlocks them */
html.ps-auth-pending body {
  visibility: hidden;
}

/* ...except a dialog the gate shows first (the Beta Tester Agreement). */
html.ps-auth-pending .ps-dialog-root {
  visibility: visible;
}

/* —— Top bar —— */
.ps-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.5rem;
  position: relative;
  z-index: 5;
}

.ps-beta {
  text-align: right;
  animation: ps-fade-down 0.7s ease both;
}

.ps-beta-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ps-cyan-bright);
  letter-spacing: 0.02em;
}

.ps-beta-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--ps-muted);
  max-width: 11rem;
  line-height: 1.35;
}

.ps-chip {
  appearance: none;
  border: 1px solid var(--ps-border);
  background: rgba(8, 30, 58, 0.55);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease,
    transform 0.15s ease;
}

.ps-chip:hover:not(:disabled) {
  border-color: var(--ps-cyan);
  background: rgba(20, 50, 90, 0.7);
  box-shadow: 0 0 18px rgba(61, 184, 255, 0.2);
}

.ps-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ps-chip-user {
  max-width: 12rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ps-chip-user #loggedInAs {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-user-caret {
  flex-shrink: 0;
  font-size: 0.7rem;
  opacity: 0.85;
}

.ps-user-menu {
  position: relative;
}

.ps-user-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 100%;
  z-index: 40;
  border: 1px solid var(--ps-border);
  border-radius: 0.75rem;
  background: rgba(8, 30, 58, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.ps-user-dropdown-item {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ps-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ps-user-dropdown-item:hover {
  background: rgba(61, 184, 255, 0.18);
}

a.ps-user-dropdown-item {
  box-sizing: border-box;
  text-decoration: none;
}

/* —— Menu bar (app) —— */
.ps-menubar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--ps-border-soft);
  background: rgba(4, 16, 34, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: ps-fade-down 0.6s ease both;
}

.ps-menubar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  padding: 0.55rem 1rem;
}

.ps-menubar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ps-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ps-text);
  white-space: nowrap;
}

.ps-menubar-beta {
  font-family: var(--ps-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-cyan-bright);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-pill);
  padding: 0.12rem 0.5rem;
}

.ps-menubar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.ps-menubar-item {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ps-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5rem 0.8rem;
  border-radius: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ps-menubar-item:hover:not(:disabled),
.ps-menubar-item[aria-expanded="true"] {
  border-color: var(--ps-border);
  background: rgba(20, 50, 90, 0.65);
}

.ps-menubar-item:focus-visible {
  outline: 2px solid var(--ps-cyan-bright);
  outline-offset: 2px;
}

.ps-menubar-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ps-menubar-item svg {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  stroke: var(--ps-cyan-bright);
  fill: none;
  stroke-width: 1.7;
}

.ps-menubar-account {
  border-color: var(--ps-border);
  background: rgba(8, 30, 58, 0.55);
}

@media (max-width: 560px) {
  .ps-menubar-inner {
    padding: 0.5rem 0.6rem;
  }

  /* Once the menu wraps under the name, spread it edge to edge */
  .ps-menubar-nav {
    width: 100%;
    justify-content: space-between;
  }

  .ps-menubar-item {
    padding: 0.45rem 0.6rem;
  }
}

.ps-user-dropdown-item {
  white-space: nowrap;
}

/* "Coming soon" group in the user menu */
.ps-user-dropdown-label {
  padding: 0.55rem 0.9rem 0.25rem;
  border-top: 1px solid var(--ps-border-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-muted);
}

.ps-user-dropdown-soon {
  color: rgba(240, 248, 255, 0.8);
  font-weight: 500;
}

/* Divider between the Coming soon group and Log out */
.ps-user-dropdown-soon + .ps-user-dropdown-item:not(.ps-user-dropdown-soon) {
  border-top: 1px solid var(--ps-border-soft);
}

.ps-members-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--ps-cyan);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ps-cyan-bright);
  vertical-align: middle;
}

/* Coming soon page */
.ps-coming-feature {
  scroll-margin-top: 1rem;
}

.ps-about p.ps-coming-sub {
  margin: 0 0 0.4rem;
  font-style: italic;
  color: var(--ps-muted);
}

.ps-user-dropdown-danger {
  border-top: 1px solid var(--ps-border-soft);
  color: #fca5a5;
}

.ps-user-dropdown-danger:hover {
  background: rgba(248, 113, 113, 0.16);
}

.ps-user-dropdown-danger.is-armed {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
}

/* Delete-account dialog */
.ps-delete-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.ps-delete-legend {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ps-muted);
}

.ps-delete-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.35rem;
}

.ps-delete-reason {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.ps-delete-reason:has(input:checked) {
  border-color: var(--ps-cyan);
  background: rgba(61, 184, 255, 0.12);
}

.ps-delete-reason input {
  accent-color: var(--ps-cyan);
}

.ps-delete-details {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ps-border);
  border-radius: 0.6rem;
  background: rgba(4, 16, 32, 0.7);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

.ps-dialog-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— Main —— */
.ps-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem 1.5rem;
  width: 100%;
  min-height: calc(100dvh - 7rem);
}

.ps-stage {
  width: 100%;
  max-width: 26rem;
}

.ps-stage-wide {
  max-width: 40rem;
}

/* About page */
.ps-about p {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(240, 248, 255, 0.88);
}

.ps-about-steps {
  margin: 0 0 0.9rem;
  padding-left: 1.35rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(240, 248, 255, 0.88);
}

.ps-about-steps li {
  margin-bottom: 0.4rem;
  padding-left: 0.2rem;
}

.ps-about-steps li::marker {
  color: var(--ps-cyan);
  font-weight: 700;
}

.ps-about-steps strong {
  color: var(--ps-text);
}

.ps-about p.ps-about-callout {
  font-weight: 700;
  color: var(--ps-cyan-bright);
}

.ps-about-heading {
  margin: 1.1rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ps-cyan);
}

.ps-link {
  color: var(--ps-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ps-link:hover {
  color: var(--ps-text);
}

.ps-about-actions {
  margin-top: 1.25rem;
}

/* Settings page */
.ps-settings-list {
  margin: 0 0 0.5rem;
}

.ps-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ps-border-soft);
  font-size: 0.92rem;
}

.ps-settings-row dt {
  flex: 0 0 5rem;
  color: var(--ps-muted);
  font-weight: 600;
}

.ps-settings-row dd {
  margin: 0;
  color: var(--ps-text);
  overflow-wrap: anywhere;
}

.ps-about p.ps-settings-note {
  margin-top: 0.75rem;
  color: var(--ps-muted);
}

.ps-settings-danger-heading {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--ps-border-soft);
  color: #fca5a5;
}

.ps-settings-delete.is-armed {
  border-color: rgba(220, 38, 38, 0.9);
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
}

.ps-about-actions .ps-btn-ghost {
  text-decoration: none;
}

/* Brand */
.ps-brand {
  text-align: center;
  margin-bottom: 1.35rem;
  animation: ps-rise 0.85s ease both;
}

.ps-logo {
  width: min(92%, 22rem);
  margin: 0 auto 0.85rem;
  filter: drop-shadow(0 0 18px var(--ps-cyan-glow))
    drop-shadow(0 0 40px rgba(61, 184, 255, 0.25));
  animation: ps-glow-pulse 4.5s ease-in-out infinite;
}

.ps-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.ps-tagline {
  margin: 0;
  font-family: var(--ps-italic);
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(240, 248, 255, 0.92);
  letter-spacing: 0.01em;
}

/* Glass card */
.ps-card {
  background: var(--ps-glass);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.5rem 1.35rem 1.25rem;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(61, 184, 255, 0.08);
  animation: ps-rise 0.95s ease 0.08s both;
}

/* —— Admin dashboard layout —— */
.ps-dash-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ps-dash-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.ps-dash-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.ps-dash-link-chip {
  text-decoration: none;
  display: inline-block;
}

.ps-dash-main {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 0.5rem 0.75rem 2rem;
  flex: 1;
}

.ps-dash-page-title {
  margin: 0 0 1.5rem;
  text-align: center;
  font-family: var(--ps-display);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ps-text);
}

.ps-dash-section {
  margin-bottom: 1.5rem;
}

.ps-dash-section-last {
  margin-bottom: 2rem;
}

.ps-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ps-dash-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.ps-dash-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ps-dash-card-head h2 {
  margin: 0;
}

.ps-feedback-export-btn {
  border-color: rgba(61, 184, 255, 0.55);
  background: rgba(61, 184, 255, 0.18);
}

.ps-feedback-export-btn:disabled {
  opacity: 0.7;
}

.ps-dash-card-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.ps-dash-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ps-dash-status {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.ps-dash-item .ps-dash-status {
  margin-bottom: 0;
}

.ps-dash-status-center {
  text-align: center;
}

.ps-dash-status-ok,
.ps-dash-card .ps-dash-status-ok {
  color: #86efac;
}

.ps-dash-status-bad,
.ps-dash-card .ps-dash-status-bad {
  color: #fca5a5;
}

.ps-dash-health-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ps-dash-health-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ps-dash-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
}

.ps-dash-scroll-lg {
  max-height: 24rem;
}

.ps-deletions-grid {
  margin: 1rem 0 0;
}

.ps-deletion-comment {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: rgba(244, 248, 255, 0.9);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ps-dash-search-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ps-dash-title-row .ps-dash-page-title {
  margin-bottom: 1rem;
}

.ps-dash-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.ps-dash-tab.is-active {
  border-color: var(--ps-cyan);
  background: rgba(61, 184, 255, 0.22);
  box-shadow: 0 0 18px rgba(61, 184, 255, 0.25);
}

.ps-dash-tab-panel[hidden] {
  display: none;
}

.ps-dash-account-type-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ps-dash-account-type {
  width: auto;
}

@media (min-width: 640px) {
  .ps-dash-search-row {
    flex-direction: row;
    align-items: stretch;
  }

  .ps-dash-search-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

.ps-dash-field {
  display: block;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.ps-dash-field-flush {
  margin-bottom: 0;
}

.ps-dash-field-area {
  min-height: 6rem;
  resize: vertical;
}

.ps-dash-item-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.ps-dash-item-stack-tight {
  gap: 0.25rem;
}

.ps-dash-item-action {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.ps-dash-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ps-dash-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ps-text);
}

.ps-dash-item-meta {
  font-size: 0.75rem;
  color: var(--ps-muted);
}

.ps-dash-item-msg {
  color: rgba(244, 248, 255, 0.9);
}

.ps-dash-rating-stars {
  color: #f5b942;
  font-size: 1.35rem;
  line-height: 1;
}

.ps-dash-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--ps-radius-pill);
  border: 1px solid var(--ps-border-soft);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 248, 255, 0.85);
}

.ps-dash-badge-accent {
  border-color: rgba(61, 184, 255, 0.4);
  background: rgba(61, 184, 255, 0.15);
  color: #c5ebff;
}

.ps-dash-badge-danger {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.ps-dash-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.ps-dash-item-meta.ps-dash-suspension {
  color: #fca5a5;
}

/* User metrics ring chart (dashboard) */
.ps-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.ps-metrics-chart {
  width: 9.5rem;
  height: 9.5rem;
  flex-shrink: 0;
}

.ps-metrics-chart svg {
  width: 100%;
  height: 100%;
}

.ps-metrics-track,
.ps-metrics-active {
  fill: none;
  stroke-width: 14;
}

.ps-metrics-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.ps-metrics-active {
  stroke: var(--ps-cyan);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(61, 184, 255, 0.45));
  transition: stroke-dasharray 0.4s ease;
}

.ps-metrics-pct {
  fill: var(--ps-text);
  font-size: 1.5rem;
  font-weight: 700;
}

.ps-metrics-sub {
  fill: var(--ps-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ps-metrics-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 12rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.ps-metrics-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ps-metrics-label {
  flex: 1;
  color: var(--ps-muted);
}

.ps-metrics-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.ps-metrics-dot-active {
  background: var(--ps-cyan);
  box-shadow: 0 0 6px rgba(61, 184, 255, 0.6);
}

.ps-metrics-dot-inactive {
  background: rgba(255, 255, 255, 0.18);
}

.ps-metrics-dot-total {
  border: 2px solid var(--ps-cyan);
}

.ps-metrics-dot-online {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

/* User growth chart (dashboard) */
.ps-growth {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ps-growth-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 1.5rem;
  font-size: 0.72rem;
  color: var(--ps-muted);
  text-align: right;
}

.ps-growth-chart {
  flex: 1;
  height: 11rem;
  min-width: 0;
}

.ps-growth-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ps-growth-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.ps-growth-area {
  fill: rgba(61, 184, 255, 0.16);
}

.ps-growth-line {
  fill: none;
  stroke: var(--ps-cyan);
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(61, 184, 255, 0.45));
}

.ps-growth-hit {
  fill: transparent;
}

.ps-growth-hit:hover {
  fill: rgba(61, 184, 255, 0.08);
}

.ps-growth-x {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 0 0 2rem;
  font-size: 0.72rem;
  color: var(--ps-muted);
}

/* Prompt analytics (dashboard) */
.ps-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.ps-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.85rem;
  background: rgba(8, 30, 58, 0.45);
}

.ps-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ps-cyan-bright);
}

.ps-stat-label {
  font-size: 0.74rem;
  color: var(--ps-muted);
}

.ps-analytics-heading {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ps-muted);
}

.ps-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 7rem;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--ps-border-soft);
}

.ps-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--ps-cyan-bright), rgba(61, 184, 255, 0.45));
  transition: filter 0.15s ease;
}

.ps-bar:hover {
  filter: brightness(1.3);
}

.ps-bar.is-zero {
  height: 2px !important;
  background: rgba(155, 184, 212, 0.25);
}

.ps-bars-x {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--ps-muted);
}

.ps-analytics-table-wrap {
  max-height: 20rem;
  overflow: auto;
}

.ps-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ps-analytics-table th {
  position: sticky;
  top: 0;
  padding: 0.45rem 0.5rem;
  background: rgba(6, 18, 38, 0.95);
  color: var(--ps-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.ps-analytics-table th:first-child {
  text-align: left;
}

.ps-analytics-table td {
  padding: 0.5rem;
  border-top: 1px solid var(--ps-border-soft);
  vertical-align: top;
}

.ps-analytics-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ps-analytics-title {
  display: block;
  font-weight: 600;
}

.ps-analytics-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--ps-muted);
}

.ps-llm-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ps-llm-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
}

.ps-llm-bar-head .ps-dash-muted {
  font-size: 0.76rem;
  text-align: right;
}

.ps-llm-bar-track {
  height: 0.6rem;
  border-radius: var(--ps-radius-pill);
  background: rgba(155, 184, 212, 0.15);
  overflow: hidden;
}

.ps-llm-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(61, 184, 255, 0.6), var(--ps-cyan-bright));
}

.ps-vc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.ps-vc-pill {
  min-width: 8.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.75rem;
  background: rgba(8, 30, 58, 0.45);
}

.ps-vc-pill.is-current {
  border-color: var(--ps-border);
}

.ps-vc-top,
.ps-vc-mid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ps-vc-version {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ps-muted);
}

.ps-vc-avg {
  font-size: 1.1rem;
  font-weight: 700;
}

.ps-vc-delta {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ps-muted);
}

.ps-vc-delta.is-up {
  color: #4ade80;
}

.ps-vc-delta.is-down {
  color: #f87171;
}

.ps-vc-sub {
  font-size: 0.72rem;
  color: var(--ps-muted);
}

/* Prompt version badge + dropdown (dashboard) */
.ps-version-dropdown {
  position: relative;
  flex-shrink: 0;
}

.ps-version-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ps-version-trigger:hover,
.ps-version-dropdown.is-open .ps-version-trigger {
  border-color: var(--ps-cyan);
  box-shadow: 0 0 0 3px rgba(61, 184, 255, 0.18);
}

.ps-version-caret {
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-0.08rem);
  transition: transform 0.15s ease;
}

.ps-version-dropdown.is-open .ps-version-caret {
  transform: rotate(225deg) translateY(-0.04rem);
}

.ps-llm-menu.ps-version-menu {
  position: fixed;
  z-index: 60;
  top: auto;
  left: auto;
  right: auto;
  width: max-content;
  min-width: 13rem;
  max-width: calc(100vw - 1rem);
  max-height: 16rem;
  overflow-y: auto;
}

.ps-version-option {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
}

.ps-version-date {
  font-weight: 400;
  color: var(--ps-muted);
}

.ps-version-reviews-title {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ps-cyan);
}

.ps-version-reviews {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ps-version-review {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
}

.ps-version-review-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ps-version-review-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.ps-version-empty {
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: var(--ps-muted);
}

.ps-dash-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ps-dash-btn-danger {
  appearance: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

.ps-dash-btn-danger:hover {
  filter: brightness(1.08);
  border-color: rgba(248, 113, 113, 0.65);
}

.ps-dash-health-ok {
  border-color: rgba(74, 222, 128, 0.35);
}

.ps-dash-health-bad {
  border-color: rgba(248, 113, 113, 0.35);
}

.ps-dash-field-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.ps-dash-field-content {
  font-size: 0.875rem;
  min-height: 6rem;
  resize: vertical;
}

/* Dashboard glass panels */
.ps-dash-card {
  background: rgba(8, 24, 48, 0.42);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.15rem;
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 16px 40px rgba(0, 0, 0, 0.35);
  color: var(--ps-text);
}

.ps-dash-card h2 {
  margin: 0;
  color: var(--ps-text);
  font-size: 1.25rem;
  font-weight: 600;
}

.ps-dash-card .ps-dash-muted {
  color: var(--ps-muted);
}

.ps-dash-item {
  background: rgba(4, 16, 32, 0.45);
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.85rem;
  padding: 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ps-dash-card input,
.ps-dash-card textarea,
.ps-dash-field {
  background: rgba(4, 16, 32, 0.55);
  border: 1px solid var(--ps-border);
  color: var(--ps-text);
}

.ps-dash-card input::placeholder,
.ps-dash-card textarea::placeholder,
.ps-dash-field::placeholder {
  color: var(--ps-muted-soft);
}

.ps-dash-card input:focus,
.ps-dash-card textarea:focus,
.ps-dash-field:focus {
  outline: none;
  border-color: var(--ps-cyan);
  box-shadow: 0 0 0 2px rgba(61, 184, 255, 0.2);
}

.feedback-filter-btn.is-active {
  border-color: var(--ps-cyan);
  background: rgba(61, 184, 255, 0.22);
  box-shadow: 0 0 18px rgba(61, 184, 255, 0.25);
}

/* Amazon-style average stars */
.ps-avg-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  line-height: 1;
  vertical-align: middle;
}

.ps-avg-star {
  position: relative;
  display: inline-block;
  width: 0.95em;
  height: 1em;
  font-size: 0.95rem;
  color: rgba(180, 200, 220, 0.35);
}

.ps-avg-star::before {
  content: "★";
}

.ps-avg-star-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #f5b942;
  text-shadow: 0 0 8px rgba(245, 185, 66, 0.35);
}

.ps-avg-star-fill::before {
  content: "★";
}

.ps-avg-stars-lg .ps-avg-star {
  font-size: 1.15rem;
}

.ps-avg-summary-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
}

.ps-avg-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ps-muted);
}

.ps-prompt-avg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ps-card-title {
  margin: 0 0 0.4rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ps-card-sub {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ps-muted);
}

.ps-btn-primary {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: var(--ps-radius-pill);
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #4fc3ff 0%, #1a8fe8 55%, #0d6fc4 100%);
  box-shadow:
    0 4px 18px rgba(30, 140, 230, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.ps-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 6px 24px rgba(30, 140, 230, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset;
  transform: translateY(-1px);
}

.ps-btn-primary:active {
  transform: translateY(0) scale(0.985);
}

.ps-btn-primary svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.ps-status {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ps-cyan-bright);
}

.ps-status-muted {
  color: var(--ps-muted-soft);
  font-weight: 400;
  margin-top: 0.35rem;
}

.ps-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0;
  color: var(--ps-muted-soft);
  font-size: 0.8rem;
}

.ps-divider::before,
.ps-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ps-border-soft),
    transparent
  );
}

.ps-btn-ghost {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid var(--ps-border);
  border-radius: var(--ps-radius-pill);
  padding: 0.75rem 1.15rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ps-text);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ps-btn-ghost:hover {
  border-color: var(--ps-cyan);
  background: rgba(61, 184, 255, 0.08);
  box-shadow: 0 0 16px rgba(61, 184, 255, 0.15);
}

/* Feature strip */
.ps-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ps-border-soft);
}

.ps-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
  position: relative;
}

.ps-feature:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 15%;
  bottom: 15%;
  width: 1px;
  background: var(--ps-border-soft);
}

.ps-feature svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: rgba(230, 242, 255, 0.9);
  fill: none;
  stroke-width: 1.5;
}

.ps-feature span {
  font-size: 0.62rem;
  line-height: 1.3;
  color: var(--ps-muted);
  font-weight: 500;
}

.ps-feature {
  cursor: help;
}

.ps-feature-label {
  border-radius: 0.35rem;
  outline: none;
}

.ps-feature-label:focus-visible {
  box-shadow: 0 0 0 2px var(--ps-cyan-bright);
}

.ps-feature-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 0.62rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ps-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ps-feature-link:hover {
  color: var(--ps-text);
}

.ps-feature .ps-tip {
  position: absolute;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 11rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ps-border);
  border-radius: 0.6rem;
  background: rgba(6, 18, 38, 0.97);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  color: var(--ps-text);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.ps-feature .ps-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--ps-border);
}

/* Keep the outer tooltips inside the card on narrow screens */
.ps-feature:first-child .ps-tip {
  left: 0;
  transform: translate(0, 4px);
}

.ps-feature:first-child .ps-tip::after {
  left: 1.5rem;
}

.ps-feature:last-child .ps-tip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.ps-feature:last-child .ps-tip::after {
  left: auto;
  right: 1.5rem;
  margin-left: 0;
  margin-right: -5px;
}

.ps-feature:hover .ps-tip,
.ps-feature:focus-within .ps-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.ps-feature:first-child:hover .ps-tip,
.ps-feature:first-child:focus-within .ps-tip,
.ps-feature:last-child:hover .ps-tip,
.ps-feature:last-child:focus-within .ps-tip {
  transform: translate(0, 0);
}

/* Feedback panel */
.ps-feedback-panel {
  margin-top: 1rem;
  background: var(--ps-glass-strong);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.35rem 1.25rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: ps-rise 0.45s ease both;
}

.ps-feedback-panel.ps-hidden {
  display: none !important;
}

.ps-feedback-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.ps-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ps-muted);
  text-align: center;
}

.ps-llm-picker {
  margin: 0 0 1.1rem;
}

.ps-llm-dropdown {
  position: relative;
  width: 100%;
  max-width: 18rem;
  margin: 0 auto;
}

.ps-llm-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: 1px solid var(--ps-border);
  border-radius: 0.85rem;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ps-text);
  background: rgba(4, 16, 32, 0.65);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ps-llm-trigger:hover,
.ps-llm-trigger:focus-visible,
.ps-llm-dropdown.is-open .ps-llm-trigger {
  border-color: var(--ps-cyan);
  background: rgba(8, 28, 52, 0.85);
  box-shadow: 0 0 0 3px rgba(61, 184, 255, 0.18);
}

.ps-llm-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ps-muted);
}

.ps-llm-dropdown.has-value .ps-llm-trigger-label {
  color: var(--ps-text);
}

.ps-llm-trigger-caret {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--ps-cyan-bright);
  border-bottom: 2px solid var(--ps-cyan-bright);
  transform: rotate(45deg) translateY(-0.1rem);
  transition: transform 0.15s ease;
}

.ps-llm-dropdown.is-open .ps-llm-trigger-caret {
  transform: rotate(225deg) translateY(-0.05rem);
}

.ps-llm-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--ps-border);
  border-radius: 0.85rem;
  background: rgba(6, 18, 38, 0.96);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 16px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.ps-llm-menu.ps-hidden {
  display: none;
}

.ps-llm-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.65rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ps-text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.ps-llm-option:hover,
.ps-llm-option:focus-visible,
.ps-llm-option.is-active {
  outline: none;
  background: rgba(61, 184, 255, 0.16);
  color: var(--ps-cyan-bright);
}

.ps-llm-option[aria-selected="true"] {
  background: rgba(61, 184, 255, 0.22);
  color: var(--ps-cyan-bright);
  box-shadow: 0 0 14px rgba(61, 184, 255, 0.18);
}

#promptFeedbackLlm {
  min-height: 2.6rem;
  resize: none;
  cursor: default;
  opacity: 0.95;
}

.ps-stars {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.ps-star {
  font-size: 1.75rem;
  color: rgba(180, 200, 220, 0.35);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.12s ease;
  line-height: 1;
}

.ps-star.filled {
  color: #f5b942;
  text-shadow: 0 0 10px rgba(245, 185, 66, 0.45);
}

.ps-star:hover {
  transform: scale(1.12);
}

.ps-rating-label {
  margin: 0 0 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ps-muted-soft);
}

.ps-textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid var(--ps-border);
  background: rgba(4, 16, 32, 0.65);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ps-textarea::placeholder {
  color: var(--ps-muted-soft);
}

.ps-prompt-feedback {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ps-border-soft);
}

.ps-prompt-feedback-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ps-text);
}

.ps-textarea:focus {
  border-color: var(--ps-cyan);
  box-shadow: 0 0 0 3px rgba(61, 184, 255, 0.18);
}

.ps-feedback-status {
  min-height: 1.15rem;
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ps-cyan-bright);
}

.ps-feedback-actions {
  margin-top: 0.85rem;
}

/* —— Footer —— */
.ps-footer {
  padding: 0.5rem 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: ps-fade-up 0.8s ease 0.2s both;
}

.ps-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.ps-footer-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--ps-border);
  background: rgba(8, 24, 48, 0.5);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

a.ps-footer-btn {
  text-decoration: none;
}

.ps-footer-btn:hover {
  border-color: var(--ps-cyan);
  background: rgba(20, 50, 90, 0.65);
  box-shadow: 0 0 16px rgba(61, 184, 255, 0.18);
}

.ps-footer-btn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.ps-slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--ps-muted);
  font-style: italic;
}

.ps-slogan::before,
.ps-slogan::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--ps-border-soft);
}

.ps-not-affiliated {
  margin: -0.6rem 0 0; /* sit close under the slogan despite the footer gap */
  font-size: 0.72rem;
  color: var(--ps-muted);
  text-align: center;
}

/* Motion */
@keyframes ps-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ps-fade-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ps-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ps-glow-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 14px var(--ps-cyan-glow))
      drop-shadow(0 0 28px rgba(61, 184, 255, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 22px var(--ps-cyan-glow))
      drop-shadow(0 0 48px rgba(61, 184, 255, 0.35));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-brand,
  .ps-card,
  .ps-beta,
  .ps-footer,
  .ps-feedback-panel,
  .ps-logo {
    animation: none;
  }
}

@media (max-width: 380px) {
  .ps-feature span,
  .ps-feature .ps-feature-link {
    font-size: 0.55rem;
  }

  .ps-card {
    padding: 1.25rem 1rem 1.1rem;
  }
}

/* Install control: website only, not in installed PWA */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .pwa-browser-only {
    display: none !important;
  }
}

html.pwa-standalone .pwa-browser-only {
  display: none !important;
}

/* —— Auth (landing) —— */
.ps-auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem 1.25rem;
  width: 100%;
  min-height: calc(100dvh - 5.5rem);
}

@supports not (height: 100dvh) {
  .ps-auth-main {
    min-height: calc(100vh - 5.5rem);
  }
}

.ps-topbar-auth {
  justify-content: flex-end;
}

.ps-field {
  margin-bottom: 0.85rem;
}

.ps-invite-bulk {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--ps-border-soft);
  text-align: left;
}

.ps-invite-bulk-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ps-text);
}

.ps-invite-bulk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.65rem;
}

.ps-invite-csv-input {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--ps-muted);
  font-size: 0.82rem;
}

.ps-invite-csv-input::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--ps-border);
  border-radius: 0.55rem;
  background: rgba(61, 184, 255, 0.12);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.ps-prompt-file-note {
  margin: 0.5rem 0 0.45rem;
}

.ps-prompt-file-input {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.ps-dash-card .ps-label {
  text-align: left;
}

select.ps-dash-field option {
  background: #061428;
  color: var(--ps-text);
}

.ps-prompt-model-select {
  flex: 0 0 auto;
  width: auto;
}

.ps-invite-results {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 16rem;
  overflow-y: auto;
  text-align: left;
  margin-top: 0.35rem;
}

.ps-invite-result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ps-border-soft);
  border-radius: 0.55rem;
  font-size: 0.8rem;
}

.ps-invite-result-row strong {
  color: var(--ps-text);
}

.ps-invite-result-meta {
  grid-column: 1 / -1;
  color: var(--ps-muted);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.ps-invite-link {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ps-invite-link-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ps-border);
  border-radius: 0.6rem;
  background: rgba(4, 16, 32, 0.7);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.78rem;
}

.ps-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.25rem 0 0.9rem;
  font-size: 0.8rem;
  color: var(--ps-muted);
  text-align: left;
  cursor: pointer;
}

.ps-check input {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0.1rem 0 0;
  accent-color: var(--ps-cyan);
  cursor: pointer;
}

.ps-link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.ps-field-note {
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  color: var(--ps-muted);
  text-align: left;
}

.ps-input.ps-textarea {
  height: auto;
  min-height: 4.5rem;
  padding: 0.65rem 0.85rem;
  resize: vertical;
  line-height: 1.4;
}

/* Spam trap on the invite request form: off-screen, not display:none, so
   simple bots still fill it. */
.ps-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ps-field-note-ok {
  color: #5fd39a;
}

.ps-input[readonly] {
  opacity: 0.8;
  cursor: default;
}

.ps-field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ps-muted);
  text-align: left;
}

.ps-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ps-input-wrap .ps-field-icon {
  position: absolute;
  left: 0.85rem;
  width: 1.05rem;
  height: 1.05rem;
  stroke: var(--ps-cyan-bright);
  fill: none;
  stroke-width: 1.6;
  pointer-events: none;
}

.ps-input-wrap .ps-field-action {
  position: absolute;
  right: 0.55rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ps-muted);
  padding: 0.35rem;
  cursor: pointer;
  display: inline-flex;
  border-radius: 0.4rem;
}

.ps-input-wrap .ps-field-action:hover {
  color: var(--ps-cyan-bright);
}

.ps-input-wrap .ps-field-action svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.ps-input {
  width: 100%;
  height: 2.85rem;
  padding: 0 2.5rem 0 2.55rem;
  border-radius: 0.85rem;
  border: 1px solid var(--ps-border);
  background: rgba(4, 16, 32, 0.65);
  color: var(--ps-text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ps-input:not(.ps-input-has-action) {
  padding-right: 0.9rem;
}

.ps-input::placeholder {
  color: var(--ps-muted-soft);
}

.ps-input:focus {
  border-color: var(--ps-cyan);
  box-shadow: 0 0 0 3px rgba(61, 184, 255, 0.18);
}

.ps-forgot {
  display: block;
  text-align: right;
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--ps-cyan-bright);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease, transform 0.15s ease;
}

.ps-forgot:hover {
  color: #9adbff;
}

.ps-forgot.is-highlighted {
  color: #ffc857;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 0 12px rgba(255, 200, 87, 0.55);
  animation: ps-forgot-pulse 1.25s ease-in-out infinite;
}

@keyframes ps-forgot-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

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

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

.ps-auth-error {
  min-height: 1.15rem;
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: #ff8f9f;
}

.ps-cookie-notice {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.ps-switch-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ps-muted-soft);
}

.ps-switch-hint button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ps-cyan-bright);
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Custom dialog (replaces native alert/confirm) */
.ps-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
}

.ps-dialog-root[hidden] {
  display: none !important;
}

.ps-dialog-root.ps-dialog-open {
  pointer-events: auto;
}

.ps-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ps-dialog-root.ps-dialog-open .ps-dialog-backdrop {
  opacity: 1;
}

.ps-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 24rem);
  padding: 1.35rem 1.4rem 1.2rem;
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border);
  background: var(--ps-glass-strong);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: var(--ps-text);
  transform: translateY(10px) scale(0.97);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ps-dialog-root.ps-dialog-open .ps-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ps-dialog-title {
  margin: 0 0 0.55rem;
  font-family: var(--ps-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ps-cyan-bright);
}

.ps-dialog-message {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ps-text);
  white-space: pre-wrap;
}

.ps-dialog-box-label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ps-muted);
}

.ps-dialog-box {
  display: block;
  width: 100%;
  min-height: 8.5rem;
  max-height: 12rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1px solid var(--ps-border);
  background: rgba(4, 16, 32, 0.7);
  color: var(--ps-muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ps-dialog-box:focus-visible {
  outline: 2px solid var(--ps-cyan);
  outline-offset: 2px;
}

.ps-dialog.ps-dialog-wide {
  width: min(100%, 36rem);
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
}

.ps-dialog-content {
  margin-top: 0.85rem;
  max-height: 16rem;
  overflow-y: auto;
}

.ps-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.ps-dialog-btn {
  appearance: none;
  min-width: 5.5rem;
  border-radius: var(--ps-radius-pill);
  padding: 0.55rem 1.05rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    transform 0.12s ease;
}

.ps-dialog-btn:focus-visible {
  outline: 2px solid var(--ps-cyan);
  outline-offset: 2px;
}

.ps-dialog-btn-ghost {
  border: 1px solid var(--ps-border);
  background: transparent;
  color: var(--ps-text);
}

.ps-dialog-btn-ghost:hover {
  border-color: var(--ps-cyan);
  background: rgba(61, 184, 255, 0.08);
}

.ps-dialog-btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #4fc3ff 0%, #1a8fe8 55%, #0d6fc4 100%);
  box-shadow: 0 4px 14px rgba(30, 140, 230, 0.4);
}

.ps-dialog-btn-primary:hover {
  filter: brightness(1.06);
}

.ps-dialog-btn-danger {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #ff7a8a 0%, #e0455a 55%, #b82d40 100%);
  box-shadow: 0 4px 14px rgba(200, 50, 70, 0.4);
}

.ps-dialog-btn-danger:hover {
  filter: brightness(1.06);
}

.ps-dialog-btn:active {
  transform: scale(0.98);
}
