.rppc-app {
  --rppc-bg: #f6f8fb;
  --rppc-card: #ffffff;
  --rppc-text: #111827;
  --rppc-muted: #64748b;
  --rppc-border: #e2e8f0;
  --rppc-primary: #0f172a;
  --rppc-accent: #f97316;
  --rppc-accent-dark: #ea580c;
  --rppc-soft: #fff7ed;
  --rppc-success: #166534;
  --rppc-success-soft: #f0fdf4;
  --rppc-danger: #b91c1c;
  --rppc-danger-soft: #fef2f2;
  color: var(--rppc-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.rppc-app *, .rppc-app *::before, .rppc-app *::after { box-sizing: border-box; }
.rppc-app input, .rppc-app select, .rppc-app button { font: inherit; }
.rppc-app button { cursor: pointer; }

.rppc-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
  background: var(--rppc-bg);
  border-radius: 28px;
}

.rppc-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 4px 28px;
}

.rppc-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--rppc-accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rppc-header h2 { margin: 0; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; color: var(--rppc-primary); }
.rppc-header p { max-width: 720px; margin: 12px 0 0; color: var(--rppc-muted); font-size: 16px; }
.rppc-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

.rppc-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .75fr); gap: 24px; align-items: start; }
.rppc-form { display: grid; gap: 18px; }
.rppc-card, .rppc-results-empty, .rppc-results { background: var(--rppc-card); border: 1px solid var(--rppc-border); border-radius: 22px; box-shadow: 0 8px 30px rgba(15, 23, 42, .045); }
.rppc-card { padding: 24px; }

.rppc-section-heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 20px; }
.rppc-step { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: var(--rppc-soft); color: var(--rppc-accent-dark); font-weight: 800; }
.rppc-section-heading h3 { margin: 1px 0 2px; font-size: 18px; color: var(--rppc-primary); }
.rppc-section-heading p { margin: 0; color: var(--rppc-muted); font-size: 13px; }

.rppc-fields { display: grid; gap: 16px; }
.rppc-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rppc-field-wide { grid-column: 1 / -1; }
.rppc-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rppc-field > span { color: #334155; font-size: 13px; font-weight: 700; }
.rppc-field > span small { color: #94a3b8; font-weight: 500; }
.rppc-field > small, .rppc-switch small { color: #94a3b8; font-size: 11.5px; line-height: 1.35; }

.rppc-field input, .rppc-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--rppc-text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rppc-field input:focus, .rppc-field select:focus { border-color: var(--rppc-accent); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
.rppc-field input::placeholder { color: #94a3b8; }

.rppc-switch { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.rppc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rppc-switch-ui { position: relative; width: 44px; height: 25px; border-radius: 99px; background: #cbd5e1; transition: background .15s ease; }
.rppc-switch-ui::after { content: ""; position: absolute; width: 19px; height: 19px; top: 3px; left: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .15s ease; }
.rppc-switch input:checked + .rppc-switch-ui { background: var(--rppc-accent); }
.rppc-switch input:checked + .rppc-switch-ui::after { transform: translateX(19px); }
.rppc-switch > span:last-child { display: flex; flex-direction: column; gap: 2px; color: #334155; font-size: 13px; }

.rppc-target-card { border-color: #fed7aa; }
.rppc-target-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.rppc-target-options label { position: relative; cursor: pointer; }
.rppc-target-options input { position: absolute; opacity: 0; }
.rppc-target-options span { display: grid; place-items: center; min-height: 46px; padding: 8px 10px; border: 1px solid var(--rppc-border); border-radius: 12px; background: #fff; color: #475569; font-size: 12.5px; font-weight: 700; text-align: center; transition: .15s ease; }
.rppc-target-options input:checked + span { border-color: var(--rppc-accent); background: var(--rppc-soft); color: #9a3412; box-shadow: 0 0 0 2px rgba(249,115,22,.08); }
.rppc-target-value { max-width: 420px; }
.rppc-input-affix { display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 50px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; overflow: hidden; }
.rppc-input-affix:focus-within { border-color: var(--rppc-accent); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
.rppc-input-affix > span { padding: 0 12px; color: #64748b; font-weight: 800; }
.rppc-input-affix input { min-height: 48px; border: 0; border-radius: 0; box-shadow: none !important; padding-left: 0; padding-right: 0; }

.rppc-btn { min-height: 44px; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; transition: transform .1s ease, background .15s ease, border-color .15s ease; }
.rppc-btn:active { transform: translateY(1px); }
.rppc-btn-primary { background: var(--rppc-accent); color: #fff; }
.rppc-btn-primary:hover { background: var(--rppc-accent-dark); color: #fff; }
.rppc-btn-secondary { background: #fff; color: var(--rppc-primary); border: 1px solid var(--rppc-border); }
.rppc-btn-secondary:hover { border-color: #cbd5e1; background: #f8fafc; }
.rppc-btn-ghost { background: transparent; color: #64748b; border: 1px solid transparent; }
.rppc-btn-ghost:hover { background: #eef2f7; }
.rppc-calculate { width: 100%; margin-top: 18px; min-height: 52px; font-size: 15px; }

.rppc-error { margin-top: 16px; border: 1px solid #fecaca; border-radius: 12px; background: var(--rppc-danger-soft); color: var(--rppc-danger); padding: 12px 14px; font-size: 13px; font-weight: 700; }

.rppc-results-wrap { position: sticky; top: 24px; }
.rppc-results-empty { min-height: 350px; padding: 44px 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rppc-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 20px; background: var(--rppc-soft); color: var(--rppc-accent-dark); font-size: 30px; font-weight: 900; }
.rppc-results-empty h3 { margin: 0 0 8px; font-size: 20px; color: var(--rppc-primary); }
.rppc-results-empty p { margin: 0; max-width: 320px; color: var(--rppc-muted); font-size: 13px; }
.rppc-results { overflow: hidden; }
.rppc-result-hero { padding: 28px 24px; background: linear-gradient(145deg, #0f172a, #1e293b); color: #fff; }
.rppc-result-kicker { display: block; min-height: 18px; color: #cbd5e1; font-size: 12px; font-weight: 700; }
.rppc-result-hero strong { display: block; margin-top: 7px; font-size: clamp(34px, 4vw, 46px); line-height: 1; letter-spacing: -.04em; }
.rppc-result-caption { display: block; margin-top: 6px; color: #94a3b8; font-size: 12px; }
.rppc-result-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rppc-border); border-bottom: 1px solid var(--rppc-border); }
.rppc-metric { min-height: 88px; padding: 16px; background: #fff; }
.rppc-metric span { display: block; margin-bottom: 6px; color: var(--rppc-muted); font-size: 11.5px; }
.rppc-metric strong { color: var(--rppc-primary); font-size: 18px; }
.rppc-result-section { padding: 22px 24px; border-bottom: 1px solid var(--rppc-border); }
.rppc-result-section-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 12px; }
.rppc-result-section-head h3 { margin: 0; font-size: 14px; color: var(--rppc-primary); }
.rppc-result-section-head span { color: var(--rppc-muted); font-size: 11.5px; }
.rppc-breakdown { margin: 0; }
.rppc-breakdown > div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; }
.rppc-breakdown dt { color: var(--rppc-muted); font-size: 12.5px; }
.rppc-breakdown dd { margin: 0; color: #334155; font-size: 12.5px; font-weight: 750; text-align: right; }
.rppc-breakdown-emphasis { margin-top: 6px; padding-top: 12px !important; border-top: 1px dashed #cbd5e1; }
.rppc-breakdown-emphasis dt, .rppc-breakdown-emphasis dd { color: var(--rppc-primary); font-weight: 850; }
.rppc-batch-section { background: var(--rppc-success-soft); }
.rppc-batch-section small { display: block; margin-top: 8px; color: #4b6b55; font-size: 10.5px; }
.rppc-copy { width: calc(100% - 48px); margin: 20px 24px 8px; }
.rppc-copy-status { min-height: 20px; padding: 0 24px 18px; color: var(--rppc-success); text-align: center; font-size: 11.5px; font-weight: 700; }
.rppc-disclaimer { margin: 22px 4px 2px; color: #64748b; font-size: 11.5px; }

@media (max-width: 1000px) {
  .rppc-shell { padding: 20px; border-radius: 20px; }
  .rppc-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
  .rppc-target-options { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .rppc-shell { padding: 14px; margin-left: -8px; margin-right: -8px; }
  .rppc-header { align-items: flex-start; flex-direction: column; padding: 8px 2px 20px; }
  .rppc-header-actions { width: 100%; }
  .rppc-header-actions .rppc-btn { flex: 1; }
  .rppc-grid { grid-template-columns: 1fr; }
  .rppc-results-wrap { position: static; }
  .rppc-card { padding: 19px; border-radius: 18px; }
}

@media (max-width: 560px) {
  .rppc-fields-2 { grid-template-columns: 1fr; }
  .rppc-field-wide { grid-column: auto; }
  .rppc-header h2 { font-size: 32px; }
  .rppc-header p { font-size: 14px; }
  .rppc-target-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rppc-result-hero { padding: 24px 20px; }
  .rppc-result-section { padding: 20px; }
  .rppc-copy { width: calc(100% - 40px); margin-left: 20px; margin-right: 20px; }
}
