.length-adding-calculator-page {
  --tool-author-footer-max: 1120px;
}

.length-shell {
  width: min(1120px, calc(100% - 32px));
  max-width: none;
  margin: 24px auto 60px;
  padding: 0;
  color: #101828;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.length-shell .calc-page-head {
  margin-bottom: 20px;
}

.length-shell .calc-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #667085;
  font-size: 12px;
}

.length-shell .calc-breadcrumbs a {
  color: #667085;
  text-decoration: none;
}

.length-shell .calc-breadcrumbs a:hover,
.length-shell .calc-breadcrumbs a:focus-visible {
  color: #2364d2;
  text-decoration: underline;
}

.length-shell .calc-card {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(20, 24, 30, 0.08);
  border-radius: 12px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.length-hero {
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.length-kicker {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.length-hero h1 {
  margin: 0 0 12px;
  color: #101828;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.length-shell .calc-page-intro {
  margin: 0;
  max-width: 850px;
  color: #475467;
  font-size: 15px;
  line-height: 1.6;
}

.length-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.length-panel,
.length-result-card {
  display: grid;
  gap: 16px;
}

.length-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.length-panel h2,
.length-result-card h2,
.length-reference h2 {
  margin: 0;
  color: #101828;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.length-panel-head p,
.length-result-card p,
.length-reference p {
  margin: 4px 0 0;
}

.length-panel-head p {
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
}

.length-rows {
  display: grid;
  gap: 10px;
}

.length-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 180px) minmax(130px, 180px) 44px;
  gap: 10px;
  align-items: end;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 12px;
}

.length-row label,
.length-options label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.length-row input,
.length-row select,
.length-options select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #ffffff;
  color: #101828;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
}

.length-row input:focus,
.length-row select:focus,
.length-options select:focus {
  border-color: #0f766e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.length-remove-row,
.length-btn {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #101828;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.length-remove-row {
  width: 40px;
  padding: 0;
  border-radius: 10px;
  color: #475467;
}

.length-btn-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.length-btn:hover,
.length-btn:focus-visible,
.length-remove-row:hover,
.length-remove-row:focus-visible {
  border-color: #0f766e;
}

.length-options {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
}

.length-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.length-validation {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
}

.length-result-label {
  margin: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.length-result-value {
  margin: 0;
  color: #101828;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.length-result-card p {
  color: #475467;
  font-size: 15px;
  line-height: 1.6;
}

.length-result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.length-result-stats article {
  display: grid;
  gap: 4px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f9fafb;
  padding: 12px;
}

.length-result-stats span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.length-result-stats strong {
  color: #101828;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.length-table-wrap {
  overflow-x: auto;
}

.length-breakdown-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.length-breakdown-table th,
.length-breakdown-table td {
  border-bottom: 1px solid #e4e7ec;
  padding: 10px 8px;
  text-align: left;
}

.length-breakdown-table th {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.length-breakdown-table td {
  color: #101828;
  font-size: 14px;
}

.length-action-section {
  display: block;
}

.length-reference {
  margin-top: 16px;
}

.length-related-section {
  margin-top: 16px;
}

.length-shell .length-related-card {
  display: block;
}

.length-reference h2 {
  margin-bottom: 8px;
}

.length-reference p,
.length-reference li {
  color: #344054;
  font-size: 15px;
  line-height: 1.65;
}

.length-reference ul {
  margin: 0;
  padding-left: 20px;
}

.length-reference p + p {
  margin-top: 12px;
}

.length-reference .calc-faq {
  display: grid;
  gap: 10px;
}

.length-reference .calc-faq-item {
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #ffffff;
}

.length-reference .calc-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: #101828;
  font-size: 17px;
  font-weight: 700;
}

.length-reference .calc-faq-item summary::-webkit-details-marker {
  display: none;
}

.length-reference .calc-faq-item > p {
  margin: 0;
  padding: 0 14px 14px;
}

@media (max-width: 900px) {
  .length-row,
  .length-result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .length-remove-row {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .length-shell {
    width: calc(100% - 20px);
    margin-top: 20px;
    margin-bottom: 42px;
  }

  .length-shell .calc-card {
    padding: 16px;
  }

  .length-panel-head {
    display: grid;
  }

  .length-row,
  .length-result-stats,
  .length-options {
    grid-template-columns: 1fr;
  }

  .length-remove-row {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
}
