/* ================================================================
   SchergenCIDR – Styles
   Gleiche Farbwelt wie Startseite und Planner.
   ================================================================ */

:root {
  --bg:            #0e1016;
  --surface:       rgba(255, 255, 255, .045);
  --surface-2:     rgba(255, 255, 255, .075);
  --line:          rgba(255, 255, 255, .10);
  --line-soft:     rgba(255, 255, 255, .06);
  --text:          #e8ebf2;
  --text-dim:      #98a1b5;
  --accent:        #7aa2ff;
  --accent-strong: #5b86ff;
  --accent-2:      #b98cff;
  --ok:            #2fd68b;
  --warn:          #ffc861;
  --off:           #ff5468;
  --radius:        16px;
  --shadow:        0 18px 45px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 12% -10%, #26304a 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a2140 0%, transparent 55%);
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover  { background: var(--surface-2); border-color: rgba(255,255,255,.18); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #0b1020;
  font-weight: 650;
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--sm    { padding: .35rem .7rem; font-size: .84rem; }

/* ----------------------------------------------------------------
   Kopfzeile
   ---------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 16, 22, .72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.topbar__logo  { font-size: 1.25rem; }
.topbar__right { display: flex; align-items: center; gap: .75rem; }
.topbar__note  {
  color: var(--text-dim);
  font-size: .8rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 3rem;
  display: grid;
  gap: clamp(1rem, 2vw, 1.4rem);
}

/* ----------------------------------------------------------------
   Karten
   ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem clamp(1rem, 2vw, 1.3rem) 1.2rem;
}
.card--input { box-shadow: var(--shadow); }
.card[hidden] { display: none; }

.card__head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card__title { font-size: 1.1rem; font-family: var(--mono); letter-spacing: -.01em; }
.card__hint  { color: var(--text-dim); font-size: .86rem; margin: .3rem 0 .9rem; }
.card__head .btn { margin-left: auto; }

.pill {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 650;
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(122,162,255,.35);
  background: rgba(122,162,255,.12);
  color: #b9ccff;
}

.sub {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .5rem;
}

/* ----------------------------------------------------------------
   Reiter und Eingabe
   ---------------------------------------------------------------- */
.tabs {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  margin-bottom: 1.1rem;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  padding: .35rem 1.1rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-2); color: var(--text); }

.pane[hidden] { display: none; }

.field { display: block; margin-bottom: .9rem; }
.field > span {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: .35rem;
}
.field input {
  width: 100%;
  padding: .7rem .85rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 1.02rem;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}
.field--inline { margin: 0; }
.field--inline input { font-size: .95rem; padding: .5rem .7rem; width: 9rem; }
.field--grow { flex: 1; }
.field--grow input { width: 100%; }

.slider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .4rem;
}
.slider label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  min-width: 0;
}
.slider output {
  font-family: var(--mono);
  font-weight: 650;
  min-width: 3.6ch;
  color: var(--accent);
}

.err {
  background: rgba(255, 84, 104, .13);
  border: 1px solid rgba(255, 84, 104, .35);
  color: #ffc3ca;
  border-radius: 10px;
  padding: .55rem .75rem;
  font-size: .87rem;
  margin: .6rem 0 0;
}
.err[hidden] { display: none; }

.samples { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1rem; }
.samples__label { font-size: .78rem; color: var(--text-dim); margin-right: .2rem; }
.chip-btn {
  font: inherit;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: .22rem .65rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.chip-btn:hover { color: var(--accent); border-color: rgba(122,162,255,.4); }

/* ----------------------------------------------------------------
   Ergebnisliste
   ---------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 1px;
  margin: 0 0 1.4rem;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
}
.facts__key,
.facts__val {
  background: rgba(14, 16, 22, .55);
  margin: 0;
  padding: .5rem .8rem;
  display: flex;
  align-items: center;
  min-width: 0;
}
.facts__key { color: var(--text-dim); font-size: .84rem; }
.facts > .facts__key:nth-of-type(odd),
.facts > .facts__val:nth-of-type(odd) { background: rgba(255, 255, 255, .015); }

.val {
  font: inherit;
  font-family: var(--mono);
  font-size: .92rem;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: copy;
  border-radius: 5px;
  overflow-wrap: anywhere;
  transition: color .12s;
}
.val:hover { color: var(--accent); }
.val:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----------------------------------------------------------------
   Bitmuster
   ---------------------------------------------------------------- */
.bits__hint { color: var(--text-dim); font-size: .78rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.bits__key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.bits__key--net  { background: rgba(122, 162, 255, .55); }
.bits__key--host { background: rgba(255, 255, 255, .12); margin-left: .8rem; }

.bits__rows { overflow-x: auto; }
.bitrow {
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.9;
  letter-spacing: .04em;
  white-space: nowrap;
}
.bit { padding: .05rem .01rem; }
.bit--net  { color: #b9ccff; background: rgba(122, 162, 255, .16); }
.bit--host { color: var(--text-dim); }
.bit--edge { box-shadow: inset -2px 0 0 var(--accent-2); }
.bitsep { color: rgba(255,255,255,.25); padding: 0 .3rem; }

/* ----------------------------------------------------------------
   Werkzeuge
   ---------------------------------------------------------------- */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
  align-items: start;
}

.tool-row { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.tool-out { margin-top: .9rem; }
.tool-out:empty { margin-top: 0; }

.note { color: var(--text-dim); font-size: .84rem; margin: 0 0 .6rem; }
.note--warn { color: #ffc3ca; }

.verdict {
  display: flex;
  align-items: center;
  gap: .8rem;
  border-radius: 12px;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.verdict__icon {
  font-size: 1.15rem;
  font-family: var(--mono);
  font-weight: 700;
  width: 2.4rem;
  text-align: center;
  flex: none;
}
.verdict--yes { border-color: rgba(47,214,139,.4);  background: rgba(47,214,139,.12); }
.verdict--yes .verdict__icon { color: var(--ok); }
.verdict--no  { border-color: rgba(255,84,104,.4); background: rgba(255,84,104,.12); }
.verdict--no  .verdict__icon { color: var(--off); }
.verdict strong { font-weight: 600; font-size: .93rem; }
.verdict .note { margin: .15rem 0 0; }

.table-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  margin-bottom: .7rem;
}
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th {
  position: sticky;
  top: 0;
  background: #171b26;
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  font-weight: 600;
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--line);
}
.table td { padding: .35rem .6rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255,255,255,.03); }
.mono   { font-family: var(--mono); }
.strong { color: var(--text); font-weight: 600; }
.dim    { color: var(--text-dim); }

/* ----------------------------------------------------------------
   Fußzeile und Meldung
   ---------------------------------------------------------------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  color: var(--text-dim);
  font-size: .8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
}
.foot__sep { opacity: .5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 140%);
  background: #1c2130;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .6rem 1rem;
  font-size: .87rem;
  font-family: var(--mono);
  box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s;
  opacity: 0;
  z-index: 60;
  max-width: min(90vw, 460px);
  overflow-wrap: anywhere;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { border-color: rgba(255, 84, 104, .5); color: #ffc3ca; }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .facts__key { padding-bottom: 0; background: transparent; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
  .facts > .facts__key:nth-of-type(odd) { background: transparent; }
  .topbar__note { display: none; }
  .field--inline input { width: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
