.agreements-workspace {
  --agreement-accent: #c63c16;
}
.agreements-workspace .agreement-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.agreements-workspace .agreement-page-heading h1 {
  font-size: 28px;
  line-height: 1.25;
}
.agreements-workspace .agreement-modes {
  display: flex;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid #8883;
  border-radius: 10px;
  margin: 0 0 24px;
}
.agreements-workspace .agreement-modes button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  padding: 10px 16px;
  cursor: pointer;
}
.agreements-workspace .agreement-modes button[aria-pressed='true'] {
  background: #8882;
}
.agreements-workspace .agreement-modes span {
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.65;
}
.agreements-workspace .agreement-progress {
  display: flex;
  gap: 8px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #8883;
}
.agreements-workspace .agreement-progress button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
}
.agreements-workspace .agreement-progress button[aria-current='step'] {
  background: #f4511e15;
  font-weight: 700;
}
.agreements-workspace .agreement-progress button span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #8885;
  border-radius: 50%;
  font-size: 12px;
}
.agreements-workspace .agreement-progress button[aria-current='step'] span {
  background: var(--agreement-accent);
  border-color: var(--agreement-accent);
  color: white;
}
.agreements-workspace button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.agreements-workspace button:focus-visible,
.agreements-workspace input:focus-visible,
.agreements-workspace select:focus-visible,
.agreements-workspace summary:focus-visible {
  outline: 2px solid var(--agreement-accent);
  outline-offset: 3px;
}
.agreements-workspace .agreement-help {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.75;
}
.agreements-workspace .agreement-service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.agreements-workspace .agreement-service-row > label {
  min-height: 48px;
  align-items: center;
  padding: 14px;
}
.agreements-workspace .agreement-service-row > label strong {
  font-size: 14px;
  line-height: 1.4;
}
.agreements-workspace .agreement-service-row > label span {
  font-size: 12px;
  line-height: 1.5;
}
.agreements-workspace .agreement-service-row > button {
  font-size: 12px;
  min-height: 44px;
  padding: 10px;
}
.agreements-workspace .agreement-service-row input[type='checkbox'] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--agreement-accent);
}
.agreements-workspace .agreement-service-row + .agreement-service-row {
  margin-top: 2px;
}
.agreements-workspace .agreement-optional {
  margin: 4px 0 20px;
  padding: 14px 0;
  border-top: 1px solid #8883;
  border-bottom: 1px solid #8883;
}
.agreements-workspace .agreement-optional summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.agreements-workspace .agreement-optional[open] summary {
  margin-bottom: 16px;
}
.agreements-workspace .agreement-reset {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #8883;
}
.agreements-workspace .agreement-reset button {
  border: 0;
  opacity: 0.65;
  font-size: 12px;
  padding: 4px 0;
  min-height: 32px;
}
.agreements-workspace .agreement-empty-review {
  min-height: 340px;
  align-content: center;
  gap: 12px;
  padding: 48px 28px;
}
.agreements-workspace .agreement-empty-review h3 {
  margin: 0;
  font-size: 17px;
}
.agreements-workspace .agreement-empty-review p {
  margin: 0;
  max-width: 310px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.7;
}
.agreements-workspace .agreement-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 12px;
  opacity: 0.85;
}
.agreements-workspace label {
  font-size: 13px;
  line-height: 1.5;
}
.agreements-workspace label input:not([type='checkbox']):not([type='radio']),
.agreements-workspace label select {
  font-size: 14px;
  min-height: 44px;
}
.agreements-workspace button {
  min-height: 40px;
}
.agreements-workspace details > summary {
  font-size: 14px;
  line-height: 1.5;
}
.agreements-workspace details p,
.agreements-workspace details li {
  font-size: 14px;
  line-height: 1.7;
}
.agreements-workspace dl {
  font-size: 13px;
  line-height: 1.5;
}
.agreements-workspace .agreement-review-panel {
  position: sticky;
  top: 24px;
}
@media (max-width: 900px) {
  .agreements-workspace .agreement-review-panel {
    position: static;
  }
}
@media (max-width: 540px) {
  .agreements-workspace .agreement-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .agreements-workspace .agreement-service-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .agreements-workspace .agreement-service-row > button {
    justify-self: start;
    margin: 2px 0 10px;
  }
  .agreements-workspace .agreement-progress {
    gap: 0;
  }
  .agreements-workspace .agreement-progress button {
    gap: 5px;
    font-size: 12px;
  }
}

.agreements-workspace .agreement-services {
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 901px) {
  .agreements-workspace .agreement-review-panel {
    max-height: calc(100dvh - 260px);
    min-height: 360px;
    overflow: auto;
  }
}
.agreements-workspace .agreement-review-panel {
  scroll-margin-top: 16px;
}
.agreements-workspace #agreement-composer {
  scroll-margin-top: 16px;
}

.agreements-workspace button {
  font-size: 14px;
  min-height: 44px;
}
.agreements-workspace button[style*='#f4511e']:not([aria-pressed]) {
  background: var(--agreement-accent);
  border-color: var(--agreement-accent);
  color: #fff;
}
.agreements-workspace .agreement-page-heading > div > div {
  color: var(--agreement-accent);
}

/* Saved records retain the theme surface; orange marks selection only. */
.agreements-workspace button[aria-pressed][style] {
  padding: 16px;
  align-items: flex-start;
  gap: 16px;
  color: inherit;
  background: transparent;
}
.agreements-workspace button[aria-pressed='true'][style] {
  border-color: var(--agreement-accent);
  background: color-mix(in srgb, currentColor 5%, transparent);
  box-shadow: inset 3px 0 0 var(--agreement-accent);
}
.agreements-workspace button[aria-pressed][style] > span:first-child {
  min-width: 0;
}
.agreements-workspace button[aria-pressed][style] strong {
  font-size: 15px;
  line-height: 1.4;
  color: inherit;
}
.agreements-workspace button[aria-pressed][style] small {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: inherit;
  overflow-wrap: anywhere;
}
.agreements-workspace button[aria-pressed][style] > span:first-child > span {
  margin-top: 10px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: inherit;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.agreements-workspace button[aria-pressed][style] > span:last-child {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.4;
}

.agreements-workspace .agreement-project-scope {
  display: grid;
  gap: 14px;
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid #8883;
}
.agreements-workspace .agreement-project-scope textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 240px;
  padding: 12px;
  border: 1px solid #8885;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
.agreements-workspace .agreement-project-scope textarea:focus-visible {
  outline: 2px solid var(--agreement-accent);
  outline-offset: 3px;
}
.agreements-workspace .agreement-scope-evidence {
  padding: 14px;
  border: 1px solid #8883;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.agreements-workspace .agreement-scope-evidence p {
  margin: 8px 0 0;
}
