/* Taschen - Elektrotechnik-Rechner | M. Benning 2026 */
:root {
  --bg: #1a1612;
  --bg-card: #221c17;
  --bg-elev: #2a2319;
  --border: #3a302a;
  --text: #ebe3d9;
  --text-dim: #a89c8e;
  --accent: #9f8fb8;       /* Lavendel */
  --accent-2: #7a5a48;     /* Mokka */
  --accent-soft: rgba(159, 143, 184, 0.15);
  --ok: #7fb886;
  --warn: #d4a35a;
  --err: #d97a6c;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.35);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Lora', 'Iowan Old Style', Georgia, serif;
}
html.light {
  --bg: #f5f0e8;
  --bg-card: #ffffff;
  --bg-elev: #f0e9dc;
  --border: #d9cfbf;
  --text: #2a2319;
  --text-dim: #6e5f50;
  --accent: #7a5a48;
  --accent-2: #9f8fb8;
  --accent-soft: rgba(122, 90, 72, 0.10);
  --shadow: 0 2px 10px rgba(50,30,10,0.08);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.01em; margin: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 30px; filter: drop-shadow(0 0 6px var(--accent-soft)); }
.topbar h1 { font-size: 22px; }
.sub { margin: 2px 0 0; color: var(--text-dim); font-size: 12.5px; }
.theme-btn {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); width: 40px; height: 40px;
  border-radius: 50%; font-size: 18px; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.theme-btn:hover { transform: rotate(20deg); border-color: var(--accent); }

.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  overflow-x: auto; scrollbar-width: thin;
}
.tab {
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); padding: 7px 14px;
  border-radius: 999px; cursor: pointer; font-size: 13.5px;
  font-family: inherit; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tab:hover { color: var(--text); background: var(--bg-elev); }
.tab.active {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent);
}

main { max-width: 920px; margin: 0 auto; padding: 24px 16px 80px; }
.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 22px; margin-bottom: 4px; color: var(--accent); }
.hint { color: var(--text-dim); font-size: 13px; margin: 4px 0 18px; }

.grid-2, .grid-3 {
  display: grid; gap: 14px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; color: var(--text-dim);
  letter-spacing: 0.02em;
}
input[type="number"], input[type="search"], input[type="text"], select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-s);
  font-family: inherit; font-size: 14.5px;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--bg); }

.combo { display: flex; gap: 6px; }
.combo input { flex: 1 1 60%; }
.combo select { flex: 0 1 90px; }

.row-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 10px 18px;
  border-radius: var(--radius-s); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: #1a1612; border-color: var(--accent);
}
html.light .btn.primary { color: #fff; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.1); }

.result {
  margin-top: 22px; padding: 16px;
  background: var(--bg-elev); border-left: 3px solid var(--accent);
  border-radius: var(--radius-s);
  min-height: 24px;
  font-variant-numeric: tabular-nums;
}
.result:empty { display: none; }
.result .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.result .row:last-child { border-bottom: 0; }
.result .row .k { color: var(--text-dim); }
.result .row .v { color: var(--text); font-weight: 500; }
.result .note { margin-top: 10px; font-size: 13px; }
.result .note.ok { color: var(--ok); }
.result .note.warn { color: var(--warn); }
.result .note.err { color: var(--err); }
.result .big { font-size: 24px; color: var(--accent); font-family: var(--font-head); }

.src {
  margin: 16px 0 0; font-size: 11.5px;
  color: var(--text-dim); font-style: italic;
  padding-top: 12px; border-top: 1px dashed var(--border);
}

/* Cable table */
.table-wrap { overflow-x: auto; margin-top: 14px; border-radius: var(--radius-s); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-elev); color: var(--text-dim); font-weight: 500; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--accent-soft); }

/* Mini-Tabellen (IP) */
.mini { font-size: 13px; }
.mini td { padding: 5px 8px; vertical-align: top; }
.mini td:first-child { color: var(--accent); font-weight: 600; width: 30px; }

.ref-table { margin-top: 16px; }
.ref-table summary { cursor: pointer; padding: 8px 0; color: var(--accent); font-size: 14px; }

.svg-diag { width: 100%; max-width: 320px; margin: 14px 0 0; display: block; }

footer {
  text-align: center; padding: 24px 16px;
  color: var(--text-dim); font-size: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 540px) {
  .topbar { padding: 14px; }
  .topbar h1 { font-size: 19px; }
  .sub { font-size: 11.5px; }
  main { padding: 16px 10px 60px; }
  .card { padding: 16px; border-radius: 10px; }
  .card h2 { font-size: 19px; }
  .tabs { padding: 8px 10px; }
  .tab { padding: 6px 11px; font-size: 12.5px; }
}
