/* ==========================================================================
   OSINT.onl – Business-Oberfläche
   Anlehnung an den Auftritt des Kantons Zürich: weisse Flächen, Cyan-Kante,
   ZH-Blau als Aktionsfarbe, ruhiges Raster, klare Typografie.
   ========================================================================== */

:root {
  --zh-cyan:       #009ee0;
  --zh-blue:       #0076bd;
  --zh-blue-dark:  #005f99;
  --zh-blue-deep:  #134873;   /* Navy des Logos */
  --ink:           #16303f;
  --ink-soft:      #3d5666;
  --muted:         #5d7181;
  --line:          #d7e2e9;
  --line-soft:     #e8eef2;
  --surface:       #ffffff;
  --canvas:        #f2f6f8;
  --tint:          #e9f4fa;
  --tint-line:     #c4dded;
  --danger:        #a4262c;
  --danger-bg:     #fdf1f1;
  --ok:            #1a7f4b;
  --radius:        4px;
  --shadow:        0 1px 2px rgba(19, 72, 115, .06), 0 6px 20px rgba(19, 72, 115, .07);
  --shadow-pop:    0 10px 34px rgba(19, 72, 115, .16);
  --wrap:          1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--zh-blue-dark); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--zh-blue-deep); }

:focus-visible {
  outline: 3px solid var(--zh-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--zh-blue-deep);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ------------------------------------------------------------ Kopfleiste */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 4px solid var(--zh-cyan);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 6px 0;
  color: var(--zh-blue-deep);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.5px;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--zh-blue-deep); }
.brand__mark { display: block; width: 44px; height: auto; }
.brand__dot { color: var(--zh-blue); font-weight: 600; }

/* Navigation ---------------------------------------------------------- */

.mainnav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover { background: var(--tint); color: var(--zh-blue-dark); }
.nav-link.is-active {
  color: var(--zh-blue-deep);
  background: var(--tint);
  box-shadow: inset 0 -3px 0 var(--zh-blue);
}

.nav-trigger__caret {
  width: 10px;
  height: 6px;
  flex: 0 0 auto;
  transition: transform .16s ease;
}
.nav-trigger[aria-expanded="true"] { background: var(--tint); color: var(--zh-blue-dark); }
.nav-trigger[aria-expanded="true"] .nav-trigger__caret { transform: rotate(180deg); }

/* Aufklapp-Panel */
.nav-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  display: none;
  width: 320px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--zh-cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
/* Ohne JavaScript: Fokus im Element öffnet das Panel. */
html:not(.js) .nav-item--group:hover .nav-panel,
html:not(.js) .nav-item--group:focus-within .nav-panel { display: block; }
.nav-trigger[aria-expanded="true"] + .nav-panel { display: block; }

.nav-panel__list { margin: 0; padding: 0; list-style: none; }

.nav-panel__link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.nav-panel__link:hover { background: var(--tint); }
.nav-panel__link.is-active { background: var(--tint); box-shadow: inset 3px 0 0 var(--zh-blue); }

.nav-panel__title { display: block; font-weight: 650; font-size: 15px; color: var(--zh-blue-deep); }
.nav-panel__desc  { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Referenznummer ------------------------------------------------------- */

.ref {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.ref__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.ref--form input[type="text"] {
  width: 150px;
  min-height: 38px;
  margin: 0;
  padding: 7px 11px;
  font-size: 14px;
}
.ref--form button {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 14px;
}
.ref--set {
  padding: 7px 8px 7px 12px;
  background: var(--tint);
  border: 1px solid var(--tint-line);
  border-radius: var(--radius);
}
.ref__value { font-size: 14px; font-weight: 650; color: var(--zh-blue-deep); overflow-wrap: anywhere; }
.ref__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
}
.ref__clear:hover { background: #fff; color: var(--danger); }

/* Mobile-Umschalter ---------------------------------------------------- */

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-left: auto;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

/* ------------------------------------------------------------- Seitenraum */

.page { flex: 1 0 auto; padding: 0 0 56px; }
.page__inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.breadcrumb { padding: 18px 0 0; font-size: 13.5px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #9fb3c0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--zh-blue-dark); text-decoration: underline; }
.breadcrumb li:last-child span { color: var(--ink-soft); font-weight: 600; }

.page__head { padding: 22px 0 26px; }
.page__head h1 { margin: 0; }
.page__lead { margin: 12px 0 0; max-width: 68ch; font-size: 17px; color: var(--ink-soft); }

h1 {
  font-size: clamp(27px, 3.2vw, 38px);
  line-height: 1.18;
  letter-spacing: -.9px;
  font-weight: 650;
  color: var(--zh-blue-deep);
}
h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.3; letter-spacing: -.3px; font-weight: 650; color: var(--zh-blue-deep); }
h3 { margin: 0 0 10px; font-size: 17px; font-weight: 650; color: var(--zh-blue-deep); }
p  { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- Bausteine */

.card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.card + .card { margin-top: 22px; }
.card--form { border-top: 3px solid var(--zh-cyan); }

.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.aside .card { padding: 22px; }
.aside h2 { font-size: 17px; }
.aside ul { margin: 0; padding-left: 18px; }
.aside li + li { margin-top: 7px; }
.aside p, .aside li { font-size: 14.5px; color: var(--ink-soft); }

/* Formulare ------------------------------------------------------------ */

label { display: block; margin-bottom: 7px; font-weight: 600; font-size: 15px; }
.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 22px; }
.field__hint { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); }
.field__hint code { padding: 1px 5px; background: var(--tint); border-radius: 3px; font-size: 12.5px; }

input, textarea, select, button { font: inherit; }

input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="url"], input[type="search"],
input[type="file"], select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #90a7b6;
  border-radius: var(--radius);
}
input:hover, select:hover, textarea:hover { border-color: #6b8798; }
input:focus, select:focus, textarea:focus {
  border-color: var(--zh-blue);
  outline: 2px solid var(--zh-blue);
  outline-offset: 0;
}
input::placeholder, textarea::placeholder { color: #728695; opacity: 1; }

textarea {
  min-height: 260px;
  resize: vertical;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.55;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2316303f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

button, input[type="submit"], input[type="button"], .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--zh-blue);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover, .btn:hover {
  background: var(--zh-blue-dark);
  color: #fff;
}
.btn--ghost, input.btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--zh-blue-dark);
}
.btn--ghost:hover, input.btn--ghost:hover { background: var(--tint); color: var(--zh-blue-deep); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
form > br { display: none; }

/* Ergebnisbereich ------------------------------------------------------ */

.result { margin-top: 22px; }
.result__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.result__head h2 { margin: 0; }

.result-box,
#results, #result {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-wrap: anywhere;
}
.result-box:empty, #results:empty, #result:empty { display: none; }
.result-box > :last-child, #results > :last-child, #result > :last-child { margin-bottom: 0; }

pre {
  margin: 0;
  font: 13.5px/1.7 Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.placeholder { color: var(--muted); }

/* Tabellen, Hinweise --------------------------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 15px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--tint); color: var(--zh-blue-deep); font-weight: 650; }
tbody tr:nth-child(even) { background: #f8fafc; }

.note {
  margin: 0 0 22px;
  padding: 15px 20px;
  border-left: 4px solid var(--zh-blue);
  background: var(--tint);
  color: #23495f;
  font-size: 14.5px;
}
.note--warn { border-left-color: #c47600; background: #fdf5e9; color: #6d4400; }
.note--error { border-left-color: var(--danger); background: var(--danger-bg); color: #7a1c21; }
.note strong { color: inherit; }
.warnbox { /* Altklasse, weiterhin unterstützt */
  margin: 0 0 22px; padding: 15px 20px;
  border-left: 4px solid #c47600; background: #fdf5e9; color: #6d4400; font-size: 14.5px;
}

.muted { color: var(--muted); font-size: 14.5px; }
.ok    { color: var(--ok); }
.bad   { color: var(--danger); }

/* -------------------------------------------------------------- Startseite */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 40px;
  margin-bottom: 30px;
  padding: 28px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--zh-cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero h2 { margin: 0 0 12px; font-size: 25px; }
.hero p { max-width: 62ch; color: var(--ink-soft); }
.hero__art { margin: 0; text-align: center; }
.hero__art img { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }

.section-label {
  margin: 34px 0 16px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label:first-of-type { margin-top: 0; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-grid > li { display: flex; }
.tool-card {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.tool-card:hover {
  border-color: var(--tint-line);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  color: var(--ink-soft);
}
.tool-card__group {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--zh-cyan);
}
.tool-card__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 18px;
  font-weight: 650;
  color: var(--zh-blue-deep);
  letter-spacing: -.2px;
}
.tool-card__title::after { content: "→"; font-size: 16px; color: var(--zh-blue); transition: transform .14s ease; }
.tool-card:hover .tool-card__title::after { transform: translateX(3px); }
.tool-card__desc { font-size: 14.5px; line-height: 1.55; }

.link-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; }
.link-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.link-row a:hover { border-color: var(--tint-line); background: var(--tint); }
.link-row .ext::after { content: "↗"; font-weight: 400; color: var(--muted); }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.meta-grid div { padding: 18px 22px; background: var(--surface); }
.meta-grid dt { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.meta-grid dd { margin: 6px 0 0; font-size: 17px; font-weight: 650; color: var(--zh-blue-deep); font-family: Consolas, monospace; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ Fuss */

.site-footer { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 24px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer strong { color: var(--zh-blue-deep); }

#print-only-ref { display: none; }

/* ------------------------------------------------------------ Responsive */

@media (max-width: 1080px) {
  .layout-split { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-link { padding: 8px 11px; font-size: 14.5px; }
  .ref--form input[type="text"] { width: 120px; }
}

@media (max-width: 900px) {
  .site-header__bar { flex-wrap: wrap; padding: 0 16px; min-height: 60px; }
  .nav-toggle { display: inline-flex; }
  .mainnav {
    display: none;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 16px;
    border-top: 1px solid var(--line-soft);
  }
  .mainnav.is-open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { justify-content: space-between; width: 100%; border-radius: 0; padding: 13px 8px; }
  .nav-link.is-active { box-shadow: inset 3px 0 0 var(--zh-blue); }
  .nav-panel {
    position: static;
    width: auto;
    margin: 0 0 6px;
    padding: 4px 0 4px 12px;
    border: 0;
    border-left: 2px solid var(--tint-line);
    border-radius: 0;
    box-shadow: none;
  }
  .ref { width: 100%; margin: 12px 0 0; }
  .ref--form input[type="text"] { flex: 1 1 auto; width: auto; }
  .hero { grid-template-columns: 1fr; padding: 26px 24px; gap: 22px; }
  .hero__art img { max-width: 180px; }
}

@media (max-width: 640px) {
  .page__inner { padding: 0 16px; }
  .card, .result-box, #results, #result { padding: 20px; }
  .page__head { padding: 16px 0 20px; }
  .brand { font-size: 19px; }
  .tool-grid { grid-template-columns: 1fr; }
  .brand__mark { width: 36px; }
  th, td { padding: 10px 12px; }
  .actions > * { flex: 1 1 100%; }
}

/* ----------------------------------------------------------------- Druck */

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .breadcrumb, .nav-toggle, .skip-link, .actions { display: none !important; }
  .page { padding: 0; }
  .page__inner { max-width: none; padding: 0; }
  .card, .result-box, #results, #result, .tool-card { box-shadow: none; border-color: #999; break-inside: avoid; }
  .result-box, #results, #result { overflow: visible; }
  a { color: #000; }
  #print-only-ref {
    display: block !important;
    margin: 0 0 12px;
    padding: 6px 0;
    border-bottom: 1px solid #000;
    font-size: 12pt;
    text-align: right;
  }
  .hero__art, .layout-split .aside { display: none; }
  .layout-split { display: block; }
}
