/* Additions for the JSON Schema Generator. Loaded after css/json-schema-page.css. */
.sg-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.sg-panel { padding: 12px 14px; background: #f8f9fa; border: 1.5px solid #e5e7eb; border-radius: 8px; }
body.dark-mode .sg-panel { background: #252525; border-color: #404040; }
.sg-panel-title { font-size: 13px; font-weight: 700; color: #333; margin: 0 0 8px; }
body.dark-mode .sg-panel-title { color: #e0e0e0; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; }
.sg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-opt { display: block; min-width: 0; }
.sg-opt > label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #333; cursor: pointer; min-height: 28px; }
body.dark-mode .sg-opt > label { color: #e0e0e0; }
.sg-opt input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; accent-color: #0066cc; }
.sg-opt select { font-size: 13px; padding: 4px 8px; border-radius: 6px; border: 1.5px solid #e5e7eb; background: #fff; color: #333; cursor: pointer; max-width: 100%; }
body.dark-mode .sg-opt select { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }
.sg-hint { display: block; margin: 2px 0 0 24px; font-size: 12px; line-height: 1.45; color: #555; font-weight: 400; }
body.dark-mode .sg-hint { color: #b5b5b5; }
.sg-hint-flat { margin-left: 0; }
/* Dim only the label and checkbox; the hint keeps full contrast (WCAG 1.4.3). */
.sg-dim > label { opacity: 0.55; }
.sg-status { margin: 0 0 10px; font-size: 13px; color: #444; min-height: 20px; overflow-wrap: anywhere; }
body.dark-mode .sg-status { color: #c8c8c8; }
.sg-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; }
.sg-status-row .sg-status { margin: 0; flex: 1 1 260px; }
.sg-note { font-size: 12px; color: #555; margin: 0; overflow-wrap: anywhere; }
body.dark-mode .sg-note { color: #b5b5b5; }
.sg-drop-active { outline: 3px dashed #0066cc; outline-offset: -3px; }
.sg-checkbar { margin-top: 12px; padding: 12px 14px; background: #f8f9fa; border: 1.5px solid #e5e7eb; border-radius: 8px; }
body.dark-mode .sg-checkbar { background: #252525; border-color: #404040; }
.sg-checkbar .sg-hint { margin-left: 0; margin-bottom: 8px; font-size: 12.5px; }
.sg-check { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid #e5e7eb; font-size: 13px; max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.sg-check[hidden] { display: none; }
.sg-check-head { margin: 0; font-weight: 600; }
.sg-check-ok { background: #e8f5e9; border-color: #218838; color: #1b4d27; }
.sg-check-bad { background: #fdecea; border-color: #dc3545; color: #6b1d24; }
.sg-check-busy { background: #eef4ff; border-color: #2563eb; color: #1e3a8a; }
.sg-check-list { margin: 8px 0 0 22px; padding: 0; font-size: 12.5px; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.dark-mode .sg-check-ok { background: #16301c; border-color: #2f9e49; color: #b9f0c4; }
body.dark-mode .sg-check-bad { background: #3a1d20; border-color: #dc3545; color: #ffc9ce; }
body.dark-mode .sg-check-busy { background: #1b2640; border-color: #4a7cf0; color: #c4d6ff; }
.sg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sg-actions button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
button.sg-linkbtn { background: transparent !important; color: #0066cc !important; text-decoration: underline; padding: 0 6px; height: 30px; box-shadow: none !important; transform: none !important; }
body.dark-mode button.sg-linkbtn { color: #6bb6ff !important; }
.sg-worked { margin: 8px 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.sg-worked pre, .sg-code { margin: 6px 0 12px; padding: 10px 12px; background: #f1f3f5; border: 1px solid #dde1e6; border-radius: 6px; font-size: 12px; line-height: 1.5; overflow: auto; max-width: 100%; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.dark-mode .sg-worked pre, body.dark-mode .sg-code { background: #1d1d1d; border-color: #404040; color: #e0e0e0; }
.sg-worked .sg-cap { font-size: 12px; font-weight: 700; margin: 4px 0 0; color: #333; }
body.dark-mode .sg-worked .sg-cap { color: #e0e0e0; }
.sg-table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0 14px; display: block; overflow-x: auto; }
.sg-table th, .sg-table td { border: 1px solid #dde1e6; padding: 6px 10px; text-align: left; vertical-align: top; }
body.dark-mode .sg-table th, body.dark-mode .sg-table td { border-color: #404040; }
.publisher-content code, .sg-hint code { font-size: 0.92em; overflow-wrap: anywhere; }
.js-container { contain: layout; }
.js-header-left { flex-wrap: wrap; }
.js-main-content { min-width: 0; }
@media (max-width: 900px) {
    .sg-grid, .sg-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .sg-worked { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .sg-panel, .sg-checkbar { padding: 10px; }
    .js-header-left button, .js-header-right button, .sg-actions button, button.sg-linkbtn { min-height: 44px; }
    .sg-opt > label { min-height: 44px; }
    .sg-opt input[type="checkbox"] { width: 22px; height: 22px; }
    .sg-opt select { min-height: 44px; width: 100%; }
    .sg-actions { flex-direction: column; align-items: stretch; }
    .sg-actions button { width: 100%; }
    .js-container { min-height: 460px; }
    .js-validate-btn { min-height: 44px; }
}

.js-editor.sg-booting { visibility: hidden; }
