.lcs-widget {
  --lcs-green: #28634a;
  --lcs-green-dark: #194b37;
  --lcs-green-light: #eaf4ee;
  --lcs-gold: #b76b22;
  --lcs-ink: #24302a;
  --lcs-muted: #64706a;
  --lcs-line: #dbe3de;
  max-width: 900px;
  margin: 24px auto;
  color: var(--lcs-ink);
  font-size: 16px;
  line-height: 1.7;
}

.lcs-widget *,
.lcs-widget *::before,
.lcs-widget *::after {
  box-sizing: border-box;
}

.lcs-hero {
  padding: 32px clamp(20px, 5vw, 48px);
  color: #fff;
  background: linear-gradient(135deg, var(--lcs-green-dark), var(--lcs-green));
  border-radius: 18px 18px 0 0;
}

.lcs-eyebrow {
  margin: 0 0 6px;
  color: #d7ebdf;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lcs-hero h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.35;
}

.lcs-hero p:last-child {
  max-width: 720px;
  margin: 0;
  color: #f2f8f4;
}

.lcs-form {
  padding: clamp(20px, 5vw, 40px);
  border: 1px solid var(--lcs-line);
  border-top: 0;
  background: #fff;
}

.lcs-section {
  min-width: 0;
  margin: 0 0 30px;
  padding: 0;
  border: 0;
}

.lcs-section:last-of-type {
  margin-bottom: 22px;
}

.lcs-section legend {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--lcs-green-light);
  color: var(--lcs-green-dark);
  font-size: 1.12rem;
  font-weight: 700;
}

.lcs-section legend span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--lcs-green);
  border-radius: 50%;
  font-size: 0.9rem;
}

.lcs-section-lead {
  margin: -4px 0 14px;
  color: var(--lcs-muted);
  font-size: 0.9rem;
}

.lcs-grid {
  display: grid;
  gap: 18px 20px;
}

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

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

.lcs-field {
  min-width: 0;
}

.lcs-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.lcs-field label b {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  color: #fff;
  background: #b33d32;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: 2px;
}

.lcs-input-unit {
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  border: 1px solid #b8c4bd;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lcs-input-unit:focus-within {
  border-color: var(--lcs-green);
  box-shadow: 0 0 0 3px rgba(40, 99, 74, 0.14);
}

.lcs-input-unit input {
  min-width: 0;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lcs-ink);
  font: inherit;
}

.lcs-input-unit span {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  color: #4d5a53;
  background: #f2f5f3;
  border-left: 1px solid var(--lcs-line);
  font-size: 0.85rem;
  white-space: nowrap;
}

.lcs-field > p {
  margin: 5px 0 0;
  color: var(--lcs-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.lcs-rate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 7px;
}

.lcs-rate-links a {
  color: var(--lcs-green);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lcs-rate-links a::after {
  content: " ↗";
}

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

.lcs-actions button {
  min-height: 48px;
  padding: 11px 22px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.lcs-primary {
  color: #fff;
  border: 1px solid var(--lcs-gold);
  background: var(--lcs-gold);
}

.lcs-primary:hover {
  background: #985515;
}

.lcs-secondary {
  color: var(--lcs-green-dark);
  border: 1px solid #b8c4bd;
  background: #fff;
}

.lcs-error {
  margin-top: 16px;
  padding: 14px 18px;
  color: #8b2922;
  border: 1px solid #efbcb7;
  border-radius: 10px;
  background: #fff1ef;
}

.lcs-result {
  margin-top: 20px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--lcs-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(24, 65, 46, 0.08);
}

.lcs-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 10px;
}

.lcs-status.is-ok {
  color: #184b36;
  background: var(--lcs-green-light);
}

.lcs-status.is-over {
  color: #852e26;
  background: #fff0ed;
}

.lcs-status span {
  font-size: 0.88rem;
}

.lcs-result-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}

.lcs-result-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--lcs-line);
  border-radius: 12px;
  background: #f9fbfa;
}

.lcs-result-grid article p {
  margin: 0 0 5px;
  color: var(--lcs-muted);
  font-size: 0.82rem;
}

.lcs-result-grid article strong {
  display: block;
  color: var(--lcs-green-dark);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lcs-result-grid article strong small {
  font-size: 0.68rem;
  font-weight: 500;
}

.lcs-result-grid .lcs-result-main {
  color: #fff;
  border-color: var(--lcs-green);
  background: var(--lcs-green);
}

.lcs-result-grid .lcs-result-main p,
.lcs-result-grid .lcs-result-main strong,
.lcs-result-grid .lcs-result-main small {
  color: #fff;
}

.lcs-result-grid .lcs-result-main strong {
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.lcs-result-grid .lcs-result-main small {
  display: block;
  margin-top: 5px;
  line-height: 1.45;
}

.lcs-ratio-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #f7f9f8;
}

.lcs-ratio-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 0.88rem;
}

.lcs-ratio-heading span {
  color: var(--lcs-muted);
}

.lcs-ratio-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e6e3;
}

.lcs-ratio-debt {
  background: #cf7a57;
}

.lcs-ratio-home {
  background: var(--lcs-green);
}

.lcs-ratio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: var(--lcs-muted);
  font-size: 0.78rem;
}

.lcs-ratio-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
}

.lcs-ratio-legend i.debt {
  background: #cf7a57;
}

.lcs-ratio-legend i.home {
  background: var(--lcs-green);
}

.lcs-reduction {
  margin: 16px 0 0;
  color: #63401f;
}

.lcs-inline-note {
  margin-top: 14px;
  padding: 12px 15px;
  border-left: 4px solid var(--lcs-gold);
  background: #fff8ed;
  font-size: 0.88rem;
}

.lcs-flat-reference {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #aebbb3;
  border-radius: 12px;
}

.lcs-flat-reference p {
  margin: 0;
  color: var(--lcs-muted);
  font-size: 0.8rem;
}

.lcs-flat-reference strong {
  color: var(--lcs-green-dark);
  font-size: 1.18rem;
}

.lcs-flat-reference .lcs-flat-note {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--lcs-line);
}

.lcs-result-caution {
  margin-top: 16px;
  padding: 14px 16px;
  color: #5a4228;
  border: 1px solid #e9d2a8;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 0.88rem;
}

.lcs-result-caution strong {
  display: block;
}

.lcs-notes {
  margin-top: 18px;
  padding: 15px 18px;
  color: var(--lcs-muted);
  border: 1px solid var(--lcs-line);
  border-radius: 12px;
  background: #fafbfa;
  font-size: 0.85rem;
}

.lcs-notes summary {
  color: var(--lcs-ink);
  cursor: pointer;
  font-weight: 700;
}

.lcs-notes ul {
  margin: 12px 0 0;
  padding-left: 1.3em;
}

.lcs-notes li + li {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .lcs-grid-2,
  .lcs-grid-3,
  .lcs-result-grid {
    grid-template-columns: 1fr;
  }

  .lcs-result-grid .lcs-result-main {
    order: -1;
  }
}

@media (max-width: 480px) {
  .lcs-widget {
    margin: 14px 0;
    font-size: 15px;
  }

  .lcs-hero {
    border-radius: 12px 12px 0 0;
  }

  .lcs-form {
    padding: 18px 14px 22px;
  }

  .lcs-input-unit span {
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .lcs-actions button {
    width: 100%;
  }

  .lcs-ratio-heading,
  .lcs-flat-reference {
    grid-template-columns: 1fr;
  }

  .lcs-ratio-heading {
    display: grid;
  }

  .lcs-flat-reference .lcs-flat-note {
    grid-column: auto;
  }
}
