:root {
    --rg-accent: #10b981;
    --rg-navy: #1e2a4a;
    --rg-border: #d1d5db;
}

/* .ic-wrap box model (max-width/padding/margin) is owned centrally by
   dev-tool.css's ".dev-tool-widget .ic-wrap" rule — not redefined here
   to avoid the two paddings stacking and misaligning tool content. */

.ic-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
    line-height: 1.6;
}

/* ==== ACTION BAR ==== */
.ic-actionbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ic-btn {
    background: var(--rg-navy);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ic-btn:hover {
    background: #16213e;
}

.ic-btn-outline {
    background: #fff;
    color: var(--rg-navy);
    border: 1px solid var(--rg-border);
}

.ic-btn-outline:hover {
    border-color: var(--rg-navy);
    background: #f9fafb;
}

/* ==== Layout: options left, output right ==== */
.rg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--rg-border);
    border-radius: 10px;
    overflow: hidden;
}

.rg-options {
    background: #fff;
    border-right: 1px solid var(--rg-border);
    padding: 18px 20px;
    overflow-y: auto;
    max-height: 640px;
}

.rg-group {
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f3;
}

.rg-group:last-child {
    border-bottom: none;
}

.rg-group-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--rg-navy);
    margin-bottom: 10px;
}

.rg-group > label:not(.rg-check) {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--rg-navy);
    margin-bottom: 6px;
}

.rg-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--rg-navy);
    cursor: pointer;
    line-height: 1.4;
    padding: 5px 0;
}

.rg-check input[type="checkbox"] {
    accent-color: var(--rg-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
}

.rg-check em {
    font-style: normal;
    color: #6b7280;
    font-weight: 500;
}

.rg-select-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--rg-navy);
    margin-bottom: 6px;
}

.rg-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--rg-border);
    border-radius: 7px;
    padding: 9px 10px;
    font-size: 13px;
    color: var(--rg-navy);
    background: #fff;
    margin-top: 6px;
}

.rg-select:focus {
    outline: none;
    border-color: var(--rg-accent);
}

.rg-subfield {
    margin-top: 10px;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rg-subfield label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.rg-text-input,
.rg-textarea-small {
    box-sizing: border-box;
    border: 1px solid var(--rg-border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: var(--rg-navy);
    width: 100%;
}

.rg-textarea-small {
    min-height: 70px;
    resize: vertical;
}

.rg-text-input:focus,
.rg-textarea-small:focus {
    outline: none;
    border-color: var(--rg-accent);
}

.hg-small-input {
    width: 90px;
}

/* ==== Output panel ==== */
.rg-panel {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid var(--rg-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--rg-navy);
}

.rg-copy-btn {
    background: none;
    border: 1px solid var(--rg-border);
    color: var(--rg-navy);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rg-copy-btn:hover {
    background: var(--rg-accent);
    border-color: var(--rg-accent);
    color: #fff;
}

.rg-copy-btn.rg-copied {
    background: var(--rg-accent);
    border-color: var(--rg-accent);
    color: #fff;
}

.rg-textarea {
    flex: 1;
    min-height: 380px;
    border: none;
    resize: vertical;
    padding: 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--rg-navy);
    background: #f9fafb;
}

.rg-textarea:focus {
    outline: none;
}

@media (max-width: 720px) {
    .rg-layout {
        grid-template-columns: 1fr;
    }

    .rg-options {
        border-right: none;
        border-bottom: 1px solid var(--rg-border);
        max-height: none;
    }

    .rg-textarea {
        min-height: 280px;
    }

    .ic-actionbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ic-actionbar .ic-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
