/* Krytz · Decision Trace Theater */

.dt-theater {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  overflow: hidden;
  position: relative;
}

/* ── top bar ──────────────────────────────────────────── */
.dt-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.dt-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dt-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  background: rgba(216,73,58,0.10);
  color: #B23A2D;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  font-family: var(--mono);
}
.dt-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #D8493A;
  animation: dt-blink 1.6s ease-in-out infinite;
}
@keyframes dt-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}
.dt-step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.dt-progress {
  flex: 1;
}
.dt-progress-track {
  height: 2px;
  background: var(--line);
  border-radius: 1px;
  overflow: hidden;
}
.dt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g), var(--g-mid));
  transition: width 600ms cubic-bezier(.2,.7,.2,1);
}
.dt-controls { display: flex; gap: 8px; }
.dt-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}
.dt-btn:hover {
  border-color: var(--g);
  color: var(--g);
  transform: translateY(-1px);
}

/* ── stage layout ────────────────────────────────────── */
.dt-stage {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr 1.05fr;
  gap: 0;
  min-height: 540px;
}
.dt-col {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.dt-col + .dt-col { border-left: 1px dashed var(--line); }
.dt-col-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--g);
  text-transform: uppercase;
}

/* ── 01 Capture paper ─────────────────────────────────── */
.dt-paper {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
  position: relative;
}
.dt-paper-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}
.dt-paper-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  min-height: 144px;
  margin: 0;
}
.dt-caret {
  display: inline-block;
  width: 1.5px; height: 16px;
  background: var(--g);
  vertical-align: -3px;
  margin-left: 1px;
  animation: dt-caret 1s steps(2) infinite;
}
@keyframes dt-caret { 50% { opacity: 0; } }

.dt-ent {
  padding: 1px 2px;
  border-radius: 3px;
  background: rgba(27, 42, 74,0.10);
  border-bottom: 1.5px solid;
  animation: dt-ent-in 360ms ease-out both;
  white-space: pre-wrap;
}
@keyframes dt-ent-in {
  from { background: transparent; border-bottom-color: transparent; }
}
.dt-ent-person     { border-bottom-color: #1B2A4A; background: rgba(27, 42, 74,0.10); }
.dt-ent-date       { border-bottom-color: #E58B2A; background: rgba(229,139,42,0.10); }
.dt-ent-doc        { border-bottom-color: #2A6FDB; background: rgba(42,111,219,0.10); }
.dt-ent-topic      { border-bottom-color: #1B7A52; background: rgba(200, 164, 90,0.10); }
.dt-ent-commitment { border-bottom-color: #D8493A; background: rgba(216,73,58,0.10); }
.dt-ent-event      { border-bottom-color: #828B87; background: rgba(130,139,135,0.10); }

.dt-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.dt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dt-chip {
  width: 10px; height: 4px; border-radius: 2px;
}
.dt-chip.dt-ent-person     { background: #1B2A4A; }
.dt-chip.dt-ent-date       { background: #E58B2A; }
.dt-chip.dt-ent-doc        { background: #2A6FDB; }
.dt-chip.dt-ent-topic      { background: #1B7A52; }
.dt-chip.dt-ent-commitment { background: #D8493A; }

/* ── 02/03 Cards ──────────────────────────────────────── */
.dt-cards {
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.dt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 12px 14px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 500ms ease-out, transform 500ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
.dt-card.is-in { opacity: 1; transform: translateX(0); }
.dt-card.is-scored { border-color: var(--g-soft-2); }

.dt-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.dt-type {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 9.5px;
}
.dt-type.t-task    { background: rgba(27, 42, 74,0.10); color: #2C3E6B; }
.dt-type.t-blocker { background: rgba(216,73,58,0.10);  color: #B23A2D; }
.dt-type.t-meeting { background: rgba(130,139,135,0.14); color: #46524F; }
.dt-type.t-plan    { background: rgba(200, 164, 90,0.10);   color: #1B7A52; }
.dt-who { color: var(--ink-2); }
.dt-due { margin-left: auto; color: var(--ink-3); }
.dt-card-text {
  font-size: 13px; color: var(--ink); line-height: 1.4;
  margin-bottom: 8px;
}

.dt-signals {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
}
.dt-sig {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.dt-sig-l { letter-spacing: 0.05em; }
.dt-sig-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.dt-sig-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--g);
  border-radius: 2px;
  transition: width 600ms cubic-bezier(.2,.7,.2,1);
}
.dt-sig-v {
  font-size: 9px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.dt-score {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.dt-score strong {
  color: var(--g);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* ── 04 Decide / Final rank ──────────────────────────── */
.dt-rank {
  display: flex; flex-direction: column; gap: 12px;
  opacity: 0.5;
  transition: opacity 400ms ease;
}
.dt-rank.is-ready { opacity: 1; }
.dt-tier {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 12px;
}
.dt-tier-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 8px;
}
.dt-primary { border-color: var(--g); background: var(--g-soft-2); }
.dt-primary .dt-tier-label { color: var(--g-deep); }
.dt-rank-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  color: var(--ink);
  animation: dt-rank-in 500ms ease-out both;
}
.dt-rank-row + .dt-rank-row { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; }
.dt-rank-row.is-quiet { color: var(--ink-3); }
.dt-rank-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-rank-row strong { font-family: var(--mono); font-size: 12px; color: var(--g); font-variant-numeric: tabular-nums; font-weight: 600; }
.dt-rank-row.is-quiet strong { color: var(--ink-4); }
.dt-rank-empty {
  font-family: var(--mono);
  color: var(--ink-4);
  font-size: 12px;
  text-align: center;
  padding: 12px 0;
}
@keyframes dt-rank-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dt-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .dt-stage { grid-template-columns: 1fr; }
  .dt-col + .dt-col { border-left: 0; border-top: 1px dashed var(--line); }
  .dt-paper-text { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .dt-ent, .dt-card, .dt-rank-row, .dt-progress-fill, .dt-sig-bar i { animation: none; transition: none; }
}
