:root {
  color-scheme: light;
}

body {
  font-family: Arial, sans-serif;
  background: #f4f6fa;
  margin: 0;
}

.app-header {
  background: #0b2f6b;
  color: #fff;
  padding: 1.5rem;
}

.app-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.8rem;
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

.panel {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(11, 47, 107, 0.08);
  margin-bottom: 2rem;
}

.panel.info {
  border-left: 4px solid #0b6ef5;
}

.notice-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: calc(100% - 2rem);
  max-width: 960px;
  z-index: 1200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-left-color: #f59e0b;
  box-shadow: 0 12px 32px rgba(11, 47, 107, 0.18);
  background: #a8e9c0;
}

.notice-banner .notice-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.95rem;
  color: #0b2f6b;
}

.notice-banner .notice-title {
  font-size: 1rem;
  font-weight: 700;
  color: #a05a00;
}

.notice-banner .notice-dismiss {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  border: none;
  background: rgba(11, 47, 107, 0.1);
  color: #0b2f6b;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notice-banner .notice-dismiss:hover {
  background: rgba(11, 47, 107, 0.18);
}

.drop-label.highlight {
  animation: drop-highlight 0.4s ease-in-out 0s 6 alternate;
}

@keyframes drop-highlight {
  from {
    color: #357ae8;
  }
  to {
    color: #0b2f6b;
  }
}

.collapse-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}

.collapse-switch {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  color: #0b2f6b;
}

.collapse-switch input[type="checkbox"] {
  margin-right: 0.5rem;
}

.collapse-note {
  margin-top: 0.75rem;
}

.pdf-page {
  background: #fff;
  border: 1px solid #c8d2ea;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 12px rgba(11, 47, 107, 0.08);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pdf-page.collapsed {
  background: #f5f7ff;
  border-color: #b6c2e8;
}

.pdf-page.collapsed .page-header {
  margin-bottom: 0.3rem;
}

.pdf-page.collapsed .page-header p,
.pdf-page.collapsed .page-blocks {
  display: none;
}

.page-collapse-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #e9efff;
  border: 1px solid #0b6ef5;
  color: #0b2f6b;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.page-collapse-toggle:hover:not([disabled]) {
  background: #dbe5ff;
}

.page-collapse-toggle[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-collapse-toggle.hidden {
  display: none;
}

.page-header {
  margin-bottom: 1rem;
}

.page-header h2 {
  margin: 0;
  font-size: 1.4rem;
  color: #0b2f6b;
}

.page-header p {
  margin: 0.35rem 0 0;
  color: #4b5771;
  font-size: 0.9rem;
}

.page-header h2 .page-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5771;
  margin-left: 0.5rem;
}

.page-blocks > *:not(:last-child) {
  margin-bottom: 1.2rem;
}

.title-block {
  text-transform: uppercase;
  color: #0b2f6b;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-align: center;
}

.title-line {
  font-size: 1.3rem;
}

.block-heading {
  margin: 1.4rem 0 0.6rem;
  color: #0b2f6b;
  font-size: 1.15rem;
}

.block-subheading {
  margin: 1rem 0 0.4rem;
  color: #183c7a;
  font-size: 1rem;
}

.block-paragraphs p {
  margin: 0.6rem 0;
  line-height: 1.5;
  color: #1f2d4d;
}

.layout-table.two-column td {
  width: 50%;
}

.layout-table.toc-table td {
  border: none;
  padding: 0.3rem 0;
}

.layout-table.toc-table .toc-page {
  text-align: right;
  color: #4b5771;
}

.layout-table.clause-table th:first-child {
  width: 12%;
}

.layout-table.clause-table th:nth-child(2) {
  width: 38%;
}

.layout-table {
  width: 100%;
  border-collapse: collapse;
}

.layout-table th,
.layout-table td {
  border: 1px solid #d2daed;
  padding: 0.75rem;
  vertical-align: top;
  background: #fbfcff;
}

.layout-table th {
  width: 32%;
  background: #f2f5ff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.layout-table td {
  background: #fff;
}

.field-label {
  display: block;
}

.widget-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.widget-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #25407f;
}

.input-wide {
  width: 100%;
  border: 1px solid #a9b8d3;
  border-radius: 4px;
  padding: 0.6rem;
  font-size: 1rem;
}

.widget-control .input-wide {
  flex: 1;
  background: #fff;
}

.widget-static {
  font-size: 0.9rem;
  color: #4b5771;
}

.input-affix-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.affix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  /*background: #eef3ff;*/
  color: #25407f;
  font-weight: 600;
  font-size: 0.85rem;
}

.affix.placeholder {
  visibility: hidden;
}

.affix.suffix {
  order: 3;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.button-row {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

button {
  background: #0b6ef5;
  border: none;
  border-radius: 4px;
  color: #fff;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #094ea7;
}

.main-actions {
  margin-bottom: 2rem;
}

.button-link {
  display: inline-block;
  text-decoration: none;
  background: #fff;
  color: #0b6ef5;
  border: 1px solid #0b6ef5;
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
}

.button-link:hover {
  background: rgba(11, 110, 245, 0.08);
}

.batch-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prefill-select-wrapper.hidden {
  display: none;
}

.prefill-select {
  width: 100%;
  border: 1px solid #a9b8d3;
  border-radius: 4px;
  padding: 0.55rem;
  background: #fff;
  font-size: 1rem;
}

.batch-form input[type="file"] {
  border: 1px solid #a9b8d3;
  border-radius: 4px;
  padding: 0.55rem;
  background: #fff;
}

.batch-label {
  font-weight: 600;
}

.prefill-select-wrapper {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.required {
  color: #d93025;
  font-weight: bold;
  margin-left: 0.35rem;
}

.field-note {
  font-size: 0.8rem;
  color: #4b5771;
  display: block;
  margin-top: 0.45rem;
}

.duplicate-note {
  color: #6b7490;
  font-size: 0.75rem;
}

.toc-table tr td:first-child {
  font-weight: 500;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-item {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px dashed #d2daed;
  padding-bottom: 0.75rem;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-control {
  min-width: 220px;
}

.checklist-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.summary-subcontract-row {
  --summary-value-width: min(320px, 100%);
}

.summary-subcontract-row .checklist-body {
  flex: 1 1 100%;
}

.summary-subcontract-row .checklist-fields {
  width: 100%;
  gap: 1rem;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) var(--summary-value-width);
  align-items: flex-end;
}

.summary-subcontract-row .widget-control {
  margin-bottom: 0;
}

.summary-subcontract-row .widget-label {
  font-size: 0.8rem;
}

.summary-subcontract-row--single .checklist-body {
  margin-left: auto;
  width: 100%;
}

.summary-subcontract-row--single .checklist-fields::before {
  content: "";
  display: block;
  min-height: 1px;
}

.summary-subcontract-row--single .widget-control {
  width: 100%;
  grid-column: 2;
}

.summary-subcontract-row--pair .widget-control:last-child {
  width: 100%;
}

@media (max-width: 720px) {
  .summary-subcontract-row {
    --summary-value-width: 100%;
  }

  .summary-subcontract-row--single .checklist-body {
    margin-left: 0;
    max-width: 100%;
  }

  .summary-subcontract-row .checklist-fields {
    display: flex;
    flex-direction: column;
  }

  .summary-subcontract-row--single .checklist-fields::before {
    display: none;
  }
}

.initials-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.6rem;
}

.signature-placeholder {
  gap: 0.25rem;
}

.signature-box {
  border: 2px dashed #a9b8d3;
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  color: #6b7490;
  font-style: italic;
  background: #f8faff;
}

.unknown-block,
.unknown-widget {
  padding: 0.75rem;
  background: #fff7ea;
  border: 1px solid #f3d9a6;
  border-radius: 4px;
  color: #8a5d0d;
}

.status-success {
  color: #0a7d3b;
  font-weight: 600;
}

.status-error {
  color: #bf2f27;
  font-weight: 600;
}
