:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #172027;
  --muted: #697580;
  --line: #dce3e8;
  --accent: #0f8f8c;
  --accent-dark: #0a6968;
  --warn: #b7791f;
  --danger: #b83232;
  --shadow: 0 18px 38px rgba(20, 32, 40, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.login-page {
  background:
    linear-gradient(135deg, rgba(15, 143, 140, .10), transparent 38%),
    linear-gradient(315deg, rgba(17, 26, 32, .10), transparent 34%),
    #f5f8fa;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(100%, 460px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(17, 26, 32, .14);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.login-brand h1 {
  font-size: 22px;
}

.login-brand p,
.login-form p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 5px;
}

.login-form h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.login-form .field {
  margin-top: 16px;
}

.login-error {
  margin-top: 14px;
  border: 1px solid #f0c2c2;
  border-radius: 6px;
  background: #fff1f1;
  color: var(--danger);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 72px;
  background: #111a20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  transition: width .18s ease;
  z-index: 10;
}

body.rail-expanded .rail {
  width: 236px;
  align-items: stretch;
  padding-inline: 14px;
}

.rail-head {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 12px;
}

body.rail-expanded .rail-head {
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
}

.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.rail-toggle {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  background: #17242c;
  color: #d7e2e7;
}

body.rail-expanded .rail-toggle {
  width: 100%;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  color: #aab5bd;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

body.rail-expanded .rail-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 0 11px;
}

.rail-label {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

body.rail-expanded .rail-label {
  display: inline;
}
.rail-btn.active, .rail-btn:hover { background: #20303a; color: white; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app {
  margin-left: 72px;
  padding: 28px;
  transition: margin-left .18s ease;
}

body.rail-expanded .app {
  margin-left: 236px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: 0; }
.topbar p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}
.logout-btn {
  min-height: 36px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 18px;
  align-items: start;
}
.view[hidden] {
  display: none !important;
}
.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
  gap: 18px;
  align-items: start;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 18px;
  align-items: start;
}
.docs-grid {
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(440px, 1.22fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.form-panel { padding: 20px; }
.run-panel { padding: 18px; position: sticky; top: 18px; }

.profile-card {
  border: 1px solid #cbdfe3;
  border-radius: 8px;
  background: #f4fbfb;
  padding: 14px;
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}
.monitor-toggle {
  border: 1px solid #cbdfe3;
  border-radius: 8px;
  background: #f4fbfb;
  padding: 12px;
  margin-bottom: 14px;
}
.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.check-row input {
  width: 18px !important;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  padding: 0;
}
.check-row strong {
  display: block;
  font-size: 14px;
  color: #1f3038;
}
.check-row em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.submit-now-row { margin: 0 0 14px; }
.price-helper {
  border: 1px solid #d4e4e8;
  border-radius: 8px;
  background: #f8fcfc;
  padding: 12px;
  margin: -4px 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .42fr);
  gap: 12px;
  align-items: end;
}
.price-helper .check-row {
  grid-column: 1 / -1;
}
.price-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  align-items: center;
}
.price-preview.is-ready {
  border-color: #a8d8c2;
  background: #f0fbf5;
  color: #216242;
}
.price-preview.is-muted {
  color: var(--muted);
  font-weight: 700;
}
.multi-lot-panel {
  border: 1px solid #d4e4e8;
  border-radius: 8px;
  background: #f8fcfc;
  padding: 12px;
  margin: -4px 0 14px;
  display: grid;
  gap: 12px;
}
.multi-lot-panel[hidden] {
  display: none;
}
.multi-lot-rows {
  display: grid;
  gap: 10px;
}
.multi-lot-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(130px, .65fr) minmax(130px, .75fr) minmax(130px, .75fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.multi-lot-row .check-row {
  align-self: center;
}
.multi-lot-row .price-preview {
  min-height: 42px;
  font-size: 12px;
}
.multi-lot-row .remove-lot-row {
  min-width: 38px;
  padding-left: 10px;
  padding-right: 10px;
}
.readonly-price {
  background: #eef7f7;
  color: #1f3038;
  font-weight: 800;
}
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 12px;
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
}
.status-card strong {
  color: #1f3038;
  font-size: 14px;
}
.status-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.status-card.ok {
  border-color: #a8d8c2;
  background: #f0fbf5;
}
.status-card.warn {
  border-color: #efcf93;
  background: #fff8e8;
}
.profile-summary {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.profile-summary.ok {
  border-color: #a8d8c2;
  background: #f0fbf5;
  color: #216242;
  font-weight: 700;
}
.profile-summary.warn {
  border-color: #efcf93;
  background: #fff8e8;
  color: #7a5418;
  font-weight: 700;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-mode .profile-managed {
  display: none !important;
}
.library-panel {
  max-width: 1120px;
}
.profile-library-mount {
  display: grid;
  gap: 10px;
}
.library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.library-tabs a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfb;
  color: var(--accent-dark);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.library-savebar {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  padding-top: 14px;
  margin-top: 18px;
}
.library-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}
.library-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  cursor: pointer;
  color: #21313a;
  list-style: none;
}
.library-section summary::-webkit-details-marker {
  display: none;
}
.library-section summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef7f7;
  color: var(--accent-dark);
  font-weight: 900;
}
.library-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f7fbfb;
}
.library-section[open] summary::after {
  content: "-";
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.library-section summary strong {
  font-size: 15px;
  line-height: 1.25;
}
.library-section summary span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.library-section-body {
  padding: 14px;
}
.library-original-title {
  margin-top: 0;
}
.settings-list {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}
.helper-box {
  border: 1px solid #d4e4e8;
  border-radius: 6px;
  background: #f8fcfc;
  color: #4c5f69;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.requirements-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #a8d8c2;
  border-radius: 6px;
  background: #f0fbf5;
  color: #216242;
  padding: 10px 12px;
  margin: -4px 0 14px;
  font-size: 13px;
  font-weight: 700;
}
.requirements-result.is-warning {
  border-color: #e5c16a;
  background: #fff8e5;
  color: #71501a;
}
.requirements-result[hidden] {
  display: none !important;
}
.requirements-result span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 18px; line-height: 1.25; }
.section-head span { color: var(--muted); font-size: 12px; }

.form-group-title {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 20px 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #eef7f7;
  border-radius: 6px;
  color: #21313a;
  font-size: 13px;
  font-weight: 800;
}
.section-head + .form-group-title { margin-top: 0; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}
.field span {
  color: #33414b;
  font-size: 13px;
  font-weight: 700;
}
.esf-list {
  display: grid;
  gap: 8px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 11px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 86px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 143, 140, .12); }
.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}
.icon-btn {
  min-height: 42px;
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #f7fbfb;
  color: var(--accent-dark);
}
.icon-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.drop {
  min-height: 92px;
  border: 1px dashed #b9c7cf;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 14px;
  background: #fbfcfd;
  cursor: pointer;
}
.drop input { display: none; }
.drop svg { grid-row: span 2; width: 24px; height: 24px; color: var(--accent); }
.drop strong { font-size: 14px; }
.drop span { color: var(--muted); font-size: 12px; }
.drop em {
  grid-column: 2;
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.file-tile {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.file-tile .drop {
  margin-bottom: 0;
}
.file-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.document-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.specialist-groups,
.specialist-catalog,
.tender-specialist-groups,
.document-library,
.requirement-plan {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.specialist-group,
.catalog-person,
.tender-specialist-group,
.library-document,
.requirement-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}
.tender-specialists[hidden] {
  display: none !important;
}
.specialist-head {
  display: grid;
  gap: 4px;
}
.specialist-rows {
  display: grid;
  gap: 12px;
}
.specialist-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.specialist-files {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.specialist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.library-subtitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 -2px;
  color: #21313a;
}
.library-subtitle strong {
  font-size: 14px;
}
.library-subtitle span {
  color: var(--muted);
  font-size: 12px;
}
.legacy-hidden { display: none; }
.license-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.license-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.license-choice input {
  width: 18px !important;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  padding: 0;
}
.license-choice strong {
  display: block;
  color: #1f3038;
  font-size: 14px;
}
.license-choice em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.license-choice.has-file {
  border-color: #cbdfe3;
  background: #fbfefe;
}
.license-choice.missing-file {
  background: #f7f8f8;
  opacity: .72;
}
.license-choice.missing-file strong { color: #647782; }
.people-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}
.person-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  min-height: 42px;
}
.person-choice input {
  width: 16px !important;
  height: 16px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--accent);
}
.person-choice span {
  min-width: 0;
  color: #2d3b44;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.document-choice span {
  display: grid;
  gap: 3px;
}
.document-choice em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}
.requirement-doc-picker {
  margin-top: 8px;
}
.empty-inline {
  grid-column: 1 / -1;
  border: 1px dashed #cbd8de;
  border-radius: 6px;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
}
.danger-text {
  color: var(--danger);
  background: #fff1f1;
}
.drop.compact {
  min-height: 116px;
  margin-bottom: 0;
  align-content: start;
}
.drop.compact strong,
.drop.compact span,
.drop.compact em {
  min-width: 0;
}
.run-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  display: grid;
  gap: 5px;
  padding: 12px;
  margin-bottom: 14px;
}
.run-state strong {
  font-size: 13px;
  color: #25323b;
}
.run-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.mini {
  align-self: flex-start;
  min-height: 34px;
  background: #eef4f6;
  color: var(--accent-dark);
  font-size: 13px;
}
.primary { width: 100%; background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.run-primary { width: auto; grid-column: span 2; }
.secondary { background: #e9f2f2; color: var(--accent-dark); }
.danger { background: #fff1f1; color: var(--danger); }
.link-button {
  text-decoration: none;
}
.monitor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.monitor-results-panel {
  position: static;
}
.monitor-results {
  display: grid;
  gap: 10px;
}
.docs-report {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.docs-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.docs-card h3 {
  color: #1f3038;
  font-size: 15px;
  line-height: 1.35;
}
.docs-card p,
.docs-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.docs-card ul {
  margin: 0;
  padding-left: 18px;
}
.docs-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.monitor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.monitor-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  gap: 14px;
  align-items: start;
}
.monitor-card strong {
  color: var(--accent-dark);
  font-size: 13px;
}
.monitor-card h3 {
  margin-top: 4px;
  color: #1f3038;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.monitor-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.monitor-card-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}
.monitor-card-side b {
  color: #21313a;
  font-size: 14px;
}
.monitor-card-side span {
  color: var(--muted);
  font-size: 12px;
}
.monitor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.monitor-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
  color: #4e626d;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.monitor-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.steps {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}
.steps div {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.steps div:last-child { border-bottom: 0; }
.steps span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf3f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.compact-head { margin-bottom: 10px; }
.compact-head h3 { font-size: 16px; }
.preflight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
  margin: 14px 0;
}
.preflight-panel[hidden] { display: none !important; }
.preflight-panel.is-ready {
  border-color: #a8d8c2;
  background: #f5fbf8;
}
.preflight-panel.is-blocked {
  border-color: #efcf93;
  background: #fffaf0;
}
.preflight-checklist {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.preflight-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px;
}
.preflight-item b {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
}
.preflight-item.ok b {
  background: #e7f7ef;
  color: #216242;
}
.preflight-item.bad b {
  background: #fff1d2;
  color: #835816;
}
.preflight-item span {
  display: grid;
  gap: 2px;
}
.preflight-item strong { font-size: 13px; }
.preflight-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.preflight-details {
  display: grid;
  gap: 8px;
}
.preflight-details details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
}
.preflight-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #21313a;
}
.preflight-details dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
}
.preflight-details dt {
  color: var(--muted);
  font-size: 12px;
}
.preflight-details dd {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.preflight-details ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #34424b;
  font-size: 12px;
}
.preflight-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.run-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.run-panel h3 { font-size: 14px; margin-bottom: 10px; }
.jobs {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.job {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  min-height: 54px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: stretch;
  align-items: center;
  column-gap: 10px;
  text-align: left;
}
.job small { justify-self: end; }
.job.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 143, 140, .12); }
.job small { color: var(--muted); font-weight: 600; }
.job .reason {
  grid-column: 1 / -1;
  display: block;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}
.output {
  min-height: 110px;
  max-height: 240px;
  overflow: auto;
  background: #101820;
  color: #d7e2e7;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .docs-results-panel {
    position: static;
  }
}

@media (max-width: 980px) {
  .rail { width: 56px; }
  .app { margin-left: 56px; padding: 18px; }
  body.rail-expanded .rail { width: 210px; }
  body.rail-expanded .app { margin-left: 210px; }
  .workspace, .monitor-grid, .docs-grid, .settings-grid { grid-template-columns: 1fr; }
  .run-panel { position: static; }
  .document-grid, .specialist-files, .people-picker, .license-choice-grid, .price-helper, .multi-lot-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .rail { position: static; width: 100%; height: 56px; flex-direction: row; padding: 8px 12px; }
  body.rail-expanded .rail { width: 100%; height: auto; align-items: stretch; }
  .rail-head { width: auto; grid-template-columns: 40px 40px; }
  body.rail-expanded .rail-head { grid-template-columns: 40px 40px; }
  body.rail-expanded .rail-btn { width: auto; min-width: 130px; }
  .app { margin-left: 0; padding: 14px; }
  body.rail-expanded .app { margin-left: 0; }
  .topbar { flex-direction: column; }
  .grid2, .run-grid, .monitor-actions, .monitor-card-main, .docs-actions { grid-template-columns: 1fr; }
  .monitor-card-side { justify-items: start; text-align: left; }
}
