/* The Treble job: Theatre of Stones (Making the Call, Level 2).
   Builds on profit-and-loss.css (layout, options, feedback), sales-price-quantity.css (speed round),
   move-the-needle.css (tags, facts, revealed cards), pull-the-lever.css and not-every-dollar.css (four-button speed round, reminder). */

/* Tag colours for this lesson: Best call, Safer bet, Bigger bet, Backfires */
.tj-room .mn-tag.best{background:var(--goodbg);color:var(--green)}
.tj-room .mn-tag.safe{background:#e5eef8;color:#1d4b78}
.tj-room .mn-tag.big{background:var(--amberbg);color:var(--amber)}
.tj-room .mn-tag.back{background:var(--tint);color:var(--dark)}
.tj-room .pl-option.picked-mid{background:#e5eef8;border-color:#1d4b78;color:var(--ink)}

/* The line: six boxes, coloured like Scott's diagram */
.tj-line{list-style:none;margin:0;padding:12px 16px 4px;display:grid;gap:6px}
.tj-line li{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 8px 14px;border:2px solid var(--line);border-radius:10px;background:#fff;font-size:13px;font-weight:800;line-height:1.3}
.tj-line li::before{content:'';position:absolute;left:-2px;top:-2px;bottom:-2px;width:7px;border-radius:10px 0 0 10px;background:var(--c)}
.tj-line li+li::after{content:'';position:absolute;left:50%;top:-8px;width:2px;height:6px;background:var(--line)}
.tj-line .c1{--c:#e8743b}.tj-line .c2{--c:#1e6b2a}.tj-line .c3{--c:#1a9bd7}.tj-line .c4{--c:#9b2a8f}.tj-line .c5{--c:#4ea72e}.tj-line .c6{--c:#e8743b}
.tj-line .now{border-color:var(--ink);box-shadow:0 2px 0 var(--ink)}
.tj-line .now .tj-here{display:inline-block}
.tj-here{display:none;font-size:10px;letter-spacing:.06em;text-transform:uppercase;background:var(--ink);color:#fff;border-radius:999px;padding:1px 7px;margin-left:6px;vertical-align:1px}
.tj-cost{font-variant-numeric:tabular-nums;color:var(--muted);font-weight:800;white-space:nowrap}
.tj-line .hit .tj-cost{color:var(--dark)}
.tj-line .hit{background:var(--tint)}
.tj-q{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--amber);color:#fff;font-size:12px;font-weight:900;margin-left:6px}
@media(prefers-reduced-motion:no-preference){.tj-line .new{animation:tj-flash 1.4s ease-out 2}}
@keyframes tj-flash{0%,100%{background:var(--tint)}50%{background:#f0b9bc}}

/* The tally under the line */
.tj-tally{margin:10px 16px 0;width:calc(100% - 32px);border-collapse:collapse;font-size:13px}
.tj-tally th{text-align:left;font-weight:600;padding:5px 0;color:var(--muted)}
.tj-tally td{text-align:right;font-weight:800;padding:5px 0;font-variant-numeric:tabular-nums;white-space:nowrap}
.tj-tally .sub>*{border-top:1px solid var(--line)}
.tj-tally .left>*{border-top:2px solid var(--ink);font-weight:900;color:var(--ink);font-size:15px}
.tj-tally .extra td{color:var(--dark)}

/* Mark's texts */
.tj-texts{margin:18px 0;display:grid;gap:8px;justify-items:start}
.tj-text{position:relative;max-width:30ch;background:#e9e9ee;border-radius:18px 18px 18px 4px;padding:9px 14px;font-weight:900;font-size:15px;letter-spacing:.02em;color:var(--ink)}
.tj-text small{display:block;font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:2px}
.tj-mark{margin:14px 16px 0;padding:10px 12px;border-radius:12px;background:var(--wash);font-size:12px;color:var(--muted);font-weight:700}
.tj-mark .tj-text{display:inline-block;margin-top:4px;font-size:14px;background:#fff}
.tj-mark.m1 .tj-text{background:var(--amberbg);color:var(--amber)}
.tj-mark.m2 .tj-text{background:var(--tint);color:var(--dark)}

/* Eric's note */
.tj-note{margin:18px 0;max-width:420px;background:#fff7c2;border-radius:4px;padding:14px 18px;transform:rotate(-1.2deg);box-shadow:0 3px 0 #0001;font-style:italic;font-size:17px;line-height:1.45}
.tj-note b{display:block;font-style:normal;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--amber);margin-bottom:4px}

/* Where we are on the line, above each decision */
.tj-where{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center;margin:0 0 14px;font-size:12px;font-weight:800;color:var(--muted)}
.tj-where span{padding:3px 9px;border-radius:999px;background:var(--wash)}
.tj-where .on{background:var(--ink);color:#fff}
.tj-step{display:none;font-weight:800}
@media(max-width:560px){.tj-where span:not(.on){display:none}.tj-step{display:inline}}

/* How a benchtop gets made */
.tj-steps{list-style:none;margin:18px 0 0;padding:0;display:grid;gap:10px;counter-reset:tj}
.tj-steps li{position:relative;padding:12px 16px 12px 58px;border:2px solid var(--line);border-radius:14px;background:#fff;font-size:15px;line-height:1.55}
.tj-steps li::before{counter-increment:tj;content:counter(tj);position:absolute;left:14px;top:12px;width:30px;height:30px;border-radius:8px;background:var(--c);color:#fff;font-weight:900;display:grid;place-items:center}
.tj-steps strong{display:block;font-size:16px}
.tj-steps .c1{--c:#e8743b}.tj-steps .c2{--c:#1e6b2a}.tj-steps .c3{--c:#1a9bd7}.tj-steps .c4{--c:#9b2a8f}.tj-steps .c5{--c:#4ea72e}.tj-steps .c6{--c:#e8743b}
.tj-steps em{font-style:normal;font-weight:800;color:var(--dark)}

/* The two sinks */
.tj-sinks{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}
.tj-sinks figure{margin:0;border:2px solid var(--line);border-radius:14px;background:#fff;padding:12px 14px}
.tj-sinks svg{display:block;width:100%;height:auto}
.tj-sinks figcaption{font-size:14px;line-height:1.5;color:var(--muted);margin-top:8px}
.tj-sinks figcaption strong{display:block;color:var(--ink);font-size:16px}
.tj-rule{font-size:clamp(18px,2.6vw,22px);font-weight:850;color:var(--red);background:var(--tint);border-radius:12px;padding:14px 18px;margin:20px 0;text-align:center;line-height:1.35}

/* The one fact to carry into the first call */
.pl-room .stage .tj-key{margin:20px 0;padding:14px 18px;border-left:5px solid var(--ink);background:var(--wash);border-radius:0 12px 12px 0;font-size:clamp(17px,2.2vw,19px);font-weight:800;line-height:1.45;color:var(--ink)}
.tj-key b{display:block;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}

/* Extra detail, folded away on the start page */
.tj-more{margin:10px 0;border:2px solid var(--line);border-radius:12px;background:#fff}
.tj-more summary{padding:11px 16px;font-weight:800;cursor:pointer}
.tj-more>div{padding:0 16px 14px}
.tj-side-list{margin:6px 0 0;padding-left:18px;display:grid;gap:4px}

/* Glossary */
.tj-gloss{margin:8px 0 0}
.tj-gloss dt{font-weight:800;color:var(--ink);margin-top:8px}
.tj-gloss dd{margin:2px 0 0;line-height:1.5}
.pl-room .stage .tj-gloss-inline{margin-top:18px}

/* What each call cost */
.tj-bill{list-style:none;margin:14px 0 0;padding:0;border:2px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}
.tj-bill li{display:grid;grid-template-columns:1fr auto;gap:2px 14px;padding:9px 14px;border-bottom:1px solid var(--line);font-size:15px;line-height:1.45}
.tj-bill li:last-child{border-bottom:0}
.tj-bill .amt{font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dark)}
.tj-bill small{grid-column:1/-1;font-size:13px;color:var(--muted);font-weight:700}
.tj-bill .none{color:var(--muted)}
.tj-sum{margin-top:12px!important;font-weight:800}
.tj-story{border-left:4px solid var(--line);padding-left:16px}
.pl-room .stage .tj-story p{font-size:16px}
.tj-hint{background:var(--amberbg);border-radius:12px;padding:12px 16px;font-weight:700}

/* The roll */
.tj-roll{display:flex;align-items:center;gap:16px;margin:14px 0;padding:14px 18px;border-radius:14px;background:#fff;border:2px solid var(--line)}
.tj-die{flex:none;width:58px;height:58px;border-radius:12px;background:var(--red);color:#fff;font-size:32px;font-weight:900;display:grid;place-items:center;box-shadow:inset 0 -4px 0 #0003}
.pl-room .stage .tj-roll p{margin:0;font-size:15px;line-height:1.5}
.tj-roll strong{display:block;font-size:17px}
@media(prefers-reduced-motion:no-preference){.tj-die{animation:tj-tumble .7s ease-out}}
@keyframes tj-tumble{0%{transform:rotate(-200deg) scale(.4);opacity:0}100%{transform:none;opacity:1}}

/* The final whistle */
.tj-verdict{display:flex;gap:14px;align-items:flex-start;margin:18px 0;padding:14px 16px;border-radius:14px;background:var(--wash)}
.tj-verdict .tj-text{flex:none}
.pl-room .stage .tj-verdict p{margin:0}
.tj-calls{list-style:none;margin:14px 0 0;padding:0}
.tj-calls li{padding:8px 0;border-bottom:1px solid var(--line);font-size:15px}
.tj-calls li:last-child{border-bottom:0}
.tj-calls .mn-tag{margin-left:6px}

/* Phone: the line and tally in a drop-down above each decision */
.tj-inline{display:none;margin:0 0 18px;border:2px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}
.tj-inline summary{padding:11px 16px;font-weight:800;cursor:pointer}
.tj-inline .tj-tally{margin-bottom:12px}
@media(max-width:720px){.tj-inline{display:block}.tj-side-core{display:none}}

@media(max-width:560px){
  .tj-sinks{grid-template-columns:1fr}
  .tj-steps li{padding-left:52px}
  .tj-roll{align-items:flex-start}
  .tj-verdict{flex-direction:column}
  .tj-room .stage .sq-tally th,.tj-room .stage .sq-tally td{padding:9px 8px;white-space:normal}
}
