
.inline-button--small { padding: 0.34rem 0.62rem; font-size: 0.82rem; }
.inline-button--ghost {
  background: rgba(255,255,255,0.78);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.explorer-shell {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  grid-template-areas:
    "toolbar toolbar"
    "sidebar main";
  gap: 1rem;
  align-items: start;
  width: min(1440px, calc(100vw - 2rem));
  margin-top: 1.35rem;
  margin-left: 50%;
  transform: translateX(-50%);
}
.explorer-shell > * { min-width: 0; }
.explorer-command-bar {
  grid-area: toolbar;
  position: sticky;
  top: 0.75rem;
  z-index: 12;
  padding: 1.05rem 1.2rem;
  border-color: rgba(15,109,122,0.2);
  background:
    linear-gradient(105deg, rgba(239,250,249,0.97), rgba(255,250,242,0.97)),
    var(--panel-strong);
  box-shadow: 0 22px 58px rgba(17,29,36,0.13);
}
.explorer-command-bar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.explorer-command-bar__head .eyebrow { margin-bottom: 0.35rem; }
.explorer-command-bar__head h2 { margin: 0; }
.explorer-command-bar__copy {
  max-width: 52rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.explorer-command-bar__controls {
  display: grid;
  grid-template-columns: minmax(390px, 1.45fr) minmax(190px, 0.65fr) minmax(210px, 0.7fr);
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.9rem;
}
.explorer-control-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.explorer-control-group legend,
.explorer-branch-control > span {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.explorer-branch-control { display: grid; gap: 0; }
.explorer-branch-control select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(19,33,41,0.14);
  border-radius: 13px;
  padding: 0.68rem 0.8rem;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font: inherit;
}
.explorer-layer-menu { position: relative; }
.explorer-layer-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 46px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(19,33,41,0.14);
  border-radius: 13px;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  list-style: none;
}
.explorer-layer-menu summary::-webkit-details-marker { display: none; }
.explorer-layer-menu summary small,
.explorer-layer-menu summary strong { display: block; }
.explorer-layer-menu summary small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.explorer-layer-menu summary strong { margin-top: 0.08rem; font-size: 0.9rem; }
.explorer-layer-menu__chevron {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(15,109,122,0.1);
  color: var(--accent);
  font-size: 1.15rem;
  transition: transform 0.18s ease, background 0.18s ease;
}
.explorer-layer-menu[open] .explorer-layer-menu__chevron {
  transform: rotate(45deg);
  background: rgba(200,106,43,0.14);
  color: var(--accent-2);
}
.explorer-layer-popover {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 20;
  width: min(430px, calc(100vw - 2.5rem));
  max-height: min(620px, calc(100vh - 11rem));
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgba(19,33,41,0.13);
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 24px 64px rgba(17,29,36,0.2);
}
.explorer-layer-popover__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.explorer-layer-popover__head .eyebrow { margin-bottom: 0.2rem; }
.explorer-layer-popover__head > span { color: var(--muted); font-size: 0.74rem; }
.explorer-command-bar__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(19,33,41,0.08);
}
.explorer-command-bar__foot p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}
.explorer-sidebar { grid-area: sidebar; }
.explorer-main { grid-area: main; }
.explorer-sidebar, .explorer-main, .explorer-detail-grid { display: grid; gap: 1rem; }
.explorer-search-panel { align-self: start; }
.explorer-graph-panel { min-height: 760px; }
.explorer-panel h2, .explorer-panel h3 { margin: 0; }
  .explorer-panel__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
  }
  .explorer-panel__head--compact { align-items: center; }
  .explorer-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: 260px;
}
.explorer-kpis div,
.explorer-result__meta span,
.explorer-module__meta,
.explorer-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
}
.explorer-kpis div { padding: 0.55rem 0.7rem; text-align: center; }
.explorer-kpis span { display: block; color: var(--muted); font-size: 0.76rem; }
.explorer-kpis strong { display: block; margin-top: 0.1rem; font-size: 1.05rem; }
.explorer-field { display: grid; gap: 0.35rem; margin: 0.85rem 0 0.75rem; }
.explorer-field label { font-weight: 700; }
.explorer-field input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  background: rgba(255,255,255,0.78);
  color: var(--ink);
}
.explorer-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  background: rgba(255,255,255,0.78);
  color: var(--ink);
}
.explorer-view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
}
.explorer-view-switch label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 46px;
  border: 1px solid rgba(19,33,41,0.14);
  border-radius: 13px;
  padding: 0.58rem 0.5rem;
  background: rgba(255,255,255,0.88);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 750;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.explorer-view-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.explorer-view-switch label:hover { transform: translateY(-1px); }
.explorer-view-switch label:has(input:checked) {
  border-color: #0f6d7a;
  background: linear-gradient(135deg, #0f6d7a, #175765);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15,109,122,0.22);
}
.explorer-view-switch label:focus-within { outline: 3px solid rgba(15,109,122,0.22); outline-offset: 2px; }
.explorer-taxonomy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}
.explorer-taxonomy-legend span {
  border: 1px solid rgba(19,33,41,0.14);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: var(--branch-color, #d7dde0);
  color: #102027;
}
.explorer-taxonomy-legend [data-branch="Matter"] { --branch-color: #8dcfc4; }
.explorer-taxonomy-legend [data-branch="Process"] { --branch-color: #f1b46f; }
.explorer-taxonomy-legend [data-branch="InformationEntity"] { --branch-color: #b8a6dc; }
.explorer-taxonomy-legend [data-branch="Characteristic"] { --branch-color: #91c9d8; }
.explorer-taxonomy-legend [data-branch="Agent"] { --branch-color: #b9c0c5; }
.explorer-note {
  margin-top: 0.7rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}
.explorer-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
  color: var(--ink);
}
.explorer-results {
  display: grid;
  gap: 0.55rem;
  max-height: 560px;
  margin-top: 0.9rem;
  padding-right: 0.25rem;
  overflow: auto;
  scrollbar-color: rgba(15,109,122,0.34) transparent;
}
.explorer-result {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  padding: 0.8rem 0.9rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.explorer-result:hover,
.explorer-result.is-highlighted,
.explorer-trail button:hover,
.explorer-trail button.is-active {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 29, 36, 0.08);
  border-color: rgba(15,109,122,0.24);
}
.explorer-result.is-active { border-color: rgba(15,109,122,0.32); background: rgba(244, 251, 251, 0.92); }
.explorer-result strong { display: block; }
.explorer-result small { color: var(--muted); }
.explorer-result__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0; }
.explorer-result__meta span,
.explorer-module__meta,
.explorer-chip { padding: 0.18rem 0.5rem; font-size: 0.76rem; color: var(--muted); }
.explorer-empty {
  border: 1px dashed rgba(19,33,41,0.18);
  border-radius: 16px;
  padding: 0.95rem;
  color: var(--muted);
  background: rgba(255,255,255,0.42);
}
.explorer-module-grid { display: grid; gap: 0.65rem; margin-top: 0.85rem; }
.explorer-module {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  border: 1px solid rgba(19,33,41,0.08);
  border-radius: 16px;
  padding: 0.75rem 0.8rem;
  background: rgba(255,255,255,0.72);
}
.explorer-module strong,
.explorer-inspector strong,
.explorer-relations th,
.explorer-relations td:first-child { color: var(--ink); }
.explorer-module small { display: block; margin-top: 0.15rem; color: var(--muted); line-height: 1.45; }
.explorer-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin: 0; }
.explorer-toolbar button[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.explorer-trail { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.explorer-trail button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  padding: 0.48rem 0.75rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
  .explorer-chart {
    min-height: 620px;
    border: 1px solid rgba(19,33,41,0.08);
    border-radius: 18px;
    background:
      linear-gradient(rgba(15,109,122,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(15,109,122,0.035) 1px, transparent 1px),
      linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,244,237,0.76));
    background-size: 28px 28px, 28px 28px, auto;
  }
  .explorer-chart-wrap {
    position: relative;
    margin-top: 0.85rem;
  }
  .explorer-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.1rem;
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.86rem;
  }
  .explorer-breadcrumb button,
  .explorer-breadcrumb span {
    border: 0;
    border-radius: 999px;
    padding: 0.3rem 0.58rem;
    background: rgba(15,109,122,0.08);
    color: var(--ink);
    font: inherit;
  }
  .explorer-breadcrumb button { cursor: pointer; }
  .explorer-breadcrumb .separator { padding: 0; background: transparent; color: var(--muted); }
  .explorer-hovercard {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 4;
    width: min(460px, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: auto;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(19,33,41,0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 40px rgba(17, 29, 36, 0.14);
    backdrop-filter: blur(12px);
    pointer-events: none;
  }
  .explorer-hovercard.is-hidden { display: none; }
  .explorer-hovercard__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .explorer-hovercard__head strong {
    font-size: 1rem;
  }
  .explorer-hovercard__label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .explorer-hovercard__body {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.75rem;
  }
  .explorer-hovercard__triple {
    display: grid;
    gap: 0.25rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(19,33,41,0.08);
  }
  .explorer-hovercard__triple:first-child {
    padding-top: 0;
    border-top: 0;
  }
  .explorer-hovercard__spo {
    line-height: 1.55;
    color: var(--ink);
    font-size: 0.96rem;
  }
  .explorer-hovercard__spo strong {
    font-weight: 700;
  }
  .explorer-hovercard__meta {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .explorer-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explorer-inspector { display: grid; gap: 0.8rem; }
  .explorer-inspector__section { padding-top: 0.7rem; border-top: 1px solid rgba(19,33,41,0.08); }
  .explorer-inspector__section:first-child { padding-top: 0; border-top: 0; }
  .explorer-inspector p { margin: 0.3rem 0 0; color: var(--muted); line-height: 1.6; }
.explorer-chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.explorer-relations { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
  .explorer-relations th,
  .explorer-relations td { text-align: left; padding: 0.55rem 0.45rem; border-bottom: 1px solid rgba(19,33,41,0.08); vertical-align: top; }
  .explorer-relations th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
@media (max-width: 1180px) {
  .explorer-command-bar__controls {
    grid-template-columns: minmax(380px, 1.25fr) minmax(190px, 0.75fr) minmax(190px, 0.7fr);
  }
}
@media (max-width: 980px) {
  .explorer-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "toolbar"
      "sidebar"
      "main";
  }
  .explorer-detail-grid { grid-template-columns: 1fr; }
  .explorer-command-bar { position: relative; top: auto; }
  .explorer-command-bar__controls { grid-template-columns: 1fr 1fr; }
  .explorer-control-group { grid-column: 1 / -1; }
  .explorer-kpis { min-width: 0; }
  .explorer-results { max-height: 360px; }
}
@media (max-width: 760px) {
    .explorer-command-bar__head,
    .explorer-command-bar__foot { align-items: stretch; flex-direction: column; }
    .explorer-command-bar__controls { grid-template-columns: 1fr; }
    .explorer-control-group { grid-column: auto; }
    .explorer-toolbar { justify-content: flex-start; }
    .explorer-command-bar__foot p { text-align: left; }
    .explorer-layer-popover { position: static; width: 100%; max-height: none; margin-top: 0.55rem; }
    .explorer-view-switch { grid-template-columns: 1fr; }
    .explorer-panel__head { flex-direction: column; }
    .explorer-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .explorer-graph-panel { min-height: 0; }
    .explorer-chart { min-height: 520px; }
    .explorer-hovercard {
      width: calc(100% - 1.2rem);
      top: 0.6rem;
      left: 0.6rem;
    }
  }
