:root {
    --bg: #f5f3ee;
    --surface: #ffffff;
    --surface-soft: #eef2ee;
    --ink: #17211d;
    --muted: #68736d;
    --green: #183229;
    --green-soft: #244b3d;
    --gold: #b79a63;
    --line: #d9ded9;
    --danger: #8d2f2f;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    padding: 28px 20px;
    background: var(--green);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #ead9b9;
    font-weight: 800;
    font-size: 22px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 19px;
}

.brand-copy span {
    margin-top: 4px;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .76);
    text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
    background: rgba(255, 255, 255, .11);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    color: rgba(255, 255, 255, .58);
    font-size: 12px;
}

.app-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.topbar {
    min-height: 74px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-title {
    display: flex;
    flex-direction: column;
}

.topbar-title small,
.entity-summary small,
.user-summary small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.entity-summary,
.user-summary {
    display: flex;
    flex-direction: column;
    max-width: 260px;
}

.entity-summary strong,
.user-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.entity-switcher {
    display: flex;
    gap: 8px;
}

.entity-switcher select {
    max-width: 260px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    background: #fff;
}

.small-button,
.text-button {
    border: 0;
    cursor: pointer;
}

.small-button {
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--green);
    color: #fff;
}

.text-button {
    padding: 8px;
    background: transparent;
    color: var(--green);
}

.nav-toggle {
    display: none;
}

.content-area {
    min-width: 0;
    padding: 34px;
}

.page-container {
    min-width: 0;
    max-width: 1180px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1,
.account-heading h1 {
    margin: 8px 0 10px;
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -.035em;
}

.page-intro,
.account-heading p {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.65;
}

.eyebrow {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.eyebrow-light {
    color: #ead9b9;
}

.status-badge {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
}

.hero-panel {
    padding: 34px;
    border-radius: 16px;
    background: var(--green);
    color: #fff;
    box-shadow: 0 18px 50px rgba(24, 50, 41, .12);
}

.hero-panel h2 {
    margin: 8px 0 8px;
    font-size: 28px;
}

.hero-panel p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
}

.card-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.workspace-card {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.workspace-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(20, 36, 30, .08);
}

.card-label {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.workspace-card h3 {
    margin: 10px 0 8px;
}

.workspace-card p,
.empty-state p {
    color: var(--muted);
    line-height: 1.6;
}

.empty-state {
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.primary-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--green);
    font-weight: 700;
}

.app-footer {
    padding: 16px 28px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 12px;
}

.account-body {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at top right, #dfe7df, transparent 38%),
        var(--bg);
}

.account-shell {
    width: min(100%, 560px);
}

.account-brand {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-brand > div:last-child {
    display: flex;
    flex-direction: column;
}

.account-brand span {
    color: var(--muted);
    font-size: 12px;
}

.account-card {
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(25, 47, 39, .10);
}

.account-heading {
    margin-bottom: 26px;
}

.account-heading h1 {
    font-size: 36px;
}

.account-form,
.entity-choice-form {
    display: grid;
    gap: 18px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    font-size: 13px;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 12px 13px;
    background: #fff;
}

.form-field input:focus,
.entity-switcher select:focus {
    outline: 2px solid rgba(183, 154, 99, .28);
    border-color: var(--gold);
}

.primary-button {
    border: 0;
    border-radius: 9px;
    padding: 13px 16px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.form-alert {
    color: var(--danger);
    font-size: 13px;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.form-note,
.account-footer {
    color: var(--muted);
    font-size: 12px;
}

.account-footer {
    text-align: center;
    margin-top: 16px;
}

.entity-choice-list {
    display: grid;
    gap: 10px;
}

.entity-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
}

.entity-choice:has(input:checked) {
    border-color: var(--gold);
    background: #fbf8f1;
}

.entity-choice > span {
    display: flex;
    flex-direction: column;
}

.entity-choice small {
    color: var(--muted);
    margin-top: 4px;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 10;
        inset: 0 auto 0 0;
        width: min(82vw, 280px);
        transform: translateX(-100%);
        transition: transform .18s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .nav-toggle {
        display: block;
        border: 0;
        background: transparent;
        font-size: 24px;
        cursor: pointer;
    }

    .topbar {
        padding: 12px 18px;
    }

    .topbar-actions {
        gap: 10px;
    }

    .user-summary {
        display: none;
    }

    .content-area {
        padding: 24px 18px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .page-heading {
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .account-body {
        padding: 18px;
    }

    .account-card {
        padding: 26px 20px;
    }

    .topbar-actions .entity-summary,
    .entity-switcher {
        display: none;
    }
}


/* === MFQR ADMINISTRATION === */

.page-container-narrow {
    max-width: 920px;
}

.primary-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border-radius: 9px;
    background: var(--green);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.table-panel,
.form-panel,
.info-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.table-panel {
    overflow: hidden;
}

.table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.table-heading h2 {
    margin: 6px 0 0;
}

.table-heading > span {
    color: var(--muted);
    font-size: 12px;
}

.table-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.table-actions {
    text-align: right !important;
}

.table-actions a {
    color: var(--green);
    font-weight: 700;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-pill,
.status-pill {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.role-pill {
    background: #edf2ef;
    color: var(--green);
}

.role-pill-super {
    background: #f6eedf;
    color: #795f2c;
}

.status-pill.is-success {
    background: #e8f2eb;
    color: #275f3e;
}

.status-pill.is-warning {
    background: #fff4d8;
    color: #7a5412;
}

.status-pill.is-muted {
    background: #f1f1ef;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.info-panel {
    margin-top: 18px;
    padding: 20px 22px;
}

.info-panel.compact {
    margin-top: 8px;
}

.info-panel p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.form-panel {
    padding: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.field-note {
    color: var(--muted);
    line-height: 1.5;
}

.role-fieldset {
    margin: 26px 0 0;
    padding: 0;
    border: 0;
}

.role-fieldset legend {
    margin-bottom: 12px;
    font-weight: 800;
}

.role-choice-grid {
    display: grid;
    gap: 10px;
}

.role-choice,
.switch-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.role-choice:has(input:checked),
.switch-choice:has(input:checked) {
    border-color: var(--gold);
    background: #fbf8f1;
}

.role-choice span,
.switch-choice span {
    display: flex;
    flex-direction: column;
}

.role-choice small,
.switch-choice small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}

.form-actions {
    margin-top: 26px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }
}


/* === MFQR RETURN / PERIOD MANAGEMENT === */

.mfqr-context-grid,
.return-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.context-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.context-card strong {
    font-size: 17px;
}

.context-card small {
    color: var(--muted);
}

.mfqr-warning-panel,
.mfqr-success-panel {
    margin: 18px 0;
    padding: 17px 20px;
    border-radius: 12px;
}

.mfqr-warning-panel {
    border: 1px solid #d8bd82;
    background: #fbf7ed;
}

.mfqr-success-panel {
    border: 1px solid #b9d5c1;
    background: #eef7f0;
}

.mfqr-warning-panel p,
.mfqr-success-panel p {
    margin: 7px 0 0;
    line-height: 1.55;
}

.mfqr-period-panel {
    margin-top: 18px;
}

.mfqr-empty-state {
    padding: 34px 24px;
}

.mfqr-empty-state p {
    margin: 8px 0 0;
    color: var(--muted);
}

.return-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 26px 28px;
    border-radius: 14px;
    background: var(--green);
    color: #fff;
}

.return-hero h2 {
    margin: 7px 0;
    font-size: 28px;
}

.return-hero p {
    margin: 0;
    opacity: .85;
}

.return-status-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.return-boundary-panel {
    margin-top: 20px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.return-boundary-panel h2 {
    margin: 8px 0;
}

.return-boundary-panel p {
    max-width: 850px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.stage-badge {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font-size: 12px;
}

.home-card {
    color: inherit;
    text-decoration: none;
}

.home-card:hover {
    border-color: var(--gold);
}

@media (max-width: 760px) {
    .mfqr-context-grid,
    .return-detail-grid {
        grid-template-columns: 1fr;
    }

    .return-hero {
        flex-direction: column;
    }
}


/* === MFQR REGULATORY APPLICABILITY APPROVAL === */

.approval-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.approval-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.approval-card h2 {
    margin: 8px 0 18px;
}

.approval-details {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
}

.approval-details div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
}

.approval-details dt {
    color: var(--muted);
}

.approval-details dd {
    margin: 0;
    font-weight: 600;
}

.approval-note {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.approval-decision-panel {
    margin-top: 18px;
}

.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

@media (max-width: 760px) {
    .approval-summary-grid {
        grid-template-columns: 1fr;
    }

    .approval-details div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* === MFQR EXCEL-STYLE RETURN WORKSPACE === */
.mfqr-workspace { max-width: 1500px; }
.mfqr-workspace-hero { margin-bottom: 12px; }
.mfqr-workspace-meta {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 14px;
}
.mfqr-workspace-meta div { padding: 12px 14px; border-right: 1px solid var(--line); }
.mfqr-workspace-meta div:last-child { border-right: 0; }
.mfqr-workspace-meta span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mfqr-workspace-meta strong { display: block; margin-top: 4px; font-size: 13px; }
.mfqr-section-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    margin: 14px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.mfqr-section-nav a { white-space: nowrap; text-decoration: none; color: inherit; padding: 8px 10px; border-radius: 8px; background: #f6f6f3; font-size: 12px; }
.mfqr-section-nav a:hover, .mfqr-section-nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.mfqr-section-nav span { color: var(--muted); margin-right: 5px; }
.mfqr-state-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 16px; color: var(--muted); font-size: 12px; }
.state-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 4px; }
.state-dot.state-unset { background: #a6a6a0; }
.state-dot.state-blank { background: #b98a36; }
.state-dot.state-value { background: #3a7a50; }
.mfqr-grid-section { margin: 0 0 22px; scroll-margin-top: 80px; }
.mfqr-grid-section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f7f7f4; }
.mfqr-grid-section-heading h2 { margin: 3px 0 0; font-size: 18px; }
.mfqr-grid-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.mfqr-section-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mfqr-grid-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--surface); }
.mfqr-entry-grid { width: 100%; min-width: 1060px; border-collapse: collapse; font-size: 12px; }
.mfqr-entry-grid th, .mfqr-entry-grid td { padding: 8px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.mfqr-entry-grid thead th { position: sticky; top: 0; z-index: 2; background: #efefe9; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.mfqr-entry-grid tbody tr:last-child td { border-bottom: 0; }
.mfqr-entry-grid label { font-weight: 600; }
.mfqr-entry-grid td small { display: block; margin-top: 2px; color: var(--muted); line-height: 1.3; }
.mfqr-code { width: 105px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); }
.mfqr-type { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.mfqr-cell-form { margin: 0; }
.mfqr-editor { width: 100%; min-width: 180px; box-sizing: border-box; padding: 7px 8px; border: 1px solid #cfcfc7; border-radius: 6px; background: #fff; color: inherit; font: inherit; }
.mfqr-editor:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.mfqr-editor:disabled { background: #f1f1ee; color: var(--muted); }
.mfqr-state { display: inline-flex; min-width: 52px; justify-content: center; padding: 4px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.mfqr-state.state-unset { background: #eeeeea; color: #66665f; }
.mfqr-state.state-blank { background: #f6ead2; color: #76561d; }
.mfqr-state.state-value { background: #e5f1e8; color: #275f3e; }
.mfqr-save-status { display: block; max-width: 180px; color: var(--muted); font-size: 11px; line-height: 1.25; }
tr.is-saving .mfqr-save-status { font-weight: 700; }
tr.has-error { background: #fff2f0; }
tr.has-conflict { background: #fff8e7; }
.mfqr-actions-column { width: 140px; }
.mfqr-cell-actions { white-space: nowrap; }
.mfqr-mini-button { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 5px 7px; font-size: 10px; cursor: pointer; }
.mfqr-mini-button:hover:not(:disabled), .mfqr-mini-button:focus-visible { border-color: var(--gold); outline: none; }
.mfqr-mini-button:disabled { opacity: .45; cursor: default; }
.mfqr-occurrence-row th { background: #f5f0e7; color: #5f553f; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mfqr-repeat-note, .mfqr-workspace-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.mfqr-repeat-note { margin: 8px 4px 0; }
.mfqr-workspace-note { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8f8f5; }
@media (max-width: 1100px) { .mfqr-workspace-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mfqr-workspace-meta div:nth-child(3) { border-right: 0; } }
@media (max-width: 760px) { .mfqr-workspace-meta { grid-template-columns: 1fr 1fr; } .mfqr-workspace-meta div { border-bottom: 1px solid var(--line); } .mfqr-grid-section-heading { flex-direction: column; } }


/* MFQR Source Files */
.source-files-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0;
}
.source-upload-panel { grid-column: 1 / -1; }
.source-files-workspace .form-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
}
.source-files-boundary { margin: 18px 0; }
.source-files-table td { vertical-align: top; }
.source-files-table td small,
.source-files-table td code { display: block; margin-top: 5px; }
.source-hash {
    max-width: 280px;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 10px;
}
.source-version-superseded { opacity: .72; }
.source-actions { min-width: 180px; }
.source-actions form { margin: 8px 0; }
.source-adapter-note { max-width: 210px; color: var(--muted); }
.source-replace { margin-top: 8px; }
.source-replace summary { cursor: pointer; font-weight: 700; }
.source-replace form {
    display: grid;
    gap: 8px;
    min-width: 220px;
    padding-top: 8px;
}
.source-replace label { display: grid; gap: 5px; font-size: 12px; }
.source-replace input { max-width: 260px; }
@media (max-width: 900px) {
    .source-files-grid { grid-template-columns: 1fr; }
    .source-upload-panel { grid-column: auto; }
}
