/* Changes view — the "what changed" strip above the tree and the detail
   modal (changes.js). The modal reuses the route-modal shell classes
   from modals.css; everything here is the strip and the modal body. */

.changes-strip {
    padding: 10px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.changes-strip[hidden] { display: none; }
.changes-strip-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}
.changes-title {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}
.changes-since-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.changes-since-btn,
.changes-chip,
.changes-tab,
.changes-action {
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--fg);
    cursor: pointer;
}
.changes-since-btn:hover,
.changes-chip:not(:disabled):hover,
.changes-tab:not(:disabled):hover,
.changes-action:not(:disabled):hover {
    border-color: var(--accent);
}
.changes-since-btn.active,
.changes-tab[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.changes-since-select {
    font: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--fg);
    max-width: 150px;
}
.changes-since-btn:focus-visible,
.changes-chip:focus-visible,
.changes-tab:focus-visible,
.changes-action:focus-visible,
.changes-since-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.changes-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.changes-chip {
    font-variant-numeric: tabular-nums;
}
.changes-chip.is-zero {
    color: var(--muted);
    background: var(--bg);
    cursor: default;
}
.changes-chip.is-up { color: #1e7f4f; border-color: #b7dfc8; }
.changes-chip.is-down { color: var(--rejected); border-color: #f0c2bc; }
.changes-note {
    color: var(--muted);
    font-size: 12px;
}
.changes-note.is-error { color: var(--rejected); }

/* Modal body */
.changes-modal { max-width: 1000px; }
.changes-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 16px;
    overflow: hidden;
    min-height: 0;
}
.changes-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.changes-tab:disabled {
    color: var(--muted);
    background: var(--bg);
    cursor: default;
}
.changes-table-wrap {
    overflow: auto;
    max-height: 55vh;
    border: 1px solid var(--line);
    border-radius: 6px;
}
.changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.changes-table thead th {
    position: sticky;
    top: 0;
    background: var(--accent-soft);
    color: var(--accent);
    text-align: left;
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
}
.changes-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.changes-table tbody tr:nth-child(even) td { background: var(--zebra); }
.changes-table .changes-pfx code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}
/* "By first hop" / "By origin AS" summary line above the table */
.changes-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.changes-groups-label,
.changes-groups-note {
    color: var(--muted);
}
.changes-group-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35em;
    max-width: 100%;
}
.changes-group-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.changes-group-chip.active .changes-as-name { color: inherit; opacity: 0.85; }
.changes-group-chip .changes-as-name {
    display: inline-block;
    max-width: 14em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.changes-group-count { font-variant-numeric: tabular-nums; }

/* "AS16509 Amazon": keep a hop together, mute the name */
.changes-as { white-space: nowrap; }
.changes-as-name { color: var(--muted); }

.changes-empty,
.changes-truncated {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}
.changes-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.changes-foot-note {
    color: var(--muted);
    font-size: 12px;
}
.changes-action {
    border-radius: 6px;
    padding: 6px 14px;
}
.changes-action-primary:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.changes-action:disabled {
    color: var(--muted);
    cursor: default;
}

/* Tree decorations (tree-view.js) */
.col-delta {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    vertical-align: 1px;
}
.col-delta.is-up { color: #1e7f4f; }
.col-delta.is-down { color: var(--rejected); }
.col-rejected .col-delta.is-up { color: var(--rejected); }
.col-rejected .col-delta.is-down { color: #1e7f4f; }
.changes-cell {
    display: inline-flex;
    gap: 10px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.changes-cell b { color: var(--fg); font-weight: 600; }
.changes-cell .chg-acc.is-up b { color: #1e7f4f; }
.changes-cell .chg-acc.is-down b { color: var(--rejected); }
.changes-cell .chg-rej.is-up b { color: var(--rejected); }
.changes-cell .chg-rej.is-down b { color: #1e7f4f; }
