.estacas-shell {
  --estacas-green: #24745b;
  --estacas-blue: #d89a00;
  --estacas-red: #b64242;
  color: var(--calc-ink);
}

.estacas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.estacas-shell[data-current-step="1"] .estacas-layout {
  grid-template-columns: 1fr;
}

.estacas-shell[data-current-step="1"] .estacas-side {
  display: none;
}

.estacas-shell[data-current-step="2"] .estacas-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.estacas-shell[data-current-step="2"] .estacas-side-card:nth-child(2) {
  display: none;
}

.estacas-shell[data-current-step="3"] .estacas-layout,
.estacas-shell[data-current-step="4"] .estacas-layout {
  grid-template-columns: 1fr;
}

.estacas-shell[data-current-step="3"] .estacas-side,
.estacas-shell[data-current-step="4"] .estacas-side {
  display: none;
}

.estacas-main,
.estacas-side {
  min-width: 0;
}

.estacas-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 92px;
}

.estacas-panel,
.estacas-side-card,
.estacas-chart-card {
  border: 1px solid var(--calc-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.06);
}

.estacas-panel {
  display: none;
  padding: 18px;
}

.estacas-panel.is-active {
  display: block;
}

.estacas-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.estacas-card-head h2,
.estacas-side-card h3,
.estacas-chart-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 850;
}

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

.estacas-form-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

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

.estacas-form-grid label,
.estacas-factor-grid label {
  display: grid;
  gap: 6px;
  color: #30445b;
  font-size: 0.88rem;
  font-weight: 800;
}

.estacas-form-grid label.is-disabled {
  opacity: 0.58;
}

.estacas-check-param {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  padding-top: 24px;
}

.estacas-input-with-tool {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.estacas-lookup-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  background: #fff;
  color: var(--calc-primary);
}

.estacas-lookup-table button {
  width: 100%;
  min-height: 32px;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  background: #fff;
  color: var(--calc-primary);
  font-weight: 800;
}

.estacas-lookup-table button:hover,
.estacas-lookup-table button:focus {
  border-color: var(--calc-blue);
  background: #fff4d2;
}

.estacas-table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.estacas-table th {
  color: #30445b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.estacas-table input,
.estacas-table select {
  min-width: 110px;
}

.estacas-row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.estacas-row-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  background: #fff;
  color: var(--calc-primary);
}

.estacas-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #f6f9fc;
  color: var(--calc-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.estacas-alert.is-error {
  border-color: rgba(182, 66, 66, 0.35);
  background: #fff5f5;
  color: #8f2f2f;
}

.estacas-chart-card {
  margin-top: 16px;
  padding: 14px;
}

.estacas-spt-workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(320px, 0.75fr);
  gap: 12px;
  align-items: stretch;
}

.estacas-spt-table-card {
  min-width: 0;
}

.estacas-spt-table-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 850;
}

.estacas-spt-chart-card {
  margin-top: 0;
  min-width: 0;
}

.estacas-shell[data-current-step="2"] .estacas-table {
  font-size: 0.82rem;
}

.estacas-shell[data-current-step="2"] .estacas-table th,
.estacas-shell[data-current-step="2"] .estacas-table td {
  padding: 5px;
}

.estacas-shell[data-current-step="2"] .estacas-table input,
.estacas-shell[data-current-step="2"] .estacas-table select {
  min-width: 0;
  height: 34px;
  padding: 4px 6px;
  font-size: 0.82rem;
}

.estacas-shell[data-current-step="2"] .estacas-table input[type="number"] {
  width: 74px;
}

.estacas-shell[data-current-step="2"] .estacas-table select {
  width: 126px;
}

.estacas-shell[data-current-step="2"] .estacas-row-actions {
  gap: 4px;
}

.estacas-shell[data-current-step="2"] .estacas-row-actions button {
  width: 28px;
  height: 28px;
  border-radius: 5px;
}

.estacas-shell[data-current-step="2"] .estacas-side-card {
  padding: 10px;
}

.estacas-shell[data-current-step="2"] .estacas-side-card svg {
  margin-top: 8px;
}

.estacas-chart-card canvas {
  display: block;
  width: 100%;
  height: 300px;
}

.estacas-spt-chart-card canvas {
  height: 330px;
}

.estacas-chart-tip {
  min-height: 22px;
  color: var(--calc-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.estacas-method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.estacas-method-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #b9c8d8;
  border-radius: 6px;
  background: #fff;
  color: var(--calc-primary);
  font-weight: 850;
}

.estacas-method-tabs button.is-active {
  border-color: var(--calc-blue);
  background: #fff4d2;
}

.estacas-method-reductions {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--calc-border);
  border-radius: 8px;
  background: #fffaf0;
}

.estacas-method-reductions h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 850;
}

.estacas-method-reduction-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
  align-items: stretch;
}

.estacas-reduction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 10px;
}

.estacas-reduction-grid label {
  display: grid;
  gap: 6px;
  color: #30445b;
  font-size: 0.86rem;
  font-weight: 800;
}

.estacas-method-extra-params {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 10px 14px;
  align-content: start;
  padding: 10px 12px;
  border: 1px dashed #b9c8d8;
  border-radius: 8px;
  background: #fff;
}

.estacas-method-extra-params label:not(.estacas-check-param) {
  display: grid;
  gap: 6px;
  color: #30445b;
  font-size: 0.86rem;
  font-weight: 800;
}

.estacas-method-extra-params small,
.estacas-muted-box {
  color: var(--calc-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.estacas-check-param-inline {
  padding-top: 0;
  grid-column: 1 / -1;
}

.estacas-param-panel {
  display: none;
}

.estacas-param-panel.is-active {
  display: block;
}

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

.estacas-summary-card,
.estacas-check-card {
  border: 1px solid var(--calc-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.estacas-summary-card.is-best {
  border-color: rgba(36, 116, 91, 0.45);
  background: #f2fbf7;
}

.estacas-summary-card.is-ok {
  border-color: rgba(36, 116, 91, 0.45);
  background: #f2fbf7;
}

.estacas-summary-card.is-fail {
  border-color: rgba(182, 66, 66, 0.45);
  background: #fff4f4;
}

.estacas-summary-card.is-ok strong {
  color: #24745b;
}

.estacas-summary-card.is-fail strong {
  color: #b64242;
}

.estacas-summary-card strong,
.estacas-check-card strong {
  display: block;
  margin-bottom: 6px;
  color: #30445b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.estacas-summary-card span {
  display: block;
  color: var(--calc-ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.estacas-summary-card small,
.estacas-check-card small {
  display: block;
  margin-top: 6px;
  color: var(--calc-muted);
  font-weight: 700;
}

.estacas-check-card.is-ok {
  border-color: rgba(36, 116, 91, 0.36);
  background: #f2fbf7;
}

.estacas-check-card.is-fail {
  border-color: rgba(182, 66, 66, 0.42);
  background: #fff4f4;
}

.estacas-check-card.is-ok strong {
  color: #24745b;
}

.estacas-check-card.is-fail strong {
  color: #b64242;
}

.estacas-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.estacas-memory {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--calc-border);
  border-radius: 8px;
  background: #fffaf0;
  color: #30445b;
  font-size: 0.9rem;
}

.estacas-memory p {
  margin: 0 0 8px;
}

.estacas-armadura-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.estacas-armadura-form {
  min-width: 0;
}

.estacas-combined-card {
  position: sticky;
  top: 92px;
}

.estacas-combined-card svg {
  min-height: 520px;
}

.estacas-memorial-button-row {
  display: flex;
  justify-content: flex-end;
}

.estacas-side-card {
  padding: 14px;
}

.estacas-side-card svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid #e3ebf3;
  border-radius: 8px;
  background: #fbfdff;
}

.estacas-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1055;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(216, 154, 0, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--calc-ink);
  box-shadow: 0 18px 42px rgba(18, 32, 51, 0.16);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.18s ease;
}

.estacas-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .estacas-layout {
    grid-template-columns: 1fr;
  }

  .estacas-shell[data-current-step="2"] .estacas-layout {
    grid-template-columns: 1fr;
  }

  .estacas-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .estacas-spt-workspace {
    grid-template-columns: 1fr;
  }

  .estacas-armadura-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .estacas-side,
  .estacas-chart-grid,
  .estacas-summary-grid,
  .estacas-check-grid,
  .estacas-form-grid,
  .estacas-factor-grid {
    grid-template-columns: 1fr;
  }

  .estacas-card-head {
    display: grid;
  }
}
