:root {
  --bg-top: #0a3d42;
  --bg-mid: #062428;
  --bg-bottom: #010203;
  --surface: rgba(255, 255, 255, 0.96);
  --text: #eef3ff;
  --muted: #9aa8c7;
  --cyan: #3de0ff;
  --cyan-dim: rgba(61, 224, 255, 0.35);
  --magenta: #c45bff;
  --line: rgba(120, 150, 220, 0.22);
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1120px;
  /* header.jpg 1200×347; Portrait: links 2/3, unten 1/6 weg → 800×(347×5/6) */
  --banner-full: 1200 / 347;
  --banner-portrait: 800 / 289.1667;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 75% 48% at 12% 8%, rgba(30, 110, 170, 0.38), transparent 55%),
    radial-gradient(ellipse 65% 42% at 88% 5%, rgba(20, 90, 140, 0.22), transparent 50%),
    linear-gradient(175deg, #0a4a62 0%, #0a3a52 26%, #061f30 58%, #010203 100%);
  background-attachment: fixed;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  overflow-x: hidden;
  box-sizing: border-box;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
  width: 100%;
  min-width: 0;
}

.hero-banner-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-width: 0;
}

.hero-banner-frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: var(--banner-full);
  box-shadow:
    0 0 0 1px rgba(180, 240, 255, 0.55),
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(61, 224, 255, 0.14);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.hero-banner-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(4, 8, 24, 0.7) 0%, rgba(4, 8, 24, 0.25) 55%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-banner-frame:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(210, 250, 255, 0.75),
    0 22px 60px rgba(0, 0, 0, 0.5),
    0 0 55px rgba(61, 224, 255, 0.22);
}

.hero-banner {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  vertical-align: middle;
}

.search-form {
  width: 100%;
  max-width: 720px;
}

.search-form--in-header {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  width: min(92%, 720px);
  margin: 0;
  z-index: 2;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.28rem 0.22rem 0.85rem;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-pill);
  backdrop-filter: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-bar:focus-within {
  border-color: rgba(61, 224, 255, 0.65);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 0 3px rgba(61, 224, 255, 0.2);
}

.search-icon {
  width: 1.05rem;
  height: 1.05rem;
  color: #1a6b72;
  flex-shrink: 0;
}

.search-bar input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #122028;
  font: 500 0.98rem/1.2 var(--font);
  padding: 0.38rem 0.2rem;
}

.search-bar input[type="search"]::placeholder {
  color: #7a8a96;
}

.search-bar input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.48rem 1.15rem;
  font: 600 0.88rem/1 var(--font);
  color: #e8f7f8;
  background: linear-gradient(135deg, #0d4a50 0%, #08363b 55%, #052428 100%);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.search-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.search-btn:active {
  transform: translateY(0);
}

.tabs {
  display: flex;
  justify-content: flex-start;
  gap: 0.25rem;
  width: 100%;
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0.05rem 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-dim) transparent;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 0.92rem/1 var(--font);
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab svg {
  width: 1.1rem;
  height: 1.1rem;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab.is-active {
  color: var(--cyan);
}

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transform-origin: center;
  animation: tab-in 0.28s ease;
}

@keyframes tab-in {
  from {
    transform: scaleX(0.4);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.results-area {
  margin-top: 1.75rem;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.results-area > * {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.hint,
.loading,
.error-box {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

.error-box {
  color: #ffb4c4;
  background: rgba(120, 20, 50, 0.22);
  border: 1px solid rgba(255, 120, 150, 0.25);
  border-radius: 14px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fade-up 0.4s ease;
  width: 100%;
  max-width: none;
  margin: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.abstract-card {
  max-width: none;
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(10, 50, 62, 0.85), rgba(6, 35, 48, 0.75));
  border: 1px solid rgba(160, 230, 245, 0.4);
  animation: fade-up 0.4s ease;
}

.abstract-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.abstract-heading {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.abstract-text {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.98rem;
}

.abstract-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.abstract-meta a {
  color: var(--cyan);
}

.result-item {
  max-width: none;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.result-item:last-child {
  border-bottom: 1px solid var(--line);
}

.result-item.has-thumb {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
}

.result-thumb {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(190, 240, 255, 0.55);
  background:
    linear-gradient(145deg, rgba(30, 45, 90, 0.55), rgba(60, 30, 90, 0.4));
  display: grid;
  place-items: center;
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-thumb img.is-favicon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.result-body {
  min-width: 0;
  flex: 1;
}

.result-title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.result-title a {
  color: #9ecbff;
  text-decoration: none;
}

.result-title a:hover {
  text-decoration: underline;
  color: #c5e0ff;
}

.result-url {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #6fd6a8;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.result-url a {
  color: inherit;
  text-decoration: none;
}

.result-url a:hover {
  text-decoration: underline;
}

.result-snippet {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ai-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(8, 55, 68, 0.9), rgba(5, 32, 42, 0.88));
  border: 1px solid rgba(61, 200, 210, 0.22);
  animation: fade-up 0.4s ease;
  min-width: 0;
  overflow: hidden;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ai-card-head h2 {
  margin: 0;
}

.chat-new-btn {
  border: 1px solid rgba(190, 240, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: 500 0.8rem/1 var(--font);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.chat-new-btn:hover {
  color: var(--text);
  border-color: var(--cyan-dim);
}

.ai-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.02em;
}

.ai-answer {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--text);
  white-space: pre-wrap;
}

.ai-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ai-meta a {
  color: var(--cyan);
}

.ai-sources-wrap {
  margin: 1rem 0 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(120, 180, 200, 0.25);
}

.ai-sources-wrap > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
  padding: 0.35rem 0;
}

.ai-sources-wrap > summary::-webkit-details-marker {
  display: none;
}

.ai-sources-wrap > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.ai-sources-wrap[open] > summary::before {
  transform: rotate(90deg);
}

.ai-sources {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.88rem;
  min-width: 0;
  overflow: hidden;
}

.ai-sources li {
  margin: 0.35rem 0;
  min-width: 0;
  overflow: hidden;
}

.ai-sources a {
  color: #9ecbff;
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.ai-sources a:hover {
  text-decoration: underline;
}

.src-snip {
  color: var(--muted);
  font-size: 0.8rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ai-sources-empty {
  margin: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.chat-bubble {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  max-width: 95%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble--user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(190, 240, 255, 0.25);
}

.chat-bubble--bot {
  align-self: flex-start;
  background: rgba(4, 28, 36, 0.65);
  border: 1px solid rgba(61, 200, 210, 0.22);
}

.chat-bubble-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-bubble--user .chat-bubble-label {
  color: #b8e8ff;
  text-align: right;
}

.chat-bubble-text {
  white-space: pre-wrap;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-bubble-text a {
  color: #9ecbff;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.chat-follow {
  margin: 1.25rem 0 0;
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: none;
  position: relative;
  z-index: 2;
}

.chat-follow input {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(61, 200, 210, 0.28);
  background: #ffffff;
  color: #122028;
  caret-color: #0a4a62;
  padding: 0.7rem 1.05rem;
  font: 500 0.95rem var(--font);
  outline: none;
  -webkit-text-fill-color: #122028;
}

.chat-follow input::placeholder {
  color: #7a8a96;
  -webkit-text-fill-color: #7a8a96;
}

.chat-follow input:focus {
  border-color: rgba(61, 224, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 224, 255, 0.15);
}

.chat-follow button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.15rem;
  font: 600 0.9rem var(--font);
  color: #e8f7f8;
  background: linear-gradient(135deg, #0d5a68 0%, #0a4552 55%, #073640 100%);
  cursor: pointer;
  flex-shrink: 0;
}

.chat-follow button:hover {
  filter: brightness(1.1);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: none;
  margin: 0;
  animation: fade-up 0.4s ease;
}

.product-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(6, 28, 34, 0.72);
  border: 1px solid rgba(190, 240, 255, 0.35);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 224, 255, 0.55);
}

.product-thumb {
  aspect-ratio: 1;
  background: linear-gradient(145deg, rgba(20, 50, 60, 0.5), rgba(10, 30, 40, 0.6));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.product-thumb img.is-favicon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
}

.product-body {
  padding: 0.65rem 0.75rem 0.8rem;
}

.product-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #7dffb0;
}

.product-snip {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  animation: fade-up 0.4s ease;
  width: 100%;
  max-width: none;
  margin: 0;
}

.image-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(10, 14, 32, 0.65);
  border: 1px solid rgba(190, 240, 255, 0.45);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: var(--cyan-dim);
}

.image-thumb {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(30, 50, 100, 0.5), rgba(80, 30, 100, 0.4));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb .ph {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.5rem;
  text-align: center;
}

.image-card .cap {
  padding: 0.55rem 0.65rem 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.key-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: -0.25rem;
}

.key-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: rgba(8, 30, 36, 0.55);
  color: var(--muted);
  font: 500 0.85rem/1 var(--font);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.key-btn:hover {
  color: var(--text);
  border-color: var(--cyan-dim);
}

.key-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #6a7a9a;
}

.key-dot.is-on {
  background: #3dffa0;
  box-shadow: 0 0 8px rgba(61, 255, 160, 0.55);
}

.key-panel {
  width: 100%;
  margin: 0.35rem 0 0;
  padding: 1rem 1.15rem 1.15rem;
  border-radius: 16px;
  background: rgba(6, 28, 32, 0.85);
  border: 1px solid var(--line);
  animation: fade-up 0.3s ease;
}

.key-panel[hidden] {
  display: none !important;
}

.key-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.key-steps {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.key-steps a {
  color: var(--cyan);
}

.key-steps code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: #b8f0ff;
}

#groq-key-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #122028;
  font: 500 0.95rem var(--mono);
  padding: 0.7rem 0.85rem;
  outline: none;
}

#groq-key-input:focus {
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 3px rgba(61, 224, 255, 0.15);
}

.key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.key-save,
.key-clear,
.key-toggle-vis {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem;
  font: 600 0.85rem/1 var(--font);
  cursor: pointer;
}

.key-save {
  color: #e8f7f8;
  background: linear-gradient(135deg, #0d4a50, #08363b);
}

.key-clear,
.key-toggle-vis {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.key-note,
.key-hint {
  margin: 0.75rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.linkish {
  border: 0;
  background: none;
  color: var(--cyan);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.site-footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
  opacity: 0.85;
}

.load-more {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1.25rem 0.5rem 0.5rem;
  min-height: 2.5rem;
}

.load-more.is-loading {
  color: var(--cyan);
}

.load-more.is-end {
  opacity: 0.65;
}

/* —— Querformat / Desktop: volles Banner, Suche auf Unterkante —— */
@media (orientation: landscape) {
  .hero-banner-frame {
    aspect-ratio: var(--banner-full);
  }

  .hero-banner {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
  }

  .search-form--in-header {
    position: absolute;
    left: 50%;
    bottom: 0.85rem;
    transform: translateX(-50%);
    width: min(92%, 720px);
    margin: 0;
  }

  .hero-banner-frame::after {
    display: block;
  }
}

/* —— Hochformat: rechts 1/3 und unten 1/6 abschneiden, Suche unter Banner —— */
@media (orientation: portrait) {
  .hero-banner-frame {
    aspect-ratio: var(--banner-portrait);
  }

  .hero-banner {
    position: absolute;
    left: 0;
    top: 0;
    width: 150%;
    height: auto;
    max-width: none;
    object-fit: fill;
    object-position: left top;
  }

  .hero-banner-frame::after {
    display: none;
  }

  .search-form--in-header {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    margin: 0.75rem 0 0;
  }

  .search-form--in-header .search-bar {
    width: 100%;
  }
}

/* Tablet / Zwischengröße (z. B. A13 Quer, kleine Tablets) */
@media (max-width: 900px) {
  .page {
    padding: 1.15rem 0.75rem 2.5rem;
  }

  .tab {
    padding: 0.48rem 0.7rem;
    font-size: 0.88rem;
  }

  .product-grid,
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
}

/* Smartphone & enge Portrait-Breiten (A13 ~412px) */
@media (max-width: 640px) {
  .page {
    padding: 0.75rem 0.65rem 2rem;
  }

  .hero {
    gap: 0.85rem;
  }

  .search-form--in-header {
    width: 100%;
  }

  .search-bar {
    padding-left: 0.7rem;
    gap: 0.3rem;
  }

  .search-bar input[type="search"] {
    font-size: 0.95rem;
    padding: 0.34rem 0.15rem;
  }

  .search-btn {
    padding: 0.42rem 0.9rem;
    font-size: 0.82rem;
  }

  .tabs {
    gap: 0.1rem;
    padding-bottom: 0.35rem;
  }

  .tab {
    padding: 0.42rem 0.55rem;
    font-size: 0.8rem;
    gap: 0.28rem;
  }

  .tab svg {
    width: 1rem;
    height: 1rem;
  }

  .result-title {
    font-size: 1.05rem;
  }

  .result-thumb {
    width: 64px;
    height: 64px;
  }

  .result-item.has-thumb {
    gap: 0.7rem;
  }

  .ai-card,
  .abstract-card,
  .key-panel {
    padding-inline: 0.95rem;
  }

  .chat-follow {
    flex-wrap: wrap;
  }

  .chat-follow button {
    width: 100%;
  }

  .product-grid,
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.65rem;
  }

  .site-footer {
    margin-top: 2rem;
    font-size: 0.75rem;
    padding-inline: 0.25rem;
  }
}

/* Sehr schmale Displays */
@media (max-width: 380px) {
  .search-btn {
    padding-inline: 0.7rem;
  }

  .product-grid,
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Hochformat: Suche mittig auf Unterkante */
@media (orientation: portrait) and (min-width: 641px) and (min-height: 900px) {
  .hero-banner-frame::after {
    display: block;
    height: 36%;
  }

  .search-form--in-header {
    position: absolute;
    left: 50%;
    bottom: 0.9rem;
    transform: translateX(-50%);
    width: min(88%, 640px);
    margin: 0;
    z-index: 2;
  }
}
