/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }

:root {
  --font: "Google Sans", "Noto Sans Georgian", sans-serif;

  --bg:          #f8fafc;
  --bg-card:     #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-header:   #ffffff;
  --bg-muted:    #f1f5f9;
  --bg-hover:    #f8fafc;
  --bg-input:    #f1f5f9;

  --border:      #e2e8f0;
  --border-light:#f1f5f9;

  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-subtle: #94a3b8;
  --text-white:  #ffffff;

  --blue:        #2563eb;
  --blue-hover:  #1d4ed8;
  --blue-light:  #eff6ff;
  --blue-text:   #1d4ed8;

  --emerald:     #059669;
  --emerald-bg:  #ecfdf5;
  --emerald-ring:#d1fae5;

  --red:         #ef4444;
  --red-bg:      #fef2f2;
  --red-text:    #dc2626;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.10);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  --transition: 0.18s ease;
}

.dark {
  --bg:          #020617;
  --bg-card:     #0f172a;
  --bg-sidebar:  #0f172a;
  --bg-header:   #0f172a;
  --bg-muted:    #1e293b;
  --bg-hover:    #1e293b;
  --bg-input:    #1e293b;

  --border:      #1e293b;
  --border-light:#1e293b;

  --text:        #f8fafc;
  --text-muted:  #94a3b8;
  --text-subtle: #475569;

  --blue:        #3b82f6;
  --blue-hover:  #60a5fa;
  --blue-light:  rgba(59,130,246,.12);
  --blue-text:   #60a5fa;

  --emerald-bg:  rgba(5,150,105,.12);
  --emerald-ring:rgba(5,150,105,.2);

  --red-bg:      rgba(239,68,68,.1);
  --red-text:    #f87171;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-optical-sizing: auto;
  font-style: normal;
  font-variation-settings: "GRAD" 0;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color .3s, color .3s;
  min-height: 100vh;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
  display: none;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

@media (min-width: 1024px) {
  .top-navbar { display: block; }
}

.top-navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 48px;
}

.top-navbar-link {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.top-navbar-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.top-navbar-link-active {
  background: var(--blue-light);
  color: var(--blue-text);
  font-weight: 600;
}

.mobile-nav-link-active {
  background: var(--blue-light);
  color: var(--blue-text);
  font-weight: 600;
}

/* ===== TOP NAVBAR DROPDOWNS ===== */
.top-navbar-dropdown {
  position: relative;
}

.top-navbar-drop-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.top-navbar-drop-toggle i {
  font-size: 16px;
  transition: transform var(--transition);
}

.top-navbar-dropdown:hover .top-navbar-drop-toggle i {
  transform: rotate(180deg);
}

.top-navbar-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 6px;
  z-index: 100;
  animation: fadeSlideDown .15s ease;
}

.top-navbar-dropdown:hover .top-navbar-submenu {
  display: block;
}

.top-navbar-submenu li a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.top-navbar-submenu li a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  display: none;
  width: 256px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  height: calc(100vh - 48px);
  position: sticky;
  top: 48px;
  overflow-y: auto;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .sidebar { display: flex; }
}

.sidebar-top {
  padding: 24px;
}

.sidebar-brand {
  margin-bottom: 32px;
}

.sidebar-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-subtle);
  margin-bottom: 6px;
  margin-left: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
  margin-bottom: 2px;
}

.sidebar-link-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-link-inner span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--blue-light);
  color: var(--blue-text);
  font-weight: 600;
}

.sidebar-link.active svg { color: var(--blue); }

.saved-link {
  color: var(--text-muted);
  font-weight: 500;
}

.saved-link.active {
  background: var(--red-bg);
  color: var(--red-text);
  font-weight: 600;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 8px;
}

.saved-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
}

.saved-link.active .saved-count {
  background: #fee2e2;
  color: var(--red-text);
}

/* ===== BRAND ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

@media (min-width: 1024px) {
  .mobile-header { display: none; }
}

.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.hamburger-btn:hover { background: var(--bg-hover); }

/* ===== THEME BUTTON ===== */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.theme-btn:hover { background: var(--border); }

.theme-btn-desktop {
  border-radius: var(--radius-full);
  width: 32px;
  height: 32px;
}

.sun-icon, .moon-icon { display: none; }

body:not(.dark) .sun-icon { display: none; }
body:not(.dark) .moon-icon { display: block; color: #6366f1; }
.dark .sun-icon { display: block; color: #fb923c; }
.dark .moon-icon { display: none; }

/* ===== MOBILE MENU ===== */
.mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  width: 256px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
  animation: fadeSlideDown .18s ease;
}

.mobile-menu.open { display: block; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav { padding: 8px; }

.mobile-nav-link {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.mobile-nav-link:hover { background: var(--bg-hover); color: var(--text); }
.mobile-nav-link.active { background: var(--blue-light); color: var(--blue-text); }

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== DESKTOP HEADER ===== */
.desktop-header {
  display: none;
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 48px;
  z-index: 40;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

@media (min-width: 1024px) {
  .desktop-header { display: flex; }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb-sep { color: var(--text-subtle); }
.breadcrumb-active { font-weight: 500; color: var(--text); }

.desktop-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ===== SEARCH ===== */
.search-input {
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 192px;
}

@media (min-width: 1280px) {
  .search-input-desktop { width: 256px; }
}

.search-input::placeholder { color: var(--text-subtle); }
.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

/* ===== CONTENT ===== */
.content {
  flex: 1;
  padding: 12px 0;
  max-width: 896px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 480px)  { .content { padding: 16px; } }
@media (min-width: 640px)  { .content { padding: 24px; } }
@media (min-width: 1024px) { .content { padding: 32px; } }

/* ===== MOBILE HERO ===== */
.mobile-hero {
  display: block;
  margin-bottom: 16px;
  padding: 12px 16px 0;
  position: relative;
  z-index: 20;
}

@media (min-width: 1024px) { .mobile-hero { display: none; } }

.mobile-hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 8px;
}

.mobile-hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.mobile-search-wrapper { margin-bottom: 16px; }

.search-input-mobile {
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ===== SUBJECT SELECTOR ===== */
.subject-selector-wrapper { position: relative; }

.subject-selector-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-subtle);
  margin-bottom: 8px;
  margin-left: 4px;
}

.subject-selector-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
  position: relative;
  z-index: 20;
}

.chevron-icon {
  transition: transform .3s ease;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.chevron-icon.open {
  transform: rotate(180deg);
  color: var(--blue);
}

.subject-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 30;
  max-height: 50vh;
  overflow-y: auto;
  animation: fadeSlideDown .15s ease;
}

.subject-dropdown.open { display: block; }

.subject-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}

.subject-dropdown-item:last-child { border-bottom: none; }
.subject-dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.subject-dropdown-item.active { background: var(--blue-light); color: var(--blue-text); }

.subject-dropdown-item-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-dropdown-divider {
  height: 4px;
  background: var(--bg-muted);
}

.saved-dropdown-item.active { background: var(--red-bg); color: var(--red-text); }

.saved-count-dropdown {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
}

/* ===== PROMO BANNER ===== */
.promo-banner {
  padding: 20px 16px;
  background: var(--blue-light);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
  transition: background var(--transition);
}

@media (min-width: 480px) {
  .promo-banner {
    padding: 20px 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
  }
}

@media (min-width: 1024px) {
  .promo-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

.promo-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

@media (min-width: 640px) { .promo-left { align-items: center; } }

.promo-icon {
  width: 44px;
  height: 44px;
  background: rgba(37,99,235,.12);
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

@media (min-width: 640px) { .promo-icon { display: flex; } }

.promo-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.dark .promo-title { color: #bfdbfe; }

.promo-sub {
  font-size: 13px;
  color: #1d4ed8;
  opacity: .85;
  max-width: 480px;
}

.dark .promo-sub { color: #93c5fd; }

.promo-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

@media (min-width: 1024px) { .promo-right { justify-content: flex-end; } }

.promo-price {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a8a;
  display: none;
}

@media (min-width: 640px) { .promo-price { display: block; } }
.dark .promo-price { color: #bfdbfe; }

.promo-btn {
  padding: 10px 20px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.promo-btn:hover { background: var(--blue-hover); }

/* ===== SUBJECT CARD ===== */
.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  margin-bottom: 8px;
  transition: background var(--transition), border-color var(--transition);
  scroll-margin-top: 96px;
}

@media (min-width: 480px) {
  .subject-card {
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0,0,0,.03);
    margin-bottom: 24px;
  }
}

@media (min-width: 1024px) {
  .subject-card { scroll-margin-top: 128px; }
}

.subject-card-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  background: var(--bg-muted);
  transition: background var(--transition);
}

@media (min-width: 640px) {
  .subject-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    gap: 0;
  }
}

.subject-card-header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

@media (min-width: 640px) {
  .subject-card-header-left { gap: 20px; }
}

.subject-icon-wrap {
  width: 48px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.subject-icon-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(37,99,235,.06);
  border-radius: 12px;
}

.subject-icon-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transform: scale(1.3);
  position: relative;
  z-index: 1;
}

.subject-card-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.25;
}

@media (min-width: 640px) { .subject-card-title { font-size: 24px; } }

.subject-card-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.updated-badge {
  padding: 6px 14px;
  background: var(--emerald-bg);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--emerald-ring);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  align-self: center;
}

/* ===== YEAR ACCORDION ===== */
.year-accordion {
  border-bottom: 1px solid var(--border-light);
  transition: border-color var(--transition);
}

.year-accordion:last-of-type { border-bottom: none; }

.accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
  text-align: left;
}

@media (min-width: 640px) { .accordion-btn { padding: 20px 32px; } }

.accordion-btn:hover { background: var(--bg-hover); }
.accordion-btn.open { background: rgba(37,99,235,.03); }

.accordion-btn-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (min-width: 640px) { .accordion-btn-left { gap: 24px; } }

/* mobile: year stacked above label */
.accordion-year-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* desktop: year | label in one row */
@media (min-width: 640px) {
  .accordion-year-block {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
}

.accordion-year {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  transition: color var(--transition);
  line-height: 1.15;
}

.accordion-btn.open .accordion-year { color: var(--blue-text); }

/* vertical pipe — hidden on mobile, shown on desktop between year and label */
.accordion-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  display: none;
  flex-shrink: 0;
}

@media (min-width: 640px) { .accordion-divider { display: block; } }

.accordion-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  display: none;
}

@media (min-width: 640px) { .accordion-label { display: block; } }

/* small label under year on mobile only */
.accordion-label-mobile {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
}

@media (min-width: 640px) { .accordion-label-mobile { display: none; } }

.accordion-btn.open .accordion-label,
.accordion-btn.open .accordion-label-mobile { color: rgba(37,99,235,.7); }

.accordion-btn-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (min-width: 640px) { .accordion-btn-right { gap: 12px; } }

/* mobile: circle with number+ვარ. stacked */
.variant-count {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--bg-muted);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.variant-count .count-label-short {
  font-size: 10px;
  font-weight: 600;
  opacity: .7;
}

/* desktop: pill with "N ვარიანტი" */
@media (min-width: 640px) {
  .variant-count {
    width: auto;
    height: auto;
    border-radius: var(--radius-full);
    flex-direction: row;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    gap: 4px;
  }
  .variant-count .count-label-short { display: none; }
  .variant-count .count-label-full {
    display: inline;
    font-size: 13px;
    font-weight: 600;
    opacity: 1;
  }
}

.dark .variant-count { color: #e2e8f0; }

.accordion-btn.open .variant-count {
  background: rgba(37,99,235,.12);
  color: var(--blue-text);
}

.count-label-full { display: none; }

.accordion-chevron-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.accordion-btn.open .accordion-chevron-wrap {
  background: var(--blue);
  border-color: var(--blue);
}

.accordion-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  transition: transform .3s ease, color var(--transition);
}

.accordion-btn.open .accordion-chevron {
  transform: rotate(180deg);
  color: white;
}

/* ===== VARIANTS GRID ===== */
.variants-wrapper {
  overflow: hidden;
  max-height: 0;
  transition: max-height .4s cubic-bezier(.04,.62,.23,.98), opacity .25s ease;
  opacity: 0;
  background: rgba(241,245,249,.3);
}

.dark .variants-wrapper { background: rgba(15,23,42,.5); }

.variants-wrapper.open {
  opacity: 1;
}

.variants-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
}

@media (min-width: 640px) {
  .variants-grid {
    grid-template-columns: 1fr 1fr;
    padding: 16px 32px 24px;
  }
}

@media (min-width: 1024px) {
  .variants-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.variant-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.02);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), color var(--transition), background var(--transition);
  animation: variantIn .25s ease both;
}

@keyframes variantIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.dark .variant-card { color: #cbd5e1; }

.variant-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 16px rgba(37,99,235,.08), 0 0 0 1px rgba(37,99,235,.15);
  transform: translateY(-2px);
  color: var(--blue-text);
}

.variant-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.variant-file-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.variant-card:hover .variant-file-icon {
  background: var(--blue-light);
  color: var(--blue);
  border-color: rgba(37,99,235,.2);
}

.variant-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: transform var(--transition);
}

.heart-btn:hover { transform: scale(1.15); }
.heart-btn:active { transform: scale(.9); }

.heart-icon {
  width: 18px;
  height: 18px;
  color: var(--border);
  transition: color var(--transition), fill var(--transition);
}

.heart-btn.saved .heart-icon {
  color: #ef4444;
  fill: #ef4444;
}

.heart-btn:not(.saved):hover .heart-icon { color: #f87171; }

.ext-link-icon {
  width: 14px;
  height: 14px;
  color: var(--border);
  transition: color var(--transition);
  flex-shrink: 0;
}

.variant-card:hover .ext-link-icon { color: var(--blue); }

/* ===== SHOW ALL BUTTON ===== */
.show-all-wrap {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(241,245,249,.4);
  display: flex;
  justify-content: center;
  transition: background var(--transition);
}

.dark .show-all-wrap { background: rgba(15,23,42,.4); }

.show-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: color var(--transition);
}

.show-all-btn:hover { color: var(--blue-hover); }

.show-all-chevron {
  width: 16px;
  height: 16px;
  transition: transform .3s ease;
}

.show-all-chevron.open { transform: rotate(180deg); }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 340px;
  margin: 0 auto;
}

/* ===== INFO CARDS ===== */
.info-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
}

@media (min-width: 768px) {
  .info-cards { grid-template-columns: 1fr 1fr; }
}

.info-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.info-card:hover { box-shadow: var(--shadow-md); }

.info-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info-card-icon-orange { background: rgba(249,115,22,.08); }
.info-card-icon-purple { background: rgba(147,51,234,.08); }

.info-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.info-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== NEWSLETTER ===== */
.newsletter {
  margin: 24px auto 80px;
  max-width: 640px;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}

@media (min-width: 640px) { .newsletter { padding: 40px; } }

.newsletter-icon {
  width: 56px;
  height: 56px;
  background: var(--blue-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  margin: 0 auto 20px;
}

.newsletter-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 8px;
}

@media (min-width: 640px) { .newsletter-title { font-size: 26px; } }

.newsletter-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .newsletter-form { flex-direction: row; }
}

.newsletter-input-wrapper {
  position: relative;
  flex: 1;
}

.newsletter-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.newsletter-input {
  width: 100%;
  height: 48px;
  padding-left: 44px;
  padding-right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.newsletter-input::placeholder { color: var(--text-subtle); }

.newsletter-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

.newsletter-input:disabled { opacity: .5; }

.newsletter-btn {
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  background: var(--blue);
  color: white;
  transition: background var(--transition);
  flex-shrink: 0;
}

.newsletter-btn:hover { background: var(--blue-hover); }
.newsletter-btn.success { background: #059669; }
.newsletter-btn:disabled { opacity: .7; cursor: default; }

/* ===== FOOTER ===== */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.footer-inner {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) { .footer-inner { padding: 0 24px; } }

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

@media (min-width: 768px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.footer-col { display: flex; flex-direction: column; gap: 12px; }

.footer-brand {
  font-size: 22px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -.02em;
}

.footer-email {
  color: #94a3b8;
  text-decoration: none;
  font-size: 15px;
  transition: color var(--transition);
}

.footer-email:hover { color: #60a5fa; }

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.footer-social-label { font-size: 14px; }

.footer-social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #1e293b;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.footer-social-btn:hover { background: #1877F2; color: white; }

.footer-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition);
  width: fit-content;
}

.footer-link:hover { color: #f8fafc; }

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

.footer-copy { font-size: 13px; }

.topge-badge {
  width: 88px;
  height: 31px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: .1em;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
