.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #17181ce6, #0b0c0e66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--red), #8c0f1c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow:
    0 0 0 1px #ffffff0f,
    0 6px 18px var(--red-glow);
  flex-shrink: 0;
}
.brand h1 {
  font-size: 22px;
  line-height: 1.1;
}
.brand-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  border-radius: 5px;
  letter-spacing: 0.06em;
}
.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}
.app-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding-right: 4px;
}
.app-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 980px) {
  .app-main {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .app-sidebar {
    position: static;
    max-height: none;
  }
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.section-heading {
  margin-bottom: 14px;
}
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 4px;
}
.section-heading h2 {
  font-size: 19px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 6px;
  max-width: 60ch;
}
.input-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-top-actions {
  display: flex;
}
.form-section-title {
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--text);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.field em {
  font-style: normal;
  color: var(--text-faint);
  font-size: 12px;
}
.field input[type="number"],
.field input[type="text"],
.field select {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: var(--font-body);
}
.field input:focus,
.field select:focus {
  border-color: var(--red);
}
.field-inline {
  display: flex;
  gap: 8px;
}
.field-inline input {
  flex: 1;
  min-width: 0;
}
.field-inline select {
  width: 84px;
  flex-shrink: 0;
}
.field-note {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.5;
}
.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.checkbox-field input {
  width: 16px;
  height: 16px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.chip button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.chip button:hover {
  color: var(--red);
}
.btn {
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.btn-ghost {
  background: var(--bg-raised);
  border-color: var(--border-strong);
  color: var(--text);
  width: 100%;
}
.btn-ghost:hover {
  border-color: var(--red);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  margin-top: 14px;
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover {
  background: #b51424;
}
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.goal-card {
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  color: var(--text);
}
.goal-card:hover {
  border-color: #4d4f56;
}
.goal-card-active {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red) inset;
}
.goal-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.goal-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.section-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--border-strong);
  border-radius: 20px;
  transition: background-color 0.15s ease;
}
.switch-track:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track {
  background: var(--red);
}
.switch input:checked + .switch-track:before {
  transform: translate(18px);
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 700px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.stat-card {
  padding: 16px;
}
.highlight-card {
  border-color: var(--red-dim);
  background: linear-gradient(
    160deg,
    rgba(217, 25, 44, 0.08),
    var(--bg-card) 60%
  );
}
.stat-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat-value-lg {
  font-size: 24px;
}
.stat-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
}
.tone-good {
  background: #3fae6326;
  color: var(--green);
}
.tone-warn {
  background: #e0a52c26;
  color: var(--amber);
}
.tone-danger {
  background: #d9192c26;
  color: var(--red);
}
.assumed-flag {
  cursor: help;
  margin-left: 4px;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.mono {
  font-family: var(--font-mono);
}
.table-sub {
  color: var(--text-faint);
  font-size: 12px;
}
.formula-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.formula-item {
  border-left: 2px solid var(--red-dim);
  padding-left: 12px;
}
.formula-item-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.formula-eq {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--red);
  margin-bottom: 6px;
}
.formula-vars {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.full-calc {
  margin-top: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.full-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 12px;
}
.full-calc-row span:first-child {
  color: var(--text-muted);
}
.assumptions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assumptions-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.assumptions-list li:last-child {
  border-bottom: none;
}
.limitations-box {
  border: 1px solid var(--red-dim);
  background: #d9192c0f;
  border-radius: 10px;
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.6;
}
.limitations-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--red);
  margin-bottom: 10px;
}
.limitations-box p {
  margin-bottom: 10px;
  color: var(--text);
}
.limitations-list {
  columns: 2;
  column-gap: 24px;
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .limitations-list {
    columns: 1;
  }
}
.simulation-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
@media (max-width: 700px) {
  .simulation-result {
    grid-template-columns: 1fr;
  }
}
.app-footer {
  border-top: 1px solid var(--border);
  padding: 20px 28px;
  text-align: center;
}
.app-footer p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
}
:root {
  --bg: #0b0c0e;
  --bg-raised: #131417;
  --bg-card: #17181c;
  --border: #26282e;
  --border-strong: #37393f;
  --text: #f1f1ee;
  --text-muted: #97999f;
  --text-faint: #5c5e64;
  --red: #d9192c;
  --red-dim: #7a1420;
  --red-glow: rgba(217, 25, 44, 0.28);
  --amber: #e0a52c;
  --green: #3fae63;
  --font-display: "Rajdhani", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body {
  background-image:
    radial-gradient(
      ellipse 900px 500px at 15% -10%,
      rgba(217, 25, 44, 0.08),
      transparent 60%
    ),
    linear-gradient(180deg, #0b0c0e, #0a0a0c);
  background-attachment: fixed;
}
#root {
  min-height: 100vh;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
p {
  margin: 0;
  line-height: 1.55;
}
button {
  font-family: var(--font-body);
}
a {
  color: inherit;
}
::selection {
  background: var(--red-dim);
  color: var(--text);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
