/* ============================================================
   FinToolbox — Rental Property Calculator (tool-specific)
   Global/shared styles (.card .fld .input .bk .btn .tag .aff …)
   live in /css/styles.css.
   ============================================================ */

/* The hidden attribute must beat the display:flex of .fld / .prop-grp / .bk that
   appears on the conditional reveal targets (loan fields, sell-price, deprec row…). */
.prop-form [hidden],
#p-results [hidden] { display: none !important; }

/* ---------- Form layout ---------- */
.prop-form { display: flex; flex-direction: column; gap: 16px; }

/* Conditional reveal containers should still stack their inputs nicely. */
.prop-grp { display: flex; flex-direction: column; gap: 14px; }

/* Paired field row: value on the left, escalator (%) on the right. */
.fld-pair {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .fld-pair { grid-template-columns: 1fr; }
}

.prop-disclaimer {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* Subtle highlight for the optional Annual Depreciation field — it's easy to
   miss in a long opex form and the tax caveat matters. Thin yellow left
   border + lifted background + yellow-tinted helper note. */
.prop-deprec {
  position: relative;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid var(--yellow);
  background: var(--card-hi);
  border-radius: 0 8px 8px 0;
}
.prop-deprec > label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prop-deprec-tag {
  font-size: 10px !important;
  padding: 1px 7px !important;
  background: color-mix(in srgb, var(--yellow) 18%, transparent);
  color: var(--yellow);
  border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent);
}
.prop-deprec-note {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--yellow);
}

/* ---------- Results layout ---------- */
.prop-h2 {
  margin: 22px 0 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Summary cards grid: 3 cols desktop, 2 cols tablet, 1 col mobile. */
.prop-sum {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .prop-sum { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .prop-sum { grid-template-columns: 1fr; } }

.prop-stat {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prop-stat .l {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 600;
}
.prop-stat .v {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.prop-stat .v.lg { font-size: 22px; }
.prop-stat .v.green { color: var(--green); }
.prop-stat .v.red { color: var(--red); }

/* ---------- Chart ---------- */
.prop-chart { width: 100%; min-height: 240px; }
.prop-chart svg { display: block; width: 100%; height: auto; }

/* ---------- Year-by-Year table ---------- */
.prop-proj-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prop-proj {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 720px; /* forces horizontal scroll on mobile */
}
.prop-proj th,
.prop-proj td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.prop-proj th:first-child,
.prop-proj td:first-child { text-align: left; }
.prop-proj th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--card-hi);
  position: sticky;
  top: 0;
}
.prop-proj td { font-family: var(--mono); color: var(--text-2); }
.prop-proj tbody tr:hover td { background: var(--card-hi); }
.prop-proj td.green { color: var(--green); }
.prop-proj td.red { color: var(--red); }

/* ---------- Bottom-of-funnel CTA card ---------- */
.prop-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--green) 7%, var(--card)) 0%, var(--card) 80%);
}
.prop-cta > div { flex: 1; min-width: 0; }
.prop-cta h3 { font-size: 16px; font-weight: 700; }
.prop-cta .btn { flex-shrink: 0; }

@media (max-width: 600px) {
  .prop-cta { flex-direction: column; align-items: stretch; }
  .prop-cta .btn { width: 100%; text-align: center; }
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 720px) {
  .prop-h2 { margin: 18px 0 10px; font-size: 15px; }
  .prop-stat { padding: 12px 14px; }
  .prop-stat .v.lg { font-size: 19px; }
}
