/* ================================================================
   SchergenMail – Styles
   Gleiche Farbwelt wie die übrigen Werkzeuge.
   ================================================================ */

: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;
  --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; }
code { font-family: var(--mono); font-size: .92em; }

kbd {
  font: inherit;
  font-size: .78em;
  font-weight: 600;
  padding: .1em .4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.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, Kopfzeile, Gerüst
   ---------------------------------------------------------------- */
.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; }

.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: 940px;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem clamp(1rem, 2vw, 1.3rem) 1.2rem;
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
}
.card__head  { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card__title { font-size: 1.05rem; }
.card__head .btn, .card__head .search, .card__aside { margin-left: auto; }

.hint { color: var(--text-dim); font-size: .82rem; margin: .9rem 0 0; }
.note { color: var(--text-dim); font-size: .86rem; margin: 0 0 .9rem; }
.dim  { color: var(--text-dim); }

/* ----------------------------------------------------------------
   Eingabe
   ---------------------------------------------------------------- */
#dropZone { transition: border-color .15s, background .15s; }
#dropZone.is-over {
  border-color: var(--accent);
  background: rgba(122, 162, 255, .08);
}

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: .86rem;
  line-height: 1.55;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}
textarea::placeholder { color: var(--text-dim); }

.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.actions .hint { margin: 0 0 0 auto; }

.search {
  padding: .4rem .7rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  width: min(220px, 45vw);
}
.search:focus { outline: none; border-color: var(--accent); }

/* ----------------------------------------------------------------
   Kurzfassung
   ---------------------------------------------------------------- */
.summary {
  border-radius: 12px;
  padding: .7rem 1rem;
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
  font-size: .92rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.summary--alarm { border-color: rgba(255,84,104,.45); background: rgba(255,84,104,.12); color: #ffc3ca; }
.summary--warn  { border-color: rgba(255,200,97,.45); background: rgba(255,200,97,.12); color: #ffdca0; }
.summary--ok    { border-color: rgba(47,214,139,.45); background: rgba(47,214,139,.12); color: #8ae9bf; }

/* ----------------------------------------------------------------
   Auffälligkeiten
   ---------------------------------------------------------------- */
.finding {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .7rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: .55rem;
}
.finding__tag {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
  margin-top: .1rem;
}
.finding__body  { min-width: 0; }
.finding__title { display: block; font-size: .95rem; font-weight: 650; }
.finding__text  { margin: .2rem 0 0; font-size: .87rem; color: var(--text-dim); }

.finding--alarm { border-color: rgba(255,84,104,.4);  background: rgba(255,84,104,.10); }
.finding--alarm .finding__tag { background: rgba(255,84,104,.22); color: #ffc3ca; }
.finding--warn  { border-color: rgba(255,200,97,.35); background: rgba(255,200,97,.08); }
.finding--warn  .finding__tag { background: rgba(255,200,97,.2); color: #ffdca0; }
.finding--info  .finding__tag { background: var(--surface-2); color: var(--text-dim); }
.finding--ok    { border-color: rgba(47,214,139,.35); background: rgba(47,214,139,.08); }
.finding--ok    .finding__tag { background: rgba(47,214,139,.2); color: #8ae9bf; }

/* ----------------------------------------------------------------
   Wertelisten
   ---------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 1px;
  margin: 0;
  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;
  gap: .6rem;
  min-width: 0;
  flex-wrap: wrap;
}
.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: .9rem;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: copy;
  overflow-wrap: anywhere;
  transition: color .12s;
}
.val:hover { color: var(--accent); }
.val__extra { color: var(--text-dim); font-size: .8rem; }

/* ----------------------------------------------------------------
   Authentifizierung
   ---------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .86rem;
}
.chip__name  { font-weight: 700; letter-spacing: .03em; }
.chip__state { font-family: var(--mono); font-size: .82rem; }
.chip--ok   { border-color: rgba(47,214,139,.45);  background: rgba(47,214,139,.13);  color: #8ae9bf; }
.chip--bad  { border-color: rgba(255,84,104,.45);  background: rgba(255,84,104,.13);  color: #ffc3ca; }
.chip--warn { border-color: rgba(255,200,97,.45);  background: rgba(255,200,97,.13);  color: #ffdca0; }
.chip--none { color: var(--text-dim); }

/* ----------------------------------------------------------------
   Zustellweg
   ---------------------------------------------------------------- */
.hop {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .7rem .2rem;
  border-top: 1px solid var(--line-soft);
}
.hop:first-of-type { border-top: 0; }

.hop__num {
  width: 26px; height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 650;
  color: var(--text-dim);
  margin-top: .1rem;
}
.hop__main { flex: 1; min-width: 0; }
.hop__line { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.hop__label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  width: 2.2rem;
  flex: none;
}
.hop__host {
  font-family: var(--mono);
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.hop__meta {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .25rem;
  margin-left: 2.65rem;
  font-size: .78rem;
  color: var(--text-dim);
}
.tagling {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: .05rem .5rem;
  font-family: var(--mono);
}

.iplink {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(122,162,255,.5);
}
.iplink:hover { color: #b9ccff; }

.hop__delay { width: 130px; flex: none; text-align: right; }
.delay { font-size: .8rem; font-variant-numeric: tabular-nums; }
.delay.is-long { color: var(--warn); }
.delay.is-back { color: var(--off); }

.bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.07);
  margin-top: .3rem;
  overflow: hidden;
}
.bar__fill { height: 100%; background: var(--accent); border-radius: 2px; }
.bar__fill.is-long { background: var(--warn); }
.bar__fill.is-back { background: var(--off); }

/* ----------------------------------------------------------------
   Rohe Kopfzeilen
   ---------------------------------------------------------------- */
.raw {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  max-height: 460px;
  overflow-y: auto;
}
.raw__row {
  display: grid;
  grid-template-columns: minmax(120px, 210px) minmax(0, 1fr);
  gap: .8rem;
  padding: .4rem .8rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .84rem;
}
.raw__row:last-child { border-bottom: 0; }
.raw__row:nth-child(odd) { background: rgba(255,255,255,.015); }
.raw__row[hidden] { display: none; }
.raw__name  { font-family: var(--mono); color: var(--accent); overflow-wrap: anywhere; }
.raw__value { font-family: var(--mono); color: var(--text-dim); overflow-wrap: anywhere; white-space: pre-wrap; }

/* ----------------------------------------------------------------
   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);
  text-align: center;
}
.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;
  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: 700px) {
  .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; }
  .raw__row { grid-template-columns: 1fr; gap: .1rem; }
  .hop { flex-wrap: wrap; }
  .hop__delay { width: 100%; text-align: left; padding-left: 2.65rem; }
  .topbar__note, .actions .hint { display: none; }
}

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