:root {
  --brand: #0197af;
  --accent: #00788c;
  --ink: #152d36;
  --muted: #526872;
  --line: #cbd9dd;
  --pale: #eaf7f8;
  --canvas: #fff;
  --sidebar: #f9fbfb;
  --danger: #9d3a31;
  --amber: #8a5608;
  --font: "Inter","Segoe UI","Microsoft YaHei",Arial,sans-serif;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.48;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
}

[hidden] {
  display: none!important;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

button,a,select,label.drop {
  touch-action: manipulation;
}

button,a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid #067e9b;
  outline-offset: 3px;
}

button:disabled,input:disabled,select:disabled,textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mast {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(18px,3vw,46px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 730;
  font-size: 23px;
  letter-spacing: -.045em;
}

.brand>span {
  display: inline-flex;
  align-items: center;
  line-height: 28px;
  border-left: 1px solid var(--line);
  padding-left: 17px;
}

.brand img {
  width: 63px;
  height: 40px;
  object-fit: contain;
}

.ai {
  color: var(--accent);
}

.mast-actions,.language,.signout,.actions,.row,.group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language {
  gap: 5px;
}

.language span {
  color: #a8babf;
}

.language button {
  font-size: 13px;
  border-bottom: 2px solid transparent;
  padding: 5px 6px;
  color: var(--muted);
}

.language button.active {
  font-weight: 700;
  color: var(--accent);
  border-color: var(--brand);
}

.signout {
  border-left: 1px solid var(--line);
  padding: 3px 0 3px 16px;
  gap: 7px;
  font-size: 13px;
}

.skip {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 8;
  background: white;
  padding: 8px;
}

.skip:focus {
  top: 6px;
}

#layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

nav {
  flex: 0 0 clamp(170px,17vw,238px);
  padding: 37px 0;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.nav-group + .nav-group {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.nav-title {
  padding: 0 clamp(14px,1.6vw,26px) 6px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
  color: var(--muted);
}

nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-left: 3px solid transparent;
  padding: 13px clamp(14px,1.6vw,26px);
  font-size: 15px;
  font-weight: 560;
  color: var(--muted);
}

nav button.active {
  border-color: var(--accent);
  background: var(--pale);
  color: var(--accent);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  min-width: 0;
  flex: 1;
  padding: clamp(24px,3vw,46px);
  max-width: 1510px;
  margin: 0 auto;
  outline: 0;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2 {
  font-weight: 665;
  line-height: 1.15;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(29px,3vw,40px);
}

h2 {
  font-size: clamp(25px,2.1vw,32px);
}

h3 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 10px;
}

.row {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.actions {
  gap: 8px;
  flex-wrap: wrap;
}

.group {
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 37px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
}

.btn:hover,.quiet:hover,.signout:hover {
  background: #eff5f6;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover {
  background: #006778;
}

.btn.bad {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.quiet {
  color: var(--accent);
  padding: 6px 3px;
  font-weight: 600;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  padding: 6px;
  color: var(--muted);
  border-radius: 4px;
}

.iconbtn:hover {
  background: #f4e9e6;
  color: var(--danger);
}

.iconbtn[data-act="rename-study"]:hover {
  background: var(--pale);
  color: var(--accent);
}

.iconbtn .icon {
  width: 17px;
  height: 17px;
}

.hint,.meta,.time {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  margin: 6px 0 16px;
}

.meta {
  font-size: 12px;
}

.time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  white-space: nowrap;
}

.box {
  margin: 21px 0 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.table-scroll {
  max-height: 295px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,td {
  text-align: left;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 12px;
  font-weight: 630;
  background: #f0f4f5;
  color: var(--muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.studyrow td:first-child {
  width: 42%;
}

.studyrow .select-study {
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  padding: 2px 0;
}

.studyrow.selected {
  background: var(--pale);
}

.studyrow.selected .select-study {
  color: var(--accent);
}

.studyrow:hover {
  background: #f4f9fa;
}

td:last-child.tools {
  text-align: right;
  width: 76px;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #edf2f4;
  color: #425962;
  font-size: 12px;
  font-weight: 580;
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.status:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.s-approved,.s-complete,.s-completed,.s-ready {
  color: #24744e;
  background: #eaf6ed;
}

.s-running,.s-review,.s-queued {
  color: var(--accent);
  background: #def3f5;
}

.s-needs_input,.s-skipped {
  color: var(--amber);
  background: #fff3da;
}

.s-error,.s-failed {
  color: var(--danger);
  background: #faeae8;
}

.study-detail {
  border-top: 1px solid var(--line);
  padding-top: 23px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  padding: 8px 13px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 580;
  white-space: nowrap;
}

.tabs button:first-child {
  padding-left: 4px;
}

.tabs button.active {
  color: var(--accent);
  border-color: var(--brand);
}

.count {
  font-size: 12px;
  background: #eff4f5;
  border-radius: 12px;
  padding: 2px 6px;
  margin-left: 3px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px,3vw,42px);
}

.drop {
  display: flex;
  min-height: 157px;
  border: 1.5px dashed #9db6be;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: #fbfdfd;
}

.drop .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.drop b {
  font-size: 15px;
}

.drop .btn {
  color: var(--accent);
  min-height: 31px;
  padding: 6px 10px;
}

.drop.hover,.drop:focus-within {
  background: var(--pale);
  border-color: var(--brand);
}

.sr {
  position: absolute!important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.filelist,.plain-list,.events {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.filelist li,.plain-list li {
  border-bottom: 1px solid #e4ebed;
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow-wrap: anywhere;
}

.filelist .group {
  flex-wrap: nowrap;
  min-width: 0;
  align-items: flex-start;
}

.filelist .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

label.field {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}

input:not([type=file]),textarea,select {
  border: 1px solid #aebfc5;
  background: #fff;
  min-height: 39px;
  border-radius: 5px;
  padding: 8px 10px;
}

textarea,input:not([type=file]) {
  width: 100%;
}

textarea {
  display: block;
  resize: vertical;
  min-height: 106px;
  line-height: 1.5;
}

textarea::placeholder,input::placeholder {
  color: #637983;
}

.stack>*+* {
  margin-top: 12px;
}

.notes {
  white-space: pre-wrap;
}

.empty {
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.empty .icon {
  display: block;
  margin: 0 auto 10px;
  width: 27px;
  height: 27px;
  color: var(--accent);
}

.empty strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.inline-message,.notice {
  padding: 10px 13px;
  border-left: 3px solid var(--brand);
  background: var(--pale);
  margin: 12px 0;
  color: #27515d;
  font-size: 14px;
}

.inline-message.error {
  border-color: var(--danger);
  background: #fbf0ed;
  color: #873a31;
}

.gapcard {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.gapcard h3 {
  margin: 4px 0 8px;
}

.gapcard textarea {
  margin: 9px 0;
  min-height: 64px;
}

.pill {
  font-size: 12px;
  font-weight: 620;
  padding: 2px 7px;
  border-radius: 4px;
  background: #edf3f5;
  color: var(--muted);
}

.pill.required {
  background: #fff1d9;
  color: #805617;
}

.events li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.events p,.section-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.events .time {
  padding-top: 3px;
}

.progress {
  height: 6px;
  width: 100%;
  background: #e3ecee;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  appearance: none;
}

.progress::-webkit-progress-bar {
  background: #e3ecee;
}

.progress::-webkit-progress-value {
  background: var(--brand);
}

.progress::-moz-progress-bar {
  background: var(--brand);
}

.report-table {
  margin: 14px 0;
}

.section-body {
  max-height: 58vh;
  overflow: auto;
  line-height: 1.6;
}

.section-body table {
  display: block;
  overflow: auto;
  margin: 10px 0;
}

.section-body h4 {
  margin: 13px 0 5px;
}

.section-body p+p {
  margin-top: 8px;
}

dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  width: min(510px,calc(100vw - 32px));
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 22px 85px #112a3940;
}

dialog::backdrop {
  background: #17303855;
}

dialog h2 {
  font-size: 24px;
  margin: 0 0 14px;
}

dialog .actions {
  margin-top: 19px;
  justify-content: flex-end;
}

dialog .field {
  margin-top: 12px;
}

dialog p {
  overflow-wrap: anywhere;
}

#notification {
  position: fixed;
  z-index: 20;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px,94vw);
  border-radius: 7px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #183b45;
  color: white;
  box-shadow: 0 6px 25px #102c3630;
  font-size: 14px;
}

#notification.error {
  background: #84382f;
}

#notification button {
  font-size: 22px;
  line-height: 1;
  color: white;
}

.login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 176px);
}

.login form {
  width: min(100%,390px);
  border-top: 3px solid var(--brand);
  padding-top: 25px;
}

.login h1 {
  font-size: 33px;
  margin-bottom: 22px;
}

.login .btn {
  width: 100%;
  margin-top: 15px;
}

.nowrap {
  white-space: nowrap;
}

.report-controls select {
  font-size: 13px;
  min-height: 35px;
}

.report-controls .field {
  margin: 0;
  font-size: 12px;
}

.file-fields {
  margin-bottom: 15px;
}

.lib {
  max-width: 870px;
}

.lib .drop {
  max-width: 650px;
}

.lib ul {
  max-width: 650px;
}

.outline {
  display: block;
  margin-top: 12px;
}

.outline li {
  padding: 8px 0;
}

.outline button {
  color: var(--accent);
  text-align: left;
}

.outline .status {
  flex: none;
}

@media(max-width:850px) {
  nav {
    flex-basis: 155px;
  }
  nav button {
    font-size: 13px;
    gap: 8px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .table-scroll .datecol {
    display: none;
  }
  th,td {
    padding: 9px;
  }
  .mast {
    min-height: 60px;
  }
}

@media(max-width:650px) {
  #layout {
    display: block;
  }
  nav {
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-group {
    display: flex;
    flex-wrap: wrap;
    padding-top: 8px;
  }
  .nav-group + .nav-group {
    margin-top: 0;
    padding-top: 8px;
  }
  .nav-title {
    width: 100%;
    padding: 0 16px;
  }
  nav button {
    width: 50%;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
  }
  nav button.active {
    border-bottom-color: var(--accent);
  }
  main {
    padding: 22px 15px 40px;
  }
  .mast {
    padding: 9px 15px;
  }
  .brand {
    gap: 10px;
    font-size: 20px;
  }
  .brand>span {
    padding-left: 10px;
  }
  .brand img {
    width: 49px;
    height: 32px;
  }
  .mast-actions {
    gap: 5px;
  }
  .signout {
    padding-left: 10px;
  }
  .signout .word {
    display: none;
  }
  .box {
    margin: 15px 0 21px;
  }
  .tabs {
    margin: 12px 0 17px;
    gap: 0;
  }
  .tabs button {
    padding: 8px 9px;
    font-size: 13px;
  }
  .row.detail-heading {
    align-items: flex-start;
  }
  .report-controls {
    gap: 6px;
  }
  .status {
    font-size: 11px;
  }
  th,td {
    font-size: 12px;
  }
  .events li {
    grid-template-columns: 1fr;
  }
  .login {
    min-height: 70vh;
  }
  .time {
    font-size: 11px;
  }
  .studyrow td:first-child {
    width: 43%;
  }
  .brand>span {
    line-height: 23px;
  }
  dialog {
    padding: 20px;
  }
  .table-scroll {
    max-height: 248px;
  }
}

.research {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

.research input[type=checkbox] {
  appearance: auto;
  accent-color: var(--accent);
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
}

.templates {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0 0;
}

.templates a,.filelist a {
  text-underline-offset: 3px;
}

.filelist a {
  color: var(--ink);
}

.filelist a:hover {
  color: var(--accent);
}

.workflow {
  margin: 19px 0 12px;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(112deg, #f2fafb, #fff 74%);
}
.workflow ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}
.workflow li {
  position: relative;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  padding-right: 7px;
}
.workflow li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.workflow li:last-child::before { display: none; }
.workflow li > span {
  display: block;
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--line);
  margin-bottom: 6px;
}
.workflow .current { color: var(--accent); font-weight: 700; }
.workflow .current > span { border-color: var(--accent); box-shadow: 0 0 0 3px #d6eff2; }
.workflow .complete > span, .workflow .complete::before { background: var(--accent); border-color: var(--accent); }
.workflow p { font-size: 13px; margin-top: 13px; }
.inbox h3, .assembly h3 { margin-bottom: 0; font-size: 19px; }
.inbox-head, .assembly > .row { margin-bottom: 9px; }
.ticket-filters { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.ticket-filters label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.ticket-filters select { display: block; font-size: 13px; font-weight: 400; margin-top: 4px; max-width: 100%; }
.ticket-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.ticket + .ticket { border-top: 1px solid var(--line); }
.ticket-heading {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 132px 12px;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px 16px;
}
.ticket-heading:hover, .expanded > .ticket-heading { background: #f3f9fa; }
.ticket-heading:focus-visible { outline-offset: -3px; }
.ticket-text { min-width: 0; overflow-wrap: anywhere; }
.ticket-text small, .ticket-ref { display: block; font-size: 12px; color: var(--muted); }
.ticket-text strong { display: block; font-weight: 600; line-height: 1.35; margin-top: 2px; }
.ticket-heading .status { justify-self: start; white-space: normal; }
.ticket-priority { justify-self: start; color: var(--muted); font-size: 12px; }
.ticket-priority.required { color: #78500c; font-weight: 600; }
.disclosure { width: 8px; height: 8px; border: solid var(--muted); border-width: 0 1.7px 1.7px 0; transform: rotate(-45deg); }
.expanded .disclosure { transform: rotate(45deg); }
.ticket-body { padding: 13px 16px 17px; border-top: 1px solid #e1eaec; }
.ticket-body p { overflow-wrap: anywhere; }
.ticket-conflict { margin: 10px 0 16px; border-left: 3px solid #b98227; background: #fffbf2; padding: 10px 14px; overflow-wrap: anywhere; }
.ticket-conflict h4 { margin: 0 0 6px; font-size: 14px; color: #694811; }
.ticket-conflict ol { margin: 0; padding-inline-start: 22px; }
.ticket-conflict li { padding: 5px 0; }
.ticket-conflict li + li { border-top: 1px solid #e6ddc9; }
.ticket-conflict blockquote { margin: 4px 0; white-space: pre-wrap; }
.ticket-conflict li small { color: #52646a; }
.ticket-conflict :is(p,.hint) { margin: 4px 0; }
.ticket-provider { margin: 10px 0 16px; border-left: 3px solid #7099a0; padding: 10px 14px; background: #f2f7f8; overflow-wrap: anywhere; }
.ticket-provider :is(h4,h5,p),.hold-location p { margin: 4px 0; }
.ticket-provider h5 { margin-top: 10px; }
.ticket-provider ul { margin: 5px 0; padding-inline-start: 19px; }
.ticket-provider li,.hold-location { font-size: 13px; }
.hold-location code { overflow-wrap: anywhere; }
.ticket-ref { margin: 6px 0 11px; }
.ticket-body textarea { min-height: 84px; margin-bottom: 10px; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.s-passed, .s-resolved { color: #276944; background: #e4f3e8; }
.s-blocked { color: var(--danger); background: #faeae8; }
.s-warning, .s-conflict { color: var(--amber); background: #fff3da; }
.s-deferred, .s-answered { color: #3f6475; background: #edf3f6; }
.audit-checks { list-style: none; margin: 12px 0 18px; padding: 0; }
.audit-checks li { display: flex; justify-content: space-between; align-items: flex-start; padding: 9px 0; gap: 12px; border-top: 1px solid var(--line); }
.audit-checks strong { font-size: 14px; }
.audit-checks p { font-size: 13px; color: var(--muted); }
.exports { margin: 6px 0 22px; }
.issued-list { display: grid; gap: 1rem; }
.issued-report { padding: 1rem 1.25rem; }
.issued-report h2 { margin: 0; overflow-wrap: anywhere; }
.issued-report .exports { margin: .75rem 0 0; }
.issue-downloads { margin: 1rem 0; }
.inline-link { padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font: inherit; }
@media(max-width:720px) {
  .workflow { padding: 13px 10px; }
  .workflow li { font-size: 11px; line-height: 1.3; }
  .ticket-heading { grid-template-columns: minmax(0, 1fr) auto minmax(56px, 92px) 9px; gap: 7px; padding: 11px 8px; }
  .ticket-heading .status { font-size: 11px; padding: 2px 5px; }
  .ticket-text strong { font-size: 14px; }
  .ticket-filters label { max-width: 100%; }
}
@media(max-width:430px) {
  .ticket-heading { grid-template-columns: auto 1fr 10px; }
  .ticket-text { grid-row: 1; grid-column: 1 / 3; }
  .ticket-priority { grid-row: 2; grid-column: 1; }
  .ticket-heading .status { grid-row: 2; grid-column: 2; }
  .disclosure { grid-row: 1 / 3; grid-column: 3; }
}
.scope-panel,.handoff { margin: 16px 0; padding: 10px 12px; background: #f5fafb; border: 1px solid var(--line); border-radius: 6px; }
.scope-panel summary,.handoff summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; }
.scope-panel .pill { flex-shrink: 0; }
.saved-inventory { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.saved-inventory strong { color: var(--ink); }
.file-meta { display: block; font-size: 12px; color: var(--muted); }
.filelist .inline-link { font-size: 12px; text-align: left; }
.evidence-records { margin: 12px 0 3px; font-size: 14px; overflow-wrap: anywhere; }
.evidence-records dt { font-weight: 600; }
.evidence-records dd { margin: 4px 0 13px; white-space: pre-wrap; }
.evidence-records dd + dt { border-top: 1px solid var(--line); padding-top: 11px; }
.citation { font-size: .89em; text-decoration: underline; text-underline-offset: 2px; }
.citation.public { color: #005b72; }
.citation.supplied { color: #3f5261; }
.source-register { list-style: none; margin: 6px 0; padding: 0; white-space: normal; overflow-wrap: anywhere; }
.source-register li { padding: 8px 0; border-top: 1px solid var(--line); }
.source-register li:target { background: #e1f1f4; }
.source-register small { display: block; color: var(--muted); }
.table-source { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.handoff dl { display: grid; grid-template-columns: minmax(100px,30%) minmax(0,1fr); gap: 4px 12px; margin: 9px 0; font-size: 13px; }
.handoff dd { margin: 0; }
.handoff dt,.handoff small,.scope-panel small { color: var(--muted); }
.handoff ul { margin: 0; padding-left: 21px; }
.study-setup { margin: 0 0 22px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.study-setup h3 { margin: 0 0 10px; font-size: 17px; }
.setup-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; }
.setup-controls > .btn { margin-left: auto; }
.study-setup .hint { margin: 8px 0 0; }
.restart-options { margin-top: 12px; color: var(--muted); font-size: 13px; }
.restart-options summary { width: fit-content; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.restart-options-body { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding-top: 9px; }
.restart-options-body .hint { margin: 0; }
.live-work { padding: 15px 18px 12px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 7px; overflow-wrap: anywhere; }
.live-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; }
.live-heading h3 { font-size: 18px; margin: 0; }
.work-title { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
#run-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.s-paused,.run-indicator[data-state=paused],.run-indicator[data-state=pausing] { color: #71501b; background: #fff2d7; }
.run-indicator { display: inline-flex; align-items: center; gap: 7px; background: #e4f4f5; color: #006b7d; border-radius: 20px; padding: 3px 9px; font-size: 12px; font-weight: 650; }
.run-indicator i { width: 13px; height: 13px; flex: none; border-radius: 50%; border: 2px solid #9ccfd6; border-top-color: currentColor; }
.run-indicator[data-state=running] i { animation: work-rotate .85s linear infinite; }
.run-indicator[data-state=stale],.run-indicator[data-state=disconnected] { background: #fff2d7; color: #865414; }
.run-indicator:not([data-state=running]) i { border-color: currentColor; border-width: 1px; display: grid; place-items: center; }
.run-indicator:not([data-state=running]) i::before { content: ""; width: 3px; height: 3px; border-bottom: 1px solid currentColor; border-left: 1px solid currentColor; }
.events small { color: var(--muted); }
@keyframes work-rotate { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .run-indicator[data-state=running] i { animation: none; } }
.work-count { color: var(--accent); font-size: 13px; font-weight: 650; }
.live-work h4,.work-update > span,.work-times dt { font-size: 12px; font-weight: 650; color: var(--muted); }
.live-work h4 { margin: 11px 0 5px; }
.live-work p { font-size: 14px; margin: 5px 0; }
.work-tasks { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(225px,100%),1fr)); gap: 7px 12px; list-style: none; margin: 0; padding: 0; }
.work-tasks li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 11px; background: #f2f8f9; border-radius: 4px; }
.work-tasks strong { font-size: 14px; display: block; }
.work-role,.work-tasks small { display: block; font-size: 12px; color: var(--muted); }
.work-tasks p { margin: 3px 0; }
.work-tasks .transport { color: #00586a; }
.work-age,.work-times dd { font-variant-numeric: tabular-nums; }
.work-age { flex-shrink: 0; }
.work-update { margin-top: 10px; }
.work-update p { margin: 2px 0; }
.work-times { display: flex; flex-wrap: wrap; gap: 5px 24px; margin: 11px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.work-times:empty { display: none; }
.work-times dd { margin: 0; font-size: 13px; }
.live-work .connection-note { color: var(--amber); }
.reply-files { margin: 6px 0 12px; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.selected-files li { display: flex; align-items: baseline; gap: 12px; }
.selected-files { padding-left: 0; }
.ticket-drop { min-height: 62px; flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; }
.ticket-drop .icon { flex: 0 0 20px; width: 20px; height: 20px; }
.ticket-drop small { display: block; margin-top: 3px; }
.context-form { display: grid; grid-template-columns: minmax(110px,1fr) minmax(160px,3fr); align-items: end; gap: 8px 16px; margin: 12px 0 20px; }
.context-body { grid-column: 1 / -1; }
.context-form .btn { justify-self: start; }
.context-records { list-style: none; padding: 0; }
.context-records li { display: flex; justify-content: space-between; align-items: flex-start; border-top: 1px solid var(--line); padding: 12px 0; gap: 10px; overflow-wrap: anywhere; }
.context-records small { display: block; color: var(--muted); }
.context-records p { font-size: 14px; white-space: pre-wrap; max-height: 12em; overflow: auto; }
.doc-head,.doc-tools,.request-head { display: flex; align-items: baseline; gap: 6px 15px; flex-wrap: wrap; }
.doc-head h3 { margin: 0; }
.doc-message,.doc-missing { color: var(--amber); font-size: 13px; }
.doc-tools { font-size: 13px; margin: 10px 0; }
.doc-info,.doc-help,.doc-error { font-size: 14px; margin: 7px 0; }
.doc-help { color: var(--muted); }
.doc-error { color: var(--danger); }
.doc-chapters { margin: 15px 0; }
.doc-chapters article { border-top: 1px solid var(--line); min-width: 0; }
.doc-chapter-title { display: flex; justify-content: space-between; align-items: baseline; text-align: left; width: 100%; padding: 13px 4px; gap: 13px; color: var(--ink); }
.doc-chapter-title small { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.doc-chapter-title[aria-expanded=true] strong { color: var(--accent); }
.doc-body { padding: 0 clamp(5px,3vw,36px) 16px; max-width: 870px; overflow-wrap: anywhere; }
.doc-body p { line-height: 1.7; margin: 12px 0; white-space: pre-wrap; }
.doc-body h4 { color: var(--ink); margin: 16px 0 6px; }
.doc-body mark { background: #ffebac; color: inherit; }
.doc-exhibits { margin: 10px 0; }
.doc-exhibits summary { cursor: pointer; color: var(--accent); }
.doc-tables { overflow-x: auto; }
.doc-gaps { border-left: 3px solid #d49a47; padding: 8px 12px; background: #fff8e8; }
.doc-gaps ul { margin: 4px 0; padding-left: 20px; }
.doc-quote-bar { position: sticky; bottom: 12px; width: fit-content; margin: 0 auto; display: flex; gap: 8px; background: white; padding: 6px; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 2px 10px #143f461a; }
.doc-form form,.doc-requests li { background: #f7fafb; padding: 12px 15px; margin: 10px 0; border-radius: 5px; }
.doc-form textarea { width: 100%; margin: 5px 0 10px; }
.doc-form h4,.doc-requests h4 { margin: 8px 0; }
.doc-form blockquote,.doc-requests blockquote { margin: 8px 0; border-left: 2px solid var(--brand); padding: 0 10px; color: var(--muted); }
.doc-requests ol { list-style: none; padding: 0; }
.doc-requests small { color: var(--muted); }
.doc-requests p { white-space: pre-wrap; }
@media(max-width:600px) {
  .live-work { padding: 12px; }
  .setup-controls > .btn { margin-left: 0; }
  .context-form { grid-template-columns: minmax(0,1fr); }
}
