@import url("client-components.css");
@import url("editors.css");

.java-function-based-editor {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 218px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "header header" "navigation workspace";
    gap: 12px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    padding: 0 14px 14px;
}
.java-function-based-editor *,
.java-function-based-editor *::before,
.java-function-based-editor *::after { box-sizing: border-box; }
.java-function-based-editor :is(h2, h3, p, figure) { margin: 0; }
.eva-editor__content:has(> .java-function-based-editor) { overflow: hidden; }

.eva-editor__content > .java-function-based-editor.editor-appearance {
    min-height: 0;
    padding: 0 12px 12px;
    border: 0;
    border-radius: 0;
    background: var(--editor-shell);
    box-shadow: none;
}
.eva-editor__content > .java-function-based-editor > .java-function-editor__topbar { padding-top: 16px; }

.java-function-editor__topbar {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    min-width: 0;
    padding: 24px 12px 12px;
}
.java-function-editor__topbar > div { min-width: 0; }
.java-function-editor__title { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -0.7px; }
.fullscreen-content-container > .java-function-based-editor > .java-function-editor__topbar { padding-inline-end: 5rem; }
.java-function-editor__subtitle,
.java-function-editor__section-hint { margin-top: 4px !important; color: var(--editor-muted); font-size: 13px; }
.java-function-editor__topbar-actions,
.java-function-editor__view-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    padding: 5px;
    border: 1px solid var(--editor-border);
    border-radius: 28px;
    background: linear-gradient(135deg, var(--editor-glass-lens), transparent 90%), var(--editor-chrome-surface);
    box-shadow: inset 0 1px var(--editor-glass-shine), 0 7px 20px -14px var(--editor-shadow);
}
.java-function-editor__sync { padding-inline: 7px; color: var(--editor-muted); font-size: 12px; overflow-wrap: anywhere; }
.java-function-editor__diagram-section,
.java-function-editor__workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.java-function-editor__diagram-section { grid-area: navigation; gap: 12px; padding: 6px 2px; overflow: hidden; }
.java-function-editor__workspace {
    grid-area: workspace;
    overflow: hidden;
    border: 1px solid var(--editor-border);
    border-radius: 15px;
    background: var(--editor-code-surface);
    box-shadow: 0 9px 25px -18px var(--editor-shadow);
}
.java-function-editor__section-heading,
.java-function-editor__workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.java-function-editor__workspace-heading { padding: 12px 14px; border-bottom: 1px solid var(--editor-border); background: var(--editor-code-surface); }
.java-function-editor__section-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.java-function-editor__section-heading > div,
.java-function-editor__workspace-heading > div { min-width: 0; }
.java-function-editor__class-row {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    scrollbar-color: var(--editor-scrollbar) transparent;
    scrollbar-width: thin;
}
.java-function-editor__class-card { flex: 0 0 auto; min-width: 0; padding: 10px 4px; }
.java-function-editor__class-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--editor-border); }
.java-function-editor__class-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.java-function-editor__function-list { display: flex; flex-direction: column; gap: 4px; padding-top: 7px; }
.java-function-editor__empty-class { color: var(--editor-muted); }
.java-function-based-editor.editor-appearance :is(.java-function-editor__button, .java-function-editor__function) {
    min-height: 38px;
    min-width: 44px;
    padding: 8px 12px;
    border: 1px solid var(--editor-border);
    border-radius: 22px;
    background: var(--editor-chrome-surface);
    color: var(--editor-ink);
    cursor: pointer;
    font: inherit;
    line-height: 1.4;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.java-function-editor__button { display: inline-flex; align-items: center; justify-content: center; overflow-wrap: anywhere; }
.java-function-based-editor.editor-appearance .java-function-editor__button--small { padding-inline: 10px; font-size: 12px; }
.java-function-based-editor.editor-appearance .java-function-editor__function {
    width: 100%;
    border-color: transparent;
    border-radius: 11px;
    background: transparent;
    font-family: Consolas, "JetBrains Mono", monospace;
    text-align: left;
    overflow-wrap: anywhere;
}
.java-function-based-editor.editor-appearance .java-function-editor__button--primary {
    border-color: var(--editor-button-primary);
    background: var(--editor-button-primary);
    box-shadow: inset 0 1px var(--editor-glass-shine), 0 5px 12px -8px var(--editor-shadow);
    color: var(--editor-on-primary);
}
.java-function-based-editor.editor-appearance .java-function-editor__function--selected {
    border-color: var(--editor-border-strong);
    background: linear-gradient(135deg, var(--editor-glass-lens), transparent 90%), var(--editor-selected);
    box-shadow: inset 0 1px var(--editor-glass-shine), 0 4px 14px -9px var(--editor-shadow);
    color: var(--editor-accent);
}
.java-function-based-editor.editor-appearance :is(.java-function-editor__button, .java-function-editor__function):hover:not(:disabled) { border-color: var(--editor-border-strong); background: var(--editor-hover); color: var(--editor-ink); }
.java-function-based-editor.editor-appearance .java-function-editor__button--primary:hover:not(:disabled) { border-color: var(--editor-focus); background: var(--editor-button-primary); color: var(--editor-on-primary); }
.java-function-based-editor.editor-appearance :is(.java-function-editor__button, .java-function-editor__function):focus { border-color: var(--editor-focus); }
.java-function-based-editor :is(button, input, textarea):focus-visible { outline: 2px solid var(--editor-focus); outline-offset: 2px; }
.java-function-editor__button:disabled,
.java-function-editor__function:disabled { opacity: 0.55; cursor: not-allowed; }
.java-function-editor__function-name,
.java-function-editor__function-signature { display: block; }
.java-function-editor__function-name { font-size: 13px; }
.java-function-editor__function-signature { margin-top: 3px; color: var(--editor-muted); font-size: 11px; }
.java-function-editor__view-toggle { gap: 3px; padding: 3px; border-radius: 23px; box-shadow: inset 0 1px var(--editor-glass-shine); }
.java-function-based-editor .java-function-editor__view-toggle .java-function-editor__button { padding: 7px 11px; border-color: transparent; background: transparent; color: var(--editor-muted); font-size: 12px; }
.java-function-based-editor .java-function-editor__view-toggle .java-function-editor__button--primary { border-color: var(--editor-border); background: var(--editor-selected); box-shadow: none; color: var(--editor-accent); }
.java-function-based-editor .java-function-editor__view-toggle .java-function-editor__button--primary:hover:not(:disabled) { background: var(--editor-selected); color: var(--editor-accent); }
.java-function-editor__compact-navigation { display: none; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; margin-top: 8px; color: var(--editor-muted); font-size: 12px; }
.java-function-editor__compact-navigation select { min-width: 0; min-height: 38px; max-width: 100%; padding: 7px 10px; border: 1px solid var(--editor-border); border-radius: 9px; background: var(--editor-chrome-surface); color: var(--editor-ink); font: inherit; }
.java-function-editor__compact-navigation select:focus-visible { outline: 2px solid var(--editor-focus); outline-offset: 2px; }
.java-function-based-editor--structure-collapsed .java-function-editor__compact-navigation { display: flex; }
.java-function-editor__editor-panel,
.java-function-editor__method,
.java-function-editor__source,
.java-function-based-editor .code-mirror-editor { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: var(--editor-code-surface); }
.java-function-based-editor .code-mirror-editor { overflow: hidden; }
.java-function-editor__editor-panel > [role="alert"] { padding: 16px; color: var(--editor-error); }
.java-function-based-editor .code-mirror-editor > .cm-editor { flex: 1; min-width: 0; min-height: 0; height: auto; }
.java-function-based-editor .code-mirror-editor:focus-within { outline: 2px solid var(--editor-focus); outline-offset: -2px; }
.java-function-based-editor .cm-scroller { min-height: 0; overflow: auto; font: 14px/1.65 Consolas, "JetBrains Mono", monospace; }
.java-function-based-editor .cm-content { padding-block: 12px; }
.java-function-based-editor .code-mirror-editor__fallback { flex: 1; width: 100%; min-height: 0; padding: 16px; border: 0; font: 14px/1.65 Consolas, "JetBrains Mono", monospace; resize: none; }
.java-function-editor__editor-panel--hidden,
.java-function-editor__editor-placeholder--hidden,
.java-function-editor__draft-warning--hidden { display: none !important; }
.java-function-editor__draft-warning { padding: 12px 16px; border-top: 1px solid var(--editor-warning-border); background: var(--editor-warning-surface); color: var(--editor-warning-ink); }
.java-function-editor__empty-diagram,
.java-function-editor__editor-placeholder { padding: 16px; border: 1px dashed var(--editor-border-strong); border-radius: 11px; background: var(--editor-code-surface); }
.java-function-editor__editor-placeholder { flex: 1; margin: 16px; }
.java-function-editor__empty-diagram span,
.java-function-editor__editor-placeholder span { display: block; margin-top: 6px; color: var(--editor-muted); }
.java-function-editor__reference {
    grid-area: reference;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--editor-border);
    border-radius: 19px;
    background: linear-gradient(135deg, var(--editor-glass-lens), transparent 80%), var(--editor-chrome-surface);
    box-shadow: inset 0 1px var(--editor-glass-shine), 0 14px 35px -25px var(--editor-shadow);
    overflow-wrap: anywhere;
}
.java-function-editor__reference :is(h2, h3) { font-size: 16px; }
.java-function-editor__reference p { color: var(--editor-muted); }
.java-function-editor__reference .turtle-execution__figure { background: var(--editor-reference-figure-surface); }
.java-function-editor__reference .turtle-execution__figure figcaption { color: var(--editor-reference-figure-ink); }
.java-function-editor__reference :is(img, svg, canvas) { display: block; max-width: 100%; height: auto; }
.java-function-editor__dialog::backdrop { background: var(--editor-dialog-backdrop); }
.java-function-editor__dialog {
    flex-direction: column;
    gap: 16px;
    width: min(480px, calc(100% - 24px));
    max-height: min(90dvh, 700px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--editor-border);
    border-radius: 18px;
    background: var(--editor-code-surface);
    box-shadow: 0 24px 70px -28px var(--editor-shadow);
    color: var(--editor-ink);
}
.java-function-editor__dialog[open] { display: flex; }
.java-function-editor__dialog-title { font-size: 20px; font-weight: 500; }
.java-function-editor__dialog-fields,
.java-function-editor__field { display: flex; flex-direction: column; gap: 8px; }
.java-function-editor__dialog-fields { gap: 14px; }
.java-function-based-editor .java-function-editor__field input { width: 100%; min-height: 38px; padding: 9px 12px; border: 1px solid var(--editor-border); border-radius: 9px; background: var(--editor-chrome-surface); color: var(--editor-ink); font: inherit; }
.java-function-based-editor .java-function-editor__field input:focus { background: var(--editor-chrome-surface); border-color: var(--editor-focus); }
.java-function-editor__dialog-error { min-height: 20px; color: var(--editor-error); }
.java-function-editor__dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.java-function-editor__method-option { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.java-function-based-editor .java-function-editor__method-option input { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--editor-accent, var(--color-focus)); }
.java-function-based-editor--with-reference { grid-template-columns: 218px minmax(0, 1fr) minmax(280px, 320px); grid-template-areas: "header header header" "navigation workspace reference"; }
.java-function-based-editor--structure-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "header" "workspace"; }
.java-function-based-editor--structure-collapsed .java-function-editor__diagram-section { display: none; }
.java-function-based-editor--with-reference.java-function-based-editor--structure-collapsed { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); grid-template-areas: "header header" "workspace reference"; }

@media (max-width: 1024px) {
    .java-function-based-editor--with-reference { grid-template-columns: 202px minmax(0, 1fr) 280px; }
}
@media (max-width: 760px) {
    .java-function-based-editor,
    .java-function-based-editor--with-reference,
    .java-function-based-editor--with-reference.java-function-based-editor--structure-collapsed { grid-template-columns: minmax(0, 1fr); }
    .java-function-based-editor { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "header" "workspace"; }
    .java-function-based-editor--with-reference { grid-template-rows: auto minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "header" "workspace" "reference"; }
    .java-function-editor__subtitle,
    .java-function-editor__diagram-section .java-function-editor__section-hint { display: none; }
    .java-function-editor__diagram-section {
        position: absolute;
        grid-area: auto;
        inset: 64px 8px auto;
        z-index: 2;
        max-height: calc(100% - 76px);
        min-height: 0;
        padding: 12px;
        border: 1px solid var(--editor-border);
        border-radius: 13px;
        background: var(--editor-code-surface);
        box-shadow: 0 10px 24px -8px var(--editor-shadow);
    }
    .java-function-editor__compact-navigation { display: flex; }
    .java-function-based-editor--structure-collapsed { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "header" "workspace"; }
    .java-function-based-editor--with-reference.java-function-based-editor--structure-collapsed { grid-template-rows: auto minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "header" "workspace" "reference"; }
    .java-function-editor__topbar { gap: 6px; padding: 8px 0; }
    .eva-editor__content > .java-function-based-editor > .java-function-editor__topbar { padding-top: 8px; }
    .java-function-editor__topbar > div:first-child { display: none; }
    .java-function-editor__title,
    .java-function-editor__workspace-heading .java-function-editor__section-hint,
    .java-function-editor__sync { display: none; }
    .java-function-editor__workspace-heading { padding: 8px; gap: 6px; }
    .java-function-editor__workspace-heading > div:first-child { display: none; }
    .java-function-editor__compact-navigation { margin: 0; width: 100%; flex-wrap: nowrap; }
    .java-function-editor__compact-navigation select { flex: 1; width: 0; }
    .java-function-editor__view-toggle { padding: 2px; }
}
@media (max-width: 520px) {
    .java-function-based-editor { gap: 10px; padding: 0 8px 8px; }
    .eva-editor__content > .java-function-based-editor.editor-appearance { padding: 0 8px 8px; }
    .java-function-editor__title { font-size: 21px; }
    .java-function-editor__workspace { border-radius: 13px; }
    .java-function-editor__reference { padding: 12px; border-radius: 16px; }
}
@media (max-width: 390px) {
    .java-function-editor__workspace-heading { padding: 6px; }
    .java-function-editor__title,
    .java-function-editor__section-hint { overflow-wrap: anywhere; }
    .java-function-editor__view-toggle { width: 100%; }
    .java-function-based-editor .java-function-editor__view-toggle .java-function-editor__button { flex: 1; min-width: 0; padding-inline: 8px; }
    .java-function-editor__topbar-actions { width: 100%; border-radius: 16px; }
}
@media (max-width: 320px) {
    .java-function-editor__dialog { padding: 14px; }
    .java-function-editor__topbar-actions { align-items: stretch; }
    .java-function-editor__topbar-actions > button { flex: 1; }
}
@media (max-height: 600px) and (min-width: 761px) {
    .java-function-editor__topbar { padding-block: 8px; gap: 6px; }
    .java-function-editor__topbar > div:first-child,
    .java-function-editor__sync,
    .java-function-editor__workspace-heading > div:first-child { display: none; }
    .java-function-editor__workspace-heading { padding: 6px; gap: 6px; }
    .java-function-editor__compact-navigation { margin: 0; }
}
@media (max-height: 600px) and (max-width: 760px) {
    .java-function-based-editor .java-function-editor__view-toggle { width: auto; flex: 0 0 auto; }
    .java-function-based-editor .java-function-editor__view-toggle .java-function-editor__button {
        min-width: 44px;
        font-size: 0;
    }
    .java-function-editor__view-toggle .java-function-editor__button::before { font: 14px/1 monospace; }
    .java-function-editor__view-toggle .java-function-editor__button:first-child::before { content: "ƒ"; }
    .java-function-editor__view-toggle .java-function-editor__button:last-child::before { content: "{ }"; }
    .java-function-editor__compact-navigation { flex: 1; width: auto; }
    .java-function-editor__compact-navigation > span { display: none; }
}
@media (pointer: coarse) {
    .java-function-based-editor.editor-appearance :is(.java-function-editor__button, .java-function-editor__function),
    .java-function-based-editor .java-function-editor__field input { min-height: 44px; }
    .java-function-editor__compact-navigation select { min-height: 44px; }
    .java-function-based-editor .cm-scroller,
    .java-function-based-editor .code-mirror-editor__fallback,
    .java-function-based-editor .java-function-editor__field input { font-size: 16px; }
}
