:root {
  --bg-dark: #262526;
  --bg-light: #ffffff;
  --text-dark: #262526;
  --text-light: #ffffff;
  --accent: #06d6a0;
  --accent-strong: #04b58a;
  --accent-soft: rgba(6, 214, 160, 0.12);
  --border: rgba(38, 37, 38, 0.14);
  --border-soft: rgba(38, 37, 38, 0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.18), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
  --danger: #e63946;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar__inner,
.page,
.site-footer__inner {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: auto;
  height: 30px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar__link {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.topbar__link:hover {
  color: var(--text-light);
}

.page {
  padding: 48px 0 64px;
}

.page--narrow {
  width: min(840px, calc(100vw - 32px));
}

.license-card h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
}

.license-card a {
  color: #047857;
  font-weight: 800;
}

.license-text {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(38, 37, 38, 0.12);
}

.license-text h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.license-text p {
  margin: 0 0 14px;
  color: rgba(38, 37, 38, 0.72);
  font-size: 15px;
  line-height: 1.7;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.section-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  font-weight: 800;
}

.hero h1 span {
  color: var(--accent);
}

.hero__copy {
  width: min(720px, 100%);
  margin: 16px auto 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
}

.hero__help {
  width: min(720px, 100%);
  margin: 10px auto 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.glass-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dark);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.jump-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(6, 214, 160, 0.28);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-dark);
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.jump-card p {
  margin: 0;
  color: rgba(38, 37, 38, 0.78);
  font-size: 14px;
  line-height: 1.45;
}

.jump-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.jump-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(38, 37, 38, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-dark);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.jump-card__link--primary {
  border-color: rgba(6, 214, 160, 0.32);
  background: var(--accent-strong);
  color: #0f172a;
}

#rating-goal,
#rating-stress-test {
  scroll-margin-top: 86px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.panel-intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(38, 37, 38, 0.66);
  font-size: 14px;
  line-height: 1.55;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px auto;
  gap: 14px;
  align-items: end;
}

.lookup-row .field {
  grid-template-rows: 20px 46px;
}

.field {
  display: grid;
  gap: 7px;
}

.field__label {
  color: rgba(38, 37, 38, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.field__help {
  color: rgba(38, 37, 38, 0.56);
  font-size: 12px;
  line-height: 1.4;
  min-height: 17px;
}

.field__help--empty {
  visibility: hidden;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(38, 37, 38, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-dark);
  padding: 11px 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-strong);
  color: #0f172a;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary:hover {
  background: #33dfb4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 214, 160, 0.35);
}

.btn-primary:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.status {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.text-neutral {
  color: rgba(38, 37, 38, 0.62);
}

.text-error {
  color: var(--danger);
}

.app-summary {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.app-data-row {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(5, minmax(130px, 1fr));
  gap: 14px;
}

.app-data-cell {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}

.app-data-cell span {
  display: block;
  margin-bottom: 5px;
  color: rgba(38, 37, 38, 0.62);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-data-cell strong {
  display: block;
  overflow: hidden;
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-data-cell--app strong {
  font-size: 16px;
}

.result-card > span,
.main-result > span {
  display: block;
  margin-bottom: 5px;
  color: rgba(38, 37, 38, 0.62);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grid {
  display: block;
}

.input-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.input-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-grid--stress {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.input-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

.assumption-section {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(38, 37, 38, 0.02);
  padding: 16px;
}

.assumption-section + .assumption-section {
  margin-top: 16px;
}

.assumption-section h3 {
  margin: 0 0 14px;
  color: rgba(38, 37, 38, 0.78);
  font-size: 15px;
  line-height: 1.25;
}

.assumption-section__intro {
  margin: -6px 0 14px;
  color: rgba(38, 37, 38, 0.62);
  font-size: 13px;
  line-height: 1.45;
}

.assumption-section--goal {
  border-color: rgba(6, 214, 160, 0.38);
  background: rgba(6, 214, 160, 0.11);
}

.assumption-section--goal h3 {
  color: #047a60;
  font-size: 17px;
}

.assumption-section--goal input {
  border-color: rgba(6, 214, 160, 0.32);
  background: #ffffff;
}

.assumption-section--store {
  background: #ffffff;
}

.google-settings {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
  border: 1px dashed rgba(38, 37, 38, 0.18);
  border-radius: 8px;
  background: rgba(38, 37, 38, 0.035);
  padding: 16px;
  margin-top: 18px;
}

.google-settings__copy strong {
  display: block;
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.3;
}

.google-settings__copy p {
  margin: 7px 0 0;
  color: rgba(38, 37, 38, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

.google-settings__inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.calculated-input {
  background: rgba(38, 37, 38, 0.045);
  color: rgba(38, 37, 38, 0.72);
  cursor: default;
}

.result-grid--wide {
  grid-template-columns: 1fr;
}

.result-grid--wide {
  margin-top: 18px;
}

.output-explanation {
  margin: -4px 0 16px;
  color: rgba(38, 37, 38, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.projection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.result-stack {
  display: grid;
  gap: 16px;
}

.result-grid--secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(38, 37, 38, 0.035);
  padding: 14px;
}

.result-card p {
  margin: 6px 0 0;
  color: rgba(38, 37, 38, 0.58);
  font-size: 12px;
  line-height: 1.45;
}

.result-card strong {
  color: var(--text-dark);
  font-size: 28px;
  line-height: 1;
}

.result-card--primary {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: center;
  background: var(--accent-soft);
  border-color: rgba(6, 214, 160, 0.28);
  padding: 18px 20px;
}

.result-card--primary strong {
  display: block;
  color: #038b6b;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.18;
}

.result-card--primary p {
  color: rgba(38, 37, 38, 0.68);
  font-size: 13px;
}

.sensitivity-panel {
  border-left: 1px solid rgba(6, 214, 160, 0.25);
  padding-left: 20px;
}

.sensitivity-panel h3 {
  margin: 0 0 10px;
  color: rgba(38, 37, 38, 0.72);
  font-size: 13px;
  line-height: 1.2;
}

.sensitivity-rows {
  display: grid;
  gap: 8px;
}

.sensitivity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(38, 37, 38, 0.08);
  padding-top: 8px;
}

.sensitivity-row span,
.sensitivity-note {
  color: rgba(38, 37, 38, 0.64);
  font-size: 12px;
  line-height: 1.35;
}

.sensitivity-row strong {
  color: var(--text-dark);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.result-grid--secondary .result-card {
  min-height: 98px;
  background: rgba(38, 37, 38, 0.025);
}

.result-grid--secondary .result-card strong {
  font-size: 22px;
}

.stress-input-groups {
  display: grid;
  gap: 16px;
}

.stress-input-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.stress-input-section {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.stress-input-section h3 {
  margin: 0 0 14px;
  color: rgba(38, 37, 38, 0.78);
  font-size: 15px;
  line-height: 1.25;
}

.stress-input-section--primary {
  border-color: rgba(6, 214, 160, 0.38);
  background: rgba(6, 214, 160, 0.11);
}

.stress-input-section--primary h3 {
  color: #047a60;
  font-size: 17px;
}

.stress-input-section--primary input {
  border-color: rgba(6, 214, 160, 0.32);
}

.stress-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
  margin-top: 20px;
}

.stress-summary {
  display: grid;
  gap: 16px;
}

.stress-main-copy {
  border: 1px solid rgba(6, 214, 160, 0.2);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 16px;
}

.stress-main-copy p {
  margin: 0;
  color: rgba(38, 37, 38, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.stress-main-copy p:first-child {
  color: var(--text-dark);
  font-weight: 800;
}

.stress-main-copy p + p {
  margin-top: 8px;
}

.stress-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stress-card-grid .result-card {
  min-height: 92px;
}

.stress-card-grid .result-card strong {
  font-size: 22px;
}

.stress-chart-card {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(38, 37, 38, 0.025);
  padding: 18px;
}

.stress-chart-card h3 {
  margin: 0 0 12px;
  color: var(--text-dark);
  font-size: 18px;
  line-height: 1.25;
}

.stress-chart {
  min-height: 280px;
}

.stress-chart svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(38, 37, 38, 0.08);
  border-radius: 8px;
}

.stress-line {
  fill: none;
  stroke: #038b6b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.stress-baseline {
  stroke: #e63946;
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.stress-displayed-line {
  stroke: #06d6a0;
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.stress-baseline-label {
  fill: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

.stress-displayed-label {
  fill: rgba(3, 139, 107, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.stress-chart .chart-axis-label {
  font-size: 13px;
  fill: rgba(38, 37, 38, 0.68);
}

.stress-event-line {
  stroke: rgba(38, 37, 38, 0.18);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.stress-dot {
  stroke: #ffffff;
  stroke-width: 2;
}

.stress-dot--current,
.stress-dot--recovery {
  fill: #038b6b;
}

.stress-dot--displayed {
  fill: #06d6a0;
}

.stress-dot--drop {
  fill: #e63946;
}

.projection-card {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(38, 37, 38, 0.025);
  padding: 16px;
}

.projection-header h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: 18px;
  line-height: 1.2;
}

.projection-header p {
  margin: 8px 0 0;
  color: rgba(38, 37, 38, 0.62);
  font-size: 13px;
  line-height: 1.45;
}

.projection-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-top: 16px;
}

.projection-chart {
  min-height: 260px;
  margin-top: 16px;
}

.projection-result-note {
  margin: 10px 0 0;
  color: rgba(38, 37, 38, 0.68);
  font-size: 13px;
  line-height: 1.45;
}

.projection-chart svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(38, 37, 38, 0.08);
  border-radius: 8px;
}

.chart-axis {
  stroke: rgba(38, 37, 38, 0.28);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: #038b6b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-target {
  stroke: #e63946;
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.chart-threshold {
  stroke: #06d6a0;
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.chart-time-band-0 {
  fill: rgba(6, 214, 160, 0.06);
}

.chart-time-band-1 {
  fill: rgba(6, 214, 160, 0.14);
}

.chart-time-band-2 {
  fill: rgba(6, 214, 160, 0.22);
}

.chart-hit-line {
  stroke: rgba(3, 139, 107, 0.35);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.chart-reach-line {
  stroke: rgba(38, 37, 38, 0.18);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.chart-hit {
  fill: #038b6b;
  stroke: #ffffff;
  stroke-width: 2;
}

.chart-axis-label,
.chart-target-label,
.chart-threshold-label,
.chart-reach-label,
.chart-time-band-label {
  fill: rgba(38, 37, 38, 0.58);
  font-size: 11px;
}

.chart-time-band-label {
  fill: rgba(3, 139, 107, 0.75);
  font-weight: 700;
}

.chart-reach-label {
  fill: rgba(38, 37, 38, 0.72);
  font-weight: 700;
}

.chart-target-label {
  fill: #b91c1c;
  font-weight: 700;
}

.site-footer {
  padding: 0 0 20px;
}

.site-footer__inner {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer p {
  margin: 0;
}

.site-footer__brand {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

.site-footer__disclaimer {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: flex-end;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--text-light);
}

@media (max-width: 820px) {
  .topbar__inner,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .jump-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .jump-card__actions {
    justify-content: flex-start;
  }

  .topbar__actions {
    justify-content: flex-start;
  }

  .site-footer__links {
    justify-content: flex-start;
  }

  .app-data-row {
    grid-template-columns: 1fr;
  }

  .lookup-row,
  .grid,
  .projection-layout,
  .stress-layout,
  .stress-input-row,
  .google-settings,
  .google-settings__inputs,
  .input-grid,
  .input-grid--three,
  .input-grid--stress,
  .result-grid,
  .result-grid--secondary,
  .result-grid--wide {
    grid-template-columns: 1fr;
  }

  .stress-card-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding-top: 34px;
  }

  .result-card--primary {
    grid-template-columns: 1fr;
  }

  .projection-controls {
    grid-template-columns: 1fr;
  }

  .sensitivity-panel {
    border-left: 0;
    border-top: 1px solid rgba(6, 214, 160, 0.25);
    padding-left: 0;
    padding-top: 14px;
  }
}
