:root {
  color-scheme: light;
  font-family: "Golos Text", Arial, Helvetica, sans-serif;
  color: #1f2933;
  background: #f6f7f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid #dde2e8;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar nav a {
  text-decoration: none;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px;
}

.hero,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.hero {
  padding: 56px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2f6f6d;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 1.15;
}

h2 {
  margin: 0 0 8px;
}

p {
  margin: 0;
  color: #52616f;
  line-height: 1.5;
}

.lead {
  max-width: 680px;
  font-size: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #1d4f4d;
  border-radius: 6px;
  background: #1d4f4d;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
}

.button-secondary {
  background: #ffffff;
  color: #1d4f4d;
}

.button-secondary:hover {
  background: #1d4f4d;
  color: #ffffff;
}

.button-danger {
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

.button-disabled {
  border-color: #c8d0d9;
  background: #eef1f4;
  color: #7b8794;
  cursor: default;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #c8d0d9;
  border-radius: 6px;
  background: #ffffff;
  color: #52616f;
  cursor: pointer;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button-danger {
  border-color: #f0b8b2;
  color: #b42318;
}

.icon-button-danger:hover {
  background: #fff4f2;
  border-color: #b42318;
}

.icon-button-excel {
  border-color: #b7d7c2;
  color: #1f7a3f;
  text-decoration: none;
}

.icon-button-excel:hover {
  background: #f0faf3;
  border-color: #1f7a3f;
}

.icon-button-disabled {
  border-color: #c8d0d9;
  background: #eef1f4;
  color: #7b8794;
  cursor: default;
}

.table {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #dde2e8;
  font-size: 14px;
}

.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid #e6eaf0;
  text-align: left;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f1f6f6;
}

.report-link {
  color: #163f3d;
  font-weight: 800;
  text-decoration: none;
}

.report-link:hover {
  text-decoration: underline;
}

.reports-table .numeric-cell {
  text-align: left;
}

.table th {
  background: #e7f2f1;
  color: #163f3d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.table tbody tr:nth-child(even) {
  background: #f7fafb;
}

.table tbody tr:hover {
  background: #edf6f5;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f2f1;
  color: #1d4f4d;
  font-size: 13px;
  font-weight: 700;
}

.run-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.overview-panel {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d4dde6;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(31, 41, 51, 0.06);
}

.overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e6eaf0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
}

.overview-header form {
  margin: 0;
  flex: 0 0 auto;
}

.overview-header h2 {
  margin-bottom: 2px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 10px;
}

.kpi-card {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-width: 0;
  min-height: 66px;
  padding: 8px 10px;
  background: #f7fbfb;
  border: 1px solid #cfe3e1;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.kpi-card span {
  color: #52616f;
  font-size: 10.5px;
  font-weight: 700;
}

.kpi-card strong {
  overflow: hidden;
  color: #163f3d;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-table-block {
  margin: 0 16px 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.overview-table-title {
  margin-bottom: 6px;
  color: #163f3d;
  font-size: 12px;
  font-weight: 800;
}

.overview-type-table {
  margin-top: 0;
  table-layout: fixed;
  font-size: 11px;
}

.overview-type-table th,
.overview-type-table td {
  padding: 5px 7px;
  white-space: nowrap;
}

.overview-type-table th {
  font-size: 9.5px;
}

.overview-type-table td:first-child {
  color: #1f2933;
  font-weight: 700;
  text-align: left;
}

.overview-type-table th:first-child,
.overview-type-table td:first-child {
  width: 18%;
}

.summary-placeholder {
  margin: 16px 20px 18px;
  padding: 16px;
  background: #f8fbfb;
  border: 1px dashed #c8d0d9;
  border-radius: 6px;
  color: #52616f;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #52616f;
}

.status-inline-completed {
  color: #1d4f4d;
  font-weight: 700;
}

.status-inline-failed {
  color: #b42318;
  font-weight: 700;
}

.status-inline-processing {
  color: #2f6f6d;
  font-weight: 700;
}

.inline-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #c8d0d9;
  border-top-color: #1d4f4d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-value {
  color: #9aa6b2;
}

.empty,
.form-shell {
  max-width: 680px;
  padding: 32px;
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
}

.empty {
  margin-top: 28px;
}

.empty-inline {
  margin-top: 18px;
  max-width: none;
}

.empty .button {
  margin-top: 20px;
}

.form {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.form label {
  display: grid;
  gap: 8px;
  color: #52616f;
  font-weight: 700;
}

.form input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c8d0d9;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.detail-panel {
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 16px;
  background: #f6f7f9;
  border: 1px solid #dde2e8;
  border-radius: 8px;
}

.upload-form p {
  flex: 1 1 280px;
  font-size: 14px;
}

.upload-form-inline {
  display: inline-flex;
  flex: 0 1 auto;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.upload-form-inline p {
  flex: 0 1 auto;
  font-size: 12.5px;
  white-space: nowrap;
}

.upload-button {
  flex: 0 0 auto;
}

.upload-form-inline .upload-button {
  min-height: 36px;
  padding: 0 12px;
}

.upload-accordion-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
  padding: 14px 20px;
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
}

.upload-accordion-item .upload-button {
  min-height: 36px;
  padding: 0 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.details-list {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
}

.details-list div {
  display: grid;
  gap: 4px;
}

.details-list dt {
  color: #52616f;
  font-size: 13px;
  font-weight: 700;
}

.details-list dd {
  margin: 0;
}

.table-compact {
  margin-top: 18px;
  font-size: 13px;
}

.table-compact th,
.table-compact td {
  padding: 8px 10px;
  line-height: 1.35;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.results-section,
.notice {
  margin-top: 22px;
}

.section-header-compact h2 {
  margin-bottom: 4px;
}

.notice {
  padding: 20px 24px;
  border: 1px solid #f0b8b2;
  border-radius: 8px;
  background: #fff4f2;
}

.notice-danger h2 {
  color: #b42318;
}

.file-accordion {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.file-accordion-item {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
}

.file-accordion-item[open] {
  border-color: #9cc8c6;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.06);
}

.file-accordion-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.file-accordion-summary::-webkit-details-marker {
  display: none;
}

.file-accordion-summary::before {
  content: "›";
  flex: 0 0 auto;
  color: #1d4f4d;
  font-size: 26px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.file-accordion-item[open] .file-accordion-summary::before {
  transform: rotate(90deg);
}

.file-summary-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.file-name {
  overflow: hidden;
  color: #1f2933;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta,
.quiet-text {
  color: #52616f;
  font-size: 14px;
}

.file-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-summary-actions form {
  margin: 0;
}

.file-accordion-body {
  padding: 0 20px 22px;
  border-top: 1px solid #e6eaf0;
}

.loading-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 20px;
  background: #f8fbfb;
  border: 1px solid #d7e7e6;
  border-radius: 8px;
}

.loading-block .inline-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.loading-block h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.file-body-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.file-summary-table-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  background: #f8fbfb;
  border: 1px solid #d7e7e6;
  border-radius: 8px;
}

.summary-table-title {
  color: #163f3d;
  font-size: 14px;
  font-weight: 800;
}

.summary-table-title-secondary {
  margin-top: 10px;
}

.summary-table {
  margin-top: 0;
}

.analysis-table {
  margin-top: 0;
  border-color: #d7e7e6;
  font-size: 12.5px;
}

.analysis-table th {
  background: #dcefed;
  color: #163f3d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.analysis-table td {
  max-width: 220px;
  overflow: hidden;
  color: #31424f;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.analysis-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.analysis-table tbody tr:nth-child(even) {
  background: #f7fafb;
}

.analysis-table tbody tr:hover {
  background: #edf6f5;
}

.summary-table td {
  white-space: nowrap;
}

.summary-table td {
  color: #7b8794;
  font-variant-numeric: tabular-nums;
}

.summary-table td:first-child,
.summary-table th:first-child {
  color: #1f2933;
}

.summary-table tbody tr:hover {
  background: #edf6f5;
}

.offers-table td:first-child,
.offers-table td:nth-child(2),
.offers-table td:nth-child(3),
.offers-table td:nth-child(4) {
  white-space: normal;
}

.numeric-cell {
  color: #52616f;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.analysis-subtitle {
  margin: 20px 0 10px;
  color: #163f3d;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .topbar,
  .hero,
  .section-header {
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
    padding: 16px 20px;
  }

  h1 {
    font-size: 30px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .overview-header {
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .file-accordion-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-accordion-summary::before {
    position: absolute;
    margin-top: -2px;
  }

  .file-summary-main {
    padding-left: 22px;
    width: 100%;
  }

  .file-summary-actions {
    justify-content: flex-start;
    padding-left: 22px;
  }

}
