/* style.css — design tokens + components — «РЕШИ.» */

:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.25rem, 1rem + 3.5vw, 4.25rem);

  /* Spacing (4px system) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fedorov-team palette — cool corporate blue on light neutral surfaces */
  --color-bg: #eef1f9;
  --color-surface: #ffffff;
  --color-surface-2: #e7ebf7;
  --color-surface-offset: #dbe1f2;
  --color-border: oklch(0.3 0.04 265 / 0.14);
  --color-divider: oklch(0.3 0.04 265 / 0.09);

  --color-text: #10142b;
  --color-text-muted: #545a7a;
  --color-text-faint: #8c92b3;
  --color-text-inverse: #f2f4fc;

  --color-primary: #1c34dc;
  --color-primary-hover: #1226ab;
  --color-primary-active: #0d1c80;
  --color-primary-highlight: #dde3fb;

  --color-success: #227a4e;
  --color-success-highlight: #d9ecdf;

  --brand-gradient: linear-gradient(135deg, #0037d2 0%, #0c1c6b 55%, #050a26 100%);
  --brand-grid-line: rgba(255, 255, 255, 0.07);

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.03 50 / 0.08);
  --shadow-md: 0 8px 24px oklch(0.2 0.03 50 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.2 0.03 50 / 0.16);

  --content-narrow: 620px;
  --content-default: 880px;
  --content-wide: 1120px;

  --font-display: 'Cabinet Grotesk', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0a0f24;
  --color-surface: #121834;
  --color-surface-2: #17203f;
  --color-surface-offset: #1c2749;
  --color-border: oklch(0.95 0.02 265 / 0.12);
  --color-divider: oklch(0.95 0.02 265 / 0.07);

  --color-text: #eef1fb;
  --color-text-muted: #a7add0;
  --color-text-faint: #656c94;
  --color-text-inverse: #0a0f24;

  --color-primary: #5b78ff;
  --color-primary-hover: #7891ff;
  --color-primary-active: #97aaff;
  --color-primary-highlight: #1c2870;

  --color-success: #7fc79c;
  --color-success-highlight: #163826;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a0f24;
    --color-surface: #121834;
    --color-surface-2: #17203f;
    --color-surface-offset: #1c2749;
    --color-border: oklch(0.95 0.02 265 / 0.12);
    --color-divider: oklch(0.95 0.02 265 / 0.07);
    --color-text: #eef1fb;
    --color-text-muted: #a7add0;
    --color-text-faint: #656c94;
    --color-text-inverse: #0a0f24;
    --color-primary: #5b78ff;
    --color-primary-hover: #7891ff;
    --color-primary-active: #97aaff;
    --color-primary-highlight: #1c2870;
    --color-success: #7fc79c;
    --color-success-highlight: #163826;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.5);
  }
}

/* ---------- Layout shells ---------- */

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--transition-interactive);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Brand surface: the Fedorov-team navy gradient + subtle grid, used on
   header, footer and the CTA block regardless of light/dark theme. */
.brand-surface {
  background-image:
    repeating-linear-gradient(0deg, var(--brand-grid-line) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, var(--brand-grid-line) 0 1px, transparent 1px 56px),
    var(--brand-gradient);
  color: #eef1fb;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) clamp(var(--space-5), 4vw, var(--space-10));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #f4f6fd;
  text-decoration: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  color: #7c92ff;
  flex-shrink: 0;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  color: #f4f6fd;
}
.version-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6em;
  font-weight: 700;
  color: #9fb2ff;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: 0.1em;
}
.brand-sub {
  display: none;
}
@media (min-width: 640px) {
  .brand-sub {
    display: inline;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    color: rgba(238, 241, 251, 0.55);
    padding-left: var(--space-3);
    margin-left: var(--space-3);
    border-left: 1px solid rgba(238, 241, 251, 0.2);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.partner-logo-link {
  display: flex;
  align-items: center;
  opacity: 0.92;
}
.partner-logo-link:hover {
  opacity: 1;
}
.partner-logo {
  height: 30px;
  width: auto;
  display: block;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: rgba(238, 241, 251, 0.75);
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f6fd;
}

main {
  display: block;
}

.screen {
  padding-block: clamp(var(--space-10), 6vw, var(--space-20));
  padding-inline: clamp(var(--space-5), 4vw, var(--space-10));
}
.screen[hidden] {
  display: none;
}

.wrap-narrow {
  max-width: var(--content-narrow);
  margin-inline: auto;
}
.wrap-default {
  max-width: var(--content-default);
  margin-inline: auto;
}

@media (min-width: 860px) {
  .wrap-narrow {
    max-width: 760px;
  }
}
@media (min-width: 1180px) {
  .wrap-narrow {
    max-width: 860px;
  }
}
@media (min-width: 1500px) {
  .wrap-narrow {
    max-width: 940px;
  }
}

/* ---------- Intro / hero ---------- */

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}
.hero-kicker::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--color-primary);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  max-width: 22ch;
}
@media (min-width: 1180px) {
  .hero-title {
    max-width: 26ch;
  }
}
.hero-title em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 58ch;
  margin-bottom: var(--space-4);
}
.hero-body p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  max-width: 62ch;
}
.hero-body strong {
  color: var(--color-text);
  font-weight: 600;
}

.hero-divider {
  height: 1px;
  background: var(--color-divider);
  margin-block: var(--space-10);
  border: none;
}

.algo-preview {
  display: grid;
  gap: var(--space-3);
  margin-block: var(--space-10);
}
.algo-preview-item {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}
.algo-preview-item:last-child {
  border-bottom: none;
}
.algo-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-faint);
  min-width: 2ch;
}
.algo-label {
  font-size: var(--text-base);
  color: var(--color-text);
  font-weight: 500;
}

.privacy-note {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}
.privacy-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--color-text-faint);
}
.privacy-note p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #f4f6fd;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-faint);
}
.btn-text {
  background: none;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
}
.btn-text:hover {
  color: var(--color-text);
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- Wizard ---------- */

.wizard-head {
  margin-bottom: var(--space-10);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.progress-label .current-step-name {
  color: var(--color-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: var(--text-sm);
}
.progress-track {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-plan-link {
  display: block;
  width: 100%;
  text-align: right;
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
}
.back-to-plan-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* ---------- Reversibility gate (шаг 0) ---------- */

.gate-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-block: var(--space-8);
}
@media (max-width: 640px) {
  .gate-options {
    grid-template-columns: 1fr;
  }
}
.gate-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  text-align: left;
  padding: clamp(var(--space-5), 3vw, var(--space-6));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.gate-option:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.gate-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-primary);
  flex-shrink: 0;
}
.gate-option-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.gate-option-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.gate-option[aria-pressed='true'] {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.gate-result-card {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 4vw, var(--space-8));
  margin-bottom: var(--space-6);
}
.gate-result-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.gate-result-card p:not(.gate-result-title) {
  color: var(--color-text-muted);
}

.step-panel {
  animation: step-in 380ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  max-width: 22ch;
}
.step-hint {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 56ch;
}
.step-hint strong {
  color: var(--color-text);
}

.field-group {
  margin-bottom: var(--space-8);
}
.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.field-caption {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

textarea,
input[type='text'] {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
  resize: vertical;
}
textarea::placeholder,
input::placeholder {
  color: var(--color-text-faint);
}
textarea:focus,
input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}
textarea {
  min-height: 100px;
}
textarea.compact {
  min-height: 70px;
}
textarea.tall {
  min-height: 150px;
}

.sentence-field {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}
.sentence-field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}
.sentence-prefix {
  display: flex;
  align-items: center;
  padding-inline: var(--space-3);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.sentence-field input {
  flex: 1;
  min-width: 180px;
  border: none;
  background: transparent;
  padding: var(--space-3);
}
.sentence-field input:focus {
  box-shadow: none;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  min-height: 44px;
}
.chip:hover {
  border-color: var(--color-text-faint);
}
.chip[aria-pressed='true'] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #f4f6fd;
}

.micro-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.micro-step-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.micro-step-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.micro-step-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.micro-step-row input {
  flex: 1;
}
.micro-step-assignee-row,
.micro-step-deadline-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-6);
}
.deadline-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: var(--space-6);
  margin-top: var(--space-1);
}
.deadline-preset {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
}
.deadline-preset:hover {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.assignee-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-faint);
}
.assignee-input {
  flex: 1;
  min-height: 36px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--space-2) var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.assignee-input:focus {
  border-color: var(--color-primary);
  box-shadow: none;
  color: var(--color-text);
}
.assignee-input::placeholder {
  color: var(--color-text-faint);
}
.result-assignee {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
}
.micro-step-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  color: var(--color-text-faint);
}
.micro-step-remove:hover {
  color: var(--color-error, var(--color-primary));
  background: var(--color-surface-2);
}
.add-micro-step {
  align-self: flex-start;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-1);
}
.add-micro-step:hover {
  color: var(--color-primary-hover);
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

/* ---------- Result screen ---------- */

.result-head {
  margin-bottom: var(--space-10);
}
.result-kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.result-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}
.result-decision {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 3vw, var(--space-8));
  margin-bottom: var(--space-5);
}
.result-card-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.result-card-question {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.result-card-answer {
  font-size: var(--text-base);
  color: var(--color-text);
  white-space: pre-wrap;
}
.result-card-answer.empty {
  color: var(--color-text-faint);
  font-style: italic;
}
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.result-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.result-tag-critical {
  background: var(--color-primary);
  color: #f4f6fd;
}
.result-list {
  display: grid;
  gap: var(--space-2);
}
.result-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-base);
  color: var(--color-text);
}
.result-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 0.6em;
  flex-shrink: 0;
}

/* ---------- Result sections (structured plan) ---------- */

.result-section {
  margin-bottom: var(--space-10);
}
.result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.result-section-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0;
}
.result-section-title .num {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
}
.section-edit-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  flex-shrink: 0;
  white-space: nowrap;
}
.section-edit-link:hover {
  color: var(--color-primary);
}

.diagnosis-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.diagnosis-divider {
  border: none;
  height: 1px;
  background: var(--color-divider);
  margin-block: var(--space-6);
}
.belief-quote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text);
}
.belief-quote.empty {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-faint);
}

.risk-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.risk-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.risk-chip .risk-chip-label {
  color: var(--color-text-faint);
  font-weight: 500;
}
.risk-chip.level-good {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.risk-chip.level-good .risk-chip-label {
  color: var(--color-success);
  opacity: 0.75;
}
.risk-chip.level-warn {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.risk-chip.level-warn .risk-chip-label {
  color: var(--color-primary);
  opacity: 0.75;
}
.risk-chip.level-bad {
  background: var(--color-primary);
  color: #f4f6fd;
}
.risk-chip.level-bad .risk-chip-label {
  color: #f4f6fd;
  opacity: 0.75;
}

.capsule-card {
  background: var(--color-surface);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 3vw, var(--space-8));
}
.capsule-card .diagnosis-label {
  color: var(--color-text-faint);
}
.capsule-review-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--color-divider);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.alt-item {
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.alt-item:last-child {
  border-bottom: none;
}
.alt-item:first-child {
  padding-top: 0;
}

.action-plan-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin: var(--space-6) 0 var(--space-4);
}
.action-plan-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.action-plan-item {
  display: flex;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) clamp(var(--space-5), 3vw, var(--space-6));
}
.action-plan-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  flex-shrink: 0;
  padding-top: 0.15em;
}
.action-plan-body {
  flex: 1;
  min-width: 0;
}
.action-plan-text {
  font-size: var(--text-base);
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.action-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.meta-chip svg {
  flex-shrink: 0;
}
.assignee-chip {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.deadline-chip {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.deadline-chip.nodate {
  color: var(--color-text-faint);
}
.deadline-chip.normal {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.deadline-chip.soon {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.deadline-chip.overdue {
  background: var(--color-primary);
  color: #f4f6fd;
}

.success-list {
  display: grid;
  gap: var(--space-5);
}
.success-list dt {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.success-list dd {
  font-size: var(--text-base);
  color: var(--color-text);
}
.success-list dd.empty {
  color: var(--color-text-faint);
  font-style: italic;
}

.closing-quote {
  border-left: none;
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  margin-block: var(--space-10);
}
.closing-quote p {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text);
  max-width: 46ch;
}
.closing-quote p + p {
  margin-top: var(--space-4);
}

.cta-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-8), 5vw, var(--space-12));
  margin-top: var(--space-12);
}
.cta-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: #f8f9fe;
  max-width: 20ch;
}
.cta-card p {
  color: rgba(238, 241, 251, 0.7);
  margin-bottom: var(--space-6);
  max-width: 52ch;
}
.cta-card .btn-primary {
  background: #3355ff;
}
.cta-card .btn-primary:hover {
  background: #4d6bff;
}
.cta-watermark {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  height: 44px;
  width: auto;
  opacity: 0.5;
}
@media (max-width: 640px) {
  .cta-watermark {
    height: 32px;
  }
}

.copy-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-interactive);
  z-index: 50;
}
.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  padding: var(--space-8) clamp(var(--space-5), 4vw, var(--space-10)) var(--space-10);
  text-align: left;
}
.footer-credit {
  font-size: var(--text-xs);
  color: rgba(238, 241, 251, 0.55);
  max-width: 60ch;
  margin-bottom: var(--space-5);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.footer-brand .line {
  flex: 1;
  max-width: 48px;
  height: 1px;
  background: rgba(238, 241, 251, 0.25);
}
.footer-brand a {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f4f6fd;
  text-decoration: none;
}
.footer-brand a:hover {
  color: #a9b8ff;
}

/* ---------- Print (used for "Save as PDF") ---------- */

@media print {
  :root,
  [data-theme] {
    --color-bg: #ffffff;
    --color-surface: #f7f5f0;
    --color-surface-2: #efebe2;
    --color-text: #16130f;
    --color-text-muted: #55504a;
    --color-text-faint: #8b857a;
    --color-border: rgba(20, 15, 10, 0.15);
    --color-divider: rgba(20, 15, 10, 0.1);
    --color-primary: #1c34dc;
    --color-primary-highlight: #dde3fb;
    --color-success: #227a4e;
    --color-success-highlight: #d9ecdf;
  }
  .site-header,
  .site-footer,
  .step-nav,
  .cta-card,
  .copy-toast,
  .no-print,
  .section-edit-link,
  #screen-intro,
  #screen-gate,
  #screen-step {
    display: none !important;
  }
  #screen-result {
    display: block !important;
    padding: 0;
  }
  body {
    background: #fff;
    color: var(--color-text);
  }
  .result-card,
  .action-plan-item {
    border: 1px solid var(--color-border);
    box-shadow: none;
    break-inside: avoid;
  }
  .deadline-chip.overdue {
    background: var(--color-primary-highlight);
    color: var(--color-primary);
  }
}

/* ---------- Responsive ---------- */

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .micro-step-assignee-row,
  .micro-step-deadline-row,
  .deadline-presets {
    margin-left: 0;
  }
  .step-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--space-3);
  }
  .step-nav .btn-row {
    width: 100%;
    justify-content: stretch;
  }
  .step-nav .btn {
    flex: 1;
  }
  .sentence-prefix {
    width: 100%;
  }
}
