/* BT Engineering — base stylesheet. Dark, shop-floor-readable, mobile first. */
:root {
  --bg: #14181d;
  --panel: #1d232b;
  --border: #2c343f;
  --text: #dde3ea;
  --muted: #8a94a1;
  --accent: #e8a33d;      /* machine-tool amber */
  --accent-2: #4fa3d1;
  --radius: 10px;
  --maxw: 1100px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent-2); text-decoration: none; }

.site-header { border-bottom: 1px solid var(--border); background: var(--panel); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.site-header nav a { color: var(--muted); margin-left: 1.1rem; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }

.hero { padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 1.9rem; margin: 0 0 0.4rem; }
.hero p { color: var(--muted); margin: 0; }

h2 { margin: 2.2rem 0 1rem; font-size: 1.3rem; border-left: 3px solid var(--accent); padding-left: 0.6rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.card { display: block; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; color: var(--text); position: relative;
  transition: border-color 0.15s; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.badge { position: absolute; top: 0.7rem; right: 0.7rem; font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--accent); color: #14181d; }
.badge.soon { background: var(--border); color: var(--muted); }

.ad-slot { margin: 1.5rem auto; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; }
/* An empty slot collapses to nothing, so the live site never shows a blank box.
   Put ad unit markup inside a slot and it starts occupying space again on its own. */
.ad-slot:empty { display: none; }
.ad-leaderboard { max-width: 728px; min-height: 90px; }
.ad-rect { max-width: 336px; min-height: 280px; }

.muted { color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.2rem 0 2rem;
  font-size: 0.85rem; color: var(--muted); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.45rem; }
  .site-header nav a { margin-left: 0.7rem; font-size: 0.85rem; }
}

/* ---------- Tool & reference pages ---------- */
.tool-head { padding: 1.6rem 0 0.4rem; }
.tool-head h1 { font-size: 1.5rem; margin: 0 0 0.3rem; }
.tool-head p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.panel { background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.panel h2 { margin: 0 0 0.8rem; border: none; padding: 0; font-size: 1.05rem; }

.field-row { display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; margin-bottom: 0.4rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field > span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.field small { color: var(--muted); font-size: 0.72rem; }
input[type=text], input[type=number], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 0.6rem; font-size: 1rem; min-width: 7.5rem;
  font-family: Consolas, "Cascadia Mono", monospace; }
select { font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent-2); }
input.linked { border-left: 3px solid var(--accent-2); }

/* Segmented control (mode / form pickers) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: none; color: var(--muted); padding: 0.5rem 1rem;
  font-size: 0.92rem; cursor: pointer; border-left: 1px solid var(--border); }
.seg button:first-child { border-left: none; }
.seg button.on { background: var(--accent); color: #14181d; font-weight: 700; }

/* Range slider */
.slider-row { display: flex; align-items: center; gap: 0.8rem; }
.slider-row input[type=range] { flex: 1; accent-color: var(--accent); min-width: 8rem; }
.slider-val { font-family: Consolas, monospace; font-weight: 700; color: var(--accent);
  min-width: 3.2rem; text-align: right; font-size: 1.05rem; }

/* Results table */
table.res { width: 100%; border-collapse: collapse; }
table.res td { padding: 0.45rem 0.6rem; border-top: 1px solid var(--border); font-size: 0.95rem; }
table.res tr:first-child td { border-top: none; }
table.res td.l { color: var(--muted); }
table.res td.v { font-family: Consolas, "Cascadia Mono", monospace; font-weight: 700;
  text-align: right; white-space: nowrap; }
table.res td.v .unit { color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-left: 0.25rem; }
table.res tr.hero-row td.v { color: var(--accent); font-size: 1.25rem; }
table.res tr.sec td { background: var(--bg); color: var(--accent-2); font-weight: 700;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; }

/* Data table (drill chart etc.) */
table.data { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data th { text-align: left; background: var(--bg); padding: 0.5rem 0.7rem;
  font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: 0; }
table.data th.sorted { color: var(--accent); }
table.data td { padding: 0.4rem 0.7rem; border-top: 1px solid var(--border); font-size: 0.92rem; }
table.data td.num { font-family: Consolas, "Cascadia Mono", monospace; text-align: right; }
table.data tr.hl td { background: rgba(232, 163, 61, 0.12); }
.table-scroll { overflow-x: auto; }

/* Notes */
.note { font-size: 0.85rem; color: var(--accent); background: rgba(232, 163, 61, 0.08);
  border: 1px solid rgba(232, 163, 61, 0.35); border-radius: 6px; padding: 0.55rem 0.8rem; margin: 0.8rem 0; }
.note.info { color: var(--accent-2); background: rgba(79, 163, 209, 0.08);
  border-color: rgba(79, 163, 209, 0.35); }

/* Material cards */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.9rem; }
.mat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; }
.mat-card h3 { margin: 0; font-size: 1.05rem; }
.mat-card .cat { color: var(--muted); font-size: 0.78rem; margin: 0.1rem 0 0.5rem; }
.mat-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; margin: 0.4rem 0; font-size: 0.85rem; }
.mat-card dt { color: var(--muted); }
.mat-card dd { margin: 0; font-family: Consolas, monospace; text-align: right; }
.mat-card .notes { font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--border);
  padding-top: 0.5rem; margin-top: 0.5rem; line-height: 1.45; }

/* Filter/search bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1rem 0; }
.filter-bar input[type=text] { flex: 1; min-width: 10rem; font-family: inherit; }
.chip { border: 1px solid var(--border); background: none; color: var(--muted); border-radius: 999px;
  padding: 0.3rem 0.8rem; font-size: 0.85rem; cursor: pointer; }
.chip.on { border-color: var(--accent); color: var(--accent); }

/* Prose pages (about, privacy, ...) */
.prose { max-width: 46rem; }
.prose h1 { font-size: 1.5rem; margin: 1.6rem 0 0.6rem; }
.prose h2 { margin: 1.6rem 0 0.6rem; }
.prose p, .prose li { color: var(--text); font-size: 0.95rem; }
.prose .updated { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 600px) {
  .field-row { gap: 0.6rem 0.8rem; }
  input[type=text], input[type=number], select { min-width: 6rem; font-size: 16px; }
}
