/* Data-modeling lesson vocabulary: notebook boards, pointers, wait-what notes. */

.model-scroll { overflow-x: auto; }
.model-board {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  min-width: min-content;
}
.model-board > small {
  display: block;
  padding: 9px 14px 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.model-board + .model-board { margin-top: 14px; }
.split-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 4px; }
.split-boards .model-board + .model-board { margin-top: 0; }
.split-boards + .model-board { margin-top: 14px; }

.model-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.model-table th,
.model-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.model-table th { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.model-table tbody tr:last-child td { border-bottom: 0; }
.model-table .mono { font-family: var(--mono); font-size: 12.5px; }

.model-table tr.stale td { background: var(--coral-soft); }
.model-table td.stale-cell::after { content: "stale copy"; margin-left: 8px; padding: 1px 6px; border-radius: 99px; font-family: var(--font); font-size: 9.5px; color: #fff; background: var(--coral); font-weight: 700; letter-spacing: 0.04em; }
.model-table tr.lit td { background: var(--lime); }
.model-table tr.gone td { opacity: 0.45; text-decoration: line-through; }

@keyframes modelingHot { 0% { background: var(--lime); } 100% { background: transparent; } }
@keyframes modelingHotBad { 0%, 40% { background: var(--coral); } 100% { background: var(--coral-soft); } }
.model-table tr.hot td { animation: modelingHot 1.4s ease-out; }
.model-table tr.hot-bad td { animation: modelingHotBad 1.2s ease-out; }

/* Lab 01A: hunt the copies. */


.hunt-timer { height: 6px; margin-top: 14px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.hunt-timer i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--green); transition: width 0.1s linear, background 0.3s; }
.hunt-timer.low i { background: var(--coral); }

.hunt-scroll.tall { max-height: 360px; overflow-y: auto; }
.hunt-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: inset 0 -1px var(--line); }

.phone-cell { margin: -4px -7px; padding: 3px 6px; border: 1px dashed transparent; border-radius: 6px; color: inherit; background: none; font: inherit; cursor: default; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.hunting .phone-cell { border-color: var(--line-strong); cursor: pointer; }
.hunting .phone-cell:hover { border-color: var(--green); background: var(--green-soft); }
.hunting .phone-cell:active { transform: scale(0.94); }
.phone-cell.fixed { border-color: transparent; background: var(--green-soft); color: var(--green-deep); font-weight: 700; }
@keyframes modelingShake { 0%, 100% { transform: none; } 0%, 80% { border-color: var(--coral); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.phone-cell.miss { animation: modelingShake 0.4s; }
.hunt-clock { white-space: nowrap; }

.model-table tr.scan td { background: var(--amber-soft); box-shadow: inset 0 1px var(--amber), inset 0 -1px var(--amber); }

/* Lab 01B: values that travel between lists. */
#split-stage { position: relative; }
.flip { display: inline-block; border-radius: 5px; }
.flip-ghost { position: absolute; z-index: 5; pointer-events: none; white-space: nowrap; font-size: 13.5px; padding: 0 4px; margin-left: -4px; border-radius: 5px; background: var(--amber-soft); box-shadow: 0 4px 14px rgba(23, 33, 29, 0.14); }
.flip-ghost.mono { font-family: var(--mono); font-size: 12.5px; }
.flip-ghost.leaving { background: var(--coral-soft); box-shadow: none; text-decoration: line-through; }
.key-chip, .ref-chip { padding: 1px 7px; border-radius: 99px; font-weight: 700; font-size: 11.5px; }
.key-chip { color: var(--green-deep); background: var(--green-soft); }
.ref-chip { color: var(--blue); background: var(--blue-soft); }

.form-track { display: flex; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: form; }
.form-track li { position: relative; flex: 1; padding-top: 20px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; counter-increment: form; }
.form-track li::before { content: ""; position: absolute; top: 6px; left: -50%; right: 50%; height: 2px; background: var(--line); transition: background 0.4s; }
.form-track li:first-child::before { display: none; }
.form-track li::after { content: ""; position: absolute; top: 1px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); box-sizing: border-box; transition: 0.3s; }
.form-track li.done, .form-track li.current { color: var(--green-deep); }
.form-track li.done::before, .form-track li.current::before { background: var(--green); }
.form-track li.done::after { border-color: var(--green); background: var(--green); }
.form-track li.current::after { border-color: var(--green); background: var(--lime); transform: scale(1.35); }

.wait-what {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 16px 15px;
  border: 1px dashed var(--line-strong);
  border-left: 3px solid var(--lime);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.wait-what > strong { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-deep); }
.wait-what p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }

.form-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 700;
}

#copy-status.warn, #split-status.warn, #join-status.warn, #drill-status.warn { color: var(--coral); }
#copy-status.ok, #split-status.ok, #join-status.ok, #drill-status.ok { color: var(--green); }

.metric strong.bad { color: var(--coral); }
.metric strong.good { color: var(--green); }
.metric strong.warn { color: var(--amber); }

/* Concept-card mini diagrams, each a short looping story. */
.mini-card { display: grid; gap: 2px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); font-family: var(--mono); font-size: 11px; }
.mini-card b { color: var(--muted); font-size: 9.5px; font-weight: 500; }
.mini-window { display: block; height: 15px; overflow: hidden; }
.mini-window i { display: block; height: 15px; font-style: normal; }
.mini-drift .mini-card:first-child .mini-window i { animation: miniSwap 4s infinite; }
.mini-window .fresh { color: var(--green); font-weight: 700; }
@keyframes miniSwap { 0%, 30% { transform: none; } 40%, 90% { transform: translateY(-15px); } 100% { transform: none; } }
.mini-neq { color: var(--coral); font-size: 18px; font-weight: 800; opacity: 0; animation: miniNeq 4s infinite; }
@keyframes miniNeq { 0%, 38% { opacity: 0; transform: scale(.4); } 46%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.mini-card.lagging { animation: miniLag 4s infinite; }
@keyframes miniLag { 0%, 40% { background: var(--surface); border-color: var(--line-strong); } 48%, 88% { background: var(--coral-soft); border-color: var(--coral); } 100% { background: var(--surface); } }
.mini-card .ref-chip { font-size: 10px; padding: 0 6px; }
.mini-wire { position: relative; width: 34px; height: 2px; background: var(--blue-soft); }
.mini-wire i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: miniWire 2.4s ease-in-out infinite; }
@keyframes miniWire { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 55% { left: calc(100% - 8px); opacity: 1; } 70%, 100% { left: calc(100% - 8px); opacity: 0; } }
.mini-card.home { border-color: var(--green); animation: miniHome 2.4s infinite; }
@keyframes miniHome { 0%, 50% { background: var(--surface); } 60%, 80% { background: var(--lime); } 100% { background: var(--surface); } }
.mini-stitch { gap: 0; }
.mini-piece { padding: 6px 9px; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--mono); font-size: 11px; }
.mini-piece.a { border-radius: 7px 0 0 7px; animation: miniLeft 3.6s infinite; }
.mini-piece.b { border-left: 0; border-right: 0; animation: miniMid 3.6s infinite; }
.mini-piece.c { border-radius: 0 7px 7px 0; animation: miniRight 3.6s infinite; }
@keyframes miniLeft { 0%, 15% { transform: translate(-14px, -12px); } 45%, 85% { transform: none; } 100% { transform: translate(-14px, -12px); } }
@keyframes miniMid { 0%, 15% { transform: translateY(14px); } 45%, 85% { transform: none; background: var(--surface); } 60%, 75% { background: var(--lime); } 100% { transform: translateY(14px); } }
@keyframes miniRight { 0%, 15% { transform: translate(14px, -12px); } 45%, 85% { transform: none; } 100% { transform: translate(14px, -12px); } }

/* Bakery order-pad look for notebook boards. */
.model-board.paper { background: #fffdf6; border-top: 0; }
.model-board.paper::before { content: ""; display: block; height: 6px; background: radial-gradient(circle at 5px -1px, transparent 4px, var(--line-strong) 4.5px, var(--line-strong) 5px, transparent 5.5px) 0 0 / 12px 6px repeat-x, linear-gradient(var(--line-strong), var(--line-strong)) 0 5px / 100% 1px no-repeat; }
.model-board.paper > small::before { content: "🧾 "; }

/* Lab 01C: race lanes, pointer arrows, assembled row. */
.lane-stage { position: relative; flex: 1; }
.lane .model-table th, .lane .model-table td { padding: 7px 10px; font-size: 12.5px; }
.lane .model-table .mono { font-size: 12px; }
.join-arrows { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; color: var(--blue); }
.join-arrows path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.assembled { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.slot { padding: 4px 9px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); font-size: 11px; transition: background .2s; }
.slot.filled { border-style: solid; border-color: var(--green); color: var(--ink); background: var(--green-soft); font-family: var(--mono); font-size: 12px; }
.slot.filled.wrong { border-color: var(--coral); background: var(--coral-soft); color: #8f3d27; }
.slot.filled.wrong::after { content: " ✗ stale"; font-family: var(--font); font-size: 10px; font-weight: 700; }

/* Production drill: response cards and a month on a timeline. */
.response-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.response-card { display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.response-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.response-card .rc-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.response-card strong { font-size: 14px; }
.response-card small { color: var(--muted); font-size: 11.5px; }
.response-card[aria-checked="true"] { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.response-card.wide[aria-checked="true"] { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.response-card.wide .rc-tag { color: var(--coral); }
.timeline-wrap { display: grid; gap: 10px; }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; }
.timeline-head strong { font-family: var(--mono); font-size: 13px; }
.timeline { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; padding-top: 10px; }
.tl-day { position: relative; height: 26px; border-radius: 4px; background: var(--surface-soft); transition: background .2s; }
.tl-day.ok { background: var(--green-soft); }
.tl-day.lag { background: var(--amber); }
.tl-day.bad { background: var(--coral); }
.tl-day.today { box-shadow: 0 0 0 2px var(--ink); }
.tl-event { position: absolute; top: -10px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--blue); }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.timeline-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.timeline-legend .ok::before { background: var(--green-soft); border: 1px solid var(--green); }
.timeline-legend .lag::before { background: var(--amber); }
.timeline-legend .bad::before { background: var(--coral); }
.timeline-legend .ev::before { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); vertical-align: 1px; }
.event-log { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.event-log:empty { display: none; }
.event-log li { padding: 7px 10px; border-left: 3px solid var(--line-strong); border-radius: 0 6px 6px 0; background: var(--surface-soft); animation: modelingLog .35s ease-out; }
.event-log li b { margin-right: 6px; font-family: var(--mono); font-size: 11px; }
.event-log li.ok { border-color: var(--green); }
.event-log li.lag { border-color: var(--amber); }
.event-log li.bad { border-color: var(--coral); background: var(--coral-soft); }
@keyframes modelingLog { from { opacity: 0; transform: translateX(-6px); } }
.incident-lab .metric-grid { margin: 16px 0; }

/* Columnar & LSM lesson: column strips, sorted chunks, read traces. */

.column-board { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.col-strip {
  display: flex;
  flex-direction: column;
  min-width: 86px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.col-strip b { padding: 8px 10px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.col-strip span { padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }
.col-strip span:last-child { border-bottom: 0; }
.col-strip.lit { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.col-strip.lit b { color: var(--green-deep); background: var(--green-soft); }

.sstable {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.sstable b { padding: 8px 10px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.sstable.newest { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.sstable.newest b { color: var(--green-deep); background: var(--green-soft); }
.sstable span { padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }
.sstable span:last-child { border-bottom: 0; }
.sstable span.touched { background: var(--amber-soft); }
.sstable span.lit { background: var(--lime); font-weight: 700; }
.lsm-arrows { align-self: center; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 2px; }
.model-table td.empty { color: var(--muted); font-style: italic; }

@media (max-width: 680px) {
  .model-table th, .model-table td { padding: 8px 10px; font-size: 12.5px; }
  .response-cards { grid-template-columns: 1fr; }
  .timeline { gap: 2px; }
  .form-track li { font-size: 9.5px; }
}
