:root {
    --bg: #e5e5e3;
    --panel: #f6f6f4;
    --panel-2: #ebebe8;
    --text: #202124;
    --muted: #67686d;
    --accent: #303238;
    --success: #167a59;
    --success-border: #2a8f72;
    --border: #c9c9c6;
    --dark-panel: #101114;
    --dark-panel-2: #17181b;
    --dark-text: #eeeeef;
    --dark-muted: #a9abb1;
    --dark-border: #34363b;
    --code-panel: #25272b;
    --code-panel-response: #292b30;
    --code-border: #484b52;
    --code-text: #ececee;
    --pending-page-bg: #c2c2c2;
    --radius-surface: 8px;
    --radius-control: 6px;
    --radius-inset: 4px;
    --radius-small: 3px;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

html.results-pending {
    background: var(--pending-page-bg);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: var(--bg);
    color: var(--text);
    padding: 32px;
}

.page {
    width: 100%;
    max-width: 100%;
}

.grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    min-width: 0;
}

.card {
    min-width: 0;
    max-width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-surface);
    padding: 16px;
    box-shadow: 0 10px 26px rgba(35, 36, 38, 0.1);
}

label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    color: var(--muted);
}

.request-json-editor {
    --jse-theme: dark;
    --jse-theme-color: var(--panel-2);
    --jse-theme-color-highlight: #dededa;
    --jse-menu-color: var(--text);
    --jse-background-color: var(--code-panel);
    --jse-text-color: var(--code-text);
    --jse-text-color-inverse: var(--text);
    --jse-main-border: 0;
    --jse-panel-background: #dededa;
    --jse-panel-color: var(--text);
    --jse-panel-color-readonly: var(--muted);
    --jse-panel-border: 1px solid var(--border);
    --jse-panel-button-color-highlight: var(--text);
    --jse-panel-button-background-highlight: #d0d0cc;
    --jse-navigation-bar-background: #d8d8d4;
    --jse-navigation-bar-background-highlight: #cacac5;
    --jse-navigation-bar-dropdown-color: var(--text);
    --jse-key-color: #9cdcfe;
    --jse-value-color-number: #b5cea8;
    --jse-value-color-boolean: #8eb8e5;
    --jse-value-color-null: #8eb8e5;
    --jse-value-color-string: #d9a186;
    --jse-value-color-url: #d9a186;
    --jse-delimiter-color: #b8bac0;
    --jse-selection-background-color: #46484e;
    --jse-selection-background-inactive-color: #34363b;
    --jse-hover-background-color: #34363b;
    --jse-active-line-background-color: rgba(255, 255, 255, 0.06);
    --jse-input-background: #f6f6f4;
    --jse-input-color: var(--text);
    --jse-input-border: 1px solid var(--border);
    --jse-input-border-focus: 1px solid #7c7e84;
    --jse-error-color: #e85d75;
    --jse-warning-color: #d7903f;
    width: 100%;
    height: 320px;
    min-height: 180px;
    max-height: 70vh;
    border: 1px solid var(--code-border);
    border-radius: var(--radius-control);
    overflow: hidden;
}

.command-card {
    padding: 0;
    overflow: visible;
}

.command-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.command-action-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.command-json-actions {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.command-action-cluster,
.command-toolbar-end {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.command-action-cluster + .command-action-cluster {
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.command-toolbar-end {
    margin-left: auto;
}

.command-request-size {
    font-variant-numeric: tabular-nums;
}

button.command-request-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: 12px;
    white-space: nowrap;
}

button.command-request-button:hover {
    transform: none;
    border-color: var(--border);
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

.command-request-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.command-toolbar-top .command-secondary-button {
    min-height: 34px;
    padding: 7px 10px;
}

.command-toolbar-top .command-icon-button {
    justify-content: center;
    width: 34px;
    min-width: 34px;
    padding: 0;
}

.command-toolbar-top .command-secondary-button:disabled {
    background: transparent;
    color: #999a9d;
    opacity: 0.55;
}

.command-toolbar-top .command-secondary-button:disabled:hover {
    background: transparent;
}

.command-toolbar-top .command-history-actions .command-secondary-button:first-child,
.command-toolbar-top .command-fold-actions .command-secondary-button:first-child {
    border-radius: var(--radius-inset) 0 0 var(--radius-inset);
}

.command-toolbar-top .command-history-actions .command-secondary-button:last-child,
.command-toolbar-top .command-fold-actions .command-secondary-button:last-child {
    margin-left: -5px;
    border-radius: 0 var(--radius-inset) var(--radius-inset) 0;
}

.command-toolbar-top .command-history-actions .command-secondary-button + .command-secondary-button,
.command-toolbar-top .command-fold-actions .command-secondary-button + .command-secondary-button {
    border-left-color: transparent;
}

.command-toolbar-top .command-secondary-button:focus-visible {
    position: relative;
    z-index: 1;
}

.command-toolbar-top .command-responsive-label {
    white-space: nowrap;
}

.command-toolbar .example-picker {
    margin-left: auto;
}

.command-toolbar-top {
    border-bottom: 1px solid var(--border);
}

.command-toolbar-bottom {
    border-top: 1px solid var(--border);
}

button.block-expand-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

button.block-expand-button:hover {
    transform: none;
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

.block-expand-button svg,
.block-dialog-close svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

button.examples-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-color: var(--border);
    background: var(--panel-2);
    color: var(--text);
    box-shadow: none;
}

button.examples-toggle-button:hover {
    transform: none;
    background: #dededa;
}

button.examples-toggle-button[aria-expanded="true"] {
    border-color: #a9aaa7;
    background: #d9d9d5;
}

.examples-toggle-button svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.examples-chevron-icon {
    transition: transform 0.15s ease;
}

.examples-toggle-button[aria-expanded="true"] .examples-chevron-icon {
    transform: rotate(180deg);
}

button.run-button,
button.cancel-run-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

button.cancel-run-button[hidden] {
    display: none;
}

.run-button svg,
.cancel-run-button svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

button.cancel-run-button {
    border: 1px solid rgba(180, 35, 67, 0.5);
    background: transparent;
    color: #a51d3a;
    box-shadow: none;
}

button.cancel-run-button:hover {
    transform: none;
    background: rgba(180, 35, 67, 0.08);
}

button.command-secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-color: var(--border);
    background: transparent;
    color: var(--text);
    box-shadow: none;
}

button.command-secondary-button:hover {
    transform: none;
    background: rgba(32, 33, 36, 0.06);
}

.command-secondary-button svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.command-action-check-icon {
    display: none;
}

button.command-secondary-button.is-success {
    border-color: var(--success-border);
    color: var(--success);
}

button.command-secondary-button.is-success .command-action-default-icon {
    display: none;
}

button.command-secondary-button.is-success .command-action-check-icon {
    display: block;
}

button.command-secondary-button.is-error {
    border-color: rgba(180, 35, 67, 0.5);
    color: #a51d3a;
}

button.command-secondary-button.is-pending {
    border-color: #8c8d91;
    background: #e2e2df;
    color: var(--text);
}

.command-card .request-json-editor {
    display: block;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
}

.request-json-editor .jse-main {
    height: 100%;
    border: 0;
}

.request-json-editor .jse-menu {
    display: none !important;
}

.request-json-editor .cm-gutter.cm-lineNumbers,
.request-json-editor .cm-lineNumbers {
    display: none !important;
}

.request-json-editor .cm-gutters,
.request-json-editor .cm-foldGutter {
    border-right: 0 !important;
    background: var(--code-panel) !important;
}

.request-json-editor .cm-foldGutter .cm-gutterElement {
    color: #858890;
}

.request-json-editor .cm-foldGutter .cm-gutterElement:hover {
    color: var(--code-text);
}

.request-json-editor .jse-status-bar {
    font-family: inherit;
}

.example-picker {
    position: relative;
}

.example-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    width: clamp(280px, 42vw, 440px);
    max-width: calc(100vw - 40px);
    max-height: min(78vh, 760px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-surface);
    background: var(--panel);
    box-shadow: 0 16px 36px rgba(35, 36, 38, 0.18);
    transition: height 0.15s ease;
}

.example-popover[hidden] {
    display: none;
}

.example-popover:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.result-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--panel);
    font-size: 12px;
    color: var(--muted);
    box-sizing: border-box;
}

.result-bar[hidden] {
    display: none;
}

.result-summary-message {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 28px;
}

button.result-response-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

button.result-response-button:hover {
    transform: none;
    border-color: var(--border);
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

button.result-response-button[hidden] {
    display: none;
}

.result-response-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.result-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 3px rgba(168, 170, 176, 0.1);
}

.result-status[data-tone="success"] .result-status-dot {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(70, 214, 164, 0.13);
}

.result-status[data-tone="active"] .result-status-dot {
    background: #5ab0ff;
    box-shadow: 0 0 0 3px rgba(90, 176, 255, 0.13);
}

.result-status[data-tone="warning"] .result-status-dot {
    background: #f2a65a;
    box-shadow: 0 0 0 3px rgba(242, 166, 90, 0.13);
}

.result-status[data-tone="error"] .result-status-dot {
    background: #e85d75;
    box-shadow: 0 0 0 3px rgba(232, 93, 117, 0.13);
}

.result-details {
    display: contents;
}

.result-details > span:not(.result-separator) {
    white-space: nowrap;
}

.result-separator {
    color: rgba(168, 170, 176, 0.55);
}

.results-region {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}

.results-region > * {
    position: relative;
    z-index: 1;
}

.results-region.is-pending::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: -8px;
    bottom: -32px;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: var(--pending-page-bg);
    pointer-events: none;
}

button {
    appearance: none;
    border: 1px solid #25262a;
    background: #303136;
    color: #f7f7f6;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-control);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(35, 36, 38, 0.16);
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

button.toggle-btn {
    background: var(--panel-2);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
}

button.toggle-btn.is-active {
    background: #303136;
    color: #f7f7f6;
    border-color: #25262a;
}

button.toggle-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.playback-transport-group {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 5px 7px;
    border-top: 1px solid rgba(168, 170, 176, 0.22);
    background: rgba(14, 15, 17, 0.88);
    color: var(--dark-text);
    backdrop-filter: blur(6px);
}

.playback-transport-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
}

button.playback-control-button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--dark-muted);
    box-shadow: none;
    touch-action: manipulation;
}

button.playback-control-button:hover {
    transform: none;
    border-color: var(--dark-border);
    color: var(--dark-text);
}

button.playback-primary-button {
    background: rgba(224, 225, 228, 0.13);
    color: var(--dark-text);
}

.playback-control-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.playback-primary-button[data-state="pause"] .playback-icon-play,
.playback-primary-button[data-state="play"] .playback-icon-pause {
    display: none;
}

.playback-transport-group input[type="range"] {
    flex: 1 1 auto;
    min-width: 40px;
    margin: 0;
    accent-color: #d7d8dc;
}

.playback-transport-status {
    display: grid;
    grid-template-columns: var(--playback-time-width, 4ch) auto var(--playback-time-width, 4ch) auto;
    align-items: baseline;
    gap: 0 0.55ch;
    flex: 0 0 auto;
    text-align: right;
    color: var(--dark-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
}

.playback-transport-status[data-mode="samples"] {
    grid-template-columns: auto;
}

.playback-transport-status[data-mode="samples"] #playback-current-time {
    width: auto;
}

.playback-transport-status [hidden] {
    display: none !important;
}

#playback-current-time,
#playback-duration-time {
    display: inline-block;
    width: var(--playback-time-width, 4ch);
    text-align: right;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    min-width: 0;
    max-width: 100%;
}

.is-hidden {
    display: none;
}

pre {
    margin: 0;
    background: var(--code-panel-response);
    border: 1px solid var(--code-border);
    padding: 16px;
    border-radius: var(--radius-control);
    overflow: auto;
    max-height: 360px;
}

code {
    color: var(--code-text);
    font-size: 13px;
}

json-viewer {
    display: block;
    background: var(--code-panel-response);
    border: 1px solid var(--code-border);
    padding: 12px;
    border-radius: var(--radius-control);
    overflow: auto;
    max-height: 360px;
    color: var(--code-text);
    font-size: 13px;
}

.response-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.response-card {
    display: none;
}

.response-actions {
    display: flex;
    gap: 5px;
}

button.response-icon-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-inset);
    background: var(--panel-2);
    color: var(--muted);
    box-shadow: none;
}

button.response-icon-button:hover {
    transform: none;
    color: var(--text);
}

button.response-icon-button.is-success {
    border-color: var(--success-border);
    color: var(--success);
}

.response-icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#response-wrap {
    margin-top: 10px;
}

.chart-canvas {
    width: 100%;
    height: 420px;
    border-radius: 0;
    overflow: hidden;
}

.scene-viewport {
    position: relative;
    scroll-margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-surface);
    background: var(--dark-panel);
    overflow: hidden;
}

.scene-viewport:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button.back-to-scene-button {
    position: fixed;
    z-index: 30;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    box-shadow: 0 8px 22px rgba(35, 36, 38, 0.24);
}

button.back-to-scene-button[hidden] {
    display: none;
}

.back-to-scene-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scene-overlay-controls {
    position: absolute;
    z-index: 5;
    top: 0;
    right: 0;
    display: flex;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(168, 170, 176, 0.22);
    border-radius: 0 0 0 var(--radius-control);
    background: rgba(14, 15, 17, 0.86);
    backdrop-filter: blur(6px);
}

button.scene-overlay-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--dark-muted);
    box-shadow: none;
}

button.scene-overlay-button:hover {
    transform: none;
    border-color: var(--dark-border);
    color: var(--dark-text);
}

button.scene-overlay-button.is-active {
    border-color: rgba(224, 225, 228, 0.48);
    background: rgba(224, 225, 228, 0.14);
    color: var(--dark-text);
}

button.scene-overlay-button.has-hidden-layers {
    border-color: rgba(242, 166, 90, 0.55);
    color: #f2b36f;
}

.scene-layer-picker {
    position: relative;
}

.scene-layer-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border: 1px solid var(--dark-panel);
    border-radius: 999px;
    background: #f2a65a;
    color: #0b0e12;
    font-size: 9px;
    line-height: 1;
}

.scene-layer-badge[hidden],
.scene-layer-popover[hidden],
.scene-layer-group[hidden],
.scene-layer-toggle[hidden] {
    display: none;
}

.scene-layer-popover {
    position: absolute;
    z-index: 8;
    top: calc(100% + 6px);
    right: 0;
    width: 230px;
    max-width: calc(100vw - 64px);
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-surface);
    background: rgba(246, 246, 244, 0.98);
    box-shadow: 0 14px 30px rgba(35, 36, 38, 0.2);
    backdrop-filter: blur(10px);
}

.scene-layer-popover:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.scene-layer-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 12px;
}

button#layers-show-all {
    padding: 3px 6px;
    border: 0;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--accent);
    font-size: 10px;
    box-shadow: none;
}

button#layers-show-all:hover {
    transform: none;
    background: rgba(224, 225, 228, 0.1);
}

.scene-layer-group + .scene-layer-group {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(168, 170, 176, 0.14);
}

.scene-layer-group-title {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scene-layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 5px 4px;
    color: var(--text);
    font-size: 11px;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

.scene-layer-toggle:hover {
    background: rgba(168, 170, 176, 0.08);
    border-radius: var(--radius-small);
}

.scene-layer-toggle input {
    margin: 0;
    accent-color: var(--accent);
}

.scene-overlay-button svg {
    width: 18px;
    height: 18px;
    overflow: visible;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scene-overlay-button svg circle {
    stroke: none;
}

.scene-overlay-axes .axis-x {
    stroke: #ff6b6b;
}

.scene-overlay-axes .axis-y {
    stroke: #55d978;
}

.scene-overlay-axes .axis-z {
    stroke: #65a3ff;
}

.component-props-panel {
    display: grid;
    gap: 8px;
}

.component-props-panel[hidden] {
    display: none;
}

.component-prop-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
    padding: 10px 0 14px;
}

.component-prop-charts[hidden] {
    display: none;
}

.component-prop-chart-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.telemetry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 1px;
}

.telemetry-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.telemetry-title span {
    color: var(--muted);
    font-weight: 400;
}

.telemetry-actions {
    display: flex;
    gap: 4px;
}

.telemetry-actions button {
    padding: 4px 7px;
    border: 0;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    box-shadow: none;
}

.telemetry-actions button:hover {
    transform: none;
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

.telemetry-category {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.telemetry-category + .telemetry-category:not([hidden]) {
    border-top: 1px solid rgba(32, 33, 36, 0.12);
}

.telemetry-category[hidden] {
    display: none;
}

button.telemetry-category-toggle {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 9px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: rgba(32, 33, 36, 0.025);
    color: var(--text);
    font-size: 11px;
    text-align: left;
    box-shadow: none;
    cursor: pointer;
}

button.telemetry-category-toggle:hover {
    transform: none;
    border-color: rgba(32, 33, 36, 0.16);
    background: rgba(32, 33, 36, 0.06);
}

button.telemetry-category-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button.telemetry-category-toggle[aria-expanded="true"] {
    border-color: rgba(32, 33, 36, 0.18);
    background: rgba(32, 33, 36, 0.07);
}

.telemetry-category-label {
    color: var(--text);
    font-weight: 600;
}

.telemetry-category-count {
    min-width: 22px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(32, 33, 36, 0.08);
    color: var(--muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.telemetry-category-chevron {
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.15s ease;
    transform-origin: center;
}

.telemetry-category-toggle[aria-expanded="true"] .telemetry-category-chevron {
    transform: rotate(90deg);
}

.component-prop-chart-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-inset);
    background: #ffffff;
    padding: 8px;
}

.component-prop-chart-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.component-prop-chart-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

button.component-prop-chart-expand {
    width: 26px;
    height: 26px;
}

.component-prop-chart-name {
    color: var(--text);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-prop-chart-meta {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.component-prop-chart-svg {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: var(--radius-inset);
    background: #ffffff;
    overflow: hidden;
}

.component-prop-chart-plot {
    position: relative;
    border-radius: var(--radius-small);
    background: #ffffff;
    box-shadow: none;
    overflow: hidden;
}

.component-prop-chart-uplot {
    width: 100%;
    min-height: 170px;
}

.component-prop-chart-uplot .uplot {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text);
}

.component-prop-chart-uplot .u-title {
    color: var(--text);
}

.component-prop-chart-uplot .u-legend {
    color: var(--muted);
}

.component-prop-chart-grid {
    stroke: rgba(32, 33, 36, 0.14);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.component-prop-chart-border {
    fill: none;
    stroke: rgba(32, 33, 36, 0.26);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.component-prop-chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.component-prop-chart-point {
    stroke: none;
}

.component-prop-chart-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(32, 33, 36, 0.55);
    border-left: 0;
    pointer-events: none;
    transform: translateX(-0.5px);
}

.component-prop-chart-axis-label {
    fill: var(--muted);
    color: var(--muted);
    font-size: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

.component-prop-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

button.component-prop-chart-legend-item {
    display: inline-grid;
    grid-template-columns: 12px minmax(0, auto) auto;
    gap: 6px;
    align-items: center;
    max-width: 100%;
    min-height: 23px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--text);
    box-shadow: none;
    cursor: pointer;
}

button.component-prop-chart-legend-item:hover {
    transform: none;
    border-color: rgba(32, 33, 36, 0.16);
    background: rgba(32, 33, 36, 0.05);
}

button.component-prop-chart-legend-item.is-muted {
    opacity: 0.42;
}

.component-prop-chart-legend-swatch {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.component-prop-chart-legend-label {
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-prop-chart-legend-value {
    color: var(--text);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    text-align: right;
    margin-left: 3px;
}

.expanded-block-placeholder {
    width: 100%;
    min-width: 0;
}

html.block-dialog-open,
html.block-dialog-open body {
    overflow: hidden;
}

.block-dialog {
    width: calc(100vw - 32px);
    max-width: none;
    height: calc(100vh - 32px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-surface);
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(16, 17, 20, 0.32);
}

.block-dialog::backdrop {
    background: rgba(16, 17, 20, 0.58);
    backdrop-filter: blur(2px);
}

.block-dialog-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
}

.block-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    padding: 6px 8px 6px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-2);
}

.block-dialog-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.block-dialog-close {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-inset);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

button.block-dialog-close:hover {
    transform: none;
    border-color: var(--border);
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

.block-dialog-content {
    min-width: 0;
    min-height: 0;
    padding: 10px;
    overflow: auto;
}

.block-dialog-content > .is-expanded-block {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
}

.command-card.is-expanded-block {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.command-card.is-expanded-block .request-json-editor {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
}

.scene-viewport.is-expanded-block .chart-canvas {
    height: 100%;
}

.response-card.is-expanded-block {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.response-card.is-expanded-block #response-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.response-card.is-expanded-block json-viewer {
    height: 100%;
    max-height: none;
}

.component-prop-chart-card.is-expanded-block {
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr) auto;
    min-height: 0;
    overflow: auto;
}

.component-prop-chart-card.is-expanded-block .component-prop-chart-plot,
.component-prop-chart-card.is-expanded-block .component-prop-chart-uplot {
    min-height: 0;
    height: 100%;
}

.example-groups {
    display: grid;
    gap: 8px;
}

.example-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--panel-2);
    overflow: hidden;
}

.example-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    transition: color 0.15s;
}

.example-group-header:hover {
    color: var(--text);
    transform: none;
}

.example-group-chevron {
    font-size: 10px;
    transition: transform 0.15s;
}

.example-group.is-open .example-group-chevron {
    transform: rotate(90deg);
}

.example-group-body {
    display: none;
    padding: 6px 10px 10px 10px;
    gap: 5px;
}

.example-group.is-open .example-group-body {
    display: grid;
}

.example-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-inset);
    background: #ffffff;
}

button.example-run-button {
    min-width: 0;
    padding: 7px 9px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: none;
}

button.example-run-button:hover {
    transform: none;
    background: rgba(32, 33, 36, 0.06);
}

button.example-copy-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 100%;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

button.example-copy-button:hover {
    transform: none;
    background: rgba(32, 33, 36, 0.06);
    color: var(--text);
}

button.example-run-button:focus-visible,
button.example-copy-button:focus-visible {
    position: relative;
    z-index: 1;
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.example-copy-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.example-copy-check-icon {
    display: none;
}

button.example-copy-button.is-success .example-copy-link-icon {
    display: none;
}

button.example-copy-button.is-success .example-copy-check-icon {
    display: block;
}

button.example-copy-button.is-success {
    color: var(--success);
}

button.example-copy-button.is-error {
    color: #a51d3a;
}

@media (max-width: 680px) {
    body {
        padding: 20px;
    }

    .example-popover {
        width: calc(100vw - 40px);
        max-height: 65vh;
    }

    .results-region.is-pending::before {
        bottom: -20px;
    }

    .command-toolbar .example-picker {
        order: 2;
    }

    .command-json-actions {
        gap: 6px;
    }

    .command-action-cluster + .command-action-cluster {
        padding-left: 6px;
    }

    .command-toolbar-top .command-responsive-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .command-toolbar-top .command-secondary-button {
        justify-content: center;
        width: 34px;
        min-width: 34px;
        padding: 0;
    }

    .component-prop-charts {
        grid-template-columns: minmax(0, 1fr);
    }

    .telemetry-header {
        align-items: flex-start;
    }

    .playback-transport-status {
        grid-template-columns: var(--playback-time-width, 4ch) auto;
    }

    .playback-time-separator,
    #playback-duration-time {
        display: none;
    }

    .block-dialog {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
    }

    .block-dialog-content {
        padding: 6px;
    }
}
