/* style.css — Fix My Settings (Bygger C)
 * Modern, visual, beginner-friendly. Light default + dark via
 * prefers-color-scheme. System fonts only, no frameworks, no CDNs.
 * Mobile-first: the questionnaire is used standing next to the printer. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #171d2b;
  --text-muted: #5d6678;
  --border: #e0e4ee;
  --border-strong: #c9cfdd;

  --accent: #6366f1;
  --accent-strong: #4f46e5;
  --accent-contrast: #ffffff;
  --accent-soft: #eef0fe;
  --accent-soft-2: #e0e3fd;

  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --danger-text: #b91c1c;

  --warn-bg: #fff7e6;
  --warn-border: #e8b34b;
  --warn-text: #7a4d00;

  /* severity palette (profile health check) + all-clear green */
  --info: #2563eb;
  --info-soft: #dbeafe;
  --info-text: #1d4ed8;

  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --ok-text: #166534;

  --chip-bg: #e9ecf4;

  --shadow-sm: 0 1px 2px rgba(23, 29, 43, 0.06);
  --shadow-md: 0 2px 8px rgba(23, 29, 43, 0.08);
  --shadow-lift: 0 6px 18px rgba(23, 29, 43, 0.12);

  --header-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #8b5cf6 100%);

  --radius: 14px;
  --radius-sm: 9px;
  --speed: 150ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1220;
    --surface: #171c2e;
    --surface-2: #1f2539;
    --text: #e6e9f2;
    --text-muted: #99a2b8;
    --border: #2a3149;
    --border-strong: #3a4260;

    --accent: #818cf8;
    --accent-strong: #a5b0ff;
    --accent-contrast: #10132a;
    --accent-soft: #23284b;
    --accent-soft-2: #2c3260;

    --danger: #f87171;
    --danger-soft: #3d1b1e;
    --danger-text: #fca5a5;

    --warn-bg: #37290f;
    --warn-border: #b98a2e;
    --warn-text: #eeda9f;

    --info: #60a5fa;
    --info-soft: #14264a;
    --info-text: #93c5fd;

    --ok: #4ade80;
    --ok-soft: #12321e;
    --ok-text: #86efac;

    --chip-bg: #262d44;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 6px 18px rgba(0, 0, 0, 0.55);

    --header-grad: linear-gradient(135deg, #3730a3 0%, #4f46e5 55%, #7c3aed 100%);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); font-weight: normal; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- header ---------- */

.site-header {
  background: var(--header-grad);
  color: #fff;
  padding: 1.1rem 0;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 42px;
  flex-shrink: 0;
  color: #fff;
  --accent: #c7d2fe;   /* logo accent reads on the gradient */
  --danger: #fca5a5;
}

.logo svg { width: 100%; height: 100%; display: block; }

/* graceful placeholder until illustrations.js provides the logo */
.logo:empty {
  width: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.logo:empty::before { content: "▲"; font-size: 1.1rem; }

.brand-text { min-width: 0; }

.wordmark {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  display: block;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.1rem;
}

/* language picker */

.lang-picker { position: relative; flex-shrink: 0; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--speed) ease;
}

.lang-btn:hover { background: rgba(255, 255, 255, 0.24); }

.flag {
  display: inline-flex;
  width: 22px;
  height: 16px;
  overflow: hidden;
  border-radius: 3px;
  flex-shrink: 0;
}

.flag svg { width: 100%; height: 100%; display: block; }
.flag:empty::before { content: "🌐"; font-size: 0.85rem; line-height: 1; }
.flag:empty { border-radius: 0; }

.caret { font-size: 0.7rem; opacity: 0.8; }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 240px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  padding: 0.35rem;
  z-index: 50;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
}

button.lang-item { cursor: pointer; }
button.lang-item:hover { background: var(--accent-soft); }

.lang-active { font-weight: 600; }

.lang-check { margin-left: auto; color: var(--accent); font-weight: 700; }

.lang-disabled {
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: default;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin-top: 0.25rem;
  padding-top: 0.6rem;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 3rem;
  padding: 1.4rem 1rem 2.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---------- warning banner ---------- */

.warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  margin: 1rem auto 0;
  max-width: 848px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.warning p { margin: 0.25rem 0; }

/* ---------- stepper ---------- */

#stepper { margin: 1.5rem 0 1.25rem; }

#stepper ol {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

#stepper li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 0;
}

/* connector line */
#stepper li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  background: var(--border-strong);
  transition: background var(--speed) ease;
}

#stepper li:first-child::before { display: none; }

#stepper li.done::before,
#stepper li.active::before { background: var(--accent); }

.step-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--text-muted);
  transition: all var(--speed) ease;
  z-index: 1;
}

#stepper li.active .step-dot {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

#stepper li.done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

#stepper li.active { color: var(--text); font-weight: 600; }
#stepper li.done { color: var(--accent); }

.step-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 0.15rem;
}

/* ---------- step panels ---------- */

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.step h2 {
  margin: 0 0 0.3rem;
  font-size: 1.32rem;
  letter-spacing: -0.015em;
}

.step-explainer {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.1rem;
}

.sub-label {
  margin: 1.6rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
}

.field { margin: 1rem 0 0; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
}

.warn-hint { color: var(--warn-text); }

input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

/* ---------- choice cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 880px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
  .card-grid-compact { grid-template-columns: repeat(6, 1fr); }
  /* 6 plates balance better 3+3, and the product photos get more room */
  #plate-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 640px) and (max-width: 879.98px) {
  .card-grid-compact { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 639.98px) {
  .card-grid-compact { grid-template-columns: repeat(3, 1fr); }
}

.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 0.85rem 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease,
              transform var(--speed) ease, background var(--speed) ease;
}

.choice-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice-label {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.35rem;
}

.choice-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.choice-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-contrast);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--speed) ease, transform var(--speed) ease;
  pointer-events: none;
}

.choice-card.selected .choice-check {
  opacity: 1;
  transform: scale(1);
}

.choice-card-compact { padding: 0.7rem 0.5rem 0.75rem; }
.choice-card-compact .choice-label { font-size: 0.86rem; margin-top: 0.25rem; }
.choice-card-compact .choice-desc { font-size: 0.7rem; }

/* illustration area */

.illo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 82px;
  color: var(--text);
}

.illo svg {
  height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
}

.choice-card-compact .illo { height: 52px; }
#plate-grid .illo { height: 92px; } /* photo and SVG cards align */

/* real product photos (plates): fixed-height area with a clean white
 * product-shot backdrop — the photos ship with white/transparent
 * backgrounds, and white keeps dark plates readable on the dark theme */
.illo-photo {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  overflow: hidden;
  height: 92px;
}

.illo-photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- chip + big selects ---------- */

.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip-btn {
  position: relative;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--speed) ease;
}

.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.chip-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.chip-btn .choice-check, .chip-btn .choice-desc { display: none; }
.big-btn .choice-check { display: none; }

.big-select {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.big-btn {
  flex: 1 1 0;
  min-width: 96px;
  padding: 0.95rem 0.8rem;
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--speed) ease;
}

.big-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.big-btn.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-strong);
}

/* ---------- phase-4 teaser stubs ---------- */

.stub-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

@media (min-width: 560px) {
  .stub-row { grid-template-columns: 1fr 1fr; }
}

.stub {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--surface-2), transparent 70%),
    var(--surface);
  user-select: none;
}

.stub-illo {
  width: 58px;
  height: 44px;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.85;
}

.stub-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.stub-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }

.stub-sub { font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; }

.badge {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft-2);
  color: var(--accent-strong);
}

/* ---------- profile upload (Phase 4, active card) ---------- */

.upload-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 70%),
    var(--surface);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}

.upload-card:hover,
.upload-card.drag-over {
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-md);
}

.upload-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upload-card.upload-loaded {
  border-style: solid;
  border-color: var(--border-strong);
}

.upload-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.upload-label { cursor: pointer; }

/* Real file input, visually hidden but still focusable: Enter/Space opens
 * the picker, and .upload-card:focus-within shows the focus ring. */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.upload-label .stub-illo { color: var(--accent); opacity: 1; }

.upload-privacy {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.upload-error {
  margin: 0.25rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 0.8rem;
}

.upload-loading { color: var(--text-muted); }

.upload-spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2.5px solid var(--accent-soft-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upload-spin 0.8s linear infinite;
}

@keyframes upload-spin { to { transform: rotate(360deg); } }

.source-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-contrast);
}

.upload-chip-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.upload-chip-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.upload-chip-warning {
  margin: 0.15rem 0 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.74rem;
}

.upload-remove {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--speed) ease;
}

.upload-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- buttons & nav ---------- */

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--speed) ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-contrast);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* ---------- report ---------- */

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.toolbar-left { flex: 1 1 260px; }

.toolbar-right { display: flex; gap: 0.5rem; }

/* segmented slicer switch */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
}

.seg-btn {
  padding: 0.42rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--speed) ease;
  white-space: nowrap;
}

.seg-btn:hover { color: var(--text); }

.seg-btn.seg-active {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}

/* hero summary */

.report-hero {
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 75%),
    var(--surface);
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1rem;
  margin-bottom: 1.25rem;
}

.hero-line {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.hero-sub {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hero-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* advice callout */

.advice-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.4rem;
}

.advice-box h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.advice-box ul { margin: 0; padding-left: 1.2rem; }

.advice-box li { margin: 0.35rem 0; font-size: 0.95rem; }

/* profile health check (Phase 4b) */

.health-box { margin-bottom: 1.4rem; }

.health-heading {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.health-allclear {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--ok-soft);
  border: 1px solid var(--ok);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
}

.health-ok-mark {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.health-ok-body { min-width: 0; }

.health-ok-title {
  margin: 0;
  font-weight: 700;
  color: var(--ok-text);
}

.health-ok-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.health-card {
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.95rem 1.1rem 0.9rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.health-card.sev-critical { border-left-color: var(--danger); }
.health-card.sev-warning { border-left-color: var(--warn-border); }
.health-card.sev-info { border-left-color: var(--info); }

.health-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.health-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.sev-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sev-badge.sev-critical {
  color: var(--danger-text);
  background: var(--danger-soft);
  border-color: var(--danger);
}

.sev-badge.sev-warning {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.sev-badge.sev-info {
  color: var(--info-text);
  background: var(--info-soft);
  border-color: var(--info);
}

.health-fix { margin-top: 0.55rem; }

.health-fix-line {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
}

.health-advice {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
}

.health-advice li { margin: 0.3rem 0; font-size: 0.93rem; }

.health-passed-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ok-hint { color: var(--ok-text); }

/* fix cards */

.fix-list-heading { font-size: 1.02rem; margin: 1.4rem 0 0.15rem; }

.fix-section-sub {
  margin: 0 0 0.7rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.fix-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem 0.95rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--speed) ease;
}

.fix-card:hover { box-shadow: var(--shadow-md); }

.fix-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.fix-titles { min-width: 0; }

.fix-name {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.fix-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prio-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
}

.conflict-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--danger-text);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}

.fix-value {
  margin: 0.55rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.01em;
}

.fix-baseline {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* discreet "Where: Filament settings → Cooling" line (v0.7) */
.fix-where {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.fix-reason { margin: 0.5rem 0 0; font-size: 0.93rem; }

/* "🔧 Advanced tuning" — collapsed details below the quick wins (v0.7) */

.advanced-tuning {
  margin-top: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.advanced-tuning > summary {
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
}

.advanced-tuning > summary:hover { color: var(--accent-strong); }

.advanced-tuning[open] > summary { border-bottom: 1px solid var(--border); }

.advanced-body { padding: 0.8rem 0.9rem 0.15rem; }

.advanced-body .fix-section-sub { margin: 0 0.2rem 0.8rem; }

.advanced-body .fix-card { background: var(--bg); }

.conflict-note {
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 0.85rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.chip {
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--chip-bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
}

.report-hero .chip {
  background: var(--accent-soft-2);
  color: var(--accent-strong);
}

/* "Your profile vs. Bambu defaults" — collapsible, informational */

.deviations {
  margin-top: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.deviations summary {
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius);
}

.deviations summary:hover { color: var(--accent-strong); }

.deviations[open] summary { border-bottom: 1px solid var(--border); }

.deviations-note {
  margin: 0.7rem 1.1rem 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.deviation-list { padding: 0.4rem 1.1rem 0.9rem; }

.deviation-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  padding: 0.42rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}

.deviation-row:last-child { border-bottom: 0; }

.deviation-label { font-weight: 600; }

.deviation-values { color: var(--text-muted); }

.learn-more {
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.learn-more h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.learn-more-intro {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.learn-more ul {
  margin: 0;
  padding-left: 1.2rem;
}

.learn-more li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.learn-more-symptom { font-weight: 600; }

.learn-more a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.learn-more a:hover { color: var(--accent-strong); }

/* ---------- "Printable fixes" (v0.11) — mirrors the Learn-more box ------ */

.print-fixes {
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.print-fixes h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.print-fixes-intro {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.print-fixes ul {
  margin: 0;
  padding-left: 1.2rem;
}

.print-fixes li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.print-fixes a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.print-fixes a:hover { color: var(--accent-strong); }

.print-fix-why { color: var(--text-muted); }

.print-fixes-disclaimer {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

.assumptions {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.assumptions p { margin: 0.2rem 0; }

.empty-note {
  padding: 1.1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.disclaimer {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- "Download fixed profile" card (Phase 6, beta) ---------- */

.export-box {
  margin: 1.2rem 0;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.export-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.export-heading {
  margin: 0;
  font-size: 1.02rem;
}

.export-beta-badge {
  background: var(--accent);
  color: var(--accent-contrast);
  border: 0;
}

.export-sub {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
}

.export-count {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.export-details {
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.export-details summary {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.export-details summary:hover { color: var(--accent-strong); }

.export-details[open] summary { border-bottom: 1px solid var(--border); }

.export-list { padding: 0.25rem 0.8rem 0.6rem; }

.export-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  padding: 0.38rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
}

.export-row:last-child { border-bottom: 0; }

.export-row-label { font-weight: 600; }

.export-row-value { color: var(--text-muted); }

.export-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* small "filament"/"process" scope tag in the .3mf changed-list (6b) */
.export-scope-tag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  vertical-align: 1px;
}

/* secondary "…or download just the filament preset" link-button (6b) */
.export-secondary-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.86rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.export-secondary-link:hover { color: var(--accent-strong); }

/* muted note: an uploaded .3mf that couldn't be rebuilt (6b) */
.export-note {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.export-instruction {
  margin: 0.7rem 0 0;
  font-size: 0.83rem;
  color: var(--text);
}

.export-disclaimer {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

/* ---------- version badge (fixed "tab" top-right) ---------- */

.version-badge {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
  padding: 0.22rem 0.65rem 0.28rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-right: 0;
  border-radius: 0 0 0 var(--radius-sm);
  box-shadow: var(--shadow-sm);
  opacity: 0.92;
}

/* ---------- responsive tweaks ---------- */

@media (max-width: 480px) {
  .tagline { display: none; }
  .step { padding: 1.1rem 0.9rem 1.25rem; }
  .step-name { font-size: 0.66rem; }
  .toolbar-right { width: 100%; }
  .toolbar-right .btn { flex: 1; }
}

/* ---------- print: clean white report, hide chrome ---------- */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f2f2f2;
    --text: #000;
    --text-muted: #444;
    --border: #bbb;
    --border-strong: #999;
    --accent: #000;
    --accent-strong: #000;
    --accent-soft: #f2f2f2;
    --accent-soft-2: #e5e5e5;
    --chip-bg: #eee;

    /* severity colors: force the light palette so a dark-theme user still
     * prints readable badges on white paper */
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --danger-text: #b91c1c;
    --warn-bg: #fff7e6;
    --warn-border: #b45309;
    --warn-text: #7a4d00;
    --info: #1d4ed8;
    --info-soft: #dbeafe;
    --info-text: #1d4ed8;
    --ok: #166534;
    --ok-soft: #dcfce7;
    --ok-text: #166534;
  }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, #stepper, .no-print, .warning, .stub-row,
  .version-badge {
    display: none !important;
  }
  .step { border: 0; box-shadow: none; padding: 0; }
  .fix-card { break-inside: avoid; box-shadow: none; border-color: #999; background: #fff; }
  /* the "Advanced tuning" details must print EXPANDED so the paper report
   * is complete. Two mechanisms: the beforeprint handler in app.js sets
   * [open] before real printing, and (for engines that support it) the
   * ::details-content rule below forces the content visible even while
   * the element is closed — e.g. under print-media emulation. */
  .advanced-tuning { border: 0; box-shadow: none; background: #fff; }
  .advanced-tuning > summary {
    padding: 0;
    margin-bottom: 0.7rem;
    list-style: none;         /* no disclosure triangle on paper */
  }
  .advanced-tuning > summary::-webkit-details-marker { display: none; }
  .advanced-tuning::details-content {
    content-visibility: visible;
    display: block;
  }
  .advanced-tuning[open] > summary { border-bottom: 0; }
  .advanced-body { padding: 0; }
  .advanced-body .fix-card { background: #fff; }
  .health-card { break-inside: avoid; box-shadow: none; background: #fff; }
  .export-box { break-inside: avoid; box-shadow: none; background: #fff; border-color: #999; }
  .export-details { background: #fff; }
  .health-allclear { break-inside: avoid; }
  .report-hero { border-color: #999; background: #fff; }
  .advice-box { border-color: #000; background: #fff; }
  .fix-value { color: #000; }
}
