/* /converter/: unit converter and download-time calculator.
   Loaded before style.css (it sits in the page head block), so every override here is one step
   more specific than the rule it changes. */

.tool.calc .calc__amount {
  flex: 1 1 120px;
}

.tool.calc .calc__unit {
  flex: 1 1 180px;
}

.tool.calc .field__control {
  width: 100%;
  min-width: 0;
}

.prose .calc__summary {
  margin: 16px 0 12px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.prose .calc__summary.is-error,
.prose .calc__error {
  color: var(--bad);
  font-size: 14.5px;
  font-weight: 500;
}

.prose .calc__error {
  margin: 14px 0 0;
}

.calc .table-scroll {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.prose .calc table {
  font-size: 14px;
}

/* Row headers read as data labels, not as a second header row. */
.prose tbody th {
  background: none;
  color: var(--text);
}

.calc tbody tr:last-child > * {
  border-bottom: 0;
}

.calc td.num {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
}

.calc tr[data-active] > * {
  background: color-mix(in srgb, var(--down) 9%, transparent);
}

.prose .calc tr[data-active] > th {
  color: var(--down);
}

.prose .calc__foot {
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.calc__out {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.calc__out > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calc__out dt {
  color: var(--text-2);
  font-size: 13px;
}

.calc__out dd {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc__out > div:first-child dd {
  color: var(--down);
}

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

/* Broadband tiers: two-line headers and wrapping plan names keep the five columns close to phone width. */
.prose .tiers thead th {
  vertical-align: bottom;
}

.prose .tiers tbody th {
  white-space: normal;
}

@media (max-width: 640px) {
  .prose .tiers th,
  .prose .tiers td {
    padding-inline: 8px;
  }
}
