.reach-planner {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  padding-bottom: 20px;
}

.reach-planner h2, .reach-method h2 {
  font-size: clamp(28px, 3.3vw, 46px);
}

.reach-assumptions, .reach-editor, .reach-impact {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(17px, 2.6vw, 32px);
  background: #f5f6fb;
}

.reach-assumption-grid, .reach-placement-grid {
  display: grid;
  gap: 16px;
}

.reach-assumption-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reach-planner label {
  min-width: 0;
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.reach-planner small, .reach-help {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.reach-planner small {
  margin-top: 5px;
}

.reach-planner input, .reach-planner select {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 5px 0 0;
  accent-color: var(--blue);
}

.reach-planner input:not([type=range]), .reach-planner select {
  min-height: 44px;
  padding: 7px 8px;
  font-size: 16px;
  font-weight: 400;
  border: 1px solid #aeb8d0;
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

.reach-planner input[type=range] {
  min-height: 44px;
}

.reach-planner label output {
  margin-left: 4px;
  color: var(--blue-dark);
}

.reach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.reach-heading-actions, .reach-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 12px;
}

.reach-editor-actions {
  justify-content: start;
  margin-top: 14px;
}

.reach-jump {
  display: none;
}

.reach-heading-actions .button, .reach-editor-actions .button {
  min-height: 42px;
  padding: 8px 12px;
}

.reach-planner button {
  cursor: pointer;
}

.reach-planner button:disabled {
  cursor: default;
  opacity: .6;
}

.reach-plan-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: #e8ecf9;
  border-radius: 8px;
}

.reach-plan-switch button {
  min-height: 40px;
  padding: 5px 15px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 700;
}

.reach-plan-switch [aria-pressed=true] {
  background: var(--blue-dark);
  color: #fff;
}

.reach-placement {
  min-width: 0;
  position: relative;
  padding: 12px;
  margin: 0 0 12px;
  border: 1px solid #cbd3e8;
  border-radius: 8px;
  background: #fff;
}

.reach-placement legend {
  padding: 0 4px;
  color: var(--blue-dark);
  font-weight: 700;
}

.reach-placement-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 12px;
}

.reach-placement-grid label {
  grid-column: span 2;
}

.reach-placement-grid label:first-child {
  grid-column: span 4;
}

.reach-placement .reach-help {
  margin: 7px 0 0;
}

.reach-placement .reach-help:empty {
  display: none;
}

.reach-remove {
  position: absolute;
  right: 10px;
  top: -16px;
  min-height: 32px;
  padding: 2px 7px;
  border: 0;
  border-radius: 4px;
  background-color: #fff;
  color: var(--blue-dark);
  text-decoration: underline;
  font-size: 13px;
}

.reach-results {
  min-width: 0;
  padding: clamp(17px, 2.6vw, 32px);
  border-radius: 12px;
  background: #151d51;
  color: #f7f8ff;
}

.reach-results h3 {
  margin-top: 24px;
  font-size: 25px;
}

.reach-results .reach-help {
  color: #dce3ff;
}

.reach-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.reach-table th, .reach-table td {
  padding: 8px 4px;
  text-align: right;
  border-bottom: 1px solid #4d578b;
  background: transparent;
  color: inherit;
}

.reach-table th:first-child {
  text-align: left;
}

.reach-table tbody th {
  font-weight: 400;
}

.reach-table td {
  font-variant-numeric: tabular-nums;
}

.reach-table .reach-key-metric {
  font-weight: 700;
  color: #fff;
  background: #283369;
}

.reach-table .reach-key-metric th {
  font-weight: 700;
}

.reach-status {
  margin: 12px 0;
  color: #fff1bd;
}

.reach-bar-group {
  display: grid;
  gap: 4px;
  align-content: start;
  margin: 0 0 10px;
}

.reach-bar-row {
  display: grid;
  grid-template-columns: minmax(48px, auto) minmax(24px, 1fr) minmax(69px, auto);
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.reach-bar-row strong {
  text-align: right;
}

.reach-bar-track {
  height: 8px;
  border-radius: 5px;
  overflow: hidden;
  background: #333d71;
}

.reach-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #aabaff;
}

.reach-bar-fill.is-b {
  background: #91e0d2;
}

.reach-results .button {
  margin-top: 13px;
}

#reach-placement-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#reach-placement-bars .reach-bar-group {
  padding: 14px;
  border-radius: 7px;
  background: #fff;
}

#reach-placement-bars .reach-bar-group > strong {
  overflow-wrap: anywhere;
}

#reach-placement-bars .reach-bar-row {
  grid-template-columns: 79px minmax(24px, 1fr) 43px;
}

#reach-placement-bars .reach-bar-track {
  background: #e5e9fa;
}

#reach-placement-bars .reach-bar-fill {
  background: #3e57cc;
}

#reach-placement-bars .reach-bar-fill.is-b {
  background: #246f63;
}

.reach-method details {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.reach-method summary {
  cursor: pointer;
  font-weight: 700;
}

.reach-method summary + p {
  margin-top: 12px;
}

.reach-method .work-links {
  margin-top: 16px;
}

@media (max-width: 950px) {
  .reach-assumption-grid, #reach-placement-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .reach-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reach-jump {
    display: inline-flex;
    align-self: center;
  }
}

@media (max-width: 480px) {
  #reach-placement-bars {
    grid-template-columns: minmax(0, 1fr);
  }

  .reach-placement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reach-placement-grid label {
    grid-column: auto;
  }

  .reach-placement-grid label:first-child {
    grid-column: 1 / -1;
  }
}
