/* ============================================================
   Aquarium Guide & CMS — Public Site Styles
   ============================================================ */

:root {
  --accent: #0e7490;
  --accent-bright: #0891b2;
  --accent-soft: rgba(8, 145, 178, 0.12);
  --ink: #0c1929;
  --muted: #5b6b7c;
  --surface: #ffffff;
  --page: #eef5f8;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(8, 145, 178, 0.14), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 116, 144, 0.08), transparent),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 40c8-10 16-10 24 0s16 10 24 0' fill='none' stroke='%230e7490' stroke-opacity='0.04' stroke-width='1.5'/%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-width: 0;
}

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

#readingProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  z-index: 100; transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.45);
}

.home-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(200px, 0.75fr);
  align-items: center;
  gap: 1.5rem 1.75rem;
  border-radius: 28px;
  padding: 2.5rem 2rem 2.25rem;
  margin-bottom: 2.25rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(236, 248, 252, 0.95) 55%, rgba(224, 242, 254, 0.9) 100%);
  border: 1px solid rgba(14, 116, 144, 0.12);
  box-shadow: 0 20px 50px rgba(12, 25, 41, 0.06);
  animation: heroIn 0.7s var(--ease-out) both;
}
.home-hero-glow {
  position: absolute; width: 280px; height: 260px; border-radius: 50%;
  right: -50px; top: -70px;
  background: radial-gradient(circle, rgba(8,145,178,0.22), transparent 70%);
  pointer-events: none;
  animation: floatGlow 8s ease-in-out infinite;
}
.home-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}
.home-hero-kicker {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem;
  white-space: nowrap;
}
.home-hero-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.75rem, 3.6vw, 2.45rem);
  font-weight: 700; line-height: 1.2; color: var(--ink);
  margin-bottom: 0.95rem;
  max-width: none;
}
.home-hero-desc {
  font-size: 1.02rem; color: var(--muted);
  max-width: 46ch;
  line-height: 1.65; margin-bottom: 1.5rem;
}
.home-hero-stats {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.home-hero-stats::-webkit-scrollbar { display: none; }
.site-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.site-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
button:hover .site-logo {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 16px rgba(14, 116, 144, 0.35);
}
.hero-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(14, 116, 144, 0.1);
  flex: 0 0 auto;
  white-space: nowrap;
  animation: fadeUp 0.5s var(--ease-out) both;
}
.hero-stat strong { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.hero-stat span { font-size: 0.68rem; color: var(--muted); font-weight: 600; }

.home-hero-scene {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  justify-self: end;
  pointer-events: none;
}
.hero-tank { display: block; width: 100%; height: auto; overflow: hidden; }

.hero-fish-wiggle {
  transform-origin: 0 0;
  animation: fishWiggle 1.15s ease-in-out infinite;
}
.hero-fish-wiggle-slow {
  animation-duration: 1.45s;
}
.hero-fish-wiggle-fast {
  animation-duration: 0.85s;
}
.hero-fin-tail {
  transform-box: fill-box;
  transform-origin: 100% 50%;
  animation: finTail 0.48s ease-in-out infinite;
}
.hero-fin-tail-inner {
  animation-duration: 0.48s;
  animation-delay: -0.1s;
}
.hero-fin-pectoral {
  transform-box: fill-box;
  transform-origin: 0% 30%;
  animation: finPectoral 0.85s ease-in-out infinite;
}
.hero-fin-dorsal,
.hero-fin-anal {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: finSoft 1.5s ease-in-out infinite;
}
.hero-fin-anal { animation-delay: -0.4s; }

.hero-plant-a { transform-origin: 48px 194px; animation: plantSway 6s ease-in-out infinite; }
.hero-plant-b { transform-origin: 372px 194px; animation: plantSway 7.2s ease-in-out infinite reverse; }
.hero-plant-c { transform-origin: 210px 196px; animation: plantSway 5.4s ease-in-out infinite; }
.hero-bubble { animation: bubbleRise 5.4s ease-in infinite; }
.hero-bubble.b1 { animation-delay: 0s; }
.hero-bubble.b2 { animation-delay: 1.5s; animation-duration: 4.4s; }
.hero-bubble.b3 { animation-delay: 0.9s; animation-duration: 5.8s; }
.hero-bubble.b4 { animation-delay: 2.4s; animation-duration: 4.9s; }
.hero-bubble.b5 { animation-delay: 1.8s; animation-duration: 5.2s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-18px, 12px); }
}
@keyframes fishWiggle {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-1.2px); }
}
@keyframes finTail {
  0%, 100% { transform: rotate(-12deg) scaleY(1) scaleX(1); }
  50% { transform: rotate(14deg) scaleY(0.86) scaleX(1.08); }
}
@keyframes finPectoral {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(-18deg); }
}
@keyframes finSoft {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg); }
}
@keyframes plantSway {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(3.5deg); }
}
@keyframes bubbleRise {
  0% { transform: translate(0, 0) scale(0.85); opacity: 0; }
  12% { opacity: 0.85; }
  70% { transform: translate(6px, -95px) scale(1); opacity: 0.45; }
  100% { transform: translate(-4px, -140px) scale(1.05); opacity: 0; }
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.35rem 1.75rem;
  }
  .home-hero-scene {
    justify-self: center;
    width: min(100%, 380px);
    max-width: none;
    order: -1;
    margin-bottom: 0.25rem;
  }
  .home-hero-kicker { white-space: normal; }
  .home-hero-stats {
    flex-wrap: nowrap;
    width: max-content;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-glow,
  .hero-fish-wiggle,
  .hero-fin-tail,
  .hero-fin-pectoral,
  .hero-fin-dorsal,
  .hero-fin-anal,
  .hero-plant-a,
  .hero-plant-b,
  .hero-plant-c,
  .hero-bubble {
    animation: none !important;
  }
  .hero-tank.hero-tank--static animateMotion {
    display: none;
  }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.view-section {
  animation: pageFadeIn 0.4s var(--ease-out) forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.tg-card {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.25s;
  border-color: rgba(14, 116, 144, 0.1) !important;
}
.tg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px rgba(12, 25, 41, 0.1);
  border-color: rgba(8, 145, 178, 0.28) !important;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.category-btn {
  transition: transform 0.2s var(--ease-out), background 0.2s, color 0.2s, box-shadow 0.2s;
}
.category-btn:hover { transform: translateY(-1px); }

.animate-fade-in {
  animation: modalIn 0.3s var(--ease-out) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

header.sticky {
  transition: box-shadow 0.25s, background 0.25s;
}
header.scrolled {
  box-shadow: 0 8px 24px rgba(12, 25, 41, 0.06);
}

.article-cover-img {
  display: block;
  width: 100%;
  height: 280px;
  max-height: 42vw;
  min-height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  margin-top: 0.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  animation: fadeUp 0.55s var(--ease-out) both;
}

@media (max-width: 640px) {
  .article-cover-img {
    height: 200px;
    max-height: none;
    min-height: 180px;
    border-radius: 14px;
  }
}

.article-content figure,
.article-figure {
  margin: 0.6rem 0;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.article-content figure img,
.article-inline-img {
  display: block;
  width: 100%;
  height: 280px;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin: 0 auto;
}

@media (max-width: 640px) {
  .article-content figure img,
  .article-inline-img {
    height: 200px;
    border-radius: 14px;
  }
}

.article-content figcaption,
.article-figure figcaption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
  line-height: 1.55;
}

/* Ad banners */
.ad-label {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(255,255,255,0.92);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 8px;
}
.home-ad-card {
  display: block;
  position: relative;
  align-self: stretch;
  height: 100%;
  min-height: 280px;
  background: #0f172a;
  border: 1px solid #dfe1e5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
.home-ad-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}
.home-ad-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#postsContainer {
  align-items: stretch;
}
.home-ad-body,
.home-ad-media {
  display: none;
}
.article-ad,
.native-ad {
  display: block;
  margin: 2.5rem 0;
  text-decoration: none;
  color: inherit;
}
.native-ad {
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 0;
  background: transparent;
}
.native-ad-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}
.native-ad-inner {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}
.native-ad-inner img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f1f5f9;
}
.native-ad-copy strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 4px;
}
.native-ad-copy p {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
}
.native-ad-copy span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0e7490;
}
.native-ad:hover .native-ad-copy span {
  text-decoration: underline;
}
@media (max-width: 520px) {
  .native-ad-inner {
    grid-template-columns: 72px 1fr;
    gap: 10px;
  }
  .native-ad-inner img {
    width: 72px;
    height: 56px;
  }
}
/* Wide center banner — full width, shorter than article images (280px) */
.article-wide-banner {
  position: relative;
  display: block;
  margin: 2.5rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  text-decoration: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.article-wide-banner img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
}
.article-wide-banner .ad-label {
  top: 8px;
  right: 8px;
}
@media (max-width: 640px) {
  .article-wide-banner img {
    height: 130px;
  }
}

.article-content {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
  line-height: 2.1;
  color: #1f2937;
  font-size: 1.12rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-top: 1rem;
}

.article-content > *:first-child {
  margin-top: 0 !important;
}

.article-content p {
  margin: 0;
  word-break: break-word;
}

.article-content strong {
  color: #0f172a;
  font-weight: 700;
}

.article-content h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.75rem 0 0;
  padding: 0.2rem 0 0.15rem 0.95rem;
  border-left: 4px solid var(--accent-bright);
  line-height: 1.4;
  scroll-margin-top: 100px;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.25rem 0 0;
  line-height: 1.45;
  scroll-margin-top: 100px;
}

.article-content h4 {
  font-size: 1.14rem;
  font-weight: 700;
  color: #334155;
  margin: 0.9rem 0 0;
}

.article-content ul,
.article-content ol {
  margin: 0.2rem 0 0.4rem;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-content ul li {
  position: relative;
  padding-left: 1.75rem;
  margin: 0;
  line-height: 1.95;
}

.article-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.article-content ol {
  counter-reset: custom-counter;
}

.article-content ol li {
  counter-increment: custom-counter;
  position: relative;
  padding-left: 2.5rem;
  margin: 0;
  line-height: 1.95;
}

.article-content ol li::before {
  content: counter(custom-counter);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(14, 116, 144, 0.3);
}

.article-content blockquote {
  position: relative;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border-left: 4px solid var(--accent-bright);
  padding: 1.85rem 1.95rem;
  border-radius: 0 16px 16px 0;
  margin: 0.5rem 0;
  color: #0c4a6e;
  font-size: 1.05rem;
  line-height: 1.95;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.06);
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content table, .ai-friendly-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 0.95rem;
  border: 1px solid #dfe1e5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.article-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0.75rem 0 1rem;
  padding-bottom: 2px;
  border-radius: 14px;
}

.article-content > * {
  min-width: 0;
  max-width: 100%;
}

.article-content th, .ai-friendly-table th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.article-content td, .ai-friendly-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  color: #334155;
  white-space: normal;
  min-width: 7.5rem;
}

@media (max-width: 640px) {
  .article-content th, .ai-friendly-table th,
  .article-content td, .ai-friendly-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
  .article-content th, .ai-friendly-table th {
    font-size: 0.72rem;
  }
  .article-table-scroll {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

.article-content tr:last-child td, .ai-friendly-table tr:last-child td {
  border-bottom: none;
}

.article-content tr:nth-child(even), .ai-friendly-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.article-content tr:hover, .ai-friendly-table tr:hover {
  background-color: #f1f5f9;
}

.article-content hr {
  margin: 1rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.alice-direct-answer {
  background: linear-gradient(135deg, #e0f2fe 0%, #ecfeff 100%);
  border-left: 4px solid var(--accent-bright);
  padding: 1.75rem 1.85rem;
  border-radius: 0 16px 16px 0;
  font-size: 1.05rem;
  line-height: 1.9;
  color: #0c4a6e;
  margin-top: 0.5rem;
  margin-bottom: 2.85rem;
  position: relative;
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.08);
  animation: fadeUp 0.45s var(--ease-out) both;
}

.alice-direct-answer::before {
  content: '💡';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.3);
}

.compatibility-test {
  background: #ffffff;
  border: 2px solid var(--accent-bright);
  border-radius: 20px;
  padding: 2.15rem;
  margin: 3rem 0;
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.1);
  animation: fadeUp 0.5s var(--ease-out) both;
}

.fish-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  font-size: 13.5px;
  font-weight: 500;
  color: #1e293b;
}

.fish-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.fish-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.3);
}

.compatibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.compat-good { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.compat-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.compat-bad { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-bright);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(8, 145, 178, 0.4);
  transition: transform 0.15s;
}
.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }

.calc-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-bright);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(8, 145, 178, 0.4);
}

.soil-type-btn {
  padding: 9px 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-align: center;
}

.soil-type-btn:hover {
  border-color: var(--accent-bright);
  background: #ffffff;
}

.soil-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 116, 144, 0.3);
}

.bio-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 2.15rem;
  margin: 3rem 0 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.paa-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s var(--ease-out);
}

.paa-item:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.06);
}

.paa-item summary {
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
  list-style: none;
  font-size: 0.975rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.paa-item summary::-webkit-details-marker { display: none; }
.paa-item summary::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--accent-bright);
  transition: transform 0.25s var(--ease-out);
  margin-left: auto;
}

.paa-item[open] summary::after {
  transform: rotate(180deg);
}

.paa-item[open] summary {
  border-bottom: 1px solid #f1f5f9;
}

.paa-answer {
  padding: 1.2rem 1.25rem 1.35rem;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.85;
  animation: fadeUp 0.25s var(--ease-out);
}

.comment-bubble {
  position: relative;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}
.comment-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid #22c55e;
  border-radius: 12px;
  font-size: 11.5px;
  color: #15803d;
  font-weight: 600;
}

#loginBtnHeader:hover { transform: translateY(-1px); }

footer {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.8));
}

.site-footer {
  position: relative;
  overflow: hidden;
}

.footer-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.footer-bubbles span {
  position: absolute;
  bottom: -28px;
  border-radius: 50%;
  border: 1px solid rgba(14, 116, 144, 0.14);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), rgba(14,116,144,0.06));
  opacity: 0.28;
  animation: footerBubbleRise linear infinite;
  will-change: transform, opacity;
}

.footer-bubbles span:nth-child(1) { left: 8%;  width: 10px; height: 10px; animation-duration: 14s; animation-delay: 0s; }
.footer-bubbles span:nth-child(2) { left: 22%; width: 6px;  height: 6px;  animation-duration: 18s; animation-delay: 2.5s; }
.footer-bubbles span:nth-child(3) { left: 41%; width: 12px; height: 12px; animation-duration: 16s; animation-delay: 1.2s; }
.footer-bubbles span:nth-child(4) { left: 58%; width: 7px;  height: 7px;  animation-duration: 20s; animation-delay: 4s; }
.footer-bubbles span:nth-child(5) { left: 74%; width: 9px;  height: 9px;  animation-duration: 15s; animation-delay: 0.8s; }
.footer-bubbles span:nth-child(6) { left: 88%; width: 5px;  height: 5px;  animation-duration: 17s; animation-delay: 3.2s; }

@keyframes footerBubbleRise {
  0%   { transform: translate3d(0, 0, 0) scale(0.85); opacity: 0; }
  12%  { opacity: 0.28; }
  70%  { opacity: 0.18; }
  100% { transform: translate3d(6px, -120px, 0) scale(1.05); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-bubbles span { animation: none; opacity: 0.12; bottom: 18%; }
  .footer-bubbles span:nth-child(odd) { bottom: 42%; }
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-dropdown button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.user-dropdown button:hover { background: #f1f5f9; }
.user-dropdown button.danger { color: #b91c1c; }

/* Article SEO chrome */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding-bottom: 1.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #64748b;
}
.focus-kw {
  font-size: 11px;
  font-weight: 700;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  padding: 4px 10px;
}
.fav-btn {
  margin-left: auto;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.fav-btn:hover { border-color: #0e7490; color: #0e7490; }
.fav-btn.active {
  background: #ecfeff;
  border-color: #0e7490;
  color: #0e7490;
}
.useful-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.useful-btn:hover { border-color: #0e7490; color: #0e7490; }
.useful-btn.active {
  background: #ecfdf5;
  border-color: #059669;
  color: #047857;
}
.feed-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1.25rem;
}
.feed-sort-btn {
  border: 1px solid #dfe1e5;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.feed-sort-btn:hover { border-color: #0e7490; color: #0e7490; }
.feed-sort-btn.is-active {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}
.writings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.writings-head .cabinet-title { margin: 0; }
.writings-form {
  max-width: 640px;
  margin: 16px 0 24px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}
.writings-form-title { font-weight: 800; color: #0f172a; margin: 0 0 4px; }
.writings-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.writings-cancel {
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  cursor: pointer;
}
.writings-reject { color: #991b1b; font-size: 0.85rem; margin: 6px 0; }
.cabinet-hint-link { color: #0e7490; font-weight: 700; }
.cabinet-form select {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  color: #0f172a;
  background: #fff;
}
.article-toc {
  margin: 2.25rem 0 2.85rem;
  padding: 1.6rem 1.65rem;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.article-toc strong {
  display: block;
  margin-bottom: 1rem;
  color: #0f172a;
  font-size: 0.95rem;
}
.article-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.7rem;
}
.article-toc a {
  color: #0e7490;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.article-toc a:hover { text-decoration: underline; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.related-card {
  text-align: left;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}
.related-card:hover {
  border-color: #0e7490;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.08);
}
.related-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 0.95rem;
}
.related-card span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Cabinet */
.cabinet-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .cabinet-layout { grid-template-columns: 1fr; }
  .cabinet-aside { position: static; }
}
.cabinet-aside {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  position: sticky;
  top: 80px;
}
.cabinet-user-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.cabinet-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0e7490, #0891b2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.cabinet-nick { font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.cabinet-role { font-size: 0.8rem; color: #64748b; }
.cabinet-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.cabinet-nav-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
}
.cabinet-nav-btn:hover { background: #f1f5f9; }
.cabinet-nav-btn.active {
  background: #ecfeff;
  color: #0e7490;
}
.cabinet-back {
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
}
.cabinet-main {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px;
  min-height: 420px;
}
.cabinet-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 18px;
}
.cabinet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .cabinet-stats { grid-template-columns: repeat(2, 1fr); }
}
.cabinet-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cabinet-stat strong { font-size: 1.4rem; color: #0e7490; }
.cabinet-stat span { font-size: 0.75rem; color: #64748b; font-weight: 600; }
.cabinet-hint { color: #475569; font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; }
.cabinet-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.cabinet-quick button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.cabinet-quick button:hover { border-color: #0e7490; color: #0e7490; }
.cabinet-empty { color: #94a3b8; text-align: center; padding: 40px 12px; }
.cabinet-fav-grid { display: grid; gap: 12px; }
.cabinet-fav-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px;
}
.cabinet-fav-open {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cabinet-fav-open img, .cabinet-fav-ph {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: #ecfeff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cabinet-fav-open h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.cabinet-fav-open p {
  font-size: 0.8rem;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cabinet-remove {
  border: 0;
  background: #fef2f2;
  color: #b91c1c;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}
.cabinet-comments { display: grid; gap: 12px; }
.cabinet-comment {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}
.cabinet-comment-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cabinet-comment-top a {
  font-weight: 800;
  color: #0e7490;
  text-decoration: none;
}
.cabinet-status {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.cabinet-status.status-approved { background: #dcfce7; color: #166534; }
.cabinet-status.status-pending { background: #fef9c3; color: #854d0e; }
.cabinet-status.status-rejected { background: #fee2e2; color: #991b1b; }
.cabinet-comment p { color: #334155; font-size: 0.9rem; line-height: 1.55; margin-bottom: 10px; }
.cabinet-comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 0.75rem;
}
.cabinet-comment-meta button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-weight: 700;
  cursor: pointer;
}
.cabinet-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}
.cabinet-form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}
.cabinet-form input,
.cabinet-form textarea {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  color: #0f172a;
  background: #fff;
}
.cabinet-save {
  justify-self: start;
  background: #0e7490;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}
.cabinet-msg { font-size: 0.85rem; font-weight: 700; }
.cabinet-msg.ok { color: #166534; }
.cabinet-msg.err { color: #b91c1c; }
.cabinet-meta-line { margin-top: 16px; color: #94a3b8; font-size: 0.8rem; }

/* Static pages — same type scale as articles, no new card chrome beyond existing shell */
.prose-page p { margin: 0 0 0.85rem; }
.prose-page ul, .prose-page ol { margin: 0 0 0.85rem; padding-left: 1.25rem; }
.prose-page li { margin-bottom: 0.35rem; }
.prose-page a { color: #0e7490; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose-page strong { color: #0f172a; font-weight: 800; }

/* RF video embeds — match article figure language */
.article-video {
  margin: 1.5rem 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a0a;
  border: 1px solid #dfe1e5;
}
.article-video-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0f172a;
}
.article-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.article-video figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #64748b;
  background: #fff;
}

/* Author sameAs pills — teal brand, no new card language */
.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.author-link-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.author-link-pill:hover {
  background: #cffafe;
  border-color: #67e8f9;
}

/* ——— Motion: pleasant, intentional, reduced-motion safe ——— */
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.reveal-on-scroll:not(.is-visible) {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  /* Failsafe: never leave blank cards if IntersectionObserver misses */
  animation: revealFailsafe 0.01s ease 1.1s forwards;
}
@keyframes revealFailsafe {
  to { opacity: 1; transform: none; }
}
.site-header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease, backdrop-filter 0.25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(12, 25, 41, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}
.cat-chip,
.category-chip,
[data-cat-filter] {
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.cat-chip:hover,
.category-chip:hover,
[data-cat-filter]:hover {
  transform: translateY(-1px);
}
.post-card,
.tg-card,
.related-card {
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.2s ease;
}
.post-card:hover,
.tg-card:hover,
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(12, 25, 41, 0.1);
}
.article-body h2 {
  scroll-margin-top: 88px;
}
.article-body .alice-direct-answer {
  animation: softPulseBorder 4.5s ease-in-out infinite;
}
@keyframes softPulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 116, 144, 0); }
  50% { box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.08); }
}
/* Quick topics: horizontal chip rail */
.cluster-rail-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 55%, #ecfeff 100%);
  border: 1px solid #e2e8f0;
}
.cluster-rail-wrap--compact {
  gap: 0.55rem;
}
.cluster-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
.cluster-rail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.cluster-rail-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}
.cluster-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0;
  min-width: 0;
  flex: 1;
}
.cluster-rail--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.25rem;
  padding-bottom: 0.15rem;
  margin: 0 -0.15rem;
  padding-inline: 0.15rem;
  scrollbar-width: none;
}
.cluster-rail--scroll::-webkit-scrollbar {
  display: none;
}
.cluster-rail a,
.cluster-rail-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0e7490;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 0.05rem 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.cluster-rail--scroll .cluster-rail-link,
.cluster-rail--scroll a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(14, 116, 144, 0.14);
  scroll-snap-align: start;
}
.cluster-rail a:hover,
.cluster-rail-link:hover {
  color: #155e75;
  border-bottom-color: #67e8f9;
}
.cluster-rail--scroll .cluster-rail-link:hover,
.cluster-rail--scroll a:hover {
  background: #fff;
  border-color: rgba(8, 145, 178, 0.35);
  border-bottom-color: rgba(8, 145, 178, 0.35);
}
.cluster-rail-sep {
  display: inline-block;
  margin: 0 0.55rem;
  color: #94a3b8;
  font-weight: 700;
  user-select: none;
}
.time-filter {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

/* Category pills — legacy / optional wrap (homepage uses select now) */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  max-width: 100%;
  width: 100%;
  margin-bottom: 1rem;
}
.category-nav .category-btn {
  flex: 0 1 auto;
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #dfe1e5;
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
}
.category-nav .category-btn.is-active {
  background: #3390ec;
  border-color: #3390ec;
  color: #fff;
}

/* Homepage filter bar — sort + section + period, always fits */
.home-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.home-filter-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.home-filter-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.home-filter-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.home-filter-chip.is-active {
  background: #3390ec;
  color: #fff;
}
.home-filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}
.home-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.home-filter-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}
.home-filter-select {
  appearance: none;
  max-width: min(220px, 52vw);
  min-width: 7.5rem;
  padding: 0.4rem 1.85rem 0.4rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  cursor: pointer;
}
.home-filter-select:focus {
  outline: none;
  border-color: #3390ec;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.15);
}
@media (max-width: 640px) {
  .home-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.7rem;
  }
  .home-filter-sort {
    width: 100%;
  }
  .home-filter-chip {
    flex: 1 1 calc(50% - 0.35rem);
    text-align: center;
  }
  .home-filter-controls {
    width: 100%;
  }
  .home-filter-field {
    flex: 1 1 calc(50% - 0.35rem);
  }
  .home-filter-select {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .cluster-rail-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: 0.85rem 0.95rem;
  }
  .cluster-rail-top {
    gap: 0.5rem;
  }
  .cluster-rail-label {
    font-size: 0.64rem;
  }
  .time-filter-btn-text {
    max-width: 4.5rem;
  }
  #view-article .alice-direct-answer {
    padding: 1.35rem 1.15rem !important;
  }
  .native-ad-inner {
    grid-template-columns: 88px 1fr;
    gap: 12px;
  }
  .native-ad-inner img {
    width: 88px;
    height: 88px;
    object-fit: cover;
  }
}
.time-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  appearance: none;
  border: 1px solid #d7dee7;
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.time-filter-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
}
.time-filter-btn.is-active {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}
.time-filter-btn-text {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.time-filter-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 200px;
  padding: 0.55rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.time-filter-popover[hidden] {
  display: none !important;
}
.time-filter-popover-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.35rem 0.45rem 0.25rem;
}
.time-filter-popover-sep {
  height: 1px;
  background: #eef2f6;
  margin: 0.35rem 0.25rem;
}
.time-filter-option {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}
.time-filter-option:hover {
  background: #f1f5f9;
}
.time-filter-option.is-active {
  background: #ecfeff;
  color: #0e7490;
}

/* ===== Feeding library special layout ===== */
.feeding-query-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 700;
}
.feeding-alice {
  border-left-color: #ea580c !important;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%) !important;
}
.feeding-card {
  margin: 0 0 1.5rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 16px;
  border: 1px solid #fed7aa;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(251, 146, 60, 0.12), transparent),
    linear-gradient(180deg, #fffbeb 0%, #fff 55%);
}
.feeding-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.feeding-emoji {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  background: #fff;
  border: 1px solid #fed7aa;
  flex-shrink: 0;
}
.feeding-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c2410c;
}
.feeding-species {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.feeding-latin {
  font-weight: 500;
  font-style: italic;
  color: #64748b;
  font-size: 0.92rem;
}
.feeding-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .feeding-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.feeding-stat {
  background: #fff;
  border: 1px solid #ffedd5;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}
.feeding-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9a3412;
  margin-bottom: 0.25rem;
}
.feeding-stat strong {
  font-size: 0.92rem;
  color: #0f172a;
  font-weight: 750;
}
.feeding-foods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
@media (min-width: 700px) {
  .feeding-foods { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.feeding-food-col {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}
.feeding-food-col h3 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.feeding-food-col ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.45;
}
.feeding-food-avoid {
  border-color: #fecaca;
  background: #fef2f2;
}
.feeding-food-avoid h3 { color: #b91c1c; }
.feeding-schedule {
  margin-bottom: 1rem;
  background: #fff;
  border: 1px dashed #fdba74;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.feeding-schedule h3 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a3412;
}
.feeding-schedule-item {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-top: 1px solid #fff7ed;
  font-size: 0.88rem;
}
.feeding-schedule-item:first-of-type { border-top: 0; }
.feeding-schedule-when {
  flex: 0 0 4.5rem;
  font-weight: 800;
  color: #ea580c;
}
.feeding-schedule-what { color: #334155; }
.feeding-signs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 640px) {
  .feeding-signs { grid-template-columns: 1fr 1fr; }
}
.feeding-signs-ok,
.feeding-signs-bad {
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.feeding-signs-ok { border-color: #bbf7d0; background: #f0fdf4; }
.feeding-signs-bad { border-color: #fecaca; background: #fef2f2; }
.feeding-signs h3 {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.feeding-signs-ok h3 { color: #15803d; }
.feeding-signs-bad h3 { color: #b91c1c; }
.feeding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.feeding-chip {
  display: inline-flex;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.feeding-chip.ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.feeding-chip.bad { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.feeding-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.35rem;
}
.feeding-related-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-right: 0.25rem;
}
.feeding-related-link {
  display: inline-flex;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.feeding-related-link:hover {
  background: #fff7ed;
}
.feeding-hub-card .feeding-related {
  margin-top: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-on-scroll:not(.is-visible),
  .post-card,
  .tg-card,
  .related-card,
  .cat-chip,
  .article-body .alice-direct-answer,
  .cluster-rail a,
  .cluster-rail-wrap {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


/* Article reading rhythm — high specificity vs Tailwind preflight */
#view-article .article-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.9rem !important;
  line-height: 2.1 !important;
  font-size: 1.12rem !important;
}
#view-article .article-content p {
  margin: 0 !important;
}
#view-article .article-content h2 {
  margin: 1.75rem 0 0 !important;
}
#view-article .article-content h3 {
  margin: 1.25rem 0 0 !important;
}
#view-article .article-content h4 {
  margin: 0.9rem 0 0 !important;
}
#view-article .article-content ul,
#view-article .article-content ol {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  margin: 0.2rem 0 0.4rem !important;
}
#view-article .article-content ul li,
#view-article .article-content ol li {
  margin: 0 !important;
  line-height: 1.95 !important;
}
#view-article article.bg-white {
  padding: 2.1rem 1.6rem !important;
  overflow-x: clip;
}
@media (min-width: 640px) {
  #view-article article.bg-white {
    padding: 3.25rem 3.5rem !important;
  }
}
@media (max-width: 640px) {
  #view-article article.bg-white {
    padding: 1.35rem 0.9rem !important;
  }
}
#view-article .alice-direct-answer {
  margin-bottom: 3rem !important;
  line-height: 1.95 !important;
  padding: 1.85rem 2rem !important;
}
#view-article .article-toc {
  margin: 2.5rem 0 3rem !important;
}
#view-article .article-cover-img {
  margin-bottom: 3.25rem !important;
}
#view-article .bio-box,
#view-article .compatibility-test {
  margin-top: 3.25rem !important;
  margin-bottom: 1.5rem !important;
  padding: 2.25rem !important;
}

/* ============================================================
   MOBILE LAYOUT
   ============================================================ */
@media (max-width: 640px) {
  main.max-w-6xl {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.5rem !important;
  }

  header .max-w-6xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    gap: 0.5rem !important;
  }

  #headerSubtitle { display: none; }
  #headerSiteName { font-size: 0.95rem !important; }

  .home-hero {
    padding: 1.35rem 1rem 1.25rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    gap: 1rem;
  }
  .home-hero-title { font-size: 1.55rem; }
  .home-hero-desc { font-size: 0.92rem; margin-bottom: 1rem; }
  .home-hero-scene { width: min(100%, 280px); }

  .cluster-rail-wrap {
    padding: 0.85rem 0.9rem;
    margin-bottom: 1.35rem;
  }
  .cluster-rail-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .cluster-rail-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .time-filter {
    margin-left: 0;
    align-self: flex-end;
  }
  .cluster-rail--scroll {
    margin: 0;
    padding-inline: 0;
  }

  .article-content {
    font-size: 1rem;
    line-height: 1.75;
    gap: 1.35rem;
  }
  .article-content h2 { font-size: 1.35rem; margin-top: 1.25rem; padding-left: 0.75rem; }
  .article-content h3 { font-size: 1.12rem; }
  .article-content h4 { font-size: 1rem; }

  #view-article .article-content {
    font-size: 1rem !important;
    line-height: 1.75 !important;
    gap: 1.35rem !important;
  }
  #view-article .article-content h2 {
    font-size: 1.35rem !important;
    margin-top: 1.25rem !important;
    padding-left: 0.75rem !important;
  }
  #view-article .article-content h3 { font-size: 1.12rem !important; }
  #view-article .article-content h4 { font-size: 1rem !important; }
  #view-article article.bg-white {
    padding: 1.25rem 0.85rem !important;
  }
  #view-article .alice-direct-answer {
    padding: 1.15rem 1rem !important;
    margin-bottom: 2rem !important;
    line-height: 1.65 !important;
  }
  #view-article .bio-box,
  #view-article .compatibility-test {
    padding: 1.15rem !important;
    margin-top: 2rem !important;
  }
  #view-article .article-toc { margin: 1.75rem 0 2rem !important; }
  #view-article .article-cover-img { margin-bottom: 2rem !important; }

  .article-meta-bar {
    gap: 10px 14px;
    padding-bottom: 1.25rem;
    font-size: 0.8rem;
  }

  .cabinet-main { padding: 1rem; border-radius: 16px; }
  .cabinet-title { font-size: 1.15rem; }

  #postsContainer {
    gap: 1rem !important;
  }

  #loginModal:not(.hidden),
  #registerModal:not(.hidden),
  #searchModal:not(.hidden),
  #aboutModal:not(.hidden) {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
  }
  #loginModal:not(.hidden) > .relative,
  #registerModal:not(.hidden) > .relative {
    margin-top: 0 !important;
    width: 100%;
    max-width: 24rem;
  }
  #searchModal:not(.hidden) > .relative,
  #aboutModal:not(.hidden) > .relative {
    margin-top: 0 !important;
    width: 100%;
    max-width: 42rem;
  }
  #aboutModal:not(.hidden) > .relative {
    padding: 1.25rem !important;
    max-height: calc(100vh - 2rem);
  }

  .user-dropdown {
    right: -0.25rem;
    min-width: min(220px, calc(100vw - 2rem));
  }
}

@media (max-width: 400px) {
  #loginBtnHeader {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    font-size: 0.78rem !important;
  }
  .hero-stat { padding: 7px 10px; }
  .hero-stat strong { font-size: 1rem; }
}
