/* ==================================================================
 * Knihovnička KČJL · Barevný moderní design
 * Inspirace: netolismus – gradient nadpisy, pastelové mlhové pozadí,
 * oblé pill buttony, vzdušný layout
 * ================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg:           #f7f6f2;
  --bg-card:      #ffffff;
  --bg-subtle:    #efedf5;
  --bg-hover:     #e4e2ec;

  /* Text – výrazně tmavší pro dobrou čitelnost */
  --text:         #13131c;
  --text-muted:   #4a4959;
  --text-subtle:  #7b7a8c;

  /* Borders & shadows */
  --border:       rgba(31, 31, 44, 0.12);
  --border-hover: rgba(31, 31, 44, 0.25);
  --shadow-sm:    0 1px 2px rgba(31, 31, 44, 0.06);
  --shadow-md:    0 4px 12px rgba(31, 31, 44, 0.08), 0 1px 2px rgba(31, 31, 44, 0.04);
  --shadow-lg:    0 12px 32px rgba(31, 31, 44, 0.12), 0 2px 6px rgba(31, 31, 44, 0.06);
  --shadow-glow:  0 8px 24px rgba(96, 94, 240, 0.25);

  /* Brand gradient */
  --grad-brand-1: #3d6bff;
  --grad-brand-2: #00c3ff;
  --grad-pink-1:  #ffa3c7;
  --grad-pink-2:  #ffd0e1;
  --grad-violet:  #8e82ff;

  /* Accent colors */
  --accent:       #3d6bff;
  --accent-hover: #2854e0;
  --accent-fg:    #ffffff;
  --accent-soft:  #e6edff;
  --accent-grad:  linear-gradient(135deg, #3d6bff 0%, #00c3ff 100%);

  /* Semantic */
  --success:      #0f9c6e;
  --success-bg:   #dcf5e8;
  --warning:      #b07405;
  --warning-bg:   #fef3d7;
  --danger:       #c4342e;
  --danger-bg:    #fde4e3;
  --info:         #3d6bff;
  --info-bg:      #e6edff;

  /* Categories – sytější, veselejší */
  --cat-1-bg: #d0defb; --cat-1-fg: #1d4ed8; --cat-1-accent: #3d6bff;
  --cat-2-bg: #b6ecd5; --cat-2-fg: #0f7a5e; --cat-2-accent: #10b981;
  --cat-3-bg: #dacefa; --cat-3-fg: #5932c7; --cat-3-accent: #8b5cf6;
  --cat-4-bg: #ffd0ba; --cat-4-fg: #b53d0b; --cat-4-accent: #f97316;
  --cat-5-bg: #fcbcd2; --cat-5-fg: #a1174a; --cat-5-accent: #ec4899;
  --cat-6-bg: #fde79c; --cat-6-fg: #854d0e; --cat-6-accent: #eab308;
  --cat-7-bg: #d8d6e0; --cat-7-fg: #4b4a5c; --cat-7-accent: #6b6a80;

  /* Type icon colors – stejná škála */
  --type-1-bg: #fde79c; --type-1-fg: #854d0e;
  --type-2-bg: #fccbc9; --type-2-fg: #c4342e;
  --type-3-bg: #fccbc9; --type-3-fg: #c4342e;
  --type-4-bg: #b6ecd5; --type-4-fg: #0f7a5e;
  --type-5-bg: #ffd0ba; --type-5-fg: #b53d0b;
  --type-6-bg: #dacefa; --type-6-fg: #5932c7;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Timing */
  --t-fast: 0.15s;
  --t-med:  0.25s;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0c0c14;
    --bg-card:     #16161f;
    --bg-subtle:   #1f1f2c;
    --bg-hover:    #292938;
    --text:        #f0eff5;
    --text-muted:  #a6a4b8;
    --text-subtle: #65647a;
    --border:      rgba(255,255,255,0.08);
    --border-hover:rgba(255,255,255,0.20);
    --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:   0 12px 32px rgba(0,0,0,0.6);
    --shadow-glow: 0 8px 24px rgba(61, 107, 255, 0.35);

    --accent:      #6b8fff;
    --accent-hover:#8aa5ff;
    --accent-fg:   #0c0c14;
    --accent-soft: #1e2340;

    --success-bg:  #0d3b2b;
    --warning-bg:  #3d2a08;
    --danger-bg:   #3d1614;
    --info-bg:     #1e2340;

    --cat-1-bg: #1e2a52; --cat-1-fg: #a3bcff; --cat-1-accent: #6b8fff;
    --cat-2-bg: #0f3728; --cat-2-fg: #5fd5a4; --cat-2-accent: #10b981;
    --cat-3-bg: #2d1f57; --cat-3-fg: #c3a9ff; --cat-3-accent: #a78bfa;
    --cat-4-bg: #4a1f07; --cat-4-fg: #ffb787; --cat-4-accent: #fb923c;
    --cat-5-bg: #4a0f2a; --cat-5-fg: #ffa3c7; --cat-5-accent: #f472b6;
    --cat-6-bg: #3a2a05; --cat-6-fg: #fcd34d; --cat-6-accent: #eab308;
    --cat-7-bg: #2b2a3a; --cat-7-fg: #b8b6cc; --cat-7-accent: #7d7c94;

    --type-1-bg: #3a2a05; --type-1-fg: #fcd34d;
    --type-2-bg: #3d1614; --type-2-fg: #ff9b97;
    --type-3-bg: #3d1614; --type-3-fg: #ff9b97;
    --type-4-bg: #0f3728; --type-4-fg: #5fd5a4;
    --type-5-bg: #4a1f07; --type-5-fg: #ffb787;
    --type-6-bg: #2d1f57; --type-6-fg: #c3a9ff;
  }
}

/* Manuální dark/light toggle */
body.theme-dark {
  --bg:#0c0c14; --bg-card:#16161f; --bg-subtle:#1f1f2c; --bg-hover:#292938;
  --text:#f0eff5; --text-muted:#a6a4b8; --text-subtle:#65647a;
  --border:rgba(255,255,255,0.08); --border-hover:rgba(255,255,255,0.20);
  --shadow-sm:0 1px 2px rgba(0,0,0,0.4); --shadow-md:0 4px 12px rgba(0,0,0,0.5); --shadow-lg:0 12px 32px rgba(0,0,0,0.6);
  --shadow-glow:0 8px 24px rgba(61,107,255,0.35);
  --accent:#6b8fff; --accent-hover:#8aa5ff; --accent-fg:#0c0c14; --accent-soft:#1e2340;
  --success-bg:#0d3b2b; --warning-bg:#3d2a08; --danger-bg:#3d1614; --info-bg:#1e2340;
  --cat-1-bg:#1e2a52;--cat-1-fg:#a3bcff;--cat-1-accent:#6b8fff;
  --cat-2-bg:#0f3728;--cat-2-fg:#5fd5a4;--cat-2-accent:#10b981;
  --cat-3-bg:#2d1f57;--cat-3-fg:#c3a9ff;--cat-3-accent:#a78bfa;
  --cat-4-bg:#4a1f07;--cat-4-fg:#ffb787;--cat-4-accent:#fb923c;
  --cat-5-bg:#4a0f2a;--cat-5-fg:#ffa3c7;--cat-5-accent:#f472b6;
  --cat-6-bg:#3a2a05;--cat-6-fg:#fcd34d;--cat-6-accent:#eab308;
  --cat-7-bg:#2b2a3a;--cat-7-fg:#b8b6cc;--cat-7-accent:#7d7c94;
  --type-1-bg:#3a2a05;--type-1-fg:#fcd34d;
  --type-2-bg:#3d1614;--type-2-fg:#ff9b97;
  --type-3-bg:#3d1614;--type-3-fg:#ff9b97;
  --type-4-bg:#0f3728;--type-4-fg:#5fd5a4;
  --type-5-bg:#4a1f07;--type-5-fg:#ffb787;
  --type-6-bg:#2d1f57;--type-6-fg:#c3a9ff;
}
body.theme-light {
  --bg:#f7f6f2; --bg-card:#ffffff; --bg-subtle:#efedf5; --bg-hover:#e4e2ec;
  --text:#13131c; --text-muted:#4a4959; --text-subtle:#7b7a8c;
  --border:rgba(31,31,44,0.12); --border-hover:rgba(31,31,44,0.25);
  --shadow-sm:0 1px 2px rgba(31,31,44,0.06); --shadow-md:0 4px 12px rgba(31,31,44,0.08); --shadow-lg:0 12px 32px rgba(31,31,44,0.12);
  --shadow-glow:0 8px 24px rgba(96,94,240,0.25);
  --accent:#3d6bff; --accent-hover:#2854e0; --accent-fg:#ffffff; --accent-soft:#e6edff;
  --success-bg:#dcf5e8; --warning-bg:#fef3d7; --danger-bg:#fde4e3; --info-bg:#e6edff;
  --cat-1-bg:#d0defb;--cat-1-fg:#1d4ed8;--cat-1-accent:#3d6bff;
  --cat-2-bg:#b6ecd5;--cat-2-fg:#0f7a5e;--cat-2-accent:#10b981;
  --cat-3-bg:#dacefa;--cat-3-fg:#5932c7;--cat-3-accent:#8b5cf6;
  --cat-4-bg:#ffd0ba;--cat-4-fg:#b53d0b;--cat-4-accent:#f97316;
  --cat-5-bg:#fcbcd2;--cat-5-fg:#a1174a;--cat-5-accent:#ec4899;
  --cat-6-bg:#fde79c;--cat-6-fg:#854d0e;--cat-6-accent:#eab308;
  --cat-7-bg:#d8d6e0;--cat-7-fg:#4b4a5c;--cat-7-accent:#6b6a80;
  --type-1-bg:#fde79c;--type-1-fg:#854d0e;
  --type-2-bg:#fccbc9;--type-2-fg:#c4342e;
  --type-3-bg:#fccbc9;--type-3-fg:#c4342e;
  --type-4-bg:#b6ecd5;--type-4-fg:#0f7a5e;
  --type-5-bg:#ffd0ba;--type-5-fg:#b53d0b;
  --type-6-bg:#dacefa;--type-6-fg:#5932c7;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Pastelové mlhové pozadí na hero stránce */
body.has-hero-bg::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 720px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 40% 50% at 15% 20%, rgba(61, 107, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 35% 45% at 85% 15%, rgba(168, 130, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 55% at 50% 50%, rgba(255, 163, 199, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 70%, rgba(0, 195, 255, 0.10) 0%, transparent 60%);
}
@media (prefers-color-scheme: dark) {
  body.has-hero-bg::before {
    background:
      radial-gradient(ellipse 40% 50% at 15% 20%, rgba(61, 107, 255, 0.15) 0%, transparent 60%),
      radial-gradient(ellipse 35% 45% at 85% 15%, rgba(168, 130, 255, 0.18) 0%, transparent 60%),
      radial-gradient(ellipse 50% 55% at 50% 50%, rgba(255, 163, 199, 0.08) 0%, transparent 60%),
      radial-gradient(ellipse 40% 40% at 90% 70%, rgba(0, 195, 255, 0.12) 0%, transparent 60%);
  }
}
body.theme-dark.has-hero-bg::before {
  background:
    radial-gradient(ellipse 40% 50% at 15% 20%, rgba(61, 107, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 35% 45% at 85% 15%, rgba(168, 130, 255, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 55% at 50% 50%, rgba(255, 163, 199, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 70%, rgba(0, 195, 255, 0.12) 0%, transparent 60%);
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--accent-hover); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* =================== HEADER =================== */
.site-header {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0.95rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.25);
}
.brand-icon svg { width: 18px; height: 18px; }
.brand-sub {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.btn-ghost svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-ghost-icon {
  padding: 0.5rem;
  width: 38px; height: 38px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
}

/* =================== HERO + SEARCH =================== */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
body.theme-dark .hero-badge { background: var(--bg-card); color: var(--text); }
body.theme-light .hero-badge { background: var(--bg-card); color: var(--text); }

.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cat-5-accent);
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  margin: 0 0 1rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero .tagline {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.hero .lead {
  color: var(--text-muted);
  margin: 0 auto 2rem;
  max-width: 600px;
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
}

.hero-search {
  max-width: 680px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.65rem 0.65rem 0.65rem 1.2rem;
  box-shadow: var(--shadow-md);
  transition: all var(--t-med);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(61, 107, 255, 0.12), var(--shadow-lg);
}
.search-box > svg {
  width: 20px; height: 20px;
  color: var(--text-subtle);
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  padding: 0.3rem 0;
}
.search-box input::placeholder { color: var(--text-subtle); }
.search-box .search-submit {
  background: var(--accent-grad);
  color: #fff;
  border: 0;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--t-fast);
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.3);
}
.search-box .search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(61, 107, 255, 0.4);
}
.search-box .search-submit svg { width: 14px; height: 14px; }

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  background: var(--accent-grad);
  color: #fff;
  border-radius: var(--r-pill);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
}
.ai-badge svg { width: 11px; height: 11px; }

.chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  justify-content: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--r-pill);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
}
.chip:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-hover);
  text-decoration: none;
  transform: translateY(-1px);
}
.chip.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.3);
}
.chip.active:hover { color: #fff; transform: translateY(-1px); }
.chip .count {
  opacity: 0.6;
  font-size: 0.78rem;
  font-weight: 500;
}

/* =================== SECTION HEADS =================== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.25rem;
}
.section-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}
.section-head .sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
  margin-left: 0.3rem;
}
.section-head-link {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-head-link:hover { text-decoration: underline; }

/* =================== CATEGORIES =================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: all var(--t-med);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.cat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.cat-card-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
body.theme-dark .cat-card-icon { background: rgba(0, 0, 0, 0.3); }
@media (prefers-color-scheme: dark) { .cat-card-icon { background: rgba(0, 0, 0, 0.3); } }
body.theme-light .cat-card-icon { background: rgba(255, 255, 255, 0.55); }

.cat-card-icon svg { width: 20px; height: 20px; }
.cat-card-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cat-card .name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.cat-card .count {
  font-size: 0.82rem;
  opacity: 0.8;
  font-weight: 500;
}

.cat-card.cat-1 { background: var(--cat-1-bg); color: var(--cat-1-fg); }
.cat-card.cat-2 { background: var(--cat-2-bg); color: var(--cat-2-fg); }
.cat-card.cat-3 { background: var(--cat-3-bg); color: var(--cat-3-fg); }
.cat-card.cat-4 { background: var(--cat-4-bg); color: var(--cat-4-fg); }
.cat-card.cat-5 { background: var(--cat-5-bg); color: var(--cat-5-fg); }
.cat-card.cat-6 { background: var(--cat-6-bg); color: var(--cat-6-fg); }
.cat-card.cat-7 { background: var(--cat-7-bg); color: var(--cat-7-fg); }

/* =================== MATERIAL CARDS =================== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.35rem;
  transition: all var(--t-med);
  display: flex;
  flex-direction: column;
  position: relative;
}
.material-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.material-card .card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.6rem;
}
.type-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.type-icon svg { width: 19px; height: 19px; }
.type-1 { background: var(--type-1-bg); color: var(--type-1-fg); }
.type-2 { background: var(--type-2-bg); color: var(--type-2-fg); }
.type-3 { background: var(--type-3-bg); color: var(--type-3-fg); }
.type-4 { background: var(--type-4-bg); color: var(--type-4-fg); }
.type-5 { background: var(--type-5-bg); color: var(--type-5-fg); }
.type-6 { background: var(--type-6-bg); color: var(--type-6-fg); }

.material-card .card-title { flex: 1; min-width: 0; }
.material-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.2rem;
  letter-spacing: -0.015em;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.material-card h3 a { color: var(--text); }
.material-card h3 a:hover { color: var(--accent); text-decoration: none; }
.material-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.material-card .meta .dot { opacity: 0.55; }
.material-card .desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0.35rem 0 0.85rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.material-card .tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tag {
  font-size: 0.74rem;
  padding: 0.22rem 0.7rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all var(--t-fast);
  font-weight: 500;
  border: 1px solid var(--border);
}
.tag:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  border-color: var(--accent);
}

/* =================== EMPTY STATE =================== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}
.empty-state-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1.25rem;
  color: var(--text-subtle);
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  color: var(--text);
}
.empty-state p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

/* =================== DETAIL PAGE =================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 1.75rem 0 1rem;
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.85rem 0.35rem 0.6rem;
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
}
.back-link:hover {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}
.back-link svg { width: 14px; height: 14px; }

.detail-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-header .type-icon {
  width: 48px; height: 48px;
}
.detail-header .type-icon svg { width: 24px; height: 24px; }
.detail-main h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.45rem;
  color: var(--text);
}
.detail-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.detail-meta .dot { color: var(--text-subtle); }

.detail-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.detail-embed { margin: 1.5rem 0; }
.detail-embed iframe,
.detail-embed embed,
.detail-embed video {
  width: 100%;
  min-height: 460px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.detail-embed img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.detail-tags {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.detail-tags h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.7rem;
}

/* =================== FORMS =================== */
.form-row { margin-bottom: 1.15rem; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.form-row .help {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 0.4rem;
  line-height: 1.5;
}
input[type=text], input[type=password], input[type=url],
input[type=email], input[type=number], select, textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.94rem;
  outline: none;
  transition: all var(--t-fast);
  color: var(--text);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 107, 255, 0.12);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; font-family: inherit; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2365647a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg-card);
  border: 1px solid var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:hover { opacity: 0.9; text-decoration: none; color: var(--bg-card); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 107, 255, 0.35);
}
.btn-primary:hover {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(61, 107, 255, 0.45);
}
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; opacity: 0.9; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.84rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =================== FLASH MESSAGES =================== */
.flash {
  padding: 0.9rem 1.15rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.15rem; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error   { background: var(--danger-bg);  color: var(--danger); }
.flash-info    { background: var(--info-bg);    color: var(--info); }
.flash-warning { background: var(--warning-bg); color: var(--warning); }

/* =================== PAGINATION =================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0 1.5rem;
}
.pagination a, .pagination span {
  padding: 0.55rem 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  background: var(--bg-card);
  transition: all var(--t-fast);
  font-weight: 500;
}
.pagination a:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-hover);
  text-decoration: none;
}
.pagination span { border-color: transparent; background: transparent; }

/* =================== FOOTER =================== */
.site-footer {
  padding: 2.5rem 0 1.75rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.6;
}
.site-footer a { color: var(--text-muted); }

/* =================== ADMIN =================== */
.admin-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
  margin-bottom: 2rem;
}
.admin-nav-inner {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-nav-inner::-webkit-scrollbar { display: none; }
.admin-nav a {
  padding: 0.55rem 1rem;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.admin-nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.admin-nav a.active {
  background: var(--accent-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.3);
}

.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.page-title h1 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--text);
}
.page-title .sub {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1rem;
  margin-left: 0.4rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.35rem;
  transition: all var(--t-fast);
}
.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-card .value {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.stat-card .sub {
  font-size: 0.82rem;
  color: var(--text-subtle);
  margin-top: 0.35rem;
}
.stat-card .sub a { color: var(--accent); font-weight: 500; }

.admin-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th, .admin-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.admin-table tbody tr { transition: background var(--t-fast); }
.admin-table tbody tr:hover { background: var(--bg-subtle); }
.admin-table .actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

/* =================== LOGIN =================== */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.75rem 2.75rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .brand-icon {
  width: 52px; height: 52px;
  margin: 0 auto 1.4rem;
}
.login-card .brand-icon svg { width: 28px; height: 28px; }
.login-card h1 {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}
.login-card .sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1.75rem;
}
.login-card form { text-align: left; }
.login-card .btn { width: 100%; margin-top: 0.35rem; }
.login-card .footer-link {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-subtle);
  margin-top: 1.5rem;
}
.login-card .footer-link a { color: var(--text-muted); font-weight: 500; }

/* =================== CHATBOT =================== */
.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  max-width: 820px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  min-height: 540px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.chat-header {
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, rgba(61,107,255,0.03), rgba(0,195,255,0.03));
}
.chat-header .brand-icon { background: var(--accent-grad); }
.chat-header h2 { font-size: 1.15rem; margin: 0; color: var(--text); }
.chat-header .sub { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.15rem; }

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 60vh;
}
.chat-msg {
  max-width: 85%;
  padding: 0.8rem 1.1rem;
  border-radius: var(--r-lg);
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.chat-msg.user {
  background: var(--accent-grad);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(61, 107, 255, 0.25);
}
.chat-msg.bot {
  background: var(--bg-subtle);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.chat-msg a { color: inherit; font-weight: 600; text-decoration: underline; }
.chat-msg.user a { color: #fff; }
.chat-msg .citations {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.chat-msg .citations-head {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.chat-msg .citations-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-subtle);
  font-size: 0.7rem;
  margin-left: 0.4rem;
}
.chat-msg .citations-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.chat-msg .citations a {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--t-fast);
}
.chat-msg .citations a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.cit-score {
  color: var(--text-subtle);
  font-size: 0.72rem;
  font-weight: 400;
  margin-left: 0.2rem;
}
.chat-msg .citations-external {
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}
.chat-msg .citation-external-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.85rem;
  background: rgba(61, 107, 255, 0.05);
  border: 1px solid rgba(61, 107, 255, 0.15);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: default;
}
body.theme-dark .chat-msg .citation-external-item {
  background: rgba(107, 143, 255, 0.1);
  border-color: rgba(107, 143, 255, 0.2);
}
.chat-msg .citation-external-item svg {
  width: 13px; height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.chat-input-row input {
  flex: 1;
  padding: 0.75rem 1.1rem;
  background: var(--bg-subtle);
  border-radius: var(--r-pill);
}
.chat-thinking {
  align-self: flex-start;
  padding: 0;
  max-width: 85%;
}
.chat-thinking .thinking-bubble {
  background: linear-gradient(135deg,
    rgba(61, 107, 255, 0.1),
    rgba(139, 92, 246, 0.1),
    rgba(0, 195, 255, 0.1));
  background-size: 200% 200%;
  animation: thinking-gradient 3s ease infinite;
  color: var(--text);
  padding: 0.95rem 1.25rem;
  border-radius: var(--r-lg);
  border-bottom-left-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  min-width: 260px;
}
body.theme-dark .chat-thinking .thinking-bubble {
  background: linear-gradient(135deg,
    rgba(107, 143, 255, 0.22),
    rgba(168, 139, 250, 0.22),
    rgba(0, 195, 255, 0.22));
  background-size: 200% 200%;
  animation: thinking-gradient 3s ease infinite;
}
@keyframes thinking-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.chat-thinking .thinking-spark {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--accent);
  animation: thinking-spin 2s linear infinite;
}
@keyframes thinking-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.chat-thinking .thinking-phrase {
  flex: 1;
  transition: opacity 0.25s ease;
  font-weight: 500;
  color: var(--text);
}
.chat-thinking .dots {
  display: inline-flex;
  gap: 5px;
  flex-shrink: 0;
}
.chat-thinking .dots span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: thinking-bounce 1.4s infinite both;
}
.chat-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.7); opacity: 0.4; }
  40% { transform: translateY(-6px) scale(1); opacity: 1; }
}

/* =================== VECTOR STORE HINT =================== */
.vs-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.7rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-color: rgba(61, 107, 255, 0.25);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  width: fit-content;
  max-width: 100%;
}
.vs-hint svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
}
.vs-hint-toggle {
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.vs-hint-toggle:hover {
  background: rgba(61, 107, 255, 0.15);
  border-color: rgba(61, 107, 255, 0.4);
}
.vs-hint-arrow {
  transition: transform var(--t-fast);
}
.vs-hint-toggle.is-expanded .vs-hint-arrow {
  transform: rotate(180deg);
}
body.theme-dark .vs-hint {
  background: rgba(107, 143, 255, 0.12);
  border-color: rgba(107, 143, 255, 0.3);
  color: #8aaaff;
}
body.theme-dark .vs-hint-toggle:hover {
  background: rgba(107, 143, 255, 0.2);
}

.chat-msg .citations.is-hidden {
  display: none;
}

/* =================== DŮLEŽITÉ ODKAZY =================== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all var(--t-med);
  display: flex;
  flex-direction: column;
  position: relative;
}
.link-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.link-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}
.link-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.link-card:hover .link-card-icon {
  background: var(--accent);
  color: #fff;
}
.link-card-icon svg { width: 18px; height: 18px; }
.link-card-title {
  flex: 1;
  min-width: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}
.link-card-ext {
  width: 14px; height: 14px;
  color: var(--text-subtle);
  flex-shrink: 0;
  margin-top: 3px;
  transition: color var(--t-fast);
}
.link-card:hover .link-card-ext {
  color: var(--accent);
}
.link-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0.15rem 0 0.65rem;
  flex: 1;
}
.link-card-domain {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.link-card-hidden { display: none; }
.links-grid.expanded .link-card-hidden { display: flex; animation: linkFadeIn 0.3s ease; }
@keyframes linkFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.links-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 2.5rem;
}
.links-toggle {
  gap: 0.4rem;
}
.links-toggle-arrow {
  width: 16px; height: 16px;
  transition: transform var(--t-fast);
}
.links-toggle.is-expanded .links-toggle-arrow {
  transform: rotate(180deg);
}

/* =================== VISIT COUNTER =================== */
.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.visit-counter svg {
  width: 16px; height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.visit-label {
  font-weight: 500;
}
.visit-number {
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.footer-meta {
  margin-top: 0.5rem;
}
.muted       { color: var(--text-muted); }
.subtle      { color: var(--text-subtle); }
.text-sm     { font-size: 0.86rem; }
.text-xs     { font-size: 0.78rem; }
.font-mono   { font-family: ui-monospace, Menlo, Consolas, monospace; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }

@media (max-width: 700px) {
  .container { padding: 0 1rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero .tagline { font-size: 1.15rem; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .cat-card { padding: 0.85rem; gap: 0.6rem; }
  .cat-card-icon { width: 34px; height: 34px; }
  .cat-card-icon svg { width: 16px; height: 16px; }
  .cat-card .name { font-size: 0.9rem; }
  .cat-card .count { font-size: 0.75rem; }
  .materials-grid { grid-template-columns: 1fr; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th, .admin-table td { padding: 0.6rem 0.75rem; }
  .detail-main { padding: 1.35rem 1.35rem; }
  .detail-main h1 { font-size: 1.4rem; }
  .brand-sub { display: none; }
  .btn-ghost span { display: none; }
  .btn-ghost { padding: 0.5rem; }
  .search-box { padding: 0.5rem 0.5rem 0.5rem 1rem; border-radius: var(--r-lg); }
  .search-box .search-submit { padding: 0.5rem 0.85rem; }
}

/* =================== AI PANEL (admin form) =================== */
.ai-panel {
  background: linear-gradient(135deg, rgba(61,107,255,0.04), rgba(139,92,246,0.04));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.35rem;
  margin-top: 1.5rem;
}
body.theme-dark .ai-panel { background: linear-gradient(135deg, rgba(61,107,255,0.08), rgba(139,92,246,0.08)); }
.ai-panel h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
.ai-panel h3 svg { width: 16px; height: 16px; color: var(--accent); }
.ai-panel .desc { font-size: 0.86rem; color: var(--text-muted); margin: 0 0 1rem; line-height: 1.55; }
