:root {
  color-scheme: light;
  --paper: #f3f1ea;
  --paper-2: #e8e4da;
  --ink: #171915;
  --soft-ink: #3f433b;
  --muted: #777b71;
  --hairline: rgba(34, 37, 31, 0.12);
  --panel: rgba(255, 253, 247, 0.76);
  --panel-solid: #fffdf8;
  --deep: #16231e;
  --moss: #266653;
  --blue: #385f85;
  --amber: #b9822e;
  --clay: #9c5b43;
  --good: #267553;
  --watch: #a66b24;
  --bad: #9d3f36;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(29, 31, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.46), rgba(255,255,255,0) 420px),
    radial-gradient(circle at 20% -20%, rgba(185, 130, 46, 0.13), transparent 34%),
    var(--paper);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

main {
  width: min(1240px, calc(100vw - 36px));
  margin: 26px auto 72px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(247, 245, 239, 0.88);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

nav a {
  color: var(--soft-ink);
  font-size: 14px;
  text-decoration: none;
}

nav form {
  margin: 0;
}

button,
.button,
input,
select {
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  background: var(--deep);
  color: #fff;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
}

.ghost {
  min-height: 34px;
  background: transparent;
  color: var(--soft-ink);
}

input,
select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--moss);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.premium-page {
  display: grid;
  gap: 26px;
}

.instrument-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  padding: 28px;
  color: #f8f5ec;
  background:
    linear-gradient(135deg, rgba(18, 28, 24, 0.98), rgba(31, 60, 67, 0.94)),
    linear-gradient(90deg, rgba(185, 130, 46, 0.16), transparent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.instrument-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -130px 28%;
  height: 250px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent);
  transform: rotate(-8deg);
  pointer-events: none;
}

.hero-status {
  align-self: end;
  position: relative;
  z-index: 1;
}

.hero-status .eyebrow {
  color: rgba(248, 245, 236, 0.58);
}

.hero-status h1 {
  margin-bottom: -48px;
  padding-bottom: 76px;
  font-size: clamp(58px, 9vw, 122px);
  line-height: 0.88;
  font-weight: 780;
}

.hero-summary {
  max-width: 760px;
  margin-bottom: 28px;
  color: rgba(248, 245, 236, 0.82);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.36;
}

.summary-source {
  display: inline-flex;
  margin-bottom: 10px;
  color: rgba(248, 245, 236, 0.56);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta span {
  padding: 7px 10px;
  color: rgba(248, 245, 236, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 13px;
}

.hero-instrument {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.instrument-label,
.hero-instrument small {
  color: rgba(248, 245, 236, 0.62);
}

.hero-instrument strong {
  font-size: 34px;
  font-weight: 760;
}

.precision-ring {
  width: 178px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #20332d 0 58%, transparent 59%),
    conic-gradient(var(--amber) var(--progress), rgba(255,255,255,0.18) 0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.precision-ring span {
  font-size: 34px;
  font-weight: 760;
}

.outcome-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 14px;
  padding-inline: 18px;
}

.outcome-card,
.chart-panel,
.weekly-console,
.activity-ledger,
.advisor-section,
.panel,
.wizard-step,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  backdrop-filter: blur(12px);
}

.outcome-card {
  position: relative;
  min-height: 232px;
  display: grid;
  align-content: space-between;
  gap: 24px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.outcome-card:hover,
.chart-panel:hover,
.driver:hover,
.advisor-list article:hover {
  transform: translateY(-2px);
}

.outcome-card.primary {
  background: #fffdf7;
  border-color: rgba(38, 102, 83, 0.34);
}

.outcome-card.primary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--moss), var(--amber));
  border-radius: 10px 0 0 10px;
}

.outcome-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.outcome-topline span {
  font-weight: 740;
  color: var(--soft-ink);
}

.outcome-topline em {
  font-style: normal;
  font-size: 13px;
}

.outcome-card > strong {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.92;
  font-weight: 760;
}

.outcome-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.outcome-card dt {
  color: var(--muted);
  font-size: 12px;
}

.outcome-card dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 720;
}

.story-section,
.operating-section,
.advisor-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
  gap: 18px;
  align-items: start;
}

.story-section {
  padding-top: 6px;
}

.section-intro {
  padding: 18px 4px;
}

.section-intro.tight {
  padding: 0;
  margin-bottom: 18px;
}

.section-intro h2,
.advisor-copy h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  font-weight: 760;
}

.section-intro p:not(.eyebrow),
.advisor-copy p {
  color: var(--muted);
  font-size: 16px;
}

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

.chart-panel {
  min-height: 260px;
  padding: 18px;
  overflow: hidden;
  transition: transform 180ms ease;
}

.chart-panel.large {
  grid-column: 1 / -1;
  min-height: 340px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chart-header span,
.chart-header small {
  color: var(--muted);
}

.chart-header strong {
  display: block;
  margin-top: 2px;
  font-size: 34px;
  line-height: 1;
}

.line-chart,
.bar-chart {
  width: 100%;
  height: 214px;
  overflow: visible;
}

.compact-chart {
  height: 150px;
}

.chart-area {
  fill: rgba(38, 102, 83, 0.12);
}

.blue-area {
  fill: rgba(56, 95, 133, 0.12);
}

.data-line,
.target-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.data-line {
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: drawLine 1100ms cubic-bezier(.2,.7,.2,1) forwards;
}

.waist-line {
  stroke: var(--moss);
}

.weight-line {
  stroke: var(--blue);
}

.target-line {
  stroke: rgba(185, 130, 46, 0.74);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

.bar-chart rect {
  fill: rgba(185, 130, 46, 0.78);
  transform-origin: bottom;
  animation: riseBar 650ms cubic-bezier(.2,.7,.2,1) both;
}

.threshold-line {
  stroke: rgba(38, 102, 83, 0.4);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
}

.axis-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.chart-empty {
  min-height: 214px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(rgba(34, 37, 31, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 37, 31, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px dashed rgba(34, 37, 31, 0.18);
  border-radius: 8px;
}

.compact-empty {
  min-height: 150px;
}

.operating-section {
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.38fr);
}

.weekly-console,
.activity-ledger {
  padding: 22px;
}

.driver-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.driver {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  transition: transform 180ms ease;
}

.driver span,
.driver small {
  color: var(--muted);
}

.driver strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.driver-track {
  height: 7px;
  overflow: hidden;
  background: rgba(34, 37, 31, 0.1);
  border-radius: 999px;
}

.driver-track span {
  display: block;
  height: 100%;
  background: var(--moss);
  border-radius: inherit;
  animation: fillTrack 900ms cubic-bezier(.2,.7,.2,1) both;
}

.driver.blue .driver-track span {
  background: var(--blue);
}

.driver.amber .driver-track span {
  background: var(--amber);
}

.weekly-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.weekly-details div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.weekly-details span,
.weekly-details strong {
  display: block;
}

.weekly-details span {
  color: var(--muted);
  font-size: 12px;
}

.weekly-details strong {
  margin-top: 4px;
}

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

.recent-list article {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.recent-list article:last-child {
  border-bottom: 0;
}

.recent-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.recent-list span,
.recent-list small {
  color: var(--muted);
}

.recent-list p {
  margin: 6px 0 2px;
}

.advisor-section {
  align-items: stretch;
  padding: 24px;
  background: var(--deep);
  color: #f8f5ec;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.advisor-copy .eyebrow {
  color: rgba(248, 245, 236, 0.58);
}

.advisor-copy p {
  color: rgba(248, 245, 236, 0.68);
}

.advisor-list {
  display: grid;
  gap: 12px;
}

.advisor-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  transition: transform 180ms ease, background 180ms ease;
}

.advisor-list article > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 245, 236, 0.72);
  font-weight: 760;
}

.advisor-list h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.advisor-list p {
  margin: 0;
  color: rgba(248, 245, 236, 0.68);
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 40px;
}

.panel,
.wizard-step,
.login-panel {
  padding: 20px;
}

.status-list,
.stack,
.wizard {
  display: grid;
  gap: 12px;
}

.status-row,
.step-title,
.inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-row span,
.muted,
small {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  background: rgba(38, 102, 83, 0.1);
  border-radius: 999px;
  color: var(--moss);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.pill.fördröjd {
  background: rgba(185, 130, 46, 0.14);
  color: var(--watch);
}

.pill.frånkopplad {
  background: rgba(157, 63, 54, 0.12);
  color: var(--bad);
}

.alert-list {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(185, 130, 46, 0.1);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
}

.data-panel {
  overflow: hidden;
}

.health-value-list {
  display: grid;
}

.health-value-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 0.8fr) minmax(260px, 1.4fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.health-value-row:last-child {
  border-bottom: 0;
}

.health-value-row strong,
.health-value-row span,
.health-value-main {
  display: block;
}

.health-value-row strong {
  font-size: 16px;
}

.health-value-row span,
.health-value-meta {
  color: var(--muted);
  font-size: 13px;
}

.health-value-main {
  color: var(--deep);
  font-size: 24px;
  font-weight: 780;
  letter-spacing: 0;
}

.health-value-meta {
  display: grid;
  gap: 2px;
}

.empty-state {
  padding: 28px 0;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.alert-list p {
  margin: 4px 0;
}

.wizard-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
}

.step-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--deep);
  color: #fff;
  font-weight: 780;
}

.endpoint-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 18px;
}

code {
  padding: 2px 5px;
  background: rgba(34, 37, 31, 0.08);
  border-radius: 4px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
}

.notice,
.error {
  padding: 10px;
  border-radius: 8px;
}

.notice {
  background: rgba(38, 102, 83, 0.1);
}

.error {
  background: rgba(157, 63, 54, 0.12);
  color: var(--bad);
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes riseBar {
  from {
    transform: scaleY(0.15);
    opacity: 0.3;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes fillTrack {
  from {
    transform: scaleX(0.2);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@media (max-width: 1040px) {
  .instrument-hero,
  .story-section,
  .operating-section,
  .advisor-section {
    grid-template-columns: 1fr;
  }

  .outcome-grid,
  .driver-grid,
  .advisor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    width: min(100vw - 22px, 620px);
    margin-top: 16px;
  }

  .topbar,
  nav,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    padding: 14px 18px;
  }

  .instrument-hero {
    min-height: auto;
    margin-bottom: -28px;
    padding: 22px;
    padding-bottom: 56px;
  }

  .hero-status h1 {
    font-size: 56px;
  }

  .outcome-grid,
  .chart-composition,
  .driver-grid,
  .weekly-details,
  .advisor-list,
  .endpoint-list {
    grid-template-columns: 1fr;
  }

  .outcome-grid {
    padding-inline: 8px;
  }

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

  .line-chart {
    height: 180px;
  }

  .chart-panel.large {
    min-height: 300px;
  }

  .health-value-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .health-value-main {
    font-size: 28px;
  }
}
