/* Reusable chat panel + spinner + toast for the phdresearch app. Uses the
   app's existing CSS variables (defined in index.html's :root). Loaded once
   via <link> in index.html; consumed by the Reference Qualify view now and
   the Thesis Apply / Scientific Rebuild views later. Australian English, no
   em dashes. */

.pc-chat { display: flex; flex-direction: column; gap: .75rem; }
.pc-chat-log {
  display: flex; flex-direction: column; gap: .6rem;
  max-height: 26rem; overflow-y: auto; padding: .2rem;
}
.pc-msg { display: flex; gap: .55rem; align-items: flex-start; }
.pc-msg-bubble {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .6rem .8rem; font-size: .9rem; line-height: 1.5;
  max-width: 46rem; white-space: pre-wrap; word-break: break-word;
}
.pc-msg-user { justify-content: flex-end; }
.pc-msg-user .pc-msg-bubble { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.pc-msg-assistant .pc-msg-bubble { background: var(--surface); }
.pc-msg-system .pc-msg-bubble { background: var(--surface-2); color: var(--ink-soft); font-size: .84rem; }
.pc-msg-error .pc-msg-bubble { background: var(--surface); border-color: var(--negative); color: var(--negative); }
.pc-msg-role {
  font-family: var(--mono); font-size: .62rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); margin-bottom: .2rem;
}

.pc-chat-input-row { display: flex; gap: .5rem; align-items: flex-end; }
.pc-chat-input-row textarea { flex: 1; min-height: 2.6rem; max-height: 10rem; }

/* Spinner */
.pc-spinner {
  display: inline-block; width: 1.05rem; height: 1.05rem; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: pc-spin .7s linear infinite;
}
.pc-spinner-lg { width: 1.6rem; height: 1.6rem; border-width: 3px; }
@keyframes pc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pc-spinner { animation-duration: 2s; } }

.pc-inline-status { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-soft); font-size: .86rem; }

/* Toast */
.pc-toast-wrap {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: .5rem; max-width: min(24rem, calc(100vw - 2rem));
}
.pc-toast {
  background: var(--surface); border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-card);
  padding: .6rem .8rem; font-size: .85rem; color: var(--ink);
  animation: pc-toast-in .18s ease-out;
}
.pc-toast.ok { border-left-color: var(--accent); }
.pc-toast.err { border-left-color: var(--negative); }
@keyframes pc-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Correlation matrix (Stage 2) ---- */
/* Three prose columns: override the global th,td white-space:nowrap (meant for
   compact data tables) so long descriptions wrap instead of blowing the table
   out to a horizontal scroll and clipping the right-hand column. Fixed layout +
   percentage widths keep the columns aligned and readable at any width. */
.matrix-table { display: table; table-layout: fixed; width: 100%; }
.matrix-table th, .matrix-table td { white-space: normal; word-break: break-word; vertical-align: top; }
.matrix-table th:nth-child(1), .matrix-table td:nth-child(1) { width: 22%; }
.matrix-table th:nth-child(2), .matrix-table td:nth-child(2) { width: 26%; }
.matrix-table th:nth-child(3), .matrix-table td:nth-child(3) { width: 40%; }
.matrix-table th:nth-child(4), .matrix-table td:nth-child(4) { width: 12%; }
.mono-tag {
  display: inline-block; font-family: var(--mono, monospace); font-size: .7rem;
  color: var(--ink-soft); background: var(--surface-2, rgba(127,127,127,.08));
  border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; margin-top: .25rem;
}
.mono-tag-link { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); text-decoration: none; cursor: pointer; }
.mono-tag-link:hover { background: var(--accent-wash, color-mix(in srgb, var(--accent) 10%, transparent)); text-decoration: underline; }

/* Feature-column code evidence (replaces the old live tool URL) */
.cm-noev { font-size: .72rem; color: var(--ink-soft); font-style: italic; margin-top: .25rem; }
.cm-evbtn {
  margin-top: .3rem; font-family: var(--mono, monospace); font-size: .74rem; color: var(--accent);
  background: var(--accent-wash, color-mix(in srgb, var(--accent) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 6px;
  padding: .22rem .55rem; cursor: pointer;
}
.cm-evbtn:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cm-ev-modal { width: 62rem; max-width: 100%; }
.cm-ev-body { display: flex; flex-direction: column; gap: 1rem; }
.cm-ev-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .7rem; background: var(--bg); }
.cm-ev-path { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cm-ev-lines { font-size: .72rem; color: var(--ink-soft); }
.cm-ev-comment { font-size: .82rem; color: var(--ink-soft); margin: .45rem 0 .5rem; line-height: 1.45; }
.cm-ev-code { margin: 0; padding: 0; background: var(--surface-2, rgba(127,127,127,.06)); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cm-ev-err { color: var(--negative); font-family: var(--mono, monospace); font-size: .8rem; padding: .5rem .7rem; display: block; }
.cm-code-wrap { display: flex; font-family: var(--mono, monospace); font-size: .78rem; line-height: 1.55; max-height: 24rem; overflow-y: auto; }
.cm-code-gutter { flex: none; text-align: right; padding: .5rem .5rem; color: var(--ink-soft); opacity: .65; user-select: none; border-right: 1px solid var(--line); background: var(--bg); }
.cm-code-col { padding: .5rem .7rem; overflow-x: auto; }
.cm-code-lnum { white-space: nowrap; }
.cm-code-line { white-space: pre; }

/* ---- Stage 3: collaborative whiteboard canvas ---- */
.wb-wrap { display: flex; flex-direction: column; gap: .6rem; flex: 1 1 auto; min-width: 0; }
.wb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.wb-tool { font-family: var(--sans); font-size: .82rem; font-weight: 500; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); cursor: pointer; }
.wb-tool:hover { border-color: var(--accent); }
.wb-tool.active { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.wb-tool.wb-danger:hover { border-color: var(--negative); color: var(--negative); }
.wb-iconwrap { position: relative; }
.wb-iconmenu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; display: flex; flex-direction: column; gap: 6px; width: 16rem; max-width: 90vw; max-height: 60vh; overflow: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.wb-iconopt { display: inline-flex; padding: 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; }
.wb-iconopt:hover { border-color: var(--accent); color: var(--accent); }
.wb-swatches { display: inline-flex; gap: 3px; }
.wb-swatch { width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.wb-swatch.active { border-color: var(--ink); }
.wb-presence { font-size: .78rem; color: var(--ink-soft); font-family: var(--mono); margin-left: .4rem; }
.wb-scroller { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background:
  repeating-linear-gradient(0deg, transparent, transparent 23px, var(--line) 23px, var(--line) 24px),
  repeating-linear-gradient(90deg, transparent, transparent 23px, var(--line) 23px, var(--line) 24px), var(--surface); }
.wb-svg { display: block; background: transparent; }
.wb-fo { width: 100%; height: 100%; box-sizing: border-box; overflow: hidden; font-family: var(--sans); font-size: 13px; line-height: 1.35; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.wb-fo.wb-note { background: color-mix(in srgb, var(--wbc) 16%, var(--surface)); border: 1px solid var(--wbc); border-radius: 8px; padding: 8px 10px; }
.wb-fo.wb-text { color: var(--wbc); font-weight: 600; padding: 4px 2px; }
/* An empty text element must still read as "here": a faint dashed bound plus a
   placeholder, so a click that placed it is never mistaken for nothing. Only
   while genuinely empty; once it has text the affordance disappears. */
.wb-fo.wb-text:empty { outline: 1px dashed color-mix(in srgb, var(--wbc) 55%, transparent); outline-offset: -1px; border-radius: 4px; }
.wb-fo.wb-text:empty::before { content: 'Text'; opacity: .5; font-weight: 500; }
.wb-fo[contenteditable="true"] { outline: 2px solid var(--accent); }
/* Overlay editor: a positioned textarea laid over the element while editing
   (see whiteboard.js editText). Opaque so it fully covers the element beneath. */
.wb-editor { position: fixed; z-index: 60; box-sizing: border-box; border: 2px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.35; padding: 4px 6px; resize: none; overflow: hidden; box-shadow: var(--shadow-card); }
.wb-editor-text { font-weight: 600; }
/* Categorised, searchable icon picker (Job G) */
.wb-iconsearch { width: 100%; box-sizing: border-box; font-family: var(--sans); font-size: .82rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); }
.wb-iconcats { display: flex; flex-direction: column; gap: 6px; }
.wb-iconcat-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: 2px 2px 0; }
.wb-iconcat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.wb-iconempty { font-size: .8rem; color: var(--ink-soft); padding: .3rem; }
.wb-dirtydot { font-size: .68rem; font-family: var(--mono); color: var(--negative); border: 1px solid var(--negative); border-radius: 999px; padding: 0 .45rem; }
/* Whiteboard layout: canvas + right-hand boards panel (Job G) */
.wb-layout { display: flex; align-items: flex-start; gap: .6rem; }
.wb-boardpanel { flex: 0 0 15rem; width: 15rem; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; max-height: 78vh; overflow: auto; }
.wb-layout.panel-collapsed .wb-boardpanel { flex-basis: 2.1rem; width: 2.1rem; padding: .4rem .2rem; }
.wb-layout.panel-collapsed .wb-boardpanel .wb-panel-title,
.wb-layout.panel-collapsed .wb-boardpanel .wb-boardlist,
.wb-layout.panel-collapsed .wb-boardpanel .btn { display: none; }
.wb-panel-head { display: flex; align-items: center; gap: .4rem; }
.wb-panel-title { font-family: var(--display); font-weight: 700; font-size: .9rem; flex: 1; }
.wb-panel-collapse { border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); border-radius: var(--radius-sm); width: 1.6rem; height: 1.6rem; cursor: pointer; font-size: 1rem; line-height: 1; flex: none; }
.wb-panel-collapse:hover { border-color: var(--accent); color: var(--accent); }
.wb-boardlist { display: flex; flex-direction: column; gap: .35rem; }
.wb-board-empty { font-size: .82rem; color: var(--ink-soft); }
.wb-board-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.wb-board-row.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wb-board-open { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: .45rem .55rem; cursor: pointer; color: var(--ink); font-family: var(--sans); }
.wb-board-open:hover { background: var(--accent-wash); }
.wb-board-name { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-board-meta { font-size: .7rem; color: var(--ink-soft); margin-top: .1rem; }
.wb-board-actions { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.wb-board-act { flex: 1; background: none; border: none; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .66rem; padding: 0 .4rem; cursor: pointer; font-family: var(--sans); }
.wb-board-act:last-child { border-bottom: none; }
.wb-board-act:hover { background: var(--accent-wash); color: var(--accent); }
.wb-board-act.wb-danger:hover { background: color-mix(in srgb, var(--negative) 12%, transparent); color: var(--negative); }
@media (max-width: 720px) {
  .wb-layout { flex-direction: column; }
  .wb-boardpanel, .wb-layout.panel-collapsed .wb-boardpanel { flex-basis: auto; width: 100%; max-height: 40vh; }
}

/* ---- Thesis Workspace (Stage 4) ---- */
.section-head{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;}
.muted-note{color:var(--ink-soft);font-size:.85rem;}
.err-text{color:var(--negative);font-size:.9rem;}
.btn-sm{font-size:.82rem;padding:.4rem .7rem;}
.btn-xs{font-size:.74rem;padding:.25rem .55rem;margin-top:.35rem;}
.thesis-presence{font-size:.78rem;color:var(--accent);font-family:var(--mono);}
.thesis-layout{display:grid;grid-template-columns:15rem 1fr;gap:1rem;align-items:start;margin-top:.75rem;}
@media (max-width:820px){.thesis-layout{grid-template-columns:1fr;}}
.thesis-nav{position:sticky;top:.5rem;display:flex;flex-direction:column;gap:.4rem;}
.thesis-nav-list{display:flex;flex-direction:column;gap:.15rem;max-height:70vh;overflow:auto;}
.thesis-nav-item{display:flex;align-items:center;gap:.4rem;justify-content:space-between;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:.5rem .6rem;font-size:.84rem;color:var(--ink);cursor:pointer;font-family:var(--sans);}
.thesis-nav-item:hover{background:var(--surface-2);}
.thesis-nav-item.active{border-color:var(--accent);background:var(--accent-wash);color:var(--accent);font-weight:600;}
.thesis-nav-tag{font-size:.62rem;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-soft);border:1px solid var(--line);border-radius:999px;padding:.02rem .4rem;}
.thesis-main{min-width:0;}
.thesis-toolbar{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.5rem;}
.thesis-toolbar h3{margin:0;}
.thesis-editor-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);}
/* Non-blocking warning when stored content uses markup Quill cannot preserve (Job I). */
.thesis-lossy-note{margin:0 0 .5rem;padding:.5rem .7rem;border:1px solid color-mix(in srgb, var(--negative) 40%, var(--line));border-left:3px solid var(--negative);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--negative) 8%, transparent);color:var(--ink);font-size:.82rem;line-height:1.45;}
#thesis-editor{min-height:24rem;}
#thesis-editor .ql-editor{min-height:24rem;font-family:var(--sans);font-size:.95rem;line-height:1.6;color:var(--ink);}
.ql-toolbar.ql-snow,.ql-container.ql-snow{border-color:var(--line);}
.ql-snow .ql-stroke{stroke:var(--ink-soft);}
.ql-snow .ql-picker{color:var(--ink-soft);}
.thesis-panels{display:grid;grid-template-columns:1fr;gap:1rem;margin-top:1rem;}
.thesis-review-card h4{margin:0 0 .3rem;}
.thesis-review-list{display:flex;flex-direction:column;gap:.5rem;margin:.5rem 0;}
.thesis-review-row{border:1px solid var(--line);border-radius:var(--radius-sm);padding:.5rem .6rem;background:var(--bg);}
.thesis-review-row.resolved{opacity:.55;}
.thesis-review-meta{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;}
.thesis-review-quote{font-style:italic;color:var(--ink-soft);font-size:.82rem;margin:.25rem 0;border-left:2px solid var(--line);padding-left:.5rem;}
.thesis-review-text{font-size:.9rem;margin:.25rem 0;white-space:pre-wrap;}
.thesis-apply-label{font-weight:600;font-size:.82rem;color:var(--ink-soft);margin:.6rem 0 .25rem;}
.thesis-apply-preview{border:1px solid var(--line);border-radius:var(--radius-sm);padding:.6rem .8rem;background:var(--bg);max-height:22rem;overflow:auto;font-size:.9rem;line-height:1.55;}
/* Imported-document HTML niceties (register-note callouts, provenance tags) */
.ql-editor .doc-tag,.thesis-apply-preview .doc-tag{font-size:.68rem;font-weight:600;letter-spacing:.03em;color:var(--accent);background:var(--accent-wash);border-radius:4px;padding:.02em .35em;}
.ql-editor .doc-register-note,.thesis-apply-preview .doc-register-note{border-left:3px solid var(--accent);background:var(--surface-2);padding:.4rem .7rem;color:var(--ink-soft);font-size:.86rem;border-radius:0 var(--radius-sm) var(--radius-sm) 0;}
.ql-editor .doc-purpose{color:var(--ink-soft);}
.ql-editor .doc-table,.thesis-apply-preview .doc-table{border-collapse:collapse;width:100%;font-size:.82rem;}
.ql-editor .doc-table th,.ql-editor .doc-table td{border:1px solid var(--line);padding:.3rem .5rem;text-align:left;}

/* ---- Stage 5: Scientific rebuild toolbar + preview ---- */
.sci-admin-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .7rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sci-admin-note { font-size: .82rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.sci-preview-modal { width: 60rem; max-width: 100%; }
.sci-preview-frame { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem; max-height: 62vh; overflow: auto; background: var(--bg); }
.sci-preview-frame h2 { font-size: 1.15rem; margin: 1.1rem 0 .5rem; }
.sci-preview-frame h3 { font-size: 1rem; margin: .9rem 0 .35rem; }
.sci-preview-frame .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: .9rem; }
.sci-rebuild-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.sci-rebuild-table th, .sci-rebuild-table td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sci-rebuild-table th { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; color: var(--ink-soft); }
.sci-rebuild-refs { margin: 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.55; }
.sci-rebuild-refs li { margin-bottom: .5rem; }
.sci-rebuild-stamp { font-size: .78rem; color: var(--ink-soft); font-family: var(--mono); margin-top: .5rem; }

/* Thesis Workspace v2: grouped nav, manual-save toolbar, two-pane editor +
   change/review pane, unsaved-change diff, revision history. */
.thesis-nav-actions{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.4rem;}
.thesis-nav-group{font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-soft);font-weight:700;margin:.6rem 0 .15rem;padding-left:.1rem;}
.thesis-dirty{font-size:.78rem;font-family:var(--mono);padding:.1rem .5rem;border-radius:999px;}
.thesis-dirty.saved{color:var(--ink-soft);}
.thesis-dirty.unsaved{color:var(--negative);border:1px solid var(--negative);}
.thesis-split{display:grid;grid-template-columns:1fr 22rem;gap:1rem;align-items:start;}
@media (max-width:1100px){.thesis-split{grid-template-columns:1fr;}}
.thesis-edit-col{min-width:0;}
.thesis-right{position:sticky;top:.5rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden;}
.thesis-right-tabs{display:flex;border-bottom:1px solid var(--line);}
.thesis-right-tabs button{flex:1;border:none;background:none;padding:.55rem;font-family:var(--sans);font-weight:600;font-size:.82rem;color:var(--ink-soft);cursor:pointer;}
.thesis-right-tabs button.active{color:var(--accent);box-shadow:inset 0 -2px 0 var(--accent);}
#thesis-rt-changes,#thesis-rt-comments{padding:.7rem .8rem;max-height:32rem;overflow:auto;}
.thesis-rt-sub{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-soft);font-weight:700;margin:.6rem 0 .3rem;}
.thesis-rt-sub:first-child{margin-top:0;}
.thesis-diff{font-size:.86rem;line-height:1.5;white-space:pre-wrap;word-break:break-word;border:1px solid var(--line);border-radius:var(--radius-sm);padding:.5rem .6rem;background:var(--bg);max-height:16rem;overflow:auto;}
.thesis-diff.has-changes{background:var(--surface-2);}
.diff-ins{background:color-mix(in srgb, var(--structural,#0f9d6b) 22%, transparent);color:var(--ink);border-radius:3px;}
.diff-del{background:color-mix(in srgb, var(--negative) 20%, transparent);color:var(--ink-soft);text-decoration:line-through;border-radius:3px;}
.diff-summary{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-bottom:.5rem;padding-bottom:.45rem;border-bottom:1px solid var(--line);font-size:.78rem;}
.diff-sum-ins{color:var(--structural,#0f9d6b);font-weight:700;}
.diff-sum-del{color:var(--negative);font-weight:700;}
.diff-gap{color:var(--ink-soft);opacity:.7;}
.diff-body{white-space:pre-wrap;word-break:break-word;}
.thesis-revlist{display:flex;flex-direction:column;gap:.35rem;}
.thesis-rev-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);font-size:.8rem;overflow:hidden;}
.thesis-rev-row.open{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);}
.thesis-rev-headrow{display:flex;align-items:stretch;}
.thesis-rev-headrow .thesis-rev-head{flex:1;min-width:0;width:auto;}
.thesis-rev-del{flex:none;border:none;background:none;cursor:pointer;color:var(--ink-soft);font-size:.85rem;line-height:1;padding:.4rem .5rem;opacity:.5;border-radius:var(--radius-sm);}
.thesis-rev-del:hover{opacity:1;color:var(--negative);background:color-mix(in srgb, var(--negative) 12%, transparent);}
.thesis-review-actions{display:flex;gap:.4rem;margin-top:.35rem;flex-wrap:wrap;}
.thesis-review-del:hover{border-color:var(--negative);color:var(--negative);}
.thesis-rev-head{display:flex;align-items:center;gap:.4rem;width:100%;text-align:left;border:none;background:none;font:inherit;color:inherit;padding:.4rem .5rem;cursor:default;}
.thesis-rev-row.clickable .thesis-rev-head{cursor:pointer;}
.thesis-rev-row.clickable .thesis-rev-head:hover{background:var(--surface-2);}
.thesis-rev-caret{color:var(--ink-soft);font-size:.7rem;width:.8rem;display:inline-block;flex:none;}
.thesis-rev-latest{font-size:.62rem;text-transform:uppercase;letter-spacing:.04em;font-weight:700;color:var(--accent);border:1px solid color-mix(in srgb, var(--accent) 40%, transparent);border-radius:999px;padding:0 .4rem;}
.thesis-rev-time{margin-left:auto;color:var(--ink-soft);font-size:.74rem;white-space:nowrap;}
.thesis-rev-summary{color:var(--ink-soft);margin:0 .5rem .35rem;}
.thesis-rev-diff{margin:0 .5rem .5rem;font-size:.84rem;}
.thesis-rev-row .thesis-diff{margin:0 .5rem .5rem;}
.thesis-apply-reflist{margin:.4rem 0;padding-left:1.2rem;font-size:.86rem;line-height:1.5;}
.thesis-apply-rank{font-family:var(--mono);color:var(--accent);font-weight:700;}
.btn.btn-xs{font-size:.72rem;padding:.2rem .5rem;}
