:root {
  --ink: #182230;
  --muted: #667085;
  --line: #d7dde7;
  --soft: #f5f7fa;
  --blue: #2855a6;
  --blue-soft: #eef4ff;
  --green: #23724a;
  --red: #a52a2a;
  --white: #fff;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
.disabled-section {
  opacity: 0.55;
}
.input-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-direction: column;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f7f8fa;
  color: var(--ink);
  font:
    15px/1.45 Arial,
    Calibri,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.hidden {
  display: none !important;
}
.topbar {
  height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 47px;
  height: 47px;
  object-fit: contain;
}
.brand strong {
  display: block;
  font-size: 19px;
}
.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.case-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.case-controls > select {
  width: 290px;
}
select,
input,
textarea {
  width: 100%;
  border: 1px solid #bbc4d1;
  border-radius: 6px;
  background: #fff;
  padding: 10px 11px;
  outline: none;
}
textarea {
  resize: vertical;
}
select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 85, 166, 0.12);
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #344054;
}
label input,
label select,
label textarea {
  font-weight: 400;
}
.button,
.menu summary {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.primary {
  background: var(--blue);
  color: #fff;
}
.button.secondary,
.menu summary {
  border-color: #bbc4d1;
}
.button:hover,
.menu summary:hover {
  filter: brightness(0.97);
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  background: #eef0f3;
}
.danger {
  color: var(--red) !important;
}
.menu {
  position: relative;
}
.menu summary {
  list-style: none;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu > div {
  position: absolute;
  right: 0;
  top: 45px;
  width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.15);
  z-index: 30;
}
.menu > div button,
.menu > div label {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px;
  font-weight: 400;
  cursor: pointer;
  border-radius: 4px;
}
.menu > div button:hover,
.menu > div label:hover {
  background: var(--soft);
}
.menu input {
  display: none;
}
.step-nav {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.step-nav button {
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}
.step-nav button span {
  width: 27px;
  height: 27px;
  border: 1px solid #aeb7c5;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.step-nav button.active {
  color: var(--blue);
}
.step-nav button.active span {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.step {
  display: none;
}
.active-step {
  display: block;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading p {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.page-heading h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.2;
}
.page-heading > div > span,
.muted,
#save-status {
  color: var(--muted);
  font-size: 14px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.form-grid {
  display: grid;
  gap: 18px;
}
.form-grid.two {
  grid-template-columns: 1fr 1fr;
}
.full {
  grid-column: 1/-1;
}
.short {
  max-width: 330px;
}
.coordinate-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.site-note {
  margin: -6px 0 0;
  padding: 9px 11px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.section-heading h2,
.section-heading h3 {
  margin: 0 0 3px;
}
.section-heading h2 {
  font-size: 20px;
}
.section-heading h3 {
  font-size: 16px;
}
.section-heading p,
.export p {
  margin: 0;
  color: var(--muted);
}
.page-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}
.status {
  border-radius: 99px;
  padding: 5px 10px;
  background: #fff3cd;
  color: #725500;
  font-size: 12px;
  font-weight: 700;
}
.status.frozen {
  background: #e7f5ec;
  color: var(--green);
}
.notice {
  padding: 13px 15px;
  border: 1px solid #bfd1f2;
  border-radius: 7px;
  background: #eef4ff;
  margin-bottom: 18px;
}
.notice.warning {
  border-color: #f0d2a2;
  background: #fff4e5;
}
.stage-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.stage-tabs button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 11px 8px;
  text-align: left;
  cursor: pointer;
}
.stage-tabs button strong {
  display: block;
}
.stage-tabs button span {
  font-size: 12px;
  color: var(--muted);
}
.stage-tabs button.active {
  border: 2px solid var(--blue);
  background: var(--blue-soft);
  padding: 10px 7px;
}
.stage-tabs button.frozen span {
  color: var(--green);
  font-weight: 700;
}
.phase-sticky-nav {
  position: sticky;
  top: 74px;
  z-index: 15;
  margin: -10px 0 18px;
  padding: 10px;
  background: rgba(247, 248, 250, 0.97);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.1);
  backdrop-filter: blur(5px);
}
.phase-sticky-nav .stage-tabs {
  margin-bottom: 8px;
}
.phase-sticky-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phase-sticky-actions > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.phase-sticky-actions > div {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.phase-sticky-actions .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}
.input-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}
.input-card h3 {
  margin: 0;
  font-size: 16px;
}
.input-card p {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.file-button {
  display: inline-flex;
  width: auto;
  margin-top: 8px;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
}
.file-button input {
  display: none;
}
.attachments {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--soft);
  font-size: 12px;
}
.attachment-chip button {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
  padding: 0;
}
.sherloc-image-attachments {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.sherloc-image {
  position: relative;
  width: 170px;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}
.sherloc-image img {
  display: block;
  width: 100%;
  height: 105px;
  object-fit: contain;
  background: #fff;
}
.sherloc-image figcaption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  font-size: 12px;
}
.sherloc-image button {
  border: 0;
  background: none;
  color: var(--red);
  padding: 2px 0;
  font-size: 12px;
  cursor: pointer;
}
.sherloc-attachment.file a {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
}
.inclination-tool {
  border: 1px solid #bed0ed;
  border-radius: 8px;
  background: #f7faff;
  padding: 16px;
  margin-top: 16px;
}
.inclination-tool .section-heading {
  margin-bottom: 12px;
}
.calculation-result {
  border-left: 4px solid var(--blue);
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.calculation-result strong {
  color: var(--ink);
}
.inclination-fields {
  margin-top: 12px;
}
.method-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.solution {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.solution-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.solution-header button {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
}
.solution-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
}
.most-likely {
  margin-top: 18px;
}
.freeze-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid #bed0ed;
  border-radius: 9px;
  background: var(--blue-soft);
}
.freeze-bar > div {
  margin-right: auto;
}
.freeze-bar strong,
.freeze-bar span {
  display: block;
}
.freeze-bar span {
  font-size: 13px;
  color: var(--muted);
}
.reference-library details,
.calculation-audit {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.reference-library summary,
.calculation-audit summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}
.reference-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.reference-record {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--soft);
}
.reference-record > div strong,
.reference-record > div span {
  display: block;
}
.reference-record > div span,
.reference-record p {
  font-size: 13px;
}
.reference-record p {
  margin: 6px 0 0;
}
.reference-record a,
.calculation-audit a {
  color: var(--blue);
  overflow-wrap: anywhere;
}
.calculation-audit {
  background: #fff;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 14px;
}
.calculation-audit h4 {
  margin: 15px 0 5px;
}
.calculation-audit code {
  display: block;
  white-space: normal;
  background: var(--soft);
  border-radius: 5px;
  padding: 8px;
  font-size: 12px;
}
.calculation-audit table {
  font-size: 12px;
}
.calculation-audit th,
.calculation-audit td {
  padding: 7px;
}
.audit-reference {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--blue);
  padding: 8px 10px;
  margin-top: 8px;
  background: var(--blue-soft);
  font-size: 12px;
}
.reference-capture {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.reference-metadata {
  padding: 10px 12px;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  font-size: 13px;
  line-height: 1.55;
}
.reference-filter-label {
  display: block;
  margin-top: 12px;
  max-width: 620px;
}
.reference-filter-label input {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.step-nav .tool-nav {
  margin-left: 18px;
  padding-left: 32px;
  border-left: 1px solid var(--line);
}
.step-nav .tool-nav span {
  border-radius: 7px;
}
.workbench-calculator {
  background: #f7faff;
}
.workbench-actions > div:first-child {
  margin-bottom: 16px;
}
.workbench-actions h2 {
  margin: 0 0 3px;
}
.workbench-actions p {
  margin: 0;
  color: var(--muted);
}
.workbench-actions .button-row {
  margin-top: 18px;
}
.workbench-print-report {
  display: none;
}
.evidence-category-heading,
.evidence-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.evidence-category-heading .button {
  flex: none;
}
.evidence-item {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #c8d1de;
  border-radius: 7px;
  background: var(--soft);
}
.evidence-item-heading {
  margin-bottom: 12px;
}
.evidence-item-heading button {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
}
.evidence-metadata {
  margin-bottom: 12px;
}
.evidence-attachments {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.evidence-attachment {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.evidence-attachment.image {
  width: 170px;
  margin: 0;
  padding: 7px;
}
.evidence-attachment.image img {
  display: block;
  width: 100%;
  height: 105px;
  object-fit: contain;
  background: #fff;
}
.evidence-attachment.image figcaption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  font-size: 12px;
}
.evidence-attachment.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.evidence-attachment button {
  border: 0;
  background: none;
  color: var(--red);
  padding: 2px 0;
  font-size: 12px;
  cursor: pointer;
}
.evidence-category-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.evidence-item {
  overflow: hidden;
}
.evidence-item-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style-position: outside;
}
.evidence-item-summary::marker {
  color: var(--blue);
}
.evidence-summary-title {
  font-weight: 500;
}
.evidence-summary-meta {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}
.evidence-item.carried:not([open]) {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f7f9fc;
}
.evidence-item-body {
  padding-top: 14px;
}
.evidence-item-body .evidence-item-heading {
  justify-content: flex-end;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .evidence-category-heading,
  .evidence-item-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .evidence-category-actions {
    justify-content: flex-start;
  }
  .evidence-summary-meta {
    padding-left: 18px;
  }
}
.evidence-bottom-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.evidence-view-toggle {
  display: inline-flex;
  border: 1px solid #aeb7c5;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.evidence-view-toggle button {
  border: 0;
  border-right: 1px solid #aeb7c5;
  background: #fff;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.evidence-view-toggle button:last-child {
  border-right: 0;
}
.evidence-view-toggle button.active {
  background: var(--blue);
  color: #fff;
}
.evidence-filter-empty {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px dashed #aeb7c5;
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}
.truth-row {
  display: grid;
  grid-template-columns: 1fr 110px 1.3fr 36px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.truth-count-summary {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--soft);
  font-weight: 700;
}
.truth-attachments {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.truth-attachment {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}
.truth-attachment.image {
  width: 170px;
  margin: 0;
  padding: 7px;
}
.truth-attachment.image img {
  display: block;
  width: 100%;
  height: 105px;
  object-fit: contain;
  background: #fff;
}
.truth-attachment.image figcaption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  font-size: 12px;
}
.truth-attachment.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.truth-attachment button {
  border: 0;
  background: none;
  color: var(--red);
  padding: 2px 0;
  font-size: 12px;
  cursor: pointer;
}
.icon-button {
  height: 41px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--red);
  cursor: pointer;
}
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 13px;
  margin-top: 18px;
  border: 1px solid #cbdaf3;
  border-radius: 7px;
  background: #f6f9ff;
}
.check input {
  width: 18px;
  height: 18px;
}
.check span {
  font-weight: 600;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.metric {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  font-size: 24px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--soft);
}
.export {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}
.export h2 {
  margin: 0 0 3px;
}
.export > div:first-child {
  flex: 1;
}
.report-option {
  max-width: 330px;
  margin-top: 12px;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.print-report {
  display: none;
}
dialog {
  width: min(520px, calc(100% - 32px));
  border: 0;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.3);
}
dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
}
dialog h2 {
  margin-top: 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 11px 15px;
  border-radius: 6px;
  background: #172033;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
  z-index: 50;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: none;
}
.evidence-import-dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
}
.dialog-close {
  float: right;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #475467;
  cursor: pointer;
}
.import-table-wrap {
  max-height: 410px;
}
.import-table-wrap textarea {
  min-width: 260px;
}
.import-table-wrap select {
  min-width: 210px;
}
.import-receipt {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin: 10px 0;
  background: var(--soft);
}
.import-receipt strong,
.import-receipt span {
  display: block;
}
.import-receipt span {
  color: var(--muted);
  font-size: 12px;
}
.import-receipt p {
  margin: 7px 0;
  font-size: 13px;
}
.import-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.import-category-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.3;
}
.import-image-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.import-image-review {
  display: grid;
  grid-template-columns: auto 88px minmax(150px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.import-image-review img {
  width: 88px;
  height: 66px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.import-image-review strong,
.import-image-review small {
  display: block;
  overflow-wrap: anywhere;
}
.import-image-review small {
  margin-top: 3px;
  color: var(--muted);
}
.import-advanced {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}
.import-advanced summary {
  cursor: pointer;
  font-weight: 700;
}
.import-advanced .file-button {
  display: inline-block;
  margin-top: 10px;
}
.import-capture-summary {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #b2ccff;
  border-radius: 7px;
  background: #eff6ff;
}
.import-capture-summary span {
  font-size: 13px;
  color: var(--muted);
}
.import-capture-summary .import-warning {
  color: #854d0e;
}
.import-thread-list {
  display: grid;
  gap: 10px;
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
}
.import-thread-message {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.import-thread-keep {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 14px 7px;
  background: var(--soft);
  border-radius: 8px 0 0 8px;
  font-weight: 700;
}
.import-thread-body {
  padding: 12px;
}
.import-thread-body header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.import-thread-body header span,
.import-thread-body time,
.import-thread-body footer {
  font-size: 12px;
  color: var(--muted);
}
.import-thread-body time {
  margin-left: auto;
}
.import-thread-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0;
  font: 13px/1.45 inherit;
}
.import-post-status,
.import-edited {
  padding: 2px 7px;
  border-radius: 99px;
  background: #f2f4f7;
}
.import-post-status.duplicate {
  color: #475467;
}
.import-post-status.changed {
  color: #854d0e;
  background: #fef0c7;
}
.import-report-controls {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.import-report-controls label {
  font-size: 12px;
}
.evidence-report-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.evidence-report-controls legend {
  padding: 0 5px;
  font-weight: 700;
}
.evidence-report-controls label {
  font-size: 12px;
}
.import-phase-controls {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 1fr);
  gap: 12px 20px;
  align-items: start;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid #84adff;
  border-radius: 8px;
  background: #eff6ff;
}
.import-phase-controls p {
  margin: 4px 0;
}
.import-phase-controls > .check {
  grid-column: 1/-1;
  margin: 0;
}
@media (max-width: 760px) {
  .topbar {
    height: auto;
    padding: 12px 16px;
    align-items: flex-start;
  }
  .brand span {
    display: none;
  }
  .case-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .case-controls > select {
    width: 210px;
  }
  .step-nav {
    gap: 7px;
    justify-content: space-between;
    overflow-x: auto;
  }
  .step-nav button {
    font-size: 12px;
    gap: 5px;
    white-space: nowrap;
  }
  .step-nav .tool-nav {
    margin-left: 0;
    padding-left: 10px;
  }
  .form-grid.two,
  .solution-grid,
  .metrics {
    grid-template-columns: 1fr;
  }
  .stage-tabs {
    grid-template-columns: 1fr 1fr;
  }
  .phase-sticky-nav {
    top: 70px;
  }
  .phase-sticky-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-heading {
    display: block;
  }
  .page-heading > .status {
    display: inline-block;
    margin-top: 8px;
  }
  .truth-row {
    grid-template-columns: 1fr 90px 36px;
  }
  .truth-row label:nth-child(3) {
    grid-column: 1/3;
  }
  .truth-row button {
    grid-column: 3;
    grid-row: 1/3;
  }
  .export {
    display: block;
  }
}
@media print {
  @page {
    size: auto;
    margin: 0.48in;
  }
  body {
    background: #fff;
  }
  .topbar,
  .step-nav,
  main > .step {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .active-step#step-results {
    display: block !important;
  }
  .active-step#step-results > .page-heading,
  .active-step#step-results > .metrics,
  .active-step#step-results > .panel,
  .active-step#step-results > .page-actions {
    display: none !important;
  }
  .print-report {
    display: block !important;
    font: 8.75pt/1.28 Arial;
    color: #000;
  }
  .report-title {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 6px;
  }
  .report-title img {
    width: 44px;
  }
  .print-report h1 {
    margin: 0;
    font-size: 17pt;
  }
  .print-report h2 {
    font-size: 12pt;
    border-bottom: 1px solid #000;
    margin: 12px 0 4px;
    break-after: avoid-page;
  }
  .print-report h3 {
    font-size: 10pt;
    margin: 7px 0 3px;
    break-after: avoid-page;
  }
  .print-report h4 {
    font-size: 9.25pt;
    margin: 5px 0 2px;
    break-after: avoid-page;
  }
  .print-report p,
  .print-report pre {
    margin: 2px 0;
  }
  .print-report pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid #aaa;
    padding: 4px;
    font:
      8pt/1.25 Consolas,
      monospace;
  }
  .print-report ol {
    margin: 3px 0 4px;
    padding-left: 20px;
  }
  .print-report li {
    margin: 1px 0;
  }
  .print-report table {
    font-size: 8pt;
  }
  .print-report th,
  .print-report td {
    border: 1px solid #777;
    padding: 3px 4px;
  }
  .report-phase-meta {
    color: #333;
  }
  .report-empty {
    font-style: italic;
    color: #555;
  }
  .report-evidence-group,
  .report-assessment,
  .report-sherloc {
    margin: 0;
  }
  .report-evidence-item {
    break-inside: auto;
    border-top: 1px solid #ccc;
    padding: 2px 0 5px;
  }
  .report-evidence-item:first-of-type {
    border-top: 0;
  }
  .report-evidence-item p {
    overflow-wrap: anywhere;
  }
  .report-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 3px 0;
  }
  .report-images figure {
    margin: 2px 0;
    break-inside: avoid-page;
  }
  .report-images img {
    display: block;
    max-width: 100%;
    max-height: 230px;
    object-fit: contain;
    border: 1px solid #999;
  }
  .report-images figcaption {
    font-size: 7.25pt;
    margin-top: 1px;
    overflow-wrap: anywhere;
  }
  .report-run {
    break-before: auto;
    break-inside: auto;
  }
  .report-run + .report-run {
    margin-top: 8px;
  }
}
@media print {
  .report-overview {
    border: 1px solid #aeb7c5;
    padding: 7px 9px;
    margin: 7px 0;
  }
  .report-overview h2 {
    margin-top: 0;
  }
  .report-phase-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin: 8px 0 13px;
    break-inside: avoid-page;
  }
  .report-phase-step {
    border: 1px solid #aeb7c5;
    padding: 5px;
    background: #f5f7fa;
    min-height: 50px;
  }
  .report-phase-step span {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #182230;
    color: #fff;
    font-weight: 700;
    margin-right: 3px;
  }
  .report-phase-step strong {
    font-size: 8pt;
  }
  .report-phase-step small {
    display: block;
    margin-top: 3px;
    color: #555;
    font-size: 6.7pt;
  }
  .report-run {
    margin: 13px 0 0;
    border: 1px solid #aeb7c5;
  }
  .report-phase-header {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
    align-items: center;
    background: #182230;
    color: #fff;
    padding: 7px 9px;
    break-inside: avoid-page;
  }
  .report-phase-header h2 {
    color: #fff;
    border: 0;
    margin: 0;
    font-size: 12.5pt;
  }
  .report-phase-header p {
    color: #d0d5dd;
    margin: 1px 0;
  }
  .report-phase-number {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: #fff;
    color: #182230;
    font-size: 14pt;
    font-weight: 700;
  }
  .report-phase-dates {
    text-align: right;
    font-size: 7pt;
    color: #e4e7ec;
    line-height: 1.35;
  }
  .report-run > div:not(.report-phase-summary),
  .report-run > .report-evidence-group,
  .report-run > p {
    margin-left: 9px;
    margin-right: 9px;
  }
  .report-phase-summary {
    margin: 0;
    padding: 8px 10px;
    background: #eef4ff;
    border-bottom: 1px solid #bed0ed;
    break-inside: avoid-page;
  }
  .report-phase-summary strong {
    color: #2855a6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 8pt;
  }
  .report-phase-summary p {
    font-size: 9.5pt;
    margin-top: 3px;
  }
  .report-phase-summary.missing {
    background: #f5f7fa;
    color: #555;
  }
  .report-change-summary,
  .report-carry-summary {
    padding: 4px 7px;
    background: #f5f7fa;
    border-left: 3px solid #667085;
  }
  .report-removed {
    color: #7a271a;
  }
  .report-evidence-group {
    padding: 0 9px;
  }
  .report-evidence-item {
    border: 1px solid #c7ced8;
    border-left: 4px solid #667085;
    margin: 5px 0;
    padding: 5px 7px;
  }
  .report-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .report-item-heading h4 {
    margin: 0;
  }
  .report-change {
    display: inline-block;
    border-radius: 99px;
    padding: 1px 5px;
    font-size: 6.7pt;
    text-transform: uppercase;
    font-weight: 700;
    background: #e4e7ec;
    color: #344054;
  }
  .report-change.added,
  .report-change.initial {
    background: #dcfae6;
    color: #166534;
  }
  .report-change.updated {
    background: #fef0c7;
    color: #854d0e;
  }
  .report-source-meta {
    font-size: 7.5pt;
    color: #555;
  }
  .report-source-text > strong,
  .report-interpretation > strong {
    display: block;
    margin-top: 4px;
    font-size: 7.5pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475467;
  }
  .report-source-text pre {
    background: #fafafa;
  }
  .report-interpretation {
    margin-top: 4px;
    padding: 5px 7px;
    background: #eef4ff;
    border-left: 3px solid #2855a6;
    break-inside: avoid-page;
  }
  .report-interpretation p {
    font-size: 9pt;
  }
  .report-assessment,
  .report-sherloc {
    padding: 0 9px 7px;
  }
  .report-calculation {
    margin-top: 15px;
    border: 1px solid #667085;
    padding: 8px 10px;
  }
  .report-calculation h2 {
    margin-top: 0;
  }
  .report-calculation table {
    font-size: 7pt;
  }
  .report-calculation ol {
    padding-left: 18px;
  }
  .report-truth {
    margin-top: 15px;
    border: 2px solid #23724a;
    padding: 8px 10px;
    break-before: auto;
  }
  .report-truth h2 {
    color: #185c3b;
    border-color: #23724a;
    margin-top: 0;
  }
}
@media print {
  .active-step#step-workbench {
    display: block !important;
  }
  .active-step#step-workbench > .page-heading,
  .active-step#step-workbench > .panel {
    display: none !important;
  }
  .active-step#step-workbench .workbench-print-report {
    display: block !important;
  }
  .workbench-print-report .calculation-audit {
    display: block;
    border: 0;
    padding: 0;
  }
  .workbench-print-report .calculation-audit section {
    break-inside: auto;
  }
  .workbench-print-report .calculation-audit table {
    font-size: 7pt;
  }
  .workbench-print-report .report-evidence-item {
    margin: 6px 0;
    padding: 6px 8px;
  }
  .workbench-print-report .report-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v0.19.0 evidence and case-study workflow */
.utc-entry {
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.panel.export {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel.export > div,
.report-option,
.report-option select {
  min-width: 0;
  max-width: 100%;
}
.panel.export .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.report-phase-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stage-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.open-evidence-image {
  border: 0;
  background: none;
  padding: 0;
  cursor: zoom-in;
  width: 100%;
}
.open-loaded-image {
  cursor: zoom-in;
}
.drop-hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.evidence-item:has(.drop-hint) {
  border-style: solid;
}
#image-viewer-dialog {
  width: min(95vw, 1400px);
  max-width: 95vw;
}
.image-viewer-scroll {
  max-height: 70vh;
  overflow: auto;
}
#image-viewer-image {
  max-width: none;
  display: block;
}
#quick-intake-drop {
  border: 2px dashed #8d9bb0;
  padding: 1rem;
  margin-bottom: 1rem;
}
.intake-proposal {
  border-top: 1px solid #ccd4df;
  padding: 1rem 0;
}
.case-timeline {
  padding-left: 1.3rem;
}
.case-timeline li {
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}
.case-timeline p,
.report-debrief p {
  white-space: pre-wrap;
}
.legacy-prelaunch pre {
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .stage-tabs {
    grid-template-columns: 1fr;
  }
}
@media print {
  .legacy-prelaunch {
    break-before: page;
  }
  .case-timeline li {
    break-inside: avoid;
  }
}
