@import url('./tokens.css');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--cro-bg-canvas);
  color: var(--cro-text);
  font-family: var(--cro-font-body);
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, rgb(113 69 214 / 6%), transparent 32rem),
    var(--cro-bg-canvas);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--cro-focus);
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

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

h1,
h2,
h3 {
  color: var(--cro-text);
}

h1 {
  margin-bottom: 10px;
  font-family: var(--cro-font-display);
  font-size: clamp(1.65rem, 2.3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.035em;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.35;
}

p {
  color: var(--cro-text-muted);
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--cro-sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  padding: 28px 20px 22px;
  overflow-y: auto;
  background: var(--cro-sidebar);
  box-shadow: 10px 0 30px rgb(30 15 50 / 8%);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
  color: #fff;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, #9b73ee, #7145d6);
  color: #fff;
  font-family: var(--cro-font-display);
  font-weight: 800;
}

.sidebar__brand div {
  min-width: 0;
}

.sidebar__brand strong,
.sidebar__brand span:not(.brand-mark) {
  display: block;
}

.sidebar__brand strong {
  max-width: 136px;
  overflow: hidden;
  font-family: var(--cro-font-display);
  font-size: 1.12rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__brand div > span {
  margin-top: 1px;
  color: #fff;
  font-family: var(--cro-font-display);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.sidebar__goal {
  margin: 14px 6px 30px;
  color: #d1c7e3;
  font-size: .76rem;
}

.sidebar nav ul {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--cro-radius-sm);
  background: transparent;
  color: #e5dbf2;
  font-weight: 600;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-item:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
  transform: translateX(2px);
}

.nav-item[aria-current="page"] {
  background: #f2edfd;
  color: var(--cro-text);
}

.nav-item img {
  flex: 0 0 auto;
}

.sidebar__status {
  padding: 24px 6px 0;
  margin-top: 24px;
  border-top: 1px solid var(--cro-sidebar-border);
}

.sidebar .eyebrow {
  color: #ad9ec2;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: .78rem;
}

.connection-state--connected img {
  filter: hue-rotate(80deg) saturate(1.5);
}

.sidebar__note {
  margin: auto 6px 0;
  padding-top: 28px;
  color: var(--cro-sidebar-muted);
  font-size: .72rem;
  line-height: 1.45;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--cro-sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(24px, 3vw, 40px);
  border-bottom: 1px solid rgb(228 230 238 / 85%);
  background: rgb(246 247 251 / 88%);
  backdrop-filter: blur(18px);
}

.project-switcher {
  min-width: 180px;
}

.project-switcher select,
.field select,
.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cro-border);
  border-radius: var(--cro-radius-sm);
  background: #fff;
  color: var(--cro-text);
}

.project-switcher select {
  padding: 0 38px 0 12px;
  font-weight: 700;
}

.period-switcher {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--cro-border);
  border-radius: 12px;
  background: #fff;
}

.period-switcher button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cro-text-muted);
  font-size: .78rem;
  font-weight: 700;
}

.period-switcher button[aria-pressed="true"] {
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
}

.topbar__add {
  margin-left: auto;
}

.topbar__add-label {
  margin-left: 5px;
}

.live-sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cro-text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.live-sync i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgb(34 197 94 / 12%);
}

.main-content {
  width: min(100%, 1240px);
  padding: 26px clamp(24px, 3vw, 40px) 56px;
  margin: 0 auto;
}

.button,
.icon-button {
  border: 0;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--cro-radius-sm);
  font-size: .84rem;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--cro-brand-primary);
  box-shadow: 0 7px 16px rgb(113 69 214 / 18%);
  color: #fff;
}

.button--primary:hover {
  background: var(--cro-brand-primary-hover);
  box-shadow: 0 9px 20px rgb(113 69 214 / 24%);
}

.button--secondary,
.button--ghost {
  border: 1px solid var(--cro-border);
  background: #fff;
  color: var(--cro-text);
}

.button--ghost {
  border-color: transparent;
  background: transparent;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--cro-text);
  font-size: 1.2rem;
}

.sidebar-toggle {
  display: none;
}

.sidebar-close {
  display: none;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--cro-brand-primary);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .095em;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 2px 0 28px;
}

.page-heading p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  font-size: .88rem;
}

.data-badge,
.status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .025em;
}

.data-badge {
  background: var(--cro-warning-soft);
  color: var(--cro-warning);
  white-space: nowrap;
}

.data-badge--live {
  background: var(--cro-success-soft);
  color: var(--cro-success);
}

.data-badge--pending {
  background: var(--cro-warning-soft);
  color: var(--cro-warning);
}

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

.metric-card,
.panel {
  border: 1px solid var(--cro-border);
  background: var(--cro-bg-surface);
  box-shadow: var(--cro-shadow-card);
}

.metric-card {
  min-height: 126px;
  padding: 18px;
  border-radius: var(--cro-radius-md);
}

.metric-card strong {
  display: block;
  margin: 4px 0 5px;
  font-family: var(--cro-font-display);
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
}

.metric-card[data-state="unknown"] {
  border-style: dashed;
  box-shadow: none;
}

.metric-card[data-state="unknown"] strong {
  color: var(--cro-text-muted);
}

.metric-card p:last-child {
  margin: 0;
  overflow: hidden;
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(245px, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.panel {
  border-radius: var(--cro-radius-md);
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel__header h2,
.panel__header p {
  margin-bottom: 0;
}

.panel__header p {
  font-size: .74rem;
}

.forecast-label {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
  font-size: .68rem;
  font-weight: 800;
}

.trajectory-card,
.roadmap-card {
  min-height: 304px;
  padding: 18px 20px;
}

.chart {
  position: relative;
  height: 218px;
  padding: 18px 0 26px 42px;
}

.chart svg {
  width: 100%;
  height: 166px;
  overflow: visible;
}

.chart line {
  stroke: var(--cro-border);
  stroke-width: 1;
}

.chart__forecast {
  fill: none;
  stroke: var(--cro-brand-primary);
  stroke-dasharray: 8 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}

.chart__actual {
  fill: none;
  stroke: var(--cro-blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.chart__dots circle {
  fill: var(--cro-brand-primary);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart__dots circle:first-child {
  fill: #9da1b1;
}

.chart__dots--actual circle,
.chart__dots--actual circle:first-child {
  fill: var(--cro-blue);
}

.chart-legend {
  display: flex;
  gap: 12px;
  color: var(--cro-text-muted);
  font-size: .68rem;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--cro-blue);
}

.chart-legend .is-forecast {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--cro-brand-primary) 0 5px, transparent 5px 8px);
}

.chart--empty {
  display: grid;
  min-height: 210px;
  place-content: center;
  padding: 24px;
  text-align: center;
}

.chart--empty strong {
  margin-bottom: 5px;
}

.chart--empty p {
  margin: 0;
  font-size: .76rem;
}

.chart__y-labels {
  position: absolute;
  inset: 17px auto 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--cro-text-muted);
  font-size: .65rem;
}

.chart__x-labels {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 42px;
  height: 18px;
  color: var(--cro-text-muted);
  font-size: .64rem;
}

.chart__x-labels span {
  position: absolute;
  left: var(--chart-x);
  transform: translateX(-50%);
  white-space: nowrap;
}

.roadmap {
  display: grid;
  gap: 0;
  padding: 4px 0 0;
  margin: 0;
  list-style: none;
}

.roadmap li {
  position: relative;
  display: grid;
  min-height: 56px;
  grid-template-columns: 36px 1fr;
  gap: 10px;
}

.roadmap li:not(:last-child)::before {
  position: absolute;
  top: 34px;
  bottom: -1px;
  left: 16px;
  width: 2px;
  border-radius: 2px;
  background: var(--cro-border);
  content: '';
}

.roadmap__step {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
  font-size: .68rem;
  font-weight: 800;
}

.roadmap__step img {
  position: absolute;
  inset: 0;
}

.roadmap__step b {
  position: relative;
  z-index: 1;
  font: inherit;
}

.roadmap__step.is-active {
  background: var(--cro-brand-primary);
  color: #fff;
}

.roadmap strong,
.roadmap small {
  display: block;
}

.roadmap strong {
  padding-top: 1px;
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roadmap small {
  margin-top: 4px;
  color: var(--cro-text-muted);
  font-size: .68rem;
}

.empty-inline {
  display: block !important;
  padding: 18px 0;
  color: var(--cro-text-muted);
  font-size: .78rem;
}

.featured-test {
  padding: 18px 20px 20px;
  margin-top: 22px;
}

.featured-test header > div {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.featured-test header h2 {
  margin-bottom: 5px;
  font-size: 1.16rem;
}

.featured-test header p {
  margin-bottom: 16px;
  font-size: .82rem;
}

.status--ready,
.status--won,
.status--winner {
  background: var(--cro-success-soft);
  color: var(--cro-success);
}

.status--testing,
.status--running {
  background: var(--cro-blue-soft);
  color: var(--cro-blue);
}

.status--lost,
.status--loser,
.status--stopped {
  background: var(--cro-danger-soft);
  color: var(--cro-danger);
}

.status--draft,
.status--backlog,
.status--inconclusive {
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
}

.status--unknown {
  border: 1px dashed var(--cro-text-muted);
  background: var(--cro-bg-subtle);
  color: var(--cro-text-muted);
}

.featured-test__body {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 28px;
}

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

.variant-placeholder {
  display: grid;
  min-height: 190px;
  place-content: center;
  padding: 24px;
  border: 1px dashed #cfd2dd;
  border-radius: 12px;
  background: linear-gradient(145deg, #fafaff, #f2f3f8);
  text-align: center;
}

.variant-placeholder > span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: #fff;
  color: var(--cro-text-muted);
  font-weight: 800;
  box-shadow: var(--cro-shadow-card);
}

.variant-placeholder strong {
  font-size: .82rem;
}

.variant-placeholder p {
  max-width: 260px;
  margin: 5px 0 0;
  font-size: .72rem;
}

.variant-pair figure {
  position: relative;
  aspect-ratio: 1.03;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--cro-bg-subtle);
}

.variant-pair img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variant-pair figcaption {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  color: var(--cro-text);
  font-size: .66rem;
  font-weight: 800;
}

.variant-pair figure:last-child figcaption {
  background: rgb(242 237 253 / 96%);
  color: var(--cro-brand-primary);
}

.featured-test__summary strong {
  display: block;
  color: var(--cro-brand-primary);
  font-family: var(--cro-font-display);
  font-size: 1.6rem;
  font-weight: 800;
}

.featured-test__summary p:last-child {
  margin: 5px 0 0;
  font-size: .75rem;
}

.welcome-state,
.empty-state,
.error-state {
  min-height: 360px;
  padding: 48px;
}

.welcome-state {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  background:
    linear-gradient(110deg, #fff 42%, rgb(241 236 255 / 76%)),
    #fff;
}

.welcome-state__mark,
.empty-state__icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 17px;
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
  font-size: 1.6rem;
  font-weight: 800;
}

.welcome-state p:not(.eyebrow) {
  max-width: 560px;
  margin-bottom: 24px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 22px;
}

.empty-state__icon {
  margin: 0;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.loading-state {
  display: grid;
  min-height: 50vh;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--cro-border);
  border-top-color: var(--cro-brand-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  min-height: 260px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 24px;
  overflow-y: auto;
  place-items: center;
  background: rgb(23 13 36 / 52%);
  backdrop-filter: blur(8px);
}

.dialog {
  width: min(760px, 100%);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--cro-radius-lg);
  background: #fff;
  box-shadow: var(--cro-shadow-dialog);
}

.dialog__header,
.dialog__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog__header {
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--cro-border);
}

.dialog__header h2 {
  margin-bottom: 5px;
  font-family: var(--cro-font-display);
  font-size: 1.45rem;
  letter-spacing: -.025em;
}

.dialog__header p:last-child {
  margin-bottom: 0;
  font-size: .8rem;
}

.setup-form {
  padding: 22px 26px 24px;
}

.setup-form fieldset {
  padding: 0;
  margin: 0 0 22px;
  border: 0;
}

.setup-form legend {
  width: 100%;
  padding: 0 0 12px;
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 6px;
  color: var(--cro-text);
  font-size: .76rem;
  font-weight: 700;
}

.field__control {
  position: relative;
  display: block;
}

.field input,
.field select {
  padding: 0 12px;
  outline: none;
}

.field__control > span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--cro-text-muted);
  transform: translateY(-50%);
}

.field__control > span + input,
.field input:has(+ span) {
  padding-right: 32px;
}

.field--error input,
.field--error select {
  border-color: var(--cro-danger);
  background: var(--cro-danger-soft);
}

.field small {
  color: var(--cro-danger);
  font-size: .68rem;
  font-weight: 600;
}

.form-message {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--cro-brand-soft);
  color: var(--cro-brand-primary);
  font-size: .78rem;
  font-weight: 700;
}

.dialog__footer {
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 48px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--cro-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--cro-shadow-card);
  color: var(--cro-text);
  font-size: .8rem;
  font-weight: 700;
}

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

  .overview-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  }

  .featured-test__body {
    grid-template-columns: minmax(280px, 1.35fr) minmax(170px, .65fr);
  }

  .featured-test__body > .button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 960px) {
  :root {
    --cro-sidebar-width: 228px;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell.is-sidebar-open::before {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgb(23 13 36 / 36%);
    content: '';
  }

  .app-shell.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.is-sidebar-open .sidebar-close {
    position: absolute;
    top: 18px;
    right: 14px;
    z-index: 2;
    display: inline-grid;
    background: rgb(255 255 255 / 12%);
    color: #fff;
  }

  .workspace {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: inline-grid;
  }

  .topbar {
    padding-inline: 24px;
  }

  .main-content {
    padding-inline: 24px;
  }

  .topbar__add {
    padding-inline: 13px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

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

  .roadmap li::before {
    display: none;
  }

  .featured-test__body {
    grid-template-columns: minmax(280px, 1fr) minmax(190px, .8fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Reference dashboard: horizontal CRO journal instead of the original app sidebar. */
body {
  background: #f4f5f7;
}

.page-heading--compact {
  margin-bottom: 18px;
}

.page-heading--compact h1 {
  margin-bottom: 6px;
  font-size: clamp(1.45rem, 2vw, 1.95rem);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--cro-border);
  border-radius: 12px;
  background: #fff;
}

.summary-metric {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--cro-border);
}

.summary-metric:last-child {
  border-right: 0;
}

.summary-metric p,
.summary-metric small,
.summary-metric strong {
  display: block;
}

.summary-metric p {
  margin: 0 0 7px;
  color: var(--cro-text-muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .055em;
}

.summary-metric strong {
  overflow: hidden;
  font-family: var(--cro-font-display);
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-metric small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--cro-text-muted);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 12px;
  margin: 12px 0;
  border-radius: 7px;
  background: #e9f7ef;
  color: #17663f;
  font-size: .73rem;
}

.reference-callout span {
  color: #3b6d55;
}

.dynamic-schedule {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--cro-border);
  border-radius: 12px;
  background: #fff;
}

.dynamic-schedule > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--cro-border);
}

.dynamic-schedule > header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dynamic-schedule > header > span {
  color: var(--cro-text-muted);
  font-size: .67rem;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(260px, .9fr) minmax(360px, 1.3fr);
  align-items: start;
}

.schedule-lane {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--cro-border);
  background: #fbfbfc;
}

.schedule-lane:last-child {
  border-right: 0;
}

.schedule-lane > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 11px;
  color: #525664;
  font-size: .7rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.schedule-lane > h3 span {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  padding: 0 6px;
  border-radius: 12px;
  background: #e9eefc;
  color: var(--cro-brand-primary);
  font-size: .67rem;
}

.schedule-item {
  padding: 13px 14px;
  border: 1px solid var(--cro-border);
  border-radius: 9px;
  background: #fff;
}

.schedule-item + .schedule-item {
  margin-top: 9px;
}

.schedule-item--running {
  border-color: #efd38b;
  background: #fffaf0;
}

.schedule-item--next {
  border-color: #a9bee9;
  background: #f7f9ff;
}

.schedule-item__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--cro-text-muted);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.schedule-item__top b {
  color: var(--cro-brand-primary);
}

.schedule-item h3 {
  margin: 7px 0 5px;
  font-size: .82rem;
  line-height: 1.3;
}

.schedule-item p,
.schedule-empty {
  margin: 0;
  color: var(--cro-text-muted);
  font-size: .67rem;
  line-height: 1.45;
}

.schedule-empty {
  padding: 16px;
  border: 1px dashed var(--cro-border);
  border-radius: 9px;
  background: #fff;
}

.overview-chart .trajectory-card {
  min-height: 330px;
  border-radius: 12px;
  box-shadow: none;
}

.overview-chart .chart {
  height: 250px;
}

.journal-card {
  margin-top: 18px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: none;
}

.journal-card__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px 12px;
}

.journal-card__header h2 {
  margin: 0;
}

.journal-card__header > span {
  color: var(--cro-text-muted);
  font-size: .72rem;
  font-weight: 800;
}

.journal-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--cro-border);
  border-bottom: 1px solid var(--cro-border);
}

.journal-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: .73rem;
  font-variant-numeric: tabular-nums;
}

.journal-table th,
.journal-table td {
  padding: 12px 14px;
  border-right: 1px solid #eceef3;
  border-bottom: 1px solid #eceef3;
  text-align: left;
  vertical-align: middle;
}

.journal-table th:last-child,
.journal-table td:last-child {
  border-right: 0;
}

.journal-table th {
  background: #fafbfc;
  color: var(--cro-text-muted);
  font-size: .64rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.journal-table tbody tr {
  background: #fffdf6;
}

.journal-table td small {
  display: block;
  margin-top: 3px;
  color: var(--cro-text-muted);
}

.journal-test-link {
  max-width: 440px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cro-text);
  font-weight: 800;
  text-align: left;
}

.journal-test-link:hover {
  color: var(--cro-brand-primary);
}

.journal-uplift {
  color: var(--cro-success);
  font-weight: 800;
}

.journal-focus {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  min-height: 430px;
}

.journal-focus__story,
.journal-focus__results {
  padding: 20px 22px 24px;
}

.journal-focus__story {
  border-right: 1px solid var(--cro-border);
}

.journal-focus__story > p:not(.eyebrow) {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: .76rem;
}

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

.journal-variants figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--cro-border);
  border-radius: 9px;
  background: #f2f3f6;
}

.journal-variants figure > span {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgb(255 255 255 / 94%);
  color: #555968;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .035em;
}

.journal-variants figure:last-child > span {
  background: #e9f0ff;
  color: var(--cro-brand-primary);
}

.journal-variants img,
.journal-shot-placeholder {
  width: 100%;
  height: 305px;
}

.journal-variants img {
  display: block;
  object-fit: contain;
}

.journal-shot-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--cro-text-muted);
  text-align: center;
}

.journal-variants figcaption {
  min-height: 50px;
  padding: 11px 12px;
  border-top: 1px solid var(--cro-border);
  background: #fff;
  font-size: .72rem;
  font-weight: 800;
}

.journal-focus__results {
  background: #fbfbfd;
}

.journal-focus__result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.funnel-table {
  width: 100%;
  margin: 12px 0 18px;
  border-collapse: collapse;
  background: #fff;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.funnel-table th,
.funnel-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--cro-border);
  text-align: right;
}

.funnel-table th:first-child,
.funnel-table td:first-child {
  text-align: left;
}

.funnel-table th {
  color: var(--cro-text-muted);
  font-size: .62rem;
}

.funnel-table td:last-child {
  font-weight: 800;
}

.journal-decision {
  padding: 12px 14px;
  margin-bottom: 15px;
  border-radius: 8px;
  background: var(--cro-success-soft);
  color: var(--cro-success);
}

.journal-decision.is-preliminary {
  background: var(--cro-blue-soft);
  color: var(--cro-blue);
}

.journal-decision p {
  margin: 4px 0 0;
  color: inherit;
  font-size: .71rem;
}

.journal-empty {
  padding: 40px;
  text-align: center;
}

@media (min-width: 961px) {
  .app-shell {
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    inset: 0 auto auto 0;
    z-index: 40;
    display: flex;
    width: 100%;
    min-height: 58px;
    height: 58px;
    align-items: center;
    flex-direction: row;
    gap: 18px;
    padding: 9px 24px;
    overflow: visible;
    box-shadow: none;
  }

  .sidebar__brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--cro-brand-primary);
  }

  .sidebar__brand strong {
    max-width: 160px;
    font-size: .9rem;
  }

  .sidebar__brand div > span {
    font-size: .62rem;
  }

  .sidebar__goal,
  .sidebar__note {
    display: none;
  }

  .sidebar nav {
    min-width: 0;
    flex: 1;
  }

  .sidebar nav ul {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .nav-item {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 7px;
    color: #d7d9de;
    font-size: .72rem;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-item[aria-current="page"] {
    background: #fff;
    color: #171717;
  }

  .sidebar__status {
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
  }

  .sidebar__status .eyebrow {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    top: 58px;
    min-height: 62px;
    padding: 10px 24px;
    background: rgb(245 246 248 / 94%);
  }

  .main-content {
    width: min(100%, 1600px);
    padding: 20px 24px 64px;
  }
}

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

  .summary-metric:nth-child(3) {
    border-right: 0;
  }

  .summary-metric:nth-child(-n+3) {
    border-bottom: 1px solid var(--cro-border);
  }

  .journal-focus {
    grid-template-columns: 1fr;
  }

  .journal-focus__story {
    border-right: 0;
    border-bottom: 1px solid var(--cro-border);
  }

  .schedule-grid {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-lane:nth-child(2) {
    border-right: 0;
  }

  .schedule-lane--week {
    grid-column: 1 / -1;
    border-top: 1px solid var(--cro-border);
  }
}

@media (max-width: 720px) {
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .schedule-lane,
  .schedule-lane:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--cro-border);
  }

  .schedule-lane--week {
    grid-column: auto;
    border-top: 0;
    border-bottom: 0;
  }
}

/* Compact operations UI: one calm hierarchy, dense enough for daily CRO work. */
body {
  overflow-x: hidden;
  background: #f5f6f8;
}

.panel,
.metric-card {
  box-shadow: var(--cro-shadow-card);
}

.page-heading {
  gap: 16px;
  margin: 0 0 14px;
}

.page-heading h1,
.page-heading--compact h1 {
  margin-bottom: 3px;
  font-size: clamp(1.45rem, 2vw, 1.75rem);
  line-height: 1.15;
}

.page-heading p:last-child {
  font-size: .82rem;
  line-height: 1.4;
}

.page-heading--compact {
  margin-bottom: 12px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: .7rem;
  letter-spacing: .075em;
}

.data-badge,
.status {
  min-height: 24px;
  padding: 0 9px;
  font-size: .72rem;
}

.summary-strip {
  border-radius: 10px;
}

.summary-metric {
  min-height: 76px;
  padding: 10px 13px;
}

.summary-metric p {
  margin-bottom: 3px;
  font-size: .7rem;
}

.summary-metric strong {
  font-size: 1.25rem;
}

.summary-metric small {
  margin-top: 2px;
  font-size: .72rem;
}

.growth-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 10px 14px;
  margin: 10px 0 12px;
  border: 1px solid #cfe7d9;
  border-radius: 10px;
  background: #f1faf5;
}

.growth-path {
  display: flex;
  align-items: center;
  gap: 12px;
}

.growth-path span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.growth-path small,
.goal-progress span {
  color: #537060;
  font-size: .72rem;
}

.growth-path strong {
  color: #153f29;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.growth-path .is-current strong {
  color: var(--cro-success);
  font-size: 1.25rem;
}

.growth-path i {
  color: #80a08e;
  font-style: normal;
}

.goal-progress {
  width: min(360px, 36vw);
}

.goal-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.goal-progress strong {
  color: var(--cro-success);
  font-size: .75rem;
}

.goal-progress progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: var(--cro-success);
}

.dynamic-schedule {
  margin: 12px 0;
  border-radius: 10px;
}

.dynamic-schedule > header {
  align-items: center;
  padding: 10px 14px;
}

.dynamic-schedule > header h2 {
  font-size: 1rem;
}

.schedule-lane {
  padding: 11px 12px 12px;
}

.schedule-lane > h3 {
  margin-bottom: 8px;
  font-size: .72rem;
}

.schedule-item {
  padding: 10px 11px;
  border-radius: 8px;
}

.schedule-item + .schedule-item {
  margin-top: 7px;
}

.schedule-item h3 {
  margin: 5px 0 3px;
  font-size: .82rem;
}

.schedule-item p,
.schedule-empty {
  font-size: .72rem;
}

.schedule-empty {
  padding: 12px;
  border-radius: 8px;
}

.overview-chart .trajectory-card {
  min-height: 248px;
  padding: 14px 16px;
  border-radius: 10px;
}

.overview-chart .chart {
  height: 190px;
  padding-top: 8px;
}

.journal-card {
  margin-top: 12px;
  border-radius: 10px;
}

.journal-card__header {
  align-items: center;
  padding: 12px 14px 10px;
}

.journal-card__header h2 {
  font-size: 1rem;
}

.journal-table-wrap {
  border-bottom: 0;
}

.journal-table {
  min-width: 0;
  font-size: .8rem;
}

.journal-table th,
.journal-table td {
  height: 52px;
  padding: 8px 12px;
  border-right: 0;
  border-bottom: 1px solid #eceef2;
}

.journal-table th {
  background: #f8f9fb;
  font-size: .7rem;
}

.journal-table tbody tr {
  background: #fff;
}

.journal-table tbody tr:hover {
  background: #f9fbff;
}

.journal-table td:not(:first-child) {
  white-space: nowrap;
}

.journal-table td:nth-child(n+2):not(:last-child) {
  font-variant-numeric: tabular-nums;
}

.journal-test-link {
  max-width: 100%;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
}

.journal-preview {
  border-top: 1px solid var(--cro-border);
}

.journal-preview > summary {
  padding: 11px 14px;
  color: var(--cro-text);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  list-style-position: inside;
}

.journal-preview > summary span {
  margin-left: 6px;
  color: var(--cro-text-muted);
  font-size: .73rem;
  font-weight: 400;
}

.journal-preview[open] > summary {
  border-bottom: 1px solid var(--cro-border);
}

.journal-focus {
  min-height: 360px;
}

.journal-focus__story,
.journal-focus__results {
  padding: 16px;
}

.journal-variants img,
.journal-shot-placeholder {
  height: 240px;
}

.journal-variants figcaption {
  min-height: 42px;
  padding: 9px 10px;
  font-size: .76rem;
}

.experiments-journal {
  margin-top: 0;
}

.experiments-journal .journal-table th:first-child,
.experiments-journal .journal-table td:first-child {
  width: 39%;
}

.experiments-journal .journal-action {
  text-align: right;
}

@media (min-width: 961px) {
  .sidebar {
    min-height: 48px;
    height: 48px;
    gap: 14px;
    padding: 6px 20px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .sidebar__brand strong {
    font-size: .86rem;
  }

  .nav-item {
    min-height: 34px;
    padding: 0 11px;
    font-size: .76rem;
  }

  .nav-item img {
    display: none;
  }

  .connection-state {
    font-size: .74rem;
  }

  .topbar {
    top: 48px;
    min-height: 48px;
    padding: 6px 20px;
  }

  .project-switcher select {
    min-height: 36px;
  }

  .period-switcher button {
    min-height: 28px;
  }

  .button {
    min-height: 36px;
  }

  .main-content {
    width: min(100%, 1440px);
    padding: 16px 20px 48px;
  }
}

@media (max-width: 960px) {
  .sidebar {
    width: min(292px, calc(100vw - 48px));
  }

  .topbar {
    gap: 8px;
    min-height: 56px;
    padding: 8px 14px;
  }

  .project-switcher {
    min-width: 0;
    flex: 1;
  }

  .topbar__add {
    min-width: 40px;
    padding-inline: 11px;
  }

  .main-content {
    width: 100%;
    padding: 16px 16px 44px;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .growth-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .goal-progress {
    width: 100%;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .period-switcher {
    order: 4;
    width: 100%;
  }

  .period-switcher button {
    min-height: 34px;
    flex: 1;
  }

  .topbar__add {
    margin-left: 0;
  }

  .topbar__add-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .topbar__add > span[aria-hidden="true"] {
    font-size: 1.1rem;
  }

  .main-content {
    padding: 14px 12px 40px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .page-heading h1,
  .page-heading--compact h1 {
    font-size: 1.45rem;
  }

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

  .summary-metric,
  .summary-metric:nth-child(3) {
    border-right: 1px solid var(--cro-border);
    border-bottom: 1px solid var(--cro-border);
  }

  .summary-metric:nth-child(2n) {
    border-right: 0;
  }

  .summary-metric:nth-last-child(-n+2) {
    border-bottom: 0;
  }

  .summary-metric {
    min-height: 72px;
    padding: 9px 10px;
  }

  .summary-metric strong {
    font-size: 1.1rem;
  }

  .summary-metric small {
    white-space: normal;
  }

  .growth-path {
    justify-content: space-between;
    gap: 4px;
  }

  .growth-path span {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .growth-path .is-current strong {
    font-size: 1.1rem;
  }

  .dynamic-schedule > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .schedule-item__top,
  .schedule-item p,
  .schedule-empty,
  .journal-table td::before,
  .summary-metric p,
  .summary-metric small {
    font-size: .72rem;
  }

  .overview-chart .trajectory-card {
    min-height: 228px;
    padding: 12px;
  }

  .overview-chart .chart {
    height: 170px;
  }

  .journal-card__header {
    align-items: flex-start;
  }

  .journal-card__header .eyebrow {
    display: none;
  }

  .journal-table,
  .journal-table tbody,
  .journal-table tr,
  .journal-table td {
    display: block;
    width: 100%;
  }

  .journal-table {
    min-width: 0;
  }

  .journal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .journal-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    border-bottom: 1px solid var(--cro-border);
  }

  .journal-table th,
  .journal-table td {
    height: auto;
    min-height: 0;
    padding: 7px 0;
    border: 0;
    white-space: normal;
  }

  .journal-table td::before {
    display: block;
    margin-bottom: 2px;
    color: var(--cro-text-muted);
    content: attr(data-label);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .journal-table td:first-child {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .journal-table td:last-child {
    text-align: left;
  }

  .experiments-journal .journal-table th:first-child,
  .experiments-journal .journal-table td:first-child {
    width: 100%;
  }

  .experiments-journal .journal-action {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-bottom: 0;
  }

  .experiments-journal .journal-action::before {
    display: none;
  }

  .journal-preview > summary span {
    display: none;
  }

  .journal-focus,
  .journal-variants {
    grid-template-columns: 1fr;
  }

  .journal-focus__story {
    border-right: 0;
    border-bottom: 1px solid var(--cro-border);
  }

  .journal-variants img,
  .journal-shot-placeholder {
    height: 220px;
  }
}

/* Dashboard V2: one click opens the complete test story in place. */
.journal-test-list { border-top: 1px solid var(--cro-border); }
.journal-test-row { border-bottom: 1px solid var(--cro-border); }
.journal-test-row > summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1fr) minmax(140px, .55fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 82px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.journal-test-row > summary::-webkit-details-marker { display: none; }
.journal-test-row > summary:hover strong { color: var(--cro-brand-primary); }
.journal-test-row > summary:focus-visible { outline: 2px solid var(--cro-brand-primary); outline-offset: 4px; }
.journal-test-row > summary span { min-width: 0; }
.journal-test-row > summary strong,
.journal-test-row > summary small { display: block; }
.journal-test-row > summary strong { color: var(--cro-text); font-size: .86rem; line-height: 1.35; }
.journal-test-row > summary small { margin-bottom: 4px; color: var(--cro-text-muted); font-size: .68rem; }
.journal-test-row[open] > summary { border-bottom: 1px solid var(--cro-border); }
.journal-test-row .journal-focus { padding: 22px 0 26px; }

@media (max-width: 900px) {
  .journal-test-row > summary { grid-template-columns: 1fr auto; gap: 12px; }
  .journal-test-row > summary > span:nth-child(2),
  .journal-test-row > summary > span:nth-child(3) { grid-column: 1 / -1; }
}

/* Calm owner UI: one decision per screen, detail only on demand. */
html {
  background: var(--cro-bg-canvas);
  color: var(--cro-text);
}

body {
  background: var(--cro-bg-canvas);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--cro-text);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.panel,
.metric-card {
  border-color: var(--cro-border);
  box-shadow: none;
}

.button {
  border-radius: 6px;
  box-shadow: none;
}

.button--primary {
  background: var(--cro-text);
  box-shadow: none;
}

.button--primary:hover {
  background: #363936;
  box-shadow: none;
}

.button:active,
.nav-item:active,
.text-action:active {
  transform: translateY(1px);
}

.eyebrow {
  color: var(--cro-brand-primary);
  font-size: .65rem;
  letter-spacing: .09em;
}

.page-heading {
  align-items: flex-end;
  margin: 8px 0 24px;
}

.page-heading h1,
.page-heading--compact h1 {
  max-width: 820px;
  margin-bottom: 6px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.page-heading p:last-child {
  max-width: 650px;
  color: var(--cro-text-muted);
  font-size: .86rem;
}

.main-content {
  width: min(100%, 1280px);
  padding: 34px 32px 80px;
}

.topbar {
  border-color: var(--cro-border);
  background: rgb(247 246 243 / 94%);
  backdrop-filter: blur(14px);
}

.project-switcher {
  display: grid;
  min-width: 230px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.project-switcher > span {
  color: var(--cro-text-muted);
  font-size: .7rem;
  font-weight: 650;
}

.project-switcher select {
  border: 0;
  background: transparent;
  font-size: .84rem;
}

.period-switcher {
  border-color: var(--cro-border);
  border-radius: 8px;
  background: #fff;
}

.period-switcher button {
  border-radius: 5px;
}

.period-switcher button[aria-pressed="true"] {
  background: #efeee9;
  color: var(--cro-text);
}

@media (min-width: 961px) {
  .sidebar {
    min-height: 56px;
    height: 56px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--cro-border);
    background: #fff;
    color: var(--cro-text);
  }

  .sidebar__brand {
    color: var(--cro-text);
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--cro-brand-primary);
  }

  .sidebar__brand strong {
    color: var(--cro-text);
    font-size: .84rem;
  }

  .sidebar__brand div > span {
    color: var(--cro-text-muted);
    font-size: .56rem;
  }

  .sidebar nav ul {
    justify-content: center;
    gap: 4px;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 13px;
    border-radius: 6px;
    color: #696b68;
    font-size: .76rem;
    font-weight: 600;
  }

  .nav-item:hover {
    background: #f5f4f0;
    color: var(--cro-text);
  }

  .nav-item[aria-current="page"] {
    background: #eeede8;
    color: var(--cro-text);
  }

  .sidebar__status {
    padding-left: 14px;
    border-left: 1px solid var(--cro-border);
  }

  .connection-state {
    color: var(--cro-brand-primary);
    font-size: .7rem;
    font-weight: 650;
  }

  .topbar {
    top: 56px;
    min-height: 58px;
    padding: 9px 24px;
  }
}

.overview-focus {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr);
  overflow: hidden;
  border: 1px solid #dfe5df;
  border-radius: 12px;
  background: #fff;
}

.overview-focus__message {
  min-height: 245px;
  padding: 32px;
  border-right: 1px solid #dfe5df;
  background: #f1f5f0;
}

.overview-focus__message h2 {
  max-width: 720px;
  margin: 6px 0 10px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.16;
  text-wrap: balance;
}

.overview-focus__message > p:not(.eyebrow) {
  max-width: 60ch;
  margin-bottom: 24px;
  font-size: .86rem;
}

.overview-focus__metrics {
  display: grid;
  align-content: start;
}

.overview-focus__metrics > span {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--cro-border);
}

.overview-focus__metrics small {
  color: var(--cro-text-muted);
  font-size: .72rem;
}

.overview-focus__metrics strong {
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}

.overview-focus__metrics [data-state="unknown"] strong {
  color: var(--cro-text-muted);
}

.overview-focus__progress {
  grid-column: 1 / -1;
  padding: 14px 20px 16px;
  background: #fff;
}

.overview-focus__progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: .72rem;
}

.overview-focus__progress span {
  color: var(--cro-text-muted);
}

.overview-focus__progress progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: var(--cro-brand-primary);
}

.dynamic-schedule {
  margin: 18px 0;
  border-radius: 12px;
}

.dynamic-schedule > header {
  min-height: 62px;
  padding: 14px 18px;
}

.text-action {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--cro-brand-primary);
  font-size: .74rem;
  font-weight: 700;
}

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

.schedule-lane {
  padding: 16px 18px 18px;
  background: #fff;
}

.schedule-lane:nth-child(2) {
  border-right: 0;
}

.schedule-lane--week {
  grid-column: 1 / -1;
  padding: 0;
  border-top: 1px solid var(--cro-border);
  background: #fafaf8;
}

.schedule-lane--week > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  color: var(--cro-text);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 650;
  list-style: none;
}

.schedule-lane--week > summary::-webkit-details-marker {
  display: none;
}

.schedule-lane--week > summary::after {
  color: var(--cro-text-muted);
  content: '+';
  font-size: 1.1rem;
}

.schedule-lane--week[open] > summary::after {
  content: '−';
}

.schedule-lane--week > summary span {
  margin-left: auto;
  color: var(--cro-text-muted);
  font-size: .7rem;
}

.schedule-lane--week > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.schedule-item--running,
.schedule-item--next {
  border-color: var(--cro-border);
  background: #fafaf8;
}

.secondary-disclosure,
.expert-disclosure {
  margin: 16px 0;
  border: 1px solid var(--cro-border);
  border-radius: 10px;
  background: #fff;
}

.secondary-disclosure > summary,
.expert-disclosure > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.secondary-disclosure > summary::-webkit-details-marker,
.expert-disclosure > summary::-webkit-details-marker {
  display: none;
}

.secondary-disclosure > summary::after,
.expert-disclosure > summary::after {
  margin-left: auto;
  color: var(--cro-text-muted);
  content: '+';
  font-size: 1.2rem;
}

.secondary-disclosure[open] > summary::after,
.expert-disclosure[open] > summary::after {
  content: '−';
}

.secondary-disclosure > summary span,
.expert-disclosure > summary span {
  font-size: .84rem;
  font-weight: 700;
}

.secondary-disclosure > summary small,
.expert-disclosure > summary small {
  color: var(--cro-text-muted);
  font-size: .72rem;
}

.secondary-disclosure[open] > summary,
.expert-disclosure[open] > summary {
  border-bottom: 1px solid var(--cro-border);
}

.secondary-disclosure .trajectory-card,
.expert-disclosure .panel {
  border: 0;
  border-radius: 0 0 10px 10px;
}

.journal-table tbody tr {
  background: #fff;
}

.journal-card__header > span {
  color: var(--cro-text-muted);
  font-weight: 600;
}

.journal-card__footer {
  display: flex;
  justify-content: flex-end;
  padding: 9px 14px;
  border-top: 1px solid var(--cro-border);
  background: #fafaf8;
}

@media (max-width: 960px) {
  .sidebar {
    background: #fff;
    box-shadow: 12px 0 30px rgb(30 34 31 / 8%);
  }

  .sidebar__brand,
  .sidebar__brand strong,
  .connection-state {
    color: var(--cro-text);
  }

  .sidebar__brand div > span,
  .sidebar__goal,
  .sidebar__note {
    color: var(--cro-text-muted);
  }

  .nav-item {
    color: var(--cro-text-muted);
  }

  .nav-item:hover,
  .nav-item[aria-current="page"] {
    background: #eeede8;
    color: var(--cro-text);
  }

  .sidebar__status {
    border-color: var(--cro-border);
  }

  .overview-focus {
    grid-template-columns: 1fr;
  }

  .overview-focus__message {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #dfe5df;
  }

  .overview-focus__progress {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 24px 14px 56px;
  }

  .project-switcher {
    min-width: 0;
  }

  .project-switcher > span {
    display: none;
  }

  .page-heading {
    margin-bottom: 18px;
  }

  .page-heading h1,
  .page-heading--compact h1 {
    font-size: 1.85rem;
  }

  .overview-focus__message {
    padding: 24px 20px;
  }

  .schedule-grid,
  .schedule-lane--week > div {
    grid-template-columns: 1fr;
  }

  .schedule-lane {
    border-right: 0;
    border-bottom: 1px solid var(--cro-border);
  }

  .schedule-lane:nth-child(2) {
    border-bottom: 0;
  }

  .secondary-disclosure > summary,
  .expert-disclosure > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 13px 42px 13px 14px;
  }

  .secondary-disclosure > summary::after,
  .expert-disclosure > summary::after {
    position: absolute;
    right: 16px;
  }
}
