.rb-hero { position: relative; overflow: hidden; padding-top: 42px; }
.rb-hero::before,
.rb-hero::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 22px 22px 5px 5px; pointer-events: none; }
.rb-hero::before { width: 110px; height: 78px; left: max(3vw, 24px); bottom: -34px; transform: rotate(-7deg); }
.rb-hero::after { width: 150px; height: 104px; right: max(2vw, 18px); bottom: -45px; transform: rotate(8deg); }
.rb-hero__badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(232,101,10,.42); background: rgba(232,101,10,.14); color: #ffad72; font-size: 11px; font-weight: 600; }
.rb-hero__badge > span { color: var(--c-accent); font-size: 9px; }
.rb-hero__badge b { font: inherit; }
.rb-hero__badge small { padding-left: 7px; border-left: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.62); font-size: 9px; font-weight: 500; }

.rb-app { max-width: 1280px; }
.rb-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; align-items: stretch; }
.rb-controls,
.rb-results,
.rb-scenarios,
.rb-chart-panel { position: relative; border-color: #d9dee5; box-shadow: 0 8px 28px rgba(30,43,60,.07); }
.rb-controls,
.rb-results { padding: 22px; border-radius: 16px; }
.rb-controls .panel__title,
.rb-results .panel__title { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--c-border); color: var(--c-navy); }
.rb-controls .panel__title svg,
.rb-results .panel__title svg { color: var(--c-accent); }

.rb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rb-field--wide { grid-column: 1 / -1; }
.rb-controls .field { min-width: 0; }
.rb-controls .field > label { display: block; margin-bottom: 7px; color: #455164; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.rb-controls .field-hint { margin-top: 6px; color: var(--c-muted); font-size: 11px; line-height: 1.45; }

.rb-stepper { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; min-height: 48px; border: 1px solid #d6dde6; border-radius: 11px; overflow: hidden; background: #f8fafc; transition: border-color .18s ease, box-shadow .18s ease; }
.rb-stepper:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(232,101,10,.11); }
.rb-stepper > button { border: 0; background: #fff; color: var(--c-navy); font-size: 21px; transition: background .18s ease, color .18s ease; }
.rb-stepper > button:first-child { border-right: 1px solid #e2e6eb; }
.rb-stepper > button:last-child { border-left: 1px solid #e2e6eb; }
.rb-stepper > button:hover:not(:disabled) { background: #fff4ec; color: var(--c-accent); }
.rb-stepper > button:disabled { color: #c2c7cf; cursor: not-allowed; }
.rb-input-wrap { display: flex; align-items: center; min-width: 0; background: #f8fafc; }
.rb-input-wrap .inp { width: 100%; min-width: 0; height: 46px; padding: 0 6px 0 12px; border: 0; outline: none; background: transparent; color: var(--c-navy); font-size: 17px; font-weight: 600; }
.rb-input-wrap span { flex: 0 0 auto; padding-right: 10px; color: #7a8492; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rb-input-wrap input[type=number] { appearance: textfield; }
.rb-input-wrap input[type=number]::-webkit-inner-spin-button,
.rb-input-wrap input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
.rb-input-wrap--solo { min-height: 44px; border: 1px solid #d6dde6; border-radius: 9px; overflow: hidden; }
.rb-input-wrap--solo:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(232,101,10,.1); }
.rb-input-wrap--solo .inp { height: 43px; font-size: 15px; }

.rb-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.rb-quick button { border: 1px solid #dbe0e7; border-radius: 7px; background: #fff; padding: 4px 8px; color: #677284; font-size: 10px; font-weight: 600; }
.rb-quick button:hover,
.rb-quick button.active { border-color: var(--c-accent); background: #fff4ec; color: var(--c-accent); }

.rb-advanced-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 12px 14px; border: 1px solid #dbe0e7; border-radius: 11px; background: #f8fafc; color: var(--c-navy); text-align: left; }
.rb-advanced-toggle span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.rb-advanced-toggle b { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; background: rgba(232,101,10,.1); color: var(--c-accent); transition: transform .2s ease; }
.rb-advanced-toggle small { color: var(--c-muted); font-size: 10px; font-weight: 400; }
.rb-advanced-toggle[aria-expanded=true] b { transform: rotate(45deg); }
.rb-advanced { padding-top: 14px; }
.rb-advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; border: 1px solid #e1e5ea; border-radius: 12px; background: #fbfcfd; }

.rb-source-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px 13px; border-radius: 10px; background: #f3f6f9; color: #566174; font-size: 11px; line-height: 1.55; }
.rb-source-note > div { display: flex; flex: 0 0 22px; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--c-navy); color: #fff; font-size: 11px; font-weight: 700; }
.rb-source-note strong { color: var(--c-navy); }
.rb-external-link { display: inline-flex; margin-top: 8px; color: var(--c-accent); font-size: 11px; font-weight: 600; }
.rb-external-link:hover { text-decoration: underline; }
.rb-controls .field-error { min-height: 18px; margin-top: 8px; color: var(--c-red); font-size: 11px; font-weight: 600; }
.rb-stepper--error,
.rb-input-wrap--error { border-color: var(--c-red) !important; box-shadow: 0 0 0 3px rgba(217,48,37,.08) !important; }

.rb-results { min-height: 100%; overflow: hidden; }
.rb-results__content { transition: filter .2s ease, opacity .2s ease; }
.rb-results--blocked .rb-results__content { filter: blur(6px); opacity: .32; pointer-events: none; user-select: none; }
.rb-verdict { position: relative; overflow: hidden; padding: 22px 20px 20px 86px; border-radius: 14px; background: linear-gradient(135deg, var(--c-navy), #314b68); color: #fff; min-height: 112px; }
.rb-verdict::after { content: ''; position: absolute; width: 150px; height: 150px; right: -54px; bottom: -75px; border: 20px solid rgba(255,255,255,.05); border-radius: 50%; }
.rb-verdict--rent { background: linear-gradient(135deg, #5f4a24, #95713b); }
.rb-verdict--even { background: linear-gradient(135deg, #445063, #68768a); }
.rb-verdict__icon { position: absolute; left: 20px; top: 24px; display: flex; width: 50px; height: 50px; align-items: center; justify-content: center; border-radius: 13px; background: rgba(255,255,255,.12); font-size: 27px; }
.rb-verdict > span { display: block; color: rgba(255,255,255,.58); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.rb-verdict > strong { display: block; max-width: 430px; margin-top: 4px; font-size: clamp(17px, 2.5vw, 22px); line-height: 1.25; }
.rb-verdict > p { margin-top: 5px; color: #ffb680; font-size: 13px; font-weight: 600; }
.rb-verdict--rent > p { color: #ffe0a6; }

.rb-position-bars { display: grid; gap: 14px; margin-top: 20px; }
.rb-position-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rb-position-row span { color: #5b6677; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rb-position-row strong { color: var(--c-navy); font-size: 18px; }
.rb-position-track { height: 9px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #edf0f3; }
.rb-position-track i { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .5s ease; }
.rb-position-row--buy i { background: linear-gradient(90deg, var(--c-accent), #ff9c57); }
.rb-position-row--rent i { background: linear-gradient(90deg, #556d8b, #8fa4bc); }
.rb-position-row small { display: block; margin-top: 5px; color: #8992a0; font-size: 10px; }

.rb-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 20px; }
.rb-stat-grid article { min-width: 0; padding: 12px; border: 1px solid #e1e5e9; border-radius: 10px; background: #fafbfc; }
.rb-stat-grid span { display: block; min-height: 28px; color: #6a7483; font-size: 10px; font-weight: 700; line-height: 1.35; text-transform: uppercase; }
.rb-stat-grid strong { display: block; overflow: hidden; margin-top: 3px; color: var(--c-navy); font-size: clamp(15px, 2vw, 19px); text-overflow: ellipsis; white-space: nowrap; }
.rb-stat-grid small { display: block; margin-top: 2px; color: #98a0aa; font-size: 9px; line-height: 1.3; }

.rb-real-value { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 13px 14px; border: 1px solid #dce2e8; border-radius: 10px; background: #f5f7f9; }
.rb-real-value > div:first-child span { display: block; color: var(--c-navy); font-size: 11px; font-weight: 700; }
.rb-real-value > div:first-child small { color: var(--c-muted); font-size: 9px; }
.rb-real-value > div:last-child { display: flex; gap: 16px; text-align: right; }
.rb-real-value p { color: #707a88; font-size: 9px; text-transform: uppercase; }
.rb-real-value p strong { display: block; margin-top: 1px; color: var(--c-navy); font-size: 13px; text-transform: none; }
.rb-break-even { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border-left: 3px solid var(--c-accent); border-radius: 7px; background: #fff6ef; }
.rb-break-even > span { color: var(--c-accent); font-size: 18px; }
.rb-break-even small { display: block; color: #9b6847; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.rb-break-even strong { color: var(--c-navy); font-size: 12px; }
.rb-summary { margin-top: 12px; color: #596476; font-size: 11px; line-height: 1.55; }
.rb-actions { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.rb-copy-btn { border: 0; border-radius: 8px; background: var(--c-accent); padding: 9px 14px; color: #fff; font-size: 11px; font-weight: 700; transition: background .18s ease, transform .18s ease; }
.rb-copy-btn:hover { background: var(--c-accent-h); transform: translateY(-1px); }
.rb-actions span { color: var(--c-green); font-size: 10px; font-weight: 600; }

.rb-result-error { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(255,255,255,.42); }
.rb-result-error[hidden] { display: none; }
.rb-result-error__card { width: min(360px, 100%); padding: 22px; border: 1px solid #f0cbc7; border-radius: 13px; background: #fff; box-shadow: 0 14px 40px rgba(30,43,60,.18); text-align: center; }
.rb-result-error__card > span { display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; margin: 0 auto 10px; border-radius: 50%; background: #fff0ee; color: var(--c-red); font-size: 20px; font-weight: 800; }
.rb-result-error__card strong { display: block; color: var(--c-navy); font-size: 15px; }
.rb-result-error__card p { margin-top: 5px; color: var(--c-muted); font-size: 11px; line-height: 1.5; }

.rb-scenarios,
.rb-chart-panel { padding: 20px 22px; border-radius: 14px; }
.rb-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.rb-section-heading h2 { color: var(--c-navy); font-size: 17px; }
.rb-section-heading p { margin-top: 3px; color: var(--c-muted); font-size: 11px; }
.rb-scenario-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rb-scenario-buttons button { min-height: 40px; border: 1px solid #dce1e7; border-radius: 9px; background: #fafbfc; color: #596576; font-size: 11px; font-weight: 700; }
.rb-scenario-buttons button:hover,
.rb-scenario-buttons button.active { border-color: var(--c-accent); background: #fff4ec; color: var(--c-accent); }

.rb-chart-legend { display: flex; gap: 14px; padding-top: 3px; color: #667183; font-size: 10px; font-weight: 600; white-space: nowrap; }
.rb-chart-legend span { display: flex; align-items: center; gap: 5px; }
.rb-chart-legend i { width: 18px; height: 3px; border-radius: 3px; }
.rb-chart-legend .buy { background: var(--c-accent); }
.rb-chart-legend .rent { background: #647d9b; }
.rb-chart-wrap { width: 100%; overflow-x: auto; }
.rb-chart-wrap svg { width: 100%; min-width: 620px; height: auto; overflow: visible; }
.rb-chart-grid { stroke: #e6e9ed; stroke-width: 1; }
.rb-chart-axis-label { fill: #8a93a0; font-family: var(--font-main); font-size: 10px; }
.rb-chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1200; animation: rb-draw .9s ease both; }
.rb-chart-line--buy { stroke: var(--c-accent); }
.rb-chart-line--rent { stroke: #647d9b; }
.rb-chart-dot--buy { fill: var(--c-accent); }
.rb-chart-dot--rent { fill: #647d9b; }
.rb-chart-area--buy { fill: url(#buyArea); opacity: .11; }
@keyframes rb-draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }

.rb-formula-note { display: flex; gap: 13px; align-items: flex-start; padding: 16px 18px; border: 1px solid #dce1e7; border-radius: 12px; background: #fff; color: #5d6878; font-size: 11px; line-height: 1.6; }
.rb-formula-note > div { display: flex; flex: 0 0 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--c-navy); color: #fff; font-size: 12px; font-weight: 700; }
.rb-formula-note strong { color: var(--c-navy); }

.rb-seo-section,
.rb-assumptions-section,
.rb-market-section,
.rb-related { max-width: 1280px; }
.rb-seo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.rb-seo-grid article { padding: 20px; border: 1px solid var(--c-border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.rb-seo-grid article > span { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; margin-bottom: 12px; border-radius: 10px; background: #fff4ec; font-size: 21px; }
.rb-seo-grid h3 { color: var(--c-navy); font-size: 14px; }
.rb-seo-grid p { margin-top: 7px; color: var(--c-muted); font-size: 12px; line-height: 1.65; }

.rb-assumptions-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--c-border); border-radius: 12px; background: #fff; }
.rb-assumptions-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 12px; }
.rb-assumptions-table th,
.rb-assumptions-table td { padding: 12px 14px; border-bottom: 1px solid #e9e8e4; text-align: left; vertical-align: top; }
.rb-assumptions-table thead th { background: var(--c-navy); color: #fff; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.rb-assumptions-table tbody th { width: 22%; color: var(--c-navy); font-weight: 700; }
.rb-assumptions-table td { color: #626c7a; }
.rb-assumptions-table tr:last-child th,
.rb-assumptions-table tr:last-child td { border-bottom: 0; }
.rb-disclaimer { margin-top: 12px; padding: 13px 15px; border-radius: 9px; background: #fff7e8; color: #705c35; font-size: 11px; line-height: 1.6; }

.rb-market-card { display: grid; grid-template-columns: 46px 1fr; gap: 16px; padding: 22px; border-radius: 14px; background: var(--c-navy); color: #fff; }
.rb-market-card > div:first-child { display: flex; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: 11px; background: rgba(232,101,10,.18); color: var(--c-accent); font-size: 20px; font-weight: 800; }
.rb-market-card h2 { color: #fff; font-size: 18px; }
.rb-market-card p { margin-top: 8px; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.65; }
.rb-market-card p strong { color: #fff; }
.rb-source-line a { color: #ffaf78; text-decoration: underline; text-underline-offset: 2px; }
.rb-faq { max-width: 1280px; }

.rb-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.rb-related-grid > a { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--c-border); border-radius: 11px; background: #fff; transition: transform .18s ease, border-color .18s ease; }
.rb-related-grid > a:hover { transform: translateY(-2px); border-color: var(--c-accent); }
.rb-related-grid > a > span { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 9px; background: #fff4ec; font-size: 20px; }
.rb-related-grid strong { color: var(--c-navy); font-size: 13px; }
.rb-related-grid p { margin-top: 3px; color: var(--c-muted); font-size: 11px; }
.rb-related-grid b { color: var(--c-accent); }

@media (max-width: 900px) {
  .rb-layout { grid-template-columns: 1fr; }
  .rb-results { min-height: 720px; }
  .rb-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .rb-seo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .rb-hero { padding: 32px 16px 28px; }
  .rb-hero__badge { max-width: 100%; flex-wrap: wrap; justify-content: center; font-size: 10px; }
  .rb-app { padding-left: 10px; padding-right: 10px; }
  .rb-controls,
  .rb-results,
  .rb-scenarios,
  .rb-chart-panel { padding: 17px 14px; border-radius: 12px; }
  .rb-fields { grid-template-columns: 1fr; gap: 14px; }
  .rb-field--wide { grid-column: auto; }
  .rb-advanced-toggle { align-items: flex-start; flex-direction: column; }
  .rb-advanced-grid { grid-template-columns: 1fr; }
  .rb-verdict { padding: 18px 15px 18px 72px; min-height: 106px; }
  .rb-verdict__icon { left: 14px; top: 20px; width: 44px; height: 44px; font-size: 23px; }
  .rb-stat-grid { grid-template-columns: 1fr 1fr; }
  .rb-real-value { align-items: flex-start; flex-direction: column; }
  .rb-real-value > div:last-child { width: 100%; justify-content: space-between; text-align: left; }
  .rb-scenario-buttons { grid-template-columns: 1fr 1fr; }
  .rb-section-heading { flex-direction: column; }
  .rb-chart-legend { padding-top: 0; }
  .rb-related-grid { grid-template-columns: 1fr; }
  .rb-market-card { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .rb-stepper { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .rb-input-wrap .inp { font-size: 15px; }
  .rb-stat-grid { gap: 7px; }
  .rb-stat-grid article { padding: 10px; }
  .rb-position-row strong { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .rb-chart-line { animation: none; }
  .rb-position-track i { transition: none; }
}
