:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #15191f;
  --panel-2: #1c222b;
  --line: #2b3440;
  --text: #eef3f8;
  --muted: #91a1b3;
  --buy: #1aa37a;
  --sell: #d55353;
  --focus: #4aa3ff;
  --warn: #d8a231;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  font-size: 15px;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: var(--text);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 68px;
  padding: 12px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgb(11 13 16 / 92%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 22px;
  font-weight: 750;
}

.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
}

.brand span {
  overflow-wrap: anywhere;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  text-align: center;
  border: 1px solid #36765f;
  border-radius: 6px;
  background: #17664f;
  color: white;
  cursor: pointer;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
}

.button.danger {
  border-color: #6c5268;
  background: #2d2630;
}

.button.ghost {
  border-color: var(--line);
  background: #202833;
}

.dash-actions [hidden] {
  display: none !important;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(20px, 3vw, 36px);
  min-height: calc(100vh - 68px);
  padding: clamp(34px, 5vw, 64px) clamp(18px, 4vw, 48px) 36px;
  align-items: center;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #77c7ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(46px, 6vw, 84px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 34px;
}

h3 {
  font-size: 18px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.terminal-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161d;
  overflow: hidden;
}

.preview-top,
.preview-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-chart {
  display: flex;
  align-items: end;
  gap: 16px;
  height: clamp(240px, 34vh, 360px);
  padding: clamp(16px, 2.4vw, 28px);
  background:
    linear-gradient(#1c2530 1px, transparent 1px) 0 0 / 100% 60px,
    #0a0d11;
}

.preview-chart span {
  flex: 1;
  min-width: 16px;
  border-radius: 5px 5px 0 0;
  background: #1aa37a;
}

.preview-chart span:nth-child(2n) {
  background: #d55353;
}

.preview-stats {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.preview-stats div,
.stat-grid article,
.panel,
.leaderboard-grid article,
.service-grid article,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.preview-stats span,
.stat-grid span,
.panel-head span,
.progress-card span,
.metric-list span,
.leaderboard-grid span,
.service-grid p,
.security-note,
.empty,
small {
  color: var(--muted);
}

.preview-stats div {
  flex: 1;
  padding: 10px;
  background: #0f141b;
}

.preview-stats span,
.preview-stats strong {
  display: block;
}

.section {
  padding: clamp(34px, 5vw, 56px) clamp(18px, 4vw, 48px);
}

.section-head {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-head p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.leaderboard-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.leaderboard-grid article {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.rank {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #223242;
  color: #77c7ff;
  font-weight: 800;
}

.service-grid article {
  padding: 18px;
}

.service-grid p {
  margin-top: 8px;
  line-height: 1.5;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(520px, calc(100vw - 28px));
}

.auth-panel {
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 24px 0;
}

.auth-tabs button,
.panel-head button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202833;
  cursor: pointer;
}

.auth-tabs button.active {
  border-color: #36765f;
  background: #17664f;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form-stage {
  position: relative;
  overflow: hidden;
  transition: height 240ms ease;
}

.auth-form-stage .auth-form {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 240ms ease,
    visibility 0ms linear 240ms;
}

.auth-form-stage[data-auth-mode="create"] #loginForm {
  transform: translateX(-18px);
}

.auth-form-stage .auth-form.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
  transition:
    opacity 180ms ease,
    transform 240ms ease;
}

.auth-form h1 {
  font-size: 34px;
}

.auth-copy {
  margin: -4px 0 2px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-link-button {
  width: fit-content;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #84c5ff;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.auth-link-button:hover {
  color: #b8ddff;
  text-decoration: underline;
}

.auth-form label,
.date-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.remember-row input {
  min-height: 0;
  width: auto;
}

input,
select,
textarea {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
}

textarea {
  min-height: 190px;
  padding: 10px;
  resize: vertical;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--warn);
}

.security-note {
  margin-top: 14px;
  line-height: 1.45;
}

.recovery-upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 12, .72);
}

.recovery-upgrade-dialog {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161d;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.recovery-upgrade-dialog h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.05;
}

.recovery-upgrade-dialog p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.recovery-upgrade-dialog .recovery-upgrade-note {
  color: #b9c7d5;
}

.recovery-upgrade-dialog .button {
  width: 100%;
}

.recovery-upgrade-dialog .auth-link-button {
  margin-top: 10px;
}

.dashboard-shell {
  padding: clamp(12px, 2.4vw, 24px);
}

.profile-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 30px);
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 0 24px;
}

.profile-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.profile-hero p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.profile-status {
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid #315848;
  border-radius: 8px;
  background: #101a17;
}

.profile-status span,
.profile-note {
  color: var(--muted);
}

.profile-status strong {
  color: #83e5be;
  font-size: 24px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: 12px;
}

.profile-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
}

.profile-subscription-panel {
  grid-column: 2;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.profile-form-grid input,
.profile-form-grid select {
  width: 100%;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-note {
  font-size: 13px;
  line-height: 1.5;
}

.profile-actions,
.profile-save-row,
.profile-save-row > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-save-row {
  grid-column: 1 / -1;
  justify-content: space-between;
  padding: 8px 0 24px;
}

.profile-save-row .message {
  margin-top: 0;
}

.admin-shell {
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2.4vw, 28px);
}

.admin-login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
}

.admin-login-panel {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  padding: clamp(20px, 4vw, 32px);
}

.admin-login-panel h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.admin-login-panel p:not(.eyebrow) {
  color: var(--muted);
}

.admin-login-form {
  display: grid;
  gap: 10px;
}

.admin-login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-workspace {
  display: flex;
  flex-direction: column;
}

.admin-workspace[hidden],
.admin-access-panel[hidden] {
  display: none !important;
}

.admin-access-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
}

.admin-access-panel p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.admin-access-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.admin-access-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#adminAccessStatus {
  grid-column: 1 / -1;
}

.admin-title-row { order: 0; }
.admin-stats { order: 1; }
.admin-grid { order: 2; }
.ingest-panel { order: 3; }
.asset-library-panel { order: 4; margin-top: 12px; }
.admin-analytics-panel { order: 5; margin-top: 12px; }

.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 0 24px;
}

.admin-title-row h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.admin-title-row p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.live-status {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11161d;
}

.live-status > span {
  width: 9px;
  height: 9px;
  grid-row: span 2;
  border-radius: 50%;
  background: #56d39f;
}

.live-status small {
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 12px;
  margin-top: 12px;
}

.admin-accounts-panel {
  grid-column: 1 / -1;
}

.admin-filters {
  display: flex;
  gap: 8px;
}

.admin-filters input,
.admin-filters select {
  min-width: 150px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.admin-table td small,
.admin-table td strong {
  display: block;
}

.admin-table td strong.account-user-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-online-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #56d39f;
  box-shadow: 0 0 0 3px rgba(86, 211, 159, .14);
}

.admin-table tr.support-account-active td {
  background: rgba(74, 163, 255, .12);
  border-color: rgba(74, 163, 255, .45);
}

.admin-table tr.support-account-active td:first-child {
  box-shadow: inset 3px 0 0 #4aa3ff;
}

.admin-table tr.support-account-active td small {
  color: #8dc8ff;
  font-weight: 750;
}

.admin-table tr.crm-account-active td {
  background: rgba(86, 211, 159, .1);
  border-color: rgba(86, 211, 159, .38);
}

.admin-table tr[data-account-row] {
  cursor: pointer;
}

.admin-table select {
  min-height: 34px;
}

.admin-crm-panel {
  grid-column: 1 / -1;
}

.account-login-version {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.account-login-version.new {
  border-color: #3b9a70;
  background: rgba(86, 211, 159, .12);
  color: #7ce8bd;
}

.account-login-version.legacy {
  border-color: #d49a3a;
  background: rgba(212, 154, 58, .12);
  color: #ffd892;
}

.crm-toggle {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.crm-toggle:hover { border-color: transparent; }

.crm-toggle-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.crm-chevron {
  display: inline-block;
  color: #79dfba;
  font-size: 1.45rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .25s ease;
}

.crm-toggle[aria-expanded="true"] .crm-chevron { transform: rotate(180deg); }
.crm-content { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s ease, opacity .22s ease; }
.crm-content.expanded { grid-template-rows: 1fr; opacity: 1; }
.crm-content-inner { min-height: 0; overflow: hidden; }

.crm-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #274036;
}

.crm-drawer-head h2 {
  margin: 0;
  font-size: 24px;
}

.crm-customer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-presence-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.crm-presence-dot.online {
  background: #56d39f;
  box-shadow: 0 0 0 4px rgba(86, 211, 159, .14);
}

.crm-presence-dot.offline {
  background: #ec6d76;
  box-shadow: 0 0 0 4px rgba(236, 109, 118, .13);
}

.crm-drawer-head button {
  width: 38px;
  height: 38px;
  border: 1px solid #365448;
  border-radius: 50%;
  background: #17241f;
  color: #fff;
  font-size: 20px;
}

.crm-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 18px;
}

.crm-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 2px;
}

.crm-detail-form label,
.crm-tags-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crm-detail-form input,
.crm-detail-form select,
.crm-detail-form textarea {
  width: 100%;
}

.crm-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.crm-summary-grid div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #293e35;
  border-radius: 8px;
  background: #101a16;
}

.crm-summary-grid span,
.crm-timeline span {
  color: var(--muted);
  font-size: 12px;
}

.crm-tags-field,
.crm-notes-field,
.crm-form-actions {
  grid-column: 1 / -1;
}

.crm-tags-field {
  margin: 0;
  padding: 12px;
  border: 1px solid #293e35;
  border-radius: 8px;
}

.crm-tags-field legend {
  padding: 0 6px;
}

.crm-tags-field div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-tags-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #2c4b40;
  border-radius: 999px;
  background: #111f1a;
  color: #dfeee8;
}

.crm-notes-field textarea {
  min-height: 150px;
  resize: vertical;
}

.crm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-timeline,
.crm-support-history {
  min-height: 180px;
  padding-top: 8px;
  border-top: 1px solid #274036;
}

.crm-side-panels {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.crm-side-panels > section > div {
  max-height: 250px;
  overflow: auto;
}

.crm-timeline h3,
.crm-support-history h3 {
  margin: 0 0 10px;
}

.crm-timeline article {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.crm-timeline p {
  color: var(--muted);
}

.crm-support-ticket {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.crm-support-ticket summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  color: #e9f2ee;
  cursor: pointer;
}

.crm-support-ticket summary small {
  color: var(--muted);
  white-space: nowrap;
}

.crm-support-ticket > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px;
}

.admin-drills-panel {
  display: grid;
  gap: 12px;
}

.admin-drills-panel .panel-head {
  margin: 0;
}

.drill-settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.drill-settings-form label:not(.remember-row) {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.drill-settings-form .remember-row {
  min-height: 40px;
}

.admin-meter-list {
  display: grid;
  gap: 12px;
}

.admin-meter-list > div {
  display: grid;
  grid-template-columns: 46px 1fr 30px;
  align-items: center;
  gap: 8px;
}

.admin-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #222a34;
}

.admin-meter i {
  display: block;
  height: 100%;
  background: #4aa3ff;
}

.admin-analytics-panel {
  grid-column: 1 / -1;
}

.admin-analytics-page .admin-analytics-panel {
  order: unset;
  margin-top: 18px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analytics-kpi-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}

.analytics-kpi-grid span,
.analytics-columns h3,
.analytics-note {
  color: var(--muted);
}

.analytics-kpi-grid span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-kpi-grid strong {
  font-size: 24px;
}

.analytics-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.analytics-columns section {
  min-width: 0;
}

.analytics-columns h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
}

.compact-list {
  gap: 6px;
}

.compact-list div {
  min-width: 0;
}

.compact-list span,
.compact-list strong {
  overflow-wrap: anywhere;
}

.compact-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.analytics-daily {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 92px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.analytics-day {
  display: grid;
  align-content: end;
  gap: 6px;
  min-width: 0;
}

.analytics-day i {
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #45d6a8, #4aa3ff);
}

.analytics-day span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.analytics-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.ingest-panel { margin-bottom: 24px; }
.ingest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  align-items: start;
  gap: 18px;
  margin-bottom: 16px;
}
.ingest-hero h2 { margin-top: 4px; }
.ingest-hero p:not(.eyebrow) { max-width: 760px; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.ingest-status-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid #2f574a;
  border-radius: 8px;
  background: #101a17;
}
.ingest-status-card span,
.ingest-status-card small { color: var(--muted); }
.ingest-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.ingest-flow article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}
.ingest-flow article span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  grid-row: span 2;
  border-radius: 50%;
  background: #1c6b55;
  color: #f4fffb;
  font-weight: 800;
}
.ingest-flow small { color: var(--muted); line-height: 1.35; }
.notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid rgba(245, 190, 99, .35); border-radius: 8px; background: rgba(245, 190, 99, .08); color: #ffd892; line-height: 1.45; }
.mt5-direct-panel { margin-bottom: 22px; padding: 18px; border: 1px solid rgba(69, 214, 168, .32); border-radius: 14px; background: rgba(69, 214, 168, .055); }
.mt5-direct-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.mt5-direct-head h3 { margin: 0 0 5px; }
.mt5-direct-head p { margin: 0; color: var(--muted); }
.mt5-direct-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mt5-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 14px; align-items: end; margin-top: 18px; }
.mt5-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.mt5-form input, .mt5-form select { width: 100%; }
.mt5-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mt5-batch-tools,
.mt5-schedule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.mt5-batch-tools h4 { margin: 0 0 4px; }
.mt5-batch-tools p { margin: 0; color: var(--muted); line-height: 1.4; }
.mt5-schedule-form {
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 170px) auto;
}
.mt5-schedule-form label:not(.remember-row) { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.mt5-schedule-form small { grid-column: 1 / -1; color: var(--muted); }
.ingest-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ingest-divider::before, .ingest-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.ingest-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; }
.ingest-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.ingest-form input, .ingest-form select { width: 100%; }
.ingest-files { grid-column: 1 / 4; }
.ingest-files small { font-weight: 400; line-height: 1.4; }
.contract-files { grid-column: 4 / -1; display: grid; gap: 8px; }
.contract-files label { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; }
.contract-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.contract-files small { color: var(--muted); }
.ingest-progress { margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 10, 18, .45); }
.integrity-head { display: flex; justify-content: space-between; gap: 12px; }
.integrity-track, .mini-integrity { overflow: hidden; height: 12px; margin-top: 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.integrity-track i, .mini-integrity i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #45d6a8, #efbf55); transition: width .35s ease; }
.integrity-visual { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 14px; }
.integrity-visual article, .asset-library-grid article { padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.integrity-visual article > div:first-child, .asset-library-grid article > div { display: flex; justify-content: space-between; gap: 10px; }
.mini-integrity { height: 7px; }
.integrity-visual small, .asset-library-grid small { display: block; margin-top: 8px; color: var(--muted); }
.rollover-note { grid-column: 1 / -1; margin: 0; color: #efbf55; }
.asset-library { margin-top: 25px; }
.asset-library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.asset-card-head { align-items: flex-start; }
.asset-card-head > div { min-width: 0; display: grid; gap: 2px; }
.asset-card-head button { flex: 0 0 auto; }
.asset-library-grid p { margin: 12px 0 0; }
.asset-library-grid span { color: var(--muted); }
.asset-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.asset-card-metrics span {
  padding: 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.local-ingest-header nav .button { min-height: 34px; }
.local-ingest-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 42px; }
.local-access-panel { max-width: 520px; margin: 64px auto 0; }
.local-access-panel h1 { font-size: 42px; line-height: 1; }
.local-access-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-top: 18px; }
.local-access-form label,
.local-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.local-access-form input,
.local-form input,
.local-form select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #111821; color: var(--text); }
.local-ingest-title { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.local-ingest-title h1 { max-width: none; font-size: clamp(34px, 4vw, 54px); line-height: 1; }
.local-toolbar,
.local-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.local-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.local-status-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.local-status-grid span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.local-status-grid strong { display: block; overflow-wrap: anywhere; }
.local-status-grid small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.local-ingest-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.local-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 16px; }
.local-form-actions { grid-column: 1 / -1; }
.local-mt5-inventory-panel { margin-top: 16px; }
.local-mt5-builder { margin-top: 16px; }
.mt5-root-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; margin-top: 12px; }
.mt5-root-row { display: grid; grid-template-columns: minmax(110px, .5fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #101720; }
.mt5-root-row.unconfigured { border-color: #4a5160; background: #11151c; }
.mt5-root-row.configured { border-color: rgb(26 163 122 / 45%); }
.mt5-root-row strong,
.mt5-root-row span,
.mt5-root-row small { display: block; overflow-wrap: anywhere; }
.mt5-root-row span { color: var(--muted); font-size: 12px; }
.mt5-root-row small { margin-top: 3px; color: #c6d2df; font-size: 12px; line-height: 1.35; }
.local-log-panel { margin-top: 16px; }
.local-activity-log { min-height: 170px; max-height: 320px; overflow: auto; margin: 12px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #070a0d; color: #d8e2eb; white-space: pre-wrap; }
.asset-card-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.challenge-data-picker { display: grid; position: relative; flex: 0 1 450px; grid-template-columns: minmax(120px, 1fr) minmax(240px, 1.3fr); gap: 10px; }
.challenge-date-help { grid-column: 1 / -1; max-width: 380px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.button.disabled, .button[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.button.active,
.button[aria-expanded="true"] {
  border-color: #36765f;
  background: #17664f;
  color: #f4fffb;
}

.practice-picker {
  align-items: end;
}

.practice-help {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px 0 24px;
}

.dash-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.dash-hero p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.dash-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.challenge-picker {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
}

.challenge-calendar-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-height: 0;
  width: min(360px, calc(100vw - 32px));
  z-index: 20;
}

.challenge-calendar {
  display: grid;
  position: absolute;
  top: 20px;
  left: 0;
  z-index: 40;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  max-height: 520px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151c;
  box-shadow: 0 18px 48px rgb(0 0 0 / 42%), 0 0 0 1px rgb(255 255 255 / 3%);
  transform-origin: top left;
  transition: width .42s ease, max-height .42s ease, min-height .42s ease, border-radius .42s ease, background .42s ease, transform .42s ease;
}

.challenge-calendar.is-empty {
  width: min(170px, calc(100vw - 32px));
  min-height: 62px;
  align-content: center;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.challenge-calendar.is-collapsed {
  width: 54px;
  max-height: 54px;
  min-height: 54px;
  place-items: center;
  padding: 10px;
  border-radius: 12px;
  background: #10241d;
  transform: scale(.96);
}

.challenge-calendar.is-expanded {
  width: min(360px, calc(100vw - 32px));
  max-height: 520px;
  transform: scale(1);
}

.challenge-calendar.is-collapsed > :not(.challenge-calendar-icon) {
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: scale(.94);
}

.challenge-calendar > :not(.challenge-calendar-icon) {
  transition: opacity .22s ease .16s, transform .22s ease .16s;
}

.challenge-calendar-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.challenge-calendar-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-calendar-head button,
.challenge-calendar-day {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151c24;
  color: var(--text);
  cursor: pointer;
}

.challenge-calendar-head button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.challenge-calendar-head button:disabled,
.challenge-calendar-day:disabled {
  cursor: default;
  opacity: .32;
}

.challenge-selected-date {
  min-height: 18px;
  color: #b9c7d5;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.challenge-calendar-icon {
  display: none;
  width: 30px;
  height: 30px;
  position: relative;
  border: 1px solid #36765f;
  border-radius: 7px;
  background: #122a22;
  box-shadow: inset 0 7px 0 #17664f;
}

.challenge-calendar-icon::before,
.challenge-calendar-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #9ff0ca;
}

.challenge-calendar-icon::before {
  left: 8px;
}

.challenge-calendar-icon::after {
  right: 8px;
}

.challenge-calendar-icon span,
.challenge-calendar-icon i {
  position: absolute;
  left: 7px;
  right: 7px;
  height: 2px;
  border-radius: 999px;
  background: #9db2c4;
}

.challenge-calendar-icon span {
  top: 17px;
}

.challenge-calendar-icon i {
  top: 23px;
}

.challenge-calendar.is-empty .challenge-calendar-icon,
.challenge-calendar.is-collapsed .challenge-calendar-icon,
.challenge-calendar.is-expanding .challenge-calendar-icon {
  display: block;
}

.challenge-calendar.is-expanded:not(.is-expanding) .challenge-calendar-icon {
  display: none;
}

.challenge-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.challenge-calendar-weekday {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.challenge-calendar-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 32px;
  padding: 0;
  font-size: 12px;
}

.challenge-calendar-day:hover:not(:disabled),
.challenge-calendar-head button:hover:not(:disabled) {
  border-color: #4b6175;
  background: #1a2430;
}

.challenge-calendar-day.eligible {
  border-color: #36765f;
  background: #10241d;
}

.challenge-calendar-day.selected {
  border-color: #4aa3ff;
  background: #13273b;
  box-shadow: inset 0 0 0 1px #4aa3ff;
}

.challenge-calendar-day.muted {
  opacity: .45;
}

.challenge-calendar-empty {
  min-height: 44px;
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .challenge-calendar,
  .challenge-calendar > :not(.challenge-calendar-icon) {
    transition: none;
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-grid article {
  padding: 14px;
}

.stat-grid article:not(.market-experience-card) {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 74px;
}

.stat-grid span,
.stat-grid strong {
  display: block;
}

.stat-grid article:not(.market-experience-card) span {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.stat-grid strong {
  margin-top: 6px;
  font-size: 22px;
}

.stat-grid article:not(.market-experience-card) strong {
  margin-top: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.05;
}

.market-experience-card {
  display: grid;
  min-width: 0;
  grid-column: span 2;
}

.market-experience-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-experience-head span {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.market-experience-head button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #345b4c;
  border-radius: 999px;
  background: #12251e;
  color: #77ddb5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.market-experience-head button:hover {
  border-color: #62d9a4;
  color: #eafff5;
}

.market-milestone-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.market-milestone-row small {
  font-size: 11px;
}

.market-experience-progress {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #222a34;
}

.market-experience-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35a97f, #6ce4b6);
  box-shadow: 0 0 16px rgba(86, 211, 159, .34);
  transition: width .35s ease;
}

.market-milestone-stages {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}

.market-milestone-stages span {
  min-width: 0;
  padding: 4px 3px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: #10151c;
  color: #81909d;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.market-milestone-stages span.reached {
  border-color: rgba(86, 211, 159, .42);
  background: #122c23;
  color: #7ce8bd;
}

.market-milestone-stages span.active {
  border-color: rgba(244, 201, 107, .55);
  color: #f4c96b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) repeat(2, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.education-panel { margin-top: 22px; }
.head2head-panel { margin-top: 22px; padding: 14px; border-color: rgba(69, 214, 168, .34); background: linear-gradient(135deg, rgba(28, 83, 64, .28), rgba(18, 25, 32, .94)); }
.head2head-panel > .panel-head { margin-bottom: 10px; }
.head2head-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.head2head-form { display: grid; align-content: start; gap: 8px; }
.head2head-form label { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.head2head-form select { width: 100%; }
.head2head-form small { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.head2head-session-buttons { display: grid; grid-template-columns: 1fr; gap: 6px; }
.head2head-session-buttons button { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #3f5f83; border-radius: 8px; background: #13243b; color: #9bc9ff; text-align: left; cursor: pointer; }
.head2head-session-buttons button:hover:not(:disabled), .head2head-session-buttons button.active { border-color: #6fa9eb; background: #1b3c66; color: #fff; }
.head2head-session-buttons button:disabled { cursor: not-allowed; opacity: .45; }
.head2head-session-buttons strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.head2head-session-buttons span { color: rgba(155,201,255,.76); font-size: .68rem; white-space: nowrap; }
.head2head-board { min-width: 0; padding: 9px; border: 1px solid rgba(69, 214, 168, .22); border-radius: 8px; background: rgba(7, 13, 20, .42); }
.mini-head { margin-bottom: 7px; }
.mini-head h3 { margin: 0; font-size: .92rem; }
.mini-head span { font-size: .72rem; }
.head2head-leaderboard { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 10px; align-items: start; }
.head2head-leaderboard-group { display: grid; min-width: 0; gap: 5px; padding: 0 8px 0 0; border-right: 1px solid rgba(255,255,255,.08); }
.head2head-leaderboard-group:last-child { padding-right: 0; border-right: 0; }
.head2head-leaderboard-group h4 { margin: 0 0 1px; color: #79dfba; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.head2head-rank { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 6px; border: 1px solid rgba(255,255,255,.07); border-radius: 6px; background: rgba(8, 14, 22, .5); }
.head2head-rank > strong { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(69, 214, 168, .14); color: #9df3ce; font-size: .68rem; }
.head2head-rank span { display: grid; min-width: 0; font-size: .76rem; font-weight: 750; line-height: 1.15; }
.head2head-rank small { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.head2head-rank em { font-size: .76rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.education-toggle { width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.education-toggle:hover { border-color: transparent; }
.education-toggle-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.education-chevron { display: inline-block; color: #79dfba; font-size: 1.45rem; line-height: 1; transform: rotate(0deg); transition: transform .25s ease; }
.education-toggle[aria-expanded="true"] .education-chevron { transform: rotate(180deg); }
.education-content { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s ease, opacity .22s ease; }
.education-content.expanded { grid-template-rows: 1fr; opacity: 1; }
.education-content-inner { min-height: 0; overflow: hidden; }
.education-intro { color: var(--muted); margin: 14px 0 18px; max-width: 760px; }
.drill-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.drill-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: rgba(8, 14, 22, .55); }
.drill-card h3, .drill-card p { margin: 0; }
.drill-card p { color: var(--muted); font-size: .88rem; line-height: 1.45; min-height: 42px; margin-top: 8px; }
.drill-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drill-best { color: #f4c96b; font-size: .72rem; white-space: nowrap; }
.drill-launches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.drill-launch { border-radius: 8px; padding: 9px 10px; display: flex; justify-content: space-between; text-transform: capitalize; }
.drill-launch.bullish { border-color: rgba(37, 211, 145, .4); color: #7ce8bd; }
.drill-launch.bearish { border-color: rgba(255, 100, 116, .4); color: #ff9aa5; }
.drill-launch strong { color: inherit; }

.drill-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(2, 7, 12, .88); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(5px); }
.drill-overlay[hidden], .drill-hud[hidden] { display: none; }
.drill-dialog { width: min(600px, 100%); border: 1px solid #263849; border-radius: 16px; background: #101821; padding: 28px; box-shadow: 0 28px 80px rgba(0,0,0,.55); }
.drill-dialog h2 { font-size: 1.7rem; margin: 4px 0 10px; }
.drill-dialog ol { color: #d6e0e9; line-height: 1.55; padding-left: 22px; }
.drill-dialog li + li { margin-top: 8px; }
.drill-objective { color: #79dfba; font-weight: 700; }
.drill-note { color: var(--muted); font-size: .82rem; }
.drill-tags { display: flex; gap: 8px; }
.drill-tags span { border: 1px solid #31485d; border-radius: 999px; padding: 4px 9px; color: #a8bed0; font-size: .75rem; text-transform: capitalize; }
.drill-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.drill-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.drill-grade { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; background: #183c31; color: #69e4b5; font-size: 2.5rem; font-weight: 900; float: right; }
.drill-breakdown { display: grid; gap: 8px; clear: both; padding-top: 14px; }
.drill-breakdown div { display: flex; justify-content: space-between; border-bottom: 1px solid #24313c; padding: 8px 0; }
.head2head-result-dialog { width: min(440px, 100%); display: grid; justify-items: center; gap: 12px; border-color: #2e6b83; text-align: center; }
.head2head-result-dialog h2 { margin: 0; }
.head2head-result-dialog p:not(.eyebrow) { margin: 0; color: #d6e0e9; font-size: 1rem; line-height: 1.45; }
.head2head-result-dialog button { margin-top: 4px; min-width: 190px; min-height: 38px; border: 1px solid #2e6b83; border-radius: 6px; background: #10445c; color: #eef3f8; cursor: pointer; }
.head2head-result-mark { display: grid; place-items: center; width: 74px; height: 74px; border: 1px solid rgba(98, 217, 255, .45); border-radius: 50%; background: rgba(13, 82, 103, .72); color: #e9fbff; font-size: .95rem; font-weight: 900; letter-spacing: .08em; box-shadow: 0 0 0 8px rgba(98, 217, 255, .07); }
.head2head-result-overlay.success .head2head-result-dialog { border-color: rgba(86, 211, 159, .58); }
.head2head-result-overlay.success .head2head-result-mark { border-color: rgba(86, 211, 159, .55); background: rgba(24, 91, 68, .82); color: #eafff5; box-shadow: 0 0 0 8px rgba(86, 211, 159, .08); }
.head2head-result-overlay.success .head2head-result-dialog button { border-color: #2e6f56; background: #185b44; }
.market-milestone-dialog { background: #101821; }
.market-milestone-mark { color: #eafff5; }
.market-milestone-quote {
  max-width: 340px;
  padding-top: 4px;
  color: #9df3ce !important;
  font-weight: 700;
}

.lifetime-stats-view .dash-hero,
.lifetime-stats-view .stat-grid,
.lifetime-stats-view .head2head-panel,
.lifetime-stats-view .education-panel,
.lifetime-stats-view .session-review-panel,
.lifetime-stats-view .dashboard-grid,
.lifetime-stats-view .diary-calendar-panel {
  display: none;
}

.lifetime-stats-page {
  display: grid;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.lifetime-stats-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.lifetime-stats-title h1 {
  max-width: none;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1;
}

.lifetime-stats-title p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.45;
}

.lifetime-stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 14px;
}

.lifetime-stats-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.lifetime-experience-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(69, 214, 168, .32);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(16, 29, 25, .96), rgba(14, 19, 25, .96));
}

.lifetime-experience-panel > span {
  color: #a8c8bc;
  font-size: 12px;
  font-weight: 800;
}

.lifetime-experience-panel > strong {
  overflow-wrap: anywhere;
  font-size: 30px;
  line-height: 1;
}

.lifetime-experience-notes {
  display: grid;
  gap: 0;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.lifetime-experience-notes div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lifetime-experience-notes span,
.lifetime-metric-list span {
  min-width: 0;
}

.lifetime-experience-notes span {
  color: var(--muted);
  font-size: 12px;
}

.lifetime-experience-notes strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.lifetime-metric-list div {
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 8px;
}

.lifetime-stats-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151c;
}

.lifetime-stats-dialog {
  width: min(860px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  overflow: auto;
  border-radius: 10px;
}

.lifetime-stats-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.lifetime-stats-head button {
  flex: 0 0 auto;
}

.lifetime-stats-body {
  display: grid;
  gap: 18px;
}

.lifetime-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lifetime-stats-summary article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151c;
}

.lifetime-stats-summary span,
.lifetime-stats-section h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lifetime-stats-summary strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.05;
}

.lifetime-stats-section {
  display: grid;
  gap: 10px;
}

.lifetime-stats-section h3 {
  margin: 0;
  text-transform: uppercase;
}
.drill-hud { position: fixed; z-index: 100; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 24px; background: rgba(12, 24, 33, .96); border: 1px solid #2e5549; border-radius: 10px; padding: 7px 10px 7px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.drill-hud div { display: grid; }
.drill-hud span { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.drill-hud strong { font-size: .82rem; white-space: nowrap; }

@media (max-width: 900px) {
  .head2head-layout, .drill-catalog, .lifetime-stats-layout { grid-template-columns: 1fr; }
  .head2head-leaderboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head2head-leaderboard-group:nth-child(2n) { padding-right: 0; border-right: 0; }
  .drill-hud { top: auto; bottom: 8px; width: calc(100% - 16px); justify-content: space-between; }
  .market-experience-card { grid-column: auto; }
  .lifetime-experience-panel { position: static; }
}

.equity-panel,
.diary-calendar-panel {
  margin-top: 12px;
}

.dashboard-equity {
  grid-column: 1 / -1;
  margin-top: 0;
}

.session-review-panel {
  margin-top: 12px;
  border-color: #36765f;
  background: #111d19;
}

.session-review-panel[hidden] {
  display: none;
}

.session-review-form {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) repeat(3, minmax(170px, 0.7fr)) minmax(260px, 1.4fr) auto;
  align-items: end;
  gap: 10px;
}

.session-review-form label:not(.review-check) {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.review-check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.review-check input {
  min-height: 0;
  width: auto;
}

.session-review-form textarea {
  min-height: 78px;
}

.equity-curve {
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0d11;
}

.equity-curve svg {
  display: block;
  width: 100%;
  height: 720px;
}

.equity-grid-line {
  stroke: #202a36;
  stroke-width: 1;
}

.equity-axis-line,
.equity-axis-tick {
  stroke: #526071;
  stroke-width: 1.5;
}

.equity-start-line {
  stroke: #526071;
  stroke-width: 1.5;
  stroke-dasharray: 7 6;
}

.equity-axis-value {
  fill: #91a0b2;
  font-size: 13px;
}

.equity-axis-title {
  fill: #c5d0dc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.equity-point {
  fill: #0a0d11;
  stroke: #56d39f;
  stroke-width: 3;
}

.panel {
  padding: 14px;
}

.wide-panel {
  grid-row: span 2;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-list,
.metric-list,
.progress-card,
.badge-list {
  display: grid;
  gap: 8px;
}

.session-row,
.leader-row,
.metric-list div,
.progress-card div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10151c;
  text-align: left;
}

.session-row {
  cursor: pointer;
}

.session-entry { display: grid; gap: 0; }
.session-row-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.session-row-actions { display: flex; align-items: stretch; gap: 8px; }
.session-reflection-toggle,
.session-coach-submit { min-width: 110px; border: 1px solid #345b4c; border-radius: 8px; background: #12251e; color: #77ddb5; }
.session-coach-submit { border-color: #3f5f83; background: #13243b; color: #9bc9ff; }
.session-coach-submit:hover:not(:disabled) { border-color: #6fa9eb; background: #1b3c66; color: #fff; }
.session-coach-submit:disabled { cursor: not-allowed; opacity: .55; }
.session-reflection-toggle[aria-expanded="true"] { background: #1b4b3a; color: #fff; }
.session-reflection-box { max-height: 0; opacity: 0; overflow: hidden; margin: 0 8px; padding: 0 14px; border: 0 solid #2f4b40; border-radius: 0 0 10px 10px; background: #101a17; transition: max-height .32s ease, opacity .2s ease, padding .28s ease, border-width .28s ease; }
.session-reflection-box.expanded { max-height: 520px; opacity: 1; padding: 14px; border-width: 0 1px 1px; }
.session-reflection-box p { margin: 5px 0 12px; color: #c6d4cd; white-space: pre-wrap; }

.support-icon { display: inline-flex; align-items: center; min-height: 36px; border: 1px solid #346653; border-radius: 8px; background: #17372c; color: #83e5be; padding: 8px 12px; }
.support-icon.support-unread { animation: support-reply-alert 2s steps(1, end) infinite; color: #fff; }
@keyframes support-reply-alert {
  0%, 49.999% { border-color: #42e09d; background: #13704d; box-shadow: 0 0 0 2px rgba(66,224,157,.18), 0 0 18px rgba(66,224,157,.48); }
  50%, 100% { border-color: #ff6b73; background: #a92f39; box-shadow: 0 0 0 2px rgba(255,107,115,.18), 0 0 18px rgba(255,107,115,.48); }
}
@media (prefers-reduced-motion: reduce) {
  .support-icon.support-unread { animation: none; border-color: #ff6b73; background: #a92f39; }
}
.support-panel,
.coach-history-panel { position: fixed; z-index: 120; top: 0; right: 0; display: flex; flex-direction: column; width: min(420px, 100%); height: 100dvh; padding: 18px; border-left: 1px solid #315244; background: #0e1714; box-shadow: -20px 0 60px rgba(0,0,0,.45); transform: translateX(0); transition: transform .25s ease; }
.coach-history-panel { width: min(680px, 100%); background: #0d141c; border-left-color: #2d4f76; }
.support-panel[aria-hidden="true"],
.coach-history-panel[aria-hidden="true"] { transform: translateX(105%); pointer-events: none; }
.support-panel-head { display: flex; align-items: center; justify-content: space-between; }
.support-panel-head button { width: 38px; height: 38px; border: 1px solid #365448; border-radius: 50%; background: #17241f; color: #fff; font-size: 23px; }
.support-intro { color: #8fa59b; }
.coach-history-list { display: grid; gap: 14px; min-height: 160px; overflow: auto; padding: 12px 4px 28px; }
.coach-review-card { display: grid; gap: 12px; padding: 14px; border: 1px solid #30455f; border-radius: 8px; background: #111a26; }
.coach-review-card section { display: grid; gap: 8px; }
.coach-review-card h3 { font-size: 1.05rem; }
.coach-review-card h4 { color: #b9d7ff; font-size: .82rem; text-transform: uppercase; }
.coach-review-card p { margin: 0; color: #dce8f5; line-height: 1.45; }
.coach-review-card ul { margin: 0; padding-left: 18px; color: #dce8f5; }
.coach-bullet-summary { display: grid; gap: 6px; }
.coach-conclusion strong { color: #b9d7ff; margin-right: 4px; }
.coach-review-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.coach-review-head small,
.coach-disclaimer,
.coach-mini-card small,
.coach-trade-list small { color: #93a9bd; }
.coach-headline { color: #ffffff !important; font-weight: 700; }
.coach-score { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid #4b6687; border-radius: 50%; background: #0e223b; color: #b9d7ff; font-size: 1.25rem; }
.coach-score.excellent { border-color: #49d392; color: #9df1c5; }
.coach-score.solid { border-color: #5fb4f5; color: #b9e1ff; }
.coach-score.mixed { border-color: #d8b455; color: #ffe4a3; }
.coach-score.poor { border-color: #d85b63; color: #ffb4ba; }
.coach-mini-card,
.coach-trade-list div { display: grid; gap: 5px; padding: 10px; border: 1px solid #2c4058; border-radius: 7px; background: #0e1722; }
.coach-mini-card.major { border-color: #75404a; background: #25161c; }
.coach-mini-card.drill { border-color: #35634e; background: #111f19; }
.coach-trade-list { display: grid; gap: 8px; }
.coach-trade-list div { grid-template-columns: auto auto; align-items: start; }
.coach-trade-list p,
.coach-trade-list small { grid-column: 1 / -1; }
.coach-trade-list span { justify-self: end; color: #b9d7ff; font-weight: 700; }
.support-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 160px; overflow: auto; padding: 14px 4px; }
.support-message { align-self: flex-start; max-width: 88%; padding: 10px 12px; border: 1px solid #30493f; border-radius: 12px 12px 12px 3px; background: #17231f; }
.support-message.user { align-self: flex-end; border-color: #2f6f58; border-radius: 12px 12px 3px 12px; background: #174534; }
.support-message p { margin: 4px 0; white-space: pre-wrap; }
.support-message small { color: #83968e; }
.support-form { display: grid; gap: 8px; }
.support-form textarea { min-height: 82px; resize: vertical; }
.support-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-support-panel { grid-column: 1 / -1; }
.support-admin-head { align-items: flex-start; }
.support-alert-controls { display: grid; justify-items: end; gap: 6px; min-width: min(220px, 100%); }
.support-alert-controls button { min-width: 126px; }
.support-alert-controls small { max-width: 220px; color: var(--muted); font-size: .72rem; line-height: 1.3; text-align: right; }
.support-alert-controls.alerts-on small { color: #7ce8bd; }
.support-alert-controls.alerts-limited small { color: #ffd892; }
.admin-support-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(320px, 1.3fr); gap: 14px; min-height: 380px; }
.support-thread-list { display: grid; align-content: start; gap: 7px; max-height: 520px; overflow: auto; }
.support-thread { display: grid; gap: 3px; padding: 10px; border: 1px solid #2b4138; border-radius: 8px; background: #111b17; color: #e9f2ee; text-align: left; }
.support-thread.unread { border-color: #d85b63; background: #3a171b; }
.support-thread.open { border-color: #d49a3a; background: #352712; }
.support-thread.complete { border-color: #3b9a70; background: #153326; }
.support-thread.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.16); }
.support-thread small, .support-thread span { overflow: hidden; color: #8da098; text-overflow: ellipsis; white-space: nowrap; }
.support-thread em { margin-top: 4px; color: #95a69f; font-size: .72rem; font-style: normal; font-weight: 750; text-transform: uppercase; }
.support-thread.unread em { color: #ff8d94; }
.support-thread.open em { color: #f4c96b; }
.support-thread.complete em { color: #69dda9; }
.support-conversation { display: flex; flex-direction: column; min-height: 0; padding: 12px; border: 1px solid #293e35; border-radius: 10px; background: #0d1512; }
.support-conversation-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.support-status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border: 1px solid #365448; border-radius: 999px; font-size: .72rem; font-style: normal; text-transform: uppercase; }
.support-status-pill.unread { border-color: #d85b63; color: #ff9aa5; }
.support-status-pill.open { border-color: #d49a3a; color: #f4c96b; }
.support-status-pill.complete { border-color: #3b9a70; color: #69dda9; }

@media (max-width: 760px) {
  .support-admin-head { align-items: stretch; }
  .support-alert-controls { justify-items: start; }
  .support-alert-controls small { text-align: left; }
  .session-row-wrap, .admin-support-layout { grid-template-columns: 1fr; }
}

.leader-row {
  grid-template-columns: 30px 1fr auto;
}

.leader-row em {
  color: #77c7ff;
  font-style: normal;
}

.badge-list span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #36765f;
  border-radius: 999px;
  background: #10241d;
  color: #9ff0ca;
  font-weight: 650;
}

.review-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.diary-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.diary-calendar-frame {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10151c;
}

.diary-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.diary-panel .date-label,
.diary-panel input,
.diary-panel textarea {
  width: 100%;
  min-width: 0;
}

.diary-panel textarea {
  min-height: 260px;
  margin-top: 12px;
}

.diary-panel > small {
  margin-top: 8px;
}

.diary-calendar-frame {
  overflow-x: auto;
}

.calendar-weekday {
  padding: 2px 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 112px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10151c;
  color: var(--text);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  border-color: #4b6175;
  background: #151c24;
}

.calendar-day.selected {
  border-color: #4aa3ff;
  box-shadow: inset 0 0 0 1px #4aa3ff;
}

.calendar-day.has-diary {
  background: #111d19;
}

.calendar-day.muted {
  opacity: 0.38;
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

.calendar-day-head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56d39f;
  box-shadow: 0 0 0 3px rgb(86 211 159 / 12%);
}

.calendar-day span {
  margin-top: 8px;
  font-size: 13px;
}

.calendar-day .calendar-day-head {
  margin-top: 0;
}

.calendar-day small {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: #c7d1dc;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.calendar-day .calendar-empty-note {
  color: #647282;
}

.positive {
  color: #56d39f;
}

.negative {
  color: #ff8b8b;
}

/* Challenge Journey */
.nav-active { color: #eef3f8; }
.journey-shell { max-width: 1500px; margin: 0 auto; padding: clamp(14px, 2.4vw, 30px); }
.journey-hero { position: relative; display: flex; align-items: end; justify-content: space-between; gap: 24px; min-height: 220px; overflow: hidden; padding: clamp(26px, 4vw, 48px); border: 1px solid #315848; border-radius: 18px; background: radial-gradient(circle at 84% 12%, rgba(86,211,159,.22), transparent 32%), linear-gradient(135deg, #12241d, #111821 62%, #161922); }
.journey-hero::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 380px; height: 260px; border: 1px solid rgba(86,211,159,.18); border-radius: 50%; transform: rotate(-12deg); }
.journey-hero > * { position: relative; z-index: 1; }
.journey-hero h1 { max-width: 900px; font-size: clamp(42px, 6vw, 68px); line-height: 1; }
.journey-hero p:not(.eyebrow) { max-width: 760px; margin-top: 18px; color: #b7c5d2; font-size: clamp(16px, 1.5vw, 21px); line-height: 1.55; }
.journey-privacy { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 16px; border: 1px solid #28473c; border-radius: 10px; background: #0f1b17; }
.journey-privacy > span { color: #56d39f; }
.journey-privacy div { display: grid; gap: 2px; }
.journey-privacy small { line-height: 1.45; }
.journey-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.journey-stat-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, #151b22, #11151b); }
.journey-stat-grid span, .journey-stat-grid strong { display: block; }
.journey-stat-grid span { color: var(--muted); font-size: 12px; }
.journey-stat-grid strong { margin-top: 7px; overflow: hidden; font-size: clamp(18px, 2vw, 26px); text-overflow: ellipsis; }
.journey-layout { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.journey-sidebar { display: grid; gap: 14px; position: sticky; top: 12px; }
.journey-list-panel h2, .challenge-editor h2 { font-size: 23px; }
.journey-list { display: grid; gap: 8px; }
.journey-list-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #10151c; text-align: left; cursor: pointer; }
.journey-list-card:hover, .journey-list-card.active { border-color: #45846e; background: #12221d; }
.journey-list-card span, .journey-list-card strong, .journey-list-card small { display: block; min-width: 0; }
.journey-list-card small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey-list-card i { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #52606c; }
.journey-list-card.active i { background: #56d39f; box-shadow: 0 0 0 4px rgba(86,211,159,.1); }
.journey-list-card .journey-list-note { grid-column: 1 / -1; margin-top: 5px; color: #81909d; font-size: 11px; }
.challenge-editor[hidden], #journeyContent[hidden], .journey-empty[hidden] { display: none !important; }
.journey-form, .day-form { display: grid; gap: 12px; }
.journey-form label, .day-form label { display: grid; gap: 7px; color: #aebbc7; font-size: 13px; font-weight: 700; line-height: 1.35; }
.journey-form input, .journey-form select, .journey-form textarea, .day-form input, .day-form select, .day-form textarea { width: 100%; }
.journey-form textarea { min-height: 115px; }
.journey-form-row, .journey-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.journey-rule-grid { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #10151c; }
.journey-form-note { color: #8191a2; font-size: 11px; line-height: 1.45; }
.journey-main { min-width: 0; }
.journey-empty { display: grid; place-items: start; min-height: 340px; padding: clamp(30px, 7vw, 90px); background: radial-gradient(circle at 80% 20%, rgba(74,163,255,.1), transparent 35%), var(--panel); }
.journey-empty h2 { font-size: clamp(28px, 4vw, 48px); }
.journey-empty p:not(.eyebrow) { max-width: 650px; margin: 12px 0 22px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.journey-empty.compact { min-height: 0; padding: 28px; }
.journey-overview { overflow: hidden; padding: clamp(18px, 2.5vw, 28px); background: linear-gradient(140deg, #151c22, #111812); }
.journey-overview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.journey-overview-head h2 { font-size: clamp(28px, 4vw, 48px); }
.journey-overview-head p:not(.eyebrow) { margin-top: 8px; color: var(--muted); }
.journey-overview-actions { display: flex; align-items: center; gap: 8px; }
.journey-overview-actions button, .timeline-card button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #202833; color: var(--text); cursor: pointer; }
.journey-status { padding: 7px 10px; border-radius: 999px; background: #25303b; color: #c7d2dc; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.journey-status[data-status="active"], .journey-status[data-status="passed"] { background: #173a2f; color: #76e6b9; }
.journey-status[data-status="failed"] { background: #3b2024; color: #ff9ba4; }
.journey-progress { margin-top: 24px; padding: 16px; border: 1px solid #2a4e41; border-radius: 10px; background: rgba(9,19,15,.7); }
.journey-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.journey-progress span, .journey-progress small { color: var(--muted); }
.journey-progress-track { height: 11px; margin: 12px 0 8px; overflow: hidden; border-radius: 999px; background: #26312d; }
.journey-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #35a97f, #6ce4b6); }
.journey-rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.journey-rules div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #10151c; }
.journey-rules span, .journey-rules strong { display: block; }
.journey-rules span { color: var(--muted); font-size: 11px; }
.journey-rules strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; }
#journeyIntent { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 14px 0 0; overflow: hidden; border: 1px solid #315848; border-radius: 10px; background: #315848; color: #d4ded9; }
#journeyIntent[hidden] { display: none; }
#journeyIntent div { padding: 16px 18px; background: #101a17; }
#journeyIntent span { display: block; margin-bottom: 7px; color: #68d9ad; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#journeyIntent p { font-size: 14px; line-height: 1.65; }
.journey-achievements { margin-top: 18px; }
.journey-achievements > span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.journey-achievements > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.journey-achievements strong { padding: 7px 10px; border: 1px solid #6d5830; border-radius: 999px; background: #292214; color: #f0cd7b; font-size: 12px; }
.journey-insights { margin-top: 14px; padding: clamp(20px, 2.5vw, 30px); border-color: #334c61; background: linear-gradient(140deg, #131b23, #11161b); }
.journey-reading { max-width: 850px; margin-top: 14px; color: #d7e0e7; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.6; }
.meaning-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.meaning-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #10151b; }
.meaning-grid span { color: #77c7ff; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.meaning-grid strong { display: block; margin-top: 8px; font-size: clamp(18px, 2vw, 24px); }
.meaning-grid p { margin-top: 8px; color: #aebbc7; font-size: 13px; line-height: 1.55; }
.daily-checkin-panel { margin-top: 14px; padding: clamp(18px, 2.5vw, 28px); }
.daily-checkin-panel h2, .journey-timeline-section h2 { font-size: clamp(25px, 3vw, 36px); }
.checkin-intro { max-width: 760px; margin: 7px 0 20px; color: #9facb8; font-size: 14px; line-height: 1.6; }
.day-form-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.day-title-field { grid-column: span 2; }
.journey-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #10151c; }
.journey-sliders label { grid-template-columns: 1fr auto; align-items: center; }
.journey-sliders input { grid-column: 1 / -1; min-height: 24px; padding: 0; }
.journey-sliders output { color: #56d39f; font-size: 15px; }
.optional-day-stats { border: 1px solid var(--line); border-radius: 8px; background: #10151c; }
.optional-day-stats summary { padding: 11px 12px; color: #b7c5d2; font-size: 12px; font-weight: 750; cursor: pointer; }
.optional-day-stats[open] summary { border-bottom: 1px solid var(--line); }
.optional-day-stats .day-form-grid { padding: 12px; }
.day-boundary-note { line-height: 1.5; }
.day-writing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.day-writing-grid textarea { min-height: 138px; line-height: 1.55; }
.day-writing-grid .writing-wide { grid-column: 1 / -1; }
.day-writing-grid .writing-wide textarea { min-height: 160px; }
.journey-timeline-section { margin-top: 22px; }
.journey-timeline { display: grid; }
.timeline-entry { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; position: relative; }
.timeline-entry:not(:last-child)::before { content: ""; position: absolute; top: 42px; bottom: -4px; left: 24px; width: 1px; background: #355246; }
.timeline-marker { position: relative; z-index: 1; display: grid; place-items: start center; padding-top: 12px; }
.timeline-marker span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #4a806c; border-radius: 50%; background: #10231c; color: #76e6b9; font-size: 12px; font-weight: 850; }
.timeline-card { margin-bottom: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, #151a20, #11151a); }
.timeline-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.timeline-card time { color: #77c7ff; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.timeline-card h3 { margin-top: 5px; }
.timeline-card-head > strong { font-size: 22px; white-space: nowrap; }
.timeline-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.timeline-metrics span, .timeline-tags { padding: 5px 8px; border-radius: 999px; background: #202833; color: #b7c4d0; font-size: 11px; }
.timeline-card > p:not(.timeline-tags) { max-width: 860px; margin-top: 14px; color: #d0d8df; font-size: 15px; line-height: 1.7; }
.timeline-tags { display: inline-block; margin-top: 10px; background: #182b24; color: #7fdcb9; }
.timeline-decision, .timeline-hard, .timeline-pattern, .timeline-lesson, .timeline-focus { display: grid; gap: 5px; margin-top: 10px; padding: 12px 14px; border-left: 3px solid #56d39f; background: #14251f; line-height: 1.55; }
.timeline-hard { border-left-color: #ec6d76; background: #28181b; }
.timeline-pattern { border-left-color: #a989dc; background: #211a2b; }
.timeline-lesson { border-left-color: #d8a231; background: #251f13; }
.timeline-focus { border-left-color: #4aa3ff; background: #121f2c; }
.timeline-decision span, .timeline-hard span, .timeline-pattern span, .timeline-lesson span, .timeline-focus span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.timeline-card button { margin-top: 12px; }

@media (max-width: 1250px) {
  .journey-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journey-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-title-field { grid-column: span 2; }
}

@media (max-width: 900px) {
  .journey-layout { grid-template-columns: 1fr; }
  .journey-sidebar { position: static; }
  .journey-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-hero { align-items: flex-start; flex-direction: column; }
  .day-writing-grid { grid-template-columns: 1fr; }
  .day-writing-grid .writing-wide { grid-column: auto; }
  #journeyIntent, .meaning-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .journey-shell { padding: 10px; }
  .journey-hero { min-height: 0; padding: 28px 20px; }
  .journey-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-list { grid-template-columns: 1fr; }
  .journey-overview-head, .journey-overview-actions, .timeline-card-head { align-items: flex-start; flex-direction: column; }
  .journey-rules, .day-form-grid, .journey-sliders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-form-row, .journey-rule-grid { grid-template-columns: 1fr; }
  .timeline-entry { grid-template-columns: 38px minmax(0, 1fr); gap: 7px; }
  .timeline-entry:not(:last-child)::before { left: 18px; }
  .timeline-marker span { width: 30px; height: 30px; }
  .timeline-card { padding: 14px; }
}

@media (max-width: 430px) {
  .journey-stat-grid, .journey-rules, .day-form-grid, .journey-sliders { grid-template-columns: 1fr; }
  .journey-hero h1 { font-size: 42px; }
  .journey-privacy { align-items: flex-start; }
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .terminal-preview {
    max-width: 820px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-subscription-panel {
    grid-column: auto;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .analytics-columns,
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-access-panel,
  .admin-access-form,
  .crm-detail-form,
  .crm-summary-grid {
    grid-template-columns: 1fr;
  }

  .crm-detail-layout {
    grid-template-columns: 1fr;
  }

  .admin-accounts-panel {
    grid-row: auto;
  }

  .wide-panel {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .leaderboard-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-review-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-reflection {
    grid-column: 1 / -1;
  }

  .site-header,
  .dash-hero,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dash-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  nav,
  .hero-actions,
  .dash-actions {
    width: 100%;
  }

  nav {
    gap: 12px;
  }

  .button {
    min-height: 38px;
    padding: 0 12px;
  }

  h1 {
    font-size: clamp(36px, 12vw, 52px);
    line-height: 1;
  }

  .brand {
    font-size: 20px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  h2 {
    font-size: 26px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-actions,
  .dash-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-top,
  .preview-stats,
  .leaderboard-grid article {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-stats {
    display: grid;
    grid-template-columns: 1fr;
  }

  .leaderboard-grid,
  .service-grid,
  .dashboard-grid,
  .profile-form-grid,
  .session-review-form {
    grid-template-columns: 1fr;
  }

  .profile-save-row,
  .profile-save-row > div,
  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-save-row .button,
  .profile-actions .button {
    width: 100%;
  }

  .head2head-panel { padding: 12px; }
  .head2head-leaderboard { grid-template-columns: 1fr; }
  .head2head-leaderboard-group,
  .head2head-leaderboard-group:nth-child(2n) { padding-right: 0; border-right: 0; }
  .head2head-leaderboard-group + .head2head-leaderboard-group { padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }

  .diary-calendar {
    min-width: 680px;
    gap: 6px;
  }

  .calendar-day {
    min-height: 100px;
  }


  .review-reflection {
    grid-column: auto;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lifetime-stats-title {
    flex-direction: column;
  }

  .lifetime-stats-title .button {
    width: 100%;
  }

  .admin-title-row,
  .admin-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .session-row,
  .leader-row,
  .metric-list div,
  .progress-card div {
    grid-template-columns: 1fr;
  }

  .lifetime-experience-notes div {
    grid-template-columns: 1fr;
  }

  .lifetime-experience-notes strong {
    text-align: left;
  }

  .lifetime-stats-summary {
    grid-template-columns: 1fr;
  }

  .ingest-hero,
  .ingest-flow,
  .ingest-form, .mt5-form, .mt5-batch-tools, .mt5-schedule-form, .drill-settings-form { grid-template-columns: 1fr; }
  .analytics-columns,
  .analytics-kpi-grid,
  .analytics-daily { grid-template-columns: 1fr; }
  .analytics-day { grid-template-columns: 56px minmax(0, 1fr); align-items: center; }
  .analytics-day i { height: 12px !important; min-height: 12px; }
  .analytics-day span { text-align: left; }
  .mt5-direct-head { display: grid; }
  .ingest-files, .contract-files { grid-column: auto; }
  .contract-files label, .challenge-data-picker, .practice-picker { grid-template-columns: 1fr; }
  .local-access-form,
  .local-status-grid,
  .local-ingest-grid,
  .local-form { grid-template-columns: 1fr; }
  .local-toolbar .button,
  .local-form-actions .button,
  .local-access-form .button { width: 100%; }
}

@media (max-width: 480px) {
  .site-header {
    gap: 12px;
  }

  nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  nav .button {
    grid-column: 1 / -1;
  }

  .preview-chart {
    gap: 8px;
    height: 220px;
  }

  .auth-panel {
    padding: 18px;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-stage,
  .auth-form-stage .auth-form,
  .auth-form-stage .auth-form.is-active {
    transition: none;
  }

  .auth-form-stage .auth-form,
  .auth-form-stage[data-auth-mode="create"] #loginForm {
    transform: none;
  }
}
