/* Shared by the two study previews (study-agent-readiness.html, study-team-cost.html).
   Every colour, radius and font comes from the Tangerine Press tokens in styles.css. */
.study { padding-block: 0 120px; }
.study .page-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.study h2 { font-size: clamp(26px, 2.6vw, 34px); text-wrap: balance; }
.study h1 { text-wrap: balance; }
.study p { text-wrap: pretty; }
.study-block { margin-top: 72px; }
.study-block > p { margin-top: 10px; max-width: 700px; }

/* Dark stat band */
.study-band { margin-top: 8px; padding: 28px; border-radius: var(--r-lg); background: var(--dark); }
.study-band .stat-tiles div { background: var(--dark-card); border-color: var(--dark-line); }
.study-band .stat-tiles strong { color: var(--on-dark); }
.study-band .stat-tiles strong small { font: inherit; font-size: inherit; color: inherit; }
.study-band .stat-tiles span { color: var(--on-dark-body); }
.study-band .stat-tiles span b { color: var(--on-dark); font-weight: 600; }

/* Controls */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 4px 16px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font: 600 14px var(--sans); color: var(--body); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 22px; }
.controls .mono { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.control { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* Horizontal bar chart: one hue, data end rounded, label column left */
.bars { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.bar-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 96px; align-items: center; gap: 14px; min-height: 34px; }
.bar-row + .bar-row { margin-top: 2px; }
.bar-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-label img { flex: none; border-radius: 5px; }
.bar-label span { overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 14px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); transition: width .35s var(--ease); }
.bar-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.bar-value { font-size: 14px; font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { filter: brightness(.92); }
.bar-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; border-radius: 0 3px 3px 0; background: var(--accent); vertical-align: middle; }
.legend i.tick { width: 2px; height: 14px; border-radius: 1px; background: var(--ink); }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }

.tip { position: fixed; z-index: 30; max-width: 280px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); box-shadow: 0 10px 30px -18px rgba(0,0,0,.35); font-size: 13px; color: var(--body); pointer-events: none; opacity: 0; transition: opacity .15s var(--ease); }
.tip.on { opacity: 1; }
.tip b { display: block; color: var(--ink); }

/* Level ladder */
.ladder { display: grid; gap: 8px; margin-top: 18px; }
.ladder li { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(120px, 34%) 64px; align-items: center; gap: 16px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.ladder .lvl { font: 400 34px/1 var(--serif); color: var(--ink); }
.ladder h3 { font-size: 16px; }
.ladder p { margin-top: 2px; font-size: 14px; color: var(--body); }
.ladder .bar-track { height: 12px; }
.ladder .bar-value { font-size: 15px; }

/* Tool chips with logo */
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tool-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tool-chip img { border-radius: 5px; }
.tool-chip.no-logo { padding-left: 12px; }
.text-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; border: 0; background: none; font: 600 14px var(--sans); color: var(--link); cursor: pointer; }
.text-button:hover { text-decoration: underline; }

/* Tables */
.study .data td { font-size: 14px; color: var(--body); }
.study .data td.num, .study .data th.num, .study .data td.cost { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.study .data td.num, .study .data td.cost { color: var(--ink); font-weight: 600; }
.study .data td .muted { color: var(--muted); font-weight: 400; }
.level-pill { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: var(--pill); background: var(--tint); font: 600 13px var(--sans); color: var(--ink); }
.level-pill.l4 { background: var(--ink); color: var(--bg); }
.level-pill.l0 { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.share-cell { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; min-width: 150px; }
.share-cell .bar-track { height: 10px; background: var(--bg); border-radius: 0 4px 4px 0; }
.proof { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; font-size: 13px; color: var(--body); }
.proof.open { display: block; -webkit-line-clamp: unset; }
.proof-item + .proof-item { margin-top: 8px; }
.proof a { color: var(--link); }
.proof-toggle { min-height: 32px; padding: 0; border: 0; background: none; font: 600 13px var(--sans); color: var(--link); cursor: pointer; }
.filter-bar.three { grid-template-columns: 1fr 200px 220px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.pager .seg button { min-height: 36px; padding: 2px 14px; font-size: 13px; }
.pager .seg button:disabled { opacity: .45; cursor: default; }
.empty-row td { color: var(--muted) !important; font-weight: 400 !important; }

/* Gap list */
.gap-list { display: grid; gap: 8px; margin-top: 18px; }
.gap-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 18px; padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 14px; color: var(--body); }
.gap-list .tool-cell { font-weight: 600; color: var(--ink); min-width: 0; }
.gap-list .tool-cell span { overflow: hidden; text-overflow: ellipsis; }
.gap-list b { color: var(--ink); white-space: nowrap; }
.gap-list .x { font: 400 26px/1 var(--serif); color: var(--accent-text); white-space: nowrap; min-width: 64px; text-align: right; }

/* Exclusions */
.excl { display: grid; gap: 8px; margin-top: 18px; }
.excl details { padding: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.excl summary { display: flex; justify-content: space-between; gap: 16px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink); list-style: none; min-height: 32px; align-items: center; }
.excl summary::-webkit-details-marker { display: none; }
.excl summary b { font-variant-numeric: tabular-nums; }
.excl details p { margin-top: 8px; font-size: 13px; color: var(--body); }

/* Method note */
.method { margin-top: 18px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.method ol, .method ul { display: grid; gap: 8px; margin-top: 12px; padding-left: 20px; font-size: 15px; color: var(--body); }
.method ol { list-style: decimal; }
.method ul { list-style: disc; }
.method h3 { margin-top: 22px; font-size: 17px; }
.method h3:first-child { margin-top: 0; }
.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 24px; margin-top: 22px; }

@media (max-width: 860px) {
  .ladder li { grid-template-columns: 40px minmax(0, 1fr) 56px; }
  .ladder li .bar-track { grid-column: 2 / 4; grid-row: 2; }
  .gap-list li { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; }
  .gap-list li .from { display: none; }
  .filter-bar.three { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .study-band { padding: 16px; }
  .bar-row { grid-template-columns: minmax(96px, 120px) 1fr 76px; gap: 10px; }
  .bars { padding: 14px; }
  .stat-tiles strong { font-size: 44px; }
}
.study .data .yes, .study .data .no { white-space: nowrap; }
.amt { white-space: nowrap; }
.text-button[hidden] { display: none; }
/* v4.1 study spacing & link polish */
.study #tldr { margin-top: 36px; }
.study h2.tldr-label { font-size: 17px; margin-bottom: 12px; }
.study .study-block > p a,
.study .method p a,
.study .method li a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  text-underline-offset: 3px;
}
.study .study-block > p a:hover,
.study .method p a:hover,
.study .method li a:hover {
  text-decoration-color: currentColor;
}
