.panels-shell-wrap {
    padding: 18px 24px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}
#panels-shell {
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 24px 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: calc(100% + 56px);
    margin-left: -28px;
    margin-right: -28px;
    align-self: stretch;
}
.panels-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.panels-shell-header h2 {
    margin: 0;
    color: #0f172a;
}

#panels-empty {
    margin: 0 0 12px;
    color: #5d6474;
    font-style: italic;
}

#panels {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding: 6px 2px;
    -webkit-overflow-scrolling: touch;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, .08);
    padding: 14px 16px 18px;
    width: calc(230px + 520px + 14px + 32px);
    max-width: calc(230px + 520px + 14px + 32px);
    min-width: calc(230px + 520px + 14px + 32px);
    flex: 0 0 auto;
}

.panel h2 {
    margin: 0;
    font-size: 1.15rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.config-toggle-group {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-toggle {
    border: 1px solid #d2d8ee;
    background: #fff;
    color: var(--color-appraisal-tag-blue);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.config-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.config-toggle.is-active {
    background: var(--color-appraisal-tag-blue);
    color: #fff;
}

.panel-meta {
    margin-top: 2px;
    font-size: .85rem;
    color: #7a8094;
}

.config-panel {
    border: 1px solid #dce1f3;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8f9ff;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.config-panel.hidden {
    display: none;
}

.config-section {
    border: 1px solid #d8deef;
    border-radius: 12px;
    padding: 10px 12px 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    width: 100%;
    box-sizing: border-box;
}

.config-section:not(:last-child) {
    margin-bottom: 12px;
}

.config-section .config-title {
    margin-bottom: 6px;
}

.decay-chart {
    margin-top: 12px;
    border: 1px solid #dfe3fb;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.decay-chart-canvas {
    width: 100%;
    height: 160px;
    display: block;
}

.decay-chart-caption {
    margin-top: 6px;
    font-size: .75rem;
    color: #5d647a;
}

.config-title {
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 8px;
    color: #1e2338;
}

.config-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-grid.is-inferred .config-slider-track {
    animation: personality-infer-glow 1.2s ease-out;
}

.config-summary.is-inferred .personality-summary {
    animation: personality-infer-outline 1.2s ease-out;
}

@keyframes personality-infer-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
    40% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes personality-infer-outline {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        border-color: #d8deef;
    }
    40% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18);
        border-color: #93c5fd;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        border-color: #d8deef;
    }
}

.config-grid.appraisal-grid {
    gap: 14px;
}

.appraisal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.appraisal-weight-status {
    font-size: .85rem;
    color: #6b7280;
}

.appraisal-section-header .config-title {
    margin-bottom: 0;
}

.appraisal-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.appraisal-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.appraisal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.appraisal-action {
    border: 1px solid #d2d8ee;
    background: #fff;
    color: var(--color-appraisal-tag-blue);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
}

.appraisal-action:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.appraisal-action.is-active {
    background: var(--color-appraisal-tag-blue);
    color: #fff;
}

.appraisal-action:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.config-row.llm-card {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    align-items: flex-start;
    flex-wrap: nowrap;
}
.config-row.llm-card.is-alt {
    background: #eef2ff;
}
.config-row.llm-card:not(.is-alt) {
    background: #f8fafc;
}
.llm-config-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.llm-config-actions .llm-assistant-btn {
    padding: 6px 10px;
    font-size: .85rem;
}
.config-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.config-radio {
    display: flex;
    align-items: center;
}
.config-row-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.config-row-title {
    font-weight: 700;
    color: #1d2336;
}
.config-row-meta {
    color: #5f657a;
    font-size: .85rem;
}
.config-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.llm-add-btn {
    border: 1px dashed #cbd5f5;
    background: #eef2ff;
    color: #1e2650;
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
}
.llm-add-btn:hover {
    background: #e0e7ff;
}
.llm-add-btn:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}
.llm-empty {
    margin: 4px 0 0;
}

.appraisal-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.appraisal-row-content {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: flex-start;
}

.appraisal-row-content--compact {
    gap: 6px;
}

.appraisal-tag-block {
    flex: 0 0 240px;
    text-align: left;
}

.appraisal-row-content--compact .appraisal-tag-block {
    flex: 0 0 270px;
    max-width: 270px;
}

.appraisal-tag-block--compact {
    flex: 0 0 230px;
    max-width: 230px;
}

.appraisal-tag-name {
    font-weight: 600;
    color: var(--color-appraisal-tag-blue);
    white-space: nowrap;
}

.appraisal-tag-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.appraisal-prompt-button {
    border: 1px solid #cbd5f5;
    background: #eef2ff;
    color: var(--color-appraisal-tag-blue);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: .68rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
    white-space: nowrap;
}

.appraisal-prompt-button.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.appraisal-prompt-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.appraisal-explanation-toggle {
    border: 1px solid #cbd5f5;
    background: #fff;
    color: #0f172a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: .85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.appraisal-explanation-toggle.is-active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.appraisal-explanation-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.appraisal-tag-meta {
    font-size: .75rem;
    color: #6b7280;
    margin-top: 2px;
}

.appraisal-prompt-panel {
    border: 1px solid #e2e6f7;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    margin: 8px 0 0;
    max-height: 13.5em;
    overflow-y: auto;
}

.appraisal-explanation-panel {
    border: 1px dashed #cdd6fb;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 12px;
    margin: 8px 0 0;
    box-sizing: border-box;
    width: 100%;
    flex: 0 0 100%;
}

.appraisal-explanation-title {
    margin: 0 0 6px;
    font-size: .78rem;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
}

.appraisal-explanation-entry {
    display: flex;
    gap: 6px;
    font-size: .75rem;
    color: #1f2937;
    margin: 0 0 4px;
}

.appraisal-explanation-entry:last-child {
    margin-bottom: 0;
}

.appraisal-explanation-attr {
    font-weight: 600;
    white-space: nowrap;
}

.appraisal-explanation-text {
    flex: 1;
    white-space: pre-wrap;
    background: #ffffff;
}

.appraisal-prompt-text {
    margin: 0;
    font-size: .78rem;
    color: #1e2338;
    white-space: pre-wrap;
}

.appraisal-prompt-used-label {
    margin-top: 8px;
    font-size: .72rem;
    font-weight: 600;
    color: #4b5164;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.appraisal-prompt-used {
    margin: 4px 0 0;
    font-size: .75rem;
    color: #1e2338;
    background: #f4f6ff;
    border: 1px solid #dbe2f4;
    border-radius: 8px;
    padding: 6px 8px;
    white-space: pre-wrap;
}

.appraisal-prompt-indicator {
    font-size: .75rem;
    min-width: 18px;
    text-align: center;
    color: #9ca3af;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.appraisal-prompt-indicator.is-complete {
    color: #16a34a;
    font-weight: 700;
}

.appraisal-prompt-indicator.is-pending {
    color: #0f172a;
}

.appraisal-estimate-pill {
    position: absolute;
    top: 8%;
    transform: translate(-50%, -60%);
    font-family: monospace;
    font-size: .75rem;
    font-weight: 600;
    color: #064e3b;
    background: rgba(34, 197, 94, .8);
    padding: 2px 8px;
    border-radius: 998px;
    box-shadow: 0 1px 3px rgba(8, 12, 32, .2);
    pointer-events: none;
    white-space: nowrap;
}

.appraisal-attributes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appraisal-group {
    border: 1px solid #e2e6f7;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fbfcff;
}

.appraisal-group-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.0rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: .05em;
    margin-bottom: 8px;
    text-align: center;
}

.appraisal-group-title-prefix {
    flex: 1;
    text-align: right;
    font-size: .85rem;
    font-weight: 100;
    color: #94a3b8;
}

.appraisal-group-title-main {
    flex: 0;
    text-transform: uppercase;
}

.appraisal-group-title-spacer {
    flex: 1;
    visibility: hidden;
}

.appraisal-group-body {
    display: flex;
    flex-direction: column;
}

.appraisal-group-body > .appraisal-row {
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e6f7;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 0;
}

.appraisal-row-content {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: flex-start;
}

.appraisal-group-body > .appraisal-row:nth-child(odd) {
    background: #f6f8ff;
}

.appraisal-theory-panel {
    border: 1px solid #e2e6f7;
    border-radius: 10px;
    background: #f7f9ff;
    padding: 10px 12px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

.appraisal-theory-text {
    margin: 0 0 6px;
    font-size: .82rem;
    color: #1e2338;
}

.appraisal-llm-panel {
    border: 1px solid #e2e6f7;
    border-radius: 10px;
    background: #f7f9ff;
    padding: 10px 12px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

.appraisal-llm-panel-title {
    margin: 0 0 6px;
    font-size: .82rem;
    font-weight: 600;
    color: #0f172a;
}
.appraisal-llm-theory {
    font-size: .82rem;
    color: #0f172a;
}
.appraisal-llm-theory .appraisal-group-title {
    justify-content: flex-start;
    text-align: left;
    font-size: .82rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0;
}
.appraisal-llm-theory .global-textarea-block label {
    display: block;
    text-align: left;
    font-size: .82rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}
.appraisal-llm-theory .global-textarea {
    font-size: .82rem;
    min-height: calc(3 * 1.2em);
}

.appraisal-theory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appraisal-theory-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #dbe2f4;
    background: #ffffff;
    cursor: pointer;
}

.appraisal-theory-item:hover {
    background: #f0f4ff;
}

.appraisal-theory-checkbox {
    margin-top: 2px;
}

.appraisal-theory-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #1e2338;
}

.appraisal-theory-title {
    font-size: .82rem;
    font-weight: 600;
    color: #0f172a;
}

.appraisal-theory-summary {
    font-size: .78rem;
    color: #4b5164;
    line-height: 1.35;
}
.appraisal-llm-status {
    margin: 0;
    font-size: .8rem;
    color: #4b5164;
    background: #fff;
    border: 1px solid #dbe2f4;
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1.4;
    white-space: pre-wrap;
    font-family: \"JetBrains Mono\", Consolas, monospace;
}

.appraisal-llm-status.is-error {
    color: #b91c1c;
}

.appraisal-attr {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appraisal-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eef2ff;
    color: #1f2937;
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}

.appraisal-status-icon.is-text::before {
    content: "T";
}

.appraisal-status-icon.is-updated {
    background: #0f172a;
    color: #fff;
}

.appraisal-status-icon.is-updated::before {
    content: "✓";
}

.appraisal-status-icon.is-loading {
    background: transparent;
    border: 2px solid #cbd5f5;
    border-top-color: #0f172a;
    animation: appraisal-spin .9s linear infinite;
}

.appraisal-status-icon.is-loading::before {
    content: "";
}

@keyframes appraisal-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.appraisal-attr-label {
    width: 110px;
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    text-transform: capitalize;
    text-align: right;
}

.appraisal-slider-wrap {
    flex: 0 0 140px;
}

.appraisal-slider-track {
    overflow: visible;
    height: 32px;
    align-items: center;
    --estimate-pos: 50%;
    --estimate-opacity: 0;
}

.appraisal-slider-track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: var(--estimate-pos);
    width: 156px;
    height: 44px;
    transform: translate(-50%, -50%);
    background: radial-gradient(78px 24px at 50% 50%,
        rgba(49, 86, 135, .72) 0%,
        rgba(49, 86, 135, .32) 34%,
        rgba(49, 86, 135, 0) 70%);
    opacity: var(--estimate-opacity);
    clip-path: polygon(50% 0%, 62% 32%, 100% 50%, 62% 68%, 50% 100%, 38% 68%, 0% 50%, 38% 32%);
    -webkit-clip-path: polygon(50% 0%, 62% 32%, 100% 50%, 62% 68%, 50% 100%, 38% 68%, 0% 50%, 38% 32%);
    pointer-events: none;
    z-index: 1;
}

.appraisal-slider-rail {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: #dfe5f3;
    border-radius: 999px;
    z-index: 0;
}

.appraisal-realization-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 22px;
}

.appraisal-slider-value {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: monospace;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, .75);
    padding: 2px 8px;
    border-radius: 998px;
    pointer-events: none;
    white-space: nowrap;
    min-width: 46px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(8, 12, 32, .25);
    z-index: 2;
}

.appraisal-slider-value.is-standalone {
    position: static;
    transform: none;
}

.appraisal-attr.is-chip {
    align-items: center;
}

.appraisal-attr-chip {
    border: 1px solid #cbd5f5;
    background: #eef2ff;
    color: #1f2937;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.config-row label {
    width: 140px;
    font-size: .82rem;
    font-weight: 600;
    color: #3c4158;
}

.config-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.config-slider-track {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.config-slider-track input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 22px;
}

.config-slider-track input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #d6dff2;
    border-radius: 999px;
}

.config-slider-track input[type="range"]::-moz-range-track {
    height: 4px;
    background: #d6dff2;
    border-radius: 999px;
}

.config-slider-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1d2336;
    border: 2px solid #fff;
    margin-top: -6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
}

.config-slider-track input[type="range"].is-readonly {
    opacity: 1;
}

.config-slider-track input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1d2336;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
}

.config-zero-tick {
    position: absolute;
    width: 3px;
    height: 18px;
    background: #1d2336;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    pointer-events: none;
    opacity: .85;
}

.config-switch-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: default;
    inset: 0;
    background: #7f1d1d;
    border-radius: 999px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, .25);
    transition: background .25s ease, box-shadow .25s ease;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .25);
    transition: transform .25s ease;
}

.switch input:checked + .switch-slider {
    background: #065f46;
    box-shadow: inset 0 0 6px rgba(6, 95, 70, .35);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(30px);
}

.switch-value {
    font-size: .85rem;
    font-weight: 600;
    color: #1e2338;
}

.config-value {
    font-family: monospace;
    font-size: .85rem;
    color: #111;
    min-width: 48px;
    text-align: right;
}

.config-summary {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.config-summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.config-summary-header label {
    font-size: .82rem;
    font-weight: 600;
    color: #3c4158;
}

.config-summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-toggle {
    border: 1px solid #d2d8ee;
    background: #fff;
    color: var(--color-appraisal-tag-blue);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
}

.config-summary-header .appraisal-action {
    border-radius: 999px;
    padding: 4px 10px;
}

.prompt-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.prompt-toggle.is-active {
    background: var(--color-appraisal-tag-blue);
    color: #fff;
}

.config-prompt {
    border: 1px solid #d8deef;
    border-radius: 10px;
    padding: 8px;
    background: #fbfcff;
    font-family: monospace;
    font-size: .82rem;
    color: #1d2336;
}

.config-prompt textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    min-height: 70px;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.config-prompt textarea:focus {
    outline: none;
}

.config-prompt.hidden {
    display: none;
}

.personality-summary {
    width: 100%;
    min-height: 110px;
    border: 1px solid #d8deef;
    border-radius: 10px;
    padding: 10px;
    font-family: monospace;
    font-size: .85rem;
    resize: vertical;
    background: #fdfefe;
    color: #1d2336;
}

.personality-summary.is-pending {
    text-align: center;
    font-style: italic;
    color: #5d6474;
}

.personality-summary:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.panel-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns:230px minmax(520px, 1fr);
    gap: 14px;
}

.evector {
    border-right: 1px solid #eceef6;
    padding-right: 12px;
}

.evector .row {
    display: grid;
    grid-template-columns:110px 2fr;
    gap: 8px;
    align-items: center;
    margin: .25rem 0;
}

.evector .label {
    text-align: right;
    font-weight: 600;
    font-size: .83rem;
}

.evector input[type="range"] {
    width: 100%;
    height: 18px;
}

.evector .row.row-physical {
    margin-top: 1rem;
    padding-top: .45rem;
    border-top: 1px dashed #dce1f1;
}

.right-col {
    display: grid;
    grid-template-rows:minmax(460px, auto) minmax(120px, auto);
    gap: 12px;
}

.mood3d {
    position: relative;
    border: 1px solid #d8deef;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7f8fc, #eef2ff);
    overflow: hidden;
    min-height: 460px;
}

.mood3d-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.mood3d .mood-control {
    background: rgba(13, 18, 32, .85);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: .75rem;
    cursor: pointer;
}

.mood3d .mood-control.is-off {
    background: rgba(15, 23, 42, .6);
    color: #dce3ff;
}

.mood3d .mood-control:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.mood3d-stage {
    position: absolute;
    inset: 0;
}

.mood3d .trail-toggle {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    background: rgba(13, 18, 32, .85);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: .75rem;
    cursor: pointer;
}

.mood3d .trail-toggle.is-off {
    background: rgba(15, 23, 42, .6);
    color: #dce3ff;
}

.mood3d .trail-toggle:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.mood3d-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.mood3d-stage.three-missing {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: #9ca4bd;
    text-align: center;
    padding: 1rem;
}

.affectinfo {
    border: 1px dashed #cfd6ec;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fbfcff;
    font-size: .9rem;
    color: #4b5164;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.affectinfo .section {
    border-bottom: 1px solid #eceef6;
    padding-bottom: 6px;
    display: flex;
    gap: 6px;
    font-family: monospace;
    align-items: center;
}

.affectinfo .section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.affectinfo .affect-label {
    min-width: 140px;
    font-weight: 600;
    color: #1d2336;
    white-space: nowrap;
    text-align: right;
}

.affectinfo .affect-values {
    flex: 1;
    color: #353a4c;
}

.muted {
    color: #9098af;
    font-size: .85rem;
}

.llm-assistant-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    z-index: 60;
    padding: 14px;
}
.llm-assistant-overlay[aria-hidden="false"] {
    display: flex;
}
.llm-assistant-dialog {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.llm-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.llm-assistant-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
}
.llm-assistant-close {
    border: none;
    background: transparent;
    font-size: 1.15rem;
    cursor: pointer;
}
.llm-assistant-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.llm-assistant-field label {
    font-weight: 600;
    color: #1f2937;
}
.llm-assistant-field input {
    border: 1px solid #cbd5f5;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .95rem;
    color: #0f172a;
}
.llm-assistant-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.llm-assistant-row .llm-assistant-field {
    min-width: 140px;
}
.llm-assistant-status {
    min-height: 18px;
    font-size: .85rem;
    color: #475569;
}
.llm-assistant-status.is-error {
    color: #c0392b;
}
.llm-assistant-models {
    border: 1px solid #e2e6f7;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f9ff;
    max-height: 220px;
    overflow-y: auto;
}
.llm-assistant-model {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #dfe3fb;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    cursor: pointer;
}
.llm-assistant-model input {
    margin-top: 2px;
}
.llm-assistant-model-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.llm-assistant-model-title {
    font-weight: 700;
    color: #1d2336;
}
.llm-assistant-model-meta {
    font-size: .85rem;
    color: #5f657a;
}
.llm-assistant-badge {
    align-self: flex-start;
    background: #e5e7eb;
    color: #374151;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 700;
}
.llm-assistant-model.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.llm-assistant-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.llm-assistant-btn {
    border: 1px solid #cbd5f5;
    background: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}
.llm-assistant-btn.primary {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}
.llm-assistant-btn.ghost {
    background: transparent;
}
.llm-assistant-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 1180px) {
    #panels {
        flex-direction: column;
        overflow-x: hidden;
    }

    .panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .panel-grid {
        grid-template-columns:1fr;
    }

    .evector {
        border-right: none;
        border-bottom: 1px solid #eceef6;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .right-col {
        grid-template-rows: minmax(360px, auto) minmax(120px, auto);
    }
}
