:root {
  --bg: #0a0a0a;
  --bg-surface: #111111;
  --panel: rgba(13, 13, 13, 0.9);
  --panel-border: rgba(91, 91, 91, 0.28);
  --text: #f3f3f3;
  --muted: #9a9a9a;
  --accent: #00ff88;
  --accent-2: #5dffc0;
  --accent-3: #e8e8e8;
  --warn: #ffaa00;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(0, 255, 136, 0.08), transparent 22%),
    linear-gradient(180deg, #090909 0%, #0a0a0a 100%);
  color: var(--text);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 95%);
  pointer-events: none;
}

.shell {
  position: relative;
  width: min(1220px, calc(100% - 32px));
  margin: 20px auto 40px;
}

.auth-shell {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(14px);
  min-width: 0;
}

.topbar,
.section-head,
.workout-card header,
.nav-tabs,
.xp-line,
.daily-line {
  display: flex;
  align-items: center;
}

.topbar,
.section-head,
.workout-card header,
.xp-line,
.daily-line {
  justify-content: space-between;
  gap: 12px;
}

.topbar-actions,
.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar,
.section-head,
.xp-line,
.daily-line,
.nav-tabs,
.stat-inline {
  flex-wrap: wrap;
}

.hero {
  overflow: hidden;
  position: relative;
  border-color: rgba(0, 255, 136, 0.18);
  display: grid;
  gap: 0;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: -20% auto auto -8%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.12), transparent 66%);
}

.hero::after {
  inset: auto -10% -40% auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.08), transparent 62%);
}

.eyebrow,
.chip,
.label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
}

h1,
h2,
h3,
strong {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  line-height: 0.98;
  margin-top: 8px;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.4rem;
}

.motivation {
  max-width: 700px;
  color: var(--text);
  font-size: 1.05rem;
  margin: 10px 0 0;
}

.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.hero-grid,
.grid-two,
.scan-grid,
.form-grid,
.xp-breakdown,
.daily-list,
.rules-list {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 24px;
}

.hero-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.grid-two > *,
.hero-grid > *,
.milestone-grid > *,
.scan-grid > *,
.rules-list > *,
.xp-breakdown > *,
.daily-list > *,
.workout-list > * {
  min-width: 0;
}

.full-span {
  grid-column: 1 / -1;
}

.stat-card,
.mission,
.workout-card,
.xp-item,
.daily-item,
.rule-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 18px;
  min-width: 0;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.4rem, 2vw, 2rem);
  margin-top: 0;
}

.stat-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.stat-inline .subtle,
.xp-line > span,
.xp-line > h3,
.daily-line > span {
  min-width: 0;
}

.subtle {
  color: var(--muted);
}

.topbar {
  margin-bottom: 18px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head.compact {
  margin-top: 24px;
  margin-bottom: 12px;
}

.chip {
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--accent);
  border-radius: 3px;
  padding: 8px 12px;
  background: rgba(0, 255, 136, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.account-chip {
  justify-content: flex-end;
}

.auth-panel {
  width: min(520px, 100%);
}

.auth-form {
  margin-top: 20px;
}

.auth-status {
  min-height: 24px;
  margin-top: 16px;
}

.stat-note {
  margin-top: 8px;
}

.mission-list,
.workout-list {
  display: grid;
  gap: 14px;
}

.mission .bar {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mission .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.clean-list li + li {
  margin-top: 10px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

label.full {
  grid-column: 1 / -1;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.toggle-line input {
  width: auto;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 3px;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

.action {
  appearance: none;
  border: 0;
  border-radius: 3px;
  padding: 14px 18px;
  background: var(--accent);
  color: #08110d;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.action.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.import-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.xp-progress-wrap {
  margin-top: 14px;
  width: 100%;
}

.xp-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.xp-progress-bar {
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
}

.xp-progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.nav-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  white-space: nowrap;
}

.nav-tab.active {
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.hidden {
  display: none !important;
}

.xp-breakdown,
.rules-list {
  grid-template-columns: 1fr;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.milestone-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 255, 136, 0.14);
  border-radius: 4px;
  padding: 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.milestone-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}

.milestone-list {
  display: grid;
  gap: 10px;
}

.milestone-target {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
  padding: 12px;
}

.milestone-target.achieved {
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.05);
}

.milestone-progress {
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.milestone-progress.compact {
  height: 8px;
}

.milestone-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7f1d1d, #ef4444 45%, #f3f3f3 100%);
}

.xp-line strong,
.daily-line strong {
  font-size: 1.2rem;
}

.daily-list,
.mission-list,
.workout-list {
  grid-template-columns: 1fr;
}

.lead {
  margin-top: 0;
  max-width: 860px;
}

.intel-copy p {
  color: var(--muted);
  margin: 0 0 12px;
}

.label,
.eyebrow,
.xp-line span,
.daily-line span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.chart {
  width: 100%;
  height: 120px;
  margin-top: 14px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

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

.scan-grid .mini {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.scan-grid strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 6px;
}

.workout-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.workout-card .meta {
  color: var(--muted);
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}

.exercise-list {
  display: grid;
  gap: 6px;
}

.exercise {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  flex-wrap: wrap;
}

.section-head h2,
.section-head h3,
.xp-line h3,
.milestone-meta strong,
.stat-card strong {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .hero-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .grid-two,
  .milestone-grid {
    grid-template-columns: 1fr;
  }

  .full-span {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .form-grid,
  .scan-grid {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .account-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .xp-progress-head {
    align-items: flex-start;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    margin-top: 12px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  h1 {
    font-size: 3.4rem;
  }
}
