/* tools_hub.css — Standings / Draft Order (/standings_power) and Draft Sim (/draft_machine).
 * Builds on stats_hub.css (same tokens, masthead, tables, buttons, modal). */

/* ---------- shared ---------- */
/* toolbar under the title: view switcher on the left, season / lottery controls on the right */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; }
.view-bar .controls { margin-left: auto; }
.res-bar { justify-content: center; }
.res-bar .controls { margin-left: 0; }
/* wide screens: view buttons centered on the page, controls pinned right */
@media (min-width: 1101px) {
  .view-bar:not(.res-bar) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .view-bar:not(.res-bar) .view-seg { grid-column: 2; }
  .view-bar:not(.res-bar) .controls { grid-column: 3; justify-self: end; }
}
@media (max-width: 1100px) { .view-bar:not(.res-bar) { flex-direction: column; align-items: center; } .view-bar:not(.res-bar) .controls { margin-left: 0; justify-content: center; } }
.view-seg button { font-family: var(--cond); font-size: 18px; font-weight: 700; padding: 6px 16px; white-space: nowrap; }
.view-seg .s { display: none; }
.tlogo { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; flex: 0 0 22px; }
.tlogo.sm { width: 16px; height: 16px; flex-basis: 16px; }
.tcell { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tcell .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcell .tn.short { display: none; }
.vs { display: none; }
.note-banner { background: var(--gold-tint); border-left: 4px solid var(--gold); padding: 10px 14px; font-size: 14px; margin: 0 0 16px; max-width: 100ch; }
.subnote { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 100ch; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; background: var(--paper); color: var(--muted); border: 1px solid var(--rule); white-space: nowrap; }
.pill.gold { background: var(--gold-tint); color: #8A5A00; border-color: #F1D79A; }
.pill.blue { background: var(--sort); color: var(--accent-ink); border-color: #C5DAF5; }
.pill.red { background: #FDECEA; color: #B42318; border-color: #F5C2BC; }
.pill.green { background: #E7F6EC; color: #1E7A3C; border-color: #BFE5CB; }
.up { color: #1E7A3C; font-weight: 700; }
.down { color: #B42318; font-weight: 700; }
.muted { color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--rule); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); }
.card-head h3 { margin: 0; font-family: var(--cond); font-size: 22px; font-weight: 700; }
.card-body { padding: 12px 14px; }
/* centered page titles: title in the middle column, controls pinned right */
.view-head.ctr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; }
.view-head.ctr .vh-title { grid-column: 2; text-align: center; }
.view-head.ctr .controls { grid-column: 3; justify-self: end; }

/* ---------- standings ---------- */
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.st-block h3 { font-family: var(--cond); font-weight: 700; font-size: 26px; margin: 0 0 8px; color: var(--navy); }
.st-block + .st-block { margin-top: 0; }
.st-divs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 20px; }
.st-divs h4 { font-family: var(--cond); font-size: 21px; font-weight: 700; margin: 0 0 6px; }
table.st td.rk, table.st th.rk { width: 34px; text-align: right; color: var(--muted); }
table.st tr.cut td { border-bottom: 2px solid var(--navy); }
table.st tr.cut-pi td { border-bottom: 2px dashed #8FA0B2; }
table.st td.team-col { text-align: left; }
table.st td.team-col a { color: var(--ink); font-weight: 600; }
.seed-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.seed-key span::before { content: ""; display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px solid var(--navy); }
.seed-key span.pi::before { border-top-style: dashed; border-top-color: #8FA0B2; }

/* draft order */
.do-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.do-grid h3 { font-family: var(--cond); font-weight: 700; font-size: 26px; margin: 0 0 8px; color: var(--navy); }
table.st.do td, table.st.do th { padding: 6px 8px; }
table.st.do td.pk { font-family: var(--cond); font-size: 19px; font-weight: 700; width: 38px; text-align: right; color: var(--navy); }
table.st.do tr.lot-end td { border-bottom: 2px solid var(--navy); }
table.st.do tr.has-detail { cursor: pointer; }
table.st.do tr.has-detail td.via::after { content: " \25BE"; color: var(--muted); font-size: 11px; }
table.st.do tr.has-detail.open td.via::after { content: " \25B4"; }
table.st.do tr.detail td { background: #F8FAFC !important; white-space: normal; text-align: left; font-size: 13px; color: var(--ink); padding: 8px 12px 10px 54px; line-height: 1.45; }
table.st.do tr.detail[hidden] { display: none; }
table.st.do td.via { text-align: left; color: var(--muted); }
table.st.do td.via .tcell { color: var(--ink); }
.lot-ctl { display: inline-flex; gap: 8px; align-items: center; }
.do-notes { margin-top: 26px; }
.do-notes h3 { font-family: var(--cond); font-weight: 700; font-size: 24px; margin: 0 0 8px; }
.do-notes ul { list-style: none; margin: 0; padding-left: 0; font-size: 13.5px; columns: 2; column-gap: 32px; }
.do-notes li { break-inside: avoid; padding: 2px 0 6px; }
.lot-result { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

/* ---------- draft sim ---------- */
.ds-setup { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.confs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.team-picker h3 { font-family: var(--cond); font-weight: 700; font-size: 22px; margin: 4px 0 8px; color: var(--navy); }
.tp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tp-grid .tp:last-child:nth-child(odd) { grid-column: 2; }
.tp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--tc, var(--navy)); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); text-align: left; border-radius: 2px; }
.tp img { width: 30px; height: 30px; object-fit: contain; }
.tp:hover { background: var(--paper); }
.tp.on { background: var(--navy); color: #fff; border-color: var(--navy); border-left-color: var(--tc, var(--gold)); }
.tp .picks { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tp.on .picks { color: #C9D4DF; }
.tp-actions { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.settings .row { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.settings .row:last-child { border-bottom: 0; }
.settings .lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
/* settings toggles fill the narrow card as a grid (speed is 2 x 2) */
.settings .seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 1px; background: var(--rule); width: 100%; }
.settings .seg button { background: #fff; padding: 8px 6px; text-align: center; white-space: nowrap; }
.settings .seg button + button { border-left: 0; }
.settings .seg button.on { background: var(--navy); color: #fff; }
.settings .seg[data-set="length"] { --n: 3; }
.start-row .btn.primary { width: 100%; }
.start-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.start-row .btn.primary { font-size: 16px; padding: 10px 22px; }
.preview { margin-top: 16px; }
.preview table.st td.pk { font-weight: 700; }
table.st tr.mine td { background: #FFF4DC !important; }
table.st tr.mine td.pk { box-shadow: inset 4px 0 0 var(--gold); }

.ds-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--tc, var(--navy)); padding: 12px 16px; margin-bottom: 16px; }
.otc { display: flex; align-items: center; gap: 14px; min-width: 0; }
.otc img { width: 54px; height: 54px; object-fit: contain; }
.otc .lbl { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.otc .who { font-family: var(--cond); font-size: 30px; font-weight: 700; line-height: 1; }
.otc .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.otc.you .lbl { color: #8A5A00; }
.ds-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ds-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.board-wrap { max-height: 76vh; }
table.st.dboard td, table.st.dboard th { padding: 6px 8px; }
table.st.dboard td.pk { font-family: var(--cond); font-size: 18px; font-weight: 700; color: var(--navy); width: 40px; text-align: right; }
table.st.dboard tr.round td { background: var(--navy-2) !important; color: #fff; font-family: var(--cond); font-size: 17px; font-weight: 700; text-align: left; letter-spacing: .02em; }
table.st.dboard tr.now td { background: #FFF8E6 !important; }
table.st.dboard tr.now td.pk { box-shadow: inset 4px 0 0 var(--gold); }
table.st.dboard td.pl { text-align: left; }
table.st.dboard td.pl b { font-weight: 700; }
table.st.dboard td.pl .meta { color: var(--muted); font-size: 12px; margin-left: 6px; }
table.st.dboard td.pl .otc-tag { font-weight: 700; color: #8A5A00; }
table.st.dboard td.via { text-align: left; font-size: 12px; color: var(--muted); }
.val { font-size: 12px; font-weight: 700; }
.val.steal { color: #1E7A3C; }
.val.reach { color: #B42318; }
.side-col { display: flex; flex-direction: column; gap: 16px; }
.side-head { padding: 8px 14px; }
.seg.side-tabs button { font-family: var(--cond); font-size: 19px; font-weight: 700; padding: 4px 14px; }
.my-picks .mp-team { margin-bottom: 4px; }
.my-picks .mp-group + .mp-group { margin-top: 12px; }
#dsProspects .my-picks { max-height: 62vh; overflow-y: auto; }
.pr-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); }
.pr-tools input[type="search"] { flex: 1 1 140px; height: 32px; border: 1px solid var(--rule); border-radius: 4px; padding: 0 10px; min-width: 0; }
.pr-tools .seg button { padding: 5px 9px; font-size: 13px; }
.pr-tools .seg { flex-wrap: wrap; }
.pr-wrap { max-height: 62vh; border: 0; border-top: 0; }
table.st.pr td, table.st.pr th { padding: 6px 8px; }
table.st.pr td.nm { text-align: left; }
table.st.pr td.nm a { color: var(--ink); font-weight: 600; }
table.st.pr td.nm .sub { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
table.st.pr td.act { width: 70px; }
.my-picks li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.my-picks li:last-child { border-bottom: 0; }
.my-picks ul { list-style: none; margin: 0; padding: 0; }
.trade-log { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.trade-log li { padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.trade-log li:last-child { border-bottom: 0; }

/* trade modal */
.tr-cols { display: grid; grid-template-columns: repeat(var(--tr-n, 2), minmax(0, 1fr)); gap: 14px; }
.tr-col { border: 1px solid var(--rule); border-top: 4px solid var(--tc, var(--navy)); background: #fff; min-width: 0; display: flex; flex-direction: column; }
.tr-col-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); }
.tr-col-head select { flex: 1 1 auto; min-width: 0; height: 32px; border: 1px solid var(--rule); border-radius: 4px; font-weight: 600; }
.tr-col-head .x { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.tr-col-head .tag { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tr-list { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; }
.tr-list li label { display: grid; grid-template-columns: 20px 44px 1fr auto; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer; font-size: 13.5px; }
.tr-list li label:hover { background: var(--paper); }
.tr-list li.sel label { background: var(--sort); }
.tr-list .slot { font-family: var(--cond); font-weight: 700; font-size: 17px; color: var(--navy); }
.tr-list .proj { color: var(--muted); font-size: 12px; display: block; }
.tr-list .pv { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; margin-left: 6px; display: inline-block; min-width: 34px; text-align: right; }
.tr-list select.dest { font-size: 12px; height: 26px; max-width: 120px; }
.tr-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.tr-add { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--rule); background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; min-height: 120px; }
.tr-add:hover { border-color: var(--accent); color: var(--accent); }
.tr-eval { margin-top: 14px; border: 1px solid var(--rule); background: #fff; }
.tr-eval .ev { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); align-items: start; }
.tr-eval .ev:last-child { border-bottom: 0; }
.tr-eval .ev-team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.meter { height: 10px; background: var(--rule-soft); border-radius: 5px; overflow: hidden; margin: 4px 0 4px; }
.meter i { display: block; height: 100%; background: #C9372C; transition: width .25s ease; }
.meter.mid i { background: var(--gold); }
.meter.good i { background: #2E9E57; }
.ev-line { font-size: 13px; }
.ev-why { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.tr-msg { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--navy); background: #F8FAFC; font-size: 14px; }
.tr-msg.bad { border-left-color: #C9372C; background: #FDF1EF; }
.tr-msg.good { border-left-color: #2E9E57; background: #EEF8F1; }
.tr-msg .counter { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.tr-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 14px; align-items: center; }
.tr-foot .left { color: var(--muted); font-size: 12.5px; max-width: 60ch; }
.tr-foot .right { display: flex; gap: 8px; flex-wrap: wrap; }

/* results */
.res-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.res-card { background: #fff; border: 1px solid var(--rule); border-top: 4px solid var(--tc, var(--navy)); }
.res-card .card-head img { width: 30px; height: 30px; object-fit: contain; }
.my-picks .pk-grade { font-family: var(--cond); font-weight: 700; font-size: 17px; color: var(--navy); min-width: 26px; text-align: right; }
.res-card .grade { font-family: var(--cond); font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1; }

/* ---------- responsive ---------- */
.mobile-only { display: none; }
@media (max-width: 1100px) { .mobile-only { display: inline-block; } }
@media (max-width: 1120px) {
  .confs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 1100px) {
  .ds-main { grid-template-columns: minmax(0, 1fr); }
  .board-wrap { max-height: 60vh; }
}
@media (max-width: 960px) {
  .st-two, .st-divs, .do-grid, .ds-setup { grid-template-columns: minmax(0, 1fr); }
  .ds-setup aside { display: contents; }
  .ds-setup .team-picker { order: 0; }
  .ds-setup .settings { order: 1; }
  .ds-setup .preview { order: 2; margin-top: 0; }
  .do-notes ul { columns: 1; }
  .ds-setup .settings .seg[data-set="speed"] { --n: 4; }
}
@media (max-width: 860px) {
  .view-seg .f { display: none; }
  .view-seg .s { display: inline; }
}
@media (max-width: 600px) {
  .hub-wrap.hub-view { padding-top: 18px; padding-bottom: 40px; }
  .vf { display: none; }
  .vs { display: inline; }
  .tcell .tn.full { display: none; }
  .tcell .tn.short { display: inline; }
  .tp { padding: 7px 8px; font-size: 13px; gap: 7px; }
  .tp img { width: 24px; height: 24px; }
  .tp .picks { display: none; }
  .ds-top { padding: 10px 12px; }
  .otc .who { font-size: 24px; }
  .otc img { width: 42px; height: 42px; }
  .ds-actions { margin-left: 0; width: 100%; }
  .ds-actions .btn { flex: 1 1 auto; }
  .tr-cols { grid-template-columns: 1fr; }
  .tr-eval .ev { grid-template-columns: 1fr; }
  .view-head h2 { font-size: 30px; }
  .view-head.ctr { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .view-head.ctr .vh-title, .view-head.ctr .controls { grid-column: 1; justify-self: center; }
  .view-head.ctr .controls { justify-content: center; }
  .ds-setup .settings .seg[data-set="speed"] { --n: 2; }
  .view-bar { justify-content: center; }
  .view-bar .controls { margin-left: 0; justify-content: center; }
  .view-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .view-seg button { padding: 7px 4px; font-size: 16px; }
}
/* draft sim trades: NBA players (rosters from the trade machine) */
.tr-players { border-top: 1px solid var(--rule-soft); }
.tr-players > summary { cursor: pointer; padding: 8px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); background: var(--paper); }
.tr-players .tr-list { max-height: 340px; }
.tr-list li.np label { grid-template-columns: 20px minmax(0, 1fr) auto; }
.np-n { min-width: 0; }
.np-flag { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 3px; border: 1px solid var(--rule); color: var(--muted); vertical-align: 1px; }
.np-flag.no { color: #9B1C12; background: #FDECEA; border-color: #F5C6C1; }
.np-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.np-sal { font-family: var(--cond); font-size: 16px; font-variant-numeric: tabular-nums; }
.tr-rules { margin-top: 12px; padding: 10px 12px; border-left: 4px solid #2E9E57; background: #EEF8F1; font-size: 14px; }
.tr-rules.bad { border-left-color: #C9372C; background: #FDF1EF; }
.tr-rules ul { margin: 6px 0 0; padding-left: 18px; }
.tr-rules li { margin-bottom: 3px; color: #9B1C12; }
.tr-rules li.note { color: #8A4B00; }
.tr-rules-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
