/* =========================================================
   BTN Tron – SMB.conf + fstab Builder (JS)
   Dark Theme · Responsive · Bündige fstab-Zeile · Help-Icon ohne Layout-Shift
   ========================================================= */

:root{
  /* Farben */
  --bg:#0a1326;
  --bg2:#0b1430;
  --border:#17335e;
  --text:#e8f0ff;
  --muted:#9fb4e6;
  --hi:#00e7ff;
  --hi2:#7b61ff;

  /* Maße */
  --radius:14px;
  --rsm:10px;
  --h:44px;                /* einheitliche Kontrolle-Höhe */
  --gap:12px;
}

/* ---------- Basics ---------- */
*{ box-sizing:border-box }
html,body{ height:100% }
html,body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
}
a{ color:var(--hi); text-decoration:none }

/* ---------- Layout ---------- */
.wrap{ width:min(1200px,96vw); margin:0 auto; padding:14px 16px }

.site-header{
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,rgba(20,36,78,.7),rgba(10,19,38,.6));
}
.site-footer{
  border-top:1px solid var(--border);
  background:linear-gradient(0deg,rgba(20,36,78,.6),rgba(10,19,38,.5));
  margin-top:28px;
}
.nav,.foot{ display:flex; justify-content:space-between; align-items:center; gap:12px }
.brand{ display:flex; align-items:center; gap:12px }
.logo{ width:46px; height:46px }
.badge{
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:linear-gradient(90deg,var(--hi),var(--hi2));
  color:#06122b; font-size:.8rem; margin-bottom:6px;
}
h1{ margin:.2rem 0 0 0; font-size:1.25rem }

/* ---------- Cards & Grids ---------- */
.grid{ display:grid; gap:16px }
@media(min-width:1100px){ .grid{ grid-template-columns:repeat(2,minmax(0,1fr)) } }

.card{
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  display:flex; flex-direction:column; gap:12px;
}
.card h3{ margin:.25rem 0 .4rem 0; font-size:1.05rem; color:#dbe6ff }
.card .actions{ margin-top:6px; display:flex; gap:10px; flex-wrap:wrap }

.grid2{ display:grid; gap:var(--gap); grid-template-columns:1fr 1fr }
@media(max-width:1000px){ .grid2{ grid-template-columns:1fr } }

.grid3{ display:grid; gap:var(--gap); grid-template-columns:repeat(3,1fr) }
@media(max-width:1200px){ .grid3{ grid-template-columns:1fr 1fr } }
@media(max-width:780px){ .grid3{ grid-template-columns:1fr } }

/* fstab-Grid: Device – Mount – Typ – Optionen – dump – pass – Button */
.grid-fstab{
  display:grid; gap:var(--gap);
  grid-template-columns: 2fr 1.2fr 1fr 2fr .6fr .6fr auto;
  align-items:end;            /* >>> alle Zellen unten bündig */
  margin-bottom:12px;
}
@media(max-width:1100px){ .grid-fstab{ grid-template-columns:1fr 1fr } }

/* ---------- Buttons ---------- */
.btn{
  border:1px solid var(--border);
  background:#0a1326;
  color:var(--text);
  height:var(--h);
  padding:0 14px;
  border-radius:var(--rsm);
  cursor:pointer;
  transition:filter .12s ease, transform .02s;
}
.btn:hover{ filter:brightness(1.08) }
.btn:active{ transform:translateY(1px) }
.btn.primary{
  background:linear-gradient(90deg,var(--hi),var(--hi2));
  color:#06122b;
  border-color:transparent;
}
.btn.danger{ border-color:#5b2434; color:#ffb3c0; background:#2a0f18 }
.btn.ghost{ background:transparent }
.grid-fstab > .btn{ align-self:end }   /* >>> Button in fstab-Reihe auch unten bündig */

/* Toolbar */
.toolbar{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:10px 0 }
.toolbar .left,.toolbar .right{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end }

/* ---------- Felder (einheitlich) ---------- */
.fld{ display:flex; flex-direction:column; gap:6px }
.lbl{ display:flex; align-items:center; gap:8px; color:#d5e3ff }

/* Controls */
.fld input,
.fld select,
.fld textarea,
.mono{
  width:100%;
  height:var(--h);
  padding:0 12px;             /* symmetrisch → echte Mitte */
  border:1px solid var(--border);
  border-radius:var(--rsm);
  background:#0a1326;
  color:var(--text);
  outline:none;
  transition:border-color .15s, box-shadow .15s;
  line-height:normal;          /* verhindert „Hochsitzen“ */
}

.fld textarea{ min-height:140px; height:auto; padding:10px }

.fld input:focus,
.fld select:focus,
.fld textarea:focus{
  border-color:var(--hi);
  box-shadow:0 0 0 3px rgba(0,231,255,.12);
}

/* Checkboxen */
.fld input[type=checkbox]{
  width:auto; height:auto; padding:0; margin:0 6px 0 0;
  accent-color: var(--hi);
}

/* Select-Pfeil konsistent */
.fld select{
  -webkit-appearance:none; appearance:none;
  padding-right:32px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%23bcd2ff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}

/* Number-Felder kompakt (dump/pass) */
.fld input[type=number]{ appearance:textfield }
.fld input[type=number]::-webkit-outer-spin-button,
.fld input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0 }
.fld--xs input{ max-width:110px }

/* ---------- Monospace Vorschau ---------- */
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background:#07101f;
  border:1px dashed var(--border);
  border-radius:var(--rsm);
  padding:10px;
  min-height:140px;
  white-space:pre;
  overflow:auto;
}

/* ---------- Hilfe / Popover ---------- */
.help-pop{
  position:absolute; z-index:9999;
  max-width:420px;
  background:#0b1430;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  box-shadow:0 6px 30px rgba(0,0,0,.35);
}

/* >>> Help-Icon OHNE Layout-Shift (absolut, opacity-toggle) */
.fld .lbl{
  position:relative;
  padding-right:22px;          /* Platz rechts fürs Icon; für links: padding-left:22px */
  line-height:1.05;
  min-height:18px;             /* stabile Label-Höhe */
}
.info-btn{
  position:absolute;
  right:2px;                   /* für linke Seite: left:2px; und padding-left nutzen */
  top:-8px;                    /* Icon „über“ der Schrift schweben lassen */
  width:18px; height:18px;
  border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  background:#0a1326; color:#bcd2ff;
  font-size:12px; line-height:1;
  box-shadow:0 2px 10px rgba(0,0,0,.25);
  transition:opacity .15s ease, transform .15s ease;
  transform-origin:center;
  z-index:2;
}
/* Hilfe AUS: ohne Reflow ausblenden (kein display:none) */
:root[data-help="off"] .info-btn{
  opacity:0; pointer-events:none; transform:translateY(-4px) scale(.9);
}
/* Hilfe AN */
:root[data-help="on"] .info-btn{
  opacity:1; transform:none;
}
/* Popover bei Hilfe AUS verstecken (kein Einfluss aufs Layout, da absolute) */
:root[data-help="off"] .help-pop{ display:none !important }
