/* ticket-prose.css — styles for the shared ticket body / transcript renderer
   (ticket-prose.js). Loaded by both index.html and q2.html. Colors are
   self-contained dark-theme values (no dependency on either page's vars). */

.tp-body {
  font-family: Inter, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: #cdd6e4;
  max-width: 74ch;
  overflow-y: auto;
  max-height: 55vh;
}
.tp-body .tp-p { margin: 0 0 0.85em; }
.tp-body .tp-p:last-child { margin-bottom: 0; }
.tp-h {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fa3bd;
  margin: 1.2em 0 0.4em;
}
.tp-ul { margin: 0 0 0.85em; padding-left: 1.3em; }
.tp-ul li { margin: 0.25em 0; }
.tp-fence {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.tp-table {
  border-collapse: collapse;
  margin: 0 0 0.85em;
  font-size: 12.5px;
}
.tp-table td {
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 4px 8px;
  vertical-align: top;
}
.tp-table tr:first-child td { font-weight: 600; color: #a9b8cc; }
.tp-bq {
  margin: 0 0 0.85em;
  padding: 4px 12px;
  border-left: 3px solid rgba(122, 162, 247, 0.4);
  color: #b4c0d0;
}

/* meta strip: Studio / Evidence time / Finding … */
.tp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}
.tp-meta-item { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.tp-meta-k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7d8fa8;
  white-space: nowrap;
}
.tp-meta-v { font-size: 12.5px; color: #cdd6e4; word-break: break-word; }

/* inline decorations */
.tp-token {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(122, 162, 247, 0.12);
  color: #9db8e8;
  white-space: nowrap;
}
.tp-quote {
  color: #e8d9a0;
  font-style: italic;
}
.tp-time { color: #7fd1b9; font-variant-numeric: tabular-nums; }
.tp-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #8fa3bd;
  word-break: break-all;
}
.tp-code-inline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}
.tp-link { color: #7aa2f7; text-decoration: none; }
.tp-link:hover { text-decoration: underline; }

/* linked-conversation transcript */
.tp-conv {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px 2px;
}
.tp-conv-head {
  font-size: 12px;
  font-weight: 600;
  color: #a9b8cc;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.tp-conv-sep { color: #55637a; }
.tp-conv-key {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 400;
  color: #6b7b94;
}
.tp-conv-note { font-size: 11px; color: #8fa3bd; font-style: italic; }
.tp-msg {
  max-width: 82%;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #d5dde9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tp-msg.is-left { align-self: flex-start; }
.tp-msg.is-right {
  align-self: flex-end;
  background: rgba(122, 162, 247, 0.10);
  border-color: rgba(122, 162, 247, 0.18);
}
.tp-msg.is-center {
  align-self: center;
  max-width: 92%;
  background: transparent;
  border-style: dashed;
  color: #93a3b8;
  font-size: 12px;
}
.tp-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.tp-msg-role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8fa3bd;
}
.tp-msg.is-right .tp-msg-role { color: #9db8e8; }
.tp-msg.is-client .tp-msg-role { color: #e8b98a; }
.tp-msg-time { font-size: 10.5px; color: #6b7b94; font-variant-numeric: tabular-nums; }
.tp-msg-body { word-break: break-word; }

/* loading / error states for the linked-conversation section */
.tp-conv-status { font-size: 12px; color: #8fa3bd; font-style: italic; padding: 4px 0; }
.tp-conv-status.is-error { color: #d99; font-style: normal; }

/* light theme (q2's data-theme toggle) */
html[data-theme="light"] .tp-body,
html[data-theme="light"] .tp-meta-v { color: #2c3644; }
html[data-theme="light"] .tp-h,
html[data-theme="light"] .tp-meta-k { color: #5b6b80; }
html[data-theme="light"] .tp-meta,
html[data-theme="light"] .tp-fence {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .tp-token { background: rgba(53, 92, 170, 0.10); color: #35507e; }
html[data-theme="light"] .tp-quote { color: #8a6d1f; }
html[data-theme="light"] .tp-time { color: #1e7a5f; }
html[data-theme="light"] .tp-id,
html[data-theme="light"] .tp-conv-key { color: #5b6b80; }
html[data-theme="light"] .tp-code-inline { background: rgba(0, 0, 0, 0.06); }
html[data-theme="light"] .tp-msg {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.07);
  color: #2c3644;
}
html[data-theme="light"] .tp-msg.is-right {
  background: rgba(53, 92, 170, 0.08);
  border-color: rgba(53, 92, 170, 0.16);
}
html[data-theme="light"] .tp-msg.is-center { color: #5b6b80; }
html[data-theme="light"] .tp-msg-role { color: #5b6b80; }
html[data-theme="light"] .tp-conv-head { color: #43526a; }
html[data-theme="light"] .tp-table td { border-color: rgba(0, 0, 0, 0.12); }
html[data-theme="light"] .tp-table tr:first-child td { color: #43526a; }
html[data-theme="light"] .tp-bq { color: #4a5a70; border-left-color: rgba(53, 92, 170, 0.35); }

/* Inline "(a) … (b) …" options lifted out of a dense block question (CCC-64) */
.tp-body { line-height: 1.6; }
.tp-opts { list-style: none; margin: 0 0 0.85em; padding: 0; }
.tp-opts li { margin: 0.35em 0; padding: 6px 10px 6px 34px; position: relative; border-radius: 5px; background: rgba(139,148,158,0.08); }
.tp-opt-k { position: absolute; left: 10px; top: 6px; font: 700 12px var(--font-mono, ui-monospace, monospace); text-transform: uppercase; color: var(--accent, #58a6ff); }
.tp-opts li.tp-opt-rec { background: rgba(88,166,255,0.12); box-shadow: inset 3px 0 0 var(--accent, #58a6ff); }
.tp-opt-note { color: var(--accent, #58a6ff); }
.tp-rec { padding: 6px 10px; border-left: 3px solid var(--accent, #58a6ff); background: rgba(88,166,255,0.08); border-radius: 0 5px 5px 0; }

/* A decision-first reading surface, with the source always available. */
.tp-blocked {
  color: var(--text, #cdd6e4);
  background: var(--bg, #11161d);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 12px;
  padding: clamp(16px, 2.5vw, 28px);
  font-family: var(--font-ui, system-ui, sans-serif);
  overflow-wrap: anywhere;
}
.tp-blocked .tp-blocked-title { margin: 0 0 12px; font-size: 20px; line-height: 1.3; color: inherit; }
.tp-blocked-ask { font-size: 18px; line-height: 1.55; font-weight: 600; max-width: 65ch; }
.tp-blocked-tag { margin-top: 10px; font-size: 12px; color: var(--text-secondary, #b6c3d4); }
.tp-blocked > section { margin-top: 24px; }
.tp-blocked h4 { font-size: 14px; line-height: 1.4; margin: 0 0 8px; font-weight: 650; color: inherit; }
.tp-blocked .tp-body { color: inherit; font-size: 15px; line-height: 1.7; max-width: 70ch; max-height: none; overflow: visible; }
.tp-blocked-recommend h4 { color: var(--text, #f5dfaa); }
.tp-blocked-original { margin-top: 24px; border-top: 1px solid var(--border, #38414d); padding-top: 14px; }
.tp-blocked-original summary { cursor: pointer; font-size: 13px; padding: 4px 0; color: var(--text-secondary, #b6c3d4); }
.tp-blocked-original summary:hover { color: var(--text, #fff); }
.tp-blocked-original summary:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 4px; }
.tp-blocked-original[open] summary { margin-bottom: 14px; }
@media (max-width: 600px) {
  .tp-blocked .tp-blocked-title { font-size: 18px; }
  .tp-blocked-ask { font-size: 16px; }
}
.tp-reading { font-size: 16px; line-height: 1.65; max-width: 68ch; }
.tp-reading:has(.tp-explain) { margin-bottom: 20px; }
.tp-reading-question { font-size: 23px; line-height: 1.35; margin: 0 0 24px; color: inherit; text-wrap: balance; }
.tp-reading section { margin-top: 22px; }
.tp-reading h4 { font-size: 15px; margin-bottom: 6px; }
.tp-reading p { margin: 0; }
.tp-reading-consequence { padding-block: 18px; border-block: 1px solid var(--border, #38414d); }
.tp-reading-options { padding-left: 20px; margin: 8px 0 0; }
.tp-reading-options li + li { margin-top: 14px; }
.tp-reading .tp-reading-note { margin-top: 24px; font-size: 12px; color: var(--text-secondary, #b6c3d4); }
.tp-reading-source { border-top: 1px solid var(--border, #38414d); margin-top: 20px; padding-top: 14px; }
.tp-reading-source > summary { cursor: pointer; font-size: 14px; padding-block: 6px; }
.tp-reading-source[open] > summary { margin-bottom: 20px; }
.tp-explain, .tp-reading-reply { font: 600 14px var(--font-ui, system-ui, sans-serif); color: var(--text, #cdd6e4); background: var(--surface-2, var(--bg-secondary, #202a36)); border: 1px solid var(--border, #536477); border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.tp-explain:hover, .tp-reading-reply:hover { border-color: var(--accent, #8ab4ff); }
.tp-explain:disabled { cursor: progress; opacity: .7; }
.tp-reading-reply { margin-top: 16px; }
.tp-explain:focus-visible, .tp-reading-reply:focus-visible, .tp-reading-source > summary:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 4px; }
.tp-reading-error { font-size: 14px; margin-top: 10px !important; }
@media (max-width: 480px) {
  .tp-blocked .tp-meta-item { display: flex; flex-direction: column; align-items: flex-start; }
  .tp-blocked .tp-meta-k { white-space: normal; }
  .tp-reading-question { font-size: 20px; }
  .tp-reading { font-size: 15px; }
}

.tp-reading .tp-reply-hint { margin-top: 8px; font-size: 13px; color: var(--text-secondary, #b6c3d4); }
