/* ObjGen-style model → JSON panel (optional, above main converter) */
/* Pane height: 3× original 200px — model textarea + JSON preview */
.objgen-model-section {
    margin: 0.75rem 0 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
    overflow: hidden;
}

body.light-mode .objgen-model-section {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(100, 116, 139, 0.35);
}

.objgen-model-summary {
    cursor: pointer;
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.objgen-model-summary::-webkit-details-marker,
.objgen-model-summary::marker {
    display: none;
}

.objgen-summary-main {
    flex: 1;
    min-width: 0;
}

/* Right side: "Collapse" / "Expand" text + chevron (▲ open, ▼ closed) */
.objgen-summary-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.05rem;
    padding: 0.2rem 0.35rem 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.15);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

body.light-mode .objgen-summary-toggle {
    background: rgba(100, 116, 139, 0.12);
}

.objgen-toggle-label--expand {
    display: none;
}

details.objgen-model-section:not([open]) .objgen-toggle-label--collapse {
    display: none;
}

details.objgen-model-section:not([open]) .objgen-toggle-label--expand {
    display: inline;
}

.objgen-disclosure {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.22);
    font-size: 0.55rem;
    line-height: 1;
    color: inherit;
}

body.light-mode .objgen-disclosure {
    background: rgba(100, 116, 139, 0.18);
}

.objgen-disclosure::before {
    content: '\25B2';
}

details.objgen-model-section:not([open]) .objgen-disclosure::before {
    content: '\25BC';
}

.objgen-model-summary .objgen-hint {
    font-weight: 400;
    opacity: 0.85;
    font-size: 0.82rem;
    margin-left: 0.35rem;
}

.objgen-model-inner {
    padding: 0 1rem 1rem;
}

.objgen-feature-line {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0 0 0.65rem;
    opacity: 0.92;
}

.objgen-feature-line a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.objgen-attribution {
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0.75rem 0 0;
    opacity: 0.75;
}

.objgen-attribution a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.objgen-model-summary a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.objgen-model-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.objgen-model-toolbar .btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
}

.objgen-model-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    min-height: 660px;
}

@media (max-width: 900px) {
    .objgen-model-grid {
        grid-template-columns: 1fr;
    }
}

.objgen-pane-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
    margin-bottom: 0.35rem;
}

.objgen-model-textarea {
    width: 100%;
    min-height: 600px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.45;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(2, 6, 23, 0.55);
    color: #e2e8f0;
    resize: vertical;
    tab-size: 2;
}

body.light-mode .objgen-model-textarea {
    background: #fff;
    color: #0f172a;
    border-color: rgba(100, 116, 139, 0.45);
}

.objgen-json-preview-wrap {
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    overflow: hidden;
    min-height: 600px;
}

.objgen-json-preview-wrap .CodeMirror {
    height: 600px;
    font-size: 13px;
}

.objgen-model-error {
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
}

body.light-mode .objgen-model-error {
    background: rgba(254, 226, 226, 0.95);
    color: #991b1b;
}

.objgen-model-error.hidden {
    display: none;
}
