@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --page: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --ink: #172238;
  --muted: #6d7890;
  --line: #e1e7f2;
  --accent: #5146e5;
  --accent-soft: #eeedff;
  --shadow: 0 14px 40px rgba(27, 39, 75, .055);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 12% 0%, #e9edff 0, transparent 30%), var(--page);
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
.site-header {
  padding: 32px 28px 30px;
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid rgba(221,228,241,.9);
}
.header-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 19px; }
.brand-icon {
  display: grid; place-items: center; width: 66px; height: 66px; flex: 0 0 auto;
  border-radius: 19px; color: #fff; font: 800 .78rem Manrope, sans-serif; letter-spacing: .06em;
  background: linear-gradient(145deg, #5146e5, #8178ff); box-shadow: 0 10px 24px rgba(81,70,229,.22);
}
.eyebrow, .category-kicker {
  margin: 0 0 5px; color: var(--accent); font-size: .67rem; font-weight: 800; letter-spacing: .15em;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font: 800 clamp(1.8rem, 3vw, 2.6rem)/1.15 Manrope, sans-serif; letter-spacing: -.045em; }
.subtitle { margin: 0; color: var(--muted); font-size: .96rem; }
.page-shell { max-width: 1440px; margin: 0 auto; padding: 25px 28px 18px; }
.search-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 21px 23px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.search-copy h2 { margin-bottom: 3px; font: 800 1.15rem Manrope, sans-serif; letter-spacing: -.025em; }
.search-copy p { margin: 0; color: var(--muted); font-size: .84rem; }
.search-copy code { padding: 2px 5px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; }
.search-tools { width: min(100%, 440px); }
.search-box {
  display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 0 12px;
  border: 1px solid #dce3f0; border-radius: 11px; background: #fbfcff; transition: .15s;
}
.search-box:focus-within { border-color: #938bff; box-shadow: 0 0 0 3px rgba(81,70,229,.1); background: #fff; }
.search-symbol { color: #7b85a0; font-size: 1.5rem; line-height: 1; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: .85rem; }
.search-box input::placeholder { color: #8993a8; }
kbd { white-space: nowrap; padding: 3px 5px; border: 1px solid #dce2ef; border-radius: 5px; background: #fff; color: #7a849a; font: 600 .63rem "DM Sans", sans-serif; }
.result-count { margin: 5px 2px 0; color: var(--muted); font-size: .72rem; text-align: right; }
.category { margin: 0 0 34px; }
.category-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.category-heading h2 { margin: 0; font: 800 1.4rem/1.2 Manrope, sans-serif; letter-spacing: -.035em; }
.category-kicker { display: block; margin-bottom: 4px; font-size: .6rem; }
.category-count { color: var(--muted); font-size: .75rem; padding-bottom: 2px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.logo-card {
  min-width: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 15px; background: var(--surface);
  box-shadow: 0 3px 12px rgba(27,39,75,.025); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.logo-card:hover { transform: translateY(-3px); border-color: #cbd1ff; box-shadow: 0 12px 26px rgba(27,39,75,.09); }
.preview-button {
  position: relative; display: grid; place-items: center; width: 100%; height: 166px; padding: 18px;
  border: 0; border-bottom: 1px solid #edf0f7; background:
    linear-gradient(45deg,#f5f7fc 25%,transparent 25%,transparent 75%,#f5f7fc 75%),
    linear-gradient(45deg,#f5f7fc 25%,#fff 25%,#fff 75%,#f5f7fc 75%);
  background-position: 0 0, 8px 8px; background-size: 16px 16px; cursor: zoom-in;
}
.preview-button img { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.logo-card:hover .preview-button img { transform: scale(1.035); }
.preview-hint { position: absolute; bottom: 8px; right: 8px; padding: 3px 7px; border: 1px solid #e3e7f1; border-radius: 6px; background: rgba(255,255,255,.93); color: #6c7690; font-size: .62rem; opacity: 0; transform: translateY(3px); transition: .15s; }
.logo-card:hover .preview-hint, .preview-button:focus-visible .preview-hint { opacity: 1; transform: none; }
.preview-button:disabled { cursor: default; }
.file-placeholder { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #929bb0; font-size: .75rem; }
.file-placeholder span { font-size: 2rem; }
.card-content { display: flex; flex: 1; flex-direction: column; padding: 13px 14px 14px; }
.logo-name { margin: 0; color: var(--ink); font-size: .88rem; font-weight: 750; overflow-wrap: anywhere; }
.card-meta { min-height: 19px; margin-top: 3px; color: var(--muted); font-size: .7rem; }
.download-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0f7; }
.format-link { display: inline-flex; align-items: center; justify-content: center; min-width: 43px; padding: 6px 9px; border: 1px solid #dfe3ff; border-radius: 7px; background: var(--accent-soft); color: #4338ca; text-decoration: none; font-size: .69rem; font-weight: 800; transition: .15s; }
.format-link:hover { border-color: #aaa4ff; background: #e2e0ff; transform: translateY(-1px); }
.empty-state { padding: 55px 20px; text-align: center; border: 1px dashed #ccd4e6; border-radius: 16px; background: rgba(255,255,255,.6); }
.empty-state > span { display: block; margin-bottom: 8px; color: #8b93aa; font-size: 2.3rem; }
.empty-state h2 { margin-bottom: 5px; font: 800 1.2rem Manrope, sans-serif; }
.empty-state p { margin: 0; color: var(--muted); font-size: .85rem; }
.notice { padding: 20px; border: 1px solid #f1d29b; border-radius: 13px; background: #fffbeb; color: #854d0e; }
.notice p { margin: 5px 0 0; }
.page-footer { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 24px 0 10px; color: #8a94a8; font-size: .75rem; }
.footer-dot { width: 6px; height: 6px; border-radius: 50%; background: #22a06b; }
.footer-separator { color: #c1c8d7; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 30px; background: rgba(13,19,35,.88); backdrop-filter: blur(8px); }
.lightbox img { max-width: min(92vw, 1400px); max-height: 82vh; object-fit: contain; padding: 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: #fff; }
.lightbox p { max-width: 80vw; margin: 0; color: #fff; font-size: .8rem; overflow-wrap: anywhere; }
.lightbox-close { position: absolute; top: 20px; right: 24px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.8rem; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.modal-open { overflow: hidden; }
@media (max-width: 800px) {
  .site-header { padding: 25px 18px; }
  .page-shell { padding: 18px 16px; }
  .search-panel { align-items: stretch; flex-direction: column; gap: 16px; padding: 18px; }
  .search-tools { width: 100%; }
  .logo-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
}
@media (max-width: 480px) {
  .header-inner { align-items: flex-start; gap: 12px; }
  .brand-icon { width: 48px; height: 48px; border-radius: 14px; font-size: .65rem; }
  h1 { font-size: 1.65rem; }
  .subtitle { font-size: .85rem; }
  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .preview-button { height: 125px; padding: 12px; }
  .card-content { padding: 10px; }
  .logo-name { font-size: .79rem; }
  .format-link { min-width: 37px; padding: 5px 7px; }
  kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Fix: Bildvorschauen bleiben innerhalb ihrer Kachel und werden nicht abgeschnitten. */
.preview-button {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
}
.preview-button img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}
.preview-hint { z-index: 2; }

/* Früheres Verhalten: große Vorschau dauerhaft unten rechts beim Hover. */
.hover-preview {
  position: fixed;
  z-index: 1200;
  right: 22px;
  bottom: 22px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 20px 60px rgba(10,18,40,.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.985);
  pointer-events: auto;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.hover-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.hover-preview-heading {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hover-preview-image {
  display: grid;
  place-items: center;
  height: auto;
  min-height: 160px;
  max-height: calc(100vh - 130px);
  flex: 0 1 auto;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #f8faff;
  background-image: linear-gradient(45deg,#edf0f7 25%,transparent 25%,transparent 75%,#edf0f7 75%),linear-gradient(45deg,#edf0f7 25%,#fff 25%,#fff 75%,#edf0f7 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}
.hover-preview-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 190px);
  padding: 10px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.hover-preview-caption {
  padding: 9px 2px 1px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}
@media (max-width: 600px), (hover: none) {
  .hover-preview { display: none; }
}

.hover-preview-image img {
  position: static;
  inset: auto;
  min-height: 0;
  max-width: 100%;
}
.hover-preview { overflow-y: auto; }

.hover-link-label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}
.hover-link-row { display: flex; gap: 6px; margin-top: 5px; }
.hover-link-row input {
  min-width: 0;
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faff;
  color: var(--ink);
  font: .68rem Consolas, "Courier New", monospace;
}
.hover-link-row button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}
.hover-link-status { min-height: 1em; margin: 4px 0 0; color: #15803d; font-size: .68rem; }


.image-url-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f6ff;
  color: var(--accent);
  font: 750 .72rem "DM Sans", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.image-url-copy:hover { border-color: #b9b4ff; background: #efedff; }
.image-url-copy:focus-visible { outline: 3px solid rgba(81,70,229,.22); outline-offset: 2px; }


/* Elegantes, responsives Anmeldefenster */
.login-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 10%, rgba(111, 98, 255, .14), transparent 38%),
              radial-gradient(ellipse at 90% 90%, rgba(67, 173, 190, .13), transparent 36%),
              var(--page-bg, #f4f6fb);
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.login-card {
  width: min(100%, 440px); padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(210, 218, 235, .8); border-radius: 26px;
  background: rgba(255,255,255,.92); box-shadow: 0 24px 80px rgba(25,35,75,.13);
  backdrop-filter: blur(18px);
}
.login-mark {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 25px;
  border-radius: 17px; color: white; font-size: 1.5rem;
  background: linear-gradient(135deg, #6257e8, #8278ff);
  box-shadow: 0 10px 25px rgba(98,87,232,.28);
}
.login-eyebrow { margin-bottom: 9px; color: #6257e8; font-size: .68rem; font-weight: 850; letter-spacing: .14em; }
.login-card h1 { margin-bottom: 10px; color: #172039; font-size: clamp(1.8rem, 6vw, 2.2rem); letter-spacing: -.05em; }
.login-subtitle { margin-bottom: 28px; color: #6c748a; font-size: .92rem; line-height: 1.65; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: #333d56; font-size: .8rem; font-weight: 750; }
.login-form input {
  width: 100%; min-height: 50px; box-sizing: border-box; padding: 0 15px;
  border: 1px solid #dce2ef; border-radius: 12px; outline: 0; background: #fbfcff;
  color: #172039; font: inherit; transition: border-color .15s, box-shadow .15s;
}
.login-form input:focus { border-color: #8278ff; box-shadow: 0 0 0 4px rgba(98,87,232,.12); }
.login-form button {
  display: flex; justify-content: space-between; align-items: center; min-height: 51px;
  margin-top: 7px; padding: 0 17px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, #6257e8, #766bf5); color: #fff;
  font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 9px 22px rgba(98,87,232,.22);
  transition: transform .15s, box-shadow .15s;
}
.login-form button:hover { transform: translateY(-1px); box-shadow: 0 13px 26px rgba(98,87,232,.28); }
.login-error { margin: 5px 0 0; padding: 10px 12px; border-radius: 9px; color: #9d2424; background: #fff0f0; font-size: .85rem; }
.login-footnote { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 25px 0 0; color: #8991a5; font-size: .75rem; }
@media (prefers-color-scheme: dark) {
  .login-page { background: radial-gradient(ellipse at 15% 10%, rgba(111,98,255,.18), transparent 38%), #101522; }
  .login-card { background: rgba(25,31,48,.94); border-color: #343d55; }
  .login-card h1 { color: #f3f5ff; }
  .login-subtitle, .login-footnote { color: #aab2c8; }
  .login-form label { color: #d8def0; }
  .login-form input { background: #171e30; color: #f3f5ff; border-color: #3b4560; }
}


/* Download-Groesse in der schwebenden Bildvorschau */
.resize-tools{margin-top:14px;padding-top:14px;border-top:1px solid var(--border,#d9dee7);display:grid;gap:8px}
.resize-title{font-weight:700;font-size:.9rem}
.resize-tools label{display:grid;gap:5px;font-size:.8rem;color:var(--muted,#667085)}
.resize-tools select,.resize-tools input{width:100%;min-width:0;border:1px solid var(--border,#d9dee7);border-radius:9px;padding:9px 10px;background:var(--surface,#fff);color:inherit;font:inherit}
.resize-dimensions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.resize-tools button{border:0;border-radius:10px;padding:10px 12px;background:var(--accent,#315efb);color:#fff;font-weight:700;cursor:pointer}
.resize-tools button:disabled{opacity:.45;cursor:not-allowed}
.resize-note{font-size:.75rem;color:var(--muted,#667085);margin:0}

/* Aktionen für echte, serverseitig neu skalierte Bilddateien */
.resize-copy-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.resize-copy-actions button { cursor:pointer; }


/* V5: Farbwelt angelehnt an das Wappen und Abmelden oben rechts */
:root {
  --page: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #edf4f0;
  --ink: #19332f;
  --muted: #62736d;
  --line: #d6e2dc;
  --accent: #1d594d;
  --accent-soft: #e5f1eb;
  --shadow: 0 14px 40px rgba(22, 57, 48, .07);
}
body {
  background: radial-gradient(ellipse at 10% 0%, #e1eee5 0, transparent 34%),
              radial-gradient(ellipse at 95% 5%, #f7ebcc 0, transparent 24%), var(--page);
}
.site-header {
  position: relative;
  background: linear-gradient(115deg, rgba(255,255,255,.97), rgba(241,247,241,.96));
  border-bottom: 3px solid #c8a64b;
}
.header-inner { position: relative; padding-right: 126px; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 7px;
  border: 1px solid #d7e2d9;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(27,73,58,.12);
}
.brand-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.eyebrow, .category-kicker { color: #1d594d; }
.logout-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid #d8b45b;
  border-radius: 10px;
  background: #fff8e7;
  color: #654c13;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
  transition: background .15s, transform .15s;
}
.logout-button:hover { background: #f7e8b9; transform: translateY(-1px); }
.search-box:focus-within { border-color: #57927e; box-shadow: 0 0 0 3px rgba(29,89,77,.12); }
.format-link { border-color: #c7dfd2; background: #e5f1eb; color: #1d594d; }
.format-link:hover { border-color: #7eb39a; background: #d5e9de; }
.logo-card:hover { border-color: #a8cbbb; }
@media (max-width: 600px) {
  .header-inner { padding-right: 0; flex-wrap: wrap; }
  .logout-button { position: static; margin-left: auto; }
}

/* V7: Das bisherige Bibliotheksdesign bleibt erhalten; nur der Header bekommt Wappenfarben. */
.site-header {
  background: linear-gradient(110deg, #fff 0%, #fff 42%, #fcebed 68%, #e8f1fa 100%);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #e30613 0%, #e30613 48%, #075ca8 100%) 1;
}
.brand-icon {
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Das Wappen im Login ohne Kasten oder Schatten anzeigen. */
.login-mark {
  width: 96px;
  height: 96px;
  padding: 0;
  margin-bottom: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
