.run-tool {
  --rt-ink: #163b2d;
  --rt-muted: #54695d;
  --rt-line: #d7dfd3;
  color: var(--rt-ink);
  max-width: 1050px;
  width: 100%;
  container: running-tool / inline-size;
  margin: 0 0 3rem;
  font: inherit;
  text-align: left;
}

.run-tool *, .run-tool *::before, .run-tool *::after { box-sizing: border-box; }

.rt-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #e8ede4;
  border-radius: 999px;
  margin-bottom: 20px;
}

.run-tool .rt-mode {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--rt-muted);
  border-radius: 999px;
  font: inherit;
  font-size: var(--text-body);
  font-weight: 650;
  padding: 10px 19px;
  cursor: pointer;
  min-height: 44px;
}

.run-tool .rt-mode[aria-pressed="true"] { background: var(--rt-ink); color: #f4f9ee; }
.run-tool .rt-mode:hover { color: var(--rt-ink); background: #d9e4d5; }
.run-tool .rt-mode[aria-pressed="true"]:hover { color: #fff; background: #244b39; }

.run-tool :is(.rt-mode, a, input, select):focus-visible {
  outline: 3px solid #568340;
  outline-offset: 3px;
}

.rt-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.85fr) minmax(0, 1.35fr);
  border: 1px solid var(--rt-line);
  border-radius: 19px;
  overflow: hidden;
  background: #fff;
}

.rt-controls, .rt-result {
  min-width: 0;
  padding: clamp(22px, 3.5vw, 42px);
}

.rt-controls {
  background: #f0f4eb;
  border-right: 1px solid var(--rt-line);
}

.rt-panel-title, .rt-subtitle, .rt-answer {
  margin: 0;
  color: var(--rt-ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.rt-panel-title { font-size: var(--text-section-title); }
.rt-description, .rt-detail, .rt-message {
  color: var(--rt-muted);
  margin: 10px 0 14px;
  line-height: 1.7;
  font-size: var(--text-body);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.rt-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 20px;
}
.rt-label { color: var(--rt-ink); font-size: var(--text-label); font-weight: 700; }
.rt-field :is(input, select) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 47px;
  border: 1px solid #bdcbb9;
  background-color: #fff;
  color: var(--rt-ink);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: var(--text-input);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.rt-field select { padding-right: 25px; cursor: pointer; }
.rt-field input[aria-invalid="true"] { border-color: #a43d26; }
.rt-hint { color: var(--rt-muted); font-size: var(--text-caption); line-height: 1.55; margin: 0; }
.rt-observations { margin: 7px 0 0; }

.rt-headline {
  color: #eaffdb;
  background: #193f30;
  border-radius: 12px;
  padding: 19px 22px 20px;
}
.rt-stat-label {
  color: #e0ebdf;
  margin: 0 0 6px;
  font-weight: 600;
  font-size: var(--text-label);
  line-height: 1.5;
}
.rt-answer {
  color: #d2f784;
  font-weight: 750;
  font-size: var(--text-display);
  letter-spacing: -.05em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}
.rt-unit {
  display: inline-block;
  font-weight: 550;
  color: #e4eddf;
  font-size: var(--text-body);
  margin-left: 9px;
  letter-spacing: 0;
}
.rt-subtitle { margin: 23px 0 10px; }
.rt-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}
.rt-table th, .rt-table td { padding: 10px 7px; border-bottom: 1px solid #e0e7dd; line-height: 1.45; }
.rt-table th { color: var(--rt-muted); font-size: var(--text-label); font-weight: 650; }
.rt-table :is(th, td):first-child { padding-left: 0; }
.rt-table :is(th, td):not(:first-child) { text-align: right; }
.rt-table :is(th, td):last-child { padding-right: 0; }
.rt-table td { color: var(--rt-ink); }
.rt-table tbody tr:last-child td { font-weight: 650; }
.rt-note {
  color: var(--rt-muted);
  border-left: 3px solid #93b775;
  padding-left: 11px;
  margin: 23px 0 0;
  font-size: var(--text-body);
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.rt-sources { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 10px; }
.rt-sources a {
  color: #35664a;
  line-height: 1.65;
  font-size: var(--text-label);
  font-weight: 550;
  text-underline-offset: 3px;
  text-decoration: underline;
  padding: 4px 0;
}
.rt-record + .rt-record { margin-top: 24px; }
.rt-result > .rt-message:first-child { margin-top: 0; }

@container running-tool (max-width: 44rem) {
  .rt-grid { grid-template-columns: minmax(0, 1fr); border-radius: 14px; }
  .rt-controls { border-right: 0; border-bottom: 1px solid var(--rt-line); }
  .rt-controls, .rt-result { padding: clamp(14px, 4vw, 20px); }
  .rt-switcher { margin-bottom: 14px; }
}
