/* Thirteen weeks: the Level 4 profit lesson (Eggs Machina).
   Builds on profit-and-loss.css, sales-price-quantity.css and move-the-needle.css (P&L sidebar, facts, cards). */

/* The P&L has sub-lines under Wages */
.mn-pl .tw-sub th:first-child{padding-left:34px;color:var(--muted)}
.mn-pl-inline .mn-pl .tw-sub th:first-child{padding-left:30px}

/* Sidebar: the target and the key figures */
.tw-target{margin:0;padding:12px 20px;border-bottom:1px solid var(--line);font-size:13px;color:var(--muted);line-height:1.5}
.tw-target strong{display:block;font-size:15px;color:var(--ink);font-weight:800}
.tw-figs{list-style:none;margin:0;padding:6px 20px 12px;font-size:13px;line-height:1.45;color:var(--muted)}
.tw-figs li{padding:5px 0}
.tw-figs b{color:var(--ink)}

/* The four steps on the opening screen */
.tw-steps{margin:18px 0;padding:0;list-style:none;counter-reset:tw;border:2px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}
.tw-steps li{counter-increment:tw;padding:11px 16px 11px 52px;border-bottom:1px solid var(--line);font-size:15px;line-height:1.5;position:relative}
.tw-steps li:last-child{border-bottom:0}
.tw-steps li::before{content:counter(tw);position:absolute;left:16px;top:11px;width:24px;height:24px;border-radius:50%;background:var(--red);color:#fff;font-weight:850;font-size:13px;display:grid;place-items:center}

/* The assumption each idea hangs on */
.tw-hangs{margin:18px 0;padding:12px 16px;border-radius:12px;background:var(--amberbg);border:2px solid #d9c690;font-size:15px;line-height:1.5}
.tw-hangs b{color:var(--amber)}

/* The slip you get after working out an idea, and the same slip on the plan screen */
.tw-slip{margin-top:14px;border:2px solid var(--line);border-radius:12px;background:#fff;padding:12px 16px}
.pl-room .stage .tw-slip p{font-size:14px;line-height:1.5;margin:0}
.pl-room .stage .tw-slip p+p{margin-top:4px}
.tw-slip .tw-name{font-weight:850;font-size:16px!important}
.tw-slip dl{margin:6px 0 0;display:grid;grid-template-columns:auto 1fr;gap:3px 12px;font-size:14px;line-height:1.45}
.tw-slip dt{color:var(--muted);font-weight:700}
.tw-slip dd{margin:0;font-weight:700}
.tw-slip dd.num{font-weight:900;font-variant-numeric:tabular-nums}

/* Plan screen: tick up to three */
.tw-plan{display:grid;gap:10px;margin:18px 0 0}
.tw-pick{width:100%;text-align:left;background:#fff;border:2px solid var(--line);border-radius:13px;padding:12px 16px 12px 50px;color:var(--ink);position:relative;font:inherit;line-height:1.45;transition:background .15s,border-color .15s}
.tw-pick::before{content:"";position:absolute;left:16px;top:14px;width:20px;height:20px;border:2px solid #8a8a96;border-radius:6px;background:#fff}
.tw-pick[aria-pressed="true"]{border-color:var(--ink);background:var(--wash)}
.tw-pick[aria-pressed="true"]::before{background:var(--red);border-color:var(--red);box-shadow:inset 0 0 0 3px #fff}
.tw-pick:hover:enabled{border-color:var(--red)}
.tw-pick:disabled{opacity:.55}
.tw-pick strong{display:block;font-weight:850;font-size:16px}
.tw-pick span{display:block;font-size:14px;color:var(--muted)}
.tw-pick span b{color:var(--ink);font-variant-numeric:tabular-nums}

.tw-tally{margin-top:18px;border:2px solid var(--ink);border-radius:14px;background:#fff;overflow:hidden}
.tw-tally table{width:100%;border-collapse:collapse;font-size:15px}
.tw-tally th,.tw-tally td{padding:10px 16px;border-bottom:1px solid var(--line)}
.tw-tally th{text-align:left;font-weight:600}
.tw-tally td{text-align:right;font-weight:850;font-variant-numeric:tabular-nums;white-space:nowrap}
.tw-tally tr:last-child>*{border-bottom:0}
.tw-tally .tw-big>*{background:var(--tint);font-weight:900}
.tw-tally-head{margin:0;padding:10px 16px;background:var(--wash);border-bottom:1px solid var(--line);font-size:12px!important;letter-spacing:.06em;text-transform:uppercase;font-weight:800;color:var(--muted)}
.tw-notes{margin:0;padding:10px 16px 12px 34px;border-top:1px solid var(--line);font-size:14px;line-height:1.5;color:var(--muted)}
.tw-notes:empty{display:none}
.tw-ok{color:var(--green)}
.tw-short{color:var(--amber)}

/* The roll */
.tw-roll{display:flex;align-items:center;gap:16px;margin:4px 0 18px;padding:14px 18px;border-radius:14px;background:#fff;border:2px solid var(--line)}
.tw-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 .tw-roll p{margin:0;font-size:15px;line-height:1.5}
.tw-roll strong{display:block;font-size:17px}
@media(prefers-reduced-motion:no-preference){.tw-die{animation:tw-tumble .7s ease-out}}
@keyframes tw-tumble{0%{transform:rotate(-200deg) scale(.4);opacity:0}100%{transform:none;opacity:1}}

/* Outcome tables */
.mn-room .stage .tw-out td{white-space:nowrap}
.tw-out .hit td:last-child{color:var(--green)}
.tw-out .you>*{background:var(--wash)}
.tw-did{list-style:none;margin:14px 0 0;padding:0;border:2px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}
.tw-did li{display:grid;grid-template-columns:1fr auto;gap:2px 16px;padding:11px 16px;border-bottom:1px solid var(--line);font-size:15px;line-height:1.5}
.tw-did li:last-child{border-bottom:0}
.tw-did b{font-weight:850}
.tw-did .amt{font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.tw-did .amt.neg{color:var(--dark)}
.tw-did small{grid-column:1/-1;font-size:14px;color:var(--muted)}

@media(max-width:520px){.tw-roll{align-items:flex-start}.tw-tally th,.tw-tally td{padding:9px 12px}
  /* Tables in the lesson: tighter cells so they fit a phone without scrolling sideways */
  .mn-room .stage .sq-tally th,.mn-room .stage .sq-tally td{padding:8px 6px;font-size:13px}
  .mn-room .stage .sq-tally thead th{white-space:normal;font-size:11px;letter-spacing:0}
  .mn-room .stage .sq-tally th:first-child{padding-left:10px}
  .mn-room .stage .sq-tally td:last-child,.mn-room .stage .sq-tally th:last-child{padding-right:10px}
  /* Inside the feedback box there's less room again */
  .mn-room .stage .pl-feedback .sq-tally th,.mn-room .stage .pl-feedback .sq-tally td{padding-left:4px;padding-right:4px}
  .mn-room .stage .pl-feedback .sq-tally th:first-child{padding-left:8px}
  .mn-room .stage .pl-feedback .sq-tally td:last-child,.mn-room .stage .pl-feedback .sq-tally th:last-child{padding-right:8px}
  /* The three-rolls table drops its Yes/No column; a green tick on "Your plan" says the same thing */
  .mn-room .stage .tw-rolls th:nth-child(5),.mn-room .stage .tw-rolls td:nth-child(5){display:none}
  .mn-room .stage .tw-rolls td:nth-child(4){padding-right:10px}
  .tw-rolls .hit td:nth-child(4){color:var(--green)}
  .tw-rolls .hit td:nth-child(4)::after{content:" \2713"}
}
