/* Carbon Footprint Calculator — The New multi-locale workspace. 20260905b
 *
 * One vertical axis for the whole workspace. The input field bar, the preset row and the
 * metric row all sit on `repeat(4, minmax(0,1fr))` with the same 10px gap, and the two
 * panes share one `repeat(2, minmax(0,1fr))` split, so every column boundary lines up at
 * each breakpoint (ledger #42, 추가 필수 확인 #22).
 *
 * `.tn-related-links` and `.tn-source-links` are deliberately absent: the shared
 * fixed-partials CSS owns those for every `data-tn-fixed-partials` page.
 *
 * The element reset never touches `p` padding. The status row, the notice and the chart
 * caption are paragraphs that own border, background and padding (추가 필수 확인 #3).
 */
.tn-cfc-page,
.tn-cfc-page * { box-sizing: border-box; }

.tn-cfc-page {
  --cfc-paper: #faf6ee;
  --cfc-wash: #f5efdf;
  --cfc-panel: #fffaf0;
  --cfc-ink: #1a1208;
  --cfc-muted: #5a4a30;
  --cfc-line: #b8a888;
  --cfc-soft-line: #ddd4be;
  --cfc-accent: #c44a00;
  --cfc-primary-bg: #1a1208;
  --cfc-primary-ink: #fff7e8;
  --cfc-secondary-bg: #ede6d4;
  --cfc-secondary-ink: #1a1208;
  --cfc-error-bg: #f7e3da;
  --cfc-error-ink: #7e2816;
  --cfc-error-line: #c7836e;
  --cfc-good-bg: #e3efe6;
  --cfc-good-ink: #235c3d;
  --cfc-good-line: #8fb79f;
  --cfc-track: #e7ddc7;
  --cfc-you: #c44a00;
  --cfc-you-soft: rgba(196, 74, 0, .16);
  --cfc-ref: #8a7433;
  --cfc-target: #2f7d54;
  --cfc-seg-1: #7a3b0c;
  --cfc-seg-2: #c44a00;
  --cfc-seg-3: #d9822b;
  --cfc-seg-4: #5d7a4a;
  --cfc-seg-5: #9a6a55;
  --cfc-seg-6: #6f6047;
  width: min(1180px, calc(100vw - 10px));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

.tn-cfc-page :where(ul, ol) { list-style: none; padding-left: 0; margin: 0; }
.tn-cfc-page .tn-cfc-tool :is(code, pre, kbd, samp) { padding: 0; border: 0; border-radius: 0; background: none; background-color: transparent; color: inherit; -webkit-text-fill-color: inherit; font-family: inherit; }

.tn-cfc-tool {
  margin: 0 0 18px;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  background:
    linear-gradient(90deg, rgba(184, 168, 136, .13) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(0deg, rgba(184, 168, 136, .10) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--cfc-paper);
  border: 1px solid var(--cfc-line);
  padding: 12px;
  overflow: hidden;
  display: grid;
  row-gap: 10px;
  min-width: 0;
}

.tn-cfc-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.tn-cfc-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto;
  align-content: start;
  row-gap: 12px;
  background: color-mix(in srgb, var(--cfc-panel) 92%, transparent);
  border: 1px solid var(--cfc-line);
  padding: 12px;
}

.tn-cfc-kicker {
  margin: 0;
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- input band */

.tn-cfc-fieldbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.tn-cfc-field { grid-column: span 2; }
.tn-cfc-field--half { grid-column: span 1; }
.tn-cfc-field[hidden] { display: none; }

.tn-cfc-field {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-size: 12.5px;
  line-height: 1.2;
  font-weight: 800;
}

/* Label reset only. `:not(.tn-cfc-control)` matters: the control is also a direct span
   child, and at specificity (0,1,1) this rule would otherwise beat `.tn-cfc-control`
   (0,1,0) and strip its inner padding (추가 필수 확인 #3, ledger #48). */
.tn-cfc-field > span:not(.tn-cfc-control):not(.tn-cfc-select) { display: block; margin: 0; padding: 0; min-height: 30px; }

.tn-cfc-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  background: var(--cfc-panel);
  border: 1px solid var(--cfc-line);
}

.tn-cfc-control input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  text-align: right;
  outline: 0;
}

.tn-cfc-control input::-webkit-outer-spin-button,
.tn-cfc-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tn-cfc-control input::placeholder,
.tn-cfc-control input::-webkit-input-placeholder { color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-weight: 400; opacity: .35; }
.tn-cfc-control:has(input:focus-visible) { outline: 2px solid var(--cfc-accent); outline-offset: -1px; }

.tn-cfc-control b {
  flex: 0 0 auto;
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  border-left: 1px solid var(--cfc-soft-line);
  border-bottom: 0;
  padding-left: 8px;
  white-space: nowrap;
}

/* The global shell resets span display; force the flex row so the unit suffix stays
   inside the control box instead of wrapping under the input (kill list #12/#13). */
.tn-cfc-page .tn-cfc-tool .tn-cfc-control { display: flex !important; align-items: center !important; min-width: 0 !important; }
.tn-cfc-page .tn-cfc-tool .tn-cfc-control input { flex: 1 1 auto; width: auto; }
.tn-cfc-page .tn-cfc-tool .tn-cfc-control b { flex: 0 0 auto; }

/* Native select keeps its accessibility and keyboard behaviour, but gets a visible
   chevron and the flat paper surface instead of the OS widget (ledger #33). */
.tn-cfc-select {
  position: relative;
  display: block;
  min-width: 0;
  height: 40px;
  background: var(--cfc-panel);
  border: 1px solid var(--cfc-line);
}

.tn-cfc-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 30px 0 10px;
  border: 0;
  background: transparent;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  outline: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-cfc-select::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--cfc-muted);
  border-bottom: 2px solid var(--cfc-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.tn-cfc-select:has(select:focus-visible) { outline: 2px solid var(--cfc-accent); outline-offset: -1px; }

.tn-cfc-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; }

.tn-cfc-chip,
.tn-cfc-button {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0 8px;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
}

.tn-cfc-chip {
  border: 1px solid var(--cfc-soft-line);
  background: var(--cfc-wash);
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
}
.tn-cfc-chip[aria-pressed="true"] { background: var(--cfc-primary-bg); color: var(--cfc-primary-ink); -webkit-text-fill-color: var(--cfc-primary-ink); border-color: var(--cfc-primary-bg); }

.tn-cfc-button {
  border: 1px solid var(--cfc-line);
  background: var(--cfc-secondary-bg);
  color: var(--cfc-secondary-ink);
  -webkit-text-fill-color: var(--cfc-secondary-ink);
}

.tn-cfc-chip:focus-visible,
.tn-cfc-button:focus-visible,
.tn-cfc-mini:focus-visible { outline: 2px solid var(--cfc-accent); outline-offset: 2px; }

.tn-cfc-status {
  margin: 0;
  padding: 9px 11px;
  background: var(--cfc-wash);
  border: 1px solid var(--cfc-soft-line);
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 700;
}
.tn-cfc-status[data-tone="error"] { background: var(--cfc-error-bg); border-color: var(--cfc-error-line); color: var(--cfc-error-ink); -webkit-text-fill-color: var(--cfc-error-ink); }
.tn-cfc-status[data-tone="done"] { background: var(--cfc-good-bg); border-color: var(--cfc-good-line); color: var(--cfc-good-ink); -webkit-text-fill-color: var(--cfc-good-ink); }

/* ---------------------------------------------------------------- result */

.tn-cfc-verdict {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--cfc-line);
  background: var(--cfc-panel);
}

.tn-cfc-verdict-value {
  min-width: 0;
  margin: 0;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  white-space: nowrap;
}

.tn-cfc-verdict-label {
  min-width: 0;
  margin: 0;
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

.tn-cfc-mini {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--cfc-soft-line);
  background: var(--cfc-wash);
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
}
.tn-cfc-mini:disabled { opacity: .5; cursor: not-allowed; }

.tn-cfc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: stretch; min-width: 0; margin: 0; }
.tn-cfc-metric { grid-column: span 2; }
.tn-cfc-metric {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--cfc-soft-line);
  background: var(--cfc-panel);
}
.tn-cfc-metric dt { margin: 0; color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 12px; line-height: 1.2; font-weight: 800; letter-spacing: .04em; }
.tn-cfc-metric dd {
  margin: 0;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
.tn-cfc-metric small { color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 11.5px; line-height: 1.4; font-weight: 600; }

/* Breakdown: one stacked bar plus the same six items as rows. */
.tn-cfc-breakdown { display: grid; gap: 6px; min-width: 0; }
.tn-cfc-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tn-cfc-block-title { color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.tn-cfc-block-note { color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 11.5px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }

.tn-cfc-bar { display: flex; width: 100%; height: 14px; border: 1px solid var(--cfc-soft-line); background: var(--cfc-track); overflow: hidden; }
.tn-cfc-bar span { display: block; height: 100%; width: 0; }
.tn-cfc-bar span[data-seg="transport"] { background: var(--cfc-seg-1); }
.tn-cfc-bar span[data-seg="electricity"] { background: var(--cfc-seg-2); }
.tn-cfc-bar span[data-seg="heating"] { background: var(--cfc-seg-3); }
.tn-cfc-bar span[data-seg="food"] { background: var(--cfc-seg-4); }
.tn-cfc-bar span[data-seg="waste"] { background: var(--cfc-seg-5); }
.tn-cfc-bar span[data-seg="water"] { background: var(--cfc-seg-6); }

.tn-cfc-rows { display: grid; gap: 0; border: 1px solid var(--cfc-soft-line); background: var(--cfc-panel); }
.tn-cfc-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) max-content 46px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--cfc-soft-line);
  min-width: 0;
}
.tn-cfc-row:last-child { border-bottom: 0; }
.tn-cfc-row i { display: block; width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, .18); }
.tn-cfc-row i[data-seg="transport"] { background: var(--cfc-seg-1); }
.tn-cfc-row i[data-seg="electricity"] { background: var(--cfc-seg-2); }
.tn-cfc-row i[data-seg="heating"] { background: var(--cfc-seg-3); }
.tn-cfc-row i[data-seg="food"] { background: var(--cfc-seg-4); }
.tn-cfc-row i[data-seg="waste"] { background: var(--cfc-seg-5); }
.tn-cfc-row i[data-seg="water"] { background: var(--cfc-seg-6); }
.tn-cfc-row span { min-width: 0; color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-cfc-row b,
.tn-cfc-row em {
  margin: 0;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  font-style: normal;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: normal;
  white-space: nowrap;
}
.tn-cfc-row em { color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); text-align: right; }

/* ---------------------------------------------------------------- comparison */

.tn-cfc-compare,
.tn-cfc-scenarios { display: grid; gap: 6px; min-width: 0; }

.tn-cfc-chart-frame { width: 100%; min-width: 0; height: 178px; border: 1px solid var(--cfc-soft-line); background: var(--cfc-panel); }
.tn-cfc-chart-frame svg { display: block; width: 100%; height: 100%; }
.tn-cfc-chart-frame .cfc-grid { stroke: var(--cfc-soft-line); stroke-width: 1; }
.tn-cfc-chart-frame .cfc-axis { stroke: var(--cfc-line); stroke-width: 1; }
.tn-cfc-chart-frame .cfc-bar-you { fill: var(--cfc-you); }
.tn-cfc-chart-frame .cfc-bar-ref { fill: var(--cfc-ref); }
.tn-cfc-chart-frame .cfc-bar-target { fill: var(--cfc-target); }
.tn-cfc-chart-frame .cfc-bar-empty { fill: var(--cfc-track); }
.tn-cfc-chart-frame .cfc-label { fill: var(--cfc-muted); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; font-weight: 700; }
.tn-cfc-chart-frame .cfc-value { fill: var(--cfc-ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; font-weight: 800; font-variant-numeric: lining-nums tabular-nums; }

/* ---------------------------------------------------------------- scenarios */

.tn-cfc-table-wrap { width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--cfc-soft-line); background: var(--cfc-panel); }
.tn-cfc-table { width: 100%; border-collapse: collapse; color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); font-size: 12.5px; line-height: 1.4; }
.tn-cfc-table th,
.tn-cfc-table td { padding: 7px 9px; border-right: 1px solid var(--cfc-soft-line); border-bottom: 1px solid var(--cfc-soft-line); text-align: left; vertical-align: top; }
.tn-cfc-table tr > :last-child { border-right: 0; }
.tn-cfc-table tbody tr:last-child > * { border-bottom: 0; }
.tn-cfc-table thead th { background: var(--cfc-primary-bg); color: var(--cfc-primary-ink); -webkit-text-fill-color: var(--cfc-primary-ink); font-weight: 800; white-space: nowrap; }
.tn-cfc-table tbody th { background: var(--cfc-wash); color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); font-weight: 800; }
.tn-cfc-table td { background: var(--cfc-panel); color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.tn-cfc-table tbody tr[data-best="true"] td,
.tn-cfc-table tbody tr[data-best="true"] th { background: var(--cfc-wash); color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); }
.tn-cfc-empty { margin: 0; padding: 12px; color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-size: 12.5px; font-weight: 700; text-align: center; white-space: normal; }

.tn-cfc-notice {
  margin: 0;
  padding: 10px 12px;
  background: var(--cfc-wash);
  border: 1px solid var(--cfc-soft-line);
  color: var(--cfc-muted);
  -webkit-text-fill-color: var(--cfc-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

/* Article-side worked-example table. */
.tn-cfc-page .tn-cfc-example-wrap { width: 100%; max-width: 100%; margin-top: 12px; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--cfc-line); background: var(--cfc-panel); }
.tn-cfc-page .tn-cfc-example-wrap:focus-visible { outline: 2px solid var(--cfc-accent); outline-offset: 2px; }
.tn-cfc-page .tn-cfc-example-table { width: 100%; min-width: 420px; border-collapse: collapse; color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); font-size: 13px; line-height: 1.45; }
.tn-cfc-page .tn-cfc-example-table th,
.tn-cfc-page .tn-cfc-example-table td { padding: 9px 10px; border-right: 1px solid var(--cfc-soft-line); border-bottom: 1px solid var(--cfc-soft-line); text-align: left; vertical-align: top; }
.tn-cfc-page .tn-cfc-example-table tr > :last-child { border-right: 0; }
.tn-cfc-page .tn-cfc-example-table tbody tr:last-child > * { border-bottom: 0; }
.tn-cfc-page .tn-cfc-example-table thead th { background: var(--cfc-primary-bg); color: var(--cfc-primary-ink); -webkit-text-fill-color: var(--cfc-primary-ink); font-weight: 800; }
.tn-cfc-page .tn-cfc-example-table tbody th { background: var(--cfc-wash); color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); font-weight: 800; }
.tn-cfc-page .tn-cfc-example-table td { background: var(--cfc-panel); color: var(--cfc-muted); -webkit-text-fill-color: var(--cfc-muted); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }

/* ---------------------------------------------------------------- breakpoints */

@media (max-width: 980px) {
  .tn-cfc-workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .tn-cfc-tool { padding: 8px; }
  .tn-cfc-pane { padding: 10px; }
  .tn-cfc-verdict { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tn-cfc-verdict-value { font-size: 25px; white-space: normal; }
  .tn-cfc-mini { width: 100%; }
  .tn-cfc-chart-frame { height: 160px; }
}

/* The field bar, preset row and metric row keep the same track count at every breakpoint
   so the vertical column axis stays aligned (ledger #42). */
@media (max-width: 560px) {
  .tn-cfc-fieldbar,
  .tn-cfc-quick,
  .tn-cfc-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tn-cfc-field,
  .tn-cfc-field--half { grid-column: span 1; }
  .tn-cfc-field--wide { grid-column: span 2; }
  .tn-cfc-chip,
  .tn-cfc-quick .tn-cfc-button,
  .tn-cfc-metric { grid-column: span 1; }
  .tn-cfc-row { grid-template-columns: 12px minmax(0, 1fr) max-content 42px; gap: 6px; }
  .tn-cfc-field > span:not(.tn-cfc-control):not(.tn-cfc-select) { min-height: 45px; }

  /* The scenario table becomes a 2x2 card per row rather than a horizontally scrolling
     grid, so long locale column names keep their meaning without a sideways swipe
     (ledger #36). */
  .tn-cfc-table,
  .tn-cfc-table tbody { display: block; }
  .tn-cfc-table thead { display: none; }
  .tn-cfc-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--cfc-soft-line);
  }
  .tn-cfc-table tbody tr:last-child { border-bottom: 0; }
  .tn-cfc-table tbody th { grid-column: span 2; }
  .tn-cfc-table tbody th,
  .tn-cfc-table tbody td {
    display: block;
    min-width: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 6px 8px;
    background: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .tn-cfc-table tbody :is(th, td)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--cfc-muted);
    -webkit-text-fill-color: var(--cfc-muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
  }
  .tn-cfc-table tbody .tn-cfc-empty::before { content: none; }
  .tn-cfc-table tbody tr:has(.tn-cfc-empty) { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .tn-cfc-control input { font-size: 15px; }
  .tn-cfc-select select { font-size: 12.5px; }
  .tn-cfc-metric dd { font-size: 15px; }
}

/* ---------------------------------------------------------------- schemes */

body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-l="dark"], [data-scheme="auto"][data-d="dark"]) .tn-cfc-page,
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-cfc-page {
  --cfc-paper: #201811;
  --cfc-wash: #2b2119;
  --cfc-panel: #241c15;
  --cfc-ink: #f7ecd8;
  --cfc-muted: #d3c2a4;
  --cfc-line: #6f5d40;
  --cfc-soft-line: #4c3f2c;
  --cfc-accent: #ff8a3d;
  --cfc-primary-bg: #3d2f1e;
  --cfc-primary-ink: #ffe9c6;
  --cfc-secondary-bg: #33281c;
  --cfc-secondary-ink: #f7ecd8;
  --cfc-error-bg: #3a211c;
  --cfc-error-ink: #ffc2b3;
  --cfc-error-line: #854d40;
  --cfc-good-bg: #22301f;
  --cfc-good-ink: #b9e0c2;
  --cfc-good-line: #4e6b52;
  --cfc-track: #3a2f21;
  --cfc-you: #ff9f5e;
  --cfc-you-soft: rgba(255, 159, 94, .18);
  --cfc-ref: #c9ae63;
  --cfc-target: #7fc9a0;
  --cfc-seg-1: #b8641f;
  --cfc-seg-2: #ff8a3d;
  --cfc-seg-3: #f0ab5e;
  --cfc-seg-4: #9dbb82;
  --cfc-seg-5: #d6a08a;
  --cfc-seg-6: #a2917a;
  color: var(--cfc-ink);
  -webkit-text-fill-color: var(--cfc-ink);
}

@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .tn-cfc-page {
    --cfc-paper: #201811;
    --cfc-wash: #2b2119;
    --cfc-panel: #241c15;
    --cfc-ink: #f7ecd8;
    --cfc-muted: #d3c2a4;
    --cfc-line: #6f5d40;
    --cfc-soft-line: #4c3f2c;
    --cfc-accent: #ff8a3d;
    --cfc-primary-bg: #3d2f1e;
    --cfc-primary-ink: #ffe9c6;
    --cfc-secondary-bg: #33281c;
    --cfc-secondary-ink: #f7ecd8;
    --cfc-error-bg: #3a211c;
    --cfc-error-ink: #ffc2b3;
    --cfc-error-line: #854d40;
    --cfc-good-bg: #22301f;
    --cfc-good-ink: #b9e0c2;
    --cfc-good-line: #4e6b52;
    --cfc-track: #3a2f21;
    --cfc-you: #ff9f5e;
    --cfc-you-soft: rgba(255, 159, 94, .18);
    --cfc-ref: #c9ae63;
    --cfc-target: #7fc9a0;
    --cfc-seg-1: #b8641f;
    --cfc-seg-2: #ff8a3d;
    --cfc-seg-3: #f0ab5e;
    --cfc-seg-4: #9dbb82;
    --cfc-seg-5: #d6a08a;
    --cfc-seg-6: #a2917a;
    color: var(--cfc-ink);
    -webkit-text-fill-color: var(--cfc-ink);
  }
}

body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-l="dark"], [data-scheme="auto"][data-d="dark"]) .tn-cfc-page :is(.tn-cfc-control input, .tn-cfc-select select),
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-cfc-page :is(.tn-cfc-control input, .tn-cfc-select select) { color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); color-scheme: dark; }
@media (prefers-color-scheme: dark) { body[data-scheme="auto"] .tn-cfc-page :is(.tn-cfc-control input, .tn-cfc-select select) { color: var(--cfc-ink); -webkit-text-fill-color: var(--cfc-ink); color-scheme: dark; } }

/* The sitewide dark rule paints every `tn-`-prefixed node cream with !important. The
   surfaces below own a dark background, so the text token has to win back explicitly
   (kill list #15). */
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-l="dark"], [data-scheme="auto"][data-d="dark"]) .tn-cfc-page .tn-cfc-tool .tn-cfc-chip[aria-pressed="true"],
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-cfc-page .tn-cfc-tool .tn-cfc-chip[aria-pressed="true"],
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-l="dark"], [data-scheme="auto"][data-d="dark"]) .tn-cfc-page :is(.tn-cfc-table thead th, .tn-cfc-example-table thead th),
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-cfc-page :is(.tn-cfc-table thead th, .tn-cfc-example-table thead th) {
  color: var(--cfc-primary-ink) !important;
  -webkit-text-fill-color: var(--cfc-primary-ink) !important;
}

@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .tn-cfc-page .tn-cfc-tool .tn-cfc-chip[aria-pressed="true"],
  body[data-scheme="auto"] .tn-cfc-page :is(.tn-cfc-table thead th, .tn-cfc-example-table thead th) {
    color: var(--cfc-primary-ink) !important;
    -webkit-text-fill-color: var(--cfc-primary-ink) !important;
  }
}
