
/* --- Prep sheet tabs ------------------------------------------------------ */

/* Agreement & conflict: independent semantic lanes. The previous equal-height
   grid stretched the shorter lane to match the longer one, creating large
   blank bands between its labels and evidence. */
.prep-sheet .ioa-grid {
  align-items: start;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.prep-sheet .iceberg-grid {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.prep-sheet .iceberg-side,
.prep-sheet .ioa-cell,
.prep-sheet .paths-packages,
.prep-sheet .paths-supporting-area {
  background: #fff;
  border: 0;
  border-top: 4px solid #2f7f69;
}

.prep-sheet .iceberg-side:nth-child(2),
.prep-sheet .ioa-cell.disagree,
.prep-sheet .paths-supporting-area {
  border-color: #eadbcf;
  border-top-color: #a9642f;
}

.prep-sheet .iceberg-side {
  gap: 0;
  padding: 0;
}

.prep-sheet .iceberg-side h4 {
  background: #f1f7f4;
  border-bottom: 1px solid #d7e6df;
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
  padding: 11px 13px 10px;
}

.prep-sheet .iceberg-side:nth-child(2) h4 {
  background: #fbf4ee;
  border-bottom-color: #eadbcf;
}

.prep-sheet .iceberg-layer {
  gap: 5px;
  padding: 12px 13px;
}

.prep-sheet .iceberg-layer + .iceberg-layer {
  border-top: 1px solid #dbe7e2;
}

.prep-sheet .iceberg-side:nth-child(2) .iceberg-layer + .iceberg-layer {
  border-top-color: #eadfd6;
}

.prep-sheet .ioa-cell {
  align-content: start;
  align-self: start;
  background: #fff;
  border-left: 0;
  border-top: 5px solid #2f7f69;
  gap: 0;
  padding: 0;
}

.prep-sheet .ioa-cell.disagree {
  border-top-color: #a9642f;
}

.prep-sheet .ioa-lane-head {
  background: #f1f7f4;
  border-bottom: 1px solid #d7e6df;
  display: grid;
  gap: 3px;
  padding: 11px 13px 10px;
}

.prep-sheet .ioa-cell.disagree .ioa-lane-head {
  background: #fbf4ee;
  border-bottom-color: #eadbcf;
}

.prep-sheet .ioa-lane-head h4 {
  font-size: 15px;
  line-height: 1.2;
}

.prep-sheet .ioa-lane-head p {
  color: #52646c;
  font-size: 11.5px;
  line-height: 1.35;
  margin: 0;
}

.prep-sheet .ioa-group {
  display: grid;
  gap: 8px;
  padding: 13px 13px 15px;
}

.prep-sheet .ioa-group + .ioa-group {
  border-top: 1px solid #dbe7e2;
}

.prep-sheet .ioa-cell.disagree .ioa-group + .ioa-group {
  border-top-color: #eadfd6;
}

.prep-sheet .ioa-subhead {
  color: #415963;
  font-size: 11px;
  letter-spacing: 0.045em;
}

.prep-sheet .ioa-group .board-list {
  display: grid;
  font-size: 13px;
  gap: 0;
  line-height: 1.45;
  margin: 0;
  padding-left: 18px;
}

.prep-sheet .ioa-group .board-list li {
  padding-bottom: 5px;
}

.prep-sheet .ioa-group .board-list li + li {
  border-top: 1px solid #edf2ef;
  padding-top: 5px;
}

.prep-sheet .ioa-group .board-list li:last-child {
  padding-bottom: 0;
}

.prep-sheet .ioa-cell.agree .board-list li::marker {
  color: #2f7f69;
}

.prep-sheet .ioa-cell.disagree .board-list li::marker {
  color: #a9642f;
}

.prep-tabs {
  align-items: stretch;
  border-bottom: 1px solid #c8dfe6;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  padding: 2px 0 10px;
}

.prep-tab {
  align-items: center;
  background: #f4f8f8;
  border: 1px solid #cbdde1;
  border-radius: 8px;
  color: #46606b;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  min-height: 54px;
  padding: 8px 9px;
  text-align: left;
}

.prep-tab:hover {
  background: #eaf3f4;
  border-color: #7fa9b4;
}

.prep-tab-number {
  align-items: center;
  background: #dcebef;
  border-radius: 999px;
  color: #07536a;
  display: inline-flex;
  flex: 0 0 30px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  height: 30px;
  justify-content: center;
}

.prep-tab-copy,
.prep-tab-notes {
  display: flex;
  flex-direction: column;
}

.prep-tab-copy {
  gap: 2px;
  min-width: 0;
}

.prep-tab-copy strong {
  line-height: 1.12;
}

.prep-tab small {
  color: #6d7f87;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.15;
  text-transform: uppercase;
}

.prep-tab-notes {
  border-style: dashed;
  justify-content: center;
  min-width: 70px;
}

.prep-tab.active {
  background: #e6f4f6;
  border-color: var(--accent);
  box-shadow: inset 0 -4px 0 var(--accent);
  color: #003b4e;
}

.prep-tab.active .prep-tab-number {
  background: var(--accent);
  color: #fff;
}

.prep-tab.active small {
  color: #006f91;
}

.prep-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prep-module-header {
  align-items: baseline;
  border-bottom: 1px solid #d6e8ee;
  display: flex;
  gap: 10px;
  padding: 4px 0 9px;
}

.prep-module-index {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.prep-module-header h3 {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.05;
  margin: 0;
}

.prep-supporting-head {
  align-items: center;
  color: #385866;
  display: flex;
  font-size: 10.5px;
  font-weight: 800;
  gap: 7px;
  letter-spacing: 0.02em;
}

.prep-field-grid,
.prep-supporting-grid {
  display: grid;
  gap: 10px;
}

.iceberg-bullets {
  display: grid;
  gap: 5px;
  margin: 6px 0 0;
  padding-left: 18px;
}

.iceberg-bullets li {
  line-height: 1.42;
  padding-left: 2px;
}

.prep-evidence-scope {
  align-items: center;
  border-bottom: 1px dashed #b9d5df;
  color: #385866;
  display: flex;
  font-size: 10.5px;
  font-weight: 800;
  justify-content: space-between;
  padding: 5px 0 7px;
}

.prep-evidence-scope[hidden] {
  display: none;
}

.prep-evidence-scope button {
  background: transparent;
  border: 0;
  color: #00688b;
  cursor: pointer;
  font: inherit;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prep-evidence-cell {
  border-radius: 0;
  cursor: pointer;
  outline: 0;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.prep-evidence-cell:hover,
.prep-evidence-cell:focus-visible,
.prep-evidence-cell:focus-within {
  background: #f4f9f7;
}

.prep-evidence-cell.evidence-cell-active {
  background: #edf6f2;
  box-shadow: inset 3px 0 0 #2f7f69;
}

.prep-evidence-cell.conversation-focus-cell {
  animation: prep-conversation-focus-glow 1.7s ease-in-out infinite alternate;
  background: #fff8e8;
  box-shadow: inset 4px 0 0 #c77b18, 0 0 0 1px rgba(199, 123, 24, 0.45), 0 0 12px rgba(218, 139, 34, 0.28);
  position: relative;
  z-index: 1;
}

.prep-evidence-cell.conversation-focus-cell::after {
  border: 3px solid rgba(199, 123, 24, 0.76);
  box-shadow: inset 0 0 12px rgba(218, 139, 34, 0.2);
  content: "";
  inset: 2px;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.prep-evidence-cell.conversation-pending-cell {
  box-shadow: inset 4px 0 0 #007ea8, 0 0 0 1px rgba(0, 126, 168, 0.35);
}

.prep-evidence-cell.conversation-updated-cell {
  animation: prep-conversation-update-pop 320ms ease-out both;
  background: #eaf5ef;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

/* A missing point can sit in the same cell as an update. Keep its amber cue. */
.prep-evidence-cell.conversation-focus-cell.conversation-pending-cell {
  background: #fff8e8;
}

.prep-evidence-cell.conversation-focus-cell.conversation-updated-cell {
  background: #fff8e8;
}

.prep-conversation-loading,
.prep-conversation-review {
  background: #f0f8fb;
  border: 1px solid #8fc4d6;
  border-left: 5px solid #007ea8;
  color: #123d4a;
  flex: 0 0 auto;
}

.prep-conversation-loading {
  align-items: center;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: auto 1fr;
  overflow: hidden;
  padding: 11px 12px 14px;
  position: relative;
}

.prep-conversation-loading strong,
.prep-conversation-review strong {
  color: #003b4e;
  display: block;
  font-size: 13px;
}

.prep-conversation-loading p,
.prep-conversation-review header p {
  color: #52646c;
  font-size: 11px;
  line-height: 1.35;
  margin: 2px 0 0;
}

.prep-conversation-spinner {
  animation: prep-conversation-spin 720ms linear infinite;
  border: 3px solid #bddde7;
  border-radius: 50%;
  border-top-color: #007ea8;
  height: 18px;
  width: 18px;
}

.prep-conversation-loading-track {
  animation: prep-conversation-track 1.3s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, #00a4d6, transparent);
  bottom: 0;
  height: 3px;
  left: -35%;
  position: absolute;
  width: 35%;
}

.prep-conversation-review {
  padding: 11px 12px;
}

.prep-conversation-review > header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.prep-conversation-review > header span {
  color: #007093;
  display: block;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.prep-conversation-review-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.prep-conversation-review-actions button {
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
  padding: 6px 9px;
}

.prep-conversation-review-actions button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.prep-conversation-apply {
  background: #00688b;
  border: 1px solid #00688b;
  color: #fff;
}

.prep-conversation-keep {
  background: #fff;
  border: 1px solid #7fa9b7;
  color: #005a78;
}

.prep-cell-diff {
  background: #f4fbfd;
  border: 1px solid #9fcbd9;
  margin-top: 9px;
  padding: 7px 9px;
}

.prep-cell-diff-label {
  color: #007093;
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.prep-cell-proposal {
  color: #27353a;
  font-size: 11.5px;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
}

.prep-conversation-result {
  background: #edf6f2;
  border-left: 3px solid #2f7f69;
  color: #1d4f41;
  font-size: 11px;
  margin: 0;
  padding: 6px 9px;
}

@keyframes prep-conversation-spin {
  to { transform: rotate(360deg); }
}

@keyframes prep-conversation-track {
  0% { left: -35%; }
  100% { left: 100%; }
}

@keyframes prep-conversation-focus-glow {
  to {
    box-shadow: inset 4px 0 0 #c77b18, 0 0 0 2px rgba(199, 123, 24, 0.56), 0 0 20px rgba(218, 139, 34, 0.48);
  }
}

@keyframes prep-conversation-update-pop {
  from {
    background: #d8ede2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prep-conversation-spinner,
  .prep-conversation-loading-track,
  .prep-evidence-cell.conversation-focus-cell,
  .prep-evidence-cell.conversation-updated-cell {
    animation: none;
  }
}

.prep-conversation-status {
  color: #52646c;
  font-size: 11.5px;
  line-height: 1.4;
  margin: 0 0 4px;
}

@media (max-width: 760px) {
  .prep-conversation-review > header {
    display: grid;
  }

  .prep-conversation-review-actions {
    flex-wrap: wrap;
  }

}

.prep-field-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prep-module-redline .prep-field-grid-3 {
  grid-template-columns: minmax(0, 1fr);
}

.prep-supporting-area {
  border-top: 1px solid #d6e8ee;
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.prep-supporting-head strong,
.prep-supporting-head span {
  color: inherit;
  font: inherit;
}

.prep-supporting-head strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.prep-supporting-head strong::after {
  color: var(--accent);
  content: "→";
  margin-left: 7px;
}

.prep-supporting-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prep-module-redline .prep-field[data-field-id="packages"] {
  border-top-color: var(--accent);
}

.prep-field {
  border-top: 3px solid #b9d5df;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

.prep-field.prep-evidence-cell.evidence-cell-active {
  border-top-color: #2f7f69;
  box-shadow: none;
}

.prep-field-evidence {
  background: transparent;
  border: 0;
  padding: 7px 10px 0;
}

.prep-field-evidence-list {
  display: grid;
  margin: 0;
  max-height: min(22vh, 132px);
  overflow-y: auto;
}

.prep-field-evidence-item {
  display: grid;
  gap: 1px;
  padding: 4px 0;
}

.prep-field-evidence-item:last-child {
  padding-bottom: 0;
}

.prep-field-evidence-text {
  background: transparent;
  border: 0;
  color: #244652;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  width: 100%;
}

.prep-field-evidence-divider {
  align-items: center;
  color: #667085;
  display: flex;
  font-size: 9px;
  font-weight: 800;
  gap: 8px;
  letter-spacing: 0.08em;
  padding: 6px 0 5px;
  text-transform: uppercase;
}

.prep-field-evidence-divider::before,
.prep-field-evidence-divider::after {
  background: #c8e0e6;
  content: "";
  height: 1px;
}

.prep-field-evidence-divider::before {
  flex: 0 0 14px;
}

.prep-field-evidence-divider::after {
  flex: 1 1 auto;
}

.prep-field-editor {
  background: #fff;
  border: 1px solid #b9d5df;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.prep-field-editor:focus-within {
  border-color: var(--accent);
}

.prep-field-editor .prep-commit-input {
  border: 0;
  box-shadow: none;
  width: 100%;
}

.prep-field-editor .prep-field-evidence + .prep-commit-input {
  border-top: 0;
}

.prep-field-evidence-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-bottom: 2px;
}

.prep-field-evidence cite {
  color: #667085;
  font-size: 9.5px;
  font-style: normal;
}

.prep-field-evidence-remove {
  background: transparent;
  border: 0;
  color: #8a3b31;
  cursor: pointer;
  font: 700 9.5px/1.2 inherit;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prep-field-evidence-remove:hover,
.prep-field-evidence-remove:focus-visible {
  color: #5f211a;
}

.prep-reference-evidence {
  border-top: 1px solid #c8e0e6;
  color: #385866;
  font-size: 11px;
  margin-top: 8px;
  padding-top: 6px;
}

.prep-package-evidence-check {
  background: #edf6f2;
  border-left: 3px solid #2f7f69;
  color: #385866;
  font-size: 10.5px;
  margin: 5px 0 10px;
  padding: 6px 8px;
}

.prep-field.prep-field-ready .prep-field-editor {
  border-color: #78a68f;
  box-shadow: inset 3px 0 0 #2f7f69;
}

.prep-field:nth-child(2) {
  border-top-color: #d7b078;
}

.prep-field:nth-child(3) {
  border-top-color: #78a68f;
}

.prep-field-label {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
}

.prep-field-prompt {
  color: #667085;
  font-size: 10.5px;
  line-height: 1.35;
  min-height: 29px;
}

.prep-field-input {
  flex: 1 1 auto;
  min-height: 96px;
}

.prep-revise {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.prep-revise-row {
  display: flex;
  gap: 6px;
}

.prep-revise-input {
  border: 1px solid #b9d5df;
  flex: 1 1 auto;
  font: inherit;
  font-size: 12.5px;
  padding: 6px 8px;
}

.prep-revise-button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
}

.prep-revise-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.prep-revise-count {
  color: #667085;
  font-size: 11.5px;
  margin: 0;
}

.prep-reference-own {
  background: #fbfaf5;
  border-left: 3px solid #6b5d2e;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding: 8px 10px;
  white-space: pre-wrap;
}

.paths-visual {
  display: grid;
  gap: 0;
}

.paths-actor-strip {
  align-items: start;
  border-block: 1px solid #b9d5df;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(145px, 0.65fr) minmax(0, 2fr);
  padding: 12px 0;
}

.paths-actor-strip-label {
  color: #52646c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 2px 0 0;
  text-transform: uppercase;
}

.paths-actor-strip-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.paths-actor {
  border-left: 3px solid #2f7f69;
  display: grid;
  gap: 2px;
  padding-left: 8px;
}

.paths-actor strong {
  color: #003b4e;
  font-size: 12px;
}

.paths-actor span {
  color: #52646c;
  font-size: 10.5px;
  line-height: 1.35;
}

.paths-stage {
  border-top: 1px solid #d6e8ee;
  display: grid;
  gap: 9px;
  padding: 13px 0;
}

.prep-sheet .paths-packages {
  border-top: 4px solid #2f7f69;
  gap: 0;
  padding: 0 13px 13px;
}

.prep-sheet .paths-packages > h4 {
  background: #f1f7f4;
  border-bottom: 1px solid #d7e6df;
  color: #003b4e;
  font-size: 15px;
  letter-spacing: 0;
  margin: 0 -13px 10px;
  padding: 11px 13px 10px;
  text-transform: none;
}

.paths-stage:first-child {
  border-top: 0;
  padding-top: 0;
}

.paths-stage > h4 {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.paths-supporting-area {
  display: grid;
  gap: 0;
  padding: 0;
}

.paths-supporting-head {
  background: #fbf4ee;
  border-bottom: 0;
  cursor: pointer;
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 11px 13px 10px;
}

.paths-supporting-head::-webkit-details-marker {
  display: none;
}

.paths-supporting-head::after {
  color: #a9642f;
  content: "+";
  font-size: 18px;
  font-weight: 900;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  line-height: 1;
}

.paths-supporting-area[open] .paths-supporting-head {
  border-bottom: 1px solid #eadbcf;
}

.paths-supporting-area[open] .paths-supporting-head::after {
  content: "−";
}

.paths-supporting-head h4 {
  color: #003b4e;
  font-size: 15px;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
}

.paths-supporting-head p {
  color: #667085;
  font-size: 10.5px;
  margin: 0;
}

.paths-supporting-area .paths-stage:first-of-type {
  border-top: 0;
}

.paths-supporting-area > .paths-stage {
  margin-inline: 0;
  padding-inline: 13px;
}

.paths-boundary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.paths-side {
  display: grid;
  gap: 5px;
  padding-left: 10px;
}

.paths-side h5,
.paths-route h5 {
  color: #003b4e;
  font-size: 13px;
  margin: 0;
}

.paths-subhead {
  color: #667085;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paths-side .board-list {
  margin: 0 0 4px;
}

.paths-route {
  border-left: 3px solid #789a88;
  display: grid;
  gap: 5px;
  padding-left: 10px;
}

.paths-route p {
  color: #52646c;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
}

.paths-route-line {
  color: #00688b !important;
  font-weight: 800;
}

.paths-watchouts {
  border-top: 1px dashed #d6e8ee;
  padding-top: 8px;
}

.paths-watchouts summary {
  color: #7a4b27;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 800;
}

/* One flat surface grammar across modules: a single accent rule separates
   sections; the section contents do not sit inside another outlined box. */
.prep-sheet .iceberg-side,
.prep-sheet .ioa-cell,
.prep-sheet .paths-packages,
.prep-sheet .paths-supporting-area {
  border: 0;
  border-top: 4px solid #2f7f69;
}

.prep-sheet .iceberg-side:nth-child(2),
.prep-sheet .ioa-cell.disagree,
.prep-sheet .paths-supporting-area {
  border-top-color: #a9642f;
}

/* Match body typography across the three analysis modules. Without this,
   Iceberg used 12.5px, Agreement used 13px, and package lists inherited 16px. */
.prep-sheet .iceberg-layer p,
.prep-sheet .iceberg-layer .iceberg-bullets,
.prep-sheet .board-visual .board-list,
.prep-sheet .paths-route p {
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .paths-actor-strip {
    grid-template-columns: 1fr;
  }

  .paths-actor-strip-list {
    grid-template-columns: 1fr;
  }

  .prep-field-grid-2,
  .prep-supporting-grid,
  .paths-boundary-grid {
    grid-template-columns: 1fr;
  }
}
