.lf-wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 26px 18px 56px;
}

.lf-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.lf-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e9d4a2;
  background: #fff8e9;
  color: #4a3706;
  font-size: 0.95rem;
  line-height: 1.45;
}

.lf-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lf-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.72fr) minmax(220px, 1.45fr) minmax(150px, 1fr) minmax(170px, 1fr) 24px;
  gap: 10px 14px;
  align-items: end;
  border: 1px solid #e1e8f0;
  background: #fff;
  padding: 10px 12px;
  border-radius: 0;
  position: relative;
}

.lf-row.lf-row-header {
  background: #edf3fb;
  color: #17314d;
  font-weight: 700;
  text-transform: none;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.lf-head {
  line-height: 1.2;
}

.lf-row.lf-row-header .lf-head {
  font-size: 0.88rem;
}

.lf-head-delete {
  width: 24px;
}

.lf-row.lf-row-header .lf-label-sub {
  font-weight: 400;
  font-style: italic;
}

.lf-row.lf-data-row {
  border-top: none;
}

.lf-row.lf-data-row:last-of-type {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.lf-row.lf-data-row:nth-of-type(odd) {
  background: #fff;
}

.lf-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #23405f;
  margin-bottom: 6px;
}

.lf-label-sub {
  display: block;
  font-weight: 400;
  font-style: italic;
}

.lf-field input,
.lf-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.95rem;
  background: #fff;
  color: #0a274f;
}

.lf-row .lf-delete-row {
  justify-self: center;
  align-self: center;
  padding: 0;
  width: 24px;
  min-width: 24px;
  line-height: 1;
}

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

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

.lf-table th,
.lf-table td {
  border: 1px solid #e1e1e1;
  padding: 10px 12px;
  text-align: left;
}

.lf-table th {
  background: #f7f7f7;
  font-weight: 700;
}

.lf-table input[type="number"],
.lf-table input[type="date"] {
  width: 100%;
  box-sizing: border-box;
}

.lf-center {
  text-align: center;
}

.lf-actions {
  margin-top: 14px;
}

.lf-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 14px;
}

.lf-actions-slot {
  display: flex;
}

.lf-actions-slot-left {
  justify-content: flex-start;
}

.lf-actions-slot-center {
  justify-content: center;
}

.lf-actions-slot-right {
  justify-content: flex-end;
}

.btn {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn-gold {
  background: #f0c75e;
  color: #0b1f33;
  border: 2px solid #bc8a36;
}

.btn-outline {
  background: #ffffff;
  color: #0b1f33;
  border: 2px solid #bc8a36;
}

.btn-blue-dark {
  background: #0b3a6e;
  color: #fff;
  border: 2px solid #0a2f58;
}

.btn-blue-bright {
  background: #2a63bf;
  color: #fff;
  border: 2px solid #2456a8;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #c00;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.lf-results {
  margin-top: 18px;
  background: #fff;
  border-radius: 16px;
  border: 2px solid #2456a8;
  padding: 16px 18px;
}

.lf-results-header h2 {
  margin: 0 0 6px;
  color: #10233c;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lf-results-stack {
  display: grid;
  gap: 10px;
}

.lf-result-card {
  border: 1px solid #dce6f0;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
}

.lf-result-card h3 {
  margin: 0 0 10px;
  color: #10233c;
  font-size: 1.1rem;
  font-weight: 700;
}

.lf-result-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: #1b2f46;
  align-items: baseline;
}

.lf-result-label {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.lf-result-value {
  font-weight: 700;
  color: #10233c;
  flex: 0 0 auto;
  text-align: right;
}

.lf-result-line-total .lf-result-label,
.lf-result-line-total .lf-result-value {
  font-weight: 800;
}

.lf-result-note {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: #47607f;
}

.lf-result-card h3,
.lf-result-line-total {
  border-top: 0;
}

.lf-result-line-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid #d4a047;
}

.lf-result-line:not(.lf-result-line-total) .lf-result-label,
.lf-result-line:not(.lf-result-line-total) .lf-result-value {
  font-weight: 600;
}

.lf-result-line:not(.lf-result-line-total) {
  font-weight: 400;
}

.lf-result-line:not(.lf-result-line-total) .lf-result-label {
  color: #1b2f46;
}

.lf-result-line:not(.lf-result-line-total) .lf-result-value {
  color: #0a274f;
}

.lf-disclaimer {
  margin: 12px 0 0;
  text-align: center;
  color: #4a5f79;
  font-size: 0.95rem;
}

.lf-footer-note {
  margin: 26px auto 0;
  max-width: 860px;
  text-align: center;
  font-style: italic;
  color: #4a5f79;
  font-size: 0.95rem;
}

.lf-results-actions {
  margin: 18px 0 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}

@media (min-width: 901px) {
  .lf-row.lf-data-row .lf-field label {
    display: none;
  }
}

@media (max-width: 640px) {
  .lf-card,
  .lf-results {
    padding: 16px;
  }

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

  .lf-row .lf-delete-row {
    justify-self: start;
  }

  .lf-actions-bar {
    grid-template-columns: 1fr;
  }

  .lf-actions-slot-left,
  .lf-actions-slot-center,
  .lf-actions-slot-right {
    justify-content: stretch;
  }

  .lf-actions-slot .btn {
    width: 100%;
  }

  .lf-result-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .lf-result-value {
    text-align: left;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .lf-row {
    grid-template-columns: repeat(2, minmax(160px, 1fr)) 24px;
  }
}

@media print {
  .lf-result-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .lf-result-line {
    gap: 10px;
    align-items: flex-start;
  }

  .lf-result-label {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .lf-result-value {
    white-space: nowrap;
  }

  .lf-result-note {
    color: #1b2f46;
  }
}
