/* ==========================================================================
   Namelist workspace width
   ========================================================================== */

/*
 * Match the maximum width and horizontal alignment of the ComIn preview
 * workspace. Border-box sizing prevents card padding from increasing the
 * effective page width.
 */
.comin-nl-workspace {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    box-sizing: border-box;
}

.comin-nl-card,
.comin-nl-preview-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   Main card and heading
   ========================================================================== */

.comin-nl-card,
.comin-nl-preview-section {
    border: 1px solid var(--comin-border, #d8e2ef);
    border-radius: 14px;
    background: var(--comin-surface, #ffffff);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.comin-nl-card {
    padding: 24px;
}

.comin-nl-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--comin-border, #d8e2ef);
}

.comin-nl-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    background: #f3edff;
    color: #7c3aed;
    font-size: 1rem;
    font-weight: 800;
}

.comin-nl-header-text h3,
.comin-nl-parameters-header h3,
.comin-nl-help-header h3,
.comin-nl-preview-header h3 {
    margin: 0;
    color: var(--comin-text, #0f2445);
}

.comin-nl-header-text p,
.comin-nl-parameters-header p,
.comin-nl-preview-header p {
    margin: 5px 0 0;
    color: var(--comin-muted, #617493);
    line-height: 1.45;
}

/* ==========================================================================
   Two-column workspace
   ========================================================================== */

.comin-nl-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 28px;
    padding-top: 22px;
}

.comin-nl-form-column {
    min-width: 0;
}

.comin-nl-help-column {
    align-self: start;
    min-width: 0;
    padding: 20px;
    border: 1px solid #d7e4f4;
    border-radius: 12px;
    background: #f8fbff;
}

.comin-nl-help-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comin-nl-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1769e0;
    color: #ffffff;
    font-weight: 800;
}

.comin-nl-help-section {
    padding: 15px 0;
    border-bottom: 1px solid #dce7f3;
}

.comin-nl-help-section h4 {
    margin: 0 0 7px;
    color: #173f79;
    font-size: 0.9rem;
}

.comin-nl-help-section p,
.comin-nl-help-note,
.comin-nl-help-examples {
    color: #45648f;
    font-size: 0.78rem;
    line-height: 1.55;
}

.comin-nl-help-section p {
    margin: 0 0 6px;
}

.comin-nl-help-note {
    margin: 5px 0;
    font-weight: 600;
}

.comin-nl-help-examples {
    margin: 6px 0 0;
    padding-left: 20px;
}

.comin-nl-help-tip {
    margin-top: 18px;
    padding: 13px;
    border: 1px solid #cce0f8;
    border-radius: 9px;
    background: #edf6ff;
    color: #1769e0;
}

.comin-nl-help-tip p {
    margin: 5px 0 0;
    font-size: 0.76rem;
    line-height: 1.45;
}

/* ==========================================================================
   Plugin selection and information
   ========================================================================== */

.comin-nl-field {
    min-width: 0;
    margin-bottom: 16px;
}

.comin-nl-field-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.comin-nl-field-unit {
    color: #64748b;
    font-weight: 700;
}

.comin-nl-dropdown {
    margin: 0;
}

.comin-nl-dropdown .Select-control,
.comin-nl-dropdown .Select__control {
    min-height: 48px;
    border-color: #c9d6e6;
    border-radius: 8px;
    box-shadow: none;
}

.comin-nl-plugin-info {
    margin: 14px 0 20px;
    padding: 15px 16px;
    border: 1px solid #d5e0ed;
    border-radius: 9px;
    background: #f8fafc;
}

.comin-nl-plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #334155;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.75rem;
}

.comin-nl-plugin-description {
    margin: 10px 0 0;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.55;
}

/* ==========================================================================
   Output-format selector
   ========================================================================== */

.comin-nl-format-block {
    margin: 0 0 22px;
}

.comin-nl-format-options {
    display: flex;
    gap: 10px;
}

.comin-nl-format-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 110px;
    padding: 11px 15px;
    border: 1px solid #ccd8e8;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
}

.comin-nl-format-option:has(input:checked) {
    border-color: #1769e0;
    background: #eaf3ff;
    color: #075fd3;
}

.comin-nl-format-radio {
    accent-color: #1769e0;
}

/* ==========================================================================
   Parameter controls
   ========================================================================== */

.comin-nl-parameters-header {
    margin: 8px 0 16px;
}

.comin-nl-parameters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.comin-nl-input {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid #c9d6e6;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
    font-size: 0.88rem;
    outline: none;
}

.comin-nl-input:focus {
    border-color: #1769e0;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.11);
}

.comin-nl-checkbox-field {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid #d7e1ed;
    border-radius: 8px;
    background: #fbfdff;
}

.comin-nl-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 650;
}

.comin-nl-checkbox input {
    accent-color: #1769e0;
}

.comin-nl-parameter-group {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #dce5ef;
}

.comin-nl-parameter-group-title {
    margin: 0 0 14px;
    color: #1e3a5f;
    font-size: 0.9rem;
}

.comin-nl-empty-parameters {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    border: 1px dashed #cbd8e7;
    border-radius: 8px;
    color: #64748b;
}

/* ==========================================================================
   Actions and status
   ========================================================================== */

.comin-nl-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
}

.comin-nl-button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 7px;
    background: #16a34a;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(22, 163, 74, 0.22);
}

.comin-nl-button:hover {
    background: #15803d;
}

.comin-nl-status {
    min-height: 18px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.comin-nl-status--success {
    color: #15803d;
}

.comin-nl-status--warning {
    color: #b91c1c;
}

/* ==========================================================================
   Generated document preview
   ========================================================================== */

.comin-nl-preview-section {
    margin-top: 18px;
    padding: 22px;
}

.comin-nl-preview-section--hidden {
    display: none;
}

.comin-nl-preview-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.comin-nl-preview-header > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f3edff;
    color: #7c3aed;
}

.comin-nl-preview {
    max-height: 520px;
    margin: 0;
    padding: 17px;
    overflow: auto;
    border: 1px solid #d8e2ed;
    border-radius: 9px;
    background: #f8fafc;
    color: #24364f;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* ==========================================================================
   Responsive layout
   ========================================================================== */

@media (max-width: 980px) {
    .comin-nl-top-grid {
        grid-template-columns: 1fr;
    }

    .comin-nl-help-column {
        order: 2;
    }
}

@media (max-width: 680px) {
    .comin-nl-card,
    .comin-nl-preview-section {
        padding: 18px;
    }

    .comin-nl-parameters-grid {
        grid-template-columns: 1fr;
    }

    .comin-nl-format-options,
    .comin-nl-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .comin-nl-button {
        width: 100%;
    }
}

/* ==========================================================================
   Parameter help controls
   ========================================================================== */

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

.comin-nl-parameter-header .comin-nl-field-label {
    margin-bottom: 0;
}

.comin-nl-help-button {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid #b9cde7;
    border-radius: 6px;
    background: #f4f8fd;
    color: #1769e0;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.3;
}

.comin-nl-help-button:hover {
    border-color: #1769e0;
    background: #eaf3ff;
}

.comin-nl-help-empty {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #64748b;
    text-align: center;
}

.comin-nl-help-empty h4 {
    margin: 0 0 7px;
    color: #334155;
}

.comin-nl-help-empty p {
    max-width: 280px;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.55;
}