/* Text Diff Checker (/text-diff-checker): only what is the app's own. Panels, tiles, fields, buttons and colours come
   from the app kit (css/app-kit, docs/app-kit.md); its tokens (var(--ak-success), var(--ak-danger) ...) colour the
   removed and added lines here. Loaded only on this app's page (StylePaths in its demo catalog entry). */

.tdc-landing-app {
    --tdc-del: color-mix(in srgb, var(--ak-danger) 11%, transparent);
    --tdc-del-mark: color-mix(in srgb, var(--ak-danger) 30%, transparent);
    --tdc-ins: color-mix(in srgb, var(--ak-success) 12%, transparent);
    --tdc-ins-mark: color-mix(in srgb, var(--ak-success) 32%, transparent);
    --tdc-void: color-mix(in srgb, var(--ak-muted) 7%, transparent);
}

/* --- The two texts ---------------------------------------------------------------------------------------------- */

.tdc-landing-app .tdc-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ak-space-3);
}

.tdc-landing-app .tdc-pane {
    display: flex;
    flex-direction: column;
    gap: var(--ak-space-2);
    min-width: 0;
}

.tdc-landing-app .tdc-pane-head {
    display: flex;
    align-items: center;
    gap: var(--ak-space-2);
    min-height: 2rem;
    min-width: 0;
}

.tdc-landing-app .tdc-pane-label {
    flex: none;
    color: var(--ak-text);
    font-size: var(--ak-fs-sm);
    font-weight: 700;
}

.tdc-landing-app .tdc-file-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tdc-landing-app .tdc-open {
    margin-inline-start: auto;
}

.tdc-landing-app textarea.tdc-editor {
    min-height: 10rem;
    height: 13rem;
    line-height: 1.45;
}

.tdc-landing-app .tdc-file-msg {
    grid-column: 1 / -1;
}

/* --- The differences -------------------------------------------------------------------------------------------- */

.tdc-landing-app .tdc-diff-head {
    justify-content: space-between;
}

.tdc-landing-app .tdc-nav {
    display: inline-flex;
    align-items: center;
    gap: var(--ak-space-1);
}

.tdc-landing-app .tdc-pos {
    min-width: 4.5em;
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.tdc-landing-app .tdc-status:not(.ak-message--success) > .ak-icon {
    display: none;
}

.tdc-landing-app .tdc-out {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    background: var(--ak-field);
    transition: opacity 0.15s;
}

.tdc-landing-app .tdc-out:empty {
    display: none;
}

.tdc-landing-app .tdc-out.is-busy {
    opacity: 0.55;
}

.tdc-landing-app .tdc-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: var(--ak-text);
    font-family: var(--ak-font-mono);
    font-size: var(--ak-fs-sm);
    line-height: 1.45;
}

.tdc-landing-app .tdc-col-num { width: 3.4em; }
.tdc-landing-app .tdc-col-sign { width: 1.6em; }

.tdc-landing-app .tdc-table td {
    padding: 0.05rem 0.5rem;
    vertical-align: top;
}

.tdc-landing-app .tdc-num {
    padding-inline: 0.3rem 0.45rem;
    color: var(--ak-muted);
    text-align: end;
    font-variant-numeric: tabular-nums;
    user-select: none;
    opacity: 0.8;
}

.tdc-landing-app .tdc-sign {
    padding-inline: 0;
    color: var(--ak-muted);
    font-weight: 700;
    text-align: center;
    user-select: none;
}

.tdc-landing-app .tdc-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
    text-align: start;
}

/* Side by side: a line between the halves. */
.tdc-landing-app .tdc-table--split td:nth-child(3) {
    border-inline-start: 1px solid var(--ak-border);
}

.tdc-landing-app .tdc-void {
    background: repeating-linear-gradient(-45deg, var(--tdc-void) 0 6px, transparent 6px 12px);
}

/* Removed and added lines. Side by side, a changed line is red on the left and green on the right. */
.tdc-landing-app .tdc-row--del > td,
.tdc-landing-app .tdc-table--split .tdc-row--chg > td:nth-child(-n + 2) {
    background-color: var(--tdc-del);
}

.tdc-landing-app .tdc-row--ins > td,
.tdc-landing-app .tdc-table--split .tdc-row--chg > td:nth-child(n + 3) {
    background-color: var(--tdc-ins);
}

.tdc-landing-app .tdc-table--split .tdc-row--del > td:nth-child(n + 3),
.tdc-landing-app .tdc-table--split .tdc-row--ins > td:nth-child(-n + 2) {
    background-color: transparent;
}

.tdc-landing-app .tdc-row--del .tdc-sign { color: var(--ak-danger); }
.tdc-landing-app .tdc-row--ins .tdc-sign { color: var(--ak-success); }

.tdc-landing-app .tdc-row--blank > td {
    color: var(--ak-muted);
}

.tdc-landing-app .tdc-mark {
    border-radius: 2px;
    color: inherit;
    text-decoration: none;
}

.tdc-landing-app del.tdc-mark { background: var(--tdc-del-mark); }
.tdc-landing-app ins.tdc-mark { background: var(--tdc-ins-mark); }

/* The change the arrows jumped to. */
.tdc-landing-app .tdc-row.is-current > td:first-child {
    box-shadow: inset 3px 0 0 var(--ak-accent);
}

.tdc-landing-app[dir="rtl"] .tdc-row.is-current > td:first-child,
[dir="rtl"] .tdc-landing-app .tdc-row.is-current > td:first-child {
    box-shadow: inset -3px 0 0 var(--ak-accent);
}

.tdc-landing-app .tdc-row.is-current > td.tdc-num {
    color: var(--ak-accent);
    font-weight: 700;
    opacity: 1;
}

/* --- Phones ----------------------------------------------------------------------------------------------------- */

@media (max-width: 720px) {
    .tdc-landing-app .tdc-inputs {
        grid-template-columns: minmax(0, 1fr);
    }

    .tdc-landing-app textarea.tdc-editor {
        height: 9rem;
    }

    .tdc-landing-app .tdc-col-num { width: 2.4em; }

    .tdc-landing-app .tdc-table td {
        padding-inline: 0.25rem;
    }

    .tdc-landing-app .tdc-table {
        font-size: var(--ak-fs-xs, 0.75rem);
    }
}
