/* Viewing, changing and deleting what was entered or imported by hand (2026-11-05): the transaction popup's entry section
   (where it came from, a recurring payment's pair) and loan entry picker, the Recurring tab's Pays down / Moves to, the
   Activity grid's Source column, the investment activity sheet, and the manual transaction popup's clickable recent
   activity. Every color is a token (--tx-* from transaction-popups.css, --iv-* from investments-area.css), each with its
   dark value, so both themes follow. */

/* ---- Transaction popup: the entry section ---- */
.txp-entry {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.txp-entry-origin {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--tx-muted);
    font-size: 13px;
    line-height: 1.45;
}

.txp-entry-glyph {
    flex: none;
    margin-top: 2px;
    color: var(--tx-primary);
}

.txp-entry-pair {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--tx-tile-border);
    border-radius: 14px;
    background: var(--tx-tile-bg);
}

.txp-entry-pair-chip {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--tx-surface);
    color: var(--tx-primary);
    font-size: 13px;
}

.txp-entry-pair-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.txp-entry-pair-title {
    color: var(--tx-text);
    font-family: var(--tx-font);
    font-size: 13.5px;
    font-weight: 600;
}

.txp-entry-pair-detail {
    color: var(--tx-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.txp-entry-pair-note {
    color: var(--tx-caution);
    font-size: 12px;
    line-height: 1.45;
}

/* ---- Transaction popup: Payment / Interest / Fee / Advance in place of the Expense / Income switch ---- */
.txp-loan-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.txp-loan-hint {
    margin: 0;
    color: var(--tx-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* ---- Recurring tab: Pays down / Moves to ---- */
.rse-pair-note {
    color: var(--tx-caution);
}

/* ---- Activity grid: the Source column ---- */
.iva-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--iv-icon-bg);
    color: var(--iv-text);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.iva-source-manual,
.iva-source-imported {
    background: var(--iv-accent-soft);
    color: var(--iv-accent);
}

.iva-source-plaid {
    background: transparent;
    color: var(--iv-muted);
}

.iva-grid .e-row {
    cursor: pointer;
}

/* ---- The investment activity sheet (on RulesSheet) ---- */

/* Over the manual transaction popup's dialog too; a confirmation asked over it still sits on top (investments-rules.css). */
.ivr-scrim:has(+ .ivr-sheet.ias-sheet) { z-index: 1249; }
.ivr-sheet.ias-sheet { z-index: 1250; }

.ias-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ias-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ias-facts {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 4px 14px;
    border: 1px solid var(--iv-tile-border);
    border-radius: 14px;
}

.ias-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--iv-tile-border);
}

.ias-fact:last-child {
    border-bottom: 0;
}

.ias-fact dt {
    color: var(--iv-muted);
    font-size: 12.5px;
    font-weight: 500;
}

.ias-fact dd {
    margin: 0;
    color: var(--iv-text);
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.ias-fieldset {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ias-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ias-short {
    max-width: 240px;
}

.ias-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.ias-check .form-check-input {
    flex: none;
    margin-top: 3px;
}

.ias-check-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ias-check-title {
    color: var(--iv-text);
    font-size: 13.5px;
    font-weight: 600;
}

.ias-locked {
    margin: 0;
}

.ias-delete {
    margin-right: auto;
}

@media (max-width: 575.98px) {
    .ias-pair { grid-template-columns: minmax(0, 1fr); }
    .ias-short { max-width: none; }
    .ias-foot-actions { flex-wrap: wrap; }
    .ias-foot-actions > .ias-delete { flex: 1 1 100%; margin-right: 0; }
}

/* ---- Manual transaction popup: a recent activity opens the sheet ---- */
.mtx-invest-row:has(.mtx-invest-open) {
    grid-template-columns: minmax(0, 1fr) auto;
}

.mtx-invest-open {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.mtx-invest-open:not(:disabled):hover {
    background: var(--tx-surface);
}

.mtx-invest-open:focus-visible {
    outline: 2px solid var(--tx-primary);
    outline-offset: 2px;
}

.mtx-invest-open:disabled {
    cursor: default;
}

/* ---- Finding it (2026-11-06): the one-line hints, the clickable trades, the manual form's link ---- */

/* "Click a Manual or Imported row to change or delete it." above the Activity grid and Recent trades. */
.iva-edit-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--iv-muted);
    font-size: 13px;
}

.iva-edit-hint i,
.iva-edit-hint svg {
    color: var(--iv-accent);
    font-size: 11px;
}

/* Securities > Recent trades: a row opens the activity sheet. */
.ivs-trade-row {
    cursor: pointer;
}

.ivs-trade-row:hover td {
    background: var(--iv-accent-soft);
}

.ivs-trade-row:focus-visible {
    outline: 2px solid var(--iv-accent);
    outline-offset: -2px;
}

/* The manual transaction popup's investment form. */
.mtx-invest-hint {
    margin: -4px 0 0;
    color: var(--tx-muted);
    font-size: 12.5px;
}

.mtx-invest-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--tx-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.mtx-invest-note i,
.mtx-invest-note svg {
    margin-top: 2px;
    color: var(--tx-primary);
}

.mtx-invest-all {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 2px 2px;
    border: 0;
    background: transparent;
    color: var(--tx-primary);
    font-family: var(--tx-font);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.mtx-invest-all:hover:not(:disabled) {
    text-decoration: underline;
}

.mtx-invest-all:focus-visible {
    outline: 2px solid var(--tx-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.mtx-invest-all:disabled {
    opacity: 0.55;
    cursor: default;
}
