/* Tap drill tools use the shared light reference-page layout. */
.conv-out-rows { display:grid; grid-template-columns:1fr 1fr; }
.conv-out-cell { padding:18px 12px 18px 0; border-bottom:1px solid var(--border); min-width:0; }
.conv-out-cell:nth-child(even) { padding-left:15px; }
.conv-out-cell-k { color:var(--dim); font:10px/1.6 'Share Tech Mono',monospace; text-transform:uppercase; }
.conv-out-cell-v { color:var(--text); font-size:19px; line-height:1.4; margin-top:7px; letter-spacing:-.025em; }
.conv-out-cell-v small { display:block; font-size:12px; color:var(--muted); margin-top:5px; letter-spacing:0; }
.gauge-page .conv-stock { display:block; color:var(--muted); font-size:13px; line-height:1.8; }
.gauge-page .conv-stock a { display:inline; }
.gc-caret { display:inline-block; margin-left:7px; color:var(--muted); font-size:11px; }
.gc-row { cursor:pointer; }
.gc-row.open .gc-caret { transform:rotate(90deg); }
.gc-in { display:block; font:14px/1.6 'IBM Plex Mono',monospace; color:var(--text); }
.gc-mm { display:block; color:var(--muted); font:12px/1.6 'IBM Plex Mono',monospace; }
.gc-detail { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.gc-dpanel { padding:24px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:#f3f0e8; }
.gc-dpanel-head { display:flex; justify-content:space-between; gap:16px; margin-bottom:20px; }
.gc-dpanel-name { font-size:19px; letter-spacing:-.035em; }
.gc-dpanel-thk { font:13px 'IBM Plex Mono',monospace; }
.gc-dspecs { display:grid; grid-template-columns:1fr 1fr; gap:15px; margin-bottom:20px; }
.gc-dspec-k, .gc-dstock-label { font:10px/1.7 'Share Tech Mono',monospace; text-transform:uppercase; color:var(--dim); }
.gc-dspec-v { font-size:16px; margin-top:5px; }
.gc-dsku { display:flex; flex-wrap:wrap; align-items:center; gap:8px; border-top:1px solid var(--border); padding:14px 0; }
.gc-dsku-name { font-size:12px; }
.gc-dsku-thk { font:11px 'IBM Plex Mono',monospace; }
.gc-dsku-btn { border:1px solid var(--border-md); background:#fffefa; padding:8px 10px; margin-left:auto; color:var(--text); font-size:11px !important; cursor:pointer; }
.gc-dnone { color:var(--muted); font-size:12px; line-height:1.7; }
    /* ── HERO LOOKUP: concentric hole diagram ── */
    .tl-diagram {
      background: var(--bg); border: 1px solid var(--border);
      padding: 10px; margin-bottom: 18px;
      display: flex; align-items: center; justify-content: center;
    }
    .tl-diagram svg { width: 100%; max-width: 340px; height: auto; display: block; }
    .tl-legend { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 14px; margin-bottom: 18px; }
    .tl-leg {
      display: flex; align-items: center; gap: 8px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; letter-spacing: 0.04em; color: var(--muted);
    }
    .tl-leg i { width: 12px; height: 12px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.2); }
    .tl-leg b { color: var(--text); font-weight: 700; }

    /* ── PRESETS for the thread-percentage control ── */
    .pct-presets { display: flex; flex-wrap: wrap; gap: 6px; }
    .pct-preset {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      padding: 5px 10px; background: var(--surface); border: 1px solid var(--border-md);
      font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted);
      cursor: pointer; transition: all 0.14s; white-space: nowrap;
    }
    .pct-preset:hover { border-color: var(--accent-br); color: var(--text); }
    .pct-preset.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
    .pct-range { display: flex; align-items: center; gap: 10px; min-width: 210px; }
    .pct-range input[type=range] { flex: 1; accent-color: var(--accent); min-width: 110px; }
    .pct-range output {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 13px; font-weight: 700; color: var(--accent-ink);
      min-width: 46px; text-align: right;
    }

    /* Seven columns need tighter gutters than the five-column gauge
       chart these styles came from. */
    table.gc-table { min-width: 1060px; }
    table.gc-table th, table.gc-table td { padding-left: 13px; padding-right: 13px; }

    /* ── THREAD COLUMN ── */
    .td-thread { width: 126px; white-space: nowrap; }
    .td-thread-name {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
      display: block;
    }
    .td-thread-sub {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; letter-spacing: 0.06em; color: var(--dim);
      display: block; margin-top: 3px;
    }
    .td-std-badge {
      display: inline-block; margin-top: 6px; margin-right: 5px; padding: 2px 6px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
      background: var(--bg); border: 1px solid var(--border-md); color: var(--dim);
    }
    .td-std-badge.coarse { background: var(--accent-dim); border-color: var(--accent-br); color: var(--accent-ink); }

    /* ── DRILL CELLS ── */
    .td-drill { min-width: 136px; width: 158px; }
    .td-drill-label {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1;
      display: block; letter-spacing: -0.01em;
    }
    .td-drill-dec {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 12px; color: var(--muted); display: block; margin-top: 3px;
    }
    .td-pct {
      display: inline-block; margin-top: 6px; padding: 2px 7px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
      background: var(--accent-dim); border: 1px solid var(--accent-br); color: var(--accent-ink);
    }
    .td-pct.hot { background: rgba(205,66,70,0.10); border-color: rgba(205,66,70,0.28); color: var(--red-ink); }
    .td-pct.easy { background: var(--green-dim); border-color: rgba(35,133,81,0.25); color: var(--green-ink); }
    /* the live column earns a tint so it reads as the answer */
    td.td-live, th.td-live { background: rgba(45,114,210,0.045); box-shadow: inset 1px 0 0 var(--accent-br), inset -1px 0 0 var(--accent-br); }
    th.td-live .gc-th-name { color: var(--accent-ink); }
    .gc-row:hover > td.td-live { background: rgba(45,114,210,0.09); }

    /* ── CLEARANCE CELL ── */
    .td-clr { min-width: 152px; width: 182px; }
    .td-clr-row {
      display: flex; align-items: baseline; gap: 8px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 12px; padding: 2px 0;
    }
    .td-clr-row + .td-clr-row { border-top: 1px dotted var(--border); }
    .td-clr-k { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); width: 52px; flex-shrink: 0; }
    .td-clr-v { font-weight: 700; color: var(--text); }
    .td-clr-d { color: var(--muted); margin-left: auto; }

    /* ── SHEET VERDICT ── */
    .td-verdict { min-width: 178px; width: 248px; }
    .vd {
      display: inline-flex; align-items: center; gap: 7px;
      padding: 4px 9px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
      line-height: 1.3;
    }
    .vd::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
    .vd.ok   { color: var(--green-ink);  background: var(--green-dim);            border: 1px solid rgba(35,133,81,0.28); }
    .vd.warn { color: var(--orange);     background: rgba(200,118,25,0.10);       border: 1px solid rgba(200,118,25,0.30); }
    .vd.bad  { color: var(--red-ink);    background: rgba(205,66,70,0.09);        border: 1px solid rgba(205,66,70,0.26); }
    .vd-note {
      display: block; margin-top: 5px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; color: var(--muted); line-height: 1.5;
    }
    .vd-note a { color: var(--accent-ink); font-weight: 700; text-decoration: none; }
    .vd-note a:hover { text-decoration: underline; }
    .td-tapped {
      display: inline-block; margin-top: 6px; padding: 2px 7px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
      background: var(--text); color: var(--white);
    }

    /* ── REVERSE LOOKUP ── */
    .rev-shell { display: grid; grid-template-columns: 320px minmax(0,1fr); border: 1px solid var(--border-md); background: var(--surface); }
    .rev-side { background: var(--bg); border-right: 1px solid var(--border-md); padding: 24px; }
    .rev-out { padding: 24px 26px 26px; min-width: 0; }
    .rev-hit {
      display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
      padding: 12px 0; border-bottom: 1px solid var(--border);
    }
    .rev-hit:last-child { border-bottom: none; }
    .rev-hit-name {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 16px; font-weight: 700; color: var(--text); min-width: 92px;
    }
    .rev-bar { flex: 1; min-width: 120px; height: 8px; background: var(--border); position: relative; }
    .rev-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
    .rev-hit-pct {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 13px; font-weight: 700; color: var(--accent-ink); width: 58px; text-align: right;
    }
    .rev-empty { color: var(--dim); font-size: 13px; font-style: italic; padding: 30px 0; }

    /* ── HOLE-ROUTE BAND CHART ──
       One row per thread, thickness on the x axis, coloured by what
       has to happen to the hole at that thickness. */
    .hr-shell { border: 1px solid var(--border-md); background: var(--surface); padding: 22px 26px 26px; }
    .hr-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; }
    .hr-leg {
      display: inline-flex; align-items: center; gap: 8px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; letter-spacing: 0.04em; color: var(--muted);
    }
    .hr-leg i { width: 14px; height: 11px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.14); }
    .hr-axis { position: relative; height: 26px; margin-left: 116px; border-bottom: 1px solid var(--border-md); }
    .hr-tick { position: absolute; bottom: 0; width: 1px; height: 7px; background: var(--border-md); }
    .hr-tick span {
      position: absolute; bottom: 9px; left: 0; transform: translateX(-50%);
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 9px; color: var(--dim); white-space: nowrap;
    }
    .hr-stock { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(45,114,210,0.28); }
    .hr-row { display: flex; align-items: center; gap: 0; height: 30px; }
    .hr-row:hover .hr-track { outline: 1px solid var(--accent-br); }
    .hr-label {
      width: 116px; flex-shrink: 0; padding-right: 12px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 12px; font-weight: 700; color: var(--text);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .hr-label small { font-weight: 400; color: var(--dim); }
    .hr-track { position: relative; flex: 1; height: 17px; background: var(--bg); min-width: 0; }
    .hr-seg { position: absolute; top: 0; bottom: 0; }
    .hr-seg.no    { background: repeating-linear-gradient(45deg, #E5E8EB 0 4px, #EDEFF2 4px 8px); }
    .hr-seg.good  { background: rgba(35,133,81,0.45); }
    .hr-seg.taper { background: rgba(200,118,25,0.55); }
    .hr-seg.drill { background: repeating-linear-gradient(45deg, rgba(205,66,70,0.38) 0 4px, rgba(205,66,70,0.18) 4px 8px); }
    .hr-vline { position: absolute; top: -2px; bottom: -2px; width: 1px; background: rgba(45,114,210,0.30); pointer-events: none; }
    .hr-note { font-size: 12.5px; line-height: 1.65; color: var(--muted); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
    .hr-note strong { color: var(--text); }
    .hr-note code {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 12px; font-weight: 700; color: var(--accent-ink);
    }

    /* the hole-route chip in the chart's verdict column */
    .vd-route {
      display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
      padding: 3px 8px;
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
      border: 1px solid; line-height: 1.3;
    }
    .vd-route.good  { color: var(--green-ink); background: var(--green-dim);            border-color: rgba(35,133,81,0.28); }
    .vd-route.taper { color: var(--orange);    background: rgba(200,118,25,0.10);       border-color: rgba(200,118,25,0.28); }
    .vd-route.drill { color: var(--accent-ink);background: var(--accent-dim);           border-color: var(--accent-br); }

    @media (max-width: 700px) {
      .hr-axis { margin-left: 84px; }
      .hr-label { width: 84px; font-size: 11px; }
    }

    /* ── TORQUE / STRENGTH TRADE CARD ── */
    .trade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .trade-card {
      background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent);
      padding: 20px 20px 22px;
    }
    .trade-pct {
      font-family: 'Barlow Condensed', 'Inter', sans-serif;
      font-size: 40px; font-weight: 800; line-height: 0.9; color: var(--text);
    }
    .trade-for {
      font-family: 'IBM Plex Mono', ui-monospace, monospace;
      font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
      color: var(--accent-ink); font-weight: 700; margin: 8px 0 10px;
      padding-top: 9px; border-top: 1px solid var(--border);
    }
    .trade-desc { font-size: 12.5px; line-height: 1.6; color: var(--muted); }

    /* ── RESPONSIVE ── */
    @media (max-width: 1180px) {
      .trade-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 960px) {
      .rev-shell { grid-template-columns: 1fr; }
      .rev-side { border-right: none; border-bottom: 1px solid var(--border-md); }
      .tl-legend { grid-template-columns: 1fr; }
    }
    @media (max-width: 700px) {
      .trade-grid { grid-template-columns: 1fr; }
    }

    /* Pin the thread name while the drill columns scroll past. */
    @media (max-width: 1024px) {
      table.gc-table th.td-thread,
      table.gc-table td.td-thread {
        position: sticky; left: 0; z-index: 6;
        background: var(--surface);
        box-shadow: 1px 0 0 var(--border-md);
      }
      table.gc-table th.td-thread { background: var(--bg); z-index: 7; }
      .gc-row:hover > td.td-thread { background: var(--card-hover); }
      .gc-row.open > td.td-thread { background: #E7EFFB; }
    }

    @media print {
      .rev-shell, .tl-diagram, #reverse, #trade { display: none !important; }
      td.td-live { background: none !important; box-shadow: none !important; }
    }

.tap-page { --white:#fffefa; --card:#faf9f5; --accent-br:#9cacae; --red:#a33b29; }
.tap-page .size-hero h1 { font-size:clamp(60px,7.2vw,112px); }
.tap-page .size-hero-title { grid-template-columns:1.15fr 1fr; gap:6vw; }
.tap-page .detail-section>.section-title { margin-bottom:25px; }
.tap-page .detail-section>.section-sub { max-width:1060px; margin-bottom:38px; }
.tap-page .conv-stock { display:block; font-size:13px; line-height:1.8; }
.tap-page .conv-out-big { font-size:clamp(36px,4vw,58px); }
.tap-page .conv-out-alt { color:var(--muted); }
.tap-page .tl-diagram { border:0; background:#edeae2; padding:20px; }
.tap-page .tl-diagram svg { max-width:240px; }
.tap-page .tl-legend { gap:12px 16px; margin-bottom:28px; }
.tap-page .tl-leg { flex-wrap:wrap; letter-spacing:0; line-height:1.7; }
.tap-page .pct-preset { font-size:12px; min-height:42px; font-weight:400; letter-spacing:0; }
.tap-page .pct-preset.on { background:#20201e; border-color:#20201e; color:#fffefa; }
.tap-page .gc-table { min-width:1160px; }
.tap-page .gc-table th.td-thread { z-index:4; background:#e6e2d8; }
.tap-page .gc-table td.td-thread { z-index:3; background:#faf9f5; }
.tap-page .gc-table .td-thread { position:sticky; left:0; border-right:1px solid var(--border); }
.tap-page .gc-table .td-live { background:#e9eee8; box-shadow:inset 1px 0 var(--border-md),inset -1px 0 var(--border-md); }
.tap-page .gc-table tr:hover .td-live { background:#dce5dc; }
.tap-page .gc-table .gc-detail-row>td { padding:0; }
.tap-page .gc-row.open>td.td-thread { background:#e8e4da; }
.tap-page .td-thread-name,.tap-page .td-drill-label { font-weight:500; }
.tap-page .vd { white-space:normal; }
.tap-page .cmp-side-title { font:11px/1.7 'Share Tech Mono',monospace; color:var(--dim); margin-bottom:22px; text-transform:uppercase; }
.tap-page .trade-grid { gap:26px; }
.tap-page .trade-card { border:0; border-top:2px solid var(--border-md); background:transparent; padding:25px 0 0; }
.tap-page .trade-pct { font:400 46px/1.1 Inter,sans-serif; letter-spacing:-.05em; }
.tap-page .trade-for { font:400 18px/1.4 Inter,sans-serif; color:var(--text); text-transform:none; letter-spacing:-.025em; border:0; margin:16px 0; padding:0; }
.tap-page .trade-desc { font-size:14px; line-height:1.8; }
.tap-page .hr-scroll { overflow-x:auto; border:1px solid var(--border-md); scrollbar-color:#aaa498 #f5f3ed; }
.tap-page .hr-shell { min-width:700px; border:0; }
.tap-page .hr-note { margin-top:20px; }
.tap-page .table-help { font-size:12px; color:var(--muted); margin-bottom:18px; }
@media(max-width:760px) {
  .tap-page .size-hero-title { grid-template-columns:1fr; gap:35px; }
  .tap-page .size-hero h1 { font-size:clamp(48px,12.6vw,88px); }
  .tap-page .tl-legend { grid-template-columns:1fr 1fr; }
  .tap-page .trade-grid { grid-template-columns:1fr 1fr; }
  .tap-page .gc-toolbar { gap:14px; }
  .tap-page .pct-range { width:100%; }
}
@media(max-width:380px) { .tap-page .conv-row,.tap-page .trade-grid,.tap-page .tl-legend { grid-template-columns:1fr; } }
@media print {
  #lookup,#sheet,#hole,#reverse,#trade,.size-index,.size-ending,.gc-detail-row { display:none!important; }
  .tap-page .gc-table { min-width:0; }
  .tap-page .gc-table .td-thread { position:static; }
  .tap-page .gc-table th,.tap-page .gc-table td { padding:5px; }
}

.tap-page .td-clr-v,.tap-page .td-clr-d { white-space:nowrap; }
