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

:root {
  --bg: #eef1f5;
  --paper: #ffffff;
  --paper-2: #f6f8fb;
  --ink: #1f232b;
  --muted: #6d7480;
  --line: #d8dde6;
  --dark: #15171c;
  --dark-2: #20242c;
  --dark-3: #2a303a;
  --green: #167a08;
  --green-2: #22b313;
  --green-soft: rgba(34, 179, 19, 0.12);
  --gold: #ffc83d;
  --blue: #2f80ed;
  --red: #ef4444;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.11);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', Arial, sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(34, 179, 19, 0.13), transparent 28%),
    linear-gradient(180deg, #f3f5f8 0%, var(--bg) 42%, #e8ecf2 100%);
  color: var(--ink);
  letter-spacing: -0.015em;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* Top bar */
.topbar {
  min-height: 62px;
  background: rgba(21, 23, 28, 0.96);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(12px, 3vw, 26px);
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.topbar.sticky {
  position: sticky;
  top: 0;
}

.brand {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #0dcf48, #086f05 68%),
    #108d09;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2), 0 12px 22px rgba(0, 0, 0, 0.26);
}

.icon-button {
  width: 48px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #222731;
  border-radius: 12px;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
}

.icon-button span {
  width: 23px;
  height: 3px;
  background: #fff;
  border-radius: 99px;
  display: block;
}

.nav-pill,
.back-pill,
.gold-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.nav-pill {
  margin-left: auto;
  background: #252b35;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.back-pill {
  background: #252b35;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gold-pill {
  background: linear-gradient(135deg, #ffdd68, var(--gold));
  color: #17130a;
  box-shadow: 0 10px 20px rgba(255, 200, 61, 0.17);
}

/* Side menu */
.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(330px, 84vw);
  background: #1d2027;
  color: #d8dce4;
  z-index: 30;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: 28px 0 60px rgba(0, 0, 0, 0.34);
  overflow-y: auto;
  padding-bottom: 18px;
}

.side-menu.open {
  transform: translateX(0);
}

.side-head {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #f2f5f8;
}

.side-head button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #121419;
  color: #fff;
  font-size: 22px;
}

.side-menu a {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cfd4dd;
  text-decoration: none;
  font-size: 14px;
}

.side-menu a:hover {
  background: #282d37;
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(36px, 6vw, 64px) 18px 62px;
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(35, 196, 35, 0.36), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(40, 80, 190, 0.34), transparent 34%),
    linear-gradient(135deg, #09110d, #10131a 58%, #0b2110);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  text-align: center;
}

.hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 14px);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 12px;
}

.hero h1 {
  max-width: 760px;
  margin: 0 auto 14px;
  font-size: clamp(30px, 7vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.hero-text {
  max-width: 640px;
  margin: 0 auto 22px;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(14px, 3.2vw, 17px);
  line-height: 1.55;
}

.search-bar {
  position: relative;
  display: flex;
  max-width: 780px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 16px 18px;
  font-size: 16px;
  color: #161a20;
}

.search-bar button {
  width: 74px;
  border: 0;
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.quick-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px auto 0;
  max-width: 760px;
}

.quick-tags button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(26, 29, 35, 0.76);
  color: #fff;
  border-radius: 999px;
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.quick-tags button:first-child {
  background: linear-gradient(135deg, var(--green-2), var(--green));
  border-color: rgba(34, 179, 19, 0.65);
}

/* Library */
.library {
  max-width: 1060px;
  margin: -34px auto 56px;
  background: rgba(255,255,255,0.94);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.library-head {
  padding: 26px clamp(18px, 4vw, 34px) 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.green {
  color: var(--green-2);
}

.library h2 {
  margin: 0;
  color: #535963;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: clamp(32px, 5.6vw, 48px);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.055em;
}

.select-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 220px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: #7a818c;
  font-size: 14px;
  background: #fff;
}

.select-wrap select {
  flex: 1;
  border: 0;
  outline: 0;
  font-weight: 800;
  color: #2b3037;
  background: transparent;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 12px;
  padding: 16px clamp(18px, 4vw, 34px);
  overflow-x: auto;
  background: #f0f3f7;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid #d2d8e2;
  border-radius: 15px;
  background: #fff;
  font-weight: 800;
  color: #303640;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
}

.tabs button.active {
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: #fff;
  border-color: transparent;
}

.status {
  margin: 0;
  padding: 18px clamp(18px, 4vw, 34px);
  color: #737b87;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status span {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-2);
  box-shadow: 0 0 0 9px rgba(35, 170, 19, 0.13);
}

.cards {
  padding: 18px clamp(14px, 3vw, 26px) 38px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(278px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid #d7dde7;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
  border-color: rgba(34, 179, 19, 0.36);
}

.card-top {
  padding: 16px 16px 10px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  object-fit: cover;
  background: #e9edf3;
  border: 1px solid #d5dae2;
}

.byline {
  color: #737b87;
  line-height: 1.25;
  font-size: 13px;
}

.byline strong {
  display: block;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
}

.badges {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.rating,
.downloads {
  border-radius: 11px;
  font-weight: 800;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.rating {
  background: #fff9db;
  color: #b38300;
  border: 1px solid #f1d982;
}

.downloads {
  background: #e7f1ff;
  color: #2d72d9;
  border: 1px solid #c4daf9;
}

.thumb-wrap {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #dfe5ed;
}

.type-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(20, 22, 27, 0.82);
  color: #fff;
  padding: 7px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}

.card-body {
  padding: 14px 16px 16px;
}

.tags,
.tag-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tags {
  margin-bottom: 11px;
}

.tags span,
.tag-list span {
  background: #f2f4f7;
  border: 1px solid #d8dce3;
  color: #727985;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.card h3 {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 19px;
  line-height: 1.16;
}

.card p {
  margin: 0 0 14px;
  color: #555e69;
  line-height: 1.5;
  font-size: 14px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
}

.btn.green {
  background: linear-gradient(135deg, var(--green-2), var(--green));
  color: #fff;
}

.btn.dark {
  background: #1f242c;
  color: #fff;
}

.empty,
.error-box {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed #c6ccd6;
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  color: #69717c;
  font-size: 14px;
}

/* Detail page */
.detail-body {
  background:
    radial-gradient(circle at 5% -10%, rgba(34, 179, 19, 0.12), transparent 32%),
    #f0f3f7;
}

.detail-page {
  max-width: 1040px;
  margin: 0 auto 54px;
}

.detail-loading {
  margin: 36px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 22px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #d7dbe2;
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-wrap {
  padding-bottom: 44px;
}

.detail-cover {
  background: #15171c;
  box-shadow: inset 0 -90px 90px rgba(0,0,0,.25);
}

.detail-cover img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.detail-main-card,
.detail-content-card {
  margin: 18px clamp(12px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 4vw, 30px);
}

.detail-main-card {
  margin-top: -32px;
  position: relative;
  z-index: 2;
}

.detail-type {
  color: var(--green);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin: 0 0 10px;
  font-size: 12px;
}

.detail-main-card h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  color: #2a3038;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.author-row img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 14px;
  background: #e8ecf2;
  border: 1px solid var(--line);
}

.author-row p {
  margin: 0 0 2px;
  color: #6b7280;
  font-size: 13px;
}

.author-row strong {
  color: var(--green);
  font-size: 17px;
}

.author-row small {
  color: #7b828d;
  font-size: 12px;
}

.detail-stats {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.detail-stats span {
  border-radius: 12px;
  background: #f3f5f8;
  border: 1px solid #d8dde5;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 13px;
}

.detail-stats span:first-child {
  background: #e7f1ff;
  color: #2d72d9;
  border-color: #c4daf9;
}

.detail-stats span:nth-child(2) {
  background: #fff9db;
  color: #b38300;
  border-color: #f1d982;
}

.tag-list {
  margin-bottom: 20px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-actions .btn {
  min-width: 170px;
}

.detail-content-card h2 {
  margin: 0 0 16px;
  color: #303741;
  font-size: clamp(24px, 4.6vw, 36px);
  letter-spacing: -0.045em;
}

.description {
  color: #262b33;
  font-size: 16px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.description p,
.description li {
  margin: 0 0 16px;
}

.description ul,
.description ol {
  padding-left: 22px;
}

.description img {
  display: block;
  width: min(100%, 760px);
  height: auto;
  border-radius: 14px;
  margin: 20px auto;
  border: 1px solid #e0e5ed;
}

.description a {
  color: var(--green);
  font-weight: 800;
}

.gallery {
  display: grid;
  gap: 16px;
}

.gallery img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #d7dce4;
  background: #e5e9ef;
  box-shadow: var(--shadow-soft);
}

.changelog {
  background: #f7f8fa;
  border: 1px solid #e3e6eb;
  border-radius: 16px;
  padding: 16px;
  color: #333740;
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: 14px;
}

.download-list {
  display: grid;
  gap: 10px;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #d9dee6;
  border-radius: 15px;
  background: #f9fafb;
  text-decoration: none;
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
}

.download-item small {
  color: #7b828d;
  font-weight: 700;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.related-card {
  border: 1px solid #d9dee6;
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e5e9ef;
}

.related-card strong {
  display: block;
  padding: 12px;
  color: var(--green);
  font-size: 14px;
}

.comments {
  display: grid;
  gap: 14px;
}

.comment {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  border-bottom: 1px solid #e3e7ed;
  padding-bottom: 14px;
}

.comment img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #e6ebf2;
}

.comment strong {
  color: #2d333b;
  font-size: 14px;
}

.comment small {
  color: #8a929d;
  font-size: 12px;
}

.comment p {
  margin: 5px 0 0;
  color: #555d67;
  line-height: 1.5;
  font-size: 14px;
}

@media (max-width: 700px) {
  body {
    letter-spacing: -0.02em;
  }

  .topbar {
    min-height: 62px;
    gap: 9px;
    padding: 9px 12px;
  }

  .brand {
    width: 46px;
    height: 46px;
  }

  .icon-button {
    width: 48px;
    height: 46px;
  }

  .nav-pill,
  .gold-pill,
  .back-pill {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .hero {
    padding: 34px 16px 54px;
  }

  .hero h1 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .search-bar {
    border-radius: 16px;
  }

  .search-bar input {
    font-size: 15px;
    padding: 14px 16px;
  }

  .search-bar button {
    width: 60px;
    font-size: 21px;
  }

  .quick-tags {
    gap: 9px;
  }

  .quick-tags button {
    padding: 9px 14px;
    font-size: 12px;
  }

  .library {
    border-radius: 22px 22px 0 0;
    margin-top: -30px;
  }

  .library-head {
    display: block;
    padding: 22px 18px 16px;
  }

  .library h2 {
    font-size: 36px;
  }

  .select-wrap {
    margin-top: 16px;
    width: 100%;
    min-width: 0;
    height: 50px;
  }

  .tabs {
    padding: 14px 18px;
    gap: 10px;
  }

  .tabs button {
    min-height: 46px;
    padding: 0 18px;
    font-size: 13px;
  }

  .status {
    padding: 16px 18px;
    font-size: 14px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 14px 34px;
  }

  .card-top {
    grid-template-columns: 46px 1fr auto;
    padding: 15px 15px 10px;
  }

  .avatar {
    width: 46px;
    height: 46px;
  }

  .card-actions {
    grid-template-columns: 1fr 1fr;
  }

  .detail-cover img {
    max-height: 280px;
  }

  .detail-main-card,
  .detail-content-card {
    margin-left: 12px;
    margin-right: 12px;
    border-radius: 20px;
  }

  .detail-main-card h1 {
    font-size: 36px;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-actions .btn {
    min-width: 0;
  }

  .description {
    font-size: 15.5px;
  }

  .download-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .gold-pill {
    display: none;
  }

  .nav-pill {
    margin-left: auto;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}

/* === Pro UI v3 compact + SVG system === */
svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.compact-topbar,
.detail-topbar {
  min-height: 48px;
  padding: 6px clamp(10px, 2vw, 18px);
  gap: 8px;
}

.compact-topbar {
  justify-content: flex-start;
}

.detail-topbar {
  justify-content: flex-start;
}

.topbar-title {
  color: rgba(255,255,255,.76);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 800;
}

.menu-trigger,
.compact-topbar .icon-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  gap: 0;
  color: #fff;
}

.menu-trigger svg,
.icon-button svg {
  width: 22px;
  height: 22px;
}

.icon-button span {
  display: none;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 11px;
  background: #222731;
  border: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.back-button svg {
  width: 18px;
  height: 18px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  z-index: 24;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  width: min(300px, 78vw);
  z-index: 30;
}

.side-head {
  height: 50px;
  padding: 0 14px;
  font-size: 11px;
}

.side-head button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 0;
}

.side-head button svg {
  width: 18px;
  height: 18px;
}

.side-nav {
  padding: 6px 0 18px;
}

.side-menu a {
  display: none;
}

.side-group {
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.side-category {
  width: 100%;
  min-height: 45px;
  border: 0;
  background: transparent;
  color: #d9dde5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.side-category:hover {
  background: #262b34;
  color: #fff;
}

.side-category .chevron {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
  color: #8d96a5;
}

.side-group.open .chevron {
  transform: rotate(90deg);
  color: var(--green-2);
}

.side-keywords {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
  overflow: hidden;
  background: #171a20;
}

.side-keywords::before,
.side-keywords::after {
  content: none;
}

.side-group.open .side-keywords {
  grid-template-rows: 1fr;
}

.side-keywords {
  min-height: 0;
}

.side-keywords > button {
  width: calc(100% - 42px);
  margin-left: 42px;
  min-height: 36px;
  border: 0;
  border-left: 1px solid rgba(34,179,19,.25);
  background: transparent;
  color: #aeb6c3;
  text-align: left;
  padding: 0 0 0 13px;
  font-size: 12px;
  cursor: pointer;
}

.side-keywords > button:first-child {
  margin-top: 4px;
}

.side-keywords > button:last-child {
  margin-bottom: 10px;
}

.side-keywords > button:hover {
  color: #fff;
  background: rgba(34,179,19,.08);
}

.hero {
  padding: clamp(28px, 5vw, 48px) 18px 50px;
}

.hero h1 {
  max-width: 700px;
  font-size: clamp(27px, 5.8vw, 48px);
  line-height: 1.02;
}

.hero-text {
  max-width: 600px;
  font-size: clamp(13px, 2.8vw, 15px);
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 10.5px;
  margin-bottom: 8px;
}

.search-bar {
  max-width: 700px;
  border-radius: 15px;
}

.search-bar input {
  padding: 13px 16px;
  font-size: 14px;
}

.search-bar button {
  width: 58px;
  display: grid;
  place-items: center;
  font-size: 0;
}

.search-bar button svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.quick-tags {
  gap: 8px;
  margin-top: 15px;
}

.quick-tags button {
  padding: 8px 14px;
  font-size: 11.5px;
}

.library {
  max-width: 1020px;
  border-radius: 21px 21px 0 0;
}

.library-head {
  padding: 22px clamp(16px, 3.4vw, 28px) 17px;
}

.library h2 {
  font-size: clamp(30px, 4.8vw, 42px);
}

.custom-select {
  width: min(280px, 100%);
  position: relative;
  z-index: 5;
}

.select-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #2b3037;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  text-align: left;
}

.select-trigger .select-label {
  color: #8a929e;
  font-size: 12px;
  font-weight: 500;
}

.select-trigger strong {
  font-size: 13px;
  font-weight: 800;
  margin-right: auto;
}

.select-trigger svg {
  width: 17px;
  height: 17px;
  transition: transform .18s ease;
}

.custom-select.open .select-trigger svg {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  padding: 6px;
  border: 1px solid #d6dce5;
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 40px rgba(15,23,42,.18);
  transform: translateY(-4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  overflow: hidden;
}

.custom-select.open .select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.select-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #2f3540;
  text-align: left;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.select-menu button:hover,
.select-menu button[aria-selected="true"] {
  background: rgba(34,179,19,.11);
  color: var(--green);
}

.tabs {
  gap: 10px;
  padding: 13px clamp(16px, 3.4vw, 28px);
}

.tabs button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tabs button svg {
  width: 15px;
  height: 15px;
}

.status {
  padding: 15px clamp(16px, 3.4vw, 28px);
  font-size: 13px;
}

.status span {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 8px rgba(35, 170, 19, 0.13);
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.card {
  border-radius: 17px;
}

.card-top {
  grid-template-columns: 42px 1fr auto;
  padding: 13px 13px 9px;
  gap: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.byline {
  font-size: 12px;
}

.byline strong {
  font-size: 13.5px;
}

.byline small {
  font-size: 11.5px;
}

.rating,
.downloads {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: 11.5px;
}

.rating svg,
.downloads svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.rating svg {
  fill: currentColor;
  stroke: currentColor;
}

.type-badge {
  font-size: 11px;
  padding: 6px 9px;
}

.card-body {
  padding: 12px 14px 14px;
}

.tags span,
.tag-list span {
  font-size: 11px;
  padding: 4px 9px;
}

.card h3 {
  font-size: 17px;
}

.card p {
  font-size: 13px;
}

.btn {
  min-height: 38px;
  border-radius: 12px;
  font-size: 12px;
  gap: 7px;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.detail-cover img {
  max-height: 310px;
}

.detail-main-card,
.detail-content-card {
  border-radius: 19px;
  padding: clamp(18px, 3.4vw, 26px);
}

.detail-main-card h1 {
  font-size: clamp(29px, 5.2vw, 47px);
}

.author-row img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.author-row strong {
  font-size: 15px;
}

.detail-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 12px;
}

.detail-stats svg,
.download-item svg {
  width: 15px;
  height: 15px;
}

.detail-stats span:nth-child(2) svg {
  fill: currentColor;
  stroke: currentColor;
}

.detail-content-card h2 {
  font-size: clamp(22px, 4vw, 31px);
}

.description {
  font-size: 14.5px;
}

.rating-panel h2 {
  text-transform: uppercase;
  letter-spacing: -.02em;
}

.star-meter {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--green);
}

.star-meter svg {
  width: 22px;
  height: 22px;
}

.star-meter svg.filled {
  fill: currentColor;
  stroke: currentColor;
}

.star-meter svg.empty {
  color: var(--green);
  opacity: .65;
}

.rating-panel p {
  margin: 0;
  color: #59616c;
  font-size: 14px;
  font-weight: 700;
}

.download-item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 700px) {
  .topbar,
  .compact-topbar,
  .detail-topbar {
    min-height: 48px;
    padding: 6px 10px;
  }

  .menu-trigger,
  .compact-topbar .icon-button {
    width: 38px;
    height: 38px;
  }

  .hero {
    padding: 30px 14px 48px;
  }

  .hero h1 {
    font-size: clamp(26px, 7vw, 36px);
  }

  .hero-text {
    font-size: 13px;
  }

  .search-bar input {
    font-size: 13.5px;
    padding: 12px 14px;
  }

  .search-bar button {
    width: 54px;
  }

  .library-head {
    padding: 20px 16px 14px;
  }

  .custom-select {
    width: 100%;
    margin-top: 14px;
  }

  .library h2 {
    font-size: 33px;
  }

  .tabs {
    padding: 12px 16px;
  }

  .tabs button {
    min-height: 40px;
    padding: 0 15px;
    font-size: 12px;
  }

  .cards {
    gap: 15px;
  }

  .card-top {
    grid-template-columns: 40px 1fr auto;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .detail-cover img {
    max-height: 240px;
  }

  .detail-main-card h1 {
    font-size: 32px;
  }

  .description {
    font-size: 14px;
    line-height: 1.65;
  }

  .side-menu {
    width: min(288px, 77vw);
  }
}
.side-keywords {
  display: block;
  max-height: 0;
  transition: max-height .24s ease;
}

.side-group.open .side-keywords {
  max-height: 430px;
}

/* === Detail download + rating fix v4 === */
.description {
  max-width: 100%;
  overflow: hidden;
}

.description *,
.detail-content-card * {
  max-width: 100%;
}

.description iframe,
.description video,
.description embed,
.description object {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 190px;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border: 0;
  border-radius: 16px;
  background: #0d1117;
  margin: 18px auto;
}

.embed-wrap {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #0d1117;
  margin: 18px auto;
  border: 1px solid #d8dde6;
}

.embed-wrap iframe,
.embed-wrap video,
.embed-wrap embed,
.embed-wrap object {
  margin: 0;
  min-height: 0;
  height: 100% !important;
  border-radius: 0;
}

.star-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.star-meter .star-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.star-meter .star-icon.filled {
  color: var(--green);
  fill: currentColor;
  stroke: currentColor;
}

.star-meter .star-icon.empty {
  color: #cfd5df;
  fill: transparent;
  stroke: currentColor;
  opacity: 1;
}

.version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.version-list span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--green), #0e8708);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(34, 179, 19, .18);
}

.download-item {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.download-item:hover {
  border-color: rgba(34, 179, 19, .38);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}

.download-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.download-modal.open {
  display: flex;
}

.download-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, .72);
  backdrop-filter: blur(8px);
}

.download-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .36);
}

.modal-close {
  position: sticky;
  top: 12px;
  left: auto;
  float: right;
  margin: 12px 12px -44px 0;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(17, 24, 39, .88);
  color: #fff;
  cursor: pointer;
}

.modal-close svg {
  width: 19px;
  height: 19px;
}

.download-modal-image {
  width: 100%;
  aspect-ratio: 16 / 8.8;
  object-fit: cover;
  display: block;
  background: #111827;
}

.download-modal-body {
  padding: 22px;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .18em;
}

.download-modal-body h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 6vw, 33px);
  letter-spacing: -.05em;
  color: #1f2630;
}

.download-modal-body p {
  margin: 0 0 18px;
  color: #6d7480;
  line-height: 1.55;
  font-size: 14px;
}

.modal-main-btn {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
}

.countdown-box {
  border: 1px solid #d8dde6;
  border-radius: 16px;
  padding: 16px;
  background: #f6f8fb;
}

.countdown-box strong {
  display: block;
  margin-bottom: 12px;
  text-align: center;
  color: #232a34;
  font-size: 17px;
}

.countdown-track {
  height: 9px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.countdown-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #33d923);
  transition: width .22s linear;
}

.ready-box {
  display: grid;
  gap: 12px;
}

.ready-box h3 {
  margin: 0;
  text-align: center;
  font-size: 24px;
  letter-spacing: -.04em;
}

.ready-links {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.ready-link {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #d8dde6;
  background: #f8fafc;
  text-decoration: none;
  color: var(--green);
  font-weight: 800;
}

.ready-link span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ready-link svg {
  width: 16px;
  height: 16px;
}

.ready-link small {
  color: #717985;
  font-weight: 700;
}

@media (max-width: 700px) {
  .embed-wrap,
  .description iframe,
  .description video,
  .description embed,
  .description object {
    min-height: 180px;
    border-radius: 12px;
  }

  .download-modal {
    padding: 12px;
  }

  .download-dialog {
    border-radius: 19px;
    max-height: calc(100vh - 24px);
  }

  .download-modal-body {
    padding: 18px;
  }

  .download-modal-image {
    aspect-ratio: 16 / 9.5;
  }
}

/* === V5 fix: rating star shape + stricter download modal states === */
.is-hidden {
  display: none !important;
}

.star-meter {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.star-meter .star-icon,
.star-meter .star-icon.star-filled,
.star-meter .star-icon.star-empty {
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  grid-column: auto !important;
  text-align: initial !important;
  opacity: 1 !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
}

.star-meter .star-icon.star-filled {
  color: var(--green) !important;
}

.star-meter .star-icon.star-empty {
  color: #cfd5df !important;
}

.star-meter .star-icon path {
  fill: currentColor !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
}

.download-modal-body .modal-kicker {
  max-width: calc(100% - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-modal-body #startDownloadUnlock[hidden],
.download-modal-body #countdownBox[hidden],
.download-modal-body #readyBox[hidden] {
  display: none !important;
}


/* === V6 polish: footer, lightbox, animations, cleaner modal === */
.brand-capsule {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255,255,255,.82);
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.055));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 24px rgba(0,0,0,.22);
  backdrop-filter: blur(18px) saturate(150%);
}

.brand-capsule img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}

.brand-capsule span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  opacity: .78;
}

.typing-title,
.typewriter-line {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
  animation: typingReveal 1.1s steps(16, end) both;
}

.typewriter-line {
  animation-duration: 1.35s;
  animation-delay: .08s;
}

.hero-reveal,
.hero .search-bar,
.quick-tags {
  animation: riseFade .55s ease both;
}

.hero-reveal.delay-1 { animation-delay: .12s; }
.hero .search-bar { animation-delay: .2s; }
.quick-tags { animation-delay: .3s; }

@keyframes typingReveal {
  from { clip-path: inset(0 100% 0 0); opacity: .75; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

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

.quick-tags {
  max-width: 790px;
  margin-left: auto;
  margin-right: auto;
}

.status {
  justify-content: center !important;
  text-align: center !important;
  width: 100%;
}

.status span {
  animation: pulseDot 1.3s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(35,170,19,.12); }
  50% { transform: scale(.78); box-shadow: 0 0 0 14px rgba(35,170,19,.04); }
}

.card.revealable {
  opacity: 0;
  transform: translateY(26px);
}

.card.revealable.is-visible {
  animation: cardRise .55s cubic-bezier(.2,.75,.2,1) var(--reveal-delay, 0ms) forwards;
}

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

.card-actions.single-action {
  grid-template-columns: 1fr;
}

.download-card-btn {
  min-height: 42px;
  font-size: 13px;
  letter-spacing: .01em;
  box-shadow: 0 10px 22px rgba(22,122,8,.18);
}

.site-footer {
  position: relative;
  margin-top: 0;
  padding: 54px 18px 34px;
  background: #20242c;
  color: #c8cdd5;
  text-align: center;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(34,179,19,.16), transparent 38%);
  pointer-events: none;
}

.footer-top {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 0 0 10px 10px;
  background: #f5f7fa;
  color: #4b525e;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.footer-top svg,
.footer-socials svg,
.glass-icon svg {
  width: 22px;
  height: 22px;
}

.footer-logo-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo-row img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 15px;
  background: rgba(255,255,255,.08);
}

.footer-logo-row span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 18px;
  color: #f1f4f8;
}

.footer-copy,
.footer-note {
  position: relative;
  max-width: 650px;
  margin: 0 auto 9px;
  line-height: 1.65;
  font-size: 13px;
}

.footer-note { color: #aeb5c0; }

.footer-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 34px;
  margin: 24px 0 20px;
}

.footer-links a,
.footer-socials a {
  color: #e4e8ee;
  text-decoration: none;
}

.footer-links a:hover,
.footer-socials a:hover { color: #fff; }

.footer-socials {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.09);
}

.legal-page {
  width: min(920px, 100%);
  margin: 34px auto 46px;
  padding: 0 18px;
}

.legal-card h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 7vw, 58px);
  letter-spacing: -.06em;
}

.legal-card p:not(.eyebrow) {
  color: #56606c;
  font-size: 15px;
  line-height: 1.75;
}

.download-modal-backdrop {
  background: rgba(4, 7, 12, .78) !important;
  backdrop-filter: none !important;
}

.download-modal.open .download-dialog {
  animation: modalRiseUp .32s cubic-bezier(.22,.8,.24,1) both;
}

@keyframes modalRiseUp {
  from { opacity: 0; transform: translateY(34px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ready-box h3 { display: none !important; }

.zoomable-image {
  cursor: zoom-in;
}

.detail-cover img.zoomable-image,
.gallery img.zoomable-image,
.description img.zoomable-image {
  transition: transform .2s ease, box-shadow .2s ease;
}

.detail-cover img.zoomable-image:hover,
.gallery img.zoomable-image:hover,
.description img.zoomable-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15,23,42,.14);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-lightbox.open { display: flex; }

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, .88);
}

.image-lightbox img {
  position: relative;
  max-width: min(1120px, 100%);
  max-height: min(78vh, 760px);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
  animation: lightboxImageIn .25s ease both;
}

@keyframes lightboxImageIn {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

.glass-icon {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.34);
  background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.08));
  color: #fff;
  backdrop-filter: blur(18px) saturate(165%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 18px 38px rgba(0,0,0,.28);
  cursor: pointer;
}

.image-lightbox-close { top: 18px; right: 18px; }
.image-lightbox-prev { left: max(18px, 4vw); top: 50%; transform: translateY(-50%); }
.image-lightbox-next { right: max(18px, 4vw); top: 50%; transform: translateY(-50%); }

.image-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(16px);
}

.gallery img {
  cursor: zoom-in;
}

@media (max-width: 700px) {
  .brand-capsule {
    height: 32px;
    padding: 4px 7px;
    gap: 6px;
  }

  .brand-capsule img {
    width: 22px;
    height: 22px;
  }

  .footer-links {
    gap: 14px 24px;
  }

  .footer-logo-row img {
    width: 48px;
    height: 48px;
  }

  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox img {
    max-height: 72vh;
    border-radius: 14px;
  }

  .glass-icon {
    width: 42px;
    height: 42px;
  }

  .image-lightbox-prev { left: 10px; }
  .image-lightbox-next { right: 10px; }
}


/* V7 polish: footer naik full, feed awal tanpa X-Ray paksa, dan quick-tag aktif sesuai pilihan */
.site-footer {
  padding-top: 72px !important;
  margin-top: 30px !important;
  overflow: visible !important;
}

.footer-top {
  top: -24px !important;
  transform: translateX(-50%) !important;
  width: 58px !important;
  height: 48px !important;
  border-radius: 16px !important;
  background: rgba(245,247,250,.96) !important;
  border: 1px solid rgba(255,255,255,.72) !important;
}

.quick-tags button:first-child {
  background: rgba(26, 29, 35, 0.76) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.quick-tags button.active {
  background: linear-gradient(135deg, var(--green-2), var(--green)) !important;
  border-color: rgba(34, 179, 19, 0.65) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 22px rgba(22, 122, 8, .18) !important;
}

.status {
  justify-content: center !important;
  text-align: center !important;
}

@media (max-width: 700px) {
  .site-footer {
    padding-top: 68px !important;
    margin-top: 28px !important;
  }

  .footer-top {
    top: -23px !important;
    width: 56px !important;
    height: 46px !important;
  }
}

/* === V8: category feed fix UI, theme toggle, share, favicon-ready polish === */
.theme-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  color: #f8fafc;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 10px 24px rgba(0,0,0,.2);
  backdrop-filter: blur(14px) saturate(150%);
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.85,.2,1);
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.35;
}

html[data-theme="light"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(.55) rotate(-70deg);
  pointer-events: none;
}

html[data-theme="light"] .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle.is-switching .theme-icon-moon,
.theme-toggle.is-switching .theme-icon-sun {
  animation: themeIconPop .38s cubic-bezier(.2,.86,.22,1) both;
}

@keyframes themeIconPop {
  0% { transform: scale(.45) rotate(-110deg); opacity: 0; }
  58% { transform: scale(1.16) rotate(12deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.detail-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
}

.detail-actions .btn.green {
  grid-column: 1 / -1;
}

.detail-actions .btn.dark {
  grid-column: 1;
  min-width: 0 !important;
}

.share-button {
  grid-column: 2;
  width: 46px;
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  background: #1f242c;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.share-button svg {
  width: 17px;
  height: 17px;
}

.share-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .16);
}

@media (max-width: 380px) {
  .topbar-title { font-size: 9.5px; }
  .brand-capsule { height: 30px; }
  .brand-capsule img { width: 20px; height: 20px; }
  .theme-toggle { width: 32px; height: 32px; flex-basis: 32px; }
}

/* Dark mode. Singkat saja, tidak perlu menjadikan CSS sebagai novel trilogi. */
html[data-theme="dark"] body {
  --bg: #0f1319;
  --paper: #171c24;
  --paper-2: #11161d;
  --ink: #edf2f7;
  --muted: #a5adba;
  --line: rgba(255,255,255,.105);
  background:
    radial-gradient(circle at 12% -8%, rgba(34, 179, 19, 0.12), transparent 28%),
    linear-gradient(180deg, #0b0f15 0%, #111720 46%, #0d1218 100%);
  color: var(--ink);
}

html[data-theme="dark"] .library,
html[data-theme="dark"] .card,
html[data-theme="dark"] .detail-main-card,
html[data-theme="dark"] .detail-content-card,
html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .detail-loading,
html[data-theme="dark"] .download-dialog {
  background: rgba(23, 28, 36, .96);
  border-color: rgba(255,255,255,.11);
  color: #edf2f7;
}

html[data-theme="dark"] .library h2,
html[data-theme="dark"] .detail-main-card h1,
html[data-theme="dark"] .detail-content-card h2,
html[data-theme="dark"] .legal-card h1,
html[data-theme="dark"] .download-modal-body h2,
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .comment strong {
  color: #f5f8fb;
}

html[data-theme="dark"] .library-head,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .error-box,
html[data-theme="dark"] .select-trigger,
html[data-theme="dark"] .select-menu,
html[data-theme="dark"] .download-item,
html[data-theme="dark"] .ready-link,
html[data-theme="dark"] .countdown-box,
html[data-theme="dark"] .changelog,
html[data-theme="dark"] .related-card {
  background: #131922;
  border-color: rgba(255,255,255,.12);
  color: #d8dee8;
}

html[data-theme="dark"] .tabs button,
html[data-theme="dark"] .tags span,
html[data-theme="dark"] .tag-list span,
html[data-theme="dark"] .detail-stats span,
html[data-theme="dark"] .version-list span {
  border-color: rgba(255,255,255,.12);
}

html[data-theme="dark"] .tabs button:not(.active) {
  background: #1a212b;
  color: #dce3ec;
}

html[data-theme="dark"] .select-menu button {
  color: #dce3ec;
}

html[data-theme="dark"] .card p,
html[data-theme="dark"] .description,
html[data-theme="dark"] .description p,
html[data-theme="dark"] .comment p,
html[data-theme="dark"] .legal-card p:not(.eyebrow),
html[data-theme="dark"] .download-modal-body p,
html[data-theme="dark"] .status {
  color: #b6bfcb;
}

html[data-theme="dark"] .byline,
html[data-theme="dark"] .author-row p,
html[data-theme="dark"] .author-row small,
html[data-theme="dark"] .download-item small,
html[data-theme="dark"] .ready-link small {
  color: #9fa8b6;
}

html[data-theme="dark"] .share-button,
html[data-theme="dark"] .btn.dark {
  background: #080b10;
  color: #fff;
}

html[data-theme="dark"] .search-bar {
  background: #0f141b;
  border-color: rgba(255,255,255,.18);
}

html[data-theme="dark"] .search-bar input {
  background: #0f141b;
  color: #f8fafc;
}

html[data-theme="dark"] .search-bar input::placeholder {
  color: #818b99;
}

.theme-toggle.is-switching .theme-icon { animation: none; }
html[data-theme="light"] .theme-toggle.is-switching .theme-icon-moon,
html[data-theme="dark"] .theme-toggle.is-switching .theme-icon-sun {
  animation: themeIconPop .38s cubic-bezier(.2,.86,.22,1) both;
}

/* === V9 dark-mode cleanup: chips, download links, countdown, footer-up button === */
html[data-theme="dark"] .countdown-box strong,
html[data-theme="dark"] #countdownLabel {
  color: #f8fafc !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="dark"] .countdown-track {
  background: rgba(226, 232, 240, .86) !important;
}

html[data-theme="dark"] .download-item,
html[data-theme="dark"] .ready-link {
  background: #101720 !important;
  border-color: rgba(255, 255, 255, .13) !important;
  color: #e5ebf3 !important;
}

html[data-theme="dark"] .download-item:hover,
html[data-theme="dark"] .ready-link:hover {
  background: #141d28 !important;
  border-color: rgba(34, 179, 19, .45) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .download-item span,
html[data-theme="dark"] .ready-link span,
html[data-theme="dark"] .download-item svg,
html[data-theme="dark"] .ready-link svg {
  color: var(--green-2) !important;
  stroke: currentColor !important;
}

html[data-theme="dark"] .download-item small,
html[data-theme="dark"] .ready-link small {
  color: #aab4c3 !important;
}

html[data-theme="dark"] .tags span,
html[data-theme="dark"] .tag-list span,
html[data-theme="dark"] .version-list span {
  background: rgba(255, 255, 255, .075) !important;
  color: #dce4ee !important;
  border-color: rgba(255, 255, 255, .14) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .detail-stats span {
  background: rgba(255, 255, 255, .075) !important;
  color: #e8eef7 !important;
  border-color: rgba(255, 255, 255, .14) !important;
}

html[data-theme="dark"] .detail-stats span:first-child {
  background: rgba(47, 128, 237, .16) !important;
  color: #8fc2ff !important;
  border-color: rgba(47, 128, 237, .28) !important;
}

html[data-theme="dark"] .detail-stats span:nth-child(2) {
  background: rgba(255, 200, 61, .14) !important;
  color: #ffd86b !important;
  border-color: rgba(255, 200, 61, .26) !important;
}

html[data-theme="dark"] .detail-stats span:nth-child(3),
html[data-theme="dark"] .detail-stats span:nth-child(3) svg {
  color: #e8eef7 !important;
}

html[data-theme="dark"] .footer-top {
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.055)) !important;
  color: #f8fafc !important;
  border-color: rgba(255,255,255,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 34px rgba(0,0,0,.32) !important;
  backdrop-filter: blur(16px) saturate(155%) !important;
}

html[data-theme="dark"] .footer-top svg {
  stroke: currentColor !important;
}

html[data-theme="dark"] .rating-panel p,
html[data-theme="dark"] .response-card p,
html[data-theme="dark"] .comment-date {
  color: #aab4c3 !important;
}

html[data-theme="dark"] .star-meter .star-icon.star-empty,
html[data-theme="dark"] .star-meter svg.empty {
  color: #4c5664 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .star-meter .star-icon.star-filled,
html[data-theme="dark"] .star-meter svg.filled {
  color: var(--green-2) !important;
}

html[data-theme="dark"] .avatar,
html[data-theme="dark"] .author-row img {
  background: #111821 !important;
  border-color: rgba(255,255,255,.13) !important;
}

html[data-theme="dark"] .related-card {
  background: #111821 !important;
  color: #edf2f7 !important;
}

html[data-theme="dark"] .related-card strong,
html[data-theme="dark"] .related-card h3 {
  color: var(--green-2) !important;
}

/* === V10 theme balance: light mode benar-benar terang + dark action buttons tidak tenggelam === */
html[data-theme="light"] body {
  --bg: #edf2f7;
  --paper: #ffffff;
  --paper-2: #f6f8fb;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d7dee8;
  background:
    radial-gradient(circle at 12% -8%, rgba(34, 179, 19, 0.13), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(47, 128, 237, 0.10), transparent 28%),
    linear-gradient(180deg, #f7fafc 0%, #edf2f7 48%, #e8eef5 100%) !important;
  color: var(--ink) !important;
}

/* Header mode terang, karena manusia rupanya tidak suka header pura-pura malam terus. */
html[data-theme="light"] .topbar,
html[data-theme="light"] .compact-topbar,
html[data-theme="light"] .detail-topbar {
  background: rgba(248, 250, 252, 0.90) !important;
  color: #172033 !important;
  border-bottom-color: rgba(15, 23, 42, 0.10) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
}

html[data-theme="light"] .topbar-title {
  color: #29313d !important;
  text-shadow: none !important;
}

html[data-theme="light"] .menu-trigger,
html[data-theme="light"] .compact-topbar .icon-button,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .back-button,
html[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(234,239,247,.82)) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #172033 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 10px 22px rgba(15,23,42,.10) !important;
}

html[data-theme="light"] .icon-button span,
html[data-theme="light"] .menu-trigger span {
  background: #172033 !important;
}

html[data-theme="light"] .back-button svg,
html[data-theme="light"] .menu-trigger svg,
html[data-theme="light"] .icon-button svg,
html[data-theme="light"] .theme-toggle svg {
  stroke: currentColor !important;
}

html[data-theme="light"] .brand-capsule {
  color: #202a37 !important;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(236,242,250,.66)) !important;
  border-color: rgba(15, 23, 42, .12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 10px 24px rgba(15,23,42,.12) !important;
}

html[data-theme="light"] .brand-capsule img {
  background: rgba(15,23,42,.05) !important;
  border: 1px solid rgba(15,23,42,.08) !important;
}

/* Sidebar mode terang */
html[data-theme="light"] .side-menu {
  background: #f8fafc !important;
  color: #202a37 !important;
  border-right: 1px solid rgba(15, 23, 42, .10) !important;
  box-shadow: 28px 0 60px rgba(15, 23, 42, .16) !important;
}

html[data-theme="light"] .side-head {
  color: #172033 !important;
  border-bottom-color: rgba(15, 23, 42, .10) !important;
  background: rgba(255,255,255,.64) !important;
}

html[data-theme="light"] .side-head button {
  background: #e9eef6 !important;
  color: #172033 !important;
  border: 1px solid rgba(15,23,42,.10) !important;
}

html[data-theme="light"] .side-menu a,
html[data-theme="light"] .side-toggle {
  color: #303947 !important;
  border-bottom-color: rgba(15, 23, 42, .09) !important;
}

html[data-theme="light"] .side-menu a:hover,
html[data-theme="light"] .side-toggle:hover {
  background: #edf2f7 !important;
  color: var(--green) !important;
}

html[data-theme="light"] .menu-overlay.open {
  background: rgba(15, 23, 42, .30) !important;
}

/* Hero light mode: tetap glow hijau/biru, tapi bukan gua tambang batu bara. */
html[data-theme="light"] .hero {
  color: #172033 !important;
  background:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(34, 179, 19, 0.22), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(47, 128, 237, 0.18), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f3f8ff 54%, #eefaf1 100%) !important;
  background-size: 28px 28px, 28px 28px, auto, auto, auto !important;
  text-shadow: none !important;
}

html[data-theme="light"] .hero-noise {
  opacity: .09 !important;
  background-image: repeating-linear-gradient(45deg, rgba(15,23,42,.25) 0 1px, transparent 1px 14px) !important;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .typewriter-line {
  color: var(--green-2) !important;
}

html[data-theme="light"] .hero h1,
html[data-theme="light"] .hero .typing-title {
  color: #172033 !important;
}

html[data-theme="light"] .hero-text,
html[data-theme="light"] .hero .hero-reveal {
  color: #475569 !important;
}

html[data-theme="light"] .search-bar {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, .13) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .13) !important;
}

html[data-theme="light"] .search-bar input {
  background: #ffffff !important;
  color: #172033 !important;
}

html[data-theme="light"] .search-bar input::placeholder {
  color: #7b8492 !important;
}

html[data-theme="light"] .quick-tags button,
html[data-theme="light"] .quick-tags button:first-child {
  background: rgba(255, 255, 255, .72) !important;
  color: #263241 !important;
  border-color: rgba(15, 23, 42, .14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 10px 24px rgba(15,23,42,.09) !important;
  backdrop-filter: blur(10px) saturate(130%) !important;
}

html[data-theme="light"] .quick-tags button.active,
html[data-theme="light"] .quick-tags button:hover {
  background: linear-gradient(135deg, var(--green-2), var(--green)) !important;
  color: #fff !important;
  border-color: rgba(34, 179, 19, .50) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 28px rgba(22,122,8,.20) !important;
}

/* Tombol sekunder/detail menyesuaikan tema */
html[data-theme="light"] .detail-actions .btn.dark,
html[data-theme="light"] .share-button,
html[data-theme="light"] .btn.dark {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(235,240,248,.88)) !important;
  color: #172033 !important;
  border: 1px solid rgba(15, 23, 42, .13) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 12px 24px rgba(15,23,42,.10) !important;
}

html[data-theme="light"] .detail-actions .btn.dark svg,
html[data-theme="light"] .share-button svg,
html[data-theme="light"] .btn.dark svg {
  stroke: currentColor !important;
}

html[data-theme="dark"] .detail-actions .btn.dark,
html[data-theme="dark"] .share-button,
html[data-theme="dark"] .btn.dark {
  background: linear-gradient(135deg, #263140, #17202b) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 14px 30px rgba(0,0,0,.28) !important;
}

html[data-theme="dark"] .detail-actions .btn.dark svg,
html[data-theme="dark"] .share-button svg,
html[data-theme="dark"] .btn.dark svg {
  stroke: currentColor !important;
}

/* Footer light mode */
html[data-theme="light"] .site-footer {
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 179, 19, .11), transparent 36%),
    linear-gradient(180deg, #f9fbfd, #e8eef5) !important;
  color: #465160 !important;
  border-top: 1px solid rgba(15, 23, 42, .10) !important;
}

html[data-theme="light"] .site-footer::before {
  background: radial-gradient(circle at 50% 0%, rgba(34,179,19,.13), transparent 38%) !important;
}

html[data-theme="light"] .footer-logo-row span {
  color: #2b3442 !important;
}

html[data-theme="light"] .footer-copy,
html[data-theme="light"] .footer-note {
  color: #556170 !important;
}

html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-socials a {
  color: #29313d !important;
}

html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-socials a:hover {
  color: var(--green) !important;
}

html[data-theme="light"] .footer-socials a {
  background: rgba(255,255,255,.72) !important;
  border-color: rgba(15,23,42,.11) !important;
  box-shadow: 0 10px 22px rgba(15,23,42,.10) !important;
}

html[data-theme="light"] .footer-top {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(234,240,248,.90)) !important;
  color: #384252 !important;
  border-color: rgba(15,23,42,.12) !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.14) !important;
}

html[data-theme="light"] .footer-top svg,
html[data-theme="light"] .footer-socials svg {
  stroke: currentColor !important;
}

/* Legal/static pages ikut terang juga, jangan tiba-tiba jadi ruang server. */
html[data-theme="light"] .legal-card,
html[data-theme="light"] .detail-loading,
html[data-theme="light"] .download-dialog {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(15,23,42,.10) !important;
  color: #1f2937 !important;
}

html[data-theme="light"] .legal-card h1,
html[data-theme="light"] .download-modal-body h2 {
  color: #172033 !important;
}

html[data-theme="light"] .legal-card p:not(.eyebrow),
html[data-theme="light"] .download-modal-body p {
  color: #556170 !important;
}

/* =========================================================
   V11 SIDEBAR LIGHT + PERF PATCH
   - Fix sidebar mode terang yang masih ketempelan mode gelap
   - Ringankan efek mahal di HP: blur/glow/animasi berlebihan
   - Sengaja ditaruh PALING BAWAH supaya menang dari CSS sebelumnya
   ========================================================= */

/* ---------- Sidebar / drawer: light mode clean ---------- */
html[data-theme="light"] .side-menu,
html[data-theme="light"] aside.side-menu {
  background: rgba(248, 250, 252, 0.98) !important;
  color: #172033 !important;
  border-right: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: 22px 0 46px rgba(15, 23, 42, 0.16) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] .side-head {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #111827 !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.10) !important;
}

html[data-theme="light"] .side-head,
html[data-theme="light"] .side-head *:not(svg):not(path) {
  color: #111827 !important;
}

html[data-theme="light"] .side-head button {
  background: #eef3fa !important;
  color: #111827 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(15,23,42,.10) !important;
}

html[data-theme="light"] .side-nav,
html[data-theme="light"] .side-group {
  background: transparent !important;
}

html[data-theme="light"] .side-group {
  border-bottom: 1px solid rgba(15, 23, 42, 0.09) !important;
}

html[data-theme="light"] .side-category {
  background: transparent !important;
  color: #1f2937 !important;
}

html[data-theme="light"] .side-category span,
html[data-theme="light"] .side-category b,
html[data-theme="light"] .side-category strong {
  color: #1f2937 !important;
}

html[data-theme="light"] .side-category svg,
html[data-theme="light"] .side-category .chevron {
  color: #536070 !important;
  stroke: currentColor !important;
}

html[data-theme="light"] .side-category:hover,
html[data-theme="light"] .side-group.open > .side-category {
  background: rgba(34, 179, 19, 0.08) !important;
  color: #0f3b10 !important;
}

html[data-theme="light"] .side-group.open > .side-category span,
html[data-theme="light"] .side-group.open > .side-category b,
html[data-theme="light"] .side-group.open > .side-category strong,
html[data-theme="light"] .side-group.open > .side-category .chevron,
html[data-theme="light"] .side-group.open > .side-category svg {
  color: #167a08 !important;
  stroke: currentColor !important;
}

html[data-theme="light"] .side-keywords {
  background: linear-gradient(180deg, #f9fbfd, #eef3f9) !important;
  color: #1f2937 !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: inset 0 10px 24px rgba(15,23,42,.035) !important;
}

html[data-theme="light"] .side-keywords > button {
  color: #273241 !important;
  background: transparent !important;
  border-left-color: rgba(34, 179, 19, 0.34) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] .side-keywords > button:hover,
html[data-theme="light"] .side-keywords > button:focus-visible {
  color: #0f3b10 !important;
  background: rgba(34, 179, 19, 0.10) !important;
  outline: none !important;
}

html[data-theme="light"] .menu-overlay.open {
  background: rgba(15, 23, 42, 0.28) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Paksa teks menu yang masih abu-abu pucat supaya kebaca. Ya, CSS kadang keras kepala. */
html[data-theme="light"] .side-menu button,
html[data-theme="light"] .side-menu a,
html[data-theme="light"] .side-menu li,
html[data-theme="light"] .side-menu p,
html[data-theme="light"] .side-menu span:not(.brand-capsule span) {
  opacity: 1 !important;
}

/* ---------- Dark mode safety: jangan ikut rusak ---------- */
html[data-theme="dark"] .side-keywords > button {
  color: #cbd3df !important;
}

html[data-theme="dark"] .side-keywords > button:hover {
  color: #ffffff !important;
}

/* ---------- Mobile performance patch ---------- */
@media (max-width: 760px) {
  html,
  body {
    text-rendering: optimizeLegibility;
  }

  /* Blur mahal di HP dibuat lebih waras. Kaca-kacaan boleh, tapi jangan jadi oven GPU. */
  .topbar,
  .compact-topbar,
  .detail-topbar,
  .brand-capsule,
  .theme-toggle,
  .menu-trigger,
  .icon-button,
  .back-button,
  .quick-tags button,
  .footer-top,
  .download-dialog,
  .lightbox-nav,
  .custom-select,
  .select-menu {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .result-card,
  .detail-card,
  .section-card,
  .related-card,
  .download-dialog,
  .site-footer,
  .quick-tags button,
  .filter-tabs button,
  .custom-select,
  .select-menu,
  .side-menu {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
  }

  html[data-theme="dark"] .result-card,
  html[data-theme="dark"] .detail-card,
  html[data-theme="dark"] .section-card,
  html[data-theme="dark"] .related-card,
  html[data-theme="dark"] .download-dialog,
  html[data-theme="dark"] .side-menu {
    box-shadow: 0 12px 28px rgba(0,0,0,.24) !important;
  }

  .result-card,
  .related-card,
  .detail-card,
  .section-card {
    content-visibility: auto;
    contain-intrinsic-size: 420px;
  }

  .result-card::before,
  .result-card::after,
  .detail-card::before,
  .detail-card::after,
  .section-card::before,
  .section-card::after,
  .site-footer::before {
    opacity: .55 !important;
  }

  .reveal-card,
  .hero-reveal,
  .result-card,
  .related-card {
    animation-duration: .32s !important;
    transition-duration: .18s !important;
  }

  .quick-tags button:hover,
  .result-card:hover,
  .related-card:hover,
  .download-item:hover,
  .ready-link:hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Lazy media visual stability ---------- */
.result-card img,
.related-card img,
.gallery-grid img,
.detail-hero img,
.download-modal-image {
  object-fit: cover;
  background: rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .result-card img,
html[data-theme="dark"] .related-card img,
html[data-theme="dark"] .gallery-grid img,
html[data-theme="dark"] .detail-hero img,
html[data-theme="dark"] .download-modal-image {
  background: rgba(255, 255, 255, 0.05);
}


/* === Confirmed feature update: preview button, badges, skeletons === */
.card .badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 58%;
}

.status-badge,
.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.status-badge {
  color: #15803d;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.06));
}

.version-badge {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(124, 58, 237, 0.07));
  border-color: rgba(124, 58, 237, 0.2);
}

.status-badge svg,
.version-badge svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-bar {
  position: relative;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.28), rgba(148, 163, 184, 0.14));
  background-size: 220% 100%;
  animation: skeletonShimmer 1.15s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.avatar-skeleton {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  flex: 0 0 auto;
}

.skeleton-lines {
  display: grid;
  gap: 8px;
  flex: 1;
}

.skeleton.line {
  width: 100%;
  height: 14px;
  border-radius: 999px;
}

.skeleton.line.short { width: 45%; }
.skeleton.line.medium { width: 70%; }
.skeleton.line.tiny { width: 28%; }
.skeleton.line.title-line { width: 72%; height: 24px; }
.skeleton.line.title-wide { width: 86%; height: 42px; border-radius: 18px; }

.thumb-skeleton {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-badges,
.skeleton-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-skeleton {
  width: 92px;
  height: 34px;
  border-radius: 14px;
}

.tag-skeleton {
  width: 84px;
  height: 28px;
  border-radius: 999px;
}

.button-skeleton {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  margin-top: 16px;
}

.detail-skeleton-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 0 20px 40px;
}

.detail-skeleton-cover {
  width: 100%;
  min-height: 270px;
  border-radius: 0 0 30px 30px;
}

.skeleton-detail-card,
.skeleton-detail-content {
  margin-top: -48px;
}

.skeleton-detail-content {
  margin-top: 26px;
}

.preview-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.related-card span {
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #13820c;
  font-size: 0.74rem;
  font-weight: 900;
}

html[data-theme="dark"] .status-badge {
  color: #74f18b;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(116, 241, 139, 0.22);
}

html[data-theme="dark"] .version-badge {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.11);
  border-color: rgba(216, 180, 254, 0.2);
}

html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.08));
  background-size: 220% 100%;
}

html[data-theme="dark"] .related-card span {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

@media (max-width: 760px) {
  .card .badges {
    max-width: 100%;
    justify-content: flex-start;
  }

  .status-badge,
  .version-badge {
    min-height: 30px;
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .skeleton.line.title-wide {
    height: 34px;
  }
}

/* === v14 cleanup: changelog clamp, badge alignment, skeleton sane mode === */
.card-top {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: start;
}

.card .badges {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-items: end !important;
  align-content: start;
  max-width: none !important;
  min-width: max-content;
}

.badge-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

.rating,
.downloads,
.status-badge,
.version-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  box-sizing: border-box;
}

.rating svg,
.downloads svg,
.status-badge svg,
.version-badge svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.status-badge {
  min-width: 104px;
}

.version-badge {
  min-width: 86px;
}

.rating {
  min-width: 72px;
}

.downloads {
  min-width: 104px;
}

.card .byline {
  min-width: 0;
}

.card .byline strong,
.card .byline small {
  overflow-wrap: anywhere;
}

/* Skeleton card yang tidak lagi bertumpuk seperti rak kasut manusia. */
.card.skeleton-card {
  display: block;
  overflow: hidden;
  min-height: 0;
  pointer-events: none;
}

.skeleton-card .skeleton-card-top {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.skeleton-card .avatar-skeleton {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.skeleton-card .skeleton-lines {
  min-width: 0;
  width: 100%;
}

.skeleton-card .skeleton-badges {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-items: end !important;
  width: auto;
  max-width: none !important;
  min-width: max-content;
}

.skeleton-card .badge-row {
  width: auto;
}

.badge-skeleton {
  height: 34px;
  border-radius: 14px;
}

.badge-skeleton.small { width: 72px; }
.badge-skeleton.medium { width: 104px; }
.badge-skeleton.wide { width: 104px; }

.skeleton-card .thumb-skeleton {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 0;
}

.skeleton-card .skeleton-card-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.skeleton-card .button-skeleton {
  display: block;
  width: 100%;
  height: 54px;
  margin-top: 4px;
}

/* Detail skeleton: susunan sama seperti detail asli, bukan menimpa seperti browser sedang mabuk. */
.detail-skeleton-page {
  width: min(100%, 1040px);
  margin: 0 auto 54px;
  padding: 0 0 40px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: left;
}

.detail-skeleton-page .detail-skeleton-cover {
  display: block;
  width: 100%;
  min-height: 320px;
  border-radius: 0 0 30px 30px;
}

.detail-skeleton-page .skeleton-detail-card {
  margin: -46px clamp(12px, 3vw, 24px) 18px;
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
}

.detail-skeleton-page .skeleton-detail-content {
  margin: 18px clamp(12px, 3vw, 24px);
  display: grid;
  gap: 12px;
}

.detail-skeleton-page .author-row {
  margin: 0;
}

.detail-skeleton-page .detail-stats {
  margin: 0;
}

.detail-skeleton-page .button-skeleton {
  margin-top: 0;
}

/* Changelog panjang default-nya diringkas. Peradaban selamat dari scroll tanpa akhir. */
.changelog-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.changelog-text.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  overflow: hidden;
}

.changelog-toggle {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(34, 179, 19, 0.28);
  border-radius: 999px;
  background: rgba(34, 179, 19, 0.1);
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.changelog-toggle:hover,
.changelog-toggle:focus-visible {
  background: rgba(34, 179, 19, 0.16);
  outline: none;
}

html[data-theme="dark"] .changelog-toggle {
  color: #8af59c;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(134, 239, 172, 0.22);
}

@media (max-width: 760px) {
  .card-top {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: start;
  }

  .card .badges {
    justify-items: end !important;
    min-width: max-content;
  }

  .badge-row {
    justify-content: flex-end;
    gap: 6px;
  }

  .rating,
  .downloads,
  .status-badge,
  .version-badge {
    min-height: 32px;
    height: 32px;
    padding: 0 9px;
    font-size: 11.5px;
    border-radius: 13px;
  }

  .status-badge { min-width: 92px; }
  .version-badge { min-width: 72px; }
  .rating { min-width: 62px; }
  .downloads { min-width: 88px; }

  .rating svg,
  .downloads svg,
  .status-badge svg,
  .version-badge svg {
    width: 14px;
    height: 14px;
  }

  .skeleton-card .skeleton-card-top {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
  }

  .skeleton-card .avatar-skeleton {
    width: 46px;
    height: 46px;
  }

  .badge-skeleton.small { width: 62px; }
  .badge-skeleton.medium { width: 88px; }
  .badge-skeleton.wide { width: 92px; }

  .detail-skeleton-page .detail-skeleton-cover {
    min-height: 250px;
  }

  .detail-skeleton-page .skeleton-detail-card {
    margin-top: -38px;
  }
}

@media (max-width: 430px) {
  .card-top {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .card .badges,
  .skeleton-card .skeleton-badges {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin-top: 2px;
  }

  .badge-row {
    width: 100%;
  }

  .status-badge { min-width: 104px; }
  .version-badge { min-width: 82px; }
  .rating { min-width: 70px; }
  .downloads { min-width: 104px; }

  .skeleton-card .skeleton-card-top {
    grid-template-columns: 44px minmax(0, 1fr);
  }
}

/* === V15 desktop layout fix ===
   Desktop mode sempit bikin card jadi tusuk sate. Ini dipaksa lebih waras. */
.library {
  width: min(calc(100% - 28px), 1260px) !important;
  max-width: 1260px !important;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 385px), 1fr)) !important;
  gap: clamp(18px, 2vw, 24px) !important;
}

.card-top,
.skeleton-card .skeleton-card-top {
  grid-template-columns: 52px minmax(118px, 1fr) minmax(190px, auto) !important;
  align-items: start !important;
}

.card .badges,
.skeleton-card .skeleton-badges {
  min-width: 190px !important;
  max-width: 220px !important;
  width: auto !important;
  justify-self: end !important;
}

.badge-row {
  width: auto !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

.card .byline {
  min-width: 0 !important;
  max-width: 100% !important;
}

.card .byline strong {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.15 !important;
}

.card .byline small {
  display: block !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* Desktop besar boleh 3 kolom, desktop tanggung jangan dipaksa 3 kolom kayak rak telur. */
@media (min-width: 1280px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 900px) and (max-width: 1279px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Halaman static/legal di desktop dibuat lebih stabil dan tidak kelihatan nyasar. */
.legal-page {
  width: min(calc(100% - 36px), 980px) !important;
  max-width: 980px !important;
}

.legal-card {
  width: 100% !important;
}

@media (min-width: 900px) {
  .hero {
    padding-left: clamp(24px, 5vw, 70px) !important;
    padding-right: clamp(24px, 5vw, 70px) !important;
  }

  .search-bar {
    max-width: 860px !important;
  }

  .quick-tags {
    max-width: 860px !important;
  }

  .library-head {
    padding-left: clamp(24px, 3vw, 40px) !important;
    padding-right: clamp(24px, 3vw, 40px) !important;
  }

  .tabs {
    padding-left: clamp(24px, 3vw, 40px) !important;
    padding-right: clamp(24px, 3vw, 40px) !important;
  }

  .status {
    padding-left: clamp(24px, 3vw, 40px) !important;
    padding-right: clamp(24px, 3vw, 40px) !important;
  }

  .cards {
    padding-left: clamp(22px, 3vw, 34px) !important;
    padding-right: clamp(22px, 3vw, 34px) !important;
  }
}

/* Kalau browser HP dipaksa “desktop site”, jangan sampai author jadi puisi vertikal. */
@media (hover: none) and (pointer: coarse) and (min-width: 760px) {
  .library {
    width: min(calc(100% - 18px), 1080px) !important;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  .card-top,
  .skeleton-card .skeleton-card-top {
    grid-template-columns: 52px minmax(120px, 1fr) minmax(188px, auto) !important;
  }
}

@media (max-width: 700px) {
  .library {
    width: 100% !important;
    max-width: none !important;
  }
}


/* === V17 card flow and restored result-section stacking === */
/* Hero tetap di belakang panel Results agar judul section tidak tertutup. */
.hero {
  overflow: hidden !important;
  z-index: auto !important;
}

.library {
  position: relative;
  z-index: 2;
}

/* Izinkan setiap card mengikuti tinggi kontennya sendiri. */
.cards {
  align-items: start !important;
}

.card,
.card.skeleton-card {
  align-self: start !important;
  height: auto !important;
  min-height: 0 !important;
}

.card-body,
.card-actions {
  height: auto !important;
  min-height: 0 !important;
}

.card-actions {
  margin-top: 0 !important;
}

@media (min-width: 1240px) and (hover: hover) and (pointer: fine) {
  .library {
    width: min(calc(100% - 32px), 1560px) !important;
    max-width: 1560px !important;
  }

  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(16px, 1.35vw, 22px) !important;
  }

  .card-top,
  .skeleton-card .skeleton-card-top {
    grid-template-columns: 46px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .avatar {
    width: 46px;
    height: 46px;
  }

  .card .badges,
  .skeleton-card .skeleton-badges {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }

  .badge-row {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

@media (min-width: 900px) and (max-width: 1239px) and (hover: hover) and (pointer: fine) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .card-top,
  .skeleton-card .skeleton-card-top {
    grid-template-columns: 46px minmax(0, 1fr) !important;
  }

  .card .badges,
  .skeleton-card .skeleton-badges {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }

  .badge-row {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

