/* Werkzeug-Referenz – Dashboard/Internal-Tool-Look.
   Master-Detail: Filter | Tabelle | Detail-Panel. Helle Flächen, dünne Linien,
   blaue Akzente, tabellarische Zahlen. Systemfonts (kein Webfont-Ladevorgang). */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --ink: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eef4ff;
  --accent-line: #c7dbfb;
  --warn: #dc2626;
  --warn-bg: #fef2f2;
  --warn-line: #fbc5c5;
  --ok: #16a34a;
  --r: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: "SF Mono", ui-monospace, "Segoe UI", system-ui, sans-serif;
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
:root { color-scheme: light; } /* immer hell – auch bei Dark-Mode-OS */
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { width: 26px; height: 26px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.topbar b { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.topbar .tag { font-size: 12.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .home { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Shell (Master-Detail) ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.panel { background: var(--surface); }

/* Filterspalte */
.filters { padding: 16px; border-bottom: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
#q {
  width: 100%; height: 42px; font-size: 15px; padding: 0 12px 0 34px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink);
  outline: none; font-variant-numeric: tabular-nums;
}
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#q::placeholder { color: var(--muted-2); }

/* Kategorie-Liste */
.catlist { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.catlist::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 550; cursor: pointer;
  white-space: nowrap;
}
.cat:hover { background: #f9fafb; }
.cat[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hover); }
.cat .n { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cat[aria-selected="true"] .n { color: var(--accent); }
.catdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; flex-shrink: 0; }

/* ---------- Tabelle ---------- */
.tablewrap { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.tabletop { display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid var(--line); }
.tabletop .res { font-size: 13px; color: var(--muted); font-weight: 600; }
.tabletop .res b { color: var(--ink); }
.tablescroll { overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid thead th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.03em; padding: 9px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.grid tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #f9fafb; }
.grid tbody tr.sel td { background: var(--accent-soft); }
.grid tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.grid .name { font-weight: 600; color: var(--ink); }
.grid .name a { color: inherit; }
.tagpill { display: inline-block; font-size: 11.5px; color: var(--muted); background: #f3f4f6;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tagpill--gewinde, .tagpill--zollgewinde { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.tagpill--rohrgewinde { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.tagpill--schluesselweite, .tagpill--vierkant { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.tagpill--bit { background: #faf5ff; border-color: #e9d5ff; color: #7c3aed; }
.tagpill--drehmoment { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.kv { display: inline-flex; align-items: baseline; gap: 5px; margin-right: 12px; }
.kv b { font-weight: 650; font-variant-numeric: tabular-nums; }
.kv b small { font-weight: 500; color: var(--muted); font-size: 11px; }
.kv i { font-style: normal; font-size: 11.5px; color: var(--muted-2); }
.row-warn { color: var(--warn); font-weight: 700; }

/* ---------- Detail-Panel ---------- */
.detail { display: none; }
.detail .dhead { padding: 20px 20px 0; }
.detail .dkicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.detail h2 { margin: 6px 0 2px; font-size: 24px; font-weight: 680; letter-spacing: -0.02em; }
.detail .dsub { font-size: 12.5px; color: var(--muted); }
.tabsbar { display: flex; gap: 18px; padding: 14px 20px 0; border-bottom: 1px solid var(--line); }
.tabbtn { background: none; border: none; padding: 0 0 11px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabbtn[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.dbody { padding: 18px 20px 30px; overflow: auto; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.stat.full { grid-column: 1 / -1; }
.stat .sk { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat .sv { margin-top: 4px; font-size: 23px; font-weight: 680; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .sv small { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .sv.txt { font-size: 15.5px; font-weight: 600; }

.explain { margin-top: 14px; border: 1px solid var(--line); background: #f9fafb; border-radius: var(--r);
  padding: 13px 14px; font-size: 13px; line-height: 1.5; color: #374151; }
.explain h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); }
.explain p { margin: 0 0 8px; }
.explain p:last-child { margin-bottom: 0; }
.explain b { color: var(--ink); }

.warnbox { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn);
  border-radius: var(--r); padding: 12px 13px; font-size: 13px; font-weight: 550; line-height: 1.4; }
.warnbox svg { flex: 0 0 18px; margin-top: 1px; }

.buylist { display: grid; gap: 9px; }
.buyhead { font-size: 12px; color: var(--muted); margin: 0 0 2px; font-weight: 600; }
.buy {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: 0 14px; border-radius: var(--r); text-decoration: none;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-hover);
  font-weight: 600; font-size: 14px;
}
.buy:hover { background: #e2edff; }
.buy.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.buy.primary:hover { background: var(--accent-hover); }
.buy .sub { font-weight: 500; font-size: 12px; opacity: .8; margin-left: 6px; }
.buy .arr { font-weight: 700; }

.related { margin-top: 22px; }
.related h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--ink); font-weight: 550; font-size: 13px; }
.chip:hover { background: #f9fafb; border-color: var(--line-2); }
.dsrc { margin-top: 18px; font-size: 11.5px; color: var(--muted-2); }

.empty { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

/* Detail-Seite (SEO, einspaltig) */
.page { max-width: 880px; margin: 22px auto; padding: 0 18px; }
.back { display: inline-flex; align-items: center; gap: 6px; height: 34px; color: var(--muted);
  font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card .dhead { padding: 22px 22px 0; }
.card .dbody { padding: 20px 22px 24px; }

footer { color: var(--muted); font-size: 12.5px; padding: 26px 18px 40px; max-width: 880px; margin: 0 auto; }
footer a { color: var(--muted); text-decoration: underline; }

/* ---------- Topbar-Navigation ---------- */
.topnav { display: flex; gap: 4px; }
.topnav a { font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 7px 11px; border-radius: 7px; }
.topnav a:hover { background: var(--panel, #f3f4f6); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Link Eintrag -> Ratgeber */
.postlink { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 7px 12px; border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent-hover); border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.postlink:hover { background: #e2edff; }

/* ---------- Ratgeber-Beitrag ---------- */
.posttitle { margin: 6px 0 4px; font-size: 27px; line-height: 1.2; letter-spacing: -0.02em; }
.post .dsub { font-size: 13px; color: var(--muted); }
.tldr { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px;
  padding: 14px 16px; margin: 4px 0 22px; }
.tldr h2 { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent-hover); }
.tldr ul { margin: 0; padding-left: 18px; }
.tldr li { margin: 5px 0; font-size: 14px; color: #1f2937; }
.prose { font-size: 15.5px; line-height: 1.62; color: #1f2937; }
.prose h2 { font-size: 19px; letter-spacing: -0.01em; margin: 24px 0 8px; }
.prose h3 { font-size: 16px; margin: 18px 0 6px; }
.prose p { margin: 0 0 13px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose a { text-decoration: underline; }
.prose code { background: var(--panel, #f3f4f6); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: 13px; }
.prose table { width: 100%; border-collapse: collapse; margin: 4px 0 18px; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--panel, #f3f4f6); font-weight: 650; color: var(--ink); white-space: nowrap; }
.prose tbody tr:nth-child(even) td { background: #fafbfc; }
.prose .table-scroll { overflow-x: auto; }
.buy.affiliate { margin: 18px 0 6px; }

.faq { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.faq h2 { font-size: 17px; margin: 0 0 10px; }
.faq details { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14.5px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 14px; color: var(--muted); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq .fa { padding: 0 14px 13px; font-size: 14px; line-height: 1.55; color: #374151; }

/* Ratgeber-Abschnitt auf der Eintragsseite (konsolidiert) */
.guide { margin-top: 8px; }
.guide-sep { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.guide-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 14px; }

/* Ratgeber-Index */
.ratlead { font-size: 15px; color: var(--muted); max-width: 620px; margin: 0 0 22px; }
.postgrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.postcard { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 16px;
  background: var(--surface); }
.postcard:hover { border-color: var(--line-2); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.pc-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.postcard h2 { margin: 7px 0 6px; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); }
.postcard p { margin: 0 0 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.pc-date { font-size: 12px; color: var(--muted-2); }
@media (min-width: 760px) { .postgrid { grid-template-columns: 1fr 1fr; } }

/* ---------- Desktop: 3 Spalten ---------- */
@media (min-width: 1024px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr) 400px; }
  .filters { border-bottom: none; border-right: 1px solid var(--line); height: calc(100vh - var(--topbar-h));
    position: sticky; top: var(--topbar-h); }
  .field.cat-field > label { margin-top: 4px; }
  .catlist { flex-direction: column; overflow: visible; }
  .cat { width: 100%; justify-content: space-between; height: 38px; }
  .tablewrap { border-right: 1px solid var(--line); height: calc(100vh - var(--topbar-h)); }
  .tablescroll { flex: 1; }
  .tabletop { position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .detail { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h));
    position: sticky; top: var(--topbar-h); }
}
@media (min-width: 1500px) {
  .shell { grid-template-columns: 300px minmax(0, 1fr) 440px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Schmal (Mobile/Tablet ohne Detail-Panel) ---------- */
@media (max-width: 1023px) {
  .tablescroll { -webkit-overflow-scrolling: touch; }
  .grid td.tnum { white-space: normal; }
  .kv { margin: 0 10px 2px 0; }
}
@media (max-width: 620px) {
  .grid thead th:nth-child(2), .grid tbody td:nth-child(2) { display: none; } /* Kategorie ausblenden */
  .grid thead th, .grid tbody td { padding-left: 14px; padding-right: 14px; }
  .grid .kv { display: inline-flex; }
  .grid td.name { font-size: 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  .grid tbody tr td, .buy, .cat { transition: background-color .1s ease; }
}
/* Bewusst kein Dark-Mode: immer helles, kontrastreiches Werkstatt-Design. */
