:root {
  --gts-dark: #232f3e;
  --gts-dark-2: #18212c;
  --gts-orange: #ff8400;
  --gts-orange-dark: #d96f00;
  --gts-bg: #f4f6f8;
  --gts-card: #ffffff;
  --gts-line: #d8dee5;
  --gts-muted: #66717f;
  --gts-text: #1f2933;
  --gts-success: #16794b;
  --gts-danger: #b42318;
  --gts-warning: #a15c00;
  --gts-shadow: 0 12px 34px rgba(35, 47, 62, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--gts-bg);
  color: var(--gts-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.gts-shell {
  padding: 24px 14px 48px;
}

.gts-app {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.gts-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 38px;
  color: #fff;
  background: linear-gradient(120deg, var(--gts-dark-2), var(--gts-dark));
  border-left: 7px solid var(--gts-orange);
  box-shadow: var(--gts-shadow);
}

.gts-kicker {
  margin: 0 0 8px;
  color: #ffc078;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gts-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

.gts-lead {
  max-width: 900px;
  margin: 16px 0 0;
  color: #e6ebf0;
  font-size: 17px;
}

.gts-hero-badge {
  flex: 0 0 220px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.gts-hero-badge span,
.gts-hero-badge strong {
  display: block;
}

.gts-hero-badge span {
  color: #cfd7df;
  font-size: 13px;
}

.gts-hero-badge strong {
  margin-top: 4px;
  font-size: 17px;
}

.gts-alert {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 5px solid var(--gts-danger);
  background: #fff0ef;
  color: #7a271a;
  box-shadow: 0 6px 20px rgba(35, 47, 62, 0.06);
}

.gts-alert.is-info {
  border-left-color: var(--gts-orange);
  background: #fff5e8;
  color: #6f3a00;
}

.gts-alert.is-success {
  border-left-color: var(--gts-success);
  background: #ecfdf3;
  color: #085d3a;
}

.gts-card {
  margin-top: 20px;
  padding: 26px;
  background: var(--gts-card);
  border: 1px solid #e3e8ed;
  box-shadow: var(--gts-shadow);
}

.gts-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.gts-card-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gts-card-head h2,
.gts-card h3 {
  margin: 0;
  color: var(--gts-dark);
}

.gts-card-head h2 {
  font-size: 22px;
}

.gts-card h3 {
  margin-bottom: 14px;
  font-size: 17px;
}

.gts-step {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--gts-orange);
  font-weight: 800;
}

.gts-grid {
  display: grid;
  gap: 16px;
}

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

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

.gts-span-2 {
  grid-column: span 2;
}

.gts-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.gts-field > span {
  color: #354250;
  font-size: 13px;
  font-weight: 700;
}

.gts-field small {
  color: var(--gts-muted);
  font-weight: 400;
}

.gts-field input,
.gts-field select,
.gts-table input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bfc8d2;
  border-radius: 0;
  background: #fff;
  color: var(--gts-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gts-field input,
.gts-field select {
  padding: 9px 11px;
}

.gts-table input {
  min-width: 68px;
  padding: 7px 8px;
}

.gts-field input:focus,
.gts-field select:focus,
.gts-table input:focus {
  border-color: var(--gts-orange);
  box-shadow: 0 0 0 3px rgba(255, 132, 0, 0.15);
}

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

.gts-support-box {
  padding: 20px;
  border-left: 4px solid var(--gts-orange);
  background: #f7f9fb;
}

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

.gts-dms-row-weighted {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gts-top-gap {
  margin-top: 14px;
}

.gts-top-gap-large {
  margin-top: 28px;
}

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

.gts-help-accent {
  margin: -6px 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--gts-orange);
  background: #fff8ef;
  color: #70400d;
}


.gts-example-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.gts-example-select {
  display: flex;
  min-width: min(390px, 48vw);
  flex-direction: column;
  gap: 6px;
}

.gts-example-select > span {
  color: var(--gts-muted);
  font-size: 12px;
  font-weight: 700;
}

.gts-example-select select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #bfc8d2;
  border-radius: 0;
  background: #fff;
  color: var(--gts-text);
  outline: none;
}

.gts-example-select select:focus {
  border-color: var(--gts-orange);
  box-shadow: 0 0 0 3px rgba(255, 132, 0, 0.15);
}

.gts-actions-inline,
.gts-primary-actions,
.gts-under-table {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gts-under-table {
  justify-content: space-between;
  margin-top: 12px;
}

.gts-under-table .gts-help {
  margin: 0;
}

.gts-btn {
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 700;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.gts-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.gts-btn-primary {
  color: #fff;
  background: var(--gts-orange);
  border-color: var(--gts-orange);
}

.gts-btn-primary:hover:not(:disabled) {
  background: var(--gts-orange-dark);
  border-color: var(--gts-orange-dark);
}

.gts-btn-dark {
  color: #fff;
  background: var(--gts-dark);
  border-color: var(--gts-dark);
}

.gts-btn-light {
  color: var(--gts-dark);
  background: #fff;
  border-color: #bdc7d1;
}

.gts-link-btn {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--gts-danger);
  font-weight: 700;
}

.gts-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--gts-line);
}

.gts-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.gts-table th,
.gts-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--gts-line);
  border-bottom: 1px solid var(--gts-line);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.gts-table th:last-child,
.gts-table td:last-child {
  border-right: 0;
}

.gts-table tr:last-child td {
  border-bottom: 0;
}

.gts-table thead th {
  color: #fff;
  background: var(--gts-dark);
  font-size: 12px;
}

.gts-table thead tr:nth-child(2) th {
  background: #344355;
}

.gts-input-table td:nth-child(2),
.gts-input-table td:nth-child(3) {
  min-width: 110px;
}

.gts-input-table td:nth-child(4) {
  min-width: 130px;
}

.gts-row-delete {
  width: 34px;
  height: 34px;
  border: 1px solid #d7a9a4;
  background: #fff;
  color: var(--gts-danger);
  font-size: 18px;
  font-weight: 700;
}

.gts-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr);
  align-items: stretch;
  gap: 20px;
}

.gts-workspace > .gts-card {
  min-width: 0;
}

.gts-drawing-card {
  display: flex;
  flex-direction: column;
}

.gts-drawing-card .gts-card-head {
  flex: 0 0 auto;
}

.gts-svg-wrap {
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--gts-line);
  background: #fbfcfd;
}

.gts-drawing {
  width: 100%;
  height: 100%;
}

.gts-drawing > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 480px;
}

@media (min-width: 1181px) {
  .gts-svg-wrap {
    flex: 1 1 auto;
    min-height: 0;
  }

  .gts-drawing,
  .gts-drawing > svg {
    min-height: 0;
  }
}

.gts-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  color: var(--gts-muted);
  font-size: 12px;
}

.gts-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gts-legend i {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 3px solid;
}

.gts-legend-raw {
  border-top-color: #7f8b97 !important;
  border-top-style: dashed !important;
}

.gts-legend-adjusted {
  border-top-color: var(--gts-orange) !important;
}

.gts-summary {
  display: grid;
  gap: 10px;
}

.gts-summary-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid #e3e8ed;
}

.gts-summary-item span {
  color: var(--gts-muted);
  font-size: 13px;
}

.gts-summary-item strong {
  color: var(--gts-dark);
  font-size: 15px;
  text-align: right;
}

.gts-summary-state {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-left: 4px solid var(--gts-orange);
  background: #fff8ef;
  color: #6e3b00;
  font-weight: 700;
}

.gts-summary-state.is-adjusted {
  border-left-color: var(--gts-success);
  background: #ecfdf3;
  color: #0c5f3d;
}

.gts-primary-actions {
  align-items: stretch;
  flex-direction: column;
  margin-top: 22px;
}

.gts-status {
  padding: 7px 11px;
  color: #774100;
  background: #fff1dc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.gts-status.is-adjusted {
  color: #075b38;
  background: #dff7e9;
}

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

.gts-result-table .is-correction {
  color: var(--gts-orange-dark);
  font-weight: 700;
}

.gts-footer-note {
  margin-top: 20px;
  padding: 16px 20px;
  border-left: 4px solid #8a96a3;
  background: #e9edf1;
  color: #515d69;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .gts-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gts-workspace,
  .gts-results-grid {
    grid-template-columns: 1fr;
  }

  .gts-summary-card {
    order: -1;
  }
}

@media (max-width: 820px) {
  .gts-shell {
    padding: 10px 8px 32px;
  }

  .gts-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 26px 22px;
  }

  .gts-hero-badge {
    width: 100%;
    flex-basis: auto;
  }

  .gts-card {
    padding: 20px 15px;
  }

  .gts-support-grid,
  .gts-grid-3,
  .gts-grid-4,
  .gts-dms-row,
  .gts-dms-row-weighted {
    grid-template-columns: 1fr;
  }

  .gts-span-2 {
    grid-column: auto;
  }

  .gts-card-head-wrap,
  .gts-under-table {
    align-items: stretch;
    flex-direction: column;
  }

  .gts-example-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .gts-example-select {
    min-width: 0;
  }

  .gts-actions-inline {
    width: 100%;
  }

  .gts-actions-inline .gts-btn {
    flex: 1;
  }

  .gts-svg-wrap,
  .gts-drawing,
  .gts-drawing > svg {
    min-height: 350px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .gts-shell {
    padding: 0;
  }

  .gts-btn,
  .gts-link-btn,
  .gts-actions-inline,
  .gts-footer-note {
    display: none !important;
  }

  .gts-card,
  .gts-hero {
    box-shadow: none;
  }
}
