/* =========================================================================
   KickingHorse Welder & Plasma Troubleshooter - theme v2
   Editorial-industrial dark UI. Brand: primary #AF0022, Arial/Helvetica.
   All layout scoped under .kh-master (940px centered - "full page width").
   Only a minimal body canvas rule is global (brand "dark UI" directive).
   ========================================================================= */

/* Dark canvas (brand mandate: dark UI by default).
   Faint blueprint grid adds workshop texture without glow/gradient tropes. */
body {
  margin: 0;
  background-color: #0A0A0A;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 56px 56px;
  color: #C9C7C2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scoped box-sizing reset (coding-spec: no global * selector). */
.kh-master,
.kh-master *::before,
.kh-master *::after,
.kh-master * {
  box-sizing: border-box;
}

/* Master container - 940px centered (page rule: prompt requests full width). */
.kh-master {
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 32px 64px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 999px) {
  .kh-master {
    padding: 0 20px 56px;
  }
}

/* Scoped selection + focus ring */
.kh-master ::selection {
  background: rgba(175, 0, 34, 0.6);
  color: #FFFFFF;
}

.kh-master :focus-visible {
  outline: 2px solid rgba(230, 58, 82, 0.85);
  outline-offset: 2px;
}

/* Shared easing */
.kh-master a,
.kh-master button,
.kh-master input {
  transition:
    color 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------- Top bar ---------------- */
.kh-brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kh-brandmark {
  display: flex;
  align-items: center;
  gap: 15px;
  animation: khBrandIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes khBrandIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kh-logo {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.kh-brandtext {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kh-brandtext h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: #F4F2EE;
  text-shadow: 2px 2px 0 rgba(175, 0, 34, 0.35);
}

.kh-brandtext h1 .kh-accent {
  color: #E63A52;
  margin-right: 0.22em;
}

.kh-brandtext .kh-sub {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8F8D88;
}

.kh-brandnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: khBrandIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.kh-brandnav-link {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 0 9px;
  background: none;
  border: none;
  color: #A6A39E;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.kh-brandnav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #E63A52;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-brandnav-link:hover {
  color: #F4F2EE;
}

.kh-brandnav-link:hover::after {
  transform: scaleX(1);
}

.kh-brandnav-link--house {
  color: #E63A52;
}

.kh-brandnav-link--house::after {
  transform: scaleX(1);
}

.kh-brandnav-link--house:hover {
  color: #F4F2EE;
}

@media (max-width: 560px) {
  .kh-brandnav {
    gap: 16px;
  }

  .kh-brandnav-link {
    font-size: 10.5px;
    padding: 5px 0 8px;
  }
}

.kh-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -32px;
  padding: 15px 32px 13px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    background-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}


.kh-topbar.kh-scrolled {
  background: rgba(8, 8, 8, 0.95);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

@media (max-width: 999px) {
  .kh-topbar {
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

}

@media (max-width: 560px) {
  .kh-logo {
    width: 40px;
    height: 40px;
    border-radius: 7px;
  }

  .kh-brandtext h1 {
    font-size: 19px;
  }

  .kh-brandtext .kh-sub {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }
}

.kh-crumb {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6D6B66;
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.kh-crumb a {
  color: #8F8D88;
  text-decoration: none;
  cursor: pointer;
}

.kh-crumb a:hover {
  color: #F4F2EE;
}

.kh-crumb .kh-sep {
  color: #3F3E3A;
}

.kh-crumb .kh-cur {
  color: #E63A52;
}

/* ---------------- Stage ---------------- */
.kh-stage {
  flex: 1 1 auto;
}

/* ---------------- Hero (brand screen) ---------------- */
.kh-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  padding: 52px 0 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 30px;
}

@media (max-width: 860px) {
  .kh-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 0 30px;
  }
}

.kh-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8F8D88;
  margin-bottom: 20px;
}

.kh-kicker-tick {
  width: 24px;
  height: 2px;
  background: #AF0022;
  flex-shrink: 0;
}

.kh-hero-title {
  margin: 0 0 18px;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.028em;
  color: #F4F2EE;
  max-width: 15ch;
}

@media (max-width: 860px) {
  .kh-hero-title {
    font-size: 32px;
  }
}

.kh-hero-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #A6A39E;
  max-width: 48ch;
}

.kh-hero-stats {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #101010;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  padding: 4px 20px;
}

.kh-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kh-stat:last-child {
  border-bottom: none;
}

.kh-stat-num {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F4F2EE;
  font-variant-numeric: tabular-nums;
}

.kh-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7D7B76;
  text-align: right;
}

/* ---------------- Section head ---------------- */
.kh-sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}

.kh-sectionhead-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #F4F2EE;
}

.kh-sectionhead-note {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6D6B66;
}

/* ---------------- Generic screen titles ---------------- */
.kh-screen-title {
  margin: 34px 0 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F4F2EE;
}

.kh-screen-sub {
  margin: 0 0 22px;
  color: #A6A39E;
  font-size: 14px;
  max-width: 62ch;
}

/* ---------------- Search ---------------- */
.kh-search {
  width: 100%;
  background: #0F0F0F;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #EDEBE6;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  outline: none;
}

.kh-search:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.kh-search:focus {
  border-color: #AF0022;
  box-shadow: 0 0 0 3px rgba(175, 0, 34, 0.2);
}

.kh-search::placeholder {
  color: #5A5853;
}

/* ---------------- Grid + cards ---------------- */
.kh-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  counter-reset: khcard;
}

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

.kh-grid--single {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  .kh-grid--brands {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {

  .kh-grid,
  .kh-grid--brands {
    grid-template-columns: 1fr;
  }
}

.kh-card {
  position: relative;
  counter-increment: khcard;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 15px 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  min-height: 104px;
}

.kh-card::before {
  content: counter(khcard, decimal-leading-zero);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #5A5853;
  margin-bottom: 6px;
}

.kh-card::after {
  content: "\2192";
  position: absolute;
  top: 13px;
  right: 15px;
  font-size: 14px;
  color: #E63A52;
  opacity: 0;
  transform: translateX(-5px);
  transition:
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-card:hover {
  border-color: rgba(175, 0, 34, 0.55);
  background: #151515;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.kh-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.kh-card:hover::before {
  color: #8F8D88;
}

.kh-card:active {
  transform: translateY(0);
  box-shadow: none;
}

.kh-card-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #F4F2EE;
}

.kh-card-meta {
  font-size: 12px;
  color: #8F8D88;
}

/* Featured house-brand card spans the full row */
.kh-card--featured {
  grid-column: 1 / -1;
  counter-increment: none;
  min-height: 0;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background:
    linear-gradient(120deg, rgba(175, 0, 34, 0.16), rgba(175, 0, 34, 0.04) 55%, rgba(175, 0, 34, 0) 80%),
    #121212;
  border-color: rgba(175, 0, 34, 0.4);
}

.kh-card--featured::before {
  display: none;
}

.kh-card--featured .kh-card-title {
  font-size: 18px;
}

.kh-card--featured .kh-card-meta {
  margin-left: auto;
  text-align: right;
}

.kh-card--featured:hover {
  border-color: rgba(230, 58, 82, 0.75);
}

.kh-card-house {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #FFCBD2;
  background: #AF0022;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 3px;
  align-self: flex-start;
}

.kh-card-icon {
  font-size: 10.5px;
  color: #E63A52;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Model rows: single-column list, index + title left, badges right */
.kh-grid--single .kh-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 13px 16px;
}

.kh-grid--single .kh-card::before {
  margin: 0 2px 0 0;
  width: 24px;
  flex-shrink: 0;
}

.kh-grid--single .kh-card-title {
  flex: 1 1 auto;
}

@media (max-width: 560px) {
  .kh-grid--single .kh-card {
    flex-wrap: wrap;
  }
}

/* ---------------- Badges ---------------- */
.kh-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  justify-content: flex-end;
}

.kh-grid:not(.kh-grid--single) .kh-badges {
  justify-content: flex-start;
}

.kh-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9A9893;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------------- Buttons ---------------- */
.kh-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.kh-btn--primary {
  background-color: #AF0022;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 20px rgba(175, 0, 34, 0.28);
}

.kh-btn--primary:hover {
  background-color: #C30026;
}

.kh-btn--primary:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.kh-btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  color: #D8D6D1;
  border-color: rgba(255, 255, 255, 0.14);
}

.kh-btn--ghost:hover {
  border-color: rgba(175, 0, 34, 0.6);
  color: #FFFFFF;
  background: rgba(175, 0, 34, 0.08);
}

.kh-btn--ghost:active {
  transform: translateY(1px);
}

.kh-backrow {
  margin: 26px 0 18px;
}

/* ---------------- Model hub header ---------------- */
.kh-hubhead {
  display: flex;
  flex-direction: column;
  padding: 34px 0 24px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kh-hubhead .kh-hubmodel {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.05;
  color: #F4F2EE;
}

.kh-hubhead .kh-hubmeta {
  order: -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8F8D88;
  margin: 0 0 14px;
}

.kh-hubhead .kh-hubmeta::before {
  content: "";
  width: 24px;
  height: 2px;
  background: #AF0022;
  flex-shrink: 0;
}

.kh-hubhead .kh-hubtag {
  margin: 12px 0 0;
  color: #A6A39E;
  font-size: 14px;
  max-width: 64ch;
}

/* ---------------- Tabs ---------------- */
.kh-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.kh-tab {
  font-family: inherit;
  background: transparent;
  border: none;
  color: #8F8D88;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  margin-bottom: -1px;
  box-shadow: inset 0 -2px 0 transparent;
}

.kh-tab:hover {
  color: #EDEBE6;
  background: rgba(255, 255, 255, 0.03);
}

.kh-tab--active {
  color: #FFFFFF;
  box-shadow: inset 0 -2px 0 #AF0022;
}

/* ---------------- Complaint / triage accordions ---------------- */
.kh-complaints {
  display: block;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.kh-complaint {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0;
  overflow: hidden;
}

.kh-complaint-head {
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: transparent;
  border: none;
  color: #D8D6D1;
  font-size: 14.5px;
  font-weight: 700;
  padding: 15px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.kh-complaint-head>span:first-child {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), color 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-complaint-head:hover>span:first-child {
  transform: translateX(6px);
  color: #FFFFFF;
}

.kh-complaint--open .kh-complaint-head {
  color: #FFFFFF;
}

.kh-complaint-head .kh-chev {
  color: #AF0022;
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-complaint--open .kh-chev {
  transform: rotate(90deg);
}

.kh-complaint-body {
  padding: 2px 6px 22px;
  display: none;
}

.kh-complaint--open .kh-complaint-body {
  display: block;
  animation: khReveal 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes khReveal {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------- Diagnostic steps ---------------- */
.kh-steps {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  counter-reset: step;
}

.kh-step {
  position: relative;
  padding: 0 0 20px 46px;
  counter-increment: step;
}

.kh-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  background: rgba(175, 0, 34, 0.08);
  border: 1px solid rgba(175, 0, 34, 0.55);
  color: #E63A52;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kh-step::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 31px;
  bottom: 3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.09);
}

.kh-step:last-child::after {
  display: none;
}

.kh-step-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E63A52;
  margin-bottom: 4px;
  padding-top: 4px;
}

.kh-step-body {
  color: #C9C7C2;
  font-size: 14px;
}

.kh-step-body p {
  margin: 0 0 6px;
}

.kh-why {
  margin-top: 16px;
  padding: 12px 14px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid #AF0022;
  color: #A6A39E;
  font-size: 12.5px;
  border-radius: 0 4px 4px 0;
}

.kh-why b {
  color: #D8D6D1;
}

.kh-stops {
  margin-top: 18px;
  border: 1px solid rgba(175, 0, 34, 0.35);
  background: rgba(175, 0, 34, 0.05);
  border-radius: 4px;
  padding: 13px 15px;
}

.kh-stops-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #FFCBD2;
  margin-bottom: 9px;
}

.kh-stops ul {
  margin: 0;
  padding-left: 18px;
}

.kh-stops li {
  font-size: 13px;
  color: #C9C7C2;
  margin-bottom: 5px;
}

.kh-stops li::marker {
  color: #AF0022;
}

/* ---------------- Block titles (ruled labels) ---------------- */
.kh-blocktitle {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7D7B76;
  margin: 30px 0 14px;
}

.kh-blocktitle::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------------- Related docs / chips / official links ---------------- */
.kh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kh-chip {
  font-family: inherit;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #D8D6D1;
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 13px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.kh-chip:hover {
  border-color: rgba(175, 0, 34, 0.6);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.kh-chip .kh-chip-cat {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E63A52;
  margin-bottom: 3px;
}

.kh-official {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kh-official--grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.kh-official--grid .kh-offlink {
  flex: 1 1 220px;
}

.kh-offlink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #D8D6D1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 11px 14px;
  border-radius: 4px;
}

.kh-offlink:hover {
  border-color: rgba(175, 0, 34, 0.6);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.kh-offlink .kh-ext {
  color: #E63A52;
  font-size: 11px;
}

.kh-offlink--todo {
  cursor: default;
  border-style: dashed;
  color: #6D6B66;
}

.kh-offlink--todo:hover {
  border-color: rgba(255, 255, 255, 0.09);
  color: #6D6B66;
  transform: none;
}

.kh-offlink-todo-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5A5853;
}

/* ---------------- Rendered markdown ---------------- */
.kh-md {
  color: #C9C7C2;
  font-size: 14px;
  line-height: 1.65;
}

.kh-md .kh-md-h {
  color: #F4F2EE;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 26px 0 12px;
}

.kh-md .kh-md-h1 {
  font-size: 23px;
  letter-spacing: -0.02em;
}

.kh-md .kh-md-h2 {
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.kh-md .kh-md-h3 {
  font-size: 15px;
  color: #EDEBE6;
}

.kh-md .kh-md-h4,
.kh-md .kh-md-h5,
.kh-md .kh-md-h6 {
  font-size: 13.5px;
  color: #D8D6D1;
}

.kh-md .kh-md-h:first-child {
  margin-top: 0;
}

.kh-md .kh-md-p {
  margin: 0 0 13px;
}

.kh-md .kh-md-list {
  margin: 0 0 13px;
  padding-left: 22px;
}

.kh-md .kh-md-list li {
  margin-bottom: 5px;
}

.kh-md .kh-md-list li::marker {
  color: #AF0022;
}

.kh-md ul.kh-md-list {
  list-style: disc;
}

.kh-md ol.kh-md-list {
  list-style: decimal;
}

.kh-md .kh-md-code {
  font-family: "Courier New", Consolas, monospace;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #FFCBD2;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12.5px;
}

.kh-md .kh-md-pre {
  background: #0D0D0D;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 2px solid rgba(175, 0, 34, 0.5);
  border-radius: 4px;
  padding: 13px 15px;
  overflow-x: auto;
  margin: 0 0 15px;
}

.kh-md .kh-md-pre code {
  background: none;
  border: none;
  color: #D8D6D1;
  padding: 0;
  font-size: 12.5px;
}

.kh-md .kh-md-hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

.kh-md a {
  color: #E63A52;
  text-decoration: none;
}

.kh-md a:hover {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kh-md a.kh-md-link--ext .kh-ext {
  color: #6D6B66;
  font-size: 10px;
  margin-left: 3px;
}

.kh-md a.kh-md-link--dead {
  color: #7D7B76;
  text-decoration: line-through;
  cursor: default;
}

/* Table wrapper keeps layout inside the master (horizontal scroll on overflow) */
.kh-md-tablewrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 15px;
}

.kh-md-tablewrap::-webkit-scrollbar {
  height: 8px;
}

.kh-md-tablewrap::-webkit-scrollbar-track {
  background: #0D0D0D;
}

.kh-md-tablewrap::-webkit-scrollbar-thumb {
  background: #2A2A2A;
  border-radius: 4px;
}

.kh-md-tablewrap::-webkit-scrollbar-thumb:hover {
  background: #AF0022;
}

.kh-md-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  min-width: 380px;
}

.kh-md-table th,
.kh-md-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}

.kh-md-table th {
  background: #141414;
  color: #F4F2EE;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kh-md-table tbody tr {
  transition: background-color 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-md-table tbody tr:nth-child(even) td {
  background: #0E0E0E;
}

.kh-md-table tbody tr:hover td {
  background: #161214;
}

.kh-md-table td p,
.kh-md-table th p {
  margin: 0;
}

/* ---------------- Doc viewer ---------------- */
.kh-doc-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F4F2EE;
  margin: 0 0 6px;
}

.kh-doc-path {
  font-family: "Courier New", Consolas, monospace;
  font-size: 11px;
  color: #5A5853;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  word-break: break-all;
}

/* ---------------- Empty / notice ---------------- */
.kh-empty {
  background: #0F0F0F;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 30px 22px;
  text-align: center;
  color: #8F8D88;
}

.kh-notice {
  background: rgba(175, 0, 34, 0.06);
  border: 1px solid rgba(175, 0, 34, 0.3);
  border-left: 3px solid #AF0022;
  border-radius: 4px;
  padding: 12px 15px;
  color: #C9C7C2;
  font-size: 13px;
  margin-bottom: 20px;
}

.kh-notice a {
  text-decoration: none;
}

.kh-notice a:hover {
  color: #FFFFFF !important;
}

/* ---------------- Footer ---------------- */
.kh-sitefoot {
  margin-top: 48px;
}

.kh-foot {
  display: flex;
  gap: 10px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #6D6B66;
  font-size: 11.5px;
  line-height: 1.6;
}

.kh-foot-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #5A5853;
}

.kh-foot code {
  font-family: "Courier New", Consolas, monospace;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #A6A39E;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.kh-foot a {
  color: #9A9893;
}

.kh-foot a:hover {
  color: #F4F2EE;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- Fast diagnosis (home) ---------------- */
.kh-fastdiag {
  padding: 4px 0 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 26px;
}

.kh-fastdiag-title {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F4F2EE;
}

.kh-fastdiag-sub {
  margin: 0 0 20px;
  color: #A6A39E;
  font-size: 13.5px;
  max-width: 58ch;
}

.kh-fastdiag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 760px) {
  .kh-fastdiag-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .kh-fastdiag-grid {
    grid-template-columns: 1fr;
  }
}

.kh-fastdiag-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 86px;
  padding: 15px 16px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.kh-fastdiag-btn::after {
  content: "\2192";
  position: absolute;
  top: 13px;
  right: 15px;
  font-size: 14px;
  color: #E63A52;
  opacity: 0;
  transform: translateX(-5px);
  transition:
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-fastdiag-btn:hover {
  border-color: rgba(175, 0, 34, 0.6);
  background: #151515;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
}

.kh-fastdiag-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.kh-fastdiag-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.kh-fastdiag-label {
  font-size: 14.5px;
  font-weight: 700;
  color: #F4F2EE;
}

.kh-fastdiag-desc {
  font-size: 12px;
  color: #8F8D88;
  line-height: 1.45;
}

/* ---------------- Wizard launch panel (model hub) ---------------- */
.kh-wizlaunch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  border: 1px solid rgba(175, 0, 34, 0.38);
  background:
    linear-gradient(120deg, rgba(175, 0, 34, 0.13), rgba(175, 0, 34, 0.03) 60%, rgba(175, 0, 34, 0) 85%),
    #121212;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 28px;
}

.kh-wizlaunch-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #F4F2EE;
}

.kh-wizlaunch-sub {
  margin: 0;
  font-size: 12.5px;
  color: #A6A39E;
  max-width: 40ch;
}

.kh-wizlaunch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 300px;
  justify-content: flex-end;
}

.kh-wizlaunch-grid .kh-fastdiag-btn {
  min-height: 0;
  padding: 11px 14px;
  flex-direction: row;
}

.kh-wizlaunch-grid .kh-fastdiag-label {
  font-size: 13px;
}

.kh-wizlaunch-grid .kh-fastdiag-btn::after {
  display: none;
}

/* ---------------- Wizard ---------------- */
.kh-wiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 20px;
}

.kh-wiz-step {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7D7B76;
}

.kh-wiz-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.kh-wiz-tree {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #A6A39E;
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 5px 11px;
  border-radius: 3px;
}

.kh-wiz-generic {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #E63A52;
}

.kh-wiz-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E63A52;
  margin-bottom: 14px;
}

.kh-wiz-kicker::before {
  content: "";
  width: 20px;
  height: 2px;
  background: #AF0022;
  flex-shrink: 0;
}

.kh-wiz-kicker--good {
  color: #EDEBE6;
}

.kh-wiz-kicker--good::before {
  background: #7D7B76;
}

.kh-wiz-prompt {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: #F4F2EE;
  max-width: 38ch;
}

.kh-wiz-cause {
  color: #FFFFFF;
}

.kh-wiz-hint {
  margin: 0 0 16px;
  color: #A6A39E;
  font-size: 13.5px;
  max-width: 62ch;
}

.kh-wiz-meter {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #101010;
  border-radius: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  padding: 14px 16px;
  margin: 16px 0;
  max-width: 640px;
}

.kh-wiz-meter-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 6px 0;
}

.kh-wiz-meter-row+.kh-wiz-meter-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kh-wiz-meter-k {
  width: 60px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7D7B76;
}

.kh-wiz-meter-v {
  font-size: 15px;
  font-weight: 700;
  color: #EDEBE6;
  line-height: 1.45;
}

.kh-wiz-vc {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.kh-wiz-vc--model {
  color: #FFCBD2;
  background: rgba(175, 0, 34, 0.28);
  border: 1px solid rgba(175, 0, 34, 0.45);
}

.kh-wiz-vc--universal {
  color: #9A9893;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.kh-wiz-ref {
  display: inline-block;
  margin-top: 9px;
  font-size: 11.5px;
  font-weight: 700;
  color: #E63A52;
  text-decoration: none;
  cursor: pointer;
}

.kh-wiz-ref:hover {
  color: #FFFFFF;
}

.kh-wiz-stop {
  display: flex;
  gap: 12px;
  align-items: baseline;
  background: rgba(175, 0, 34, 0.07);
  border: 1px solid rgba(175, 0, 34, 0.35);
  border-left: 3px solid #AF0022;
  border-radius: 4px;
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 13px;
  color: #D8D6D1;
  max-width: 640px;
}

.kh-wiz-stop-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FFCBD2;
  flex-shrink: 0;
}

.kh-wiz-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 22px;
  max-width: 720px;
}

@media (max-width: 560px) {
  .kh-wiz-choices {
    grid-template-columns: 1fr;
  }
}

.kh-wiz-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 16px 18px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #F4F2EE;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.kh-wiz-choice:hover {
  border-color: rgba(175, 0, 34, 0.6);
  background: #181214;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
}

.kh-wiz-choice:active {
  transform: translateY(0);
  box-shadow: none;
}

.kh-wiz-choice-arrow {
  color: #E63A52;
  font-size: 15px;
  opacity: 0;
  transform: translateX(-4px);
  flex-shrink: 0;
  transition:
    opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.kh-wiz-choice:hover .kh-wiz-choice-arrow {
  opacity: 1;
  transform: translateX(0);
}

.kh-wiz-action {
  margin: 18px 0;
  padding: 15px 17px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.6;
  color: #D8D6D1;
  max-width: 680px;
}

.kh-wiz-action-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7D7B76;
  margin-bottom: 7px;
}

.kh-wiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {

  .kh-master a,
  .kh-master button,
  .kh-master input,
  .kh-complaint-head>span:first-child,
  .kh-complaint-head .kh-chev,
  .kh-md-table tbody tr,
  .kh-card::after,
  .kh-fastdiag-btn::after,
  .kh-wiz-choice-arrow {
    transition: none;
  }

  .kh-complaint--open .kh-complaint-body {
    animation: none;
  }
}