:root {
    --chemrytnmr-multi-accent: #0b7285;
    --chemrytnmr-multi-accent-soft: #e3f7fb;
    --chemrytnmr-warn: #b45309;
    --chemrytnmr-warn-soft: #fff3d6;
}

.chemrytnmr-mode-card .cnmr-card__body {
    gap: 0.8rem;
    flex: 0 0 auto;
    display: grid;
}

.chemrytnmr-mode-card {
    height: auto;
}

.chemrytnmr-mode-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.9rem 1rem;
}

.chemrytnmr-mode-kicker {
    color: #587087;
}

.chemrytnmr-mode-title {
    margin: 0;
    font-size: 1.02rem;
    color: #16324a;
}

.chemrytnmr-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.65rem;
    align-self: start;
}

.chemrytnmr-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d7e0ea;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.92rem;
    white-space: nowrap;
}

.chemrytnmr-mode-option:has(input:checked) {
    border-color: #8bc8d4;
    background: linear-gradient(180deg, #f0fbfd, #e3f7fb);
    color: #0b5563;
    box-shadow: 0 12px 24px rgba(11, 114, 133, 0.12);
}

.chemrytnmr-mode-option input {
    margin: 0;
}

.chemrytnmr-disclaimer-band {
    display: grid;
    gap: 0.6rem;
}

.chemrytnmr-note,
.chemrytnmr-note-card {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid #d9e4ee;
    background: linear-gradient(180deg, #fbfdff, #f5f9fc);
    color: #375069;
    line-height: 1.45;
    font-size: 0.9rem;
}

.chemrytnmr-note strong {
    display: inline-block;
    margin-right: 0.35rem;
    color: #16324a;
}

.chemrytnmr-note--multi {
    border-color: #f0d39c;
    background: linear-gradient(180deg, #fff9ed, #fff3d6);
    color: #8a4b0f;
}

.chemrytnmr-multi-panel {
    display: grid;
    gap: 0.8rem;
    padding: 0.85rem;
    border: 1px solid #d7e0ea;
    border-radius: 18px;
    background: linear-gradient(180deg, #fcfeff, #f5f9fc);
}

.chemrytnmr-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.chemrytnmr-draft-badge,
.chemrytnmr-inline-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--chemrytnmr-multi-accent-soft);
    color: #0b5563;
    font-size: 0.8rem;
    font-weight: 700;
}

.chemrytnmr-form-grid,
.chemrytnmr-options-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.chemrytnmr-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.cnmr-text-input {
    width: 100%;
    min-height: 42px;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #cdd8e3;
    background: #fbfdff;
    color: #16324a;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 0.92rem;
}

.chemrytnmr-ratio-summary {
    padding: 0.72rem 0.85rem;
    border-radius: 14px;
    border: 1px dashed #b9cadb;
    background: #ffffff;
    color: #375069;
    font-weight: 700;
}

.chemrytnmr-sample-list,
.chemrytnmr-breakdown-list {
    display: grid;
    gap: 0.7rem;
}

.chemrytnmr-sample-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.8rem;
    border-radius: 16px;
    border: 1px solid #d7e0ea;
    background: #ffffff;
}

.chemrytnmr-sample-card.is-selected {
    border-color: #8bc8d4;
    box-shadow: 0 12px 28px rgba(11, 114, 133, 0.12);
}

.chemrytnmr-sample-card.is-disabled {
    opacity: 0.72;
}

.chemrytnmr-sample-top,
.chemrytnmr-sample-meta,
.chemrytnmr-sample-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.chemrytnmr-sample-top {
    justify-content: space-between;
}

.chemrytnmr-structure-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    min-height: 72px;
    padding: 0.25rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #f3f8fc, #eaf1f7);
    color: #16324a;
    overflow: hidden;
}

.chemrytnmr-structure-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 64px;
}

.chemrytnmr-structure-svg svg {
    width: 100%;
    height: 100%;
}

.chemrytnmr-structure-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 64px;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #35506a;
    text-align: center;
    word-break: break-word;
}

.chemrytnmr-sample-title {
    display: grid;
    gap: 0.2rem;
}

.chemrytnmr-sample-title strong {
    font-size: 0.95rem;
    color: #16324a;
}

.chemrytnmr-sample-title span,
.chemrytnmr-meta-pill,
.chemrytnmr-smiles-preview {
    color: #5c7084;
    font-size: 0.84rem;
}

.chemrytnmr-smiles-preview {
    word-break: break-word;
    font-family: "IBM Plex Mono", Consolas, monospace;
}

.chemrytnmr-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.32rem 0.58rem;
    border-radius: 999px;
    background: #f2f6fa;
    border: 1px solid #e0e8ef;
    font-weight: 700;
}

.chemrytnmr-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.62rem 0.78rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #d9e4ee;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
}

.chemrytnmr-check input {
    margin: 0;
}

.chemrytnmr-interpretation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.chemrytnmr-breakdown-item {
    border: 1px solid #d9e4ee;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.chemrytnmr-breakdown-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 0.92rem;
}

.chemrytnmr-breakdown-item summary::-webkit-details-marker {
    display: none;
}

.chemrytnmr-breakdown-body {
    padding: 0 0.9rem 0.9rem;
}

.chemrytnmr-breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.chemrytnmr-breakdown-table th,
.chemrytnmr-breakdown-table td {
    padding: 0.58rem 0.5rem;
    border-bottom: 1px solid #e7eef5;
    text-align: left;
    font-size: 0.85rem;
}

.chemrytnmr-breakdown-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4d657c;
}

.chemrytnmr-warning {
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    border: 1px solid #f0d39c;
    background: var(--chemrytnmr-warn-soft);
    color: #8a4b0f;
    font-weight: 700;
}

.chemrytnmr-empty-state {
    min-height: 140px;
}

.cnmr-shell[data-cnmr-mode="multi"] .chemrytnmr-note--multi:not([hidden]),
.cnmr-shell[data-cnmr-mode="multi"] #cnmr-sample-builder-panel:not([hidden]),
.cnmr-shell[data-cnmr-mode="multi"] #cnmr-sample-list-panel:not([hidden]),
.cnmr-shell[data-cnmr-mode="multi"] #cnmr-spectrum-options-panel:not([hidden]),
.cnmr-shell[data-cnmr-mode="multi"] #cnmr-interpretation-panel:not([hidden]),
.cnmr-shell[data-cnmr-mode="multi"] #cnmr-breakdown-panel:not([hidden]) {
    display: grid;
}

@media (max-width: 1100px) {
    .chemrytnmr-mode-switch,
    .chemrytnmr-panel-head {
        grid-template-columns: 1fr;
    }

    .chemrytnmr-form-grid,
    .chemrytnmr-options-grid,
    .chemrytnmr-interpretation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chemrytnmr-mode-toggle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

@media (max-width: 760px) {
    .chemrytnmr-action-grid,
    .chemrytnmr-form-grid,
    .chemrytnmr-options-grid,
    .chemrytnmr-interpretation-grid {
        grid-template-columns: 1fr;
    }

    .chemrytnmr-mode-toggle {
        grid-template-columns: 1fr;
    }

    .chemrytnmr-mode-option,
    .chemrytnmr-check {
        width: 100%;
    }
}
