.mdl-program-card {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    pointer-events: none;
}

.mdl-program-card-code {
    flex: 1;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    font: 12px/17px Menlo, Consolas, "Courier New", monospace;
    color: #1f2430;
    white-space: pre;
}

.mdl-program-card-code .mdl-code-line {
    display: block;
    min-height: 17px;
}

.mdl-program-card-error,
.mdl-program-editor-error {
    flex: none;
    font: 11px/15px Inter, sans-serif;
    color: #b42318;
    max-height: 45px;
    overflow: hidden;
}

.mdl-program-card-error:empty,
.mdl-program-editor-error:empty {
    display: none;
}

.mdl-program-editor-error {
    padding: 4px 6px 0;
}

.mdl-code-keyword {
    color: #7c3aed;
    font-weight: 600;
}

.mdl-code-builtin {
    color: #0e7490;
}

.mdl-code-number {
    color: #c2410c;
}

.mdl-code-name {
    color: #1e3a8a;
}

.mdl-code-comment {
    color: #8a8f98;
    font-style: italic;
}

.mdl-code-line.mdl-code-error-line,
.mdl-code-gutter-line.mdl-code-error-line {
    background: rgba(220, 38, 38, 0.12);
}

.mdl-program-editor {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
    pointer-events: auto;
}

.mdl-program-editor-blocks,
.mdl-program-editor-text {
    border-radius: 4px;
    background: #fbfbfd;
    overflow: hidden;
}

.mdl-program-editor-blocks,
.mdl-program-editor-text {
    flex: 1;
    min-height: 0;
    display: none;
}

.mdl-program-editor-showing-blocks .mdl-program-editor-blocks {
    display: flex;
}

.mdl-program-editor-showing-python .mdl-program-editor-text {
    display: flex;
}

.mdl-program-editor .mdl-code-editor {
    border: none;
    border-radius: 0;
}

.mdl-program-card-code.mdl-program-card-blocks {
    white-space: normal;
    font: inherit;
}

.pb-workspace {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: auto;
    outline: none;
    user-select: none;
}

.pb-insertion {
    position: absolute;
    display: none;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
    background: #2563eb;
    pointer-events: none;
}

.pb-program {
    display: inline-flex;
    flex-direction: column;
    min-width: 100%;
    box-sizing: border-box;
    padding: 8px 8px 24px;
    font: 600 11px/14px Inter, sans-serif;
    color: #ffffff;
    --pb-surface: #fbfbfd;
}

.mdl-program-card-blocks .pb-program {
    padding: 0;
}

.pb-program > .pb-list {
    min-height: 40px;
}

.pb-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.pb-block {
    background: var(--pb);
    box-sizing: border-box;
}

.pb-stmt {
    border-radius: 6px;
    box-shadow: inset 0 -2px rgba(0, 0, 0, 0.18);
    cursor: grab;
}

.pb-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 3px 8px;
    box-sizing: border-box;
    white-space: nowrap;
}

.pb-c > .pb-list {
    min-width: 72px;
    min-height: 20px;
    margin-left: 14px;
    padding: 2px 0;
    border-radius: 4px 0 0 4px;
    background: var(--pb-surface);
}

.pb-foot {
    height: 8px;
}

.pb-expr {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 2px 6px;
    border-radius: 11px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    cursor: grab;
}

.pb-slot {
    display: inline-block;
    flex: none;
    width: 26px;
    height: 18px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.pb-field {
    min-width: 2ch;
    max-width: 40ch;
    height: 18px;
    padding: 0 6px;
    box-sizing: content-box;
    border: none;
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: #1f2430;
    font: 500 11px/18px Menlo, Consolas, "Courier New", monospace;
    cursor: text;
}

input.pb-field {
    font-family: Menlo, Consolas, "Courier New", monospace !important;
    font-size: 11px !important;
}

span.pb-field {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: inherit;
}

.pb-field.pb-invalid {
    box-shadow: 0 0 0 2px #dc2626;
}

.pb-field-text {
    color: #4b5563;
    font-style: italic;
}

.pb-choice {
    padding: 1px 6px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.2);
    font: 600 11px/16px Menlo, Consolas, "Courier New", monospace;
}

.pb-workspace .pb-choice {
    cursor: pointer;
}

.pb-workspace .pb-choice::after {
    content: " ▾";
    font-size: 9px;
    opacity: 0.8;
}

.pb-note {
    font-weight: 500;
    font-style: italic;
    opacity: 0.85;
}

.pb-selected {
    outline: 2px solid #fbbf24;
    outline-offset: 1px;
}

.pb-drop-target {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.pb-ghost {
    position: fixed;
    z-index: 100000;
    transform-origin: 0 0;
    pointer-events: none;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    font: 600 11px/14px Inter, sans-serif;
    color: #ffffff;
}

.pb-ghost.pb-ghost-leaving {
    opacity: 0.4;
}

.pb-menu {
    position: fixed;
    z-index: 100001;
    min-width: 120px;
    padding: 4px 0;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    font-family: "Atma", "Inter", sans-serif;
    font-size: 15px;
    line-height: 20px;
    color: #1f2430;
}

.pb-menu-item {
    padding: 5px 14px;
    white-space: nowrap;
    cursor: pointer;
}

.pb-menu-item:hover {
    background: #eef0f4;
}

.pb-menu-item.pb-menu-selected {
    font-weight: 600;
}

.mdl-program-palette-block .pb-stmt,
.mdl-program-palette-block .pb-expr {
    cursor: pointer;
}

.mdl-program-palette-block {
    font: 600 11px/14px Inter, sans-serif;
    color: #ffffff;
    --pb-surface: #fbfbfd;
}

.mdl-program-palette {
    display: flex;
    width: 520px;
    height: 340px;
}

.mdl-program-palette-categories {
    flex: none;
    width: 150px;
    padding: 6px 0;
    border-right: 1px solid #e3e5ea;
    overflow-y: auto;
}

.mdl-program-palette-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-family: "Atma", "Inter", sans-serif;
    font-size: 15px;
    line-height: 20px;
    cursor: pointer;
}

.mdl-program-palette-category:hover,
.mdl-program-palette-category.mdl-program-palette-selected {
    background: #eef0f4;
}

.mdl-program-palette-swatch {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.mdl-program-palette-blocks {
    flex: 1;
    min-width: 0;
    padding: 8px;
    overflow: auto;
    background: #fbfbfd;
    font: 12px/16px Inter, sans-serif;
    color: #4b5563;
}

.mdl-program-palette-block {
    width: max-content;
    max-width: 100%;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
}

.mdl-program-palette-block:hover {
    background: rgba(37, 99, 235, 0.1);
}

.mdl-code-editor {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    border: 1px solid #e3e5ea;
    border-radius: 6px;
    overflow: hidden;
    background: #fbfbfd;
    font: 13px/20px Menlo, Consolas, "Courier New", monospace;
}

.mdl-code-gutter {
    flex: none;
    width: 44px;
    padding: 10px 8px 10px 0;
    box-sizing: border-box;
    overflow: hidden;
    text-align: right;
    color: #9aa1ad;
    background: #f2f3f6;
    user-select: none;
}

.mdl-code-gutter-line {
    height: 20px;
}

.mdl-code-surface {
    position: relative;
    flex: 1;
    min-width: 0;
}

.mdl-code-highlight,
.mdl-code-input {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    border: none;
    font: inherit;
    line-height: 20px;
    white-space: pre;
    tab-size: 4;
    overflow: auto;
}

.mdl-code-highlight {
    overflow: hidden;
    pointer-events: none;
    color: #1f2430;
}

.mdl-code-highlight .mdl-code-line {
    display: block;
    min-height: 20px;
}

.mdl-code-input {
    color: transparent;
    background: transparent;
    caret-color: #111827;
    resize: none;
    outline: none;
}

.mdl-code-input::selection {
    background: rgba(37, 99, 235, 0.25);
}
