.ist-page,
.ist-page * {
    letter-spacing: 0;
}

.ist-page {
    min-width: 1180px;
    overflow-x: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.connection-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-quaternary);
}

.connection-badge.ok { color: var(--state-success); }
.connection-badge.ok::before { background: var(--state-success); box-shadow: 0 0 10px rgba(49, 182, 147, .7); }
.connection-badge.err { color: var(--state-error); }
.connection-badge.err::before { background: var(--state-error); }

.ist-shell {
    display: grid;
    grid-template-columns: 270px minmax(560px, 1fr) 370px;
    min-height: calc(100vh - var(--topbar-h));
    background: #0b0b0d;
}

.surface-panel {
    background: #141416;
    border-color: rgba(255, 255, 255, .08);
    border-style: solid;
    border-width: 0;
}

.pack-panel {
    border-right-width: 1px;
    padding: 20px 14px;
    min-width: 0;
}

.inspect-panel {
    border-left-width: 1px;
    min-width: 0;
}

.preview-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0d0d0f;
}

.panel-heading,
.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-heading h2,
.dialog-head h2,
.selection-copy h2 {
    font-size: 16px;
    line-height: 1.35;
    font-weight: 650;
}

.eyebrow {
    color: var(--text-tertiary);
    font-family: var(--ff-en);
    font-size: 10px;
    line-height: 1.4;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.count-badge {
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    background: rgba(122, 224, 64, .11);
    font-family: var(--ff-mono);
    font-size: 11px;
}

.search-field { display: block; margin: 16px 0 12px; }
.search-field input,
.inline-field select,
.stacked-field input,
.stacked-field textarea,
.stacked-field select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    background: #202024;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
}

.search-field input { height: 38px; padding: 0 12px; }
.search-field input:focus,
.inline-field select:focus,
.stacked-field input:focus,
.stacked-field textarea:focus,
.stacked-field select:focus {
    border-color: rgba(122, 224, 64, .65);
    box-shadow: 0 0 0 3px rgba(122, 224, 64, .08);
}

.pack-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: calc(100vh - 178px);
    overflow: auto;
    padding-right: 2px;
}

.pack-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
}

.pack-item:hover { background: rgba(255, 255, 255, .045); }
.pack-item.active {
    background: rgba(122, 224, 64, .1);
    border-color: rgba(122, 224, 64, .3);
}

.pack-cover {
    width: 42px;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    object-fit: cover;
    background: #2c2c31;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}

.pack-cover img { width: 100%; height: 100%; object-fit: cover; }
.pack-copy { min-width: 0; }
.pack-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.pack-meta { display: flex; gap: 6px; margin-top: 4px; color: var(--text-tertiary); font-size: 10px; }
.pack-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workspace-toolbar {
    min-height: 72px;
    border-bottom-width: 1px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.selection-copy { min-width: 0; }
.selection-copy h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 310px; }
.toolbar-controls { display: flex; gap: 10px; align-items: center; }
.inline-field { display: flex; align-items: center; gap: 7px; color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
.inline-field select { width: 120px; height: 34px; padding: 0 28px 0 9px; }
.template-select-field select { width: 190px; }

.preview-grid {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) 250px;
    flex: 1;
    min-height: 0;
}

.stage-column {
    background: #0d0d0f;
    padding: 18px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stage-wrap {
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-comparison {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: center;
}

.compare-stage-shell { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.compare-stage-heading { width: min(100%, 300px); display: flex; justify-content: space-between; gap: 10px; color: var(--text-tertiary); font: 9px/1.2 var(--ff-mono); }
.compare-stage-heading strong { color: var(--text-secondary); font-size: 10px; }
.compare-render-stage { width: min(100%, 300px); height: auto; max-width: none; }

.render-stage {
    position: relative;
    height: min(calc(100vh - 195px), 720px);
    max-width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #19191d;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .52);
}

.render-stage > video,
.render-stage > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stage-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .12);
}

.vfx-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.render-stage.dark > video,
.render-stage.dark > img { display: none; }
.render-stage.dark { background: #25262a; }

.safe-area {
    position: absolute;
    inset: 5% 6%;
    border: 1px dashed rgba(255, 214, 90, .72);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}
.safe-area.visible { opacity: 1; }

.stage-label {
    position: absolute;
    top: 9px;
    right: 9px;
    color: rgba(255, 255, 255, .56);
    font: 9px/1 var(--ff-mono);
    background: rgba(0, 0, 0, .45);
    padding: 5px 6px;
    border-radius: 4px;
}

.subtitle-root { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.subtitle-unit {
    position: absolute;
    transform-origin: center;
    display: flex;
    flex-direction: column;
    gap: var(--secondary-gap, 0);
    text-align: var(--subtitle-align, center);
    white-space: pre-wrap;
}

.subtitle-unit.align-left { align-items: flex-start; }
.subtitle-unit.align-center { align-items: center; }
.subtitle-unit.align-right { align-items: flex-end; }

.subtitle-text {
    position: relative;
    display: block;
    width: max-content;
    max-width: 100%;
    padding: var(--bg-padding-v, 0) var(--bg-padding-h, 0);
    border-radius: var(--bg-radius, 0);
    background: var(--bg-color, transparent);
    color: var(--text-color, #fff);
    font-family: var(--font-family, sans-serif);
    font-size: var(--font-size, 24px);
    font-weight: var(--font-weight, 500);
    font-style: var(--font-style, normal);
    line-height: var(--line-height, 1.2);
    text-decoration-line: var(--text-decoration, none);
    text-transform: var(--text-transform, none);
    -webkit-text-stroke: var(--stroke-width, 0) var(--stroke-color, transparent);
    paint-order: stroke fill;
    text-shadow: var(--text-shadow, none);
    letter-spacing: var(--letter-spacing, 0);
    overflow: visible;
}

.subtitle-unit.single-line .subtitle-text,
.subtitle-unit.single-line .subtitle-secondary {
    white-space: nowrap;
}

.subtitle-text.gradient-text {
    background-image:
        var(--fill-gradient),
        linear-gradient(var(--bg-color, transparent), var(--bg-color, transparent));
    background-color: transparent;
    background-clip: text, border-box;
    -webkit-background-clip: text, border-box;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.subtitle-text .keyword {
    color: var(--keyword-color, inherit);
    font-weight: var(--keyword-weight, inherit);
    display: inline-block;
    font-size: calc(1em * var(--keyword-scale, 1));
    line-height: 1;
    transform-origin: center bottom;
}

.subtitle-text.gradient-text .keyword {
    color: var(--keyword-color, inherit);
    -webkit-text-fill-color: var(--keyword-color, inherit);
}

.subtitle-secondary {
    width: max-content;
    max-width: 100%;
    margin: 0;
    color: var(--secondary-color, #fff);
    font-family: var(--secondary-family, sans-serif);
    font-size: var(--secondary-size, 12px);
    font-style: var(--secondary-style, normal);
    font-weight: var(--secondary-weight, 400);
    line-height: 1.1;
    -webkit-text-stroke: var(--secondary-stroke-width, 0) var(--secondary-stroke-color, transparent);
    paint-order: stroke fill;
    text-shadow: var(--secondary-shadow, none);
}

.measure-single-line {
    width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
}

.subtitle-layer {
    position: absolute;
    inset: 0;
    color: var(--layer-color, transparent);
    -webkit-text-stroke: var(--layer-stroke-width, 0) var(--layer-stroke-color, transparent);
    transform: translate(var(--layer-x, 0), var(--layer-y, 0)) rotate(var(--layer-rotate, 0deg));
    opacity: var(--layer-alpha, 1);
    z-index: -1;
}

.subtitle-unit.playing.fx-in { animation: ist-enter var(--enter-duration, 500ms) cubic-bezier(.2,.8,.2,1) both; }
.subtitle-unit.playing.fx-loop { animation: ist-loop var(--loop-duration, 900ms) ease-in-out infinite; }
.subtitle-unit.playing.fx-out { animation: ist-exit var(--exit-duration, 300ms) ease-in both; }
.subtitle-unit.playing .keyword.bounce { animation: ist-keyword 560ms cubic-bezier(.15,.85,.2,1.35) both; }

@keyframes ist-enter {
    from { opacity: 0; transform: translateY(18px) scale(.78); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes ist-loop { 0%,100% { scale: 1; } 50% { scale: 1.035; } }
@keyframes ist-exit { to { opacity: 0; transform: translateY(-12px) scale(.94); } }
@keyframes ist-keyword { 0% { scale: .7; } 60% { scale: 1.15; } 100% { scale: 1; } }

.playback-bar {
    display: grid;
    grid-template-columns: 58px minmax(120px, 1fr) 94px auto;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}
.icon-command { height: 34px; border-radius: 6px; background: var(--brand-primary); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.playback-bar input[type="range"] { width: 100%; accent-color: var(--brand-primary); }
.mono-label { color: var(--text-tertiary); font: 11px/1 var(--ff-mono); }
.switch-label { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
.switch-label input { accent-color: var(--brand-primary); }

.control-column { border-left-width: 1px; padding: 16px; overflow: auto; min-width: 0; }
.compact-heading { margin-bottom: 16px; }
.stacked-field { display: flex; flex-direction: column; gap: 6px; color: var(--text-tertiary); font-size: 11px; margin-bottom: 13px; }
.field-optional { display: inline; margin-left: 5px; color: var(--accent); font-size: 10px; }
.stacked-field input, .stacked-field select { height: 36px; padding: 0 10px; }
.stacked-field textarea { padding: 9px 10px; resize: vertical; line-height: 1.55; }
.two-fields { display: grid; grid-template-columns: 1fr; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(255,255,255,.08); border-radius: 6px; overflow: hidden; margin: 3px 0 16px; }
.metric-grid div { padding: 9px; min-width: 0; }
.metric-grid div:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.08); }
.metric-grid div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.08); }
.metric-grid span { display: block; color: var(--text-tertiary); font-size: 9px; }
.metric-grid strong { display: block; margin-top: 3px; font: 11px/1.35 var(--ff-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-label { color: var(--text-tertiary); font-size: 10px; text-transform: uppercase; margin-bottom: 7px; display: flex; align-items: baseline; gap: 6px; }
.section-hint { text-transform: none; color: var(--text-quaternary); font-size: 9px; font-weight: 400; }
.slot-map-block { display: flex; flex-direction: column; gap: 4px; }
.slot-map-block .section-label:not(:first-child) { margin-top: 10px; }
.slot-map { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 2px; }
.slot-chip {
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 4px;
    padding: 4px 7px;
    background: #202024;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.slot-chip:hover:not(:disabled) { border-color: rgba(255,255,255,.22); color: var(--text-primary); }
.slot-chip:disabled { opacity: .42; cursor: default; }
.slot-chip.active { border-color: rgba(122,224,64,.45); color: var(--brand-primary); background: rgba(122,224,64,.08); }
.slot-chip .slot-count { color: var(--text-quaternary); font: 10px/1 var(--ff-mono); }
.slot-chip.active .slot-count { color: rgba(122,224,64,.75); }
.slot-chip.body-tone { border-style: dashed; }
.muted { color: var(--text-tertiary); font-size: 11px; }

.inspect-tabs { height: 48px; display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid rgba(255,255,255,.08); padding: 0 8px; }
.inspect-tab { position: relative; color: var(--text-tertiary); background: transparent; font-size: 12px; }
.inspect-tab.active { color: var(--text-primary); }
.inspect-tab.active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 2px; background: var(--brand-primary); }
.inspect-body { height: calc(100vh - var(--topbar-h) - 48px); overflow: auto; }
.inspect-view { padding: 14px; }
.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.summary-card { padding: 9px; border-radius: 5px; background: #202024; }
.summary-card span { display: block; color: var(--text-tertiary); font-size: 9px; }
.summary-card strong { display: block; margin-top: 4px; font: 15px/1 var(--ff-mono); }
.summary-card.warning strong { color: var(--state-warning); }
.summary-card.error strong { color: var(--state-error); }
.summary-card.ok strong { color: var(--state-success); }
.diagnostic-list { display: flex; flex-direction: column; gap: 6px; }
.diagnostic-item { display: grid; grid-template-columns: 8px 1fr; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.075); border-radius: 5px; background: #19191c; }
.diagnostic-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--state-info); }
.diagnostic-item.warning .diagnostic-dot { background: var(--state-warning); }
.diagnostic-item.error .diagnostic-dot { background: var(--state-error); }
.diagnostic-item.ok .diagnostic-dot { background: var(--state-success); }
.diagnostic-title { font-size: 11px; font-weight: 600; }
.diagnostic-detail { color: var(--text-tertiary); font-size: 10px; line-height: 1.5; margin-top: 2px; word-break: break-word; }
.parsed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.parsed-view-switch { display: grid; grid-template-columns: 1fr 1fr; width: 132px; height: 30px; padding: 2px; border: 1px solid rgba(255,255,255,.09); border-radius: 6px; background: #0f0f11; }
.parsed-mode { border-radius: 4px; background: transparent; color: var(--text-tertiary); font-size: 10px; }
.parsed-mode.active { background: #2a2a2e; color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,.32); }
.parsed-search { display: block; margin-bottom: 7px; }
.parsed-search input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; outline: 0; background: #202024; color: var(--text-primary); font-size: 11px; }
.parsed-search input:focus { border-color: rgba(122,224,64,.65); box-shadow: 0 0 0 3px rgba(122,224,64,.08); }
.parsed-result-meta { margin-bottom: 10px; color: var(--text-tertiary); font-size: 10px; }
.parsed-structured { display: flex; flex-direction: column; gap: 8px; }
.parsed-section { overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 6px; background: #18181b; }
.parsed-section > summary { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; align-items: center; padding: 10px 11px; cursor: pointer; list-style: none; user-select: none; }
.parsed-section > summary::-webkit-details-marker { display: none; }
.parsed-section > summary::before { content: "›"; grid-column: 3; grid-row: 1; color: var(--text-quaternary); font-size: 16px; line-height: 1; transform: rotate(0); transition: transform .16s ease; }
.parsed-section[open] > summary::before { transform: rotate(90deg); }
.parsed-section-heading { grid-column: 1; grid-row: 1; min-width: 0; }
.parsed-section-heading strong { display: block; font-size: 11px; line-height: 1.35; }
.parsed-section-heading > span { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 9px; line-height: 1.45; }
.parsed-section-count { grid-column: 2; grid-row: 1; justify-self: end; min-width: 20px; color: var(--brand-primary); font: 10px/1 var(--ff-mono); text-align: right; }
.parsed-fields { border-top: 1px solid rgba(255,255,255,.065); padding: 0 11px; }
.parsed-field { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.parsed-field:last-child { border-bottom: 0; }
.parsed-field-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.parsed-field-identity { min-width: 0; }
.parsed-field-identity strong { display: block; color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.parsed-field-identity code { display: block; margin-top: 2px; color: #7d8590; font: 9px/1.35 var(--ff-mono); word-break: break-all; }
.parsed-field p { margin-top: 6px; color: var(--text-tertiary); font-size: 9px; line-height: 1.5; }
.parsed-value { max-width: 54%; display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; color: #d8dee9; font: 10px/1.4 var(--ff-mono); text-align: right; overflow-wrap: anywhere; }
.parsed-value.kind-empty { color: var(--text-quaternary); font-family: inherit; }
.parsed-value.kind-boolean { color: var(--text-tertiary); }
.parsed-value.kind-boolean.is-on { color: var(--state-success); }
.parsed-value.has-options {
    min-height: 28px;
    padding: 5px 22px 5px 8px;
    position: relative;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 5px;
    background: #222226;
    color: #e6e9ee;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.parsed-value.has-options::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    color: var(--text-tertiary);
}
.parsed-value.has-options:hover {
    border-color: rgba(122,224,64,.4);
    background: #28282d;
}
.parsed-value.has-options:focus-visible,
.parsed-value.has-options[aria-expanded="true"] {
    outline: 0;
    border-color: rgba(122,224,64,.65);
    background: rgba(122,224,64,.08);
    box-shadow: 0 0 0 3px rgba(122,224,64,.08);
}
.parsed-color-swatch { width: 14px; height: 14px; flex: 0 0 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.parsed-boolean-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--text-quaternary); }
.parsed-value.kind-boolean.is-on .parsed-boolean-dot { background: var(--state-success); box-shadow: 0 0 7px rgba(49,182,147,.6); }
.parsed-options-popover {
    position: fixed;
    z-index: 120;
    width: min(340px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 7px;
    background: #242428;
    box-shadow: 0 18px 48px rgba(0,0,0,.58), 0 2px 8px rgba(0,0,0,.36);
}
.parsed-options-popover[hidden] { display: none; }
.parsed-options-popover::before {
    content: "";
    position: absolute;
    left: var(--popover-arrow-x, 50%);
    width: 10px;
    height: 10px;
    background: #242428;
    transform: translateX(-50%) rotate(45deg);
}
.parsed-options-popover.opens-down::before {
    top: -6px;
    border-left: 1px solid rgba(255,255,255,.15);
    border-top: 1px solid rgba(255,255,255,.15);
}
.parsed-options-popover.opens-up::before {
    bottom: -6px;
    border-right: 1px solid rgba(255,255,255,.15);
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.parsed-options-head {
    flex: 0 0 auto;
    padding: 13px 14px 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #29292e;
}
.parsed-options-head > span {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-primary);
    font-size: 9px;
    line-height: 1.3;
}
.parsed-options-head strong {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.35;
}
.parsed-options-head code {
    display: block;
    margin-top: 3px;
    color: #89919c;
    font: 9px/1.35 var(--ff-mono);
    overflow-wrap: anywhere;
}
.parsed-options-list {
    min-height: 0;
    overflow: auto;
    padding: 4px 12px 6px;
}
.parsed-option {
    position: relative;
    padding: 10px 2px 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,.065);
}
.parsed-option:last-child { border-bottom: 0; }
.parsed-option::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    bottom: 11px;
    width: 2px;
    border-radius: 2px;
    background: transparent;
}
.parsed-option.active { background: rgba(122,224,64,.045); }
.parsed-option.active::before { background: var(--brand-primary); }
.parsed-option-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parsed-option-head > span:first-child { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.parsed-option-head code { color: #e6e9ee; font: 10px/1.35 var(--ff-mono); overflow-wrap: anywhere; }
.parsed-option-head strong { color: var(--text-secondary); font-size: 10px; line-height: 1.35; white-space: nowrap; }
.parsed-option.active .parsed-option-head code,
.parsed-option.active .parsed-option-head strong { color: var(--brand-primary); }
.parsed-option-current {
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(122,224,64,.12);
    color: var(--brand-primary);
    font-size: 9px;
    line-height: 1.3;
}
.parsed-option p { margin-top: 5px; color: var(--text-tertiary); font-size: 10px; line-height: 1.55; }
.parsed-options-unknown {
    margin: 8px 0 4px;
    padding: 8px 10px;
    border-left: 2px solid var(--state-warning);
    background: rgba(255,190,52,.07);
    color: var(--state-warning);
    font-size: 10px;
    line-height: 1.45;
}
.json-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.json-view { color: #d8dee9; font: 10px/1.55 var(--ff-mono); white-space: pre-wrap; word-break: break-word; }
.request-log { display: flex; flex-direction: column; gap: 7px; }
.log-entry { padding: 9px; border-left: 2px solid var(--state-info); background: #19191c; }
.log-entry.ok { border-left-color: var(--state-success); }
.log-entry.error { border-left-color: var(--state-error); }
.log-head { display: flex; justify-content: space-between; gap: 8px; font: 10px/1.35 var(--ff-mono); }
.log-detail { color: var(--text-tertiary); margin-top: 4px; font-size: 10px; word-break: break-all; }
.empty-state { color: var(--text-tertiary); text-align: center; padding: 40px 16px; }
.empty-state.compact { padding: 22px 10px; font-size: 11px; }

.settings-dialog { width: min(560px, calc(100vw - 32px)); border: 0; padding: 0; color: var(--text-primary); background: transparent; }
.settings-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.settings-card { background: #1b1b1f; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 20px; box-shadow: var(--elevation-lg); }
.dialog-head { margin-bottom: 18px; }
.dialog-close { width: 32px; height: 32px; border-radius: 50%; color: var(--text-tertiary); background: rgba(255,255,255,.06); font-size: 20px; }
.dialog-hint { color: var(--text-tertiary); font-size: 11px; margin-top: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 360px; padding: 10px 13px; border-radius: 6px; background: #2b2b30; border: 1px solid rgba(255,255,255,.13); box-shadow: var(--elevation-md); font-size: 12px; }
.toast.error { border-color: rgba(255,69,58,.5); }
.hidden { display: none !important; }

@media (max-width: 1380px) {
    .ist-shell { grid-template-columns: 230px minmax(540px, 1fr) 330px; }
    .preview-grid { grid-template-columns: minmax(360px, 1fr) 225px; }
    .render-stage { height: min(calc(100vh - 255px), 640px); }
}

@media (max-width: 900px) {
    :root { --topbar-h: 112px; }
    .ist-page { min-width: 0; }
    .topbar { height: auto; min-height: var(--topbar-h); padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
    .topbar-actions { width: 100%; justify-content: flex-end; }
    .ist-shell { display: block; min-height: 0; }
    .pack-panel { border-right-width: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
    .pack-list { height: auto; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .pack-item { min-width: 220px; }
    .workspace-toolbar { flex-wrap: wrap; }
    .selection-copy h2 { max-width: 100%; }
    .preview-grid { display: block; }
    .stage-column { min-height: 700px; }
    .render-stage { height: min(68vh, 620px); }
    .stage-comparison { min-height: 540px; padding: 0 12px; }
    .control-column { border-left-width: 0; border-top: 1px solid rgba(255,255,255,.08); }
    .two-fields { grid-template-columns: 1fr 1fr; gap: 10px; }
    .inspect-panel { border-left-width: 0; border-top: 1px solid rgba(255,255,255,.08); }
    .inspect-body { height: auto; min-height: 320px; max-height: 620px; }
}

@media (max-width: 540px) {
    :root { --topbar-h: 104px; }
    .topbar { padding: 10px 12px; }
    .brand { gap: 10px; }
    .brand .subtitle,
    .brand .ver,
    .connection-badge,
    .topbar-actions > a { display: none; }
    .topbar-actions { width: auto; margin-left: auto; }
    .topbar-actions .btn { padding: 7px 11px; font-size: 11px; }
    .pack-panel { padding: 14px 12px; }
    .workspace-toolbar { padding: 12px; }
    .toolbar-controls { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .inline-field { display: block; }
    .inline-field select,
    .template-select-field select { display: block; width: 100%; margin-top: 4px; }
    .stage-column { min-height: 0; padding: 12px 10px; }
    .render-stage { width: min(100%, 340px); height: auto; }
    .stage-comparison { min-height: 0; gap: 8px; padding: 0; }
    .compare-stage-heading { font-size: 8px; }
    .compare-render-stage { width: 100%; }
    .playback-bar { grid-template-columns: 48px minmax(80px, 1fr) 78px; gap: 7px; }
    .switch-label { grid-column: 1 / -1; justify-self: end; }
    .two-fields { grid-template-columns: 1fr; gap: 0; }
    .control-column { padding: 14px 12px; }
}

@media (min-width: 901px) {
    html,
    body.ist-page {
        height: 100%;
        min-height: 0;
    }

    .ist-page {
        height: 100dvh;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .ist-page > .topbar {
        flex: 0 0 var(--topbar-h);
    }

    .ist-shell {
        height: calc(100dvh - var(--topbar-h));
        min-height: 0;
        overflow: hidden;
    }

    .pack-panel,
    .inspect-panel,
    .preview-workspace,
    .preview-grid,
    .stage-column {
        min-height: 0;
        overflow: hidden;
    }

    .pack-panel,
    .inspect-panel {
        display: flex;
        flex-direction: column;
    }

    .pack-list,
    .inspect-body {
        flex: 1;
        height: auto;
        min-height: 0;
        overflow: auto;
    }

    .workspace-toolbar,
    .inspect-tabs,
    .playback-bar {
        flex: 0 0 auto;
    }

    .preview-grid {
        overflow: hidden;
    }

    .stage-wrap {
        container-type: size;
        overflow: hidden;
    }

    .render-stage {
        width: min(100cqw, 56.25cqh, 405px);
        height: auto;
        max-width: none;
    }

    .compare-render-stage {
        width: min(100%, 44cqw, 48cqh, 300px);
        height: auto;
    }

    .control-column {
        min-height: 0;
        overflow: auto;
    }
}
