/* ── File Compare scoped styles (built on the index.php theme vars,
      so --surface/--border/--text/--sub carry dark mode for free;
      only the diff highlight colours need their own dark rules) ── */
.fc-pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media(max-width:900px) {
    .fc-pickers {
        grid-template-columns: 1fr;
    }
}

.fc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 12px 14px;
}

.fc-card-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--sub);
    margin-bottom: 8px;
}

.fc-browse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin: 0;
}

.fc-browse:hover {
    background: var(--accent-h);
    border-color: var(--accent-h);
}

.fc-meta {
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--sub);
    word-break: break-all;
}

.fc-meta b {
    color: var(--text);
}

.fc-dirty {
    color: var(--amber-500);
    font-weight: 700;
}

.fc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 14px 0 10px;
}

.fc-toolbar label {
    font-size: 12px;
    color: var(--sub);
    margin: 0 0 0 4px;
    font-weight: 500;
    cursor: pointer;
}

.fc-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 6px;
}

.fc-status {
    margin-left: auto;
    font-size: 12px;
    color: var(--sub);
    font-family: var(--mono);
}

.fc-panes {
    display: grid;
    grid-template-columns: 1fr 58px 1fr;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface);
}

.fc-pane {
    overflow: auto;
    max-height: 540px;
    min-height: 120px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 20px;
}

.fc-gutter {
    /* Same cap as the panes: without it the gutter would grow to the
       full row count and stretch the whole grid row with it. */
    max-height: 540px;
    overflow: hidden;
    background: var(--gray-50);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

html[data-theme="dark"] .fc-gutter {
    background: #0f172a;
}

.fc-row {
    display: flex;
    height: 20px;
    line-height: 20px;
    white-space: pre;
    min-width: 100%;
    width: max-content;
    cursor: default;
}

.fc-ln {
    flex: 0 0 54px;
    padding-right: 8px;
    text-align: right;
    color: var(--gray-400);
    background: var(--gray-50);
    border-right: 1px solid var(--border);
    position: sticky;
    left: 0;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
}

html[data-theme="dark"] .fc-ln {
    background: #0f172a;
}

.fc-tx {
    padding: 0 10px;
    flex: 1 0 auto;
    tab-size: 4;
    -moz-tab-size: 4;
}

.fc-row.t-del {
    background: #fee2e2;
}

.fc-row.t-ins {
    background: #dcfce7;
}

.fc-row.t-chg {
    background: #fef3c7;
}

.fc-row.t-pad {
    background: repeating-linear-gradient(45deg, var(--gray-100) 0 6px, transparent 6px 12px);
}

.fc-row.sel {
    box-shadow: inset 3px 0 0 var(--accent);
}

.fc-row.sel .fc-ln {
    color: var(--accent);
    font-weight: 700;
}

.fc-w {
    background: #fca5a5;
    border-radius: 2px;
}

.fc-row.t-ins .fc-w {
    background: #86efac;
}

html[data-theme="dark"] .fc-row.t-del {
    background: #431a1a;
}

html[data-theme="dark"] .fc-row.t-ins {
    background: #10331f;
}

html[data-theme="dark"] .fc-row.t-chg {
    background: #3b3115;
}

html[data-theme="dark"] .fc-row.t-pad {
    background: repeating-linear-gradient(45deg, #172033 0 6px, transparent 6px 12px);
}

html[data-theme="dark"] .fc-w {
    background: #7f1d1d;
}

html[data-theme="dark"] .fc-row.t-ins .fc-w {
    background: #14532d;
}

/* The theme styles every <button> with padded !important rules,
   so the gutter arrows have to out-shout them or they grow wide
   enough to push the second arrow out of the column. */
.fc-arrow {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    min-width: 0 !important;
    height: 16px !important;
    padding: 0 !important;
    margin: 2px 1px !important;
    gap: 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    border: 1px solid var(--border) !important;
    border-radius: 3px !important;
    background: var(--surface) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.fc-arrow:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.fc-savebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.fc-savebar > div {
    text-align: center;
}

/* Drop states: fc-armed while a file is being dragged over the
   Formator screen, fc-over on the zone under the pointer. */
.fc-drop-hint {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--sub);
}

.fc-card.fc-armed {
    border-style: dashed;
    border-color: var(--blue-400);
}

.fc-card.fc-over {
    border-style: dashed;
    border-color: var(--accent);
    background: var(--blue-50);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .28);
}

html[data-theme="dark"] .fc-card.fc-over {
    background: #16233a;
}

.fc-pane.fc-armed {
    outline: 1px dashed var(--blue-400);
    outline-offset: -2px;
}

.fc-pane.fc-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}

/* Text entry: the pane itself becomes the editor, so both sides
   stay exactly where the diff will appear. */
/* While the editors are up the panes lose their diff-view height
   cap, otherwise a taller textarea would just scroll inside the
   pane and you would be looking at two scrollbars. */
.fc-panes.fc-editing .fc-pane,
.fc-panes.fc-editing .fc-gutter {
    max-height: none;
    overflow: hidden;
}

.fc-edit {
    display: block;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    margin: 0;
    padding: 8px 10px;
    border: none;
    outline: none;
    resize: none;
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 20px;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
    -moz-tab-size: 4;
}

.fc-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--sub);
    font-family: var(--sans);
    font-size: 13px;
}
