:root {
    color-scheme: light;
    --web-shell-window-bg: #ffffff;
    --web-shell-toolbar-bg: #f4f4f4;
    --web-shell-workspace-bg: #eceff3;
    --web-shell-border: #8d96a3;
    --web-shell-border-soft: #d7dbe2;
    --web-shell-text: #20242a;
    --web-shell-muted: #5f6874;
    --web-shell-hover: #e7ebf1;
    --web-shell-menu-active-bg: #e6f0ff;
    --web-shell-menu-active-border: #2f6fdd;
    --menu-font-size: 12px;
}

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

button,
input,
textarea {
    font: inherit;
}

.dialogcreator-web-app {
    display: grid;
    grid-template-rows: 28px minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    font: 12px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--web-shell-text);
    background: var(--web-shell-workspace-bg);
}

.web-menubar {
    position: relative;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    min-height: 0;
    padding: 3px 8px;
    border-bottom: 1px solid var(--web-shell-border);
    background: var(--web-shell-window-bg);
    box-sizing: border-box;
}

.web-menu-root {
    position: relative;
    display: flex;
    align-items: stretch;
}

.web-menu-button,
.web-menu-item {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--web-shell-text);
    cursor: default;
    text-align: left;
    white-space: nowrap;
}

.web-menu-button {
    min-width: 0;
    height: 22px;
    padding: 0 18px;
    font-size: var(--menu-font-size);
    font-weight: 400;
}

.web-menu-button:hover,
.web-menu-root.is-open > .web-menu-button {
    background: var(--web-shell-hover);
    outline: none;
}

.web-menu-popup {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    display: none;
    width: max-content;
    min-width: 190px;
    max-width: min(420px, calc(100vw - 24px));
    padding: 6px 0;
    border: 1px solid var(--web-shell-border);
    border-radius: 0;
    background: var(--web-shell-window-bg);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

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

.web-menu-separator {
    height: 1px;
    margin: 5px 0;
    background: var(--web-shell-border-soft);
}

.web-menu-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: max-content;
    min-height: 30px;
    padding: 3px 28px 3px 18px;
    box-sizing: border-box;
    font-size: var(--menu-font-size);
}

.web-menu-item:hover,
.web-menu-item:focus-visible {
    background: var(--web-shell-menu-active-bg);
    color: var(--web-shell-text);
    outline: none;
}

.web-menu-item:hover::before,
.web-menu-item:focus-visible::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 3px;
    background: var(--web-shell-menu-active-border);
}

.web-menu-shortcut {
    margin-left: 30px;
    color: var(--web-shell-muted);
}

.web-menubar-status {
    margin-left: auto;
    color: var(--web-shell-muted);
    white-space: nowrap;
}

.web-desktop {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px),
        var(--web-shell-toolbar-bg);
    background-size: 28px 28px;
}

.web-workbench-window {
    position: absolute;
    left: 18px;
    top: 18px;
    display: grid;
    grid-template-rows: 31px minmax(0, 1fr);
    width: min(1050px, calc(100% - 36px));
    height: min(680px, calc(100% - 36px));
    min-width: 720px;
    min-height: 420px;
    max-width: calc(100% - 36px);
    max-height: calc(100% - 36px);
    border: 1px solid var(--web-shell-border);
    border-radius: 6px;
    background: var(--web-shell-window-bg);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    box-sizing: border-box;
}

.web-workbench-window__titlebar {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 0;
    border-bottom: 1px solid var(--web-shell-border-soft);
    background: var(--web-shell-toolbar-bg);
    box-sizing: border-box;
    cursor: move;
    user-select: none;
}

.web-workbench-window__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
    color: var(--web-shell-text);
    font-weight: 600;
}

.web-workbench-window__frame {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: #a6a6a6;
}

.web-workbench-resize-handle {
    position: absolute;
    z-index: 8;
    background: transparent;
    touch-action: none;
}

.web-workbench-resize-handle[data-resize-direction="right"] {
    top: 31px;
    right: 0;
    width: 8px;
    bottom: 12px;
    cursor: ew-resize;
}

.web-workbench-resize-handle[data-resize-direction="bottom"] {
    left: 0;
    right: 12px;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
}

.web-workbench-resize-handle[data-resize-direction="corner"] {
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
}

.web-workbench-resize-handle[data-resize-direction="corner"]::after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 7px;
    height: 7px;
    border-right: 1px solid rgba(47, 55, 66, 0.42);
    border-bottom: 1px solid rgba(47, 55, 66, 0.42);
}

.web-info-layer {
    position: absolute;
    inset: 0;
    z-index: 1500;
    pointer-events: none;
}

.web-info-window {
    position: absolute;
    display: grid;
    grid-template-rows: 32px minmax(0, 1fr);
    min-width: 420px;
    min-height: 320px;
    max-width: calc(100% - 48px);
    max-height: calc(100% - 48px);
    border: 1px solid var(--web-shell-border);
    border-radius: 6px;
    background: var(--web-shell-window-bg);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    pointer-events: auto;
}

.web-info-window__titlebar {
    display: flex;
    align-items: center;
    min-width: 0;
    border-bottom: 1px solid var(--web-shell-border-soft);
    background: var(--web-shell-toolbar-bg);
    cursor: move;
    user-select: none;
}

.web-info-window__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
    font-weight: 600;
}

.web-info-window__close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background-color: transparent;
    background-image: url("../../assets/icons/close.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    cursor: pointer;
}

.web-info-window__close:hover {
    background-color: transparent;
    background-image: url("../../assets/icons/close.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
}

.web-info-window__frame {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: #ffffff;
}
