:root {
  --bg-color: dimgray;
  --text-color: #111;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --link-color: #0066cc;
  --link-hover: #9ec2e6;
  --header-bg: #222;
  --header-text: #ffffff;
}

body {
  margin: 0;
  font-family: sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

h1 {
  text-align: center;
  margin-bottom: 1em;
}

header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 1rem;
  text-align: center;
  font-size: 1.5rem;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

.card {
  background-color: var(--card-bg);
  box-shadow: 0 4px 10px var(--card-shadow);
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.grid {
   display: grid;
   gap: 1.5em;
 }
 @media (min-width: 800px) {
   .grid {
     grid-template-columns: repeat(2, 1fr);
   }
 }
 @media (min-width: 1000px) {
   .grid {
     grid-template-columns: repeat(3, 1fr);
   }
 }
section {
  background: silver;
  border-radius: 12px;
  padding: 1em;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
section h2 {
  font-size: 1.2em;
  margin-top: 0;
  margin-bottom: 0.8em;
  text-align: center;
}
hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--card-shadow);
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
li {
  margin: 0.5em 0;
}

a {
  text-decoration: none;
  color: var(--link-color);
  display: block;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em;
  border-radius: 6px;
  transition: background 0.2s;
}

a:hover {
  color: var(--link-color);
  background: var(--link-hover);
}

img.icon {
   width: 32px;
   height: 32px;
   flex-shrink: 0;
}
/* Galerie-Layout */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

/* Thumbnails: überschreibt evtl. globale img-Regeln */
.gallery img {
  max-width: 440px !important;
  max-height: 320px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* KI-Suche & Analyse – Layout-Ergänzungen */
#ai-search-tools {
  margin: 0;      
}

.ai-main {
  display: block;
  padding: 2rem;
}

.nav-back {
  margin-bottom: 1rem;
  text-align: left;
}

.nav-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: normal;
  padding: 0.3em 0.6em;
}

.ai-panel {
  background: silver;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.ai-panel h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  text-align: center;
}

.ai-panel form,
.ai-panel label {
  display: block;
  margin-bottom: 0.6rem;
}

.ai-panel input[type="text"],
.ai-panel input[type="url"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font: inherit;
}

.ai-panel button {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  background: #0066cc;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.ai-panel button:hover {
  background: #0050a0;
}

.ai-summary {
  margin-top: 0.8rem;
  padding: 0.7rem;
  background: #f7f7f7;
  border-radius: 8px;
  font-size: 0.95rem;
}

.ai-question-inline {
  margin-top: 0.8rem;
}

.ai-results {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.ai-result-item {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.ai-result-item h4 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
}

.ai-result-meta {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  color: #444;
}

.ai-result-meta a {
  padding: 0;
  border-radius: 0;
  font-weight: normal;
  display: inline;
  background: transparent;
}

.ai-result-meta a:hover {
  background: transparent;
  text-decoration: underline;
}

.ai-result-snippet {
  margin: 0 0 0.4rem 0;
  font-size: 0.9rem;
}

.ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.ai-result-actions button {
  font-size: 0.85rem;
}

.ai-result-answer,
.ai-answer {
  font-size: 0.9rem;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.6rem;
  margin-top: 0.3rem;
}

/* KI-Seite: Main-Layout einkolumnig erzwingen */
main.ai-main {
  display: block !important;    /* überschreibt ein globales display:flex */
}

/* Beide Sections auf die gleiche Breite bringen */
.ai-main #ai-search-tools,
.ai-main .nav-section {
  max-width: none;
  margin: 0 auto 1.5rem;
}

.ai-main .nav-section {
  margin-top: 2rem;
}

.ai-rawtext {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f5f5f5;
  border-radius: 4px;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 400px;
  overflow: auto;
}

.ai-meta {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8f8f8;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.ai-meta dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
}
.ai-meta dt {
  font-weight: 600;
}
.ai-meta dd {
  margin: 0;
}

