/* ============================================================
   VIL - Vision Intelligence Lab | IIIT Allahabad
   Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- Variables ---- */
:root {
  /* Brand — Neon Cyan / Deep Space */
  --primary: #7C3AED;
  --primary-light: #9D5CF5;
  --accent: #0891B2;
  --accent-light: #06B6D4;
  --gradient: linear-gradient(135deg, #06B6D4 0%, #7C3AED 100%);
  --gradient-text: linear-gradient(135deg, #0891B2, #7C3AED);
  --gradient-hover: linear-gradient(135deg, #0EA5C4 0%, #9D5CF5 100%);
  --glow-cyan: rgba(34, 211, 238, 0.45);
  --glow-violet: rgba(124, 58, 237, 0.40);

  /* Always-dark navbar (shared across themes) */
  --nav-bg: rgba(6, 8, 18, 0.97);
  --nav-border: rgba(34, 211, 238, 0.18);
  --nav-text: #C9D6EC;
  --nav-text-active: #22D3EE;
  --nav-active-bg: rgba(34, 211, 238, 0.12);

  /* Light Mode */
  --bg: #EEF2F8;
  --bg-secondary: #E4EAF3;
  --bg-card: #FFFFFF;
  --text-primary: #0B1020;
  --text-secondary: #46506A;
  --text-muted: #7A8499;
  --border: rgba(8, 145, 178, 0.14);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 10px 44px rgba(8, 145, 178, 0.18);
  --tag-bg: rgba(8, 145, 178, 0.1);
  --tag-color: #0891B2;
}

[data-theme="dark"] {
  --primary: #A855F7;
  --primary-light: #C084FC;
  --accent: #22D3EE;
  --accent-light: #67E8F9;
  --gradient: linear-gradient(135deg, #22D3EE 0%, #7C3AED 100%);
  --gradient-text: linear-gradient(135deg, #22D3EE, #A855F7);
  --gradient-hover: linear-gradient(135deg, #67E8F9 0%, #C084FC 100%);
  --glow-cyan: rgba(34, 211, 238, 0.55);
  --glow-violet: rgba(168, 85, 247, 0.50);

  --bg: #05060E;
  --bg-secondary: #0A0D1A;
  --bg-card: #0D1120;
  --text-primary: #E8F4FF;
  --text-secondary: #A6B3CC;
  --text-muted: #5E6E8C;
  --border: rgba(34, 211, 238, 0.16);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 10px 44px rgba(34, 211, 238, 0.20);
  --tag-bg: rgba(34, 211, 238, 0.13);
  --tag-color: #67E8F9;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 84px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Cinematic ambient glow field behind the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 8% 0%, var(--glow-cyan), transparent 60%),
    radial-gradient(45% 55% at 95% 12%, var(--glow-violet), transparent 60%),
    radial-gradient(50% 50% at 50% 110%, rgba(34, 211, 238, 0.10), transparent 65%);
  opacity: 0.5;
  animation: ambientDrift 22s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.08); }
}

h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', sans-serif; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; -webkit-user-drag: none; user-drag: none; pointer-events: none; }
ul { list-style: none; }

/* ---- Utility ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section { padding: 58px 0; }

.section-header { text-align: center; margin-bottom: 40px; }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  background: linear-gradient(100deg, var(--accent), var(--primary-light), var(--accent));
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.2;
  animation: titleShimmer 8s linear infinite;
}

@keyframes titleShimmer {
  to { background-position: 220% center; }
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

.section-divider {
  width: 64px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 20px auto 0;
  box-shadow: 0 0 14px var(--glow-cyan);
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover { background: var(--gradient-hover); transform: translateY(-1px); box-shadow: var(--shadow-hover); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ================================================================
   NAVBAR
   ================================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

#navbar.scrolled {
  box-shadow: 0 4px 30px rgba(34, 211, 238, 0.14);
  border-bottom-color: rgba(34, 211, 238, 0.28);
}

/* Neural particle field spanning the whole navbar */
#nav-neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* Subtle moving glow wash under the particles */
#navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 180% at 12% 50%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(60% 180% at 88% 50%, rgba(124, 58, 237, 0.16), transparent 60%);
  pointer-events: none;
}

.nav-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-logo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  /* Always the vivid dark-mode look, regardless of theme */
  background: linear-gradient(100deg, #22D3EE, #A855F7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo-sub {
  font-size: 0.66rem;
  color: #8FA3C4;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--nav-text);
  padding: 6px 12px;
  border-radius: 7px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--nav-text-active);
  background: var(--nav-active-bg);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.18) inset;
}

/* Contact Us button in the navbar (desktop) — transparent with a thin white border */
.nav-links a.nav-contact-link {
  background: transparent;
  color: var(--nav-text);
  padding: 6px 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: none;
}
.nav-links a.nav-contact-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  color: #fff;
  box-shadow: none;
}

/* ---- Contact card popup (anchored bubble below the clicked button) ---- */
.contact-card {
  --arrow-left: 50%;
  position: fixed;
  top: 78px;
  left: 16px;
  z-index: 1100;
  width: 240px;
  padding: 18px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.contact-card.open { opacity: 1; transform: none; pointer-events: auto; }

.contact-card::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--arrow-left);
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 3px 0 0 0;
}

.contact-card-rows { display: flex; flex-direction: column; gap: 8px; }
.contact-card-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.contact-card-row:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.16);
}
.contact-card-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
@media (max-width: 380px) {
  .contact-card { width: calc(100vw - 32px); }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.06);
  color: var(--nav-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.theme-toggle:hover {
  border-color: #22D3EE;
  color: #22D3EE;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ================================================================
   TOP SECTION — lab intro (left) + updates notice board (right)
   ================================================================ */
.section-top {
  padding-top: calc(68px + 36px);
  padding-bottom: 48px;
  background: transparent;
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 56px;
  align-items: start;
}

.top-intro { padding-top: 6px; }

.top-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-intro p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.top-intro p:last-child { margin-bottom: 0; }

/* ---- Notice board ---- */
.notice-board {
  position: sticky;
  top: 92px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notice-board::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.45), transparent 45%, transparent 55%, rgba(124, 58, 237, 0.40));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.notice-board-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 16px;
}
.notice-board-pin {
  font-size: 1.05rem;
}
.notice-board-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(100deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: noticeBlink 0.7s ease-in-out infinite;
}

@keyframes noticeBlink {
  0%, 50%   { opacity: 1; }
  60%, 72%  { opacity: 0.25; }
  82%, 100% { opacity: 1; }
}

/* ================================================================
   NEWS LIST (homepage top-5)
   ================================================================ */
.news-list {
  list-style: none;
  position: relative;
}

.news-list-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 11px 10px 11px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, padding-left 0.2s;
}

.news-list-item:last-child { border-bottom: none; }

.news-list-item::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 0;
  border-radius: 2px;
  background: var(--gradient);
  transition: width 0.2s ease;
}

.news-list-item:hover {
  background: var(--bg-secondary);
  padding-left: 18px;
}
.news-list-item:hover::before { width: 3px; }
.news-list-item:hover .news-item-title { color: var(--accent); }

.news-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.18s;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-show-more {
  text-align: center;
  margin-top: 14px;
  padding-top: 4px;
}
.news-show-more .btn { width: 100%; justify-content: center; }

/* Compact label inside the notice board list */
.news-list .news-label { font-size: 0.58rem; padding: 2px 7px; }

/* ---- Faculty (round profile, centered, subtle glow) ---- */
.team-list-pi { justify-content: center; margin-bottom: 8px; }
.team-list-pi .member-avatar-wrap {
  box-shadow: 0 0 24px var(--glow-cyan);
}

/* ================================================================
   RESEARCH
   ================================================================ */
#research { background: var(--bg); }

.research-marquee {
  position: relative;
  overflow: hidden;
}
/* Cheap edge fade (gradient overlays) instead of an animated mask */
.research-marquee::before,
.research-marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 70px;
  z-index: 2;
  pointer-events: none;
}
.research-marquee::before { left: 0;  background: linear-gradient(90deg, var(--bg), transparent); }
.research-marquee::after  { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

.research-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: researchMarquee 38s linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}
.research-marquee:hover .research-track { animation-play-state: paused; }

@keyframes researchMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.research-card {
  flex: 0 0 300px;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  min-height: 240px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
}

/* Neon edge that lights up on hover */
.research-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.8), rgba(124, 58, 237, 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
  pointer-events: none;
}
.research-card:hover::after { opacity: 1; }

.research-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.62) 100%);
  opacity: 1;
  transition: background 0.3s;
  border-radius: inherit;
  z-index: 0;
}

.research-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 50px rgba(34, 211, 238, 0.22), 0 4px 18px rgba(124, 58, 237, 0.18);
  border-color: transparent;
}

.research-card:hover::before {
  background: linear-gradient(160deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.48) 100%);
}

.research-card h3,
.research-card p {
  position: relative;
  z-index: 1;
  color: #fff;
}

.research-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

.research-card p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.research-card {
  background-size: cover;
  background-position: center;
}

/* ================================================================
   PUBLICATIONS
   ================================================================ */
#publications { background: var(--bg-secondary); }

/* ---- Publication Search ---- */
.pub-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pub-search {
  width: 100%;
  max-width: 440px;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pub-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.12);
}

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

/* ---- Show More / Less ---- */
#pub-pagination {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.pub-show-more,
.pub-show-less {
  padding: 10px 32px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
}

/* ---- Pagination ---- */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0 2px;
  line-height: 36px;
}

.pub-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  justify-content: center;
}

.pub-filter-btn {
  padding: 7px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.pub-filter-btn:hover,
.pub-filter-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.pub-list { display: flex; flex-direction: column; gap: 16px; }

.pub-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all 0.25s ease;
  animation: fadeUp 0.4s ease;
}

.pub-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(45, 125, 210, 0.3);
  transform: translateX(4px);
}

.pub-year-badge {
  flex-shrink: 0;
  background: var(--gradient);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  margin-top: 3px;
  white-space: nowrap;
}

.pub-body { flex: 1; }

.pub-cat-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cat-conference { background: rgba(45,125,210,0.12); color: #2D7DD2; }
.cat-journal    { background: rgba(40,167,69,0.12);  color: #28a745; }
.cat-workshop   { background: rgba(255,120,50,0.12); color: #e06020; }

.pub-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.5;
}
.pub-title:hover { text-decoration: underline; }

.pub-authors {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pub-venue {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 48px 0;
}

/* ================================================================
   TEAM
   ================================================================ */
#team { background: var(--bg); }

.team-section { margin-bottom: 38px; }

.team-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--gradient);
  border-radius: 2px;
}

/* ---- Team Profile List ---- */
.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 48px;
}

.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 160px;
}

.member-avatar-wrap {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--gradient);
  padding: 3px;
  margin-bottom: 14px;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member:hover .member-avatar-wrap {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(45, 125, 210, 0.3);
}

.member-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  display: block;
}

.member-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  border: 3px solid var(--bg);
}

.member-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.member-name-link .member-name { color: var(--text-primary); }
.member-name-link:hover .member-name { color: var(--accent); text-decoration: underline; }

.member-role {
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

.member-grad-year {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.member-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.member-project-sanction {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 5px;
}

.member-email {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: color 0.2s;
  word-break: break-all;
}
.member-email:hover { color: var(--accent); }

/* ================================================================
   NEWS & EVENTS
   ================================================================ */
#home { background: transparent; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(45, 125, 210, 0.25);
}

.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  flex-shrink: 0;
}

.news-image-placeholder {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, rgba(45, 125, 210, 0.15), rgba(74, 44, 143, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.news-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.news-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.news-label.label-news       { background: rgba(45, 125, 210, 0.12); color: var(--accent); }
.news-label.label-event      { background: rgba(74, 44, 143, 0.12); color: var(--primary-light); }
.news-label.label-seminar    { background: rgba(0, 188, 180, 0.12); color: #00BCB4; }
.news-label.label-award      { background: rgba(240, 180, 41, 0.12); color: #F0B429; }
.news-label.label-conference { background: rgba(255, 120, 50, 0.12); color: #FF7832; }
.news-label.label-workshop   { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }

.news-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.news-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.news-desc {
  font-size: 0.855rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s;
  margin-top: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.news-link:hover { gap: 8px; }

/* ---- Newspaper Modal ---- */
.news-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.news-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.news-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(24px);
  transition: transform 0.25s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.news-modal-overlay.open .news-modal { transform: translateY(0); }
.news-modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.news-modal-close:hover { background: var(--bg-secondary); }
.news-modal-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
}
.news-modal-body {
  padding: 28px 32px 36px;
}
.news-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 14px 0 18px;
}
.news-modal-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.85;
  white-space: pre-wrap;
  margin-bottom: 24px;
}
.news-modal-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--gradient);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}
.news-modal-ext-link:hover { opacity: 0.88; }
@media (max-width: 600px) {
  .news-modal-body { padding: 20px 20px 28px; }
  .news-modal-title { font-size: 1.25rem; }
}

/* ================================================================
   DATASETS
   ================================================================ */
#datasets { background: var(--bg); }

.datasets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.dataset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  min-height: 400px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dataset-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(45, 125, 210, 0.25);
}

.dataset-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.dataset-card-bg {
  background-size: cover;
  background-position: center;
  position: relative;
  isolation: isolate;
}

.dataset-card-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.38) 100%);
  z-index: -1;
}

.dataset-card.dataset-card-bg h3 {
  color: #fff !important;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

.dataset-card.dataset-card-bg .dataset-desc {
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.dataset-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dataset-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.dataset-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dataset-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.dataset-link.paper {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid rgba(0,0,0,0.12);
  font-weight: 600;
}
.dataset-link.paper:hover { background: var(--accent); color: #fff; border-color: transparent; }

.dataset-link.download {
  background: var(--gradient);
  color: #fff;
}
.dataset-link.download:hover { opacity: 0.9; transform: translateY(-1px); }

/* ================================================================
   FUNDING
   ================================================================ */
.footer-funding {
  max-width: 1200px;
  margin: 0 auto 26px;
  padding: 0 24px 26px;
  border-bottom: 1px solid var(--border);
}

.funding-title {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
}

.funding-logo-item {
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.funding-logo-item:hover { transform: translateY(-2px); }

.funding-logo-item img {
  height: 46px;
  max-width: 150px;
  object-fit: contain;
}

.funding-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  position: relative;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-col-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.visit-counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--tag-bg);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.visit-counter span { font-weight: 700; color: var(--accent); }

.footer-address {
  font-style: normal;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 320px;
}
.footer-address strong {
  display: block;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-center a { color: var(--accent); }
.footer-center a:hover { text-decoration: underline; }

.footer-right {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ================================================================
   GO TO TOP
   ================================================================ */
#go-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px rgba(74, 44, 143, 0.35);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s ease;
}

#go-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#go-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(74, 44, 143, 0.45);
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Scroll reveal: standard fade-up (with JS stagger) ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease,
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity 0.3s ease; transform: none; }
  .reveal.visible { transform: none; }
  #nav-neural-canvas { display: none; }
  /* Marquee becomes a static centered wrap */
  .research-marquee::before, .research-marquee::after { display: none; }
  .research-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .notice-board-title, .notice-board-pin { animation: none !important; }
}

/* ================================================================
   MOBILE NAV OVERLAY
   ================================================================ */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 20, 0.97);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.nav-overlay.open { display: flex; }

.nav-overlay a {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
}

.nav-overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .top-grid { grid-template-columns: 1fr; gap: 40px; }
  .notice-board { position: static; max-width: 640px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-inner { padding: 0 16px; }
  .nav-logo img { height: 38px; }
  .nav-logo-title { font-size: 1.05rem; }
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }
  .section-top { padding-top: calc(68px + 24px); }
  .team-grid.supervisor-grid { max-width: 100%; }
  .team-list { gap: 28px 24px; justify-content: center; }
  .team-member { width: 140px; }
  .member-avatar-wrap { width: 140px; height: 140px; }
  .news-grid { grid-template-columns: 1fr; }
  .datasets-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-col-left { align-items: center; }
  .visit-counter { position: static; }
  footer { padding-bottom: 32px; }
  .pub-item { flex-direction: column; gap: 10px; }
  .pub-item:hover { transform: none; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; }
  .nav-logo { gap: 8px; }
  .nav-logo img { height: 32px; }
  .nav-logo-title { font-size: 0.92rem; }
  .nav-logo-sub { font-size: 0.6rem; }
  .nav-actions { gap: 6px; }
  .theme-toggle { width: 32px; height: 32px; font-size: 0.85rem; }
  .research-card { flex-basis: 260px; width: 260px; }
}

@media print {
  body { visibility: hidden; }
}

/* ================================================================
   QUICK LINKS SIDEBAR
   ================================================================ */

/* Desktop sidebar wrapper */
.ql-sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  display: flex;
  flex-direction: row;
  align-items: center;
}

/* Vertical tab */
.ql-tab {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 16px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.25);
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.ql-tab:hover { opacity: 0.88; }

/* Slide-in panel — clips to zero width when closed, expands right of tab */
.ql-panel {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
}
.ql-sidebar.open .ql-panel {
  width: 210px;
}

/* Inner panel — holds actual styling at full width */
.ql-panel-inner {
  min-width: 210px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow-hover);
}

/* Panel header */
.ql-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.ql-panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ql-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.ql-close:hover { color: var(--text-primary); background: var(--border); }

/* Bullet list */
.ql-list {
  list-style: disc;
  padding: 14px 16px 14px 34px;
  margin: 0;
}
.ql-list li {
  margin-bottom: 6px;
  line-height: 0.8;
}
.ql-list li:last-child { margin-bottom: 0; }
.ql-list a {
  color: var(--accent);
  font-size: 0.7rem;
  text-decoration: none;
  transition: text-decoration 0.15s;
}
.ql-list a:hover { text-decoration: underline; }

/* Mobile FAB */
.ql-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74,44,143,0.35);
  transition: transform 0.2s, opacity 0.2s;
  display: none;
}
.ql-fab:hover { transform: scale(1.08); opacity: 0.9; }

/* Mobile overlay */
.ql-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ql-overlay.open { display: flex; }
.ql-popup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Responsive: hide desktop sidebar, show FAB on mobile */
@media (max-width: 768px) {
  .ql-sidebar { display: none !important; }
  .ql-fab.ql-loaded { display: flex; align-items: center; justify-content: center; }
}

/* ============================================================
   TOOLS PAGE
   ============================================================ */
.tools-page-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 100px 0 40px;
  text-align: center;
}
.tools-page-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.tools-page-hero p { color: var(--text-secondary); font-size: 0.95rem; }

.tools-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.tools-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tool-card.active { border-color: var(--accent); background: var(--tag-bg); }
.tool-card-icon { font-size: 1.3rem; }
.tool-card-text { display: flex; flex-direction: column; gap: 2px; }
.tool-card-name { font-weight: 600; font-size: 0.92rem; }
.tool-card-tagline { font-size: 0.72rem; color: var(--text-muted); }
.tools-empty, .tool-load-error { color: var(--text-secondary); padding: 20px; }

.tools-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  min-height: 400px;
}

/* ---- Comparison Image Grid tool ---- */
.grid-tool-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.grid-tool-header p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 20px; }

.grid-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}
.gt-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
}
.gt-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 4px 0;
}
.gt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}
.gt-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.gt-row input[type="number"],
.gt-row input[type="text"],
.gt-row select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  width: 100px;
}
.gt-row input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
}
.gt-check { flex-direction: row !important; align-items: center; gap: 6px !important; }
.gt-warning { font-size: 0.76rem; color: var(--accent); margin: 6px 0 0; }

.gt-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.gt-dropzone.drag-over { border-color: var(--accent); background: var(--tag-bg); }
.gt-filelabel { margin-top: 8px; display: inline-flex; }

.gt-labels-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.gt-label-input {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.gt-label-input input {
  width: 92px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.78rem;
}

.gt-font-status { font-size: 0.78rem; color: var(--text-muted); }
.gt-presets { gap: 8px; }

.grid-preview { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.grid-preview-canvas-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(128,128,128,0.15) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.15) 75%) 0 0/20px 20px,
    linear-gradient(45deg, rgba(128,128,128,0.15) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.15) 75%) 10px 10px/20px 20px,
    var(--bg-card);
  min-height: 420px;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}
.grid-preview-canvas-wrap canvas { max-width: 100%; height: auto; display: block; }
.grid-empty-hint { color: var(--text-muted); font-size: 0.85rem; position: absolute; }

.grid-export {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.grid-export select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.84rem;
}
.gt-export-status { font-size: 0.78rem; color: var(--text-secondary); }

.gt-hint { font-size: 0.78rem; color: var(--text-muted); margin: 6px 0; }

.gt-thumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.gt-thumb {
  position: relative;
  width: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: grab;
  padding-bottom: 6px;
  text-align: center;
}
.gt-thumb.dragging { opacity: 0.4; }
.gt-thumb img { width: 100%; height: 64px; object-fit: cover; display: block; }
.gt-thumb-name {
  display: block;
  margin-top: 4px;
  padding: 0 4px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gt-thumb-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  font-size: 0.68rem;
  line-height: 20px;
}

.gt-table-wrap { overflow-x: auto; }
.gt-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.gt-table th, .gt-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.gt-swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-right: 4px;
}

@media (max-width: 900px) {
  .tools-layout { grid-template-columns: 1fr; }
  .tools-sidebar { position: static; flex-direction: row; overflow-x: auto; }
  .tool-card { min-width: 220px; }
}
