/* ==========================================================================
   XTREME MACHINING INC. — CALCULATORS v3
   assets/css/calculators-v3.css

   Page styles for calculators-v3.html. Loaded after site.css and built on its
   tokens (Section 1 of site.css). Every class is prefixed "xt-" so nothing
   here collides with the older calculator styles in site.css Section 18c.

   Layout: a launcher grid of tools ("home") and a single-tool "stage". The
   page switches between them by URL hash (e.g. #speeds-feeds), so each tool
   has its own shareable link.

   NOTE: CSS comments cannot be nested, so section banners never contain
   another slash-star pair.
   ========================================================================== */

/* ===== 1. SECTION + SHARED BITS ========================================= */

.xt-tools {
  background: var(--paper);
  padding: 26px 0 96px;
  scroll-margin-top: 84px;
}

.xt-tools [hidden] { display: none !important; }

.xt-tools .ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.xt-tools code {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.88em;
  background: rgba(45, 74, 50, 0.08);
  color: var(--green);
  padding: 1px 6px;
  border-radius: 3px;
}

/* square icon badge used on tiles and tool headers */
.xt-ico {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  flex: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.xt-ico .ic { width: 22px; height: 22px; }
.xt-ico.lg { width: 52px; height: 52px; }
.xt-ico.lg .ic { width: 26px; height: 26px; }

/* ===== 2. STICKY TOOLBAR =============================================== */

.xt-bar {
  position: sticky;
  top: 84px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  margin-bottom: 26px;
  background: var(--paper);
}
.xt-bar::after {
  /* full-bleed hairline under the bar, only once the page has scrolled */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.xt-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--paper);
  z-index: -1;
}
.xt-bar.is-stuck::after { opacity: 1; }

.xt-bar-home,
.xt-bar-tool { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }

/* search */
.xt-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
}
.xt-search .ic { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.xt-search input {
  width: 100%;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 44px 14px 48px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.xt-search input::placeholder { color: #98a19b; font-weight: 300; }
.xt-search input:focus { outline: none; border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(90, 160, 108, 0.18); }
.xt-search input::-webkit-search-cancel-button { display: none; }
.xt-search kbd {
  position: absolute;
  right: 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 7px;
  line-height: 20px;
  background: var(--paper);
}
.xt-search input:focus ~ kbd { opacity: 0; }

/* back + switcher */
.xt-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.xt-back:hover { border-color: var(--green-bright); color: var(--green); }

.xt-switch { position: relative; min-width: 0; flex: 0 1 340px; }
.xt-switch select,
.xt-field select,
.xt-dd-btn {
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6862' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 44px 12px 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.xt-switch select:hover,
.xt-dd-btn:hover { border-color: #c9cfca; }
.xt-switch select:focus,
.xt-field select:focus,
.xt-dd-btn:focus-visible,
.xt-dd.open .xt-dd-btn { outline: none; border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(90, 160, 108, 0.18); }

/* ---- custom dropdown (replaces native <select> on mouse/trackpad devices) ---- */
.xt-dd { position: relative; }
.xt-dd.open { z-index: 45; }
.xt-dd > select { display: none; }
.xt-dd.open .xt-dd-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='%232d4a32' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.xt-dd-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: min(340px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 48px -20px rgba(0, 0, 0, 0.35);
  animation: xt-dd-in 0.14s var(--ease);
}
.xt-dd.up .xt-dd-list { top: auto; bottom: calc(100% + 6px); }
.xt-dd-list:focus { outline: none; }
@keyframes xt-dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.xt-dd-group {
  padding: 12px 12px 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
}
.xt-dd-group:first-child { padding-top: 6px; }
.xt-dd-opt {
  position: relative;
  padding: 9px 36px 9px 12px;
  border-radius: 3px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.xt-dd-opt.is-active { background: var(--green-soft); }
.xt-dd-opt[aria-selected="true"] { color: var(--green); font-weight: 600; }
.xt-dd-opt[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 6px;
  margin-top: -5px;
  border-left: 2px solid var(--green-bright);
  border-bottom: 2px solid var(--green-bright);
  transform: rotate(-45deg);
}

/* units toggle */
.xt-units {
  display: inline-flex;
  flex: none;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.xt-units button {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 3px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.xt-units button:hover { color: var(--ink); }
.xt-units button[aria-pressed="true"] { background: var(--green); color: var(--white); }

/* ===== 3. HOME: TOOL LAUNCHER ========================================== */

.xt-group + .xt-group { margin-top: 44px; }

.xt-group-h {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.xt-group-h h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
}
.xt-group-h::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.xt-count { font-size: 12px; font-weight: 500; color: var(--muted); order: 2; }
.xt-group-h::after { order: 1; }

.xt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.xt-tile {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.xt-tile .xt-ico { grid-row: 1 / 3; }
.xt-tile-t { font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink); padding-right: 18px; padding-top: 1px; }
.xt-tile-d { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.xt-tile::after {
  content: "\2192";
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 16px;
  color: var(--green-bright);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.xt-tile:hover,
.xt-tile:focus-visible {
  border-color: var(--green-bright);
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -26px rgba(20, 40, 25, 0.45);
}
.xt-tile:hover::after,
.xt-tile:focus-visible::after { opacity: 1; transform: none; }
.xt-tile:hover .xt-ico { background: var(--green); color: var(--white); }

.xt-empty { padding: 40px 0; text-align: center; color: var(--muted); }

.xt-tips {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 56px;
  border-top: 1px solid var(--line);
}
.xt-tips li {
  padding: 22px 24px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.xt-tips strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* ===== 4. TOOL CARD ==================================================== */

.xt-tool {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 30px 60px -40px rgba(0, 0, 0, 0.35);
  animation: xt-in 0.35s var(--ease);
}
@keyframes xt-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.xt-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 30px 34px 26px;
  border-bottom: 1px solid var(--line);
}
.xt-head h2 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 300; letter-spacing: -0.015em; line-height: 1.15; margin: 2px 0 6px; }
.xt-head p { color: var(--muted); font-size: 15px; max-width: 70ch; }

.xt-reset {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.xt-reset .ic { width: 15px; height: 15px; }
.xt-reset:hover { color: var(--ink); border-color: var(--muted); }

.xt-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 34px;
  padding: 32px 34px 34px;
  align-items: start;
}

/* ===== 5. INPUTS ======================================================= */

.xt-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 20px;
  align-content: start;
}
.xt-field { min-width: 0; }
.xt-field.xt-wide { grid-column: 1 / -1; }

.xt-field label,
.xt-lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.xt-field label em,
.xt-lbl em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #98a19b;
  margin-left: 4px;
}

.xt-input { position: relative; }
.xt-input input {
  width: 100%;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #d6dbd5;
  border-radius: var(--radius);
  padding: 13px 92px 13px 16px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.xt-input input::placeholder { color: #b5bcb7; font-weight: 300; }
.xt-input input:hover { border-color: #c2c9c3; }
.xt-input input:focus { outline: none; border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(90, 160, 108, 0.18); }
.xt-input input.is-bad { border-color: #d98b7f; box-shadow: 0 0 0 3px rgba(217, 139, 127, 0.15); }
.xt-input.is-ignored input { background: var(--paper); color: var(--muted); }

.xt-sfx {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.xt-field select,
.xt-field .xt-dd-btn { font-size: 16.5px; font-weight: 400; padding: 13px 44px 13px 16px; border-color: #d6dbd5; }

.xt-hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* quick-pick chips */
.xt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.xt-chips button {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.xt-chips button:hover { color: var(--green); border-color: var(--green-bright); }
.xt-chips button.is-on { color: var(--green); background: var(--green-soft); border-color: #bcd6c2; }

/* segmented control */
.xt-seg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 4px;
  gap: 2px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.xt-seg button {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 3px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.xt-seg button:hover { color: var(--ink); }
.xt-seg button[aria-checked="true"] { background: var(--white); color: var(--green); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

/* on/off switch */
.xt-field .xt-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}
.xt-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.xt-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 24px;
  background: #cfd5d0;
  transition: background-color 0.2s var(--ease);
  flex: none;
}
.xt-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.xt-check input:checked + .xt-toggle { background: var(--green-bright); }
.xt-check input:checked + .xt-toggle::after { transform: translateX(18px); }
.xt-check input:focus-visible + .xt-toggle { outline: 2px solid var(--green-bright); outline-offset: 3px; }

/* ===== 6. READOUT (dark "DRO" panel) =================================== */

.xt-readout {
  position: sticky;
  top: 196px;
  background: var(--graphite);
  background-image: radial-gradient(420px 220px at 100% 0%, rgba(45, 74, 50, 0.38), transparent 70%);
  color: var(--text-on-dark);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  min-width: 0;
}

.xt-hero { position: relative; padding-bottom: 20px; }
.xt-hero-2 { padding-top: 18px; border-top: 1px solid var(--line-dark); }

.xt-k {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--platinum);
  margin-bottom: 6px;
}

.xt-big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: clamp(38px, 4.2vw, 54px);
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.xt-bu {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-bright);
}
.xt-sub { display: block; margin-top: 6px; font-size: 14px; color: var(--muted-on-dark); font-variant-numeric: tabular-nums; }
.xt-sub:empty { display: none; }

.xt-rows { border-top: 1px solid var(--line-dark); }
.xt-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-dark);
}
.xt-rows dt { font-size: 13.5px; color: var(--muted-on-dark); }
.xt-rows dd {
  font-size: 16px;
  font-weight: 400;
  color: var(--white);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xt-rows dd span { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted-on-dark); }

/* empty state + click-to-copy */
.xt-val.is-empty output { color: rgba(255, 255, 255, 0.28); }
.xt-big.is-empty .xt-bu { opacity: 0.35; }
.xt-val:not(.is-empty) { cursor: copy; border-radius: 3px; transition: background-color 0.15s var(--ease); }
.xt-val:not(.is-empty):hover { background: rgba(255, 255, 255, 0.05); }
.xt-val:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.xt-val.flash { background: rgba(90, 160, 108, 0.22) !important; }

.xt-msg { font-size: 13.5px; line-height: 1.55; color: var(--muted-on-dark); margin-top: 16px; }
.xt-msg:empty { display: none; }
.xt-msg.is-warn { color: #f0b98a; }

.xt-badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
}
.xt-badge.pass { background: rgba(90, 160, 108, 0.18); color: #8fd6a1; box-shadow: inset 0 0 0 1px rgba(90, 160, 108, 0.45); }
.xt-badge.fail { background: rgba(229, 115, 115, 0.14); color: #ff9f9f; box-shadow: inset 0 0 0 1px rgba(229, 115, 115, 0.45); }
.xt-badge.info { background: rgba(255, 255, 255, 0.07); color: var(--text-on-dark); box-shadow: inset 0 0 0 1px var(--line-dark); }

/* live diagrams */
.xt-fig {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  overflow: visible;
}
.xt-fig:empty { display: none; }
.xt-fig.xt-fig-top { margin: 0 0 18px; padding: 0; border: none; }
.xt-fig text { font-family: var(--font); font-size: 11px; fill: var(--muted-on-dark); }
.xt-fig .t-acc { fill: var(--green-bright); font-weight: 600; }
.xt-fig .t-strong { fill: var(--white); font-weight: 500; }
.xt-fig .ln { fill: none; stroke: rgba(233, 236, 233, 0.6); stroke-width: 1.5; }
.xt-fig .ln-soft { fill: none; stroke: rgba(233, 236, 233, 0.22); stroke-width: 1; }
.xt-fig .ln-dash { fill: none; stroke: rgba(233, 236, 233, 0.35); stroke-width: 1; stroke-dasharray: 3 4; }
.xt-fig .acc { fill: none; stroke: var(--green-bright); stroke-width: 2; }
.xt-fig .acc-dash { fill: none; stroke: var(--green-bright); stroke-width: 1.5; stroke-dasharray: 4 4; }
.xt-fig .mat { fill: rgba(233, 236, 233, 0.07); stroke: rgba(233, 236, 233, 0.45); stroke-width: 1.2; }
.xt-fig .zone { fill: rgba(90, 160, 108, 0.14); stroke: var(--green-bright); stroke-width: 1.5; }
.xt-fig .zone.bad { fill: rgba(229, 115, 115, 0.12); stroke: #e57373; }
.xt-fig .dot { fill: var(--green-bright); }
.xt-fig .dot.bad { fill: #ff8a80; }
.xt-fig .solid { fill: rgba(233, 236, 233, 0.75); }
.xt-fig .hole { fill: var(--graphite); stroke: rgba(233, 236, 233, 0.7); stroke-width: 1.4; }
.xt-fig .hole.first { stroke: var(--green-bright); stroke-width: 2; }

/* thread limits chart (over-wires tool) */
.xt-chart-title { color: var(--green-bright); margin-bottom: 10px; }
.xt-chart-title:empty { display: none; }
.xt-chart { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.xt-chart thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--platinum);
  text-align: right;
  padding: 0 0 10px;
}
.xt-chart tbody th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-bright);
  padding: 10px 0;
  border-top: 1px solid var(--line-dark);
}
.xt-chart td {
  text-align: right;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--white);
  padding: 8px 0 8px 14px;
  border-top: 1px solid var(--line-dark);
}
.xt-chart td.xt-val { border-radius: 0; }

.xt-reading { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-dark); }
.xt-reading .xt-badge { margin-right: 10px; }
.xt-reading .xt-sub { display: inline-block; }
.xt-fig.xt-band { margin-top: 14px; padding-top: 0; border-top: none; }

/* bolt-circle coordinate table */
.xt-table-wrap:empty { display: none; }
.xt-table-wrap { max-height: 300px; overflow: auto; border-top: 1px solid var(--line-dark); }
.xt-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.xt-table th {
  position: sticky;
  top: 0;
  background: var(--graphite);
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--platinum);
  padding: 10px 6px;
  border-bottom: 1px solid var(--line-dark);
}
.xt-table td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line-dark); color: var(--white); }
.xt-table th:first-child, .xt-table td:first-child { text-align: left; color: var(--green-bright); }
.xt-table td:nth-child(2) { color: var(--muted-on-dark); }

.xt-copyall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--green-bright);
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.xt-copyall .ic { width: 16px; height: 16px; }
.xt-copyall:hover { background: #6cb47e; }

/* ===== 7. CARD FOOTER ================================================== */

.xt-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 28px;
  padding: 18px 34px;
  background: #fafbfa;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 13.5px;
  color: var(--muted);
}
.xt-formula { font-variant-numeric: tabular-nums; }
.xt-formula .sep { margin: 0 10px; color: #b5bcb7; }
.xt-related a {
  color: var(--green);
  font-weight: 600;
  margin-left: 14px;
  border-bottom: 1px solid rgba(90, 160, 108, 0.5);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.xt-related a:hover { color: var(--green-bright); border-color: var(--green-bright); }

.xt-disclaimer { margin-top: 40px; font-size: 13px; color: var(--muted); max-width: 80ch; }

/* ===== 8. COPY TOAST =================================================== */

.xt-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: var(--graphite);
  color: var(--white);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 100px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.xt-toast.show { opacity: 1; transform: translate(-50%, 0); }
.xt-toast strong { color: var(--green-bright); font-weight: 600; }

/* ===== 9. RESPONSIVE =================================================== */

@media (max-width: 1000px) {
  .xt-body { grid-template-columns: 1fr; }
  .xt-readout { position: static; }
  .xt-tips { grid-template-columns: repeat(2, 1fr); }
}

.xt-units .u-short { display: none; }

@media (max-width: 680px) {
  .xt-bar { gap: 8px; padding: 10px 0; margin-bottom: 16px; }
  .xt-bar-home, .xt-bar-tool { gap: 8px; }
  .xt-search input { font-size: 15px; padding: 12px 12px 12px 42px; }
  .xt-search .ic { left: 13px; }
  .xt-search kbd { display: none; }
  .xt-switch { flex: 1 1 auto; }
  .xt-switch select,
  .xt-switch .xt-dd-btn { font-size: 14.5px; padding: 11px 36px 11px 12px; background-position: right 12px center; }
  .xt-back { padding: 11px 12px; }
  .xt-back span { display: none; }
  .xt-units { padding: 3px; }
  .xt-units button { padding: 8px 10px; letter-spacing: 0.06em; }
  .xt-units .u-long { display: none; }
  .xt-units .u-short { display: inline; }

  .xt-tiles { grid-template-columns: 1fr; gap: 10px; }
  .xt-tile { padding: 16px 18px; }
  .xt-tile-d { font-size: 13px; }
  .xt-group + .xt-group { margin-top: 34px; }
  .xt-tips { grid-template-columns: 1fr; }

  /* icon + title on one line, description full width underneath */
  .xt-head { grid-template-columns: auto 1fr auto; padding: 20px 20px 20px; gap: 12px 14px; align-items: center; }
  .xt-head > div { display: contents; }
  .xt-head h2 { margin: 0; font-size: 23px; }
  .xt-head p { grid-column: 1 / -1; grid-row: 2; font-size: 14.5px; }
  .xt-head .xt-ico.lg { width: 44px; height: 44px; }
  .xt-reset { padding: 8px 10px; }
  .xt-body { padding: 22px 20px 24px; gap: 24px; }
  .xt-inputs { grid-template-columns: 1fr; gap: 18px; }
  .xt-readout { padding: 22px 20px 20px; }
  .xt-foot { padding: 16px 20px; }
  .xt-related a:first-of-type { margin-left: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .xt-tool { animation: none; }
  .xt-tile, .xt-tile::after { transition: none; }
}
