/* SWING UX polish: shared public and account experience. */

:root {
  --ux-surface-0: #090a0c;
  --ux-surface-1: #101216;
  --ux-surface-2: #15171c;
  --ux-surface-3: #1b1e24;
  --ux-border: rgba(241, 236, 226, 0.11);
  --ux-border-strong: rgba(241, 236, 226, 0.2);
  --ux-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

body[data-page] *,
body.legal-page * {
  letter-spacing: 0 !important;
}

body[data-page]::after,
body.legal-page::after {
  display: none;
}

body[data-page] {
  background: var(--ux-surface-0);
}

.glass-card,
.cell,
.prof-card,
.terminal,
.price-row,
.profile-detail-card,
.profile-explainer-card,
.support-kb-panel,
.support-topic-card,
.support-kb-card,
.modal-card {
  border-radius: 8px;
}

.btn {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-lg {
  min-height: 48px;
  padding: 0 22px;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Public shell */
.ticker-bar {
  height: 28px;
  font-size: 0.64rem;
  background: #07080a;
}

.site-nav {
  background: rgba(9, 10, 12, 0.9);
}

.nav-pill {
  min-height: 70px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-links {
  gap: 26px;
  font-size: 0.84rem;
}

.nav-links a[aria-current="true"] {
  color: var(--ink);
}

.nav-links a[aria-current="true"]::after {
  width: 100%;
  left: 0;
}

.nav-wordmark,
.sidebar-name,
.brand-name {
  font-weight: 700;
}

/* Homepage hero: product first, restrained editorial character. */
.s-hero {
  min-height: calc(100vh - 132px);
  min-height: calc(100svh - 132px);
  padding: 64px 0 72px;
  display: flex;
  align-items: center;
}

.s-hero::before {
  opacity: 0.7;
  background-position: 58% center;
}

.hero-grid {
  width: 100%;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 72px;
}

.hero-h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: 64px;
  line-height: 0.98;
}

.hero-lead {
  max-width: 620px;
  margin: 22px 0 28px;
  font-size: 16px;
}

.hero-actions {
  margin-bottom: 34px;
}

.hero-trust {
  max-width: 680px;
  padding-top: 18px;
}

.trust-item .num {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.trust-item .lbl {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: none;
  color: var(--ink-mute);
}

.hero-stage {
  display: grid;
  gap: 12px;
}

.terminal {
  padding: 22px;
  background: rgba(18, 19, 24, 0.94);
  box-shadow: var(--ux-shadow);
  will-change: auto;
}

.live-row:not(.is-skeleton) {
  animation: ux-row-in 420ms var(--ease-out) both;
}

.live-row:not(.is-skeleton):nth-child(2) { animation-delay: 50ms; }
.live-row:not(.is-skeleton):nth-child(3) { animation-delay: 100ms; }
.live-row:not(.is-skeleton):nth-child(4) { animation-delay: 150ms; }

.hero-flow {
  padding: 16px 18px;
  border: 1px solid var(--ux-border);
  border-radius: 8px;
  background: rgba(12, 13, 16, 0.88);
}

.hero-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 0.72rem;
  color: var(--ink-mute);
}

.hero-flow-head strong {
  color: var(--sage);
  font-size: 0.74rem;
}

.hero-flow ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.hero-flow li {
  min-width: 0;
  padding: 10px;
  border-left: 2px solid var(--line-strong);
  background: rgba(241, 236, 226, 0.025);
  animation: ux-flow-step 7.2s ease-in-out infinite;
}

.hero-flow li:nth-child(2) { animation-delay: 2.4s; }
.hero-flow li:nth-child(3) { animation-delay: 4.8s; }

.hero-flow li > span,
.hero-flow li strong,
.hero-flow li small {
  display: block;
}

.hero-flow li > span {
  margin-bottom: 5px;
  color: var(--gold);
  font: 600 0.62rem var(--mono);
}

.hero-flow li strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.hero-flow li small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes ux-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ux-flow-step {
  0%, 28%, 100% { border-color: var(--line-strong); background: rgba(241, 236, 226, 0.025); }
  8%, 20% { border-color: var(--sage); background: rgba(121, 189, 140, 0.07); }
}

/* A stationary proof band reads as evidence instead of decoration. */
.proof-rail {
  justify-content: center;
  gap: 34px;
  width: min(100%, var(--container-wide));
  margin: 0 auto;
  padding: 22px var(--gutter);
  white-space: normal;
  animation: none;
}

.proof-num {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
}

.proof-txt {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: none;
}

.proof-divider {
  font-family: var(--sans);
  font-size: 0.9rem;
}

.s {
  padding: 104px 0;
}

.s-head {
  margin-bottom: 52px;
}

.s-head h2 {
  max-width: 18ch;
  font-size: 52px;
  line-height: 1.04;
}

.s-head .lead {
  font-size: 16px;
}

.method-grid,
.bento,
.prof-grid {
  gap: 14px;
}

.method-grid {
  border-radius: 8px;
}

.method-item {
  padding: 30px;
}

.method-item h3,
.cell-title,
.prof-name {
  font-size: 1.35rem;
}

.cell,
.prof-card {
  padding: 26px;
}

.cell:hover,
.prof-card:hover,
.profile-detail-card:hover {
  transform: translateY(-2px);
}

.s-manifesto {
  background: var(--ux-surface-1);
}

.manifesto-text {
  max-width: 34ch;
}

/* Account shell */
body[data-page="account"] {
  --bg: var(--ux-surface-0);
  --bg-soft: #0e1014;
  --bg-elev: var(--ux-surface-2);
  --bg-elev-2: var(--ux-surface-3);
}

body[data-page="account"] .app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

body[data-page="account"] .acct-sidebar {
  background: #0d0f13;
}

body[data-page="account"] .sidebar-brand {
  min-height: 72px;
  padding: 16px 18px;
}

body[data-page="account"] .account-tabs {
  gap: 4px;
  padding: 14px 10px;
}

body[data-page="account"] .sidebar-section-label {
  margin: 12px 8px 3px;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: none;
}

body[data-page="account"] .account-tab {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 6px;
}

body[data-page="account"] .tab-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
}

body[data-page="account"] .dashboard-content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px 38px 64px;
}

body[data-page="account"] .account-panel {
  gap: 16px;
}

body[data-page="account"] .account-panel.is-active {
  animation: ux-panel-in 240ms var(--ease-out) both;
}

@keyframes ux-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

body[data-page="account"] .panel-header {
  padding-bottom: 20px;
}

body[data-page="account"] .panel-heading,
body[data-page="account"] .data-card h4,
body[data-page="account"] .setup-h {
  font-family: var(--sans);
  font-style: normal;
}

body[data-page="account"] .panel-heading {
  margin-bottom: 5px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.18;
}

body[data-page="account"] .panel-eyebrow,
body[data-page="account"] .data-eyebrow,
body[data-page="account"] .stat-label,
body[data-page="account"] .acct-chip-label {
  font-family: var(--sans);
  font-weight: 700;
}

#dashboard > .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

#dashboard > .panel-header .panel-header-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-items: stretch;
}

#dashboard > .panel-header .acct-chip {
  min-width: 0;
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 6px;
  background: var(--ux-surface-1);
}

#dashboard > .panel-header .acct-chip-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="account"] .admin-profile-switcher {
  margin-bottom: 22px;
  border-radius: 8px;
  background: var(--ux-surface-1);
}

.quick-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-controls-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 2px;
}

.quick-controls-heading .data-eyebrow {
  margin-bottom: 3px;
}

.quick-controls-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.quick-controls-heading > p {
  max-width: 54ch;
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: right;
}

.quick-control {
  min-width: 0;
  padding: 15px;
  border-color: var(--ux-border);
  border-radius: 8px;
  background: var(--ux-surface-1);
}

.quick-profile-select,
.quick-investment,
.settings-form input,
.settings-form select,
.settings-form textarea {
  border-radius: 6px;
  background: #0d0f13;
}

.quick-profile-review {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 6px;
  background: rgba(212, 165, 116, 0.06);
}

.quick-profile-review-copy > span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
}

.quick-profile-review-copy > strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.quick-profile-review-copy p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.quick-profile-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.stat-row {
  gap: 10px;
}

body[data-page="account"] .stat-card,
body[data-page="account"] .data-card {
  border-radius: 8px;
  background: var(--ux-surface-2);
  box-shadow: none;
}

body[data-page="account"] .stat-card {
  min-height: 132px;
  justify-content: space-between;
  padding: 18px;
}

body[data-page="account"] .stat-value {
  font-family: var(--sans);
  font-size: 1.75rem;
}

body[data-page="account"] .stat-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  line-height: 1.45;
}

body[data-page="account"] .data-card {
  padding: 22px;
}

body[data-page="account"] .data-card h4 {
  font-size: 1rem;
  font-weight: 700;
}

.ux-value-updated {
  animation: ux-value-flash 650ms ease-out;
}

@keyframes ux-value-flash {
  0% { color: var(--gold-soft); }
  100% { color: inherit; }
}

/* Profiles: more readable comparison rather than four dense columns. */
body[data-page="profiles"] .profiles {
  padding: 64px 32px;
}

body[data-page="profiles"] .section-head {
  margin-bottom: 40px;
}

body[data-page="profiles"] .section-head h1 {
  font-size: 42px;
  font-style: normal;
}

body[data-page="profiles"] .section-head h2 {
  font-size: 32px;
  font-style: normal;
}

body[data-page="profiles"] .profile-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body[data-page="profiles"] .profile-detail-card {
  padding: 24px;
}

body[data-page="profiles"] .profile-detail-card h3,
body[data-page="profiles"] .profile-explainer-card strong {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 700;
}

/* Support: more compact hierarchy and stronger primary path. */
body[data-page="support"] .support-page {
  padding-top: 82px;
}

body[data-page="support"] .support-hero {
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

body[data-page="support"] .support-hero h1 {
  font-family: var(--sans);
  font-size: 46px;
  font-style: normal;
  font-weight: 700;
}

body[data-page="support"] .support-search-shell {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0d0f13;
}

body[data-page="support"] .support-search-shell input {
  min-height: 48px;
  border: 0;
  background: transparent;
}

body[data-page="support"] .support-search-shell .btn {
  min-height: 48px;
  border-radius: 0;
}

body[data-page="support"] .support-topic-card {
  min-height: 86px;
}

/* Toasts are used only for completed account actions. */
.ux-toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 600;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.ux-toast {
  padding: 12px 14px;
  border: 1px solid rgba(121, 189, 140, 0.35);
  border-radius: 6px;
  background: #101713;
  color: var(--ink);
  box-shadow: var(--ux-shadow);
  font-size: 0.8rem;
  line-height: 1.45;
  animation: ux-toast-in 220ms var(--ease-out) both;
}

@keyframes ux-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
    gap: 44px;
  }

  .hero-h1 { font-size: 54px; }
  .proof-rail { justify-content: flex-start; overflow-x: auto; }
}

@media (max-width: 899px) {
  .ticker-bar { display: none; }

  .s-hero {
    min-height: auto;
    padding: 54px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .hero-h1 { font-size: 48px; }

  .s { padding: 82px 0; }
  .s-head h2 { font-size: 42px; }

  body[data-page="account"] .acct-sidebar {
    position: sticky;
    top: 62px;
    z-index: 80;
  }

  body[data-page="account"] .account-tabs {
    flex-flow: row nowrap;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  body[data-page="account"] .account-tab {
    flex: 0 0 auto;
    min-height: 42px;
    scroll-snap-align: start;
  }

  body[data-page="account"] .dashboard-content {
    padding: 24px 18px 52px;
  }

  body[data-page="account"] .admin-profile-switcher {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  body[data-page="account"] .admin-profile-switcher-copy p:last-child {
    display: none;
  }

  body[data-page="account"] .admin-profile-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  body[data-page="account"] .admin-profile-tab {
    flex: 0 0 150px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  .quick-controls-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .quick-controls-heading > p { text-align: left; }
}

@media (max-width: 720px) {
  .nav-pill { min-height: 62px; }
  .hero-h1 { font-size: 43px; }
  .hero-lead { font-size: 15px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-trust { grid-template-columns: 1fr; gap: 12px; }
  .trust-item { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
  .hero-stage { display: none; }

  .proof-rail { gap: 20px; padding: 18px 16px; }
  .proof-item { gap: 8px; }
  .proof-divider { display: none; }

  .s { padding: 68px 0; }
  .s-head { margin-bottom: 34px; }
  .s-head h2 { font-size: 36px; }

  #dashboard > .panel-header .panel-header-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-controls { grid-template-columns: 1fr; }
  .quick-profile-review-actions { align-items: stretch; flex-direction: column-reverse; }
  .quick-profile-review-actions .btn { width: 100%; }

  body[data-page="profiles"] .profiles { padding: 48px 16px; }
  body[data-page="profiles"] .section-head h1 { font-size: 34px; }
  body[data-page="profiles"] .section-head h2 { font-size: 28px; }
  body[data-page="profiles"] .profile-detail-grid { grid-template-columns: 1fr; }
  body[data-page="profiles"] .profile-explainer-grid { grid-template-columns: 1fr; }

  body[data-page="support"] .support-page {
    width: min(100% - 24px, 1180px);
    padding-top: 44px;
  }

  body[data-page="support"] .support-hero h1 { font-size: 36px; }
  body[data-page="support"] .support-search-shell { grid-template-columns: 1fr; }
  body[data-page="support"] .support-search-shell .btn { border-radius: 0; }
}

@media (max-width: 480px) {
  body[data-page="account"] .dashboard-content { padding: 20px 12px 44px; }
  body[data-page="account"] .panel-heading { font-size: 26px; }
  body[data-page="account"] .stat-row { grid-template-columns: 1fr 1fr; }
  body[data-page="account"] .stat-card { min-height: 118px; padding: 15px; }
  body[data-page="account"] .stat-card:last-child { grid-column: 1 / -1; }
  body[data-page="account"] .stat-value { font-size: 1.5rem; }
  body[data-page="account"] .data-card { padding: 17px; }
  #dashboard > .panel-header .acct-chip { min-height: 50px; }
  .ux-toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .live-row,
  .hero-flow li,
  .account-panel.is-active,
  .ux-value-updated,
  .ux-toast {
    animation: none !important;
  }
}
