/* Traffic overview + one dashboard per operation. Built from the shared blocks (x-card, x-tiles, x-table) and CML OS's
   variables, so every design themes it; colour only on data (the subs area, a status dot), never on chrome. */
.tr-none { color: var(--faint) !important; font: 500 14px/1.4 var(--font) !important; letter-spacing: 0 !important; }
.tr-note { margin: 6px 0 2px; font-size: 13px; }
.tr-foot { margin: 0; font-size: 12.5px; color: var(--faint); }

/* overview: one card per operation */
.tr-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--x-gap, 20px); }
a.tr-op { display: grid; gap: 10px; align-content: start; color: inherit; text-decoration: none; transition: border-color .15s ease; }
a.tr-op:hover { border-color: var(--line-strong); }
a.tr-op:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tr-op-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tr-op-h h3 { margin: 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: var(--x-h3, 600 15px/1.3 var(--font)); }
.tr-plat { margin: -8px 0 0; color: var(--faint); font-size: 12.5px; }
.tr-st { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tr-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.tr-st.tr-ok::before { background: var(--x-good, #2F855A); }
.tr-st.tr-bad { color: var(--bad); }
.tr-st.tr-bad::before { background: var(--bad); }
.tr-nums { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tr-nums > div { display: grid; gap: 1px; min-width: 0; }
.tr-nums b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-nums b.tr-none { font-size: 12.5px !important; line-height: 27px !important; }
.tr-nums span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-nums small { display: none; }
.tr-why { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.tr-quiet { margin: 0; line-height: 1.7; }
.tr-quiet a { color: var(--fg); }
.tr-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transform: translateY(-1px); }
.tr-dot.ok { background: var(--x-good, #2F855A); }
.tr-dot.warn { background: color-mix(in srgb, var(--bad) 55%, var(--faint)); }
.tr-dot.bad { background: var(--bad); }

/* one operation */
.tr-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--x-gap, 20px); align-items: start; }
.tr-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--x-gap, 20px); align-items: start; }
@media (max-width: 1700px) { .tr-three { grid-template-columns: 1fr 1fr; } .tr-three > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .tr-two, .tr-three { grid-template-columns: 1fr; } }
.tr-chart { margin: 0 0 14px; }
.tr-chart:last-child { margin-bottom: 0; }
.tr-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.tr-chart figcaption em { font-style: normal; font-size: 12px; color: var(--faint); font-family: var(--x-mono, inherit); }
.tr-plot { position: relative; height: 112px; cursor: crosshair; }
.tr-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tr-area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
.tr-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-bar { fill: color-mix(in srgb, var(--fg) 32%, transparent); }
.tr-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.tr-base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tr-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-strong); pointer-events: none; }
.tr-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 4px 9px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 12px; white-space: nowrap; pointer-events: none; }
.tr-tip b { font-weight: 700; }
.tr-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--faint); font-family: var(--x-mono, inherit); }
.tr-status { display: grid; gap: 9px; }
.tr-srow { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 12px; font-size: 13.5px; }
.tr-srow span { color: var(--muted); }
.tr-srow i { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.tr-srow i b { display: block; height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--fg) 38%, transparent); }
.tr-srow.bad i b { background: var(--bad); }
.tr-srow em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--x-mono, inherit); }
.tr-sub { margin: 18px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tr-row { display: flex; align-items: baseline; gap: 10px; min-height: 38px; padding: 9px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13.5px; }
.x-card-h + .tr-row, .tr-sub + .tr-row { border-top: 0; }
.tr-row b { flex: none; font-weight: 600; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-row span { flex: 1; min-width: 0; color: var(--muted); }
.tr-row time { flex: none; color: var(--faint); font-size: 12.5px; font-family: var(--x-mono, inherit); }
a.tr-row:hover span { color: var(--fg); }
.tr-att span { color: var(--fg); }
@media (max-width: 600px) { .tr-srow { grid-template-columns: 92px 1fr 44px; } }

/* editing: values you can change look like quiet buttons; the editor sits in the cell */
.tr-manage-btn { font-size: 13px; }
.tr-prev .tr-row b { max-width: 40%; }
.tr-even { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)) !important; }
.tr-mtop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-mtop input[type=search] { flex: 1 1 200px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--fg); }
.tr-mtable td { padding: 6px 10px; }
.tr-cell { max-width: 260px; padding: 4px 8px; margin: -4px -8px; border: 1px dashed transparent; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tr-cell:hover, .tr-cell:focus-visible { border-color: var(--line-strong); background: var(--hover); }
.tr-cell { text-decoration: underline dotted var(--line-strong); text-underline-offset: 4px; }
.tr-ed { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-ed select, .tr-ed input, .tr-ed textarea { min-width: 140px; height: 32px; padding: 0 8px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--panel); color: var(--fg); font: inherit; }
.tr-ed textarea { height: auto; padding: 6px 8px; min-width: 220px; }
.tr-ed .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.tr-when { color: var(--faint); font-size: 12px; white-space: nowrap; }
dialog.tr-manage .x-drawer-body { gap: 14px; }

/* Assign operations: one row per link name, grouped by how names start; a sticky footer with the one Save button */
.tr-afilters select, .tr-atable select { height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--fg); font: inherit; font-size: 13px; max-width: 200px; }
.tr-afilters .x-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.tr-atable td { padding: 7px 10px; vertical-align: middle; }
.tr-atable td:first-child { width: 28px; padding-right: 0; }
.tr-atable td b { font-weight: 600; overflow-wrap: break-word; }
.tr-atable td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: break-word; }
.tr-atable .tr-warnline { color: var(--bad); }
.tr-atable input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.tr-atable tr.tr-on td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tr-ag td { border-top: 1px solid var(--line-strong); }
.tr-achild td:nth-child(2) { padding-left: 26px; }
.tr-atog { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tr-atog::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.tr-atog[aria-expanded=true]::before { content: '▾'; }
.tr-atog span { color: var(--muted); font-size: 12.5px; }
.tr-conf { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 12px; white-space: nowrap; }
.tr-conf.tr-sure { background: color-mix(in srgb, var(--x-good, #2F855A) 16%, transparent); color: inherit; }
.tr-conf.tr-likely { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; }
.tr-batch { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.tr-afoot { position: sticky; bottom: -1px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 -4px; padding: 12px 4px; border-top: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.tr-afoot > .btn.primary { margin-left: auto; }
.tr-afoot progress { flex: 1 1 160px; height: 8px; accent-color: var(--accent); }
.tr-sum { display: grid; gap: 4px; margin: 8px 0 4px; padding: 0; list-style: none; font-size: 13.5px; }
.tr-sum li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tr-sum b { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .tr-atable th:nth-child(3), .tr-atable td:nth-child(3), .tr-atable th:nth-child(4), .tr-atable td:nth-child(4) { display: none; } .tr-atable select { max-width: 140px; } }
.tr-conf.tr-left { background: none; border: 1px dashed var(--line-strong); }
.tr-old { margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 12px; }
.tr-old > summary { cursor: pointer; padding: 8px 0; font-size: 13px; color: var(--muted); }
.tr-old[open] > summary { color: var(--fg); }

/* Overview: hidden operations, and Edit overview's switches */
.tr-hidden { margin: 2px 0 0; font-size: 13px; }
.tr-hidden .link { font-size: 13px; }
.tr-switches { display: grid; gap: 2px; }
.tr-switch { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tr-switch span { display: grid; font-size: 14px; }
.tr-switch small { color: var(--muted); font-size: 12px; }
.tr-switch input { appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.tr-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.tr-switch input:checked { background: var(--accent); }
.tr-switch input:checked::after { transform: translateX(14px); }
.tr-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
