/* ROI & Break-Even Calculator (prefix rbe-). Two tabs: ROI (one or two scenarios) and Break-even
   (contribution margin, break-even point, margin of safety, SVG cost/revenue chart). */
.rbe-card { padding: 28px; }
.rbe-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.rbe-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }

.rbe-topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.rbe-tabs { display: flex; border: 1px solid #e5e7eb; border-radius: 30px; padding: 4px; background: #f7f8fa; }
.rbe-tab { border: none; background: none; padding: 9px 22px; border-radius: 26px; font-weight: 700; font-size: .92em; color: #6b7280; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .2s ease, color .2s ease; }
.rbe-tab.active { background: var(--site-dark); color: #fff; }
.rbe-tab:hover:not(.active) { color: var(--site-dark); }
.rbe-topline-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rbe-currency { display: flex; align-items: center; gap: 8px; font-size: .85em; font-weight: 700; color: #23272f; }
.rbe-currency select { border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; font-size: .95em; background: #fff; color: #23272f; outline: none; }
.rbe-currency select:focus { border-color: var(--site-dark); }
.rbe-sample { font: inherit; font-size: .85em; font-weight: 700; color: var(--site-dark); background: #fff; border: 1px dashed var(--site-dark); border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.rbe-sample:hover { background: var(--site-dark); color: #fff; border-style: solid; }

.rbe-scenarios { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.rbe-scenarios.rbe-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rbe-scenario { border: 1px solid #eee; border-radius: 12px; padding: 16px; background: #fafbfc; }
.rbe-scenario-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rbe-scenario-head .rbe-badge { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--site-dark); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .9em; }
.rbe-scenario-head input { flex: 1; min-width: 0; border: none; border-bottom: 1px dashed #cbd5e1; background: none; font: inherit; font-weight: 700; font-size: 1em; color: #23272f; padding: 4px 2px; outline: none; }
.rbe-scenario-head input:focus { border-bottom-color: var(--site-dark); }
.rbe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rbe-grid.rbe-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rbe-field label, .rbe-field .rbe-label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .9em; color: #23272f; }
.rbe-input-row { display: flex; align-items: center; gap: 8px; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; background: #fff; }
.rbe-input-row:focus-within { border-color: var(--site-dark); }
.rbe-prefix { font-weight: 700; color: var(--site-dark); flex: none; }
.rbe-suffix { font-size: .8em; color: #6b7280; flex: none; white-space: nowrap; }
.rbe-input-row input { border: none; outline: none; width: 100%; min-width: 0; font-size: 1em; background: none; color: #23272f; font-variant-numeric: tabular-nums; }
.rbe-input-row select { border: none; outline: none; background: #f7f8fa; border-radius: 6px; padding: 4px 6px; font-size: .85em; font-weight: 700; color: var(--site-dark); flex: none; cursor: pointer; }
.rbe-field.rbe-bad .rbe-input-row { border-color: #b91c1c; background: #fef2f2; }
.rbe-field small { display: block; color: #6b7280; font-size: .8em; margin-top: 6px; }
.rbe-check { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 4px; font-weight: 700; font-size: .9em; color: #23272f; cursor: pointer; }
.rbe-check input { width: 16px; height: 16px; accent-color: var(--site-dark); }
.rbe-msg { margin: 10px 0 0; font-size: .86em; color: #b91c1c; font-weight: 600; }

.rbe-verdict { border-radius: 10px; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; background: #eef0f3; border: 1px solid #e3e6ea; margin: 18px 0 16px; }
.rbe-verdict.rbe-gain { background: #f0fdf4; border-color: #bbf7d0; }
.rbe-verdict.rbe-loss { background: #fef2f2; border-color: #fecaca; }
.rbe-verdict.rbe-wait { grid-template-columns: 1fr; }
.rbe-chip { display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-radius: 99px; padding: 4px 12px; background: #d1d5db; color: #374151; grid-column: 1 / -1; justify-self: start; }
.rbe-gain .rbe-chip { background: #15803d; color: #fff; }
.rbe-loss .rbe-chip { background: #b91c1c; color: #fff; }
.rbe-headline { font-size: 2.1em; font-weight: 800; line-height: 1.05; color: #23272f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rbe-headline small { display: block; font-size: .45em; font-weight: 700; color: #6b7280; margin-top: 4px; letter-spacing: .02em; }
.rbe-gain .rbe-headline { color: #15803d; }
.rbe-loss .rbe-headline { color: #b91c1c; }
.rbe-verdict-text { margin: 0; font-size: .95em; color: #23272f; }
.rbe-verdict-text + .rbe-verdict-text { margin-top: 6px; color: #4b5563; font-size: .9em; }

.rbe-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rbe-tile { background: #fafbfc; border: 1px solid #eee; border-radius: 10px; padding: 14px 16px; min-width: 0; }
.rbe-tile-k { font-size: .78em; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.rbe-tile-v { font-size: 1.25em; font-weight: 800; color: var(--site-dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rbe-tile-sub { font-size: .65em; font-weight: 700; color: #6b7280; }
.rbe-tile.rbe-neg .rbe-tile-v { color: #b91c1c; }
.rbe-tile-s { font-size: .8em; color: #6b7280; margin-top: 4px; }

.rbe-section { margin-top: 22px; }
.rbe-section h3 { font-size: 1em; font-weight: 700; color: #23272f; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.rbe-section h3 i { color: var(--site-accent); }
.rbe-formulas { list-style: none; margin: 0; padding: 0; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.rbe-formulas li { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #eee; font-size: .9em; background: #fff; }
.rbe-formulas li:last-child { border-bottom: none; }
.rbe-formulas li:nth-child(even) { background: #fafbfc; }
.rbe-f-k { font-weight: 700; color: #6b7280; }
.rbe-f-v { color: #23272f; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rbe-f-v strong { color: var(--site-dark); }
.rbe-f-v sup { font-size: .7em; }

.rbe-table-wrap { overflow-x: auto; border: 1px solid #eee; border-radius: 10px; }
.rbe-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.rbe-table th { text-align: left; font-size: .78em; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 2px solid #e5e7eb; }
.rbe-table th:not(:first-child), .rbe-table td:not(:first-child) { text-align: right; }
.rbe-table td { padding: 9px 10px; border-bottom: 1px solid #eee; color: #23272f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rbe-table tr:last-child td { border-bottom: none; }
.rbe-table td.rbe-win { font-weight: 800; color: #15803d; }
.rbe-table td.rbe-win i { font-size: .85em; margin-left: 4px; }
.rbe-note { margin: 10px 0 0; font-size: .88em; color: #4b5563; }

.rbe-chart-wrap { margin-top: 22px; }
.rbe-svg { width: 100%; height: auto; display: block; background: #fff; border: 1px solid #eee; border-radius: 10px; }
.rbe-grid { stroke: #eef0f3; stroke-width: 1; }
.rbe-axis-line { stroke: #cbd5e1; stroke-width: 1.5; }
.rbe-axis { font-size: 11px; fill: #6b7280; font-family: inherit; }
.rbe-axis-title { font-weight: 700; }
.rbe-line-rev { stroke: #15803d; stroke-width: 3; stroke-linecap: round; }
.rbe-line-cost { stroke: #b45309; stroke-width: 3; stroke-linecap: round; }
.rbe-line-fixed { stroke: #9ca3af; stroke-width: 1.5; stroke-dasharray: 6 5; }
.rbe-line-now { stroke: #1d4ed8; stroke-width: 1.5; stroke-dasharray: 4 4; }
.rbe-now-label { fill: #1d4ed8; font-weight: 700; }
.rbe-line-be { stroke: #23272f; stroke-width: 1; stroke-dasharray: 3 3; }
.rbe-be-dot { fill: #fff; stroke: #23272f; stroke-width: 3; }
.rbe-be-label { font-size: 12px; font-weight: 800; fill: #23272f; font-family: inherit; }
.rbe-area-loss { fill: #fecaca; opacity: .45; }
.rbe-area-profit { fill: #bbf7d0; opacity: .45; }
.rbe-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: .82em; color: #4b5563; }
.rbe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rbe-legend i { display: inline-block; width: 22px; height: 0; border-top: 3px solid #15803d; border-radius: 2px; }
.rbe-legend i.rbe-l-cost { border-top-color: #b45309; }
.rbe-legend i.rbe-l-fixed { border-top: 2px dashed #9ca3af; }
.rbe-legend i.rbe-l-now { border-top: 2px dashed #1d4ed8; }
.rbe-legend b { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: #bbf7d0; }
.rbe-legend b.rbe-l-loss { background: #fecaca; }

.rbe-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.rbe-copy { font: inherit; font-size: .9em; font-weight: 700; color: #fff; background: var(--site-dark); border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .2s ease; }
.rbe-copy:hover { background: var(--site-dark-2); }
.rbe-copy.rbe-copied { background: #15803d; }
.rbe-privacy { margin: 14px 0 0; font-size: .8em; color: #6b7280; display: flex; align-items: center; gap: 6px; }

@media (max-width: 900px) {
    .rbe-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rbe-grid.rbe-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rbe-scenarios.rbe-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .rbe-card { padding: 18px; }
    .rbe-title-bar { margin: -18px -18px 18px; }
    .rbe-grid, .rbe-grid.rbe-grid-3, .rbe-tiles { grid-template-columns: minmax(0, 1fr); }
    .rbe-verdict { grid-template-columns: 1fr; }
    .rbe-headline { font-size: 1.7em; white-space: normal; }
    .rbe-tabs { width: 100%; }
    .rbe-tab { flex: 1; justify-content: center; }
    .rbe-topline-right { width: 100%; }
    .rbe-currency { flex: 1; }
    .rbe-currency select { flex: 1; min-width: 0; }
    .rbe-sample { width: 100%; }
    .rbe-formulas li { grid-template-columns: 1fr; gap: 2px; }
    .rbe-svg { border-radius: 6px; }
}
