/* CSVisualizer — examples-editor.html only. Built on css/catalog.css (.catalog tokens, panels) and the drawer of
   css/visualizer.css (.uv-lib); nothing here changes the catalog or the visualizer. */

/* list button in the banner: the shape of the banner's C# / Java selector */
.ed-list-btn {
  flex: none; padding: 7px 14px; border: 1px solid #ffffff40; border-radius: 9px; background: #ffffff14;
  color: #fff; font: 700 13px Arial, "Segoe UI", sans-serif; cursor: pointer;
}
.ed-list-btn:hover { background: #ffffff26; }
.ed-list-btn[aria-expanded="true"] { background: #fff; color: #183775; }
.ed-list-btn:focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }

/* the drawer sits below the banner so the list button stays reachable; closed = hidden, takes no space */
.ed-drawer.uv-lib { top: var(--ed-top, 56px); z-index: 70; }
.ed-drawer .uv-lib-item { cursor: pointer; }
.ed-drawer .ed-row { display: flex; align-items: center; gap: 2px; }
.ed-drawer .ed-row.is-drag { opacity: .45; }
.ed-drawer .ed-row.is-over { box-shadow: inset 0 2px 0 #1c5bb8; }
.ed-drawer .ed-row.is-over-after { box-shadow: inset 0 -2px 0 #1c5bb8; }
.ed-drawer .ed-row.no-drop { cursor: not-allowed; }
.ed-grip { flex: none; width: 14px; color: #9aa5b8; cursor: grab; text-align: center; user-select: none; font-size: 12px; }
.ed-move { flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid #d7dfeb; border-radius: 5px; background: #f5f7fb; color: #33415c; font-size: 11px; line-height: 1; cursor: pointer; }
.ed-move:hover:not(:disabled) { background: #e6ecf6; }
.ed-move:disabled { opacity: .35; cursor: default; }

/* tools row */
.ed-main { padding-top: 12px; }
.ed-tools { justify-content: space-between; margin-bottom: 18px; }
.ed-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ed-mode { font-size: 17px; font-weight: 800; color: var(--navy); }
.ed-id { color: #7a88a0; font: 13px Consolas, "Courier New", monospace; }
.ed-dirty { padding: 3px 9px; border-radius: 999px; background: #fff4d6; color: #7a4b00; font-size: 12px; font-weight: 700; }
.ed-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-sep { width: 1px; height: 24px; background: var(--line); }
.ed-db-info { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }

/* buttons: the pill of .catalog-toggle-all; primary = navy like the active filter */
.ed-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid #cdd8ea;
  border-radius: 999px; background: #fff; color: #233a63; font: 600 13px Arial, "Segoe UI", sans-serif; cursor: pointer;
}
.ed-btn:hover:not(:disabled) { background: var(--soft); }
.ed-btn:focus-visible, .ed-panel :is(input, select, textarea, button):focus-visible { outline: 3px solid #facc15; outline-offset: 2px; }
.ed-btn:disabled { opacity: .45; cursor: default; }
.ed-btn.is-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.ed-btn.is-primary:hover:not(:disabled) { background: #102a5c; }
.ed-btn.is-danger { color: #9b1c1c; border-color: #efc4c4; }
.ed-btn.is-danger:hover:not(:disabled) { background: #fff1f1; }
.ed-btn.is-small { padding: 5px 11px; font-size: 12.5px; }
.ed-btn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ed-btn.lang-csharp.is-on { background: var(--cs); border-color: var(--cs); }
.ed-btn.lang-java.is-on { background: var(--java); border-color: var(--java); }
.ed-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ed-export:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.ed-badge { color: #d97706; font-size: 14px; line-height: 1; }

.ed-message { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #ecfdf3; color: #14532d; border: 1px solid #b7e4c7; max-width: none; }
.ed-message.is-error { background: #fff1f1; color: #7a1f1f; border-color: #f2c2c2; }

/* panels: the white card of .domain-group */
.ed-panel { margin: 0 0 20px; padding: 16px 20px 18px; background: var(--panel); border: 1px solid var(--line); border-right: 5px solid var(--navy); border-radius: 12px; }
.ed-panel h2 { margin: 0 0 14px; font-size: 19px; color: var(--ink); }
.ed-panel h2 code { color: #7a88a0; font-size: 12px; font-weight: 400; }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.ed-span { grid-column: 1 / -1; }
.ed-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ed-field > label, .ed-field > legend { font-size: 13.5px; font-weight: 700; color: #233a63; padding: 0; }
.ed-req { font-weight: 400; color: var(--muted); font-size: 12px; }
.ed-panel input[type="text"], .ed-panel select, .ed-panel textarea {
  box-sizing: border-box; width: 100%; padding: 8px 10px; border: 1px solid #cdd8ea; border-radius: 8px; background: #f8faff;
  color: var(--ink); font: 14.5px Arial, "Segoe UI", sans-serif;
}
.ed-panel :is(input[type="text"], select, textarea):focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px #18377522; }
.ed-panel textarea { resize: vertical; line-height: 1.5; }
.ed-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-inline > input[type="text"] { width: auto; flex: 1 1 160px; }
.ed-inline > select { width: auto; flex: 1 1 160px; }
.ed-checks { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.ed-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #cdd8ea; border-radius: 999px; background: #fff; font-size: 13px; cursor: pointer; }
.ed-check:has(input:checked) { background: var(--soft); border-color: var(--navy); color: var(--navy); font-weight: 700; }
.ed-check input { margin: 0; }
.ed-check.is-other { opacity: .75; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.ed-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--soft); color: var(--navy); font-size: 13px; }
.ed-chip button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.ed-chip button:hover { background: #d3dff5; }
.ed-err { margin: 0; color: #b42318; font-size: 12.5px; font-weight: 700; max-width: none; }
.ed-panel .is-invalid { border-color: #d92d20 !important; }
.ed-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fff8e6; border: 1px solid #f5d38a; color: #6b4a00; font-size: 13.5px; line-height: 1.55; max-width: none; }
.ed-note.is-quiet { background: #f5f8ff; border-color: var(--line); color: var(--muted); margin: 14px 0 0; }
.ed-empty { margin: 8px 0 0; color: var(--muted); max-width: none; }

/* code */
.ed-langs { margin-bottom: 12px; }
.ed-impl { display: flex; flex-direction: column; gap: 10px; }
.ed-files { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 6px; direction: ltr; justify-content: flex-start; }
.ed-file { padding: 6px 12px; border: 1px solid #cdd8ea; border-radius: 7px 7px 0 0; background: #f5f7fb; color: #33415c; font: 13px Consolas, "Courier New", monospace; cursor: pointer; }
.ed-file.is-active { background: #fff; border-color: var(--navy); color: var(--navy); font-weight: 700; }
.ed-file-tools label { font-size: 13px; font-weight: 700; color: #233a63; }
.ed-file-tools input { max-width: 260px; font-family: Consolas, "Courier New", monospace !important; }
.ed-panel textarea.ed-code { min-height: 320px; font: 13.5px/1.5 Consolas, "Cascadia Mono", "Courier New", monospace; tab-size: 4; white-space: pre; overflow: auto; text-align: left; background: #0f1b2e; color: #e6eefb; border-color: #22324d; }
.ed-panel textarea.ed-code:focus { background: #0f1b2e; }

/* scenarios */
.ed-scen { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.ed-scen-head { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.ed-scen table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ed-scen th { text-align: start; color: var(--muted); font-weight: 700; padding: 4px; }
.ed-scen td { padding: 3px 4px; vertical-align: middle; }
.ed-scen td input[type="text"], .ed-scen td select { padding: 5px 8px; font-size: 13px; }
.ed-scen .ed-extra { color: var(--muted); font-size: 12px; margin: 6px 0 0; max-width: none; }

@media (max-width: 820px) {
  .ed-grid { grid-template-columns: 1fr; }
  .ed-scen-head { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ed-list-btn { padding: 7px 9px; font-size: 12px; }
  .ed-panel { padding: 14px 14px 16px; }
  .ed-scen table, .ed-scen tbody, .ed-scen tr, .ed-scen td { display: block; width: 100%; }
  .ed-scen thead { display: none; }
  .ed-scen tr { padding: 6px 0; border-bottom: 1px solid var(--line); }
}

/* Dark appearance ("כהה מלאה"): the editor's own surfaces; the page tokens are set in catalog.css (body.ui-dark .catalog). */
body.ui-dark .ed-panel { background: #161e2c; border-color: #2d3a51; border-right-color: #8bb9ff; }
body.ui-dark .ed-panel h2 { color: #e2e8f3; }
body.ui-dark .ed-panel h2 code, body.ui-dark .ed-id { color: #8795ad; }
body.ui-dark .ed-mode { color: #bcd4ff; }
body.ui-dark .ed-sep { background: #2d3a51; }
body.ui-dark .ed-field > label, body.ui-dark .ed-field > legend, body.ui-dark .ed-file-tools label { color: #c9d8f5; }
body.ui-dark .ed-panel :is(input[type="text"], select, textarea) { background: #0f1522; border-color: #3a4c6b; color: #e2e8f3; }
body.ui-dark .ed-panel :is(input[type="text"], select, textarea):focus { background: #0f1522; border-color: #8bb9ff; }
body.ui-dark .ed-btn { background: #161e2c; border-color: #3a4c6b; color: #c9d8f5; }
body.ui-dark .ed-btn:hover:not(:disabled) { background: #1d3152; }
body.ui-dark .ed-btn.is-primary, body.ui-dark .ed-btn.is-on { background: #2a5399; border-color: #2a5399; color: #fff; }
body.ui-dark .ed-btn.is-primary:hover:not(:disabled) { background: #33619f; }
body.ui-dark .ed-btn.lang-csharp.is-on { background: #6d4aa0; border-color: #6d4aa0; }
body.ui-dark .ed-btn.lang-java.is-on { background: #8a4f23; border-color: #8a4f23; }
body.ui-dark .ed-btn.is-danger { color: #f5a3a3; border-color: #6b3340; }
body.ui-dark .ed-btn.is-danger:hover:not(:disabled) { background: #3a1f25; }
body.ui-dark .ed-export:not(:disabled) { color: #8bb9ff; border-color: #8bb9ff; }
body.ui-dark .ed-dirty { background: #3b3218; color: #f3d58a; }
body.ui-dark .ed-message { background: #132a1f; color: #bff0d2; border-color: #245c40; }
body.ui-dark .ed-message.is-error { background: #3a1f25; color: #f5c2c2; border-color: #6b3340; }
body.ui-dark .ed-panel .is-invalid { border-color: #f04438 !important; }
body.ui-dark .ed-err { color: #f5a3a3; }
body.ui-dark .ed-note { background: #3b3218; border-color: #8a6f28; color: #f3d58a; }
body.ui-dark .ed-note.is-quiet { background: #1b2433; border-color: #2d3a51; color: #a3b2c9; }
body.ui-dark .ed-check { background: #161e2c; border-color: #3a4c6b; color: #c9d8f5; }
body.ui-dark .ed-check:has(input:checked) { background: #1d3152; border-color: #8bb9ff; color: #bcd4ff; }
body.ui-dark .ed-chip { background: #1d3152; color: #bcd4ff; }
body.ui-dark .ed-chip button:hover { background: #2a4066; }
body.ui-dark .ed-files { border-bottom-color: #2d3a51; }
body.ui-dark .ed-file { background: #1b2433; border-color: #3a4c6b; color: #a3b2c9; }
body.ui-dark .ed-file.is-active { background: #161e2c; border-color: #8bb9ff; color: #bcd4ff; }
body.ui-dark .ed-move { background: #1b2433; border-color: #3a4c6b; color: #c9d8f5; }
body.ui-dark .ed-move:hover:not(:disabled) { background: #243450; }
body.ui-dark .ed-grip { color: #71839f; }
body.ui-dark .ed-scen { background: #1a2232; border-color: #2d3a51; }
body.ui-dark .ed-scen th { color: #a3b2c9; }
body.ui-dark .ed-drawer.uv-lib { background: #161e2c; color: #e2e8f3; box-shadow: -12px 0 35px #00000080; }
body.ui-dark .ed-drawer .uv-lib-head { border-bottom-color: #2d3a51; }
body.ui-dark .ed-drawer .uv-lib-title { color: #bcd4ff; }
body.ui-dark .ed-drawer .uv-lib-close { background: #1b2433; border-color: #3a4c6b; color: #c9d8f5; }
body.ui-dark .ed-drawer .uv-lib-close:hover, body.ui-dark .ed-drawer .uv-lib-ghead:hover, body.ui-dark .ed-drawer .uv-lib-full:hover { background: #1d2a40; }
body.ui-dark .ed-drawer .uv-lib-search input { background: #0f1522; border-color: #3a4c6b; color: #e2e8f3; }
body.ui-dark .ed-drawer .uv-lib-search input:focus { background: #0f1522; border-color: #8bb9ff; }
body.ui-dark .ed-drawer .uv-lib-search svg { stroke: #8795ad; }
body.ui-dark .ed-drawer .uv-lib-group { border-color: #2d3a51; --g: #8bb9ff; }
body.ui-dark .ed-drawer .uv-lib-group[data-domain="basics"] { --g: #5fd0c4; }
body.ui-dark .ed-drawer .uv-lib-group[data-domain="ds"] { --g: #f5b96b; }
body.ui-dark .ed-drawer .uv-lib-group[data-domain="oop"] { --g: #b9a2ff; }
body.ui-dark .ed-drawer .uv-lib-gcount, body.ui-dark .ed-drawer .uv-lib-topic-title, body.ui-dark .ed-drawer .uv-lib-empty { color: #a3b2c9; }
body.ui-dark .ed-drawer .uv-lib-empty { border-color: #3a4c6b; }
body.ui-dark .ed-drawer .uv-lib-item:hover { background: #1d2a40; }
body.ui-dark .ed-drawer .uv-lib-item.is-active { background: #1d3152; border-inline-start-color: #8bb9ff; }
body.ui-dark .ed-drawer .uv-lib-full { color: #8bb9ff; border-top-color: #2d3a51; }
body.ui-dark .ed-drawer .uv-lib-item { background: transparent; color: #e6eefb; }
body.ui-dark .ed-drawer .uv-lib-ghead { background: #1b2433; }
body.ui-dark .ed-drawer .uv-lib-id { color: #c2d0e5; }
body.ui-dark .ed-drawer .uv-lib-gname { color: #e6eefb; }

/* v0.3 II-F2: publication panel (draft / published, dates, test state) */
.ed-pub .ed-pub-flags { align-items: center; }
.ed-check:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.ed-pub-tests { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1px solid #cdd8ea; background: #fff; }
.ed-pub-tests[data-state="passed"] { color: #146c43; border-color: #9fd3b6; background: #eaf7f0; }
.ed-pub-tests[data-state="failed"] { color: #b42318; border-color: #f2b8b0; background: #fdecea; }
.ed-pub-tests[data-state="untested"] { color: #7a5200; border-color: #efd28a; background: #fff7df; }

/* v0.3 II-F3: list filters and the per-row status badge */
.ed-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 16px 10px; font-size: 13px; }
.ed-filters label { display: inline-flex; align-items: center; gap: 6px; }
.ed-filters select, .ed-filters input { font: inherit; padding: 3px 6px; border: 1px solid #cdd8ea; border-radius: 6px; background: #fff; }
.ed-row-state { margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid #efd28a; background: #fff7df; color: #7a5200; }
.ed-row-state[data-state="unpublished"] { border-color: #cdd8ea; background: #eef3ff; color: #183775; }
.ed-row-state[data-state="failed"] { border-color: #f2b8b0; background: #fdecea; color: #b42318; }
body.ui-dark .ed-filters select, body.ui-dark .ed-filters input { background: #0f1522; border-color: #3a4c6b; color: #e2e8f3; }

/* v0.3 II-F4: per-language test results */
.ed-test-results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.ed-test-results li { display: inline-flex; gap: 6px; align-items: baseline; }
.ed-test-results li[data-state="passed"] b { color: #146c43; }
.ed-test-results li[data-state="failed"] b { color: #b42318; }
.ed-test-results li[data-state="untested"] b { color: #7a5200; }

/* v0.3 II-F7: code scenarios */
.ed-cs { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.ed-cs-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ed-cs-lang { margin-top: 10px; }
.ed-cs-lang textarea { width: 100%; box-sizing: border-box; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.ed-cs-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; }
.ed-cs-check { padding: 0 8px; border-radius: 999px; border: 1px solid #f2b8b0; background: #fdecea; color: #b42318; }
.ed-cs-check[data-state="ok"] { border-color: #9fd3b6; background: #eaf7f0; color: #146c43; }
body.ui-dark .ed-cs { background: #121a2a; border-color: #2a3a57; }

/* 2026-10-28: one export menu (examples.json / examples-db.js) */
.ed-export-wrap { position: relative; display: inline-flex; }
.ed-caret { margin-inline-start: 6px; font-size: 11px; }
.ed-export-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; display: flex; flex-direction: column; min-width: 300px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px #10264a26; }
.ed-export-menu[hidden] { display: none; }
.ed-export-menu button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; }
.ed-export-menu button:hover, .ed-export-menu button:focus-visible { background: var(--soft); color: var(--navy); outline: none; }
.ed-export-menu code { color: var(--muted); font-size: 12px; }

/* 2026-10-28: collapsible sections of the form (several open at once) */
.ed-panel h2 .ed-acc-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ed-acc-arrow::before { content: "▾"; display: inline-block; width: 14px; color: var(--muted); font-size: 14px; transition: transform .15s; }
.ed-panel.is-closed .ed-acc-arrow::before { transform: rotate(90deg); }
.ed-panel.is-closed { padding-top: 10px; padding-bottom: 10px; margin-bottom: 12px; }
.ed-panel.is-closed > h2 { margin-bottom: 0; }
.ed-acc-err { margin-inline-start: auto; padding: 2px 9px; border-radius: 999px; background: #fde4e1; color: #9b1c1c; font-size: 12px; font-weight: 700; }
.ed-acc-err[hidden] { display: none; }
.ed-panel.has-error { border-right-color: #d92d20; }
.ed-view-hint { color: var(--muted); font-size: 11.5px; font-weight: 400; }
