:root {
  --ok: #0b6b46;
  --bad: #a1282e;
}

:where(button, a, input, textarea, select):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.upload .upload-help {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.sidebar :where(button, a):focus-visible {
  outline-color: #fff;
}

.history-item {
  width: 100%;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
}

.history-meta {
  display: block;
}

.status.ready_cleanup_pending {
  background: #fff1d6;
  color: var(--warn);
}

.document-group {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfe;
}

.document-group h3,
.document-group p {
  margin: 0 0 8px;
}

.cleanup-warning {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #eed18a;
  border-radius: 12px;
  background: #fff8df;
}

.question {
  display: block;
  width: 100%;
}

.question legend {
  padding: 0 4px;
  font-weight: 650;
}

.question-title {
  font-weight: 650;
}

.fixed-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid #ccd3e2;
  border-radius: 10px;
  background: #fff;
}

.fixed-choice span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8deeb;
  border-radius: 10px;
  background: #fff;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}

.choice:hover,
.choice:focus-within {
  border-color: #9ba9c7;
}

.choice:has(input:checked) {
  border-color: var(--blue);
  background: #eef3ff;
}

.choice input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  padding: 0;
}

.choice span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.choice input:checked + span {
  font-weight: 650;
}

.ktru-choice-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ktru-choice {
  overflow: hidden;
  border: 1px solid #d8deeb;
  border-radius: 12px;
  background: #fff;
}

.ktru-choice:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(43, 92, 230, 0.12);
}

.ktru-code-choice {
  border: 0;
  border-radius: 0;
  font-weight: 700;
}

.ktru-choice details {
  border-top: 1px solid #e1e6f0;
}

.ktru-choice summary {
  padding: 10px 14px;
  color: var(--blue);
  font-weight: 650;
  cursor: pointer;
}

.ktru-detail {
  padding: 4px 14px 14px;
  overflow-wrap: anywhere;
}

.ktru-characteristic {
  margin-top: 12px;
}

.ktru-characteristic ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

.ktru-characteristic li + li {
  margin-top: 4px;
}

.binary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.binary-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid #b8c4dc;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.35;
}

.binary-option:hover {
  border-color: var(--blue);
}

.binary-option[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(43, 92, 230, 0.18);
}

.binary-option-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.binary-option[aria-pressed="true"] .binary-option-state {
  color: #fff;
}

.binary-selection {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.volume-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #b8c4dc;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.volume-switch span,
.volume-switch strong,
.volume-switch small {
  display: block;
}

.volume-switch small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.volume-switch input[type="checkbox"] {
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.quantity-question.undefined-volume .quantity-input {
  background: #eef1f7;
  color: var(--muted);
}

.saved-answer,
.blocking-warning {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
}

.saved-answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #acd9c7;
  background: #edf9f4;
  color: #116444;
}

.saved-answer span {
  font-size: 12px;
}

.blocking-warning {
  border: 1px solid #eed18a;
  background: #fff8df;
  color: #754b00;
}

.blocking-warning p {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .binary-actions {
    grid-template-columns: 1fr;
  }
}

.customer-card {
  background: #f8faff;
  border-color: #cfd9f2;
}

.customer-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.customer-card-grid label {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.customer-card-field-wide {
  grid-column: 1 / -1;
}

.customer-card-grid :is(input, textarea) {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.source-document-evidence {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  overflow-wrap: anywhere;
  white-space: normal;
}

.customer-card-grid textarea {
  min-height: 44px;
  overflow: hidden;
  resize: none;
  line-height: 1.45;
  white-space: pre-wrap;
}

.customer-card-grid :is(input, textarea)[readonly] {
  border-color: transparent;
  background: #eef2fa;
  cursor: default;
}

.customer-card.editing .customer-card-grid :is(input, textarea) {
  border-color: #ccd3e2;
  background: #fff;
}

.customer-card.editing .customer-card-grid textarea {
  overflow: auto;
  resize: vertical;
}

.nav,
.primary,
.ghost,
.sidebar-foot a,
.document a,
.history-item {
  min-height: 44px;
}

.sidebar-foot a,
.document a {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 760px) {
  .sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .brand {
    flex: 1 1 100%;
  }

  .nav {
    flex: 1 1 130px;
  }

  .sidebar-foot {
    display: flex;
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .fixed-choice {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .customer-card-head {
    flex-direction: column;
  }

  .customer-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress i {
    animation: none;
    width: 72%;
  }
}
