/* Therapeutic window lesson. All rules scoped under .tw-* */
.tw-hero { width: min(80%, 300px); margin: 0 auto; }
.tw-hero img { width: 100%; display: block; }

.tw-sc { width: min(100%, 380px); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tw-note { font-size: 13px; color: var(--dim); text-align: center; }

/* two dishes */
.tw-dishes { display: block; width: 100%; height: auto; overflow: visible; }
.tw-dish { fill: rgba(150, 190, 230, .07); stroke: rgba(170, 200, 240, .3); stroke-width: 2; }
.tw-cell { stroke-width: 2; transition: fill .3s, stroke .3s, opacity .3s; }
.tw-cell.tw-tumor { fill: var(--violet-bright); stroke: #C9BEFF; }
.tw-cell.tw-healthy { fill: var(--mint); stroke: #A8F0D2; }
.tw-cell.dead { fill: transparent; stroke-dasharray: 3 3; opacity: .35; }
.tw-nm { font: 700 13px var(--sans); fill: var(--dim); text-anchor: middle; }

/* a row of dose boxes */
.tw-meter { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.tw-mn { font: 700 14px var(--sans); color: var(--text); }
.tw-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.tw-row i { height: 24px; border-radius: 6px; background: var(--raised); border: 1.5px solid var(--line-strong); transition: background .25s, border-color .25s, transform .25s; }
.tw-row i.z0 { background: rgba(166, 159, 147, .28); border-color: rgba(166, 159, 147, .45); }
.tw-row i.z1 { background: rgba(63, 214, 154, .45); border-color: var(--mint); }
.tw-row i.z2 { background: rgba(216, 85, 85, .5); border-color: var(--red); }
.tw-row i.now { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); transform: translateY(-3px); }
.tw-hit .tw-row i.now { animation: twShake .4s; }
@keyframes twShake { 25% { transform: translate(-3px, -3px); } 75% { transform: translate(3px, -3px); } }
.tw-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; font-weight: 700; color: var(--dim); }
.tw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tw-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid; }
.tw-legend i.z0 { background: rgba(166, 159, 147, .28); border-color: rgba(166, 159, 147, .45); }
.tw-legend i.z1 { background: rgba(63, 214, 154, .45); border-color: var(--mint); }
.tw-legend i.z2 { background: rgba(216, 85, 85, .5); border-color: var(--red); }

/* acetaminophen: the label's limit and the liver-injury zone on one line */
.tw-ap { width: min(100%, 340px); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.tw-apbar { position: relative; height: 44px; border-radius: 10px; overflow: hidden; background: rgba(166,159,147,.10); display: flex; }
.tw-apbar i { display: block; height: 100%; }
.tw-aphelp { width: 34%; background: rgba(63,214,154,.35); }
.tw-apgap { width: 38%; background: rgba(252,192,80,.12); }
.tw-apharm { flex: 1; background: rgba(216,85,85,.45); }
.tw-aplim { position: absolute; left: 34%; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.tw-apme { position: absolute; left: 34%; top: 4px; bottom: 4px; width: 5px; margin-left: -2px; border-radius: 3px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); display: none; transition: left .9s cubic-bezier(.4,0,.2,1); }
.tw-apon .tw-apme { display: block; }
.tw-apon .tw-shelf { display: none; }
.tw-apl1, .tw-apl2 { font: 800 12px var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.tw-apl1 { color: var(--gold); padding-left: calc(34% - 60px); }
.tw-apl2 { color: #FF8A8A; text-align: right; }
.tw-shelf { width: 72%; align-self: center; margin-bottom: 6px; }
.tw-apnote { font-size: 12px; color: var(--faint); }

@media (max-height: 700px) {
  .tw-sc { gap: 8px; width: min(100%, 340px); }
  .tw-shelf { width: 58%; }
}
