.graph-data-explorer-card {
    box-sizing: border-box;
    min-width: 22rem;
    min-height: 31rem;
    border-color: rgba(79, 70, 229, .25);
    background: #f8fafc;
    color: #0f172a;
}

.graph-data-explorer-widget,
.gde-shell {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.graph-data-explorer-widget {
    container-type: size;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.graph-data-explorer-widget *,
.graph-data-explorer-widget *::before,
.graph-data-explorer-widget *::after {
    box-sizing: border-box;
}

.graph-data-explorer-card.is-minimized .graph-data-explorer-widget,
.graph-data-explorer-card.is-minimized .js-widget-resize-handle,
.graph-data-explorer-card.is-minimized [class*="graph-data-drag-edge"] {
    display: none !important;
}

.graph-data-explorer-card.is-minimized .js-minimized-label {
    color: #0f172a !important;
}

.gde-shell {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    overflow: hidden;
    padding: .85rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, #eef2ff, #fff 48%, #ecfeff);
}

.gde-header,
.gde-header-actions,
.gde-mode-tabs,
.gde-row-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.gde-header {
    justify-content: space-between;
}

.gde-kicker {
    margin: 0 0 .12rem;
    color: #4f46e5;
    font-size: .65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.gde-header h2,
.gde-chart-title {
    margin: 0;
    color: #0f172a;
    font-weight: 950;
}

.gde-header h2 {
    font-size: 1.4rem;
    line-height: 1;
}

.gde-mode-tabs {
    flex-wrap: wrap;
}

.gde-mode-tabs button,
.gde-button,
.gde-icon-button {
    min-height: 2.45rem;
    border: 1px solid #cbd5e1;
    border-radius: .55rem;
    background: #fff;
    padding: .5rem .7rem;
    color: #334155;
    font-size: .75rem;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.gde-mode-tabs button.is-active,
.gde-button {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.gde-button.secondary {
    border-color: #cbd5e1;
    background: #fff;
    color: #334155;
}

.gde-workspace {
    display: grid;
    grid-template-columns: minmax(15rem, .82fr) minmax(20rem, 1.4fr);
    gap: .7rem;
    min-height: 0;
    flex: 1;
}

.gde-panel {
    min-height: 0;
    overflow: auto;
    border: 1px solid #dbeafe;
    border-radius: .8rem;
    background: rgba(255,255,255,.92);
    padding: .8rem;
}

.gde-data-panel {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.gde-field {
    display: grid;
    gap: .22rem;
    color: #475569;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.gde-field input,
.gde-field select,
.gde-row input {
    width: 100%;
    min-width: 0;
    min-height: 2.35rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    background: #fff;
    padding: .45rem .6rem;
    color: #0f172a;
    font-size: .82rem;
    font-weight: 800;
}

.gde-data-editor {
    display: grid;
    gap: .42rem;
}

.gde-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.5rem 2.5rem;
    gap: .4rem;
    align-items: center;
}

.gde-icon-button {
    width: 2.5rem;
    padding: 0;
    color: #b91c1c;
}

.gde-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}

.gde-option {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.45rem;
    border-radius: .55rem;
    background: #f1f5f9;
    padding: .45rem .6rem;
    color: #334155;
    font-size: .75rem;
    font-weight: 850;
}

.gde-visual-panel {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.gde-chart-title {
    flex: 0 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.gde-chart {
    display: grid;
    min-height: 0;
    flex: 1;
}

.gde-bar-chart {
    display: grid;
    gap: .65rem;
    align-items: end;
    min-height: 18rem;
    border-left: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    padding: 1rem .7rem 0;
    background: repeating-linear-gradient(0deg, transparent 0 39px, #e2e8f0 40px);
}

.gde-bar-item {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .35rem;
    height: 100%;
    min-width: 0;
}

.gde-bar-track {
    display: flex;
    align-items: end;
    justify-content: center;
    min-height: 0;
}

.gde-bar {
    position: relative;
    width: min(76%, 5rem);
    min-height: .3rem;
    border-radius: .4rem .4rem 0 0;
    background: var(--bar-color);
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.12);
}

.gde-value {
    position: absolute;
    top: -.15rem;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: .78rem;
    font-weight: 950;
}

.gde-axis-label {
    overflow: hidden;
    color: #334155;
    font-size: .72rem;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
}

.gde-tally-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.gde-tally-table th,
.gde-tally-table td {
    border: 1px solid #cbd5e1;
    padding: .65rem;
    text-align: left;
}

.gde-tally-table th {
    background: #eef2ff;
    font-weight: 950;
}

.gde-tallies {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: .08rem;
}

.gde-picture-chart {
    display: grid;
    gap: .7rem;
    align-content: center;
}

.gde-picture-row {
    display: grid;
    grid-template-columns: minmax(5rem, 8rem) 1fr;
    gap: .6rem;
    align-items: center;
}

.gde-picture-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    min-height: 2.2rem;
    align-items: center;
}

.gde-picture-symbol {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    line-height: 1;
}

.gde-picture-symbol-partial {
    position: relative;
    justify-content: flex-start;
    overflow: hidden;
    min-width: .18rem;
}

.gde-picture-symbol-partial > span {
    display: inline-flex;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
}

.gde-picture-key {
    border-radius: .6rem;
    background: #fef3c7;
    padding: .55rem;
    color: #92400e;
    font-size: .78rem;
    font-weight: 900;
    text-align: center;
}

.gde-line-svg {
    width: 100%;
    height: 100%;
    min-height: 19rem;
    overflow: visible;
}

.gde-stats-layout {
    display: grid;
    gap: .8rem;
    align-content: center;
}

.gde-number-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
}

.gde-number-chip {
    display: grid;
    place-items: center;
    min-width: 3rem;
    min-height: 3rem;
    border-radius: .55rem;
    background: #e0e7ff;
    color: #312e81;
    font-weight: 950;
}

.gde-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

.gde-stat {
    border: 1px solid #c7d2fe;
    border-radius: .7rem;
    background: #eef2ff;
    padding: .75rem;
    text-align: center;
}

.gde-stat span {
    display: block;
    color: #6366f1;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.gde-stat strong {
    display: block;
    margin-top: .2rem;
    font-size: 1.45rem;
}

.gde-prompt {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem;
    border: 1px solid #f59e0b;
    border-radius: .7rem;
    background: #fffbeb;
    padding: .65rem .75rem;
}

.gde-prompt[hidden] {
    display: none;
}

.gde-prompt-label,
.gde-prompt-text {
    margin: 0;
}

.gde-prompt-label {
    color: #b45309;
    font-size: .65rem;
    font-weight: 950;
    text-transform: uppercase;
}

.gde-prompt-text {
    margin-top: .15rem;
    color: #78350f;
    font-size: .82rem;
    font-weight: 850;
}

.gde-prompt-close {
    border: 0;
    background: transparent;
    color: #92400e;
    font-weight: 950;
    cursor: pointer;
}

.graph-data-drag-edge-top,
.graph-data-drag-edge-bottom,
.graph-data-drag-edge-left,
.graph-data-drag-edge-right {
    position: absolute;
    z-index: 24;
    border: 0;
    background: transparent;
    touch-action: none;
}

.graph-data-drag-edge-top,
.graph-data-drag-edge-bottom { left: 1rem; right: 1rem; height: 1.1rem; }
.graph-data-drag-edge-top { top: 0; }
.graph-data-drag-edge-bottom { bottom: 0; }
.graph-data-drag-edge-left,
.graph-data-drag-edge-right { top: 1rem; bottom: 1rem; width: 1.1rem; }
.graph-data-drag-edge-left { left: 0; }
.graph-data-drag-edge-right { right: 0; }

@container (max-width: 760px) {
    .gde-shell {
        overflow-x: hidden;
        overflow-y: auto;
    }
    .gde-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .gde-header-actions {
        width: 100%;
    }
    .gde-header-actions .gde-button {
        flex: 1;
    }
    .gde-workspace {
        grid-template-columns: 1fr;
        flex: none;
        overflow: visible;
    }
    .gde-panel {
        overflow: visible;
    }
    .gde-visual-panel {
        min-height: 24rem;
    }
    .gde-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .graph-data-explorer-card {
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        min-width: 0;
    }
    .gde-mode-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .gde-mode-tabs button {
        width: 100%;
        min-width: 0;
    }
    .gde-mode-tabs button:last-child {
        grid-column: 1 / -1;
    }
}
