:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --paper: #ffffff;
  --paper-soft: #fbfbf8;
  --ink: #233033;
  --muted: #667073;
  --line: #d8ddd7;
  --green: #96c93c;
  --green-dark: #6f9f25;
  --plum: #22458E;
  --gold: #96c93c;
  --blue: #22458E;
  --danger: #a5473d;
  --shadow: 0 18px 45px rgba(35, 48, 51, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(34, 69, 142, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #eef4ff);
}

.brand-mark svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.topbar-right {
  display: grid;
  justify-items: end;
  gap: 10px;
  margin-left: auto;
}

.site-logo {
  display: block;
  width: min(360px, 38vw);
  max-height: 82px;
  object-fit: contain;
  object-position: right center;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2,
h3,
.eyebrow,
.view-header p,
.comparison-question p,
.hint-text,
.summary-panel h3 {
  color: var(--blue);
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.session-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(150, 201, 60, 0.18);
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.tool-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.client-fields {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 11px 12px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(150, 201, 60, 0.18);
}

.step-list {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.step-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.step-button[aria-current="step"] {
  border-color: rgba(34, 69, 142, 0.42);
  background: #edf3ff;
}

.step-button:disabled {
  opacity: 0.5;
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f0f1ed;
  color: var(--muted);
  font-weight: 800;
}

.step-button[aria-current="step"] .step-number {
  background: var(--green);
  color: #ffffff;
}

.step-button strong,
.step-button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.step-button small {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.privacy-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(34, 69, 142, 0.18);
  border-radius: 8px;
  background: #edf3ff;
}

.privacy-note strong,
.privacy-note span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.privacy-note strong {
  color: var(--green-dark);
  font-size: 0.86rem;
}

.privacy-note span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tool-surface {
  min-height: 720px;
  overflow: hidden;
}

#app {
  min-height: 720px;
}

.view {
  display: grid;
  gap: 24px;
  padding: 26px;
}

.view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.view-header h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.view-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.metric {
  min-width: 112px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  font-size: 1.35rem;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.controls-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.controls-row > * {
  min-width: 0;
}

.search-field {
  display: block;
  position: relative;
}

.search-field input {
  display: block;
  padding-left: 42px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  pointer-events: none;
}

.pill-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.pill-button {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.pill-button.is-active {
  border-color: rgba(34, 69, 142, 0.42);
  background: #edf3ff;
  color: var(--green-dark);
}

.pill-button:focus-visible,
.value-card:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.choice-button:focus-visible {
  outline: 3px solid rgba(150, 201, 60, 0.35);
  outline-offset: 2px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.value-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.value-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(35, 48, 51, 0.08);
}

.value-card.is-selected {
  border-color: rgba(150, 201, 60, 0.72);
  background: #f5faec;
}

.value-card.is-maxed {
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.value-card.is-maxed:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

.value-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.value-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.03rem;
}

.checkmark {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
}

.value-card.is-selected .checkmark {
  border-color: var(--green);
  background: var(--green);
}

.checkmark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.value-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.category-tag {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f1ed;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.custom-entry {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border: 1px dashed #bfc9c2;
  border-radius: 8px;
  background: var(--paper-soft);
  cursor: text;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.custom-entry:focus-within {
  border-color: rgba(34, 69, 142, 0.5);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(150, 201, 60, 0.16);
}

.custom-entry label {
  cursor: text;
}

.custom-entry button {
  cursor: pointer;
}

.custom-feedback {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.choice-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
}

.primary-button:disabled {
  border-color: #b9c3bd;
  background: #b9c3bd;
}

.secondary-button {
  border: 1px solid rgba(34, 69, 142, 0.35);
  background: #edf3ff;
  color: var(--blue);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.ghost-button.danger {
  color: var(--danger);
}

.button-icon,
.button-icon svg {
  width: 17px;
  height: 17px;
}

.button-icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.view-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.hint-text,
.validation-text {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.validation-text strong {
  color: var(--ink);
}

.comparison-stage {
  display: grid;
  gap: 22px;
}

.progress-meter {
  display: grid;
  gap: 8px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e8e2;
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.2s ease;
}

.comparison-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f6f9ff);
}

.comparison-question {
  max-width: 790px;
}

.comparison-question h3 {
  margin-bottom: 8px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.comparison-question p {
  margin-bottom: 0;
  color: var(--muted);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.elimination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.choice-button {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-height: 178px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.choice-button:hover {
  border-color: rgba(34, 69, 142, 0.5);
  box-shadow: 0 14px 26px rgba(35, 48, 51, 0.08);
}

.choice-button strong {
  font-size: 1.25rem;
}

.choice-button span {
  color: var(--muted);
  font-size: 0.95rem;
}

.elimination-button {
  min-height: 150px;
}

.comparison-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.rank-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #f0f1ed;
  color: var(--muted);
  font-weight: 900;
}

.rank-item.is-top .rank-number {
  background: var(--plum);
  color: #ffffff;
}

.rank-copy strong,
.rank-copy span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rank-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.top-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reflection-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.reflection-card header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.reflection-card h3 {
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
  line-height: 1.2;
}

.reflection-card small {
  color: var(--muted);
  font-weight: 750;
}

.reflection-card .rank-number {
  width: 34px;
  height: 34px;
  background: var(--green);
  color: #ffffff;
}

.prompt-stack {
  display: grid;
  gap: 10px;
}

.prompt-stack label {
  font-size: 0.76rem;
}

.summary-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(34, 69, 142, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
}

.summary-panel h3 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.summary-output {
  display: grid;
  gap: 14px;
}

.summary-value {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-value:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-value strong {
  color: var(--green-dark);
}

.summary-value p {
  margin-bottom: 0;
  color: var(--muted);
}

.share-callout {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(34, 69, 142, 0.22);
  border-radius: 8px;
  background: #edf3ff;
}

.share-callout strong,
.share-callout span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.share-callout strong {
  color: var(--green-dark);
  font-size: 1rem;
}

.share-callout span {
  color: var(--muted);
  font-size: 0.92rem;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.email-button {
  flex: 1 1 100%;
  min-height: 54px;
  justify-content: flex-start;
  padding: 0 18px;
  font-size: 1rem;
}

.partner-button {
  flex: 1 1 260px;
}

.empty-state {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 24px;
  border: 1px dashed #bfc9c2;
  border-radius: 8px;
  background: var(--paper-soft);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .sidebar {
    position: static;
  }

  .step-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .top-three-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1380px);
    padding: 12px 0;
  }

  .topbar,
  .view-header,
  .controls-row,
  .custom-entry,
  .choice-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-right {
    justify-items: start;
    margin-left: 0;
  }

  .site-logo {
    width: min(100%, 320px);
    max-height: 72px;
    object-position: left center;
  }

  .session-note {
    width: max-content;
    max-width: 100%;
  }

  .view {
    padding: 18px;
  }

  .step-list {
    grid-template-columns: 1fr;
  }

  .sidebar-actions,
  .rank-item {
    grid-template-columns: 1fr;
  }

  .rank-item {
    align-items: start;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .sidebar,
  .view-header,
  .view-footer,
  .export-actions,
  .toast {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .tool-surface,
  #app,
  .view {
    display: block;
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .reflection-card,
  .summary-panel {
    break-inside: avoid;
  }
}

