/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --primary: #1a1a2e;
  --body: #2e2e3a;
  --secondary: #4a4a5a;
  --bg: #fafaf8;
  --surface: #ffffff;
  --muted: #6b6b78;
  --border: #e0e0e0;
  --accent-bg: #f0f4ff;
  --accent-border: #c8d6f0;
  --warning-bg: #fffbe6;
  --warning-border: #f0e6b0;
  --warning-text: #6b6320;
  --error: #dc3545;
  --chip-selected-bg: #1a1a2e;
  --chip-selected-text: #fff;
  --chip-border: #c0c0c0;
  --radius: 10px;
  --radius-sm: 6px;
  --callout-blue: #edf4fd;
  --callout-blue-border: #4a90d9;
  --callout-blue-text: #2c5282;
  --callout-yellow: #fdf8e8;
  --callout-yellow-border: #d4a843;
  --callout-yellow-text: #744d10;
  --callout-purple: #f3eeff;
  --callout-purple-border: #7c5cbf;
  --callout-purple-text: #4c3575;
  --distribution-bg: linear-gradient(135deg, #f8f5ff 0%, #f0f4ff 100%);
  --tip-bg: #f7f7f5;
  --tip-text: #484855;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--body);
  line-height: 1.65;
  min-height: 100vh;
}

/* === Typography === */
h1, h2, h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
}

code, .mono {
  font-family: 'DM Mono', 'Menlo', monospace;
}

/* === Brand === */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}

.brand-name {
  font-family: 'DM Mono', monospace;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -1px;
  color: var(--primary);
}

.brand-name--small {
  font-size: 1.25rem;
}

.beta-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  position: relative;
  top: -2px;
}

.tagline {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

/* === Login Page === */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary);
}

.required {
  color: var(--error);
}

/* App form overrides — scoped to .step */
.step .form-group {
  margin-bottom: 2.2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #ededea;
}

.step .form-group:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1rem;
}

.step label {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.15rem;
  line-height: 1.35;
  color: var(--primary);
}

.step .required {
  font-family: 'DM Sans', sans-serif;
}

/* Question number prefix */
.question-number {
  color: var(--muted);
  margin-right: 6px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  border: 1.5px solid #b0b0b0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--body);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}

textarea {
  resize: vertical;
  min-height: 3.2rem;
}

.helper-text {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.3rem;
}

/* === Field Tips (collapsible guidance) === */
.field-tip {
  margin: 0.45rem 0 0.8rem;
  background: var(--tip-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid #d0d0cc;
}

.field-tip-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  text-align: left;
}

.field-tip-toggle:hover {
  color: var(--primary);
}

.field-tip-toggle-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.field-tip-toggle:hover .field-tip-toggle-icon {
  background: var(--primary);
}

.field-tip-toggle-label {
  flex: 1;
}

.field-tip-toggle-arrow {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.field-tip.open .field-tip-toggle-arrow {
  transform: rotate(180deg);
}

.field-tip-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--tip-text);
  padding: 0 0.85rem 0.6rem;
}

.field-tip-body p {
  margin-bottom: 0.4rem;
}

.field-tip-body p:last-child {
  margin-bottom: 0;
}

.field-tip-body ul {
  margin: 0.3rem 0 0.4rem;
  padding-left: 1.2rem;
}

.field-tip-body ul:last-child {
  margin-bottom: 0;
}

.field-tip-body li {
  margin-bottom: 0.15rem;
}

.field-tip-body strong {
  font-weight: 600;
  color: var(--primary);
}

/* Themed tips per stage — warm neutral, distinct from callout boxes */
.callout--blue + div .field-tip,
.step:not(.step--distribution) .field-tip {
  border-left-color: #b8b8b0;
  background: var(--tip-bg);
}

.step--distribution .field-tip {
  border-left-color: #b8b8b0;
  background: var(--tip-bg);
}

.char-count {
  font-size: 0.8rem;
  color: var(--secondary);
  margin-top: 0.2rem;
  text-align: right;
}

.char-count--warn {
  color: var(--warning-text);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}

.btn-primary--generate {
  padding: 12px 28px;
  font-size: 0.95rem;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
}

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: var(--primary);
}

.login-card .btn-primary {
  width: 100%;
  margin-top: 4px;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === Error & Messages === */
.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 12px;
  padding: 10px 14px;
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius-sm);
}

/* === OTP State === */
.otp-sent-text {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 20px;
}

#otpInput {
  font-family: 'DM Mono', monospace;
  font-size: 1.5rem;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px;
}

.otp-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.separator {
  color: var(--border);
  font-size: 0.85rem;
}

/* === App Header === */
.app-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.user-email {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}

/* === Progress Bar === */
.progress-container {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.progress-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 24px;
}

.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.step-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}

.progress-step.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.progress-step.active .step-label {
  color: var(--primary);
}

.progress-step.completed .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.progress-step.completed .step-label {
  color: var(--primary);
}

/* Star badge on step 3 dot */
.step-dot--star {
  position: relative;
}

.step-dot--star::after {
  content: '\2605';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.6rem;
  color: var(--callout-purple-border);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  transition: background 0.2s;
  min-width: 12px;
}

.progress-line--wide {
  flex: 1.6;
}

.progress-line.completed {
  background: var(--primary);
}

/* === Main Content === */
.main-content {
  padding: 32px 24px 64px;
}

.content-inner {
  max-width: 700px;
  margin: 0 auto;
}

.step-title {
  font-size: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--primary);
}

.step-title-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.step-title-row .step-title {
  margin-bottom: 0;
}

.sample-data-link {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--callout-blue-border);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: color 0.15s;
}

.sample-data-link:hover {
  color: var(--primary);
}

.step-scope {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.step-subtitle {
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 1.4rem;
  font-style: italic;
}

/* === Educational Callouts === */
.callout {
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.65;
  border-left: 3px solid;
}

.callout p {
  margin-bottom: 0.5rem;
}

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

.callout--blue {
  background: var(--callout-yellow);
  border-left-color: var(--callout-yellow-border);
  color: var(--body);
}

.callout--yellow {
  background: var(--callout-yellow);
  border-left-color: var(--callout-yellow-border);
  color: var(--body);
}

.callout--purple {
  background: var(--callout-yellow);
  border-left-color: var(--callout-yellow-border);
  color: var(--body);
}

/* === Distribution Section Special Treatment === */
.step--distribution {
  background: var(--distribution-bg);
  margin: -32px -24px;
  padding: 32px 24px 64px;
}

.distribution-badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--callout-purple-border);
  color: #fff;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}

/* === Chip Select === */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip {
  padding: 0.4rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid var(--chip-border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--primary);
}

.chip.selected {
  background: var(--chip-selected-bg);
  color: var(--chip-selected-text);
  border-color: var(--chip-selected-bg);
}

/* Helper chips (clickable to append) */
.chip--helper {
  font-size: 0.88rem;
  padding: 0.35rem 0.85rem;
  background: var(--surface);
}

.chip--helper.selected {
  background: var(--callout-purple-border);
  border-color: var(--callout-purple-border);
  color: #fff;
}

.chip-group--helper {
  margin-bottom: 10px;
}

/* === Paired Inputs === */
.paired-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.paired-inputs--stacked {
  flex-direction: column;
  align-items: stretch;
}

.paired-input {
  flex: 1;
}

.paired-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.paired-arrow {
  font-size: 1.2rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 20px;
}

/* === Partner Inputs === */
.partner-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* === Validation === */
.input--invalid {
  border-color: var(--error) !important;
}

.validation-hint {
  font-size: 0.85rem;
  color: var(--error);
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 16px;
}

/* === Step Actions === */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* === Review Card === */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

.review-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.review-section:last-child {
  border-bottom: none;
}

.review-section--distribution {
  background: var(--callout-purple);
  border-left: 4px solid var(--callout-purple-border);
}

.review-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 12px;
}

.review-item {
  margin-bottom: 12px;
}

.review-item:last-child {
  margin-bottom: 0;
}

.review-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
  font-family: 'DM Mono', monospace;
}

.review-value {
  font-size: 0.95rem;
  color: var(--primary);
  line-height: 1.5;
  white-space: pre-line;
}

/* === Generate Note === */
.generate-note {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
}

/* === Disclaimer Box === */
.disclaimer-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--warning-text);
  line-height: 1.5;
  margin-bottom: 24px;
}

.disclaimer-box strong {
  font-weight: 600;
}

/* === Loading State === */
.loading-state {
  text-align: center;
  padding: 80px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-text {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 8px;
  transition: opacity 0.3s;
}

.loading-timer {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

/* === Error State === */
.error-state {
  text-align: center;
  padding: 60px 0;
}

.error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fdf2f2;
  color: var(--error);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.error-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-state .error-message {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  text-align: center;
}

/* === Results === */
.result-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  line-height: 1.7;
  max-height: none;
}

.result-content h1 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.result-content h1:first-child {
  margin-top: 0;
}

.result-content h2 {
  font-size: 1.25rem;
  margin: 28px 0 12px;
}

.result-content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.result-content p {
  margin-bottom: 12px;
}

.result-content ul,
.result-content ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.result-content li {
  margin-bottom: 4px;
}

.result-content li > ul,
.result-content li > ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

.result-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.result-content strong {
  font-weight: 600;
}

.result-content blockquote {
  border-left: 3px solid var(--accent-border);
  padding: 8px 14px;
  margin: 8px 0;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Highlight the Distribution Engine section in results */
.result-content h2:nth-of-type(3),
.result-content h2:nth-of-type(3) ~ h3,
.result-content h2:nth-of-type(3) ~ p,
.result-content h2:nth-of-type(3) ~ ul,
.result-content h2:nth-of-type(3) ~ ol {
  /* Handled by the markdown structure naturally */
}

/* === Stage Output (inline deliverable) === */
.stage-output {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.output-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--primary);
}

.output-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.output-content h1 {
  font-size: 1.4rem;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.output-content h1:first-child {
  margin-top: 0;
}

.output-content h2 {
  font-size: 1.15rem;
  margin: 22px 0 10px;
}

.output-content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 16px 0 6px;
}

.output-content p {
  margin-bottom: 10px;
}

.output-content ul,
.output-content ol {
  margin-bottom: 10px;
  padding-left: 22px;
}

.output-content li {
  margin-bottom: 4px;
}

.output-content li > ul,
.output-content li > ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

.output-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.output-content strong {
  font-weight: 600;
}

.output-content blockquote {
  border-left: 3px solid var(--accent-border);
  padding: 8px 14px;
  margin: 8px 0;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.output-error {
  color: var(--error);
  padding: 16px;
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius-sm);
}

.generating-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner--sm {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.output-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* === Step Status Badge === */
.step-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: #2d8a4e;
  background: #e6f4ea;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* === Review Edit Button === */
.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.review-edit-btn {
  font-size: 0.8rem;
}

/* === Streaming cursor animation === */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* === Footer === */
.footer {
  padding: 32px 24px 24px;
  text-align: center;
  margin: 0 auto;
  max-width: 760px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-feedback {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
  margin-left: auto;
  margin-right: auto;
  max-width: 420px;
  text-align: center;
  line-height: 1.5;
}

.footer-feedback a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-logo-link {
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.footer-logo-link:hover {
  opacity: 0.7;
}

.footer-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* === Responsive === */
@media (max-width: 600px) {
  .login-card {
    padding: 32px 20px;
  }

  .header-inner {
    padding: 10px 16px;
  }

  .user-email {
    display: none;
  }

  /* Progress bar: hide status badges on mobile to prevent overflow */
  .step-status {
    display: none !important;
  }

  .progress-inner {
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .progress-steps {
    min-width: 0;
  }

  .step-label {
    font-size: 0.75rem;
  }

  .progress-line {
    min-width: 8px;
    margin: 0 4px;
  }

  .main-content {
    padding: 24px 16px 48px;
  }

  .step--distribution {
    margin: -24px -16px;
    padding: 24px 16px 48px;
  }

  .step-title {
    font-size: 1.5rem;
  }

  .step label {
    font-size: 1.1rem;
  }

  .chip {
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
  }

  .paired-inputs {
    flex-direction: column;
  }

  .paired-arrow {
    transform: rotate(90deg);
    margin-top: 0;
  }

  .result-content {
    padding: 20px;
  }

  .output-content {
    padding: 20px;
  }

  .review-section {
    padding: 16px;
  }

  /* Stack step-actions vertically on mobile */
  .step-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .step-actions .btn {
    width: 100%;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .btn-primary--generate {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
  }

  /* Output header: stack title and re-generate on small screens */
  .output-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .output-actions {
    flex-direction: column;
  }

  .output-actions .btn {
    width: 100%;
  }

  .form-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
  }

  .field-tip-toggle {
    padding: 0.5rem 0.7rem;
  }

  .field-tip-body {
    padding: 0 0.7rem 0.5rem;
  }

  .callout {
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
  }

  .footer-feedback {
    font-size: 0.78rem;
    padding: 0 8px;
  }

  .review-section-title {
    font-size: 0.8rem;
  }

  .review-label {
    font-size: 0.7rem;
  }

  .review-value {
    font-size: 0.9rem;
  }

  .distribution-badge {
    font-size: 0.65rem;
  }

  .generate-note {
    font-size: 0.8rem;
  }

  .disclaimer-box {
    font-size: 0.8rem;
    padding: 12px 14px;
  }
}

@media (max-width: 380px) {
  .progress-step .step-label {
    display: none;
  }

  .progress-line {
    margin: 0 6px;
  }

  .step-title {
    font-size: 1.35rem;
  }

  .step label {
    font-size: 1rem;
  }

  .output-title {
    font-size: 1.05rem;
  }
}
