:root {
  color-scheme: light;
  --eh-bg: #f7fafc;
  --eh-surface: #ffffff;
  --eh-surface-subtle: #edf4f9;
  --eh-primary: #005ea8;
  --eh-primary-hover: #004b86;
  --eh-text: #102033;
  --eh-muted: #526070;
  --eh-border: #d6e1ea;
  --eh-error: #b42318;
  --eh-success: #087443;
  --eh-warning: #9a5b00;
}

[data-theme="dark"] {
  color-scheme: dark;
  --eh-bg: #071421;
  --eh-surface: #0e2235;
  --eh-surface-subtle: #15324c;
  --eh-primary: #6bb6ff;
  --eh-primary-hover: #9ccdff;
  --eh-text: #f4f8fb;
  --eh-muted: #b7c8d8;
  --eh-border: #284b68;
  --eh-error: #ffb4ab;
  --eh-success: #77ddb0;
  --eh-warning: #ffd27a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --eh-bg: #071421;
    --eh-surface: #0e2235;
    --eh-surface-subtle: #15324c;
    --eh-primary: #6bb6ff;
    --eh-primary-hover: #9ccdff;
    --eh-text: #f4f8fb;
    --eh-muted: #b7c8d8;
    --eh-border: #284b68;
    --eh-error: #ffb4ab;
    --eh-success: #77ddb0;
    --eh-warning: #ffd27a;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--eh-bg);
  color: var(--eh-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--eh-primary);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--eh-primary), transparent 62%);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  transform: translateY(-150%);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--eh-primary);
  color: var(--eh-surface);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--eh-border);
  background: var(--eh-surface);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--eh-text);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: var(--eh-primary);
  color: var(--eh-surface);
}

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

.nav a {
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--eh-text);
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus {
  background: var(--eh-surface-subtle);
}

.page {
  padding: 20px 0 40px;
}

.page-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.admin-page {
  padding-top: 14px;
}

.admin-page-new {
  padding-top: 6px;
}

.admin-topbar {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.admin-topbar .page-title {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.admin-lead {
  margin: 8px 0 0;
  font-size: .95rem;
}

.admin-topbar-compact {
  display: none;
}

.admin-topbar-compact .page-title {
  margin: 0;
  color: var(--eh-muted);
  font-size: .92rem;
  line-height: 1.2;
  text-align: center;
}

.admin-dropdown-nav {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 0 0 8px;
  padding: 6px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  background: var(--eh-surface);
}

.admin-menu-item {
  position: relative;
}

.admin-menu-item::after {
  content: "";
  position: absolute;
  z-index: 21;
  top: 100%;
  right: 0;
  left: 0;
  display: none;
  height: 10px;
}

.admin-menu-item:hover::after,
.admin-menu-item:focus-within::after {
  display: block;
}

.admin-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--eh-text);
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.admin-menu-trigger::after {
  content: "▾";
  color: currentColor;
  font-size: .72rem;
  line-height: 1;
}

.admin-menu-trigger:hover,
.admin-menu-trigger:focus {
  border-color: color-mix(in srgb, var(--eh-primary), var(--eh-border) 45%);
  background: color-mix(in srgb, var(--eh-primary), var(--eh-surface-subtle) 90%);
  outline: none;
}

.admin-menu-trigger[aria-current="page"] {
  border-color: var(--eh-primary);
  background: var(--eh-primary);
  color: var(--eh-surface);
}

.admin-menu-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  display: none;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  background: var(--eh-surface);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--eh-text), transparent 86%);
  z-index: 30;
}

.admin-menu-item:hover .admin-menu-dropdown,
.admin-menu-item:focus-within .admin-menu-dropdown {
  display: grid;
  gap: 4px;
}

.admin-menu-dropdown a {
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--eh-text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.admin-menu-dropdown a:hover,
.admin-menu-dropdown a:focus {
  background: var(--eh-surface-subtle);
  outline: 2px solid transparent;
}

.lead {
  color: var(--eh-muted);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--eh-muted);
  font-weight: 700;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.section-header h1,
.section-header h2,
.section-header h3,
.section-header p {
  margin-top: 0;
}

.admin-page-new .admin-detail-header {
  margin-bottom: 12px;
}

.admin-page-new .admin-detail-header .page-title {
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.admin-page-new .admin-detail-header .lead {
  margin: 0;
  font-size: .95rem;
}

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

.section-nav,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 8px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  background: var(--eh-surface);
}

.admin-primary-tabs {
  justify-content: flex-end;
  margin: 0;
}

.admin-new-primary-tabs {
  justify-content: flex-start;
  margin: 0 0 16px;
}

.section-nav a,
.tabs a {
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--eh-surface-subtle);
  color: var(--eh-text);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease, transform .08s ease;
}

.section-nav a:hover,
.tabs a:hover {
  border-color: color-mix(in srgb, var(--eh-primary), var(--eh-border) 35%);
  background: color-mix(in srgb, var(--eh-primary), var(--eh-surface-subtle) 88%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--eh-text), transparent 86%);
}

.section-nav a:active,
.tabs a:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px color-mix(in srgb, var(--eh-text), transparent 84%);
}

.tabs a[aria-current="page"] {
  border-color: var(--eh-primary);
  background: var(--eh-primary);
  color: var(--eh-surface);
}

.tabs a[aria-current="page"]:hover {
  border-color: var(--eh-primary-hover);
  background: var(--eh-primary-hover);
}

.tabs-secondary {
  margin-top: 0;
}

.admin-data-panel {
  gap: 12px;
  padding: 12px;
}

.admin-panel-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-panel-toolbar h2 {
  margin: 0;
  font-size: 1.35rem;
}

.admin-data-tabs {
  margin: 0;
  padding: 6px;
  background: var(--eh-surface-subtle);
}

.admin-page-new .admin-data-tabs {
  display: none;
}

.admin-page-new .admin-data-panel,
.admin-page-new > .panel {
  padding: 12px;
}

.admin-page-new .admin-panel-toolbar {
  display: none;
}

.admin-page-new .admin-panel-toolbar h2 {
  color: var(--eh-muted);
  font-size: 1rem;
}

.admin-page-new .admin-panel-toolbar .muted {
  margin: 3px 0 0;
  font-size: .88rem;
}

.admin-page-new .admin-data-panel > .stack > h3:first-child,
.admin-page-new .admin-data-panel > .admin-enrichment-section > h3:first-child {
  display: none;
}

.admin-data-tabs a,
.admin-primary-tabs a {
  padding: 7px 10px;
}

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

.admin-landing-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-page-new .admin-landing-grid {
  gap: 10px;
}

.admin-landing-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.admin-page-new .admin-landing-card {
  gap: 10px;
  padding: 12px;
  background: var(--eh-surface-subtle);
}

.admin-landing-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-page-new .admin-landing-card h2 {
  font-size: 1rem;
}

.admin-landing-card .actions {
  display: grid;
  gap: 8px;
}

.admin-landing-card .button {
  justify-content: flex-start;
}

.admin-page-new .admin-landing-card .button-row.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.admin-page-new .admin-landing-card .button {
  min-height: 0;
  justify-content: flex-start;
  border: 0;
  border-radius: 4px;
  padding: 3px 0;
  background: transparent;
  color: var(--eh-primary);
  font-size: .92rem;
  text-decoration: none;
  box-shadow: none;
}

.admin-page-new .admin-landing-card .button::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--eh-primary);
  flex: 0 0 auto;
}

.admin-page-new .admin-landing-card .button:hover,
.admin-page-new .admin-landing-card .button:focus {
  background: transparent;
  color: var(--eh-primary-hover);
  text-decoration: underline;
}

.admin-page-new .admin-landing-card .button:active {
  transform: none;
  box-shadow: none;
}

.panel {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 16px;
  background: var(--eh-surface);
}

.stack {
  display: grid;
  gap: 16px;
}

.progress-grid {
  margin-bottom: 16px;
}

.progress-card {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface-subtle);
}

.enrichment-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 8px;
  background: var(--eh-surface-subtle);
}

.admin-live-metrics {
  grid-template-columns: repeat(5, minmax(96px, 1fr));
}

.status-metric {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--eh-surface);
}

.admin-live-metrics .status-metric {
  padding: 7px 9px;
}

.status-metric span {
  display: block;
  color: var(--eh-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-live-metrics .status-metric span {
  font-size: .68rem;
}

.status-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.admin-live-metrics .status-metric strong {
  font-size: 1.15rem;
}

.status-metric strong.metric-date {
  font-size: 1.08rem;
  line-height: 1.25;
  white-space: nowrap;
}

.admin-enrichment-section {
  gap: 12px;
}

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

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

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

.operation-card,
.operation-card form {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.operation-card {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface-subtle);
}

.operation-card h3 {
  margin: 0;
}

.form-action-label {
  align-self: end;
}

.mono-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  line-height: 1.45;
}

.admin-preview-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.button-row.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button-row.compact form {
  margin: 0;
}

.article-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.content-preview-card,
.content-preview-detail {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface);
}

.content-preview-card h4,
.content-preview-detail h4 {
  margin: 0;
  font-size: 1.05rem;
}

.content-preview-card.compact {
  display: grid;
  gap: 8px;
}

.article-body-preview {
  white-space: normal;
}

.notice {
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--eh-surface-subtle);
  font-weight: 700;
}

.notice.success {
  border-color: color-mix(in srgb, var(--eh-success), transparent 45%);
  color: var(--eh-success);
}

.notice.error {
  border-color: color-mix(in srgb, var(--eh-error), transparent 45%);
  color: var(--eh-error);
}

.progress-card h3 {
  margin: 0 0 8px;
  color: var(--eh-muted);
  font-size: .9rem;
  text-transform: uppercase;
}

.muted {
  color: var(--eh-muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--eh-border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--eh-muted);
  font-size: .82rem;
  text-transform: uppercase;
}

.company-admin-table {
  table-layout: fixed;
}

.company-admin-table th:nth-child(1),
.company-admin-table td:nth-child(1) {
  width: 20%;
}

.company-admin-table th:nth-child(2),
.company-admin-table td:nth-child(2),
.company-admin-table th:nth-child(3),
.company-admin-table td:nth-child(3) {
  width: 14%;
}

.company-admin-table th:nth-child(5),
.company-admin-table td:nth-child(5) {
  width: 180px;
}

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

.business-register-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  margin: 0;
}

.business-register-settings div,
.profile-panel {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--eh-surface-subtle);
}

.business-register-settings dt,
.detail-dl dt {
  color: var(--eh-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.business-register-settings dd,
.detail-dl dd {
  min-width: 0;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.business-register-table strong,
.profile-panel p {
  overflow-wrap: anywhere;
}

.business-register-profile h3,
.profile-panel h4 {
  margin: 0 0 10px;
}

.compact-stack {
  gap: 12px;
}

.section-subtitle {
  margin: 4px 0 8px;
  font-size: .95rem;
}

.financial-pivot-table th,
.financial-pivot-table td,
.activity-turnover-table th,
.activity-turnover-table td {
  font-variant-numeric: tabular-nums;
}

.data-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .nowrap,
.nowrap {
  white-space: nowrap;
}

.table-frame {
  min-width: 0;
  width: 100%;
}

.tender-edit-search-card {
  max-width: 760px;
}

.tender-edit-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.tender-edit-search-form .button {
  min-width: 180px;
}

.tender-review-card {
  overflow: hidden;
}

.tender-review-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.tender-review-filters label {
  min-width: 0;
}

.tender-review-filters .button {
  width: auto;
  min-width: 160px;
  justify-self: start;
}

.tender-review-table {
  table-layout: fixed;
}

.tender-review-table th:nth-child(1),
.tender-review-table td:nth-child(1) {
  width: 190px;
}

.tender-review-table th:nth-child(2),
.tender-review-table td:nth-child(2) {
  width: 92px;
}

.tender-review-table th:nth-child(4),
.tender-review-table td:nth-child(4) {
  width: 64px;
}

.tender-review-table th:nth-child(5),
.tender-review-table td:nth-child(5) {
  width: 108px;
}

.tender-review-table th:nth-child(6),
.tender-review-table td:nth-child(6) {
  width: 88px;
}

.tender-review-table th:nth-child(7),
.tender-review-table td:nth-child(7) {
  width: 128px;
}

.tender-review-table th:nth-child(8),
.tender-review-table td:nth-child(8) {
  width: 128px;
}

.tender-review-table th:nth-child(9),
.tender-review-table td:nth-child(9) {
  width: 92px;
}

.tender-review-table code,
.tender-review-table td:nth-child(3) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tender-review-table code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tender-review-table td:last-child form {
  margin: 0;
}

.financial-pivot-table th:not(:first-child),
.financial-pivot-table td:not(:first-child),
.activity-turnover-table th:first-child,
.activity-turnover-table td:first-child,
.activity-turnover-table th:nth-child(2),
.activity-turnover-table td:nth-child(2),
.activity-turnover-table th:last-child,
.activity-turnover-table td:last-child,
.annual-report-rows-table th:last-child,
.annual-report-rows-table td:last-child {
  text-align: right;
}

.financial-pivot-table th:first-child,
.financial-pivot-table td:first-child {
  width: 260px;
  font-weight: 500;
  font-size: .92rem;
}

.annual-report-rows-table th,
.annual-report-rows-table td {
  font-size: .9rem;
}

.annual-report-rows-table th:nth-child(1),
.annual-report-rows-table td:nth-child(1),
.annual-report-rows-table th:nth-child(4),
.annual-report-rows-table td:nth-child(4),
.annual-report-rows-table th:nth-child(5),
.annual-report-rows-table td:nth-child(5) {
  white-space: nowrap;
}

.annual-report-rows-table th:nth-child(3),
.annual-report-rows-table td:nth-child(3) {
  min-width: 240px;
}

.business-register-search-card {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr);
  gap: 10px 16px;
  align-items: end;
}

.business-register-search-card h2 {
  margin: 0;
}

.business-register-search-card .muted {
  grid-column: 2;
  margin: 0;
}

.business-register-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.business-register-search-form label {
  display: grid;
  gap: 6px;
}

.business-register-combobox {
  position: relative;
  display: block;
}

.business-register-options {
  position: absolute;
  z-index: 30;
  inset: calc(100% + 4px) 0 auto 0;
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 6px;
  background: var(--eh-surface);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
}

.business-register-options[hidden] {
  display: none;
}

.business-register-option {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--eh-text);
  text-align: left;
  cursor: pointer;
}

.business-register-option span {
  color: var(--eh-muted);
  font-size: .86rem;
}

.business-register-option:hover,
.business-register-option[aria-selected="true"] {
  border-color: var(--eh-border-strong);
  background: var(--eh-surface-subtle);
}

.detail-dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.compact-run-list {
  display: grid;
  gap: 8px;
}

.compact-run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: start;
  border-top: 1px solid var(--eh-border);
  padding-top: 8px;
}

.compact-run p {
  grid-column: 1 / -1;
  margin: 0;
}

.company-name {
  display: block;
  overflow-wrap: anywhere;
}

.compact-dl {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.compact-dl div {
  min-width: 0;
}

.compact-dl dt {
  color: var(--eh-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-dl dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.company-users {
  display: grid;
  gap: 8px;
}

.company-user {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 9px;
  background: var(--eh-surface-subtle);
}

.company-user-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.company-user-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status {
  display: inline-flex;
  border: 1px solid color-mix(in srgb, var(--eh-success), transparent 55%);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--eh-success);
  font-size: .82rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--eh-surface);
  color: var(--eh-text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease, transform .08s ease;
  user-select: none;
}

.button:hover {
  border-color: color-mix(in srgb, var(--eh-primary), var(--eh-border) 35%);
  background: color-mix(in srgb, var(--eh-primary), var(--eh-surface) 90%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--eh-text), transparent 86%);
}

.button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px color-mix(in srgb, var(--eh-text), transparent 84%);
}

.button.primary {
  border-color: var(--eh-primary);
  background: var(--eh-primary);
  color: var(--eh-surface);
}

.button.primary:hover {
  border-color: var(--eh-primary-hover);
  background: var(--eh-primary-hover);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--eh-primary), transparent 72%);
}

.button.primary:active {
  background: color-mix(in srgb, var(--eh-primary-hover), var(--eh-text) 10%);
}

.button.danger {
  border-color: color-mix(in srgb, var(--eh-error), transparent 45%);
  color: var(--eh-error);
}

.button.danger:hover {
  border-color: var(--eh-error);
  background: color-mix(in srgb, var(--eh-error), var(--eh-surface) 92%);
}

.button.disabled,
.button[aria-disabled="true"] {
  opacity: .58;
  pointer-events: none;
  cursor: not-allowed;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 16px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface-subtle);
}

.review-card-main,
.review-card-actions {
  min-width: 0;
}

.review-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.review-card h3,
.review-card p {
  margin: 0;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.review-meta dt {
  color: var(--eh-muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.review-meta dd {
  min-width: 0;
  margin: 2px 0 0;
}

.json-snippet {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.review-card-actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--eh-surface);
  color: var(--eh-text);
  font: inherit;
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  line-height: 1.45;
}

label,
.inline-form {
  display: grid;
  gap: 6px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.radio-option input {
  width: auto;
  min-height: 0;
}

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

.form-span-full {
  grid-column: 1 / -1;
}

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

.manual-enrichment-form {
  display: grid;
  gap: 14px;
}

.manual-enrichment-form textarea {
  min-height: 0;
  font-family: inherit;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: start;
}

.checkbox-row input {
  width: auto;
  min-height: 0;
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filter-bar label {
  min-width: min(100%, 220px);
}

.filter-bar.tender-edit-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.filter-bar.tender-edit-search-form .button {
  min-width: 180px;
}

.settings-panel {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--eh-surface-subtle);
}

.settings-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.settings-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.settings-list div {
  min-width: 0;
  border-top: 1px solid var(--eh-border);
  padding-top: 8px;
}

.settings-list dt {
  color: var(--eh-muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list dd {
  min-width: 0;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.background-process-grid {
  display: grid;
  gap: 12px;
}

.background-process-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface);
}

.background-process-main,
.background-process-form {
  min-width: 0;
}

.background-process-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.background-process-header h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.code-chip {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--eh-surface-subtle);
  color: var(--eh-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.background-process-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.background-process-meta div {
  min-width: 0;
  border-top: 1px solid var(--eh-border);
  padding-top: 8px;
}

.background-process-meta dt,
.background-process-form label > span:first-child {
  color: var(--eh-muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.background-process-meta dd {
  min-width: 0;
  margin: 3px 0 0;
  font-weight: 700;
}

.background-process-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--eh-surface-subtle);
}

.background-process-form select {
  min-height: 40px;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--eh-surface);
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toggle-box {
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--eh-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--eh-muted), var(--eh-surface) 88%);
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.toggle-box::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--eh-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--eh-text), transparent 72%);
  transition: transform .14s ease;
}

.toggle-row input:checked + .toggle-box {
  border-color: var(--eh-primary);
  background: var(--eh-primary);
}

.toggle-row input:checked + .toggle-box::before {
  transform: translateX(16px);
}

.toggle-row input:focus-visible + .toggle-box {
  outline: 3px solid color-mix(in srgb, var(--eh-primary), transparent 70%);
  outline-offset: 2px;
}

.import-run-list {
  display: grid;
  gap: 12px;
}

.import-run-card {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface-subtle);
}

.import-run-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.import-run-header h4,
.import-run-header p {
  margin: 0;
}

.import-run-story {
  margin: 0 0 12px;
  font-weight: 750;
}

.run-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.run-timeline li {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 9px;
  background: var(--eh-surface);
}

.run-timeline li.done {
  border-color: color-mix(in srgb, var(--eh-success), transparent 45%);
}

.run-timeline li.active {
  border-color: var(--eh-primary);
  box-shadow: inset 0 0 0 1px var(--eh-primary);
}

.run-timeline span {
  display: block;
  color: var(--eh-muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.run-timeline strong {
  display: block;
  margin-top: 2px;
  font-size: 1.2rem;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metric-list div {
  min-width: 0;
  border-top: 1px solid var(--eh-border);
  padding-top: 8px;
}

.metric-list dt {
  color: var(--eh-muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-list dd {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 750;
}

.import-run-details {
  margin-top: 10px;
}

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

.enrichment-external-id {
  white-space: nowrap;
}

.enrichment-debug-row td {
  padding-top: 0;
}

.enrichment-debug {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 10px;
  background: var(--eh-surface-subtle);
}

.enrichment-debug summary {
  cursor: pointer;
  font-weight: 800;
}

.enrichment-debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.debug-panel {
  min-width: 0;
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 10px;
  background: var(--eh-surface);
}

.debug-panel-full {
  grid-column: 1 / -1;
}

.debug-panel p {
  margin: 0;
  color: var(--eh-muted);
}

.debug-panel h4 {
  margin: 0 0 8px;
}

.debug-panel pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .82rem;
}

.debug-field-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .9rem;
}

.debug-field-table th,
.debug-field-table td {
  border-bottom: 1px solid var(--eh-border);
  padding: 8px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.debug-field-table th:nth-child(1),
.debug-field-table td:nth-child(1) {
  width: 28%;
}

.debug-field-table th:nth-child(2),
.debug-field-table td:nth-child(2) {
  width: 64px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.prompt-list,
.prompt-editor form {
  display: grid;
  gap: 14px;
}

.prompt-editor {
  border: 1px solid var(--eh-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--eh-surface-subtle);
}

code {
  border: 1px solid var(--eh-border);
  border-radius: 6px;
  padding: 2px 5px;
  background: var(--eh-surface);
}

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

.header-form {
  margin: 0;
}

.auth-page {
  display: grid;
  min-height: 60vh;
  align-items: start;
}

.auth-panel {
  width: min(100%, 520px);
}

.theme-toggle {
  min-width: 92px;
}

@media (max-width: 860px) {
  .admin-topbar,
  .admin-panel-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-primary-tabs {
    justify-content: flex-start;
  }

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

  .review-card,
  .background-process-card,
  .operation-grid.two,
  .operation-grid,
  .business-register-workspace,
  .business-register-profile-grid,
  .business-register-search-card,
  .business-register-settings,
  .enrichment-status-strip,
  .enrichment-debug-grid,
  .run-timeline,
  .settings-list,
  .metric-list,
  .user-dl {
    grid-template-columns: 1fr;
  }

  .review-meta,
  .background-process-meta,
  .business-register-search-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .business-register-search-card .muted {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table tr {
    margin: 0 0 12px;
    border: 1px solid var(--eh-border);
    border-radius: 6px;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    overflow-wrap: anywhere;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--eh-muted);
    font-weight: 800;
  }

  .tender-edit-search-card {
    max-width: none;
  }

  .tender-edit-search-form,
  .tender-review-filters {
    grid-template-columns: 1fr;
  }

  .tender-edit-search-form .button,
  .tender-review-filters .button {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .tender-review-table th,
  .tender-review-table td {
    width: auto !important;
  }

  .tender-review-table code {
    white-space: normal;
  }
}
