.metric-grid,
.detail-grid,
.form-grid,
.score-grid,
.filter-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-block: 20px 24px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-container);
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 20px;
  position: relative;
}

.metric::before {
  background: var(--primary);
  border-radius: 2px;
  content: "";
  height: 4px;
  left: 20px;
  position: absolute;
  top: 0;
  width: 36px;
}

.metric:nth-child(3n + 2)::before {
  background: var(--aws-orange);
}

.metric:nth-child(3n)::before {
  background: var(--success);
}

.metric strong,
.score-grid strong {
  color: var(--text);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 36px;
}

.metric span,
.score-grid span,
.muted {
  color: var(--muted);
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 0;
}

.metric-grid.compact .metric {
  background: var(--surface-subtle);
  box-shadow: none;
  min-height: 100px;
}

.detail-grid {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.filter-grid {
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  margin-bottom: 24px;
}

.filter-grid.card {
  background: var(--surface);
  padding: 20px;
}

.filter-grid > div,
.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.section-card {
  margin-block: 20px;
}

.section-card > h2:first-child {
  border-bottom: 1px solid var(--border-light);
  margin: -4px -4px 20px;
  padding: 0 4px 16px;
}

.wide-form {
  max-width: 1100px;
}

.wide-form > h2 {
  border-bottom: 1px solid var(--border-light);
  margin: 28px 0 20px;
  padding-bottom: 12px;
}

.wide-form > h2:first-of-type {
  margin-top: 0;
}

.nested-card,
.draft,
.evidence {
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-block: 16px;
  padding: 20px;
}

.nested-card legend {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text);
  font-weight: 700;
  padding: 4px 12px;
}

.draft h3 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence {
  border-left: 4px solid var(--primary);
}

.action-bar,
.action-bar form,
.inline-form,
.inline-filter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-bar {
  background: rgb(255 255 255 / 96%);
  border-color: var(--border);
  box-shadow: 0 4px 16px rgb(0 7 22 / 12%);
  margin-bottom: 22px;
  padding: 14px 16px;
  position: sticky;
  top: 10px;
  z-index: 10;
}

.action-bar form {
  margin: 0;
}

.action-bar select {
  min-width: 170px;
}

.inline-filter {
  margin-bottom: 20px;
  padding: 18px 20px;
}

.inline-filter label {
  flex: 1 1 190px;
  margin: 0;
}

.inline-filter .button {
  align-self: flex-end;
}

.table-wrap {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow-x: auto;
}

.table-wrap.card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-container);
  padding: 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 16px;
  white-space: nowrap;
}

th:first-child {
  border-top-left-radius: 11px;
}

th:last-child {
  border-top-right-radius: 11px;
}

tbody tr {
  background: var(--surface);
}

tbody tr:hover {
  background: var(--surface-hover);
}

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

td {
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

td > small {
  color: var(--muted);
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.4fr);
  margin: 0 0 24px;
}

.summary-list dt,
.summary-list dd {
  border-bottom: 1px solid var(--border-light);
  padding-block: 9px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding-right: 16px;
}

.summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.untrusted-content,
pre {
  background: #f7f8f9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: 13px;
  line-height: 20px;
  max-height: 480px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.score-hero {
  align-items: center;
  background: linear-gradient(110deg, var(--aws-navy-900), var(--aws-navy-800));
  border-radius: 12px;
  color: #ffffff;
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 24px;
}

.score-hero > strong {
  color: #ffffff;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  line-height: 48px;
}

.score-hero span,
.score-hero small {
  color: #d1d5db;
}

.score-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-block: 20px;
}

.score-grid > div {
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 16px;
}

.score-grid strong {
  font-size: 24px;
  line-height: 30px;
}

.warning {
  background: var(--warning-soft);
  border: 1px solid #c7a13b;
  border-left: 4px solid #c7a13b;
  border-radius: var(--radius-control);
  color: #5f4700;
  display: block;
  padding: 12px 14px;
}

.badge.success {
  background: var(--success-soft);
  color: var(--success-dark);
}

.clean-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin-bottom: 0;
  padding: 0;
}

.clean-list li {
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  padding: 10px 12px;
}

.main-content details {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  margin-block: 12px;
}

.main-content details > summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  padding: 12px 16px;
}

.main-content details[open] > summary {
  border-bottom: 1px solid var(--border-light);
}

.main-content details > :not(summary) {
  margin-inline: 16px;
}

.main-content details > pre {
  margin-block: 16px;
}

fieldset {
  min-width: 0;
}

@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .action-bar {
    position: static;
  }

  .action-bar,
  .action-bar form,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .action-bar .button,
  .action-bar select {
    width: 100%;
  }

  .summary-list {
    grid-template-columns: 1fr;
  }

  .summary-list dt {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .summary-list dd {
    padding-top: 3px;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 96px;
  }

  .filter-grid.card,
  .inline-filter {
    padding: 16px;
  }

  .score-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* RFQ create workflow */
.rfq-create-heading {
  align-items: center;
}

.rfq-create-heading .lead {
  margin-bottom: 0;
}

.rfq-create-form {
  margin-inline: auto;
  max-width: 1240px;
}

.rfq-error-summary {
  display: grid;
  gap: 4px;
}

.rfq-error-summary > span {
  color: var(--danger-dark);
}

.rfq-error-summary .errorlist {
  margin-bottom: 0;
}

.rfq-form-steps {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-container);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 20px;
  overflow: hidden;
  position: sticky;
  top: 8px;
  z-index: 12;
}

.rfq-form-steps a {
  align-items: center;
  border-right: 1px solid var(--border-light);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 9px;
  justify-content: center;
  min-height: 48px;
  padding: 8px 12px;
  text-align: center;
}

.rfq-form-steps a:last-child {
  border-right: 0;
}

.rfq-form-steps a:hover {
  background: var(--surface-hover);
  color: var(--primary-dark);
  text-decoration: none;
}

.rfq-form-steps a span,
.section-number,
.rfq-checklist li span {
  align-items: center;
  background: var(--primary-soft);
  border: 1px solid #75b6e7;
  border-radius: 50%;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.rfq-form-shell {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.rfq-form-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.rfq-form-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-container);
  padding: 24px;
  scroll-margin-top: 76px;
}

.rfq-section-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.rfq-section-heading > div {
  min-width: 0;
}

.rfq-section-heading h2 {
  margin: 0 0 4px;
}

.rfq-section-heading p {
  color: var(--muted);
  margin: 0;
}

.rfq-section-heading .section-management-link {
  margin-left: auto;
  white-space: nowrap;
}

.section-number {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  height: 30px;
  width: 30px;
}

.rfq-create-form .form-grid {
  gap: 18px 20px;
}

.rfq-create-form .field {
  align-self: start;
}

.rfq-create-form .field-label-row {
  align-items: baseline;
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.rfq-create-form .field-label-row label {
  margin: 0;
}

.required-indicator {
  color: var(--danger);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.rfq-create-form input[type="text"],
.rfq-create-form input[type="number"],
.rfq-create-form input[type="date"],
.rfq-create-form input[type="datetime-local"],
.rfq-create-form input[type="file"],
.rfq-create-form select {
  min-height: 40px;
}

.rfq-create-form textarea {
  min-height: 96px;
}

.rfq-create-form #id_raw_request_text {
  min-height: 180px;
}

.customer-mode-fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.customer-mode-picker {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-mode-card {
  align-items: flex-start;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin: 0;
  min-height: 86px;
  padding: 16px;
  transition:
    background-color 120ms ease,
    border-color 120ms ease;
}

.customer-mode-card:hover {
  border-color: var(--primary);
}

.customer-mode-card:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.customer-mode-card input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.customer-mode-card span {
  display: grid;
  gap: 4px;
}

.customer-mode-card strong {
  color: var(--text);
}

.customer-mode-card small {
  color: var(--muted);
  font-weight: 400;
}

.customer-panel,
.attachment-panel {
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}

.new-customer-panel {
  border-left: 4px solid var(--primary);
}

.panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-heading h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.panel-heading p {
  margin: 0;
}

.inline-notice {
  align-items: flex-start;
  background: var(--info-soft);
  border: 1px solid #75b6e7;
  border-radius: var(--radius-control);
  color: var(--text);
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 13px;
}

.products-heading {
  align-items: center;
}

.rfq-items {
  display: grid;
  gap: 18px;
}

.rfq-item-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  scroll-margin-top: 76px;
}

.rfq-item-header {
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.rfq-item-header h3 {
  margin: 3px 0 0;
}

.rfq-item-remove {
  flex: 0 0 auto;
}

.item-delete-fallback {
  align-items: center;
  display: flex;
  gap: 4px;
}

.item-delete-fallback label {
  margin: 0;
}

.item-remove-button {
  display: none;
}

.js .item-delete-fallback {
  display: none;
}

.js .item-remove-button {
  display: inline-flex;
}

.item-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.product-core-grid {
  margin-bottom: 16px;
}

.main-content .rfq-advanced {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  margin: 0;
}

.main-content .rfq-advanced > summary {
  align-items: center;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
}

.main-content .rfq-advanced > summary small {
  color: var(--muted);
  font-weight: 400;
}

.main-content .rfq-advanced[open] > summary {
  border-bottom: 1px solid var(--border-light);
}

.main-content .rfq-advanced > :not(summary) {
  margin-inline: 0;
}

.rfq-advanced-grid {
  padding: 18px;
}

.add-item-button {
  border-style: dashed;
  margin-top: 16px;
  width: 100%;
}

.is-auto-filled {
  background: var(--success-soft) !important;
  border-color: #29ad32 !important;
}

.attachment-panel {
  margin-top: 20px;
}

.optional-label {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  padding: 2px 8px;
  vertical-align: 2px;
}

.security-note {
  align-items: flex-start;
  color: var(--success-dark);
  display: flex;
  font-size: 12px;
  gap: 7px;
  margin: 14px 0 0;
}

.security-note span {
  background: var(--success-soft);
  border-radius: 50%;
  flex: 0 0 auto;
  font-weight: 800;
  height: 18px;
  text-align: center;
  width: 18px;
}

.rfq-form-aside {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 76px;
}

.rfq-checklist-card,
.rfq-tip-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-container);
  padding: 20px;
}

.rfq-checklist-card {
  border-top: 4px solid var(--aws-orange);
  padding-top: 17px;
}

.rfq-checklist-card h2 {
  font-size: 18px;
  margin: 5px 0 16px;
}

.rfq-checklist {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.rfq-checklist li {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 9px;
}

.rfq-checklist li span {
  height: 22px;
  width: 22px;
}

.rfq-tip-card {
  background: var(--aws-orange-soft);
  border-color: #dba521;
}

.rfq-tip-card strong {
  color: #5f4700;
}

.rfq-tip-card p {
  color: #5f4700;
  font-size: 12px;
  margin: 6px 0 0;
}

.rfq-form-actions {
  align-items: center;
  background: rgb(255 255 255 / 97%);
  border: 1px solid var(--border);
  border-radius: 12px;
  bottom: 10px;
  box-shadow: 0 8px 24px rgb(0 7 22 / 18%);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px 18px;
  position: sticky;
  z-index: 11;
}

.rfq-form-actions > div:first-child {
  display: grid;
  gap: 2px;
}

.rfq-form-actions > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .rfq-form-shell {
    grid-template-columns: 1fr;
  }

  .rfq-form-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (max-width: 760px) {
  .rfq-form-steps {
    display: flex;
    margin-inline: -16px;
    overflow-x: auto;
    position: static;
  }

  .rfq-form-steps a {
    flex: 0 0 auto;
    justify-content: flex-start;
    min-width: 128px;
  }

  .rfq-form-section {
    padding: 18px;
    scroll-margin-top: 12px;
  }

  .rfq-section-heading,
  .products-heading {
    align-items: flex-start;
  }

  .rfq-section-heading .section-management-link {
    margin-left: 0;
    width: 100%;
  }

  .customer-mode-picker,
  .rfq-form-aside {
    grid-template-columns: 1fr;
  }

  .customer-panel,
  .attachment-panel,
  .rfq-item-card {
    padding: 16px;
  }

  .panel-heading,
  .rfq-item-header,
  .main-content .rfq-advanced > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-content .rfq-advanced > summary {
    gap: 4px;
  }

  .rfq-form-actions {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .rfq-form-actions .actions {
    align-items: stretch;
    flex-direction: column-reverse;
    width: 100%;
  }

  .rfq-form-actions .button {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .rfq-create-heading .button {
    justify-content: center;
  }

  .rfq-section-heading {
    flex-wrap: wrap;
  }

  .section-number {
    height: 28px;
    width: 28px;
  }

  .rfq-create-form input[type="file"] {
    max-width: 100%;
  }
}
/* Superuser-only AI provider configuration. */
.ai-settings-heading {
  align-items: center;
}

.ai-settings-heading p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 720px;
}

.ai-runtime-card {
  align-items: center;
  background: linear-gradient(112deg, var(--aws-navy-900), var(--aws-navy-800));
  border: 1px solid #354150;
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-container);
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 20px;
  padding: 22px 24px;
}

.ai-runtime-icon {
  align-items: center;
  background: var(--aws-orange);
  border-radius: 10px;
  color: #161d26;
  display: flex;
  font-size: 18px;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  letter-spacing: -0.03em;
  width: 48px;
}

.ai-runtime-summary h2 {
  color: #ffffff;
  font-size: 20px;
  line-height: 26px;
  margin: 2px 0 4px;
}

.ai-runtime-summary p,
.ai-runtime-facts small,
.ai-runtime-card .eyebrow {
  color: #d1d5db;
}

.ai-runtime-summary p {
  margin: 0;
}

.ai-runtime-facts {
  align-items: flex-end;
  display: grid;
  gap: 7px;
  justify-items: end;
  text-align: right;
}

.ai-runtime-card .badge:not(.success) {
  background: #fff7d6;
  color: #5f4700;
}

.ai-settings-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.ai-settings-main,
.ai-settings-aside {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.ai-settings-aside {
  position: sticky;
  top: 12px;
}

.ai-settings-section {
  margin: 0;
  padding: 22px;
}

.ai-section-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.ai-section-number {
  align-items: center;
  background: var(--primary-soft);
  border: 1px solid #89bdee;
  border-radius: 50%;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.ai-section-heading h2 {
  font-size: 18px;
  line-height: 24px;
  margin: 1px 0 3px;
}

.ai-section-heading p,
.ai-settings-section .field > small,
.credential-status small,
.ai-settings-actions small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 17px;
  margin: 0;
}

.ai-settings-section .field {
  margin-bottom: 16px;
}

.ai-settings-section .field:last-child {
  margin-bottom: 0;
}

.credential-status {
  align-items: center;
  background: var(--success-soft);
  border: 1px solid #79b895;
  border-radius: var(--radius-control);
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.credential-lock {
  border: 2px solid var(--success-dark);
  border-radius: 3px;
  height: 16px;
  position: relative;
  width: 18px;
}

.credential-lock::before {
  border: 2px solid var(--success-dark);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  content: "";
  height: 8px;
  left: 3px;
  position: absolute;
  top: -9px;
  width: 8px;
}

.credential-status > div {
  display: grid;
  gap: 2px;
}

.check-row {
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  cursor: pointer;
  display: flex;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 12px;
}

.check-row input {
  flex: 0 0 auto;
  margin: 0;
}

.ai-inline-help {
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 0;
}


.ai-settings-actions {
  bottom: auto;
  margin-top: 0;
  position: static;
}

.ai-settings-actions > div:first-child {
  display: grid;
  gap: 2px;
}

.ai-security-card h2 {
  font-size: 18px;
  line-height: 24px;
  margin: 4px 0 16px;
}

.ai-security-list li {
  display: grid;
  gap: 2px;
}

.ai-security-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.ai-cost-note {
  border-left: 4px solid var(--aws-orange);
  margin: 0;
}

.ai-cost-note p {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.ai-settings-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  margin: 0 4px;
}

.form-error-summary {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-control);
  padding: 12px 14px;
}

.form-error-summary .errorlist {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .ai-settings-layout {
    grid-template-columns: 1fr;
  }

  .ai-settings-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .ai-settings-meta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .ai-runtime-card {
    align-items: flex-start;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .ai-runtime-facts {
    align-items: flex-start;
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }

  .ai-settings-aside {
    grid-template-columns: 1fr;
  }

  .ai-settings-meta {
    grid-column: auto;
  }

  .ai-settings-section {
    padding: 18px;
  }


  .ai-settings-actions {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .ai-settings-actions .button,
  .ai-settings-heading .button {
    width: 100%;
  }
}


/* RFQ settings and versioned AI prompts. */
.settings-subnav {
  border-bottom: 1px solid var(--border);
  display: flex;
  margin: -4px 0 20px;
}

.settings-subnav span,
.settings-subnav a {
  border-bottom: 3px solid transparent;
  color: var(--muted);
  padding: 10px 16px 8px;
}

.settings-subnav .is-active {
  border-bottom-color: var(--aws-orange);
  color: var(--text);
  font-weight: 700;
}

.prompt-settings-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.prompt-settings-main,
.prompt-settings-aside {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.prompt-settings-aside {
  position: sticky;
  top: 12px;
}

.prompt-settings-card {
  padding: 22px;
}

.prompt-card-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.prompt-card-heading h2 {
  font-size: 20px;
  margin: 2px 0 4px;
}

.prompt-card-heading p {
  color: var(--muted);
  margin: 0;
  max-width: 760px;
}

.prompt-card-heading .badge {
  flex: 0 0 auto;
}

.prompt-runtime-meta {
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-control);
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.prompt-runtime-meta span,
.prompt-field small,
.prompt-history-entry small,
.prompt-settings-actions small,
.prompt-guidance-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.prompt-field textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  min-height: 220px;
}

.prompt-field small {
  display: block;
  margin-top: 6px;
}

.prompt-history {
  margin-bottom: 0;
}

.prompt-history-entry {
  border-bottom: 1px solid var(--border-light);
  margin: 0 16px;
  padding: 16px 0;
}

.prompt-history-entry:last-child {
  border-bottom: 0;
}

.prompt-history-entry > div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.prompt-history-entry pre {
  margin: 10px 0 0;
  max-height: 260px;
}

.prompt-guidance-list li {
  display: grid;
  gap: 3px;
}

.prompt-warning {
  margin: 0;
}

.prompt-warning p {
  margin: 6px 0 0;
}

.prompt-settings-actions {
  margin-top: 0;
  position: static;
}

@media (max-width: 980px) {
  .prompt-settings-layout {
    grid-template-columns: 1fr;
  }

  .prompt-settings-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (max-width: 700px) {
  .prompt-settings-aside {
    grid-template-columns: 1fr;
  }

  .prompt-settings-card {
    padding: 18px;
  }

  .prompt-card-heading,
  .prompt-history-entry > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .prompt-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-settings-actions .button {
    width: 100%;
  }
}
