body.fel-app { overflow-x: hidden; }
main.fel-workspace {
  max-width: 1380px;
  padding: 1.1rem 1.2rem 2.4rem;
  margin: 0 auto;
}
.fel-intro {
  color: var(--dim);
  max-width: 78ch;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.fel-intro code { font: 0.84em var(--mono); }
.fel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 0.85fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .fel-shell { grid-template-columns: 1fr; }
}
.fel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem 1rem;
}
.fel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.fel-card h2 {
  margin: 0;
  font-size: 0.95rem;
}
.fel-card .note, .fel-note {
  color: var(--mute);
  font-size: 0.76rem;
  margin: 0 0 0.55rem;
}
.graph-tools { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.graph-stage {
  position: relative;
  background:
    radial-gradient(ellipse at center, #1c222c 0%, var(--bg0) 72%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.fel-card svg#disk, .graph-stage svg {
  width: 100%;
  height: min(74vh, 680px);
  display: block;
  cursor: grab;
  touch-action: none;
}
.graph-stage svg:active { cursor: grabbing; }
.graph-edit {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.fel-tip {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  max-width: 28rem;
  background: rgba(20, 22, 26, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.7rem 0.6rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.fel-tip strong { display: inline; margin-right: 0.4rem; }
.fel-tip p { margin: 0.35rem 0 0; color: var(--dim); font-size: 0.78rem; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0.65rem 0 0.35rem;
  color: var(--mute);
  font-size: 0.72rem;
}
.legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99px;
  margin-right: 0.28rem;
  vertical-align: -0.05rem;
}
.legend .sw-prim { background: #2a9d8f; }
.legend .sw-def { background: #c4a35a; }
.legend .sw-axiom { background: #3b82f6; }
.legend .sw-thm { background: #fbbf24; }
.legend .sw-obs { background: #a78bfa; }
.concept-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}
.concept-chip, .jump {
  background: var(--bg0);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font: 0.7rem var(--font);
  cursor: pointer;
}
.concept-chip:hover, .jump:hover { border-color: var(--select); }
.concept-chip.on { border-color: #eef0f5; }
.concept-chip.node-prim, .kind-pill.node-prim { color: #7ee0d4; }
.concept-chip.node-definition, .kind-pill.node-definition { color: #e4c888; }
.concept-chip.node-axiom, .kind-pill.node-axiom { color: #93b8ff; }
.concept-chip.node-theorem, .kind-pill.node-theorem { color: #f5d56a; }
.concept-chip.node-observation, .kind-pill.node-observation { color: #c4b0ff; }
.inspect-card {
  position: sticky;
  top: 3.4rem;
  max-height: calc(100vh - 4.2rem);
  overflow: auto;
}
.inspect-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.45rem;
}
.inspect-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.kind-pill {
  font: 0.64rem var(--mono);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  color: var(--dim);
}
.inspect-def {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 0.85rem;
}
.chip-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 0.3rem 0.6rem;
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  align-items: start;
}
.chip-row > span { color: var(--mute); padding-top: 0.12rem; }
.chip-row .muted { color: var(--mute); }
.inspect-k { color: var(--mute); font-size: 0.72rem; margin: 0.6rem 0 0.2rem; }
.inspect-meta { color: var(--mute); font: 0.7rem var(--mono); margin: 0.8rem 0 0.6rem; }
.inspect-card details {
  border-top: 1px solid var(--line);
  padding: 0.35rem 0 0;
  margin-top: 0.35rem;
}
.inspect-card summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 0.76rem;
}
.inspect-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow: auto;
  margin: 0.35rem 0 0;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.6rem;
  font: 0.72rem var(--mono);
}
.fel-flag { color: var(--warn); font-size: 0.8rem; }
.node-prim { fill: #2a9d8f; }
.node-axiom { fill: #3b82f6; }
.node-definition { fill: #c4a35a; }
.node-theorem { fill: #fbbf24; }
.node-observation { fill: #a78bfa; }
.node-review { stroke: #f87171; stroke-width: 0.03; }
.is-selected { stroke: #eef0f5; stroke-width: 0.022; }
.dim { opacity: 0.22; }
.hit { fill: transparent; cursor: pointer; }
.edge { stroke: #5b6574; stroke-width: 0.01; fill: none; }
.edge-extra { stroke: #2a9d8f; stroke-width: 0.009; stroke-dasharray: 0.03 0.024; fill: none; }
.edge.dim, .edge-extra.dim { opacity: 0.18; }
.disk-bound { fill: rgba(255,255,255,0.015); stroke: #343c48; stroke-width: 0.01; }
.disk-origin { fill: #3a424e; }
.label {
  fill: #eef0f5;
  stroke: #14161a;
  stroke-width: 0.016;
  paint-order: stroke;
  font-size: 0.05px;
  font-family: var(--font);
  font-weight: 600;
  pointer-events: none;
}
.label.is-hot { fill: #fff; font-size: 0.054px; }
.fel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.85rem;
  position: sticky;
  top: 3.05rem;
  z-index: 4;
  background: var(--bg0);
  padding: 0.45rem 0;
}
.btn {
  background: var(--bg0);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.32rem 0.65rem;
  font: 0.76rem var(--font);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn.primary { background: var(--select); border-color: transparent; color: #fff; }
.btn.on { border-color: var(--select); color: #fff; }
.btn:hover { filter: brightness(1.08); }
.fel-source {
  width: 100%;
  min-height: 32rem;
  background: var(--bg0);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  font: 0.78rem var(--mono);
  line-height: 1.45;
  resize: vertical;
}
.def-list { display: flex; flex-direction: column; gap: 0.4rem; }
.def-row {
  display: grid;
  grid-template-columns: 7.2rem 8.5rem minmax(0, 1fr) 8.2rem 2.2rem;
  gap: 0.3rem;
  align-items: center;
}
.def-row.on {
  outline: 1px solid var(--select);
  border-radius: var(--radius);
  background: rgba(59, 130, 246, 0.08);
}
.def-row input, .def-row select {
  background: var(--bg0);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.45rem;
  font: 0.8rem var(--font);
  width: 100%;
}
.def-row .def-sentence { font-size: 0.86rem; }
.def-row .def-id { font: 0.78rem var(--mono); }
.def-row .def-del { justify-content: center; padding: 0.3rem 0; }
@media (max-width: 820px) {
  .def-row {
    grid-template-columns: 1fr 1fr 2.2rem;
    grid-template-areas:
      "kind name del"
      "sentence sentence sentence"
      "isa isa isa";
  }
  .def-kind { grid-area: kind; }
  .def-id { grid-area: name; }
  .def-sentence { grid-area: sentence; }
  .def-isa { grid-area: isa; }
  .def-del { grid-area: del; }
}
.fel-diag {
  min-height: 1.6rem;
  margin: 0.5rem 0 0;
  color: var(--dim);
  white-space: pre-wrap;
  font: 0.75rem var(--mono);
}
.fel-diag:empty { display: none; }
.fel-meta { font: 0.72rem var(--mono); color: var(--mute); }
.fel-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem;
}
@media (max-width: 1100px) {
  .fel-edit-grid { grid-template-columns: 1fr; }
  .inspect-card { position: static; max-height: none; }
}
header.top .ver.on { color: var(--ok); border-color: currentColor; }
header.top .ver.no { color: var(--warn); border-color: currentColor; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted { color: var(--mute); }
.dict-workspace {
  max-width: 52rem;
  padding: 1.1rem 1.2rem 3rem;
  margin: 0 auto;
}
.dict-search {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.dict-search input {
  flex: 1;
  background: var(--bg1);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  font: 1rem var(--font);
}
.dict-index {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dict-index li {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0 0.75rem;
}
.dict-index-term {
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dict-index-term:hover { color: #fff; }
.dict-index p {
  margin: 0.2rem 0 0;
  color: var(--dim);
  font-size: 0.92rem;
}
.dict-senses {
  margin-left: 0.55rem;
  font: 0.75rem var(--mono);
  color: var(--mute);
}
.dict-senses a { color: var(--dim); }
.dict-term {
  font-size: 2.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  font-weight: 650;
}
.dict-back { margin: 0 0 0.8rem; font-size: 0.8rem; }
.dict-back a { color: var(--dim); }
.dict-kicker {
  font: 0.72rem var(--mono);
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}
.dict-def {
  font-size: 1.12rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}
.dict-meta {
  display: grid;
  gap: 0.45rem 0;
  margin: 0 0 0.8rem;
}
.dict-meta > div {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.4rem;
  font-size: 0.86rem;
}
.dict-meta dt { color: var(--mute); font-weight: 500; }
.dict-meta dd { margin: 0; }
.dict-chip {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
}
.dict-chip:hover { border-color: var(--select); }
.dict-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.8rem 0; }
.dict-expand {
  white-space: pre-wrap;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  font: 0.8rem var(--font);
  color: var(--dim);
}
.dict-flag {
  color: var(--warn);
  font-size: 0.88rem;
}
.dict-sense { margin: 0 0 2rem; }
.dict-sense h2 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.dict-sense h3 { margin: 1rem 0 0.3rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute); }
.dict-sense ul { margin: 0; padding-left: 1.1rem; color: var(--dim); }
.dict-axioms { margin-top: 2rem; }
.dict-axioms h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mute); }
.dict-axioms ul { padding-left: 1.1rem; color: var(--dim); }
.kernel-list { margin: 0; padding-left: 1.1rem; color: var(--dim); font-size: 0.84rem; }
.kernel-list code { font: 0.72rem var(--mono); }
.sense-list { display: flex; flex-direction: column; gap: 0.85rem; }
.sense-card, .axiom-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg0);
  padding: 0.75rem;
}
.sense-card.on { border-color: var(--select); }
.sense-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 5rem minmax(0, 1fr) 7rem auto;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.sense-card label, .axiom-card label {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.7rem;
  color: var(--mute);
}
.sense-card input, .sense-card select, .sense-card textarea,
.axiom-card input, .axiom-card select, .axiom-card textarea {
  background: var(--bg1);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.45rem;
  font: 0.86rem var(--font);
  width: 100%;
}
.sense-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.35rem !important;
  padding-top: 1.1rem;
  color: var(--text) !important;
  font-size: 0.8rem !important;
}
.sense-extra {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin: 0.4rem 0;
}
@media (max-width: 860px) {
  .sense-grid, .sense-extra { grid-template-columns: 1fr; }
  .sense-check { padding-top: 0; }
}
.fel-source-fold { margin-top: 1rem; }
.fel-source-fold summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.fel-source-fold pre {
  margin-top: 0.7rem;
  max-height: 28rem;
  overflow: auto;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  font: 0.75rem var(--mono);
  color: var(--dim);
}
