/* TRAC. Brand tokens from 00-CONTEXT/artifact-brands.md (ChuckTown Homes at LPT Realty). */
:root {
  --blue: #33658A; --blue-tint: #6A8FB0; --blue-deep: #243742; --charcoal: #2F4858; --linen: #E0DFD5;
  --bg: #F4F3EE; --surface: #FFFFFF; --ink: #243742; --muted: #5A6B77; --line: #E0DFD5;
  --good: #3B7A57; --bad: #A64B3C; --warn-bg: #FBF1E6;
  --head: "Alegreya", Georgia, serif; --body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0 0 10px; color: var(--blue-deep); }
h2 { font-size: 20px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* header */
.top { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 60px; background: var(--blue-deep); color: #fff; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.wordmark { color: #fff; font-family: var(--head); font-weight: 800; font-size: 20px; letter-spacing: .2px; display: inline-flex; align-items: baseline; gap: 8px; }
.wordmark:hover { text-decoration: none; }
.wordmark .sep { color: var(--blue-tint); font-weight: 400; }
.wordmark .lpt { font-family: var(--body); font-weight: 500; font-size: 13px; text-transform: lowercase; letter-spacing: 1px; color: var(--linen); }
.brand .app { font-family: var(--body); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--blue-tint); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--linen); padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.who .name { font-weight: 600; }
.who .role { color: var(--blue-tint); text-transform: capitalize; }
.who .out { color: var(--linen); font-size: 12px; }

/* page */
.page { max-width: 1280px; margin: 0 auto; padding: 22px 24px 48px; }
.controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.filters select { font-family: var(--body); font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); min-width: 170px; }
.monthnav { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.monthnav strong { font-family: var(--head); font-size: 20px; min-width: 90px; text-align: center; }
.arrow { display: inline-block; width: 28px; height: 28px; line-height: 26px; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--blue); font-size: 18px; }
.arrow.off { color: var(--line); }
.scope { font-family: var(--head); font-size: 20px; }
.asof { font-size: 12px; color: var(--muted); max-width: 420px; text-align: right; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 12px; color: var(--ink); display: block; }
.tile:hover { text-decoration: none; border-color: var(--blue-tint); }
.tile .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile .value { font-family: var(--head); font-weight: 800; font-size: 30px; line-height: 1.1; margin: 6px 0 4px; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.tile .compare { font-size: 12px; color: var(--muted); }
/* a week whose closings are still being entered (two to three days) reads lighter, with a tag, so it is not read as a drop */
.tile .value.settling, td.settling { color: var(--blue-tint); }
.settling-tag { font-family: var(--body); font-size: 11px; font-weight: 600; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 1px 6px; vertical-align: middle; white-space: nowrap; }
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--blue-tint); color: var(--blue-tint); font-size: 9px; line-height: 12px; text-align: center; font-family: var(--head); font-style: italic; cursor: help; }

/* charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 8px; margin: 0; }
.chart figcaption { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.chart figcaption .muted { font-weight: 400; font-size: 12px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { font-family: var(--body); font-size: 10px; fill: var(--muted); text-anchor: middle; }
.chart .val { font-family: var(--body); font-size: 10px; fill: var(--ink); text-anchor: middle; font-weight: 600; }
.bars rect { fill: var(--blue); }
.bars .bar:hover rect { fill: var(--blue-deep); }
.bars rect.partial { fill: var(--blue-tint); }
.bars rect.sched, .line rect.sched { fill: var(--blue-tint); fill-opacity: .28; stroke: var(--blue-tint); stroke-opacity: .7; stroke-dasharray: 3 2; }
.bars .bar:hover rect.sched { fill-opacity: .45; }
.chart .val.sched { fill: var(--muted); font-weight: 500; }
.chart .legend { float: right; font-weight: 400; font-size: 11px; color: var(--muted); }
.chart .legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 4px 0 10px; }
.chart .legend .sw.closed { background: var(--blue); }
.chart .legend .sw.sched { background: rgba(106,143,176,.28); border: 1px dashed var(--blue-tint); }
.line circle.partial { fill: var(--surface); stroke: var(--blue); }
.charts[data-view="months"] .v-years, .charts[data-view="years"] .v-months { display: none; }
.chart-switch { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.chart-switch button { font-family: var(--body); font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; cursor: pointer; }
.chart-switch button:first-child { border-radius: 6px 0 0 6px; } .chart-switch button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.chart-switch button.on { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.years .yr polyline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .15s; }
.years .yr.current polyline { stroke-width: 3; }
.years .yr .dash { stroke: var(--c); stroke-width: 2; stroke-dasharray: 4 3; }
.years .yr .open { fill: var(--surface); stroke: var(--c); stroke-width: 2; }
.years .yrbar rect { fill: var(--c); fill-opacity: .85; }
.years .yrbar rect.partial { fill-opacity: .45; }
.years .yrbar rect.sched { fill: var(--blue-tint); fill-opacity: .28; stroke: var(--blue-tint); stroke-opacity: .7; stroke-dasharray: 3 2; }
.years .yr polyline { stroke-width: 2.5; }
.years.focus .yrbar { opacity: .15; } .years.focus .yrbar.lit { opacity: 1; }
.yr-legend i.blk { width: 10px; height: 10px; vertical-align: -1px; }
.yr-legend i.sh { background: rgba(106,143,176,.28); border: 1px dashed var(--blue-tint); }
.years .col .hit { fill: transparent; }
.years .col .cross { stroke: var(--line); stroke-width: 1; opacity: 0; }
.years .col:hover .cross { opacity: 1; }
.years.focus .yr { opacity: .15; } .years.focus .yr.lit { opacity: 1; }
.yr-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); padding: 6px 0 2px; }
.yr-legend button, .chart .legend button { font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 12px; padding: 1px 7px 1px 4px; cursor: pointer; }
.yr-legend button:hover, .chart .legend button:hover { border-color: var(--line); }
.yr-legend button[aria-pressed="false"], .chart .legend button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.charts.hide-sched .sched { display: none; }
/* recruiting and contracts trend charts (11/13): one figure, two views switched by the buttons in its caption */
.trend-fig[data-tview="net"] .tv-flow, .trend-fig[data-tview="flow"] .tv-net,
.trend-fig[data-tview="written"] .tv-fell, .trend-fig[data-tview="fell"] .tv-written { display: none; }
.tswitch { float: right; display: inline-flex; margin-left: 8px; }
.tswitch button { font-family: var(--body); font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 9px; cursor: pointer; }
.tswitch button:first-child { border-radius: 6px 0 0 6px; } .tswitch button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.tswitch button.on { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.thead { font-size: 13px; margin: 2px 0 4px; }
.thead b { font-size: 18px; font-weight: 700; }
.trend .tl polyline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .tl.bold polyline { stroke-width: 3; }
.trend .tl.faded polyline { stroke-opacity: .4; stroke-width: 2; }
.trend .tl polyline.dash { stroke-dasharray: 4 3; stroke-width: 2; }
.trend .tl polyline.dot { stroke-dasharray: 1 4; stroke-width: 3; }
.trend .tl .open { fill: var(--surface); stroke: var(--c); stroke-width: 2; }
.trend .tl .val.muted { fill: var(--muted); font-weight: 500; }
.trend .tl .val.name { text-anchor: start; fill: var(--c); font-size: 11px; font-weight: 700; }
.trend .tl.faded .val.name { fill-opacity: .6; font-weight: 600; }
.trend .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.trend .zero { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.trend .glabel { font-family: var(--body); font-size: 9px; fill: var(--muted); text-anchor: end; }
.trend .col .hit { fill: transparent; }
.trend .col .cross { stroke: var(--line); stroke-width: 1; opacity: 0; }
.trend .col:hover .cross { opacity: 1; }
.tlegend { font-size: 11px; color: var(--muted); padding: 6px 0 2px; }
.tkey { color: var(--ink); margin-right: 6px; }
.tkey i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: 3px; margin: 0 4px 0 6px; }
.tkey i:first-child { margin-left: 0; }
.yr-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 5px; }
.line polyline { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.line circle { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.line circle.hit { fill: transparent; stroke: none; }
.line g:hover circle:not(.hit) { r: 5; fill: var(--blue-deep); }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 20px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #EEEDE6; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8F7F2; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }
.flag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; background: var(--warn-bg); color: var(--bad); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
tr.late td:first-child { color: var(--bad); }
tr.inactive td { color: var(--muted); }

/* table tools */
.tablebar { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.tablebar .filter { font-family: var(--body); font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 220px; background: var(--surface); color: var(--ink); }
.tablebar .count { font-size: 12px; color: var(--muted); }
.tablebar .dl { margin-left: auto; font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--blue); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.tablebar .dl:hover { border-color: var(--blue-tint); }
thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--blue-deep); }
th.sortable::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: 5px; vertical-align: middle; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--line); }
th.sortable.desc::after { border-top-color: var(--blue); }
th.sortable.asc::after { border-top: none; border-bottom: 5px solid var(--blue); }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); padding-top: 8px; color: var(--blue-deep); }
.period { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.period a { padding: 5px 10px; border-radius: 4px; font-size: 13px; color: var(--muted); }
.period a.on { background: var(--blue-deep); color: #fff; }
.period a:hover { text-decoration: none; color: var(--blue-deep); }
.period a.on:hover { color: #fff; }
.table-wrap { max-height: none; }

/* team leader page */
.rankline { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.rankline .muted { display: block; font-size: 12px; margin-top: 4px; }
.looks h2 { margin: 6px 0 12px; }
.lookgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.look { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; overflow-x: auto; }
.look.wide { grid-column: 1 / -1; }
.look h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.look h3 .count { font-family: var(--body); font-size: 12px; font-weight: 600; background: var(--linen); color: var(--blue-deep); border-radius: 10px; padding: 1px 8px; }
.look table.compact td, .look table.compact th { padding: 5px 6px; font-size: 12.5px; }
.look .tablebar .filter { min-width: 140px; }
td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
td.late { color: var(--bad); font-weight: 600; }
@media (max-width: 980px) { .lookgrid { grid-template-columns: 1fr; } }

/* agent page */
.agentname { font-size: 26px; margin: 0; }
.tiles.five { grid-template-columns: repeat(5, 1fr); }
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.twocol .table-wrap { min-width: 0; }
table.plain td, table.plain th { padding: 6px 8px; }
table.funnel td:first-child { color: var(--muted); }
.cap { margin: 10px 0 14px; }
.caphead { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.capbar { height: 10px; background: var(--linen); border-radius: 5px; overflow: hidden; }
.capfill { height: 100%; background: var(--blue); border-radius: 5px; }
.capnums { font-size: 12px; margin-top: 4px; color: var(--ink); }
tr.me td { background: #EEF3F7; font-weight: 600; }
td a.person { color: var(--ink); border-bottom: 1px dotted var(--blue-tint); }
td a.person:hover { color: var(--blue); text-decoration: none; }
@media (max-width: 980px) { .tiles.five { grid-template-columns: repeat(3, 1fr); } .twocol { grid-template-columns: 1fr; } }

.chart.inner { border: none; padding: 6px 0; }
.filters.explorer { gap: 10px 14px; }
.filters.explorer input[type=text], .filters.explorer input[type=month] { font-family: var(--body); font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); min-width: 130px; }
.filters.explorer select { min-width: 120px; }
.filters .check { flex-direction: row; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); align-self: flex-end; padding-bottom: 8px; }
.button.small { padding: 7px 12px; font-size: 12px; align-self: flex-end; }
.button.ghost { background: var(--surface); color: var(--blue); border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface); border-color: var(--blue-tint); }
.pager { display: flex; gap: 16px; align-items: center; margin: 10px 0 0; font-size: 13px; }
table.kv td:first-child { width: 220px; }
table.kv th { width: 220px; text-align: left; font-weight: 600; vertical-align: top; padding-right: 12px; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-row input { flex: 1 1 90px; min-width: 0; }
.meter { display: inline-block; width: 60px; height: 8px; background: var(--linen); border-radius: 4px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.meterfill { display: block; height: 100%; background: var(--blue); }
/* Pipeline for an assistant team leader or team leader: one fold per agent (Jeremy 11/23) */
.agentfolds details.agentfold { border-top: 1px solid var(--line); padding: 10px 0; }
.agentfolds details.agentfold > summary { cursor: pointer; font-size: 15px; }
.agentfolds details.agentfold[open] > summary { margin-bottom: 8px; }
.monthgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 20px; }
.monthcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); display: block; }
.monthcard:hover { border-color: var(--blue-tint); text-decoration: none; }
.monthcard .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.monthcard .value { font-family: var(--head); font-weight: 800; font-size: 26px; color: var(--blue-deep); margin: 4px 0 2px; }
.monthcard .compare { font-size: 12px; color: var(--muted); }
.monthcard.nodate { border-style: dashed; }
.tiles { grid-auto-flow: row; }

/* freshness */
.freshness details { font-size: 12px; color: var(--muted); }
.freshness summary { cursor: pointer; }
.fresh-table { margin-top: 8px; max-width: 760px; font-size: 12px; }
.fresh-table td { padding: 4px 8px; }

/* sign-in */
.signin { max-width: 440px; margin: 80px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; text-align: center; }
.signin h1 { font-size: 30px; }
.lede { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.button { display: inline-block; background: var(--blue); color: #fff; font-weight: 600; padding: 11px 22px; border-radius: 8px; }
.button:hover { background: var(--blue-deep); text-decoration: none; }
.warn { background: var(--warn-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* footer, tooltip */
.foot { display: flex; justify-content: space-between; max-width: 1280px; margin: 0 auto; padding: 0 24px 28px; font-size: 11px; color: var(--muted); }
#tip { position: absolute; display: none; background: var(--blue-deep); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; max-width: 280px; z-index: 50; white-space: pre-line; box-shadow: 0 4px 14px rgba(36,55,66,.25); }

@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .top { padding: 0 16px; gap: 14px; }
  .page, .foot { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 600px) {
  .tiles, .tiles.four { grid-template-columns: repeat(2, 1fr); }
  .who .name, .who .role { display: none; }
  .nav a { padding: 8px 8px; }
}

/* the change button (deal page) and the approval queue (/changes), 2026-10-11 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 14px; background: var(--warn-bg); }
.notice.good { color: var(--good); border: 1px solid var(--good); background: var(--surface); }
.notice.bad { color: var(--bad); border: 1px solid var(--bad); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
details.suggest { margin-top: 12px; }
details.suggest > summary { list-style: none; cursor: pointer; }
details.suggest > summary::-webkit-details-marker { display: none; }
.suggest-form { display: grid; gap: 6px; max-width: 560px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.suggest-form label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.suggest-form input, .suggest-form select, .suggest-form textarea, .change-decide input { font-family: var(--body); font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; }
.change-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px 14px; margin: 10px 0; display: grid; gap: 6px; }
.change-what { font-size: 15px; }
.change-what .was { text-decoration: line-through; color: var(--muted); }
.change-why { font-size: 14px; }
.change-decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.change-decide input { flex: 1 1 220px; width: auto; }

/* commissions (TRAC step 5) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 500; }
.tabs a.on, .tabs a:hover { background: var(--blue); border-color: var(--blue); color: #fff; text-decoration: none; }
.pick select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: inherit; }
.flags { margin: 6px 0 0; padding-left: 18px; }
.flags li { margin: 4px 0; line-height: 1.45; }
.flags .badge { background: var(--blue); text-transform: none; font-weight: 600; }
td .why { font-size: 12px; margin-top: 2px; }
.tile .value.small { font-size: 20px; }
tr.tot td { border-top: 2px solid var(--ink); }

/* commission picture (10/18) */
.viewswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 6px 0 10px; background: var(--surface); }
.viewswitch button { font: inherit; font-weight: 600; font-size: 13px; padding: 6px 16px; border: none; background: none; color: var(--muted); cursor: pointer; }
.viewswitch button.on { background: var(--blue); color: #fff; }
.seg-source { background: #B8741A; } .seg-iref { background: #A0566B; } .seg-mentor { background: #8B4FA0; } .seg-lpt { background: #6A8FB0; } .seg-fmls { background: #9AA5AE; }
.seg-agent { background: #3B7A57; } .seg-cth { background: #243742; } .seg-in { background: var(--linen); }
.moneybar { display: flex; height: 46px; border-radius: 8px; overflow: hidden; margin: 10px 0 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.moneybar .seg { display: flex; align-items: center; justify-content: center; min-width: 2px; color: #fff; font-weight: 700; font-size: 13px; border-right: 2px solid var(--surface); }
.moneybar .seg:last-child { border-right: none; }
.moneylegend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; }
.moneylegend li { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: baseline; column-gap: 8px; font-size: 14px; }
.moneylegend i { width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.moneylegend .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.moneylegend .pc { color: var(--muted); font-size: 12px; min-width: 32px; text-align: right; }
.moneylegend .nt { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.steps-h { margin-top: 22px; }
.steps { display: grid; gap: 6px; }
.step { display: grid; grid-template-columns: 170px 1fr 100px; align-items: center; gap: 12px; font-size: 14px; }
.step .track { height: 16px; background: var(--bg); border-radius: 4px; overflow: hidden; display: flex; }
.step .fill { height: 100%; border-radius: 4px; min-width: 2px; }
.step .amt { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .step { grid-template-columns: 110px 1fr 80px; gap: 8px; font-size: 13px; } }

/* cap and royalty panel (10/18) */
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.capcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; align-content: start; }
.caphead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.capbar { display: flex; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.capbar .cap-before { background: var(--blue); }
.capbar .cap-this { background: repeating-linear-gradient(45deg, #B8741A, #B8741A 4px, #D49A4B 4px, #D49A4B 8px); }
.capline { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.royalty { font-size: 14px; padding: 8px 10px; border-radius: 6px; background: var(--bg); }
.royalty.due { background: var(--warn-bg); }
.royalty.paid { background: #EAF3EE; }
.small { font-size: 12px; }

/* grouped top bar (10/18) */
.nav { align-items: center; }
.navmenu { position: relative; }
.navmenu summary { list-style: none; cursor: pointer; color: var(--linen); padding: 8px 12px; border-radius: 6px; font-weight: 500; user-select: none; }
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.navmenu.on summary, .navmenu summary:hover, .navmenu[open] summary { background: rgba(255,255,255,.1); color: #fff; }
.navmenu .menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(36,55,66,.18); padding: 6px; display: grid; }
.navmenu .menu a { color: var(--ink); padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.navmenu .menu a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.navmenu .menu a.on { background: var(--bg); color: var(--blue); font-weight: 600; }

/* To do page (10/18) */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.todo-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; color: var(--ink); }
.todo-card:hover { border-color: var(--blue); text-decoration: none; box-shadow: 0 4px 14px rgba(36,55,66,.10); }
.todo-card .label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.todo-card .value { font-family: var(--head); font-weight: 800; font-size: 34px; color: var(--blue-deep); margin: 4px 0; }
.todo-card .compare { font-size: 13px; color: var(--muted); }

/* agent's view and kind words (10/18) */
.agentview-note { font-size: 12px; margin-bottom: 10px; }
.kudos { background: linear-gradient(135deg, #EAF3EE, #F4F3EE); border: 1px solid #CFE3D7; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.kudos-h { font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--good); margin-bottom: 4px; }
.kudo { margin: 6px 0; font-size: 15px; line-height: 1.45; }
.kudo::before { content: "★ "; color: #C99A2E; }
.check { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.check-top { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.check .label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.check-net { font-family: var(--head); font-weight: 800; font-size: 44px; line-height: 1.05; color: var(--good); font-variant-numeric: tabular-nums; }
.checkbar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; margin: 12px 0; background: var(--bg); }
.checkbar .take { background: var(--good); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; padding-left: 12px; white-space: nowrap; }
.checkbar .cut { background: #C9D2D8; border-left: 2px solid var(--surface); min-width: 3px; }
.check-cuts { width: 100%; }
/* Commission rules page (10/22) */
.rules-section { scroll-margin-top: 16px; }
.rules-table td { vertical-align: top; }
.rules-table td.wrap { white-space: normal; min-width: 280px; }
.rule-item { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; max-width: 900px; }
.rule-item:first-of-type { border-top: 0; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--blue); border: 1px solid var(--blue-tint); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.rule-changes { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
/* old wording tucked away so the review card reads as the new rules (Jeremy 10/22) */
details.was-before > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.was-before .was { color: var(--muted); font-size: 14px; margin-top: 2px; }
.rule-ask { display: grid; gap: 6px; max-width: 640px; grid-template-columns: minmax(0, 1fr); }
/* t1735: a pick list sizes itself to its longest rule, which stretched the whole ruling form past an iPhone screen */
.rule-ask select { max-width: 100%; min-width: 0; }
.rule-ask label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rule-ask input, .rule-ask textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); width: 100%; box-sizing: border-box; }
.rule-ask .button { justify-self: start; margin-top: 8px; }
@media (max-width: 640px) { .rules-table td.wrap { min-width: 0; } }
/* Ask page (10/22); "Ask Chuck" in its own hand-written face so it stands out (Jeremy 10/22) */
.askchuck { font-family: "Caveat", "Bradley Hand", cursive; font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: .3px; white-space: nowrap; }
.askchuck.big { font-size: 44px; color: var(--blue); }
.rule-ask.ask-big { max-width: 960px; }
.rule-ask.ask-big textarea { font-size: 16px; line-height: 1.45; min-height: 170px; resize: vertical; }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.scope-grid ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.ask-q { font-size: 16px; margin: 4px 0 12px; }
.ask-answer { max-width: 760px; line-height: 1.55; }
.ask-answer ul { padding-left: 18px; }
.ask-turn { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.ask-earlier { margin: 0 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }   /* someone else's earlier questions, folded (11/17) */
.ask-earlier > summary { cursor: pointer; margin-bottom: 6px; }
.ask-earlier[open] > summary { margin-bottom: 14px; }
.ask-earlier .ask-turn:last-child { border-bottom: 0; margin-bottom: 0; }
.rule-ask.ask-more { max-width: 760px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.rule-ask.ask-more textarea { font-size: 15px; line-height: 1.45; resize: vertical; }
.rule-ask[hidden] { display: none; }
.mine-row[hidden] { display: none; }   /* My questions search filter (t1560) */
@media (max-width: 760px) { .scope-grid { grid-template-columns: 1fr; } }
/* Ask Chuck: Jeremy's answer sent back to the asker (10/22) */
.ask-resolved { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--blue); background: var(--surface); max-width: 760px; }
.ask-resolved .lab { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.ask-resolve { margin: 14px 0; }
/* Chuck's sign-off or Easter egg: set apart from the answer in Chuck's handwriting, so nobody reads it as part of the answer */
/* a tinted card with a "Chuck says" tag so it stands out (Jeremy 10/23: the plain line didn't) */
.ask-fun { font-family: "Caveat", "Bradley Hand", cursive; font-size: 27px; line-height: 1.15; color: var(--blue-deep); margin: 18px 0 0; padding: 12px 18px 14px; max-width: 760px; background: #E6EEF5; border-left: 5px solid var(--blue); border-radius: 0 10px 10px 0; box-shadow: 0 1px 3px rgba(36,55,66,.12); }
.ask-fun::before { content: "Chuck says"; display: block; font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.ask-fun.golden { color: #7A5A00; background: #FFF4CC; border: 1px solid #E8C547; border-left: 5px solid #C9A227; }
.ask-fun.golden::before { content: "Golden Chuck"; color: #9A7400; }
.pill.golden { color: #7A5A00; border-color: #E8C547; background: #FFF4CC; }
.ask-log-btn { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.ask-log-btn .button { align-self: center; }
/* rulings (11/15): pay calls on the deal page, the executive list, case law */
.case-card { border-left: 4px solid var(--blue); }
.case-card.case-exec { border-left-color: var(--bad); }
.case-card h2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.case-body p { margin: 6px 0; }
.case-body .case-q { font-size: 16px; }
.case-opts { margin: 4px 0 8px 20px; padding: 0; }
.case-opts li { margin: 3px 0; }
.case-votes { margin-top: 8px; width: 100%; }
.case-votes th { text-align: left; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.case-votes td, .case-votes th { padding: 6px 8px 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 1px 8px; border-radius: 9px; background: var(--linen); color: var(--charcoal); }
.tag.rec, .tag.prec { background: var(--blue); color: #fff; }
.case-form { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.case-form select { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.case-radios { display: grid; gap: 4px; font-size: 14px; }
.case-radios label, .case-form label.check { font-size: 14px; color: var(--ink); margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.case-form input[type=radio], .case-form input[type=checkbox] { width: auto; flex: 0 0 auto; margin-top: 3px; padding: 0; }
.case-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.case-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.case-inline input { flex: 1 1 260px; font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.law-entry { border-top: 1px solid var(--line); padding: 10px 0; }
.law-entry:first-of-type { border-top: 0; }
.law-entry.overruled { opacity: .65; }
.law-entry p { margin: 4px 0; }
.law-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* t1735: the number people cite, first and plain to see */
.law-num { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.law-num a { color: var(--ink); text-decoration: none; }
.law-num a:hover { text-decoration: underline; }
/* what a "ruling 12" or "step 12" typed in a rule box stands for, under the box */
.rule-ref { margin: 4px 0 8px; font-size: 13px; }
.rule-ref p { margin: 2px 0; }
.rule-ref .ok::before { content: "\2713  "; }
.rule-ref .ok::before { color: var(--good); }
.rule-ref .bad { color: var(--bad); font-weight: 600; }
.case-proposals { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--warn-bg); }
.case-proposal { padding: 6px 0; border-top: 1px solid var(--line); }
.case-proposal:first-of-type { border-top: 0; }
.case-inline select { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
/* one case on its own page (11/15): clear, top to bottom */
.casepage { max-width: 860px; margin: 0 auto; }
.case-crumb { margin: 18px 0 2px; }
.case-title { margin: 0 0 6px; }
.case-pill { display: inline-block; padding: 4px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; background: var(--linen); color: var(--charcoal); }
.case-pill.bad { background: var(--warn-bg); color: var(--bad); border: 1px solid var(--bad); }
.case-pill.good { background: var(--surface); color: var(--good); border: 1px solid var(--good); }
.case-pill.wait { background: var(--surface); color: var(--blue); border: 1px solid var(--blue-tint); }
.case-block { margin-top: 16px; }
.case-block p { line-height: 1.5; }
.case-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 14px; }
.case-label:first-child { margin-top: 0; }
.case-big { font-size: 20px; font-weight: 600; line-height: 1.35; margin: 6px 0 4px; }
.case-rec { font-size: 17px; font-weight: 700; color: var(--blue-deep); margin: 6px 0 2px; }
.case-answer { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; max-width: none; }
/* the SOP itself in the answer box of a "needs a fix" page (11/17) */
.case-answer textarea.sop-box { font-size: 14px; line-height: 1.5; min-height: 260px; resize: vertical; }
.case-deadline { margin: 14px 2px; font-size: 15px; }
.case-money { margin-top: 16px; }
.case-links { margin: 4px 0 0 18px; padding: 0; line-height: 1.9; }
.case-links.sub { margin: 0 0 2px 18px; list-style: circle; }   /* a person's several lines under one name (11/20) */
.casepage .was-before { margin: 16px 2px 30px; }
@media (max-width: 640px) { .case-big { font-size: 18px; } .case-buttons .button { width: 100%; text-align: center; } }
.case-banner { font-size: 16px; margin: 0 0 4px; }
/* duplicate-lead cases (11/15) */
.dup-list { list-style: none; margin: 0; padding: 0; }
.dup-list li a { display: grid; gap: 2px; padding: 10px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.dup-list li:first-child a { border-top: 0; }
.dup-list li a:hover { background: var(--linen); text-decoration: none; }
.dup-name { font-weight: 600; }
.dup-due { font-size: 13px; color: var(--bad); }
.dup-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.dup-record p { margin: 4px 0; }
.dup-agent { font-size: 17px; font-weight: 600; }
.dup-approval { background: var(--linen); border-radius: 6px; padding: 8px 10px; }
.dup-timeline { list-style: none; padding: 0; margin: 8px 0; }
.dup-timeline li { padding: 6px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.tl-when { font-weight: 600; margin-right: 4px; }
.dup-text { white-space: pre-wrap; font-family: var(--body); font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.dup-steps { list-style: none; padding: 0; margin: 6px 0; line-height: 1.9; }
.dup-steps li.did { color: var(--good); }
.case-radios label span { flex: 1; }
/* the one To do list (11/15) */
.todo-tabs { margin: 8px 0; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li a { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); color: var(--ink); align-items: start; }
.todo-list li:first-child a { border-top: 0; }
.todo-list li a:hover { background: var(--linen); text-decoration: none; }
.todo-due { font-weight: 600; font-size: 14px; }
.todo-due.late { color: var(--bad); }
.todo-main { display: grid; gap: 3px; min-width: 0; }
.todo-title { font-size: 16px; font-weight: 600; }
.todo-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
/* the Customer Service Manager's buckets waiting on her team (Jeremy 11/16) */
.team-buckets h2 { margin-top: 0; }
.team-bucket-table { font-size: 14px; }
.team-bucket-table td a { font-weight: 600; }
.team-bucket-table tr.empty td, .team-bucket-table tr.empty td a { color: var(--muted); font-weight: 400; }
.bad-text { color: var(--bad); }
/* hover help on each bucket (Jeremy 11/16) */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
       background: var(--linen); color: var(--muted); font-size: 10px; font-weight: 700; cursor: help; vertical-align: 1px; }
/* sections under a ruling fold away, closed until opened (Jeremy 11/16) */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "\25B8"; color: var(--muted); font-size: 13px; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h2 { margin: 0; font-size: 16px; }
details.fold[open] > summary { margin-bottom: 8px; }
/* the list of every question and suggestion: one line each until opened (Jeremy 11/17, "the screen is just too busy") */
details.log-section > summary h2 { font-size: 18px; }
details.log-row { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin: 6px 0; }
details.log-row > summary { cursor: pointer; list-style: none; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
details.log-row > summary::-webkit-details-marker { display: none; }
details.log-row > summary::before { content: "\25B8"; color: var(--muted); font-size: 13px; transition: transform .15s; }
details.log-row[open] > summary::before { transform: rotate(90deg); }
details.log-row > summary .log-q { flex: 1 1 320px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
details.log-row > summary .pill { margin-left: 0; }
details.log-row > summary .log-who { white-space: nowrap; font-size: 13px; }
details.log-row[open] > summary { border-bottom: 1px solid var(--line); }
details.log-row[open] > summary .log-q { color: var(--muted); font-weight: 400; }
details.log-row > .log-body { padding: 12px 14px 14px 30px; display: grid; gap: 8px; }
/* step by step at the top of a question (Jeremy, 11/16 call with Meagan and Abby) */
.work-steps { background: var(--linen); border-radius: 8px; padding: 10px 14px; margin: 10px 0 14px; }
.work-steps > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 16px;
          display: inline-flex; align-items: center; justify-content: center; }
.steps p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
/* one step, beside the part of the page it talks about (Abby's suggestion, Jeremy 11/17) */
.step-here { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; background: var(--linen);
             border-radius: 8px; padding: 9px 12px; margin: 18px 0 8px; }
.step-here p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.casepage .step-here { margin-bottom: -6px; }
/* a ruling form right under its step needs no divider line of its own */
.step-here + form.rule-ask, .case-block > form.case-answer:first-child { border-top: none; margin-top: 4px; padding-top: 0; }

/* Back link on every screen but home (Jeremy 11/16) */
.backbar { margin: -8px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.backlink, .nextlink { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.backlink:hover, .nextlink:hover { text-decoration: underline; }
/* Jeremy looking at TRAC as someone else: a bar that never scrolls away (11/17) */
.viewbar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
           padding: 8px 16px; background: #fde68a; color: #1f2937; font-size: 14px; border-bottom: 1px solid #d97706; }
.viewbar form { margin: 0; }
.view-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.view-people button { width: 100%; text-align: left; background: none; border: 1px solid var(--line, #d1d5db); border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; }
.view-people button:hover { border-color: var(--blue); }
/* Next on To do, beside Back and again under the page (Jeremy 11/17) */
.nextlink { text-align: right; }
.nextlink .muted { font-weight: 400; }
.nextbar { margin: 16px 0 0; }
.todo-note { margin: 0 0 12px; }
/* Ask Chuck: attached files (Jeremy 11/16) */
.ask-files { display: grid; gap: 6px; margin-top: 4px; }
.ask-files-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ask-files-pick { position: relative; overflow: hidden; cursor: pointer; }
.ask-files-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ask-files-pick:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.ask-files-list, .ask-shown-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ask-files-list li, .ask-shown-files li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; max-width: 100%; }
.ask-files-list li span { overflow-wrap: anywhere; }
.ask-files-list img, .ask-shown-files img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.ask-shown-files { margin: -6px 0 12px; }
.ask-shown-files a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.ask-shown-files a:hover span:first-of-type { text-decoration: underline; }
.ask-files-note[hidden] { display: none; }
form.ask-drop { outline: 2px dashed var(--blue); outline-offset: 6px; border-radius: 6px; }
.rule-ask label.ask-files-pick { font-size: 12px; color: var(--blue); margin-top: 0; align-self: center; }
.rule-ask .ask-files .button { margin-top: 0; justify-self: auto; }

/* ---------- the Ask Chuck page with the SOP library on it (Jeremy 11/18: "think like a designer ... very intuitive") ----------
   One column in the order people use it: ask, look an SOP up, help Chuck get better, what Chuck can and cannot do. */
.askpage { max-width: 1040px; }
.ask-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin: 4px 0 16px; }
.ask-top h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.ask-top p { margin: 6px 0 0; }
.ask-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; font-weight: 600; padding-bottom: 2px; }
.ask-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 18px; box-shadow: 0 1px 2px rgba(36,55,66,.04), 0 6px 20px rgba(36,55,66,.05); }
.ask-card > .notice:first-child { margin-top: 0; }
.ask-form { display: grid; gap: 8px; }
.ask-form .ask-q { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--blue-deep); }
.ask-hint { margin: -2px 0 4px; font-size: 13px; color: var(--muted); max-width: 760px; }
.ask-form textarea { font: inherit; font-size: 16px; line-height: 1.5; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); width: 100%; min-height: 140px; resize: vertical; transition: border-color .15s, background .15s, box-shadow .15s; }
.ask-form textarea:focus { outline: none; background: var(--surface); border-color: var(--blue-tint); box-shadow: 0 0 0 3px rgba(51,101,138,.15); }
.ask-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.ask-foot .ask-files { flex: 1; min-width: 0; margin-top: 0; font-size: 12px; }
.ask-foot .ask-files .button { margin-top: 0; }
.ask-form label.ask-files-pick { font-size: 12px; color: var(--blue); }
.button.ask-go { font: inherit; font-size: 15px; font-weight: 700; padding: 11px 28px; border: 0; cursor: pointer; white-space: nowrap; }
.button.ask-go[disabled] { opacity: .5; cursor: not-allowed; }
.ask-preview { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 13px; }
.ask-preview > summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.ask-preview > summary .muted { font-weight: 400; margin-left: 6px; font-size: 12px; }
.ask-preview label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.ask-preview input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; max-width: 420px; }
.ask-beta { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.ask-beta b { color: var(--ink); }

/* the SOP library section */
.sop-lib { margin-top: 36px; }
.sop-lib [hidden] { display: none !important; }
.sop-lib-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.sop-lib-head h2 { font-size: 24px; margin: 0; }
.sop-lib-head p { margin: 2px 0 0; }
.sop-toggle { font: inherit; font-size: 12px; font-weight: 600; color: var(--blue); background: none; border: 0; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.sop-toggle:hover { text-decoration: underline; }
.sop-search { position: relative; display: flex; align-items: center; margin-bottom: 10px; }
.sop-search svg { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.sop-search input { width: 100%; font: inherit; font-size: 15px; padding: 12px 44px 12px 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.sop-search input:focus { outline: none; border-color: var(--blue-tint); box-shadow: 0 0 0 3px rgba(51,101,138,.15); }
.sop-key { position: absolute; right: 12px; font: 600 11px var(--body); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--bg); }
.sop-search input:focus ~ .sop-key { display: none; }
.sop-status { margin: 0 2px 10px; }
.sop-status:empty { display: none; }
/* departments fold, closed until opened (Jeremy 11/18, "could we make them collapsible?") */
.sop-dept { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.sop-dept > summary, details.ask-scope > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; user-select: none; }
.sop-dept > summary::-webkit-details-marker, details.ask-scope > summary::-webkit-details-marker { display: none; }
.sop-dept > summary::before, details.ask-scope > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.sop-dept[open] > summary::before, details.ask-scope[open] > summary::before { transform: rotate(45deg); }
.sop-dept > summary:hover, details.ask-scope > summary:hover { background: var(--bg); }
.sop-dept > summary:hover h3 { color: var(--blue); }
.sop-dept h3 { font-size: 17px; margin: 0; flex: 1; }
.sop-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.sop-dept[open] > summary { border-bottom: 1px solid var(--line); }
.sop-lib .sop-dept > ul { padding: 6px; }
@media (min-width: 900px) { .sop-lib .sop-dept > ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; } }
.sop-dept ul, .sop-results ul { list-style: none; margin: 0; padding: 0; }
.sop-dept li a, .sop-results li a { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.sop-dept li a:hover, .sop-results li a:hover { background: var(--bg); text-decoration: none; }
.sop-dept li a:hover .sop-title, .sop-results li a:hover .sop-title { color: var(--blue); }
.sop-title { font-weight: 600; line-height: 1.35; }
.sop-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sop-meta:empty { display: none; }
.sop-tag { font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--blue); background: rgba(51,101,138,.08); border-radius: 4px; padding: 1px 6px; }
.sop-tag.good { color: var(--good); background: rgba(59,122,87,.1); }
.sop-tag.warn { color: #8A5A1E; background: var(--warn-bg); }
.sop-results { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.sop-results li + li { border-top: 1px solid #EEEDE6; }
.sop-results li a { padding: 12px; }
.sop-dept-tag { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.sop-snip { font-size: 13px; color: var(--muted); line-height: 1.5; }
.sop-lib mark, .sop-page mark { background: #FBE7B5; color: inherit; border-radius: 2px; padding: 0 1px; }
.sop-none { background: var(--surface); border: 1px dashed var(--blue-tint); border-radius: 12px; padding: 16px 18px; }
.sop-none p { margin: 0 0 10px; }
.sop-none .button { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.sop-foot { margin: 12px 2px 0; max-width: 760px; }

/* help Chuck get better, side by side; one box alone spans the row */
.ask-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 36px; }
.ask-mini { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; }
.ask-mini h2 { font-size: 18px; margin: 0 0 6px; }
.ask-mini p { margin: 0 0 12px; font-size: 13px; }
.ask-mini-btns { margin-top: auto !important; margin-bottom: 0 !important; display: flex; gap: 8px; flex-wrap: wrap; }
.ask-mini .notice { margin: 0 0 10px; }
.ask-suggest { display: grid; gap: 8px; margin-top: auto; }
.ask-suggest textarea { font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); resize: vertical; width: 100%; }
.ask-suggest textarea:focus { outline: none; background: var(--surface); border-color: var(--blue-tint); box-shadow: 0 0 0 3px rgba(51,101,138,.15); }
.ask-suggest .button { justify-self: start; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }

/* what Chuck can and cannot do: folded, last on the page (Jeremy 11/18, "2. Y") */
details.ask-scope { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 0; overflow: hidden; }
details.ask-scope > summary h2 { display: inline; margin: 0; font-size: 17px; }
details.ask-scope > summary .muted { margin-left: auto; text-align: right; }
details.ask-scope[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0; }
details.ask-scope > .scope-grid, details.ask-scope > p { padding: 0 20px; }
details.ask-scope > .scope-grid { padding-top: 16px; }
details.ask-scope > p:last-child { padding-bottom: 16px; }

/* an SOP's own page (header) */
.sop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.sop-head h1 { font-size: 32px; margin: 2px 0 4px; }
.sop-head p { margin: 0; }
.sop-eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sop-eyebrow span { margin: 0 4px; color: var(--line); }

@media (max-width: 640px) {
  .ask-card { padding: 16px; }
  .ask-form .ask-q { font-size: 19px; }
  .ask-foot { flex-direction: column; align-items: stretch; }
  .button.ask-go { width: 100%; text-align: center; }
  .sop-key { display: none; }
  .sop-dept > summary { padding: 12px 14px; }
  .sop-dept h3 { font-size: 16px; }
  details.ask-scope > summary .muted { display: none; }
  .sop-head h1 { font-size: 26px; }
}

/* an SOP's own page: facts once at the top, then the steps as a real list */
.sop-page { max-width: 860px; }
.sop-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 0; font-size: 13px; }
.sop-facts div { display: flex; flex-direction: column; }
.sop-facts b { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.sop-body { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.sop-body h3 { font-family: var(--body); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.sop-body h3:first-child { margin-top: 0; }
.sop-body p { margin: 0 0 10px; }
.sop-body ol { counter-reset: step; list-style: none; margin: 0 0 12px; padding: 0; }
.sop-body ol li { counter-increment: step; position: relative; padding: 8px 0 8px 40px; border-top: 1px solid #EEEDE6; }
.sop-body ol li:first-child { border-top: 0; }
.sop-body ol li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(51,101,138,.1); color: var(--blue); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.sop-body ul { margin: 0 0 12px; padding-left: 20px; }
.sop-body ul li { margin: 4px 0; white-space: pre-line; }
.sop-caution { background: var(--warn-bg); border-left: 3px solid #C98A3C; border-radius: 6px; padding: 10px 14px; margin: 10px 0; }
.sop-caution b { color: #8A5A1E; }
.sop-prov { font-size: 12px; color: var(--muted); margin: 0 2px 18px; }
@media (max-width: 640px) { .sop-body { padding: 16px; font-size: 14px; } }

/* Meagan's wish list (11/20): key facts as bullets, the rule pick list and its "Another rule" box */
ul.key-facts { margin: 4px 0 10px 18px; padding: 0; }
ul.key-facts li { margin: 2px 0; }
select.rule-pick { max-width: 100%; }
input.rule-other { margin-top: 6px; }

/* ---------- The agent dashboard (Jeremy 11/23): cards, one colour rule (green hit, yellow halfway, red under halfway),
   small charts; on a phone the cards stack in the same order and nothing scrolls sideways ---------- */
.dashpage { --st-hit: #3B7A57; --st-hit-bg: #E6F2EA; --st-half: #8A6100; --st-half-bg: #FBF1D6; --st-low: #A64B3C; --st-low-bg: #F8E6E2; }
.agentflow.dashpage .stepn { display: none; }
.dashpage .dashbar { margin: 4px 0 14px; }
.dashpage .dashbar .periodpick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; min-width: 0; }
.dlabel { font-size: 12px; color: var(--muted); letter-spacing: .3px; margin: 0 0 4px; }
.dlabel.dsection { font-size: 13px; color: var(--ink); font-weight: 600; margin: 18px 0 8px; }
.dlabel.detailhead { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 26px; font-size: 15px; }
.dval { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.dsub { font-size: 12px; color: var(--muted); font-weight: 400; }
.pace .pacehead { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.pace .hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pace .heronum { font-family: var(--head); font-size: 56px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pace .herosub { font-size: 16px; color: var(--muted); }
.pace .pacestatus { text-align: right; }
.pace .practice { display: inline-block; font-size: 11px; border: 1px dashed var(--line); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.pace .progbar.big { position: relative; height: 16px; background: var(--linen); border-radius: 8px; margin: 14px 0 6px; }
.pace .progbar.big .progfill { height: 100%; border-radius: 8px; background: var(--blue); }
.pace .progbar.big .progmark { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.pace .progscale { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pace .pacefoot { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.spill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 3px 8px; white-space: normal; }
.spill.st-hit { background: var(--st-hit-bg); color: var(--st-hit); }
.spill.st-half { background: var(--st-half-bg); color: var(--st-half); }
.spill.st-low { background: var(--st-low-bg); color: var(--st-low); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.kpis .kpi { margin-bottom: 0; border-top-width: 4px; }
.kpis .kpi.st-hit { border-top-color: var(--st-hit); }
.kpis .kpi.st-half { border-top-color: #D9A400; }
.kpis .kpi.st-low { border-top-color: var(--st-low); }
.kpis .kpival { font-size: 28px; font-weight: 600; color: var(--ink); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.kpis .kpitgt { font-size: 15px; font-weight: 400; color: var(--muted); }
.kpis.results { margin-top: 12px; margin-bottom: 12px; }
.kpis.results .kpival { font-size: 22px; }
.dashpage .legend { margin: 6px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.dashpage .legend .lkey { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.coach { border-left: 4px solid var(--blue); }
.coach .coachline { font-size: 16px; font-weight: 600; color: var(--ink); margin: 2px 0 6px; }
.dgrid { display: grid; gap: 12px; }
.dgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dgrid > .dcard { margin-bottom: 0; }
.dgrid + .dgrid, .dgrid + .dlabel { margin-top: 12px; }
svg.trend { width: 100%; height: auto; display: block; margin-top: 6px; }
svg.trend .bar { fill: var(--blue); }
svg.trend .bar.st-hit { fill: var(--st-hit); }
svg.trend .bar.st-half { fill: #D9A400; }
svg.trend .bar.st-low { fill: var(--st-low); }
svg.trend .bar.partial { opacity: .45; }
svg.trend .tgt { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
svg.trend .tick { font-size: 10px; fill: var(--muted); font-family: var(--body); }
.fbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 40px; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; }
.fbar .flab { color: var(--muted); }
.fbar .ftrack { height: 12px; background: var(--bg); border-radius: 0 4px 4px 0; }
.fbar .ffill { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; min-width: 2px; }
.fbar .fnum { text-align: right; font-weight: 600; color: var(--ink); }
.drow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--bg); }
.dcard .capbar { margin: 8px 0 4px; }
.rank details.more > summary { margin-top: 8px; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dgrid.two, .dgrid.three { grid-template-columns: minmax(0, 1fr); }
  .pace .heronum { font-size: 44px; }
  .pace .pacestatus { text-align: left; }
  .fbar { grid-template-columns: 100px minmax(0, 1fr) 34px; }
  .dcard { padding: 12px 14px; }
}

/* ---------- The week against the goal (t1290, 11/20): agent page and team page ---------- */
.goalweeks td.met, .teamword td.met { color: var(--good); font-weight: 700; }
.goalweeks td.short, .teamword td.short { color: var(--bad); }
.goalweeks tr.target td, .teamword tr.target td { background: var(--linen); }
.goalweeks .weeknav { float: right; display: inline-flex; gap: 6px; font-size: 15px; }
.goalweeks .status { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.goalweeks .status.set { background: #e6f2ea; color: var(--good); }
.goalweeks .status.default { border: 1px dashed var(--line); color: var(--muted); }
.goalweeks table { white-space: nowrap; }

/* ---------- The agent's own page (11/23, Jeremy's 11/22 rules): one column, numbered steps, nothing sideways ---------- */
.agentflow { max-width: 940px; }
.agentflow .agenthead { margin-bottom: 16px; }
.agentflow .astep > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.agentflow .astep h3 { font-size: 15px; margin: 18px 0 6px; }
.agentflow .stepn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-deep); color: #fff; font-size: 14px; font-weight: 700; flex: none; }
.agentflow .lede { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.agentflow .goalline { margin: 0 0 12px; font-size: 14px; }
.agentflow .status { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border-radius: 4px; padding: 2px 8px; margin-right: 4px; }
.agentflow .status.set { background: #e6f2ea; color: var(--good); }
.agentflow .tiles { margin-bottom: 8px; }
.agentflow .answer { font-size: 15px; line-height: 1.55; margin: 8px 0; }
.agentflow .progbar { position: relative; height: 14px; background: var(--linen); border-radius: 7px; margin: 10px 0 4px; }
.agentflow .progfill { height: 100%; background: var(--blue); border-radius: 7px; }
.agentflow .progmark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--blue-deep); border-radius: 2px; }
.agentflow .periodpick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.agentflow table.fit { width: 100%; }
.agentflow table.fit td, .agentflow table.fit th { white-space: normal; }
.agentflow .goalweeks table { white-space: normal; }
.agentflow table.board tr.gaprow td { text-align: center; color: var(--muted); padding: 2px; }
.agentflow details.more { margin-top: 10px; }
.agentflow details.more > summary { cursor: pointer; color: var(--blue-deep); font-size: 14px; }
.agentflow details.more[open] > summary { margin-bottom: 8px; }
:is(.agentflow, .companyflow, .pipeflow) table.data.stack td.wrap { white-space: normal; min-width: 200px; }
/* the deals tables wrap inside the page on a computer instead of running off the right edge (agent walk 11/23: Expected pay and
   the form column were cut off at 1280 wide) */
.agentflow table.data.dealtable { width: 100%; }
.agentflow table.data.dealtable th, .agentflow table.data.dealtable td, .agentflow table.data.dealtable td:not(.wrap) { white-space: normal; }
.agentflow table.data.dealtable td.wrap { min-width: 150px; }
/* the agent's own words (11/23): My why, What's standing in your way, My notes; Reagan's line over the weeks */
.agentflow .focusline { background: var(--linen); color: var(--blue-deep); border-radius: 8px; padding: 10px 14px; font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.agentflow .wordbox { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.agentflow .wordbox textarea { width: 100%; box-sizing: border-box; font-family: var(--body); font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; }
.agentflow .wordfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.agentflow .wordfoot .fine { margin: 0; }
.agentflow .said { white-space: pre-wrap; font-size: 15px; line-height: 1.5; margin: 6px 0; }
/* the monthly one-on-ones (11/23): one line per agent on the team lists, the form's date box like its text boxes */
.oneline { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.agentflow .oneform input[type=date] { font-family: var(--body); font-size: 15px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 100%; }
.agentflow .oneitem .onenums { margin: 2px 0 6px; }
.agentflow details.callmore { margin-top: 4px; font-size: 13px; }
.agentflow details.callmore > summary { cursor: pointer; color: var(--blue-deep); }
.agentflow details.callmore p { margin: 6px 0; white-space: normal; }
.wayline { white-space: pre-wrap; margin: 8px 0; line-height: 1.5; }
/* the deal rate on the Team page (t1754, 11/23) */
.dealrate .rateline { margin: 4px 0 14px; line-height: 1.5; }
.dealrate .rateline .big { font-size: 26px; color: var(--blue); margin-right: 4px; }
.dealrate .chart { margin-bottom: 12px; }
.dealrate h3.sub, .table-wrap h3.sub { font-size: 15px; margin: 18px 0 8px; }
.older { display: block; font-size: 11px; font-weight: 400; white-space: nowrap; }

/* ---------- Phones (Jeremy 11/19, before agents get TRAC and Ask Chuck): one pass for every screen ----------
   Kept last so it wins over the desktop rules above. The page must never be wider than the phone: a wide table scrolls
   sideways inside its own box (ledger.js wraps any that has no box), never the whole page. */
@media (max-width: 640px) {
  /* top bar: brand and Sign out on the first row, the menu on its own row under them, wrapping instead of running off */
  /* saved to the home screen, TRAC runs under the phone's clock bar: the blue top bar reaches up behind it */
  .top { flex-wrap: wrap; height: auto; padding: max(10px, env(safe-area-inset-top)) 12px 4px; gap: 2px 10px; }
  .brand { order: 1; gap: 8px; white-space: nowrap; }
  .wordmark { font-size: 18px; }
  .who { order: 2; }
  .who .out { padding: 8px 4px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: wrap; margin: 0 0 0 -8px; gap: 0 2px; }
  .nav a, .navmenu summary { padding: 10px 8px; white-space: nowrap; }
  .navmenu .menu a { padding: 12px 10px; }
  /* every tile row two across */
  .tiles, .tiles.three, .tiles.four, .tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px; }
  .tile .value { font-size: 26px; }
  /* 16px stops an iPhone from zooming the page in when a box is tapped */
  input, select, textarea { font-size: 16px !important; }
  .filters select, .filters.explorer input[type=text], .filters.explorer input[type=month] { min-width: 0; max-width: 100%; }
  .filters, .filters.explorer { gap: 10px; }
  .filters label { min-width: 0; max-width: 100%; }
  .period a { padding: 8px 10px; }
  /* the deal search: two boxes a row instead of one long column */
  .filters.explorer > label:not(.check) { flex: 1 1 calc(50% - 10px); }
  .filters.explorer > label:not(.check) input, .filters.explorer > label:not(.check) select { width: 100%; }
  .filters .check { flex: 1 1 100%; padding: 4px 0; }
  /* list tables keep each row on one line and scroll sideways, instead of every name wrapping into a tall row */
  table.data td:not(.wrap) { white-space: nowrap; }
  /* a table with no box of its own scrolls inside the one ledger.js puts round it */
  .phone-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-wrap { padding: 12px; }
  .asof { text-align: left; max-width: none; }
  .foot { flex-direction: column; gap: 4px; }
  table.kv td:first-child, table.kv th { width: auto; }
  /* Net agent growth, one office (11/22): the four quarter boxes two across; the side-on quarter table keeps its own box */
  .fields.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growthflow table.sideways { font-size: 12px; }
  .growthflow table.data.fit td, .growthflow table.data.fit th { white-space: normal; padding-left: 4px; padding-right: 4px; }
  /* the agent page (11/23): small tables fit the phone; wide ones become one card per row, each value under its column name */
  .agentflow table.fit { font-size: 13px; }
  .agentflow table.fit td, .agentflow table.fit th { white-space: normal; padding-left: 4px; padding-right: 4px; }
  .agentflow table.data.fit td:not(.wrap) { white-space: normal; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack thead { display: none; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack, :is(.agentflow, .companyflow, .pipeflow) table.stack tbody, :is(.agentflow, .companyflow, .pipeflow) table.stack tfoot, :is(.agentflow, .companyflow, .pipeflow) table.stack tr { display: block; width: 100%; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; background: var(--surface); }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td, :is(.agentflow, .companyflow, .pipeflow) table.data.stack td:not(.wrap) { display: block; border: 0; padding: 4px 0; white-space: normal; text-align: right; min-width: 0; overflow: hidden; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td::before { content: attr(data-label); float: left; color: var(--muted); font-size: 12px; text-align: left; max-width: 45%; margin-right: 12px; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td.wrap { text-align: left; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td.wrap::before { float: none; display: block; margin-bottom: 2px; max-width: none; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td[colspan] { display: block; text-align: left; }
  :is(.agentflow, .companyflow, .pipeflow) table.stack td:empty, :is(.agentflow, .companyflow, .pipeflow) table.data.stack td:not(.wrap):empty { display: none; }
  .agentflow table.fit th { font-size: 11px; letter-spacing: 0; text-transform: none; }
  .agentflow .tablebar, .companyflow .tablebar, .pipeflow .tablebar { flex-wrap: wrap; }
  .agentflow .tablebar .filter, .companyflow .tablebar .filter, .pipeflow .tablebar .filter { flex: 1 1 100%; min-width: 0; }
  /* How we're doing (11/23): office tables fit the phone */
  .companyflow table.fit { font-size: 12px; }
  .companyflow table.fit th { font-size: 10px; letter-spacing: 0; text-transform: none; padding-left: 3px; padding-right: 3px; }
  .companyflow table.fit td { padding-left: 3px; padding-right: 3px; }
  .companyflow .sum.three { grid-template-columns: minmax(0, 1fr); }
}
