* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a202c;
}

/* ── header ────────────────────────────────────────────────────── */
header {
  background: #2a4365;
  color: #fff;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
header button,
header select {
  background: #fff;
  color: #2a4365;
  border: 0;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
}
header button:hover,
header select:hover { background: #ebf4ff; }
header select { padding: 0.4rem 0.5rem; }

/* Language picker — typeahead combobox */
#language-picker-container { margin-left: auto; position: relative; }
.lang-combobox { position: relative; }
.lang-input {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  width: 10rem;
  font-family: inherit;
}
.lang-input:focus {
  outline: 2px solid #bee3f8;
  outline-offset: -1px;
  background: rgba(255, 255, 255, 0.1);
}
.lang-input::placeholder { color: rgba(255, 255, 255, 0.6); }

.lang-list {
  position: absolute;
  top: 100%;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  color: #1a202c;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 22rem;
  overflow-y: auto;
  min-width: 18rem;
  z-index: 1000;
  font-size: 0.9rem;
}
.lang-list[hidden] { display: none; }
.lang-list li {
  padding: 0.35rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}
.lang-list li:hover,
.lang-list li[aria-selected="true"] { background: #ebf4ff; }
.lang-badge {
  color: #38a169;
  font-weight: 700;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.lang-native { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.lang-en {
  color: #718096;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-code {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: #a0aec0;
  padding-left: 0.5rem;
}
.lang-empty {
  padding: 0.5rem;
  text-align: center;
  color: #718096;
  font-style: italic;
  cursor: default;
}
#shell-status b { color: #fff; font-weight: 600; }
#shell-status {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: #bee3f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── workspace ─────────────────────────────────────────────────── */
main {
  flex: 1;
  position: relative;
  min-height: 0;
}
#blocklyDiv {
  position: absolute;
  inset: 0;
}

/* ── footer ────────────────────────────────────────────────────── */
footer {
  background: #2a4365;
  color: #cbd5e0;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  text-align: center;
  flex-shrink: 0;
}
footer a {
  color: #bee3f8;
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }

/* ── dialogs ───────────────────────────────────────────────────── */
dialog {
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 640px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
dialog::backdrop { background: rgba(0,0,0,0.35); }
dialog h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.hint { color: #4a5568; font-size: 0.9rem; margin: 0 0 1rem; }
.hint code { background: #edf2f7; padding: 1px 4px; border-radius: 3px; font-size: 0.85em; }

dialog fieldset {
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  padding: 0.75rem;
  margin: 0 0 1rem;
}
dialog fieldset legend { padding: 0 0.25rem; color: #4a5568; font-size: 0.85rem; }
dialog menu {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
}
dialog menu button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid #cbd5e0;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
dialog menu button:hover { background: #f7fafc; }
#shell-save, #export-copy {
  background: #2a4365; color: #fff; border-color: #2a4365;
}
#shell-save:hover, #export-copy:hover { background: #1a365d; }

.shell-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.shell-header label { flex: 1; display: flex; flex-direction: column; font-size: 0.85rem; color: #4a5568; gap: 0.25rem; }
.shell-header input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.shell-arg {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.shell-arg input {
  flex: 1;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.9rem;
}
.shell-arg .shell-arg-type { flex: 0 0 10rem; font-family: ui-monospace, monospace; }
.shell-arg-remove {
  background: #fed7d7;
  color: #c53030;
  border: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.shell-arg-remove:hover { background: #feb2b2; }
#shell-add-arg {
  background: #e6fffa;
  color: #234e52;
  border: 1px dashed #81e6d9;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}
#shell-add-arg:hover { background: #b2f5ea; }

#export-json {
  width: 100%;
  height: 320px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  padding: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  resize: vertical;
  background: #f7fafc;
}
#export-error, .error {
  color: #c53030;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
  white-space: pre-wrap;
}

/* ── fill slots from test ─────────────────────────────────────── */
#fill-slots-modal { max-width: 640px; }
.fill-slots-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #4a5568;
}
.fill-slots-picker select {
  flex: 1;
  padding: 0.3rem 0.4rem;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  font-size: 0.85rem;
}
.fill-slots-picker select:disabled { opacity: 0.6; background: #f7fafc; }
#fill-slots-preview {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.35rem 0;
  min-height: 1rem;
  margin-bottom: 0.75rem;
  background: #f7fafc;
}
#fill-slots-preview:empty { display: none; }
.fill-slots-row {
  display: grid;
  grid-template-columns: 1fr auto 2fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}
.fill-arg-label { font-weight: 500; color: #2d3748; }
.fill-arg-type code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: #718096;
  background: #fff;
  padding: 0 4px;
  border-radius: 3px;
}
.fill-arg-value {
  font-family: ui-monospace, monospace;
  color: #2c5282;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fill-fate {
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.fill-fate.will { background: #c6f6d5; color: #22543d; }
.fill-fate.skip { background: #edf2f7; color: #718096; }
#fill-slots-apply {
  background: #38a169;
  color: #fff;
  border-color: #38a169;
}
#fill-slots-apply:hover:not(:disabled) { background: #2f855a; }
#fill-slots-apply:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── slot picker ──────────────────────────────────────────────── */
#slot-picker-modal { max-width: 640px; }
#slot-picker-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
#slot-picker-results {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.25rem;
}
.slot-picker-group h3 {
  font-size: 0.78rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.5rem 0.25rem 0.25rem;
  font-weight: 600;
}
.slot-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 0.35rem 0.6rem;
  margin: 0 0 0.15rem;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.9rem;
  color: #2d3748;
}
.slot-picker-item:hover { background: #ebf4ff; }
.slot-picker-item-label { flex: 1; }
.slot-picker-item-meta {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: #718096;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.slot-picker-empty {
  padding: 1rem;
  text-align: center;
  color: #718096;
  font-style: italic;
}

/* ── wikidata search ──────────────────────────────────────────── */
#wikidata-search-modal { max-width: 640px; }
#wikidata-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
#wikidata-search-input:focus {
  outline: 2px solid #2a4365;
  outline-offset: -1px;
}
#wikidata-search-results {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.25rem;
  background: #f7fafc;
  min-height: 3rem;
}
#wikidata-search-results:empty { border-style: dashed; background: transparent; }
.wikidata-search-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.45rem 0.7rem;
  margin: 0 0 0.15rem;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.9rem;
  color: #2d3748;
}
.wikidata-search-item:hover { background: #ebf4ff; }
.wikidata-search-item-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}
.wikidata-search-item-label { font-weight: 500; color: #1a202c; }
.wikidata-search-item-id {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: #718096;
  flex-shrink: 0;
}
.wikidata-search-item-desc {
  font-size: 0.8rem;
  color: #4a5568;
  line-height: 1.3;
}
.wikidata-search-status,
.wikidata-search-empty {
  padding: 0.75rem;
  color: #718096;
  font-style: italic;
  text-align: center;
  font-size: 0.88rem;
}
.wikidata-search-error {
  padding: 0.75rem;
  color: #c53030;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.slot-picker-wikidata h3 { color: #2c5282; }
.slot-picker-wikidata-btn {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
}
.slot-picker-wikidata-btn:hover { background: #bee3f8; }

/* ── import modal ──────────────────────────────────────────────── */
#import-modal { max-width: 640px; }
.import-tabs { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.import-tabs label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: #4a5568; }
.import-tabs input,
.import-tabs textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
.import-tabs textarea { resize: vertical; }
header #import-btn {
  background: #e9d8fd;
  color: #553c9a;
}
header #import-btn:hover { background: #d6bcfa; }
#import-submit { background: #553c9a; color: #fff; border-color: #553c9a; }
#import-submit:hover:not(:disabled) { background: #44337a; }
#import-submit:disabled { opacity: 0.6; cursor: wait; }

/* ── add-function / search modal ───────────────────────────────── */
#add-function-modal { max-width: 720px; }
.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
#search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 1rem;
}
#search-input:focus {
  outline: 2px solid #2a4365;
  outline-offset: -1px;
}
#search-status {
  font-size: 0.8rem;
  color: #718096;
  min-width: 6rem;
  text-align: right;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.filter-row > label {
  font-size: 0.8rem;
  color: #4a5568;
  min-width: 3.5rem;
  font-weight: 500;
}
.filter-input {
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  width: 10rem;
}
.filter-chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 0.2rem 0.5rem;
  border: 1px solid #cbd5e0;
  background: #fff;
  color: #4a5568;
  border-radius: 3px;
  cursor: pointer;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}
.filter-chip:hover { background: #edf2f7; }
.filter-chip.active {
  background: #2a4365;
  color: #fff;
  border-color: #2a4365;
}

#search-results {
  margin-top: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f7fafc;
}
#search-results:empty { display: none; }
.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}
.search-result:last-child { border-bottom: 0; }
.search-result-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.search-result-label {
  font-weight: 500;
  color: #1a202c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-sub {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
  min-width: 0;
}
.search-result-zid {
  font-family: ui-monospace, monospace;
  color: #718096;
  text-decoration: none;
  flex-shrink: 0;
}
.search-result-zid:hover { color: #2a4365; text-decoration: underline; }
.search-result-signature {
  font-family: ui-monospace, monospace;
  color: #4a5568;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.search-result-signature::before {
  content: "·";
  margin-right: 0.35rem;
  color: #cbd5e0;
}
.search-result-signature:empty::before { content: ""; }
.search-result-pin {
  flex-shrink: 0;
  margin-left: 0.75rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid #2a4365;
  background: #2a4365;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  min-width: 5rem;
}
.search-result-pin:hover:not(:disabled) { background: #1a365d; }
.search-result-pin:disabled { opacity: 0.6; cursor: wait; }
.search-result-pin.pinned {
  background: #fff;
  color: #2a4365;
}
.search-result-pin.pinned:hover:not(:disabled) { background: #fed7d7; color: #c53030; border-color: #c53030; }
.search-error {
  padding: 0.75rem;
  color: #c53030;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
.search-info {
  padding: 0.75rem 1rem;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  color: #2c5282;
  font-size: 0.88rem;
  border-radius: 4px;
  line-height: 1.45;
}
.search-info code {
  background: #fff;
  padding: 0 4px;
  border-radius: 3px;
}
.search-info a { color: #2b6cb0; }
header #add-function-btn {
  background: #fef5e7;
  color: #744210;
}
header #add-function-btn:hover { background: #fbd38d; }

/* ── run modal ─────────────────────────────────────────────────── */
.run-scope-banner {
  padding: 0.5rem 0.75rem;
  background: #fffaf0;
  border: 1px solid #feebc8;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #744210;
  margin-bottom: 0.75rem;
  font-family: ui-monospace, monospace;
  word-break: break-word;
}
.run-scope-banner strong { color: #975a16; font-family: system-ui, sans-serif; margin-right: 0.4rem; }

.run-test-loader {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 4px;
  font-size: 0.88rem;
}
.run-test-loader label { display: flex; align-items: center; gap: 0.5rem; color: #22543d; }
.run-test-loader select {
  flex: 1;
  padding: 0.3rem 0.4rem;
  border: 1px solid #9ae6b4;
  border-radius: 3px;
  font-size: 0.85rem;
  background: #fff;
}
.run-test-loader select:disabled { opacity: 0.6; background: #f7fafc; }

.run-input-row { margin-bottom: 0.75rem; }
.run-input-row label { display: flex; flex-direction: column; gap: 0.25rem; }
.run-input-label {
  font-size: 0.85rem;
  color: #4a5568;
}
.run-input-label code {
  background: #edf2f7;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}
.run-input-row input {
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}
#run-submit {
  background: #38a169;
  color: #fff;
  border-color: #38a169;
}
#run-submit:hover { background: #2f855a; }
#run-submit:disabled { opacity: 0.6; cursor: wait; }
header #run-btn {
  background: #c6f6d5;
  color: #22543d;
}
header #run-btn:hover { background: #9ae6b4; }

/* ── result modal ──────────────────────────────────────────────── */
.result-formatted {
  font-family: ui-monospace, monospace;
  font-size: 1.2rem;
  padding: 1rem;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  word-break: break-word;
}
.result-error {
  font-family: system-ui, sans-serif;
  padding: 1rem;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 4px;
  color: #742a2a;
  margin-bottom: 0.75rem;
}
.result-error .error-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #c53030;
  margin-bottom: 0.35rem;
}
.result-error .error-zid { font-weight: 400; font-size: 0.9em; }
.result-error .error-zid a { color: #c53030; }
.result-error .error-message {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  background: #fffafa;
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.4rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.result-error .error-hint {
  font-size: 0.88rem;
  color: #744210;
  border-left: 3px solid #f6e05e;
  padding: 0.1rem 0.5rem;
  background: #fffff0;
}
#result-heading.error { color: #c53030; }

.result-meta {
  font-size: 0.8rem;
  color: #718096;
  font-family: ui-monospace, monospace;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.5rem;
  background: #f7fafc;
  border-radius: 3px;
}
.result-meta a { color: #4a5568; text-decoration: underline; }
.result-meta a:hover { color: #2a4365; }
#result-raw {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.5rem;
  max-height: 300px;
  overflow: auto;
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
details summary {
  cursor: pointer;
  color: #4a5568;
  font-size: 0.85rem;
  user-select: none;
}

/* ── Peek-inside popover ─────────────────────────────────────────── */
#peek-popover {
  position: fixed;
  background: #fff;
  border: 1px solid #a0aec0;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  padding: 0.75rem 0.85rem 0.6rem;
  font-size: 0.88rem;
  overflow: auto;
  z-index: 2000;
}
#peek-popover[hidden] { display: none; }

.peek-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  line-height: 1;
  color: #718096;
  cursor: pointer;
  padding: 0 4px;
}
.peek-close:hover { color: #2d3748; }

.peek-body { margin-top: 0.2rem; }

.peek-loading, .peek-error, .peek-note {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}
.peek-loading { color: #4a5568; font-style: italic; }
.peek-error   { color: #c53030; background: #fff5f5; border-radius: 3px; }
.peek-note    { color: #4a5568; background: #f7fafc; border-radius: 3px; }

.peek-card {
  border: 1px solid #cbd5e0;
  border-radius: 5px;
  padding: 0.5rem 0.6rem;
  background: #f7fafc;
  margin-bottom: 0.4rem;
}

.peek-header { margin-bottom: 0.4rem; }
.peek-title  {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.peek-title .peek-label {
  font-weight: 600;
  color: #2d3748;
}
.peek-title .peek-zid,
.peek-zid {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #4a5568;
  text-decoration: none;
  border-bottom: 1px dotted #a0aec0;
}
.peek-zid:hover { color: #2a4365; border-bottom-color: #2a4365; }
.peek-sig {
  font-size: 0.8rem;
  color: #4a5568;
  margin-top: 0.15rem;
}

.peek-impl-row {
  font-size: 0.75rem;
  color: #718096;
  margin-bottom: 0.35rem;
}
.peek-impl-row a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.peek-comp-body > .peek-call,
.peek-comp-body > .peek-compound,
.peek-comp-body > .peek-list,
.peek-comp-body > .peek-zidref,
.peek-comp-body > .peek-lit,
.peek-comp-body > .peek-argref {
  margin-top: 0.2rem;
}

.peek-call {
  border-left: 2px solid #4299e1;
  padding-left: 0.55rem;
  margin: 0.25rem 0;
}
.peek-call-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-weight: 500;
}
.peek-call-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.peek-arrow {
  color: #718096;
  font-size: 0.82rem;
}
.peek-call-args {
  margin: 0.25rem 0 0.1rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.peek-call-arg, .peek-compound-row {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.peek-arg-label {
  color: #4a5568;
  font-size: 0.82rem;
  flex-shrink: 0;
  min-width: 6rem;
}
.peek-arg-value {
  flex: 1 1 auto;
  min-width: 0;
}

.peek-compound {
  border-left: 2px solid #b794f4;
  padding-left: 0.55rem;
  margin: 0.2rem 0;
}
.peek-compound-header {
  font-size: 0.78rem;
  color: #6b46c1;
  margin-bottom: 0.15rem;
}
.peek-compound-rows {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.peek-list {
  border-left: 2px dashed #cbd5e0;
  padding-left: 0.55rem;
  margin: 0.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.peek-list-empty { color: #a0aec0; font-style: italic; }

.peek-lit {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #2f855a;
  background: #f0fff4;
  padding: 0 0.3rem;
  border-radius: 3px;
  border: 1px solid #c6f6d5;
}

.peek-zidref {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
}
.peek-zidref a {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #2a4365;
  text-decoration: none;
  border-bottom: 1px dotted #2a4365;
}

.peek-argref {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: #b7791f;
  background: #fffaf0;
  padding: 0 0.3rem;
  border-radius: 3px;
  border: 1px solid #feebc8;
}

.peek-null {
  color: #a0aec0;
  font-style: italic;
}

.peek-drill {
  background: transparent;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  color: #4a5568;
  cursor: pointer;
  padding: 0 0.3rem;
  font-size: 0.75rem;
  line-height: 1.2;
  margin-left: 0.2rem;
}
.peek-drill:hover:not(:disabled) {
  background: #ebf8ff;
  border-color: #63b3ed;
  color: #2a4365;
}
.peek-drill:disabled {
  opacity: 0.35;
  cursor: default;
}
.peek-drill.expanded {
  background: #bee3f8;
  border-color: #4299e1;
  color: #2a4365;
}

.peek-drill-card {
  margin: 0.3rem 0 0.2rem 0.6rem;
  padding-left: 0.3rem;
  border-left: 3px solid #4299e1;
}
