.tx-main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.tx-sub { font-weight: 500; color: var(--text-dim); font-size: .8em; margin-left: 4px; }
.tx-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 12px; }
.tx-nav a { padding: 6px 12px; border-radius: 8px; color: var(--text-dim); text-decoration: none; font-weight: 600; }
.tx-nav a:hover { background: var(--row-hover); }
.tx-nav a.active { background: var(--accent); color: #fff; }
.tx-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 14px; }
.tx-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.tx-filters select, .tx-filters input { min-width: 140px; }
.tx-team { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.tx-team img { width: 26px; height: 26px; object-fit: contain; }
.tx-team:hover span { color: var(--accent); text-decoration: underline; }
.tx-bar { position: relative; background: var(--row-hover); border-radius: 6px; height: 22px; min-width: 110px; overflow: hidden; }
.tx-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .85; }
.tx-bar > b { position: relative; padding-left: 8px; font-size: 12px; line-height: 22px; color: var(--text); }
.tx-names { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.tx-names .gone { color: var(--bad); }
.tx-names .new { color: var(--good); }
.tx-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-dim); margin-left: 4px; white-space: nowrap; }
.tx-tag.warn { color: var(--bad); border-color: var(--bad); }
.tx-tag.ok { color: var(--good); border-color: var(--good); }
.tx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.tx-col h4 { margin: 8px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.tx-col ul { list-style: none; margin: 0; padding: 0; }
.tx-col li { padding: 3px 0; font-size: 13px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.tx-col li.gone .nm { color: var(--bad); }
.tx-col li.new .nm { color: var(--good); }
.tx-col h4.h-gone { color: var(--bad); }
.tx-col h4.h-new { color: var(--good); }
.tx-col a.nm { color: inherit; text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
.tx-col a.nm::after { content: " ›"; font-weight: 700; opacity: .55; }
.tx-col a.nm:hover { text-decoration-style: solid; }
.tx-col a.nm:hover::after { opacity: 1; }
.tx-col li .acts { margin-left: auto; display: flex; gap: 4px; }
.tx-mini { font-size: 11px; padding: 1px 7px; border: 1px solid var(--border); background: var(--bg-elev2, var(--bg-elev)); color: var(--text-dim); border-radius: 6px; cursor: pointer; }
.tx-mini:hover { color: var(--accent); border-color: var(--accent); }
.tx-star { cursor: pointer; font-size: 18px; color: var(--text-dim); background: none; border: none; }
.tx-star.on { color: #e8a82c; }
.tx-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 14px; align-items: end; }
.tx-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.tx-form textarea, textarea.tx-ta { width: 100%; min-height: 130px; font-family: ui-monospace, monospace; font-size: 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.tx-msg { padding: 8px 14px; font-size: 13px; }
.tx-msg.err { color: var(--bad); }
.tx-msg.ok { color: var(--good); }
.tx-hero { padding: 24px 18px; text-align: center; }
.tx-hero h1 { margin: 0 0 6px; }
.tx-note { font-size: 12px; color: var(--text-dim); padding: 0 14px 12px; }
.tx-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.tx-checks label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); font-size: 13px; }
.tx-scroll { overflow-x: auto; }
@media (max-width: 720px) { .tx-main { padding: 8px; } .tx-nav { margin-left: 0; } }
.tx-main { display: block; width: 100%; }
.tx-scroll table th, .tx-scroll table td { text-align: left; vertical-align: top; }
.tx-scroll td.tx-names { min-width: 140px; max-width: 260px; white-space: normal; }
.tx-main a { color: var(--accent); }

.tx-cmp { table-layout: fixed; }
.tx-cmp td, .tx-cmp th { white-space: normal; word-break: break-word; }
.tx-cmp .tx-bar { min-width: 0; }
.tx-filters .tx-checks, .tx-form .tx-checks { gap: 4px 14px; }
.tx-filters .tx-checks label, .tx-form .tx-checks label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; width: auto; min-width: 0; color: var(--text); font-size: 13px; }
.tx-checks input[type=checkbox] { width: auto; min-width: 0; margin: 0; }
.tx-grid { margin-top: 16px; }
.tx-grid > .card, .tx-grid > .card + .card { margin-top: 0; }
.tx-later { opacity: .8; }
.tx-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tx-sortable:hover { color: var(--accent); }
.tx-arrow { color: var(--accent); }
.tx-exp { position: relative; display: inline-block; width: 46px; height: 16px; border-radius: 8px; background: var(--row-hover); overflow: hidden; margin-left: auto; flex: none; cursor: help; }
.tx-exp i { position: absolute; inset: 0 auto 0 0; opacity: .55; background: var(--text-dim); }
.tx-exp.ok i { background: var(--good); }
.tx-exp.warn i { background: var(--bad); }
.tx-exp b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; color: var(--text); }
.tx-col li { flex-wrap: nowrap; }
.tx-col li .tx-names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tx-suggest { position: relative; max-width: 520px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; max-height: 280px; overflow-y: auto; z-index: 20; }
.tx-sug-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; }
.tx-sug-item:last-child { border-bottom: 0; }
.tx-sug-item:hover { background: var(--row-hover); }

/* Use the full window width (cap very large monitors) */
.tx-main { max-width: 1840px; }

/* Find schools table: pinned columns, visible scrollbar, edge shadow + hint when more is off-screen */
.tx-scrollwrap { position: relative; }
.tx-scrollwrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 14px; width: 34px; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.16)); }
.tx-scrollwrap.can-right::after { opacity: 1; }
.tx-scroll { scrollbar-width: auto; scrollbar-color: var(--text-dim) var(--row-hover); }
.tx-scroll::-webkit-scrollbar { height: 14px; }
.tx-scroll::-webkit-scrollbar-track { background: var(--row-hover); }
.tx-scroll::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 7px; border: 3px solid var(--row-hover); }
.tx-scrollhint { font-size: 12px; color: var(--accent); font-weight: 600; text-align: right; padding: 4px 14px; }
#tx-table th:nth-child(1), #tx-table td:nth-child(1) { position: sticky; left: 0; z-index: 3; background: var(--bg-elev); min-width: 44px; }
#tx-table th:nth-child(2), #tx-table td:nth-child(2) { position: sticky; left: 44px; z-index: 3; background: var(--bg-elev); min-width: 190px; }
#tx-table thead th:nth-child(1), #tx-table thead th:nth-child(2) { background: var(--bg-elev2); z-index: 4; }
.tx-scrollwrap.scrolled #tx-table th:nth-child(2), .tx-scrollwrap.scrolled #tx-table td:nth-child(2) { box-shadow: 6px 0 8px -6px rgba(0,0,0,.35); }
#tx-table th, #tx-table td { padding-left: 9px; padding-right: 9px; }

/* Last six columns (spots taken, returning experience, system, cost, grad rate, RPI): centered, with headers that wrap
   onto two lines instead of forcing the column wider than its data. */
#tx-table th:nth-last-child(-n+6), #tx-table td:nth-last-child(-n+6) { text-align: center; }
#tx-table th:nth-last-child(-n+6) { white-space: normal; line-height: 1.25; vertical-align: middle; padding-left: 6px; padding-right: 6px; }
#tx-table th:nth-last-child(6) { width: 64px; }   /* spots taken */
#tx-table th:nth-last-child(5) { width: 84px; }   /* returning experience: bar is 46px wide */
#tx-table th:nth-last-child(4) { width: 62px; }   /* system */
#tx-table th:nth-last-child(3) { width: 58px; }   /* cost */
#tx-table th:nth-last-child(2) { width: 58px; }   /* grad rate */
#tx-table th:nth-last-child(1) { width: 50px; }   /* RPI */
#tx-table td:nth-last-child(-n+6) .tx-exp { margin-left: auto; margin-right: auto; }
.tx-sortbar { padding: 6px 14px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tx-sortbar .chip b { color: var(--accent); margin-right: 2px; }

/* ---------- phones ---------- */
.tx-cards, .tx-msort, .tx-filtersum { display: none; }
.tx-tip { position: absolute; z-index: 100; max-width: min(320px, calc(100vw - 16px)); background: var(--text); color: var(--bg-elev); padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; box-shadow: var(--shadow); }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 4px; padding: 8px 12px; }
  .topbar .brand { order: 1; }
  .topbar .controls { order: 2; margin-left: auto; }
  .topbar .controls .auth-area > span { display: none; }
  .tx-nav { order: 3; flex: 1 0 100%; margin: 0; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .tx-nav::-webkit-scrollbar { display: none; }
  .tx-nav a { flex: none; padding: 9px 14px; }
  .tx-main { padding: 8px; }
  .tx-filtersum { display: block; cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elev2); }
  .tx-filterbox:not([open]) .tx-filtersum { border-bottom: 0; }
  .tx-filters { padding: 10px 14px; }
  .tx-filters label { flex: 1 1 42%; }
  .tx-filters select, .tx-filters input { min-width: 0; width: 100%; }
  .tx-msort { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px; align-items: end; }
  .tx-msort label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
  .tx-msort select { width: 100%; }
  #tx-wrap, #tx-hint { display: none !important; }
  .tx-cards { display: block; padding: 0 10px 14px; }
  .tx-schoolcard { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 10px; background: var(--bg-elev); }
  .tx-sc-head { display: flex; align-items: center; gap: 6px; }
  .tx-sc-head .tx-team { font-size: 17px; flex: 1; }
  .tx-sc-opp { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 10px 0; }
  .tx-sc-opp .tx-bar { min-width: 0; height: 26px; }
  .tx-sc-opp .tx-bar b { line-height: 26px; font-size: 14px; }
  .tx-stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); font-weight: 600; }
  .tx-sc-lines { display: grid; gap: 6px; font-size: 13px; }
  .tx-sc-lines .tx-stat-l { display: inline-block; min-width: 68px; }
  .tx-sc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .tx-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .tx-stat-v { font-size: 15px; font-weight: 600; }
  .tx-stat-v small { display: block; font-weight: 400; font-size: 12px; }
  .tx-stat .tx-exp { margin-left: 0; width: 56px; height: 20px; }
  .tx-stat .tx-exp b { line-height: 20px; }
  .tx-grid { grid-template-columns: 1fr; }
  .tx-col li { flex-wrap: wrap; }
  .tx-col li .tx-names { white-space: normal; }
  .tx-form { grid-template-columns: 1fr; }
}
/* comfortable tap targets on touch screens */
@media (pointer: coarse) {
  .btn, .tx-mini, select, input:not([type=checkbox]) { min-height: 42px; }
  .tx-mini { padding: 8px 12px; font-size: 13px; }
  .tx-star { min-width: 44px; min-height: 44px; font-size: 22px; }
  .chip button { min-width: 28px; min-height: 28px; }
  .tx-checks input[type=checkbox] { width: 22px; height: 22px; }
}
.tx-linked { margin: 4px 14px 10px; padding: 10px 12px; border: 1px solid var(--good); border-radius: 10px; background: var(--row-hover); font-size: 14px; display: grid; gap: 4px; }
.tx-linked.none { border-color: var(--border); border-style: dashed; }

.tx-hide { cursor: pointer; background: none; border: none; color: var(--text-dim); font-size: 15px; padding: 2px 6px; }
.tx-hide:hover { color: var(--bad); }
.tx-hide.restore { font-size: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--accent); }
.tx-hidden { opacity: .5; }
@media (max-width: 720px) { .tx-hide { min-width: 44px; min-height: 44px; } }
