/* ================================================================
   Assistant diagnostic reseau
   ================================================================ */

:root {
  --serif: 'Instrument Serif', Georgia, serif;
}

.outil-wrap,
.outil-wrap * {
  box-sizing: border-box;
}

.outil-wrap {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.outil-header {
  padding: 54px 80px 50px;
  text-align: center;
  background:
    radial-gradient(circle at 14% 20%, rgba(30,100,152,.30), transparent 32%),
    radial-gradient(circle at 84% 18%, rgba(16,185,129,.12), transparent 30%),
    linear-gradient(135deg, #0b1018 0%, #121a24 56%, #0d1117 100%);
  border-bottom: 1px solid rgba(30,100,152,.34);
}

.outil-label {
  margin-bottom: 14px;
  color: #93c5fd;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
}

.outil-title {
  max-width: 760px;
  margin: 0 auto 14px;
  color: #f1f5f9;
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.outil-concept {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  color: #dbe5f1;
  background: transparent;
  border: 0;
  font-size: 13px;
  line-height: 1.8;
}

.outil-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 12px;
  border: 1px solid rgba(148,163,184,.20);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: #dbe5f1;
  font-family: var(--mono);
  font-size: 12px;
}

.quick-access,
.search-wrap,
.diag-card,
.search-result-item,
.search-no-result {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(26,22,18,.10);
  background: var(--bg2);
  box-shadow: 0 10px 26px rgba(26,22,18,.045);
}

.quick-access {
  padding: 18px;
  margin-bottom: 18px;
}

.quick-label {
  margin-bottom: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.quick-btn {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px 10px 36px;
  border: 1px solid rgba(30,100,152,.15);
  border-radius: 6px;
  background: rgba(244,239,230,.55);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.quick-btn::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(30,100,152,.10);
  transform: translateY(-50%);
}

.quick-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(30,100,152,.36);
  background: rgba(30,100,152,.08);
  color: var(--text);
}

.search-wrap {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.search-input {
  min-width: 0;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(30,100,152,.10);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 18px;
  pointer-events: none;
}

.search-clear {
  display: inline-block;
  min-width: 72px;
  visibility: hidden;
  padding: 6px 9px;
  border: 1px solid rgba(26,22,18,.12);
  border-radius: 5px;
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.search-clear:hover {
  border-color: rgba(30,100,152,.28);
  background: rgba(30,100,152,.08);
  color: var(--text);
}

.search-clear.is-visible {
  visibility: visible;
}

.search-count {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 13px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

#search-results {
  width: 100%;
  min-width: 0;
  margin-bottom: 16px;
}

#diag-tree {
  width: 100%;
  min-width: 0;
  scroll-margin-top: 92px;
}

#diag-content {
  min-height: 360px;
}

.search-result-item {
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.search-result-item:hover {
  transform: translateY(-1px);
  border-color: rgba(30,100,152,.34);
}

.search-result-cause {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.search-result-excerpt {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.55;
}

.search-result-excerpt mark,
.search-result-cause mark {
  padding: 0 3px;
  border-radius: 3px;
  background: #dbeafe;
  color: #1e40af;
}

.search-no-result {
  padding: 30px 20px;
  color: var(--text3);
  font-size: 14px;
  text-align: center;
}

.diag-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 16px 0 12px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 11px;
}

.diag-breadcrumb span + span::before {
  content: "/";
  margin-right: 5px;
  color: rgba(26,22,18,.22);
}

.diag-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.diag-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: rgba(30,100,152,.72);
}

.diag-question {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.45;
}

.diag-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  width: 100%;
  min-width: 0;
}

.diag-btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid rgba(26,22,18,.10);
  border-radius: 7px;
  background: rgba(244,239,230,.58);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 13px;
  text-align: left;
  min-width: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.diag-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(30,100,152,.34);
  background: rgba(30,100,152,.08);
  color: var(--text);
}

.diag-btn-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(30,100,152,.18);
}

.diag-btn-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.diag-btn-arrow {
  color: var(--text3);
  font-family: var(--mono);
}

.diag-result-label {
  margin: 22px 0 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.diag-result-label:first-child {
  margin-top: 0;
}

.diag-result-label.cause { color: #b45309; }
.diag-result-label.sol { color: #047857; }
.diag-result-label.cmd { color: var(--accent); }
.diag-result-label.expect { color: #6b48d8; }

.diag-result-title {
  max-width: 760px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 22px;
  font-weight: 760;
  line-height: 1.25;
}

.diag-result-text {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.diag-cli {
  width: 100%;
  min-width: 0;
  margin-top: 9px;
  border: 1px solid rgba(30,100,152,.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(7,10,16,1));
  box-shadow: 0 18px 38px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}

.diag-cli-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #182231, #101720);
  border-bottom: 1px solid rgba(148,163,184,.18);
}

.diag-cli-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diag-cli-controls span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.diag-cli-controls span:nth-child(1) { background: #ef4444; }
.diag-cli-controls span:nth-child(2) { background: #f59e0b; }
.diag-cli-controls span:nth-child(3) { background: #10b981; }

.diag-cli-label {
  min-width: 0;
  overflow: hidden;
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diag-cli-copy {
  padding: 3px 9px;
  border: 1px solid rgba(96,165,250,.34);
  border-radius: 5px;
  background: rgba(30,100,152,.14);
  color: #bfdbfe;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.diag-cli-copy:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.diag-cli-body {
  max-width: 100%;
  padding: 16px 18px 18px;
  overflow-x: auto;
  color: #f8fafc;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre;
  scrollbar-color: rgba(148,163,184,.48) transparent;
}

.diag-expect-block {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid rgba(26,22,18,.10);
  border-radius: 7px;
  background: rgba(244,239,230,.58);
}

.diag-expect-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.55;
}

.expect-ok,
.expect-ko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.expect-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.expect-ko {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.expect-txt {
  min-width: 0;
  color: var(--text2);
  overflow-wrap: anywhere;
}

.diag-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  padding: 9px 18px;
  border: 1px solid rgba(26,22,18,.12);
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(30,100,152,.30);
  color: var(--text);
}

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

.btn-primary:hover {
  color: #fff;
  opacity: .88;
}

@media (max-width: 760px) {
  .outil-wrap {
    padding: 34px 16px 60px;
  }

  #diag-content {
    min-height: 320px;
  }

  .outil-header {
    padding: 36px 16px;
  }

  .outil-title {
    font-size: 34px;
  }

  .outil-meta {
    flex-wrap: wrap;
    justify-content: center;
  }

  .quick-grid,
  .diag-choices {
    grid-template-columns: 1fr;
  }

  .search-wrap {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-count,
  .search-clear {
    grid-column: 1 / -1;
    justify-self: stretch;
    position: static;
  }

  .diag-card {
    padding: 20px 16px;
  }

  .diag-cli-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .diag-cli-copy {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 7px 10px;
  }

  .diag-cli-body {
    padding: 14px;
    font-size: 12px;
  }
}
