/* =============================================================================
   Rental income tax calculator (/kiraye-vergisi) — JobHub-styled.
   Letting details on the left; the live monthly figures, annual roll-up and the
   income split on the right, with the regime comparison and the itemised
   monthly calculation below.

   NOTE: the hero chip / panel / block-row / explainer rules now repeat across
   six calculator stylesheets. A shared calculator stylesheet is overdue.
   ============================================================================= */

/* hero formula chip */
.kv-hero-formula {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 24px; padding: 10px 20px; background: rgba(151, 119, 250, 0.10); border-radius: 999px;
}
.kv-hero-formula span { color: var(--hb-muted); font-weight: 600; font-size: 14px; }
.kv-hero-formula code { font-family: "Montserrat", monospace; color: var(--hb-brand); font-weight: 600; font-size: 14.5px; }

/* ── Input panel ── */
.kv-panel { padding: 30px; }
.kv-panel-title {
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 20px;
  color: var(--hb-heading); margin-bottom: 24px;
}

.kv-field { margin-bottom: 22px; }
.kv-field[hidden] { display: none; }
.kv-label {
  display: block; font-weight: 600; font-size: 14px;
  color: var(--hb-heading); margin-bottom: 9px;
}
.kv-optional { font-weight: 400; font-size: 12px; color: var(--hb-muted); }
.kv-hint { font-size: 12px; line-height: 1.5; color: var(--hb-muted); margin: 6px 0 0; }

.kv-input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--hb-border); border-radius: 10px;
  background: var(--hb-surface); color: var(--hb-heading);
  font-family: "Open Sans", sans-serif; font-size: 15px; height: auto;
}
.kv-input:focus { outline: none; border-color: var(--hb-brand); box-shadow: 0 0 0 3px rgba(151, 119, 250, 0.15); }
.kv-input::placeholder { color: var(--hb-muted); }

/* landlord status */
.kv-landlords { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv-landlord-btn {
  padding: 14px; border: 1px solid var(--hb-border); border-radius: 12px;
  background: var(--hb-surface); text-align: left; cursor: pointer; transition: all 0.18s ease;
}
.kv-landlord-btn:hover { border-color: var(--hb-brand); }
.kv-landlord-btn.is-active {
  border-color: var(--hb-brand); background: rgba(151, 119, 250, 0.10);
  box-shadow: 0 0 0 2px rgba(151, 119, 250, 0.20);
}
.kv-landlord-icon { display: block; font-size: 22px; line-height: 1; margin-bottom: 7px; }
.kv-landlord-name {
  display: block; font-family: "Montserrat", sans-serif; font-size: 13.5px; font-weight: 600;
  color: var(--hb-heading); margin-bottom: 3px;
}
.kv-landlord-btn.is-active .kv-landlord-name { color: var(--hb-brand); }
.kv-landlord-desc { display: block; font-size: 11.5px; line-height: 1.45; color: var(--hb-muted); }

/* tax regime */
.kv-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv-method-btn {
  padding: 13px 12px; border: 1px solid var(--hb-border); border-radius: 12px;
  background: var(--hb-surface); text-align: left; cursor: pointer; transition: all 0.18s ease;
}
.kv-method-btn:hover { border-color: var(--hb-brand); }
.kv-method-btn.is-active {
  border-color: var(--hb-brand); background: rgba(151, 119, 250, 0.10);
  box-shadow: 0 0 0 2px rgba(151, 119, 250, 0.20);
}
.kv-method-name {
  display: block; font-family: "Montserrat", sans-serif; font-size: 14px; font-weight: 700;
  color: var(--hb-heading); margin-bottom: 3px;
}
.kv-method-btn.is-active .kv-method-name { color: var(--hb-brand); }
.kv-method-desc { display: block; font-size: 11.5px; line-height: 1.4; color: var(--hb-muted); }

/* rent presets */
.kv-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.kv-preset {
  padding: 6px 14px; border: 1px solid var(--hb-border); border-radius: 8px;
  background: var(--hb-surface); color: var(--hb-muted);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
}
.kv-preset:hover { border-color: var(--hb-brand); color: var(--hb-heading); }
.kv-preset.is-active { border-color: var(--hb-brand); background: rgba(151, 119, 250, 0.10); color: var(--hb-brand); }

.kv-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Result column ── */
.kv-result {
  position: sticky; top: 96px;
  padding: 24px; border-radius: 16px;
  background: var(--hb-card); border: 1px solid var(--hb-border);
}
.kv-result-placeholder { text-align: center; padding: 30px 10px; color: var(--hb-muted); }
.kv-result-icon { font-size: 44px; margin-bottom: 12px; }
.kv-result-placeholder p { font-size: 14px; line-height: 1.6; margin: 0; }

.kv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv-card { padding: 16px 14px; border-radius: 14px; text-align: center; }
.kv-card-plain { background: var(--hb-surface); border: 1px solid var(--hb-border); }
.kv-card-amber { background: rgba(245, 179, 1, 0.10); border: 1px solid rgba(245, 179, 1, 0.32); }
.kv-card-net { grid-column: 1 / -1; background: linear-gradient(135deg, #9777fa, #6d4bd3); color: #fff; }
.kv-card-label { font-size: 11.5px; line-height: 1.4; margin: 0 0 5px; color: var(--hb-muted); }
.kv-card-net .kv-card-label { color: rgba(255, 255, 255, 0.85); }
.kv-card-value {
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.15;
  margin: 0; color: var(--hb-heading); word-break: break-word;
}
.kv-card-amber .kv-card-value { color: #b47500; }
.kv-card-net .kv-card-value { color: #fff; font-size: 26px; }
:root[data-theme="dark"] .kv-card-amber .kv-card-value { color: #f5c451; }
.kv-card-unit { font-size: 10.5px; margin: 4px 0 0; color: var(--hb-muted); }
.kv-card-net .kv-card-unit { color: rgba(255, 255, 255, 0.8); }

/* annual roll-up */
.kv-annual {
  margin-top: 14px; padding: 15px; border-radius: 12px;
  background: rgba(81, 146, 255, 0.07); border: 1px solid rgba(81, 146, 255, 0.24);
}
.kv-annual-title {
  display: flex; align-items: center; gap: 7px; margin-bottom: 12px;
  font-family: "Montserrat", sans-serif; font-size: 13.5px; font-weight: 700; color: var(--hb-heading);
}
.kv-annual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv-annual-grid > div {
  padding: 10px 12px; border-radius: 10px; text-align: center;
  background: var(--hb-card); border: 1px solid var(--hb-border);
}
.kv-annual-label { display: block; font-size: 10.5px; line-height: 1.35; color: var(--hb-muted); margin-bottom: 4px; }
.kv-annual-grid strong {
  font-family: "Montserrat", sans-serif; font-size: 14px; color: var(--hb-heading);
}
.is-amber { color: #b47500 !important; }
:root[data-theme="dark"] .is-amber { color: #f5c451 !important; }
.is-brand { color: var(--hb-brand) !important; }

/* where the rent goes */
.kv-distribution {
  margin-top: 14px; padding: 15px; border-radius: 12px;
  background: var(--hb-surface); border: 1px solid var(--hb-border);
}
.kv-distribution-title { font-size: 11.5px; font-weight: 700; color: var(--hb-muted); margin-bottom: 10px; }
.kv-bar { display: flex; height: 20px; border-radius: 999px; overflow: hidden; background: var(--hb-border); }
.kv-bar-seg { height: 100%; transition: width 0.25s ease; }
.kv-bar-seg.is-net { background: var(--hb-brand); }
.kv-bar-seg.is-expenses { background: #9aa3b2; }
.kv-bar-seg.is-tax { background: #f5b301; }
.kv-bar-seg.is-vat { background: #ff9800; }
.kv-bar-seg.is-property { background: #ef9a9a; }

.kv-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 11px; }
.kv-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--hb-muted); }
.kv-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.kv-legend-dot.is-net { background: var(--hb-brand); }
.kv-legend-dot.is-expenses { background: #9aa3b2; }
.kv-legend-dot.is-tax { background: #f5b301; }

.kv-note {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 11px;
  background: rgba(81, 146, 255, 0.08); border: 1px solid rgba(81, 146, 255, 0.24);
  font-size: 11.5px; line-height: 1.65; color: var(--hb-text);
}
.kv-note strong { color: var(--hb-heading); }

/* ── Comparison / detail blocks ── */
.kv-block {
  height: 100%; overflow: hidden;
  border: 1px solid var(--hb-border); border-radius: 16px; background: var(--hb-card);
}
.kv-block-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--hb-surface); border-bottom: 1px solid var(--hb-border);
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 14.5px; color: var(--hb-heading);
}

/* regime comparison */
.kv-compare-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; transition: background 0.18s ease;
}
.kv-compare-row + .kv-compare-row { border-top: 1px solid var(--hb-border); }
.kv-compare-row.is-chosen { background: rgba(18, 183, 106, 0.09); }
.kv-compare-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--hb-heading); margin-bottom: 3px; }
.kv-compare-desc { display: block; font-size: 11.5px; color: var(--hb-muted); }
.kv-compare-amounts { text-align: right; flex-shrink: 0; }
/* Keep each figure on one line with its unit. */
.kv-compare-amounts strong {
  display: block; white-space: nowrap;
  font-family: "Montserrat", sans-serif; font-size: 13.5px; color: var(--hb-heading);
}
.kv-compare-amounts > span {
  display: block; white-space: nowrap;
  font-size: 11px; color: var(--hb-muted); margin-top: 2px;
}

.kv-verdict {
  display: flex; align-items: flex-start; gap: 8px; margin: 0;
  padding: 13px 16px; border-top: 1px solid var(--hb-border);
  background: rgba(18, 183, 106, 0.10);
  font-size: 13px; line-height: 1.5; font-weight: 600; color: #0a8f51;
}
:root[data-theme="dark"] .kv-verdict { color: #38d98a; }

/* detailed rows */
.kv-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 10px 16px; font-size: 13.5px; color: var(--hb-muted);
}
.kv-row + .kv-row { border-top: 1px solid var(--hb-border); }
.kv-row[hidden] { display: none; }
.kv-row-value { flex-shrink: 0; font-weight: 600; color: var(--hb-heading); white-space: nowrap; }
.kv-row-value.is-negative { color: #d32f2f; }
:root[data-theme="dark"] .kv-row-value.is-negative { color: #ff8a85; }
.kv-row.is-total { background: rgba(245, 179, 1, 0.10); color: #b47500; font-weight: 700; }
.kv-row.is-total .kv-row-value { color: #b47500; font-weight: 700; }
.kv-row.is-net { background: rgba(151, 119, 250, 0.12); color: var(--hb-brand); font-weight: 700; }
.kv-row.is-net .kv-row-value { color: var(--hb-brand); font-weight: 700; }
:root[data-theme="dark"] .kv-row.is-total,
:root[data-theme="dark"] .kv-row.is-total .kv-row-value { color: #f5c451; }

.kv-section-head {
  padding: 9px 16px; background: var(--hb-surface);
  border-top: 1px solid var(--hb-border); border-bottom: 1px solid var(--hb-border);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--hb-muted);
}

/* ── Explainer ── */
.kv-explain-card {
  height: 100%; padding: 22px 24px; border-radius: 16px;
  background: var(--hb-card); border: 1px solid var(--hb-border);
}
.kv-explain-lead { font-weight: 700; font-size: 14px; color: var(--hb-heading); margin-bottom: 12px; }
/* JobHub resets `ol, ul { list-style: none }` globally. */
.kv-explain-list { margin: 0; padding-left: 20px; list-style: disc outside; }
.kv-explain-list li { font-size: 13px; line-height: 1.65; color: var(--hb-text); margin-bottom: 8px; }
.kv-explain-list li:last-child { margin-bottom: 0; }
.kv-explain-list li::marker { color: var(--hb-brand); }

.kv-which {
  max-width: 780px; margin: 24px auto 0; padding: 20px 24px; border-radius: 16px;
  background: rgba(18, 183, 106, 0.07); border: 1px solid rgba(18, 183, 106, 0.24);
}

.kv-disclaimer {
  max-width: 760px; margin: 24px auto 0; text-align: center;
  font-size: 12.5px; line-height: 1.7; color: var(--hb-muted);
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .kv-result { position: static; }
  .kv-annual-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .kv-panel { padding: 24px 18px; }
  .kv-landlords, .kv-methods, .kv-cards { grid-template-columns: 1fr; }
  .kv-annual-grid { grid-template-columns: 1fr 1fr; }
  .kv-compare-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kv-compare-amounts { text-align: left; }
}
