/* ============================================================================
   ApplianceClinic — customer design system
   Dark, premium, engineering-led. The customer app is themed under `.ac`
   (body.ac); the staff console (body.admin-body) keeps the original light
   tokens/rules untouched. "Diagnose first. Parts second."
   ============================================================================ */
:root {
  /* --- Legacy light tokens (used by the ADMIN console — do not repurpose) --- */
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --accent: #111827;
  --brand-charcoal: #1f2933;
  --brand-sage: #829985;
  --brand-sage-dark: #4f6a57;
  --brand-sage-light: #eef2ee;
  --confirm-bg: var(--brand-sage-light);
  --confirm-ink: var(--brand-sage-dark);
  --verify-bg: #fffbeb;
  --verify-ink: #b45309;
  --radius: 14px;
  --maxw: 680px;

  /* --- ApplianceClinic dark design tokens (customer app) --- */
  --ac-bg: #0b100e;            /* near-black charcoal, subtle green undertone */
  --ac-bg-2: #0e1512;
  --ac-surface: #121a17;       /* cards / panels */
  --ac-surface-2: #16201c;     /* raised surfaces (composer, entries) */
  --ac-elev: #1b2621;          /* hover / elevated */
  --ac-border: #233029;        /* hairline on dark */
  --ac-border-2: #2e4139;      /* stronger border */
  --ac-text: #e8f0ec;          /* primary text (~13:1 on bg) */
  --ac-text-muted: #9db0a7;    /* secondary text (~7:1) */
  --ac-text-dim: #75887f;      /* tertiary / decorative only */
  --ac-accent: #4ecdb0;        /* sage-teal accent */
  --ac-accent-2: #8fe9d4;      /* lighter accent (hover/glow) */
  --ac-accent-deep: #2f9e86;
  --ac-accent-ink: #06120e;    /* text on the accent */
  --ac-accent-soft: rgba(78, 205, 176, 0.12);
  --ac-accent-soft-2: rgba(78, 205, 176, 0.22);
  /* Safety / status — high contrast on dark, never colour-only */
  --ac-danger: #ff6f61;
  --ac-danger-2: #ff9f96;
  --ac-danger-bg: #241210;
  --ac-danger-border: #7a2f27;
  --ac-warn: #ffcf6b;
  --ac-warn-ink: #f1dca6;
  --ac-warn-bg: #241d0f;
  --ac-warn-border: #5c4a22;
  /* Light surfaces for engineering media (PNGs stay on white — never inverted) */
  --ac-media: #ffffff;
  --ac-media-2: #f4f6f4;
  --ac-media-ink: #1c2622;
  --ac-media-muted: #5c6b64;
  /* Shape / depth */
  --ac-r-sm: 10px;
  --ac-r: 14px;
  --ac-r-lg: 20px;
  --ac-r-pill: 999px;
  --ac-focus: 0 0 0 3px rgba(78, 205, 176, 0.40);
  --ac-glow: 0 12px 44px -16px rgba(78, 205, 176, 0.35);
  --ac-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  --ac-maxw: 720px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Customer app = dark ApplianceClinic theme. */
body.ac {
  background:
    radial-gradient(1200px 520px at 50% -8%, rgba(78, 205, 176, 0.08), transparent 60%),
    var(--ac-bg);
  color: var(--ac-text);
  min-height: 100dvh;
}

.wrap {
  min-height: 100dvh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 6vh, 72px) 20px 40px;
  display: flex;
  flex-direction: column;
}
body.ac .wrap {
  max-width: var(--ac-maxw);
  padding: clamp(14px, 3vh, 30px) 18px 48px;
}

/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

/* ============================================================================
   HERO — "Smart. Fast. Fixed."
   ============================================================================ */
.hero {
  margin: 0;
  transition: opacity .3s ease, max-height .4s ease, margin .4s ease;
  overflow: hidden;
}
body.ac .hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  padding: 18px 0 8px;
}
.hero__headline {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(44px, 12vw, 72px);
  color: var(--ac-text);
}
.hero__headline span { display: block; }
.hero__headline-accent { color: var(--ac-accent); }
.hero__sub {
  margin: 14px 0 0;
  color: var(--ac-text-muted);
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.5;
  max-width: 22ch;
}
/* Mobile: the artwork is a deliberate, centred statement beneath the headline —
   not a shrunk desktop crop. Held to a confident size with breathing room. */
.hero__art { justify-self: center; width: 100%; max-width: 420px; margin: 4px auto 0; }
.hero__art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 26px 50px rgba(78, 205, 176, 0.20)); }

/* ============================================================================
   ASSISTANT INTRO + COMPOSER
   ============================================================================ */
.assistant { margin-top: 8px; }
.assistant__intro { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 14px; }
.assistant__spark {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ac-accent);
  background: var(--ac-accent-soft);
  border: 1px solid var(--ac-border-2);
}
.assistant__title { margin: 2px 0 0; font-size: clamp(17px, 3vw, 20px); font-weight: 700; letter-spacing: -0.01em; color: var(--ac-text); }
.assistant__lead { margin: 6px 0 0; color: var(--ac-text-muted); font-size: 15px; line-height: 1.55; }

/* Composer / diagnostic input — the core action. */
.ask {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ac-border-2);
  border-radius: var(--ac-r);
  padding: 8px 8px 8px 16px;
  background: var(--ac-surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.ask:focus-within {
  border-color: var(--ac-accent);
  box-shadow: var(--ac-glow), 0 0 0 1px var(--ac-accent-soft-2);
}
.ask__input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16.5px;
  padding: 14px 0;
  background: transparent;
  color: var(--ac-text);
  min-width: 0;
}
.ask__input::placeholder { color: var(--ac-text-dim); }
.ask__file { display: none; }
.ask__cam {
  flex: 0 0 auto; width: 42px; height: 42px;
  border: 1px solid var(--ac-border); border-radius: 10px;
  background: transparent; color: var(--ac-text-muted);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ask__cam:hover { background: var(--ac-elev); color: var(--ac-accent); border-color: var(--ac-border-2); }
.ask__cam:disabled { opacity: .4; cursor: default; }
.ask__send {
  flex: 0 0 auto; width: 46px; height: 46px;
  border: 0; border-radius: 11px;
  background: var(--ac-accent); color: var(--ac-accent-ink);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
}
.ask__send:hover { background: var(--ac-accent-2); box-shadow: 0 6px 20px -6px rgba(78, 205, 176, 0.5); }
.ask__send:active { transform: scale(.96); }
.ask__send:disabled { opacity: .4; cursor: default; box-shadow: none; }

.hint {
  text-align: center;
  color: var(--ac-text-dim);
  font-size: 13.5px;
  margin: 14px 0 0;
  transition: opacity .3s ease;
}

/* Pending-photo preview above the composer */
.ask-preview { position: relative; align-self: center; margin: 0 0 10px; }
.ask-preview[hidden] { display: none; }
.ask-preview img {
  max-width: 120px; max-height: 120px; border-radius: 10px;
  border: 1px solid var(--ac-border-2); object-fit: cover; display: block;
}
.ask-preview button {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px;
  border: 0; border-radius: 50%; background: var(--ac-accent); color: var(--ac-accent-ink);
  font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ============================================================================
   SECONDARY ENTRY CARDS (scan rating plate / search by model)
   ============================================================================ */
.entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.entry {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 15px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-r);
  color: var(--ac-text);
  font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .05s ease;
}
.entry:hover { border-color: var(--ac-accent); background: var(--ac-elev); }
.entry:active { transform: translateY(1px); }
.entry__icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ac-accent); background: var(--ac-accent-soft);
  border: 1px solid var(--ac-border-2);
}
.entry__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry__title { font-weight: 700; font-size: 14.5px; }
.entry__desc { font-size: 12.5px; color: var(--ac-text-muted); line-height: 1.35; }

/* ============================================================================
   HOW IT WORKS
   ============================================================================ */
.howto { margin-top: 30px; }
.howto__title { margin: 0 0 16px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.howto__steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 4px;
}
.howstep { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; flex: 1 1 0; min-width: 0; }
.howstep__icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ac-accent); background: var(--ac-accent-soft);
  border: 1px solid var(--ac-border-2);
}
.howstep__k { font-size: 13.5px; font-weight: 700; color: var(--ac-text); }
.howstep__d { font-size: 11.5px; color: var(--ac-text-muted); line-height: 1.35; }
.howstep__arrow { color: var(--ac-text-dim); align-self: center; padding-top: 14px; font-size: 16px; flex: 0 0 auto; }

/* ============================================================================
   TRUST
   ============================================================================ */
.trust {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 28px; padding: 16px 18px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-r);
}
.trust__icon { flex: 0 0 auto; color: var(--ac-accent); margin-top: 1px; }
.trust__head { margin: 0; font-weight: 700; font-size: 14.5px; letter-spacing: .01em; }
.trust__text { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: var(--ac-text-muted); }

/* ============================================================================
   CONVERSATION THREAD
   ============================================================================ */
.thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.thread:empty { margin: 0; }
.turn { display: flex; flex-direction: column; }
.turn--user { align-items: flex-end; }
.bubble {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
/* Customer message — subtle teal-tinted bubble on dark. */
.turn--user .bubble {
  background: var(--ac-accent-soft);
  color: var(--ac-text);
  border: 1px solid var(--ac-border-2);
  border-bottom-right-radius: 5px;
}
.turn--bot .bubble {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  color: var(--ac-text);
  border-bottom-left-radius: 5px;
}

/* Uploaded photo shown inside a user bubble */
.bubble__img {
  max-width: 200px; max-height: 200px; border-radius: 12px;
  border: 1px solid var(--ac-border-2); object-fit: cover; margin-bottom: 6px;
}

/* Engineer-led response — calm dark surface, thin teal accent, clear hierarchy.
   Deliberately quieter than the safety panel: safety must always visually dominate. */
.turn--bot .response {
  max-width: 88%;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-left: 3px solid var(--ac-accent);
  border-radius: 14px;
  border-bottom-left-radius: 5px;
  padding: 15px 17px;
}
.turn--bot.turn--advice .response { background: var(--ac-bg-2); }
/* Small engineering overline: the grounded fault label (or a maintenance tip). */
.response__diag {
  margin: 0 0 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ac-accent);
}
/* Primary finding — the engine's lead sentence, given stronger typographic weight. */
.response__lead { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ac-text); }
/* Supporting engineer explanation. */
.response__body { margin: 9px 0 0; font-size: 14.5px; line-height: 1.62; color: var(--ac-text-muted); white-space: pre-wrap; word-wrap: break-word; }

/* Model request — a restrained, intentional next step (NOT an error state). */
.model-req { max-width: 88%; margin-top: 12px; border: 1px solid var(--ac-border-2); background: var(--ac-accent-soft); border-radius: 12px; padding: 12px 15px; }
.model-req__label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ac-accent); margin-bottom: 3px; }
.model-req__text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ac-text-muted); }

/* Parts — the SECONDARY step after diagnosis, clearly labelled, never the headline. */
.parts__head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ac-text-dim); margin: 14px 0 6px; }
.parts { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; max-width: 88%; }
.part {
  border: 1px solid var(--ac-border);
  background: var(--ac-surface);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.part:hover { border-color: var(--ac-border-2); box-shadow: var(--ac-shadow); }
.part__img {
  width: 100%; max-height: 160px; object-fit: contain; border-radius: 8px;
  background: #ffffff; border: 1px solid var(--ac-border); margin-bottom: 4px;
}
.part__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 680px) {
  .part { flex-direction: row; align-items: flex-start; gap: 16px; }
  .part__img { width: 180px; flex: 0 0 180px; max-height: 150px; margin-bottom: 0; }
}
.part__name { font-weight: 600; font-size: 15.5px; line-height: 1.35; color: var(--ac-text); }
.part__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.part__price { font-size: 17px; font-weight: 700; color: var(--ac-text); }
.fit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
/* Non-colour cue: confirmed carries a check glyph, verify carries a dot — not colour alone. */
.fit--confirmed { background: var(--ac-accent-soft); color: var(--ac-accent-2); border-color: var(--ac-border-2); }
.fit--confirmed::before { content: "\2713"; font-weight: 800; }
.fit--verify { background: var(--ac-warn-bg); color: var(--ac-warn); border-color: var(--ac-warn-border); }
.fit--verify::before { content: "\26A0"; }
.part__cta {
  align-self: flex-start; text-decoration: none; color: var(--ac-accent);
  font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--ac-border-2); padding: 9px 14px; border-radius: 10px;
  transition: background .15s ease, border-color .15s ease;
}
.part__cta:hover { background: var(--ac-elev); border-color: var(--ac-accent); }
.offer-note { font-size: 12.5px; color: var(--ac-text-muted); }

/* ============================================================================
   INSTRUCTIONAL MEDIA — LIGHT technical-reference cards on the dark UI.
   Engineering PNGs deliberately keep their white background: NEVER inverted or
   filtered. They sit on a raised light "reference card" clearly separated from
   the dark conversation.
   ============================================================================ */
.media { margin-top: 12px; max-width: min(100%, 560px); }
.media__head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ac-text-dim); margin-bottom: 8px; }
.media__item {
  background: var(--ac-media);
  border: 1px solid var(--ac-border-2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 6px 22px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(78, 205, 176, 0.10);
  display: grid; gap: 6px 14px;
  grid-template-areas: "title" "fig" "cap" "attr";
}
.media__title { grid-area: title; font-size: 13px; font-weight: 700; color: var(--ac-media-ink); }
.media__zoom { grid-area: fig; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; }
.media__img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: 6px; background: #ffffff; }
.media__caption { grid-area: cap; font-size: 12px; color: var(--ac-media-muted); line-height: 1.45; }
.media__video {
  grid-area: fig; width: 100%; max-width: 320px; aspect-ratio: 16 / 9;
  border-radius: 8px; overflow: hidden; background: #000; border: 1px solid #d5ddd8;
}
.media__video iframe { display: block; width: 100%; height: 100%; border: 0; }
.media__attrib { grid-area: attr; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; }
.media__by { color: var(--ac-media-muted); }
.media__guide { color: var(--ac-accent-deep); font-weight: 700; text-decoration: none; }
.media__guide:hover { text-decoration: underline; }
@media (min-width: 680px) {
  .media__item--video {
    grid-template-columns: 240px 1fr;
    grid-template-areas: "fig title" "fig cap" "fig attr";
    align-items: start; column-gap: 16px;
  }
  .media__item--video .media__video { max-width: 100%; }
}
/* Tap-to-enlarge lightbox */
.media-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.88); padding: 16px; }
.media-lightbox img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; border-radius: 8px; background: #fff; }
.media-lightbox__close { position: absolute; top: 10px; right: 16px; font-size: 30px; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }

/* ============================================================================
   SAFETY — authoritative and visually DOMINANT. Never softened by the dark UI.
   High contrast; non-colour cues (icon + label + heavy border), not colour alone.
   ============================================================================ */
.safety-info {
  margin-top: 14px;
  max-width: 92%;
  border: 1px solid var(--ac-warn-border);
  border-left: 5px solid var(--ac-warn);
  background: var(--ac-warn-bg);
  color: var(--ac-warn-ink);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 26px -12px rgba(0, 0, 0, 0.7);
}
.safety-info__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.safety-info__icon { color: var(--ac-warn); font-size: 17px; line-height: 1; }
.safety-info__title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ac-warn); }
.safety-info__text { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ac-text); }
/* Higher-urgency classifications get the strong red STOP treatment (dominant). */
.safety-info--stop-use, .safety-info--emergency-action, .safety-info--do-not-open {
  border-color: var(--ac-danger-border);
  border-left-color: var(--ac-danger);
  background: var(--ac-danger-bg);
  box-shadow: 0 0 0 1px rgba(255, 111, 97, 0.25), 0 10px 30px -10px rgba(255, 111, 97, 0.25);
}
.safety-info--stop-use .safety-info__title,
.safety-info--emergency-action .safety-info__title,
.safety-info--do-not-open .safety-info__title { color: var(--ac-danger-2); }
.safety-info--stop-use .safety-info__icon,
.safety-info--emergency-action .safety-info__icon,
.safety-info--do-not-open .safety-info__icon { color: var(--ac-danger); }

/* ============================================================================
   FEEDBACK
   ============================================================================ */
.feedback { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.feedback__q { font-size: 13px; color: var(--ac-text-muted); }
.feedback__btn {
  width: 34px; height: 34px;
  border: 1px solid var(--ac-border-2); border-radius: 9px;
  background: var(--ac-surface); color: var(--ac-accent);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.feedback__btn:hover { background: var(--ac-elev); border-color: var(--ac-accent); }
.feedback__btn:active { transform: scale(.94); }
.feedback__thanks { font-size: 13px; color: var(--ac-accent); font-weight: 600; }

/* ============================================================================
   THINKING / DIAGNOSING
   ============================================================================ */
.thinking { display: inline-flex; gap: 5px; padding: 6px 2px; }
.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-accent); animation: acblink 1.3s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: .2s; }
.thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes acblink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.thinking__status { margin-top: 2px; font-size: 13px; color: var(--ac-text-muted); letter-spacing: .01em; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--ac-border); transition: opacity .3s ease; }
.site-footer__line { margin: 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--ac-text-dim); display: flex; align-items: center; justify-content: center; gap: 7px; }
.site-footer__lock { color: var(--ac-text-dim); }

/* ============================================================================
   STARTED (chat) STATE — collapse the landing, keep the conversation.
   ============================================================================ */
body.started .hero,
body.started .howto,
body.started .trust,
body.started .entries,
body.started .assistant__intro,
body.started .hint,
body.started .site-footer { display: none; }
body.ac.started .assistant { margin-top: 6px; }
/* Sticky composer once conversation started */
body.started .ask { position: sticky; bottom: 12px; margin-top: auto; background: var(--ac-surface-2); z-index: 5; }

/* ============================================================================
   HEADER / SHELL — light base rules (used by the ADMIN console). The customer
   app overrides these to dark under `.ac` further below.
   ============================================================================ */
.topbar { position: sticky; top: 0; z-index: 50; background: #ffffff; border-bottom: 1.5px solid var(--brand-sage); }
.topbar__logo-img { display: block; height: 46px; width: auto; }
.topbar__inner { max-width: 1040px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 16px; }
.topbar__brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--brand-charcoal); font-weight: 800; letter-spacing: -0.01em; font-size: 18px; }
.topbar__nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__link { color: var(--brand-charcoal); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 9px; }
.topbar__link:hover { background: var(--brand-sage-light); }

.btn { font: inherit; font-weight: 700; font-size: 14.5px; border-radius: 10px; padding: 9px 16px; cursor: pointer; border: 1px solid transparent; transition: background .15s ease, border-color .15s ease, opacity .15s ease; }
.btn--ghost { background: #fff; color: var(--brand-sage-dark); border-color: #cdd8ce; }
.btn--ghost:hover { border-color: var(--brand-sage); background: #fbfdfb; }
.btn--primary { background: var(--brand-sage-dark); color: #fff; }
.btn--primary:hover { opacity: .92; }
.btn--primary:disabled { opacity: .5; cursor: default; }

.usermenu { position: relative; }
.usermenu__btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #cdd8ce; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; color: var(--brand-charcoal); font: inherit; font-weight: 600; font-size: 14px; }
.usermenu__btn:hover { border-color: var(--brand-sage); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-sage-dark); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.usermenu__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__caret { color: var(--muted); }
.usermenu__dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); padding: 6px; display: flex; flex-direction: column; }
.usermenu__item { display: block; text-align: left; text-decoration: none; color: var(--ink); font: inherit; font-size: 14.5px; padding: 10px 12px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; }
.usermenu__item:hover { background: var(--brand-sage-light); }
.usermenu__item--btn { color: #b23325; }

.topbar__burger { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid #cdd8ce; border-radius: 10px; background: #fff; color: var(--brand-charcoal); cursor: pointer; place-items: center; }
.mobilemenu { border-top: 1px solid #dfe6df; background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.mobilemenu__item { text-align: left; text-decoration: none; color: var(--ink); font: inherit; font-size: 15px; padding: 12px 14px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; }
.mobilemenu__item:hover { background: var(--brand-sage-light); }

/* Modal (login + help) — light base for admin; customer overrides under `.ac`. */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 33, .45); }
.modal__card { position: relative; z-index: 1; width: min(420px, 92vw); background: #fff; border-radius: 16px; padding: 26px 24px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal__close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 8px; }
.modal__close:hover { background: #f3f4f6; color: var(--ink); }
.modal__title { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.modal__sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.help__list { margin: 0; padding-left: 18px; color: var(--ink); font-size: 14.5px; line-height: 1.6; }
.help__list li { margin-bottom: 6px; }
.loginform { display: flex; flex-direction: column; }
.loginform__label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 8px 0 5px; }
.loginform__input { font: inherit; font-size: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; outline: 0; }
.loginform__input:focus { border-color: var(--brand-sage); box-shadow: 0 0 0 3px rgba(130, 153, 133, .22); }
.loginform__error { color: #b23325; font-size: 13.5px; margin: 12px 0 0; }
.loginform__submit { margin-top: 18px; }

/* Accessible focus for all interactive shell controls */
.btn:focus-visible, .topbar__link:focus-visible, .usermenu__btn:focus-visible,
.usermenu__item:focus-visible, .topbar__burger:focus-visible,
.mobilemenu__item:focus-visible, .modal__close:focus-visible, .topbar__brand:focus-visible,
.entry:focus-visible, .ask__cam:focus-visible, .ask__send:focus-visible, .feedback__btn:focus-visible,
.media__zoom:focus-visible {
  outline: 2px solid var(--brand-sage-dark);
  outline-offset: 2px;
}

/* ============================================================================
   CUSTOMER (.ac) HEADER + SHELL OVERRIDES — dark ApplianceClinic treatment.
   ============================================================================ */
body.ac .topbar {
  background: rgba(11, 16, 14, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ac-border);
}
body.ac .topbar__logo-img { height: 42px; }
body.ac .topbar__brand { color: var(--ac-text); }
body.ac .topbar__link { color: var(--ac-text-muted); }
body.ac .topbar__link:hover { background: var(--ac-elev); color: var(--ac-text); }
body.ac .btn--ghost { background: transparent; color: var(--ac-text); border-color: var(--ac-border-2); }
body.ac .btn--ghost:hover { border-color: var(--ac-accent); background: var(--ac-elev); }
body.ac .btn--primary { background: var(--ac-accent); color: var(--ac-accent-ink); }
body.ac .btn--primary:hover { background: var(--ac-accent-2); opacity: 1; }
body.ac .usermenu__btn { background: var(--ac-surface); border-color: var(--ac-border-2); color: var(--ac-text); }
body.ac .usermenu__btn:hover { border-color: var(--ac-accent); }
body.ac .avatar { background: var(--ac-accent); color: var(--ac-accent-ink); }
body.ac .usermenu__caret { color: var(--ac-text-dim); }
body.ac .usermenu__dropdown { background: var(--ac-surface-2); border-color: var(--ac-border-2); box-shadow: var(--ac-shadow); }
body.ac .usermenu__item { color: var(--ac-text); }
body.ac .usermenu__item:hover { background: var(--ac-elev); }
body.ac .usermenu__item--btn { color: var(--ac-danger-2); }
body.ac .topbar__burger { background: var(--ac-surface); border-color: var(--ac-border-2); color: var(--ac-text); }
body.ac .mobilemenu { background: var(--ac-surface-2); border-top-color: var(--ac-border); }
body.ac .mobilemenu__item { color: var(--ac-text); }
body.ac .mobilemenu__item:hover { background: var(--ac-elev); }

/* Customer modal (login) on dark */
body.ac .modal__backdrop { background: rgba(0, 0, 0, 0.66); }
body.ac .modal__card { background: var(--ac-surface-2); border: 1px solid var(--ac-border-2); box-shadow: var(--ac-shadow); color: var(--ac-text); }
body.ac .modal__title { color: var(--ac-text); }
body.ac .modal__sub { color: var(--ac-text-muted); }
body.ac .modal__close { color: var(--ac-text-muted); }
body.ac .modal__close:hover { background: var(--ac-elev); color: var(--ac-text); }
body.ac .loginform__label { color: var(--ac-text-muted); }
body.ac .loginform__input { background: var(--ac-bg-2); border-color: var(--ac-border-2); color: var(--ac-text); }
body.ac .loginform__input:focus { border-color: var(--ac-accent); box-shadow: var(--ac-focus); }
body.ac .loginform__error { color: var(--ac-danger-2); }
body.ac .help__list { color: var(--ac-text); }

/* Customer focus ring = teal */
body.ac .btn:focus-visible, body.ac .topbar__link:focus-visible, body.ac .usermenu__btn:focus-visible,
body.ac .usermenu__item:focus-visible, body.ac .topbar__burger:focus-visible, body.ac .mobilemenu__item:focus-visible,
body.ac .modal__close:focus-visible, body.ac .topbar__brand:focus-visible, body.ac .entry:focus-visible,
body.ac .ask__cam:focus-visible, body.ac .ask__send:focus-visible, body.ac .feedback__btn:focus-visible,
body.ac .media__zoom:focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 2px;
}

/* Composer focus = ONE treatment on the rounded container (see .ask:focus-within).
   The inner text field must never draw its own rectangular outline/box — that
   clashes with the rounded composer. Keyboard focus is still fully conveyed via
   :focus-within; the cam/send controls keep their own :focus-visible rings. */
body.ac .ask__input:focus,
body.ac .ask__input:focus-visible { outline: none; box-shadow: none; }

/* ============================================================================
   DESKTOP — intentional two-column landing (not a stretched phone).
   ============================================================================ */
@media (min-width: 900px) {
  body.ac .wrap { max-width: 1080px; padding-top: 30px; }
  body.ac .hero {
    grid-template-columns: 1fr 1.02fr;
    gap: 28px;
    padding: 34px 0 18px;
    min-height: 400px;
  }
  body.ac .hero { align-items: center; }
  body.ac .hero__art { max-width: 560px; justify-self: end; margin: 0; }
  body.ac .hero__sub { max-width: 30ch; }
  /* Keep conversation + composer to a readable measure even on wide screens. */
  body.ac .assistant, body.ac .howto, body.ac .trust, body.ac .site-footer { max-width: 760px; margin-left: auto; margin-right: auto; }
  body.ac.started .wrap { max-width: 820px; }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 640px) {
  .topbar__nav { display: none; }
  .topbar__burger { display: grid; }
}
@media (max-width: 560px) {
  .entries { grid-template-columns: 1fr; }
  .howto__steps { flex-wrap: wrap; gap: 10px; justify-content: center; }
  .howstep { flex: 1 1 40%; }
  .howstep__arrow { display: none; }
  .bubble, .turn--bot .response, .parts, .safety-info, .media, .model-req { max-width: 100%; }
  .media__img { max-width: 100%; }
  .ask__input { font-size: 16px; }
}
@media (max-width: 390px) {
  body.ac .wrap { padding-left: 14px; padding-right: 14px; }
  .hero__headline { font-size: 46px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================================
   Admin console (unchanged — light, uses legacy tokens; body.admin-body)
   ============================================================================ */
.admin-body { background: #f7f8f7; color: var(--ink); }
.topbar__badge {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-sage-dark);
  background: #fff;
  border: 1px solid #cdd8ce;
  border-radius: 999px;
  padding: 2px 8px;
}

/* Access gate */
.admin-gate { min-height: calc(100dvh - 56px); display: grid; place-items: center; padding: 24px; }
.admin-gate[hidden] { display: none; }
.admin-gate__card {
  width: min(400px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.admin-gate__title { margin: 0 0 6px; font-size: 22px; }
.admin-gate__sub { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }

/* Shell layout */
.admin { display: grid; grid-template-columns: 232px 1fr; gap: 0; min-height: calc(100dvh - 56px); }
.admin[hidden] { display: none; }
.admin__side { border-right: 1px solid var(--line); background: #fff; padding: 18px 12px; }
.admin__nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 72px; }
.admin__navitem {
  text-align: left;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 10px 13px;
  cursor: pointer;
}
.admin__navitem:hover { background: var(--brand-sage-light); }
.admin__navitem.is-active { background: var(--brand-sage-light); color: var(--brand-sage-dark); }
.admin__main { padding: 26px 30px; max-width: 900px; }
.admin__section[hidden] { display: none; }
.admin__h1 { margin: 0 0 6px; font-size: 24px; }
.admin__h2 { margin: 0 0 12px; font-size: 16px; }
.admin__lead { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.admin__placeholder {
  border: 1px dashed #d3dad3;
  border-radius: 14px;
  background: #fff;
  padding: 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.admin__placeholder strong { color: var(--ink); }
.admin__panel { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }

/* Health grid */
.health { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.health__loading { color: var(--muted); font-size: 14.5px; padding: 8px 0; grid-column: 1 / -1; }
.health__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.health__cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.health__cardhead h3 { margin: 0; font-size: 15.5px; }
.health__row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; border-top: 1px solid #f1f3f1; }
.health__row span:first-child { color: var(--muted); }
.health__row span:last-child { font-weight: 600; text-align: right; word-break: break-all; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill--ok { background: var(--brand-sage-light); color: var(--brand-sage-dark); }
.pill--bad { background: #fdecea; color: #b23325; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

@media (max-width: 720px) {
  .admin { grid-template-columns: 1fr; }
  .admin__side { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .admin__nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .admin__navitem { padding: 8px 11px; font-size: 13.5px; }
  .admin__main { padding: 20px 16px; }
  .health { grid-template-columns: 1fr; }
}
