/* Modal chrome (backdrop, header, body, footer), help content, forms, khand builder rows, inline notices, JSON editor, visually-hidden utility. */

.modalBackdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 24, 40, 0.58);
    overflow-y: auto;
}

.modal {
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

.modalWide {
    width: min(880px, 100%);
}

.modalExtraWide {
    width: min(1120px, 100%);
}

.modalHeader,
.modalFooter {
    padding: 15px 18px;
    flex: 0 0 auto;
}

.modalHeader {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.modalHeader h2 {
    margin: 0;
    font-size: 20px;
}

.modalHeader p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.modalBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.modalFooter {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.modalFooterSplit {
    justify-content: space-between;
    flex-wrap: wrap;
}

.helpContent section+section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.helpContent h3,
.builderHeader h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.helpContent p,
.helpContent li {
    color: #475467;
    font-size: 13px;
}

.helpContent ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.helpContent li+li {
    margin-top: 5px;
}

.helpGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.helpGrid>div {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
}

.helpGrid code,
.inlineNotice code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #e9edf4;
    color: #1d2939;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
}

.helpGrid span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.formGrid {
    display: grid;
    gap: 12px;
}

.formGrid.twoColumns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 5px;
    color: #475467;
    font-size: 11px;
    font-weight: 700;
}

.builderHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 8px;
}

.khandBuilderRows {
    display: grid;
    gap: 8px;
}

.khandBuilderRow {
    display: grid;
    grid-template-columns: 1.1fr 90px 105px 90px 1.4fr 36px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.inlineNotice {
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
}

.inlineNotice.error {
    border-color: #f1b9b2;
    background: #fff6f5;
    color: var(--danger);
}

.inlineNotice.success {
    border-color: #acd6bf;
    background: #f1fbf5;
    color: var(--success);
}

.jsonEditor {
    width: 100%;
    min-height: 480px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #111827;
    color: #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    tab-size: 2;
}

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

