/* Global typography, colors, controls, and blocking-overlay styles. */

@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter/Inter-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter/Inter-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter/Inter-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Roboto Mono for code/parsing output */
@font-face {
    font-family: 'Roboto Mono';
    src: url('../assets/fonts/Roboto_Mono/RobotoMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
    font-size: calc(15px * var(--font-scale, 1));
}

/* Enforce Inter everywhere in the app (UI, forms, content) */
/* Allow explicitly-set fonts (e.g., Roboto Mono) to override these global defaults */
body, input, select, textarea, button {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, 'Noto Sans', 'Liberation Sans', sans-serif !important;
}

/* Global variables */
:root {
    --font-scale: 1;
    --app-background: #cfe6d9;
    --toolbar-height: 40px;
    --tree-width: 250px;
    --tree-right-padding: 8px;
    --splitter-width: 2px; /* unified splitter thickness */
    --tree-min-width: 200px;
    --meta-min-width: 300px;
    --panel-bg: #eeeeee;
    --border-color: #898989;
    --splitter-color: #b5b5b5;
    --ds-value-column-width: 45px;
    --active-row-color: #89bba1;
    --hover-row-color: #cfe6d9; /* afd5bf at about 60% */
    --active-color: #7ab094; /* 7bb798 */
    --hover-color: #afd5bf; /* afd5bf at about 60%, or 7bb798 at about 40% */
    --dm-select-arrow-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%23444' d='M0 0h8L4 6z'/%3E%3C/svg%3E");
    --dm-select-arrow-size: 8px 6px;
    --dm-select-arrow-position: right 7px center;
    --dm-select-arrow-padding-right: 22px;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

body.dragging, body.dragging * {
    cursor: col-resize !important;
    user-select: none;
}

.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.stop-scrolling {
    height: 100%;
    overflow: hidden;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ---- Form controls used in the metadata area ---- */
.form-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 12px; /* row gap, column gap */
    align-items: start;
}

.form-label {
    font-weight: 500;
    padding-top: 6px; /* vertically align with inputs */
    font-size: 0.9rem;
    color: #333;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #c9c9c9);
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-control:focus {
    outline: none;
    border-color: var(--active-color, #7ab094);
    box-shadow: 0 0 0 3px var(--active-color, #7ab094);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Small subtitle used for blocks like "Attributes" */
.meta-subtitle {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 8px 0 6px 0;
}


.loader {
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    position: fixed;
    z-index: 1050;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cover {
    top: 0;
    display: block;
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1040;
}
/* Browser portal menu, matching the DialogCreator web shell structure. */
.web-menubar {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 10px;
    background: #f3f3f3;
    border-bottom: 1px solid #c6c6c6;
    color: #222;
    font: 13px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    user-select: none;
    position: relative;
    z-index: 30;
}

.web-menu-root {
    position: relative;
}

.web-menu-button {
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    height: 26px;
    padding: 0 10px;
    border-radius: 4px;
    font: inherit;
}

.web-menu-button:hover,
.web-menu-root.is-open .web-menu-button {
    background: #e5e5e5;
    border-color: #c4c4c4;
}

.web-menu-popup {
    display: none;
    position: absolute;
    top: 28px;
    left: 0;
    min-width: 190px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid #bdbdbd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 40;
}

.web-menu-root.is-open .web-menu-popup {
    display: block;
}

.web-menu-item {
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    background: transparent;
    color: #202020;
    text-align: left;
    border-radius: 3px;
    padding: 0 8px;
    font: inherit;
}

.web-menu-item:hover,
.web-menu-item:focus-visible {
    background: #e8f0fe;
    outline: none;
}

.web-menu-item[aria-checked="true"]::before {
    content: "✓";
    width: 14px;
    margin-right: 3px;
}

.web-menu-label {
    padding: 5px 8px 3px;
    color: #666;
    font-size: 12px;
    cursor: default;
}

.web-menu-shortcut {
    color: #666;
    font-size: 12px;
    margin-left: auto;
}

.web-menu-separator {
    height: 1px;
    margin: 4px 2px;
    background: #dddddd;
}

.portal-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.35);
}

.portal-picker-modal__panel {
    position: relative;
    width: min(1000px, calc(100vw - 56px));
    height: min(750px, calc(100vh - 56px));
    min-width: min(720px, calc(100vw - 56px));
    min-height: min(520px, calc(100vh - 56px));
    background: var(--app-background, #cfe6d9);
    border: 1px solid #7c7c7c;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
}

.portal-picker-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border: 1px solid #9f9f9f;
    border-radius: 4px;
    background: #f4f4f4;
    color: #1f1f1f;
    font-size: 20px;
    line-height: 24px;
    cursor: pointer;
}

.portal-picker-modal__close:hover,
.portal-picker-modal__close:focus-visible {
    background: #ffffff;
    outline: 2px solid rgba(38, 94, 165, 0.45);
    outline-offset: 1px;
}

.portal-picker-modal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.portal-about-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.35);
}

.portal-about-modal__panel {
    width: min(560px, calc(100vw - 56px));
    max-height: min(480px, calc(100vh - 56px));
    overflow: auto;
    background: #ffffff;
    border: 1px solid #8f8f8f;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
    padding: 22px 24px;
}

.portal-about-modal__title {
    margin: 0 0 12px;
    font-size: 20px;
}

.portal-about-modal__body {
    margin: 0 0 16px;
    line-height: 1.45;
}

.portal-about-modal__close {
    min-width: 76px;
    height: 30px;
    border: 1px solid #8f8f8f;
    border-radius: 4px;
    background: #f4f4f4;
    cursor: pointer;
}
