/* ==========================================================================
   FreewarePub.org - concept-10-layered design
   Plus Jakarta Sans, sharp edges (border-radius: 0), card-based layout.
   ========================================================================== */

/* --- Reset & Variables --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-radius: 0 !important;
}

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-deeper: #0c4a6e;
    --download: #059669;
    --download-hover: #047857;
    --text: #0f172a;
    --text-secondary: #64748b;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-hover-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --header-shadow: 0 4px 16px rgba(0,0,0,0.06);
    --border-light: #f1f5f9;
    --border: #e2e8f0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== HEADER ==================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    box-shadow: var(--header-shadow);
    height: 60px;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #0c4a6e;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.logo-mark {
    flex-shrink: 0;
    display: block;
    border-radius: 6px;
}

.logo-word {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
}

.logo-word-a { color: #0c4a6e; }
.logo-word-b { font-weight: 500; color: #075985; }
.logo-word-c {
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    margin-left: 2px;
    opacity: 0.85;
}

/* Keep footer .logo (uses span without inner spans) working */
.footer .logo {
    font-size: 18px;
    font-weight: 800;
    color: #0c4a6e;
    gap: 0;
}
.footer .logo span:not([class]) {
    color: #0369a1;
    font-weight: 600;
    font-size: 14px;
}

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

.header-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 14px;
    height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
}

.header-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

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

.header-search-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.header-search-icon:hover {
    color: var(--primary);
}

/* Header nav icons */
.header-nav a {
    gap: 5px;
}

.header-nav a svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.header-nav a:hover svg,
.header-nav a.active svg {
    opacity: 1;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s;
}

.lang-dropdown-trigger:hover {
    background: #e2e8f0;
}

.lang-flag {
    font-size: 16px;
    line-height: 1;
}

.lang-code {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.lang-chevron {
    transition: transform 0.2s;
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}

.lang-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-menu.open ~ .lang-dropdown-trigger .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s;
}

.lang-dropdown-item:hover {
    background: #f1f5f9;
}

.lang-dropdown-item.active {
    background: #e0f2fe;
    font-weight: 600;
}

.lang-item-name {
    flex: 1;
    font-weight: 500;
}

.lang-item-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    min-height: 260px;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    min-height: 260px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 560px;
    padding: 40px 0;
}

.hero-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 34px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
}

.hero-search {
    display: flex;
    height: 50px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    margin-bottom: 16px;
    position: relative;
}

.hero-search input {
    flex: 1;
    height: 100%;
    padding: 0 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    border: none;
    outline: none;
    background: #ffffff;
}

.hero-search input::placeholder {
    color: #94a3b8;
}

.hero-search button {
    padding: 0 28px;
    background: var(--primary);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.hero-search button:hover {
    background: var(--primary-dark);
}

.hero-trending {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.hero-trending a {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    transition: color 0.2s;
}

.hero-trending a:hover {
    color: #ffffff;
}

/* Autocomplete dropdown (inside hero search) */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 48px -8px rgba(0,0,0,0.25);
    z-index: 9999;
    display: none;
    max-height: 380px;
    overflow-y: auto;
}
/* Promote the parent form so dropdown sits above following sections */
.hero-search { z-index: 100; }
.hero { position: relative; z-index: 50; }

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-dropdown .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: #0f172a;
    transition: background 0.12s ease;
    border-bottom: 1px solid #f8fafc;
}

.autocomplete-dropdown .autocomplete-item:last-of-type {
    border-bottom: 0;
}

.autocomplete-dropdown .autocomplete-item:hover,
.autocomplete-dropdown .autocomplete-item.highlighted {
    background: #eff6ff;
}

.autocomplete-dropdown .autocomplete-item img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 6px;
}

.autocomplete-dropdown .autocomplete-item .autocomplete-name {
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Floating cards */
.hero-float-area {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}

.float-card {
    position: absolute;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.float-card:nth-child(1) { top: 18%; right: 8%; animation: floatAnim 6s ease-in-out infinite; }
.float-card:nth-child(2) { top: 42%; right: 22%; animation: floatAnim2 8s ease-in-out infinite; animation-delay: -2s; transform: scale(0.9); }
.float-card:nth-child(3) { top: 65%; right: 5%; animation: floatAnim 7s ease-in-out infinite; animation-delay: -4s; }
.float-card:nth-child(4) { top: 28%; right: 38%; animation: floatAnim 9s ease-in-out infinite; animation-delay: -3s; transform: scale(1.05); }
.float-card:nth-child(5) { top: 55%; right: 28%; animation: floatAnim3 6.5s ease-in-out infinite; animation-delay: -1s; transform: scale(0.85); opacity: 0.8; }

@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes floatAnim2 {
    0%, 100% { transform: translateY(0) scale(0.9); }
    50% { transform: translateY(-12px) scale(0.9); }
}
@keyframes floatAnim3 {
    0%, 100% { transform: translateY(0) scale(0.85); opacity: 0.8; }
    50% { transform: translateY(-12px) scale(0.85); opacity: 0.8; }
}

.float-card-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.float-card-info { flex: 1; }

.float-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.float-card-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--download);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==================== PAGE LAYOUT ==================== */
.page-body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==================== SECTION HEADERS ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: var(--primary);
}

.section-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    transition: opacity 0.2s;
}

.section-link:hover {
    opacity: 0.75;
}

/* ==================== CARDS BASE ==================== */
.card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

/* ==================== BUTTONS ==================== */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--download);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-download:hover {
    background: var(--download-hover);
    color: #ffffff;
}

.btn-download svg {
    width: 14px;
    height: 14px;
}

.btn-get {
    padding: 6px 14px;
    background: var(--download);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-get:hover {
    background: var(--download-hover);
    color: #ffffff;
}

/* General buttons (backward compat) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-success {
    background: var(--download);
    color: #ffffff;
}
.btn-success:hover {
    background: var(--download-hover);
    color: #ffffff;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: #f1f5f9;
}

/* ==================== FEATURED DOWNLOADS ==================== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.featured-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.10), 0 6px 16px rgba(0,0,0,0.06);
}

.featured-card-bar {
    height: 4px;
    width: 100%;
}

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

.featured-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.featured-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}

.featured-icon img {
    width: 48px;
    height: 48px;
}

.featured-meta { flex: 1; min-width: 0; }

.featured-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-publisher {
    font-size: 12px;
    color: var(--text-secondary);
}

.featured-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 16px;
}

.featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.featured-file-info {
    font-size: 11px;
    color: #94a3b8;
}

/* ==================== POPULAR PROGRAMS ==================== */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 14px;
}

.popular-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.popular-rank {
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.popular-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.popular-icon img {
    width: 36px;
    height: 36px;
}

.popular-info {
    flex: 1;
    min-width: 0;
}

.popular-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.popular-name a {
    color: var(--text);
    transition: color 0.2s;
}
.popular-name a:hover {
    color: var(--primary);
}

.popular-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.popular-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.category-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: #e0f2fe;
    padding: 3px 10px;
}

.popular-rating {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
}

.popular-downloads {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ==================== RECENTLY ADDED ==================== */
.recent-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.recent-scroll::-webkit-scrollbar { height: 4px; }
.recent-scroll::-webkit-scrollbar-track { background: #e2e8f0; }
.recent-scroll::-webkit-scrollbar-thumb { background: #94a3b8; }

.recent-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    padding: 14px 16px;
    min-width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.recent-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recent-icon {
    font-size: 28px;
    line-height: 1;
}

.recent-icon img {
    width: 36px;
    height: 36px;
}

.new-badge {
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    padding: 2px 6px;
    letter-spacing: 0.06em;
}

.recent-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.recent-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==================== CATEGORIES GRID ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.cat-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-left 0.25s ease;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.cat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    border-left-color: var(--primary);
}

.cat-emoji {
    font-size: 26px;
    line-height: 1;
}

.cat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cat-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== ONLINE TOOLS ==================== */
.tools-section-wrapper {
    background: #e2e8f0;
    padding: 28px;
    margin: 0;
}

/* ==================== TOOLS INDEX PAGE v3 ==================== */
.tools-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 44px 0;
    position: relative;
    overflow: hidden;
}

.tools-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.tools-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.tools-hero-content { flex: 1; }

.tools-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tools-hero-badge svg { opacity: 0.6; }

.tools-hero-content h1 {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
    line-height: 1.2;
}

.tools-hero-content p {
    font-size: 15px;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.5;
    max-width: 520px;
}

.tools-hero-icons {
    display: flex;
    gap: 16px;
    font-size: 40px;
    opacity: 0.15;
    flex-shrink: 0;
}

.tools-index-main { gap: 28px !important; }

.tools-category-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tools-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.tools-category-header svg { color: var(--primary); flex-shrink: 0; }

.tools-category-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.tools-category-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #e0f2fe;
    padding: 2px 8px;
}

.tools-grid-v3 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tool-card-v3 {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.tool-card-v3:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
}

.tool-card-v3-emoji {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.tool-card-v3-body { flex: 1; min-width: 0; }

.tool-card-v3-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.tool-card-v3-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-v3-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.2s, transform 0.2s;
}

.tool-card-v3:hover .tool-card-v3-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* Tool card compat (sidebar/home) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tool-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.tool-emoji, .tool-card-emoji { font-size: 24px; line-height: 1; }
.tool-name, .tool-card-name { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.tool-desc, .tool-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; flex: 1; margin: 0; }

/* ==================== SIDEBAR WIDGETS ==================== */
.widget {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.widget-body {
    padding: 16px;
}

/* Widget: Download of the Day */
.dotd-bar {
    height: 8px;
    background: linear-gradient(90deg, #0c4a6e, #0369a1);
}

.dotd-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dotd-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dotd-app {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dotd-icon {
    font-size: 42px;
    line-height: 1;
    flex-shrink: 0;
}

.dotd-icon img {
    width: 56px;
    height: 56px;
}

.dotd-info { flex: 1; }

.dotd-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.dotd-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dotd-stars {
    color: #f59e0b;
    font-size: 13px;
}

.dotd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: var(--download);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.dotd-btn:hover {
    background: var(--download-hover);
    color: #ffffff;
}

.dotd-trust {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

/* Widget: Trending */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

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

.trending-rank {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    width: 18px;
}

.trending-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.trending-icon img {
    width: 28px;
    height: 28px;
}

.trending-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.trending-dir {
    font-size: 16px;
    font-weight: 700;
}

.trending-dir.up { color: #059669; }
.trending-dir.down { color: #ef4444; }

/* Widget: Categories list */
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: var(--primary);
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cat-list-item:last-child { border-bottom: none; }
.cat-list-item:hover { opacity: 0.7; }

.cat-list-count {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Widget: Platform */
.platform-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: #f8fafc;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
    width: 100%;
    text-align: left;
}

.platform-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.platform-btn:hover:not(.active) {
    background: #e2e8f0;
    color: var(--text);
}

.platform-emoji {
    font-size: 16px;
}

/* Widget: Newsletter */
.newsletter-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.newsletter-input {
    padding: 10px 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    outline: none;
    color: var(--text);
    transition: border-color 0.2s;
}

.newsletter-input:focus {
    border-color: var(--primary);
}

.newsletter-btn {
    padding: 10px;
    background: var(--primary);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-btn:hover {
    background: var(--primary-dark);
}

.newsletter-note {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
}

/* Sidebar: related programs + tools */
.sidebar-section {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 16px;
}

.sidebar-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-program {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
    transition: opacity 0.2s;
}

.sidebar-program:last-child { border-bottom: none; }
.sidebar-program:hover { opacity: 0.7; }

.sidebar-program img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-program-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.sidebar-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-tools a {
    font-size: 13px;
    color: var(--primary);
    padding: 4px 0;
    transition: opacity 0.2s;
}

.sidebar-tools a:hover {
    opacity: 0.7;
}

/* ==================== FOOTER ==================== */
.footer {
    background: #0c4a6e;
    color: rgba(255,255,255,0.8);
    margin-top: 40px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: #ffffff;
    font-size: 18px;
    display: block;
    margin-bottom: 12px;
}

.footer-brand .logo span {
    color: #38bdf8;
}

.footer-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-tagline {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.footer-col-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links li a {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}

.footer-links li a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copyright {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: rgba(255,255,255,0.7);
}

/* ==================== BREADCRUMBS ==================== */
.breadcrumbs {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumbs-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-weight: 500;
    transition: opacity 0.2s;
}

.breadcrumb-link:hover {
    opacity: 0.7;
}

.breadcrumb-link svg {
    opacity: 0.7;
}

.breadcrumb-sep {
    color: #cbd5e1;
    flex-shrink: 0;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

/* ==================== PROGRAM PAGE (v3 full redesign) ==================== */

/* --- Hero with Background Icon --- */
.prog-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    position: relative;
    overflow: hidden;
    padding: 52px 0 48px;
}

.prog-hero-bg-icon {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.prog-hero-bg-icon-wrap {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.12;
}

.prog-hero-bg-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prog-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    position: relative;
    z-index: 2;
}

.prog-hero-left {
    flex-shrink: 0;
}

.prog-hero-icon-frame {
    width: 96px;
    height: 96px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.prog-hero-icon-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prog-hero-center {
    flex: 1;
    min-width: 0;
}

.prog-hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.prog-hero-cat-badge {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    transition: background 0.15s;
}

.prog-hero-cat-badge:hover {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}

.prog-hero-license-badge {
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    padding: 4px 12px;
}

.prog-hero-rank-badge {
    font-size: 11px;
    font-weight: 700;
    color: #0c4a6e;
    background: #fbbf24;
    padding: 4px 12px;
}

.prog-hero-rank-weekly {
    background: rgba(251, 191, 36, 0.7);
}

.prog-hero-rank-weekly small {
    font-weight: 500;
    opacity: 0.8;
}

.prog-hero-name {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 4px;
}

.prog-hero-publisher {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}

.prog-hero-publisher strong {
    color: rgba(255,255,255,0.9);
}

.prog-hero-stats-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.prog-hero-rating-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prog-hero .prog-stars {
    display: flex;
    gap: 2px;
}

.prog-hero .prog-stars .star {
    font-size: 18px;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}

.prog-hero .prog-stars .star.active,
.prog-hero .prog-stars .star.star-active,
.prog-hero .prog-stars .star.hover {
    color: #fbbf24;
}

.prog-hero-rating-num {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.prog-hero-rating-num strong {
    color: #ffffff;
    font-weight: 700;
}

.prog-hero-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    padding-left: 16px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.prog-hero-stat svg {
    opacity: 0.6;
}

.prog-hero-stat strong {
    color: rgba(255,255,255,0.9);
    font-weight: 700;
}

.prog-hero-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 220px;
}

.prog-hero-dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--download);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

.prog-hero-dl-btn:hover {
    background: var(--download-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.prog-hero-dl-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.prog-hero-dl-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.prog-hero-ask-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    transition: background 0.15s, color 0.15s;
    margin-top: 4px;
}

.prog-hero-ask-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

/* --- TOC Navigation Bar --- */
.prog-toc-bar {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 50;
}

.prog-toc-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.prog-toc-bar-inner::-webkit-scrollbar {
    display: none;
}

.prog-toc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 12px 8px 12px 0;
    border-right: 1px solid var(--border);
    margin-right: 4px;
}

.prog-toc-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
    border-bottom: 2px solid transparent;
}

.prog-toc-item:hover {
    color: var(--primary);
    background: #f0f9ff;
    border-bottom-color: var(--primary);
}

.prog-toc-item svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.prog-toc-item:hover svg {
    opacity: 1;
}

/* --- Article Meta Bar --- */
.prog-article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.prog-article-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.prog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.prog-meta-item svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.prog-meta-item strong {
    font-weight: 600;
    color: var(--text);
}

.prog-article-meta-right {
    display: flex;
    gap: 6px;
}

.prog-meta-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: var(--primary-dark);
}

/* --- Unified Content Flow --- */
.prog-content-flow {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 28px;
}

.prog-flow-section {
    scroll-margin-top: 130px;
}

.prog-flow-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 15%, var(--border) 85%, transparent 100%);
    margin: 32px 0;
}

.prog-flow-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid var(--primary);
}

/* --- Description Content --- */
.prog-description-content {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
}

.prog-description-content h2,
.prog-description-content h3 {
    margin: 28px 0 12px;
    border: none;
    padding: 0;
}

.prog-description-content h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

.prog-description-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.prog-description-content p { margin-bottom: 14px; }

.prog-description-content ul,
.prog-description-content ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.prog-description-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.prog-description-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 13px;
}

.prog-description-content table th,
.prog-description-content table td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--border);
}

.prog-description-content table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text);
}

.prog-description-content table tr:nth-child(even) td {
    background: #fafbfc;
}

.prog-description-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    margin: 20px 0;
    background: #f0f9ff;
    color: var(--text);
    font-style: normal;
}

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

.prog-description-content strong { font-weight: 600; }

.prog-description-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prog-description-content a:hover { text-decoration: none; }

/* Highlight Box */
.prog-description-content .highlight-box {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    color: #ffffff;
    padding: 18px 22px;
    margin: 24px 0;
    position: relative;
}

.prog-description-content .highlight-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #fbbf24;
}

.prog-description-content .highlight-box strong { color: #fbbf24; font-weight: 700; }
.prog-description-content .highlight-box a { color: #7dd3fc; }

/* Pros & Cons */
.prog-description-content .pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.prog-description-content .pros {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-top: 4px solid #22c55e;
    padding: 20px;
}

.prog-description-content .pros h4 {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prog-description-content .pros h4::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.prog-description-content .pros ul { list-style: none; padding-left: 0; margin-bottom: 0; }

.prog-description-content .pros li {
    padding: 5px 0 5px 24px;
    position: relative;
    color: #166534;
    font-size: 13px;
}

.prog-description-content .pros li::before {
    content: '+';
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #22c55e;
    font-size: 15px;
}

.prog-description-content .cons {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-top: 4px solid #ef4444;
    padding: 20px;
}

.prog-description-content .cons h4 {
    font-size: 14px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prog-description-content .cons h4::before {
    content: '\2717';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.prog-description-content .cons ul { list-style: none; padding-left: 0; margin-bottom: 0; }

.prog-description-content .cons li {
    padding: 5px 0 5px 24px;
    position: relative;
    color: #991b1b;
    font-size: 13px;
}

.prog-description-content .cons li::before {
    content: '\2013';
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #ef4444;
    font-size: 15px;
}

/* Editor's Opinion */
.prog-description-content .editor-opinion {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    color: rgba(255,255,255,0.9);
    padding: 22px 24px;
    margin: 24px 0;
}

.prog-description-content .editor-opinion .opinion-badge {
    display: inline-block;
    background: #fbbf24;
    color: #0c4a6e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.prog-description-content .editor-opinion p { margin-bottom: 10px; line-height: 1.7; color: rgba(255,255,255,0.9); }
.prog-description-content .editor-opinion p:last-child { margin-bottom: 0; }
.prog-description-content .editor-opinion strong { color: #ffffff; }
.prog-description-content .editor-opinion a { color: #7dd3fc; }

/* --- FAQ --- */
.prog-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prog-faq-item {
    border: 1px solid var(--border);
    overflow: hidden;
}

.prog-faq-item summary {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.prog-faq-item summary::-webkit-details-marker { display: none; }

.prog-faq-item summary::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    flex-shrink: 0;
}

.prog-faq-item[open] summary::before {
    content: '\2212';
    background: #0c4a6e;
}

.prog-faq-item summary:hover { background: #f8fafc; }

.prog-faq-answer {
    padding: 0 16px 16px 50px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* --- Program Features Table --- */
.prog-features-module {
    display: flex;
    flex-direction: column;
}

.prog-feat-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
}

.prog-feat-table thead th {
    background: var(--primary-deeper);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    text-align: left;
}

.prog-feat-col-num {
    width: 40px;
    text-align: center !important;
}

.prog-feat-col-name { width: 35%; }
.prog-feat-col-instr { width: auto; }

.prog-feat-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.prog-feat-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.prog-feat-table tbody tr:hover {
    background: #f1f5f9;
}

.prog-feat-table td {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    vertical-align: top;
}

.prog-feat-num {
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    width: 40px;
}

.prog-feat-name {
    font-weight: 600;
    color: var(--text);
}

.prog-feat-instr {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
}

.feat-step-sep {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    margin: 0 2px;
}

.prog-feat-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 24px;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    width: 100%;
}

.prog-feat-show-more:hover {
    background: #f0f9ff;
    border-color: var(--primary);
}

.prog-feat-show-more svg {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.prog-feat-show-more--expanded svg {
    transform: rotate(180deg);
}

/* Mobile: stacked cards */
@media (max-width: 767px) {
    .prog-feat-table thead { display: none; }

    .prog-feat-table,
    .prog-feat-table tbody,
    .prog-feat-table tr,
    .prog-feat-table td {
        display: block;
        width: 100%;
    }

    .prog-feat-table tbody tr {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-light);
    }

    .prog-feat-table tbody tr:nth-child(even) {
        background: #f8fafc;
    }

    .prog-feat-num {
        display: inline;
        text-align: left;
        font-size: 13px;
    }

    .prog-feat-num::after {
        content: ". ";
    }

    td.prog-feat-name {
        display: inline;
        padding: 0;
        font-size: 14px;
    }

    td.prog-feat-instr {
        display: block;
        padding: 4px 0 0 0;
        font-size: 13px;
    }
}

/* --- Feature Tags (inline) --- */
.prog-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prog-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-dark);
    transition: background 0.15s;
    cursor: default;
}

.prog-feature-tag svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* --- Similar Programs --- */
.prog-similar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.prog-similar-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    transition: background 0.15s, transform 0.15s;
}

.prog-similar-card:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.prog-similar-card img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
}

.prog-similar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prog-similar-name { font-size: 13px; font-weight: 600; color: var(--text); }

.prog-similar-meta { font-size: 11px; color: var(--text-secondary); }

.prog-similar-arrow {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
}

.prog-similar-card:hover .prog-similar-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* --- Alternatives --- */
.prog-alt-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prog-alt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    transition: background 0.15s;
}

.prog-alt-item:hover { background: #e2e8f0; }

.prog-alt-item img { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
.prog-alt-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.prog-alt-dl { font-size: 12px; color: var(--text-secondary); }

.prog-alt-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: opacity 0.2s;
}

.prog-alt-more:hover { opacity: 0.7; }

/* --- Q&A --- */
.prog-qa-form-box {
    margin-bottom: 28px;
    background:
        radial-gradient(circle at 100% 0%, rgba(251,191,36,0.20) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(96,165,250,0.20) 0%, transparent 50%),
        linear-gradient(135deg, #0369a1 0%, #0c4a6e 50%, #075985 100%);
    border-radius: 18px;
    box-shadow: 0 16px 48px -16px rgba(3,105,161,0.45), 0 2px 0 rgba(255,255,255,0.10) inset;
    overflow: hidden;
    position: relative;
}

.prog-qa-form-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.prog-qa-form-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 32px 8px;
    color: #ffffff;
    position: relative;
}

.prog-qa-form-header svg {
    color: #fde047;
    flex-shrink: 0;
    margin-top: 4px;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.prog-qa-form-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

.prog-qa-form-header p {
    font-size: 14px;
    color: rgba(255,255,255,0.88);
    margin: 4px 0 0;
    line-height: 1.5;
}

.prog-qa-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 32px 28px;
    position: relative;
}

.prog-qa-form-row { width: 100%; }

.prog-qa-form-row--inline {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.prog-qa-form-row--inline .prog-qa-input { flex: 1; }

.prog-qa-input,
.prog-qa-textarea {
    width: 100%;
    padding: 13px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    border: 2px solid transparent;
    border-radius: 10px;
    outline: none;
    color: #0f172a;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.prog-qa-input::placeholder,
.prog-qa-textarea::placeholder { color: #94a3b8; }

.prog-qa-input:focus,
.prog-qa-textarea:focus {
    border-color: #fde047;
    box-shadow: 0 0 0 4px rgba(253,224,71,0.25), 0 4px 12px rgba(0,0,0,0.10);
}

.prog-qa-textarea { resize: vertical; min-height: 72px; }

.prog-qa-form .btn-primary {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: #0369a1;
    font-weight: 700;
    padding: 13px 24px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-size: 14px;
    white-space: nowrap;
}
.prog-qa-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.20);
}
.prog-qa-form .btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.prog-qa-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prog-qa-empty {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    padding: 28px;
}

/* Q&A items — conversation cards */
.qa-item {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.03);
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    overflow: hidden;
}

.qa-item::before {
    content: '';
    position: absolute;
    left: 0; top: 18px; bottom: 18px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    opacity: 0.55;
    transition: opacity 0.18s ease;
}

.qa-item:hover {
    border-color: #bae6fd;
    box-shadow: 0 8px 24px -10px rgba(2,132,199,0.20), 0 2px 6px rgba(15,23,42,0.04);
    transform: translateY(-1px);
}
.qa-item:hover::before { opacity: 1; }

/* Highlight if question already has at least one reply (answered) */
.qa-item-has-replies {
    border-color: #bae6fd;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}
.qa-item-has-replies::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    opacity: 0.85;
}

.qa-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.qa-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    /* Deterministyczny gradient zalezny od hue ustawionego inline (190-249 = brand blue/sky) */
    background: linear-gradient(135deg,
        hsl(var(--qa-avatar-hue, 200), 85%, 55%) 0%,
        hsl(calc(var(--qa-avatar-hue, 200) + 18), 80%, 38%) 100%);
    box-shadow: 0 2px 6px -1px hsla(var(--qa-avatar-hue, 200), 70%, 35%, 0.45),
                inset 0 1px 0 rgba(255,255,255,0.25);
    text-shadow: 0 1px 1px rgba(0,0,0,0.18);
    letter-spacing: 0.02em;
}

.qa-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
    box-shadow: 0 1px 4px -1px hsla(var(--qa-avatar-hue, 200), 70%, 35%, 0.40),
                inset 0 1px 0 rgba(255,255,255,0.25);
}

.qa-item-meta { flex: 1; min-width: 0; }
.qa-author {
    font-size: 14px;
    font-weight: 700;
    color: #0c4a6e;
    display: block;
    line-height: 1.25;
    letter-spacing: -0.005em;
}
.qa-date {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.qa-item-content {
    font-size: 14.5px;
    color: #1e293b;
    line-height: 1.65;
    margin-bottom: 14px;
    word-wrap: break-word;
}

.qa-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qa-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.qa-vote-btn:hover {
    background: #ffffff;
    color: #0369a1;
    border-color: #bae6fd;
    box-shadow: 0 2px 8px -2px rgba(2,132,199,0.25);
    transform: translateY(-1px);
}
.qa-vote-btn:active { transform: translateY(0); }
.qa-vote-btn svg {
    width: 13px;
    height: 13px;
    transition: transform 0.18s ease;
}
.qa-vote-btn[data-vote="yes"]:hover svg { transform: translateY(-1px); }
.qa-vote-btn[data-vote="no"]:hover svg { transform: translateY(1px); }

/* Voted active state — set by program-interactions.js after a successful vote */
.qa-vote-btn.voted {
    cursor: default;
    pointer-events: none;
}
.qa-vote-btn.voted[data-vote="yes"] {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #047857;
}
.qa-vote-btn.voted[data-vote="no"] {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.vote-count { font-weight: 700; font-variant-numeric: tabular-nums; }

.qa-reply-toggle {
    margin-left: auto;
    border-radius: 999px !important;
    font-weight: 600;
    padding: 6px 14px !important;
    font-size: 12px !important;
}

/* Nested replies — speech-bubble thread */
.qa-replies {
    margin-top: 16px;
    padding-left: 22px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: none;
}

.qa-replies::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 60%, transparent 100%);
    border-radius: 2px;
}

.qa-reply-item {
    position: relative;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qa-reply-item::before {
    content: '';
    position: absolute;
    left: -23px; top: 22px;
    width: 21px; height: 2px;
    background: #38bdf8;
    border-radius: 2px;
    opacity: 0.55;
}

.qa-reply-item:hover {
    border-color: #bae6fd;
    box-shadow: 0 4px 12px -6px rgba(2,132,199,0.18);
}

.qa-reply-item .qa-item-header { margin-bottom: 8px; }
.qa-reply-item .qa-author { font-size: 13px; }
.qa-reply-item .qa-item-content {
    font-size: 13.5px;
    margin-bottom: 10px;
    color: #334155;
}

/* Mobile */
@media (max-width: 600px) {
    .qa-item { padding: 16px; border-radius: 12px; }
    .qa-item::before { top: 14px; bottom: 14px; }
    .qa-avatar { width: 36px; height: 36px; font-size: 14px; }
    .qa-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
    .qa-item-content { font-size: 14px; }
    .qa-item-actions { gap: 4px; }
    .qa-reply-toggle { margin-left: 0; flex-basis: 100%; order: 99; text-align: center; margin-top: 4px; }
    .qa-replies { padding-left: 16px; }
    .qa-reply-item { padding: 12px 14px; }
    .qa-reply-item::before { left: -17px; width: 15px; top: 18px; }
}

.qa-reply-form-wrapper {
    margin-top: 14px;
    padding: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 14px;
    box-shadow: 0 4px 14px -4px rgba(2,132,199,0.15);
    animation: qaReplyOpen 0.18s ease;
}

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

.qa-reply-form-wrapper::before {
    content: 'Reply to this question';
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.qa-reply-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qa-reply-form .prog-qa-form-row,
.qa-reply-form .qa-form-row { width: 100%; }

.qa-reply-form .prog-qa-input,
.qa-reply-form .qa-input,
.qa-reply-form .prog-qa-textarea,
.qa-reply-form .qa-textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    border: 1.5px solid #e0e7ff;
    border-radius: 8px;
    outline: none;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qa-reply-form .prog-qa-input:focus,
.qa-reply-form .qa-input:focus,
.qa-reply-form .prog-qa-textarea:focus,
.qa-reply-form .qa-textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2,132,199,0.15);
}

.qa-reply-form .prog-qa-textarea,
.qa-reply-form .qa-textarea { resize: vertical; min-height: 60px; }

.qa-reply-form .btn-primary,
.qa-reply-form .btn-sm.btn-primary {
    align-self: flex-start;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #ffffff;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    box-shadow: 0 4px 10px -2px rgba(3,105,161,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.qa-reply-form .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -2px rgba(3,105,161,0.45); }
.qa-reply-form .btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* --- Related Searches --- */
.prog-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prog-search-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f5f9;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.prog-search-tag:hover { background: #e2e8f0; color: var(--primary); }
.prog-search-tag svg { flex-shrink: 0; opacity: 0.5; }

/* --- Sidebar: Download Widget (dark navy) --- */
.prog-widget-download {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    overflow: hidden;
}

.prog-widget-dl-body {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.prog-widget-dl-body img {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    padding: 4px;
}

.prog-widget-dl-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prog-widget-dl-info strong { font-size: 15px; color: #ffffff; }
.prog-widget-dl-info span { font-size: 12px; color: rgba(255,255,255,0.6); }

.prog-widget-dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    background: var(--download);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.prog-widget-dl-btn:hover { background: var(--download-hover); color: #ffffff; }

.prog-widget-dl-trust {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* --- Sidebar: Online Tools Widget --- */
.prog-widget-tools {
    overflow: hidden;
}

.prog-widget-tools-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.prog-widget-tools-header svg {
    opacity: 0.7;
}

.prog-widget-tools-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-light);
}

.prog-tool-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card-bg);
    transition: background 0.15s;
}

.prog-tool-card:hover {
    background: #f0f9ff;
}

.prog-tool-emoji {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.prog-tool-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.prog-tool-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.prog-tool-cta {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

/* --- Sidebar: Feature Tags Widget (dark navy) --- */
.prog-widget-features {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    overflow: hidden;
}

.prog-widget-features-header {
    padding: 14px 16px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.6);
}

.prog-widget-features-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 16px;
}

.prog-sidebar-tag {
    display: inline-block;
    padding: 5px 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    transition: background 0.15s;
}

.prog-sidebar-tag:hover { background: rgba(255,255,255,0.2); }

/* ==================== CATEGORY PAGE ==================== */
.programs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-list-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.program-list-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
}

.program-list-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.program-list-info {
    flex: 1;
    min-width: 0;
}

.program-list-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.program-list-name a {
    color: var(--text);
    transition: color 0.2s;
}

.program-list-name a:hover {
    color: var(--primary);
}

.program-list-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.program-list-actions {
    flex-shrink: 0;
}

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

.pagination a,
.pagination span {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: background 0.15s, color 0.15s;
}

.pagination a:hover {
    background: var(--primary);
    color: #ffffff;
}

.pagination span.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.pagination span.disabled {
    opacity: 0.4;
    cursor: default;
}

/* ==================== DOWNLOAD PAGE ==================== */
.download-page {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 48px 24px;
    text-align: center;
}

.download-page h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.download-info {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.countdown-display {
    font-size: 72px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
}

.download-status {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.download-manual {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 16px;
}

.download-manual a {
    color: var(--primary);
    font-weight: 500;
}

.download-manual a:hover {
    text-decoration: underline;
}

/* ==================== TOOLS INDEX PAGE ==================== */
.page-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.page-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Also used as section heading in page-body */
.section-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.text-muted {
    color: var(--text-secondary);
}

.mb-lg {
    margin-bottom: 24px;
}

/* ==================== ALTERNATIVES INDEX v3 ==================== */
.alt-index-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 40px 0;
    text-align: center;
}

.alt-index-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.alt-index-hero-icon {
    margin-bottom: 12px;
}

.alt-index-hero-icon svg { color: rgba(255,255,255,0.5); }

.alt-index-hero h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
}

.alt-index-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 auto 16px;
    max-width: 560px;
    line-height: 1.5;
}

.alt-index-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.alt-index-hero-stat strong {
    font-size: 20px;
    font-weight: 800;
    color: #fbbf24;
}

.alt-index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.alt-index-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.alt-index-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
    border-left-color: var(--primary);
}

.alt-index-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.alt-index-card-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.alt-index-card-count svg { color: var(--download); }

/* ==================== ALTERNATIVES DETAIL v3 ==================== */
.alt-detail-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 36px 0;
}

.alt-detail-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
}

.alt-detail-hero-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.alt-detail-paid-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.3);
}

.alt-detail-vs-badge {
    font-size: 11px;
    font-weight: 800;
    color: #0c4a6e;
    background: #fbbf24;
    padding: 3px 10px;
    letter-spacing: 1px;
}

.alt-detail-free-label {
    font-size: 14px;
    font-weight: 700;
    color: #34d399;
}

.alt-detail-hero h1 {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
}

.alt-detail-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 auto;
    max-width: 560px;
    line-height: 1.5;
}

.alt-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alt-detail-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: box-shadow 0.2s;
}

.alt-detail-item:hover {
    box-shadow: var(--card-hover-shadow);
}

.alt-detail-position {
    font-size: 22px;
    font-weight: 800;
    color: #cbd5e1;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 6px;
}

.alt-detail-item:first-child .alt-detail-position { color: #fbbf24; }
.alt-detail-item:nth-child(2) .alt-detail-position { color: #94a3b8; }
.alt-detail-item:nth-child(3) .alt-detail-position { color: #cd7f32; }

.alt-detail-icon img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: contain;
}

.alt-detail-info { flex: 1; min-width: 0; }

.alt-detail-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.alt-detail-name-row h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.alt-detail-name-row h2 a {
    color: var(--text);
    transition: color 0.2s;
}

.alt-detail-name-row h2 a:hover { color: var(--primary); }

.alt-detail-license {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alt-detail-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 6px;
}

.alt-detail-meta {
    display: flex;
    gap: 12px;
}

.alt-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.alt-detail-meta-item svg { color: #fbbf24; }

.alt-detail-action {
    flex-shrink: 0;
    align-self: center;
}

/* ==================== RANKINGS INDEX v3 ==================== */
.rank-index-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 40px 0;
    text-align: center;
}

.rank-index-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.rank-index-hero-icon {
    margin-bottom: 12px;
}

.rank-index-hero-icon svg { color: #fbbf24; }

.rank-index-hero h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
}

.rank-index-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 auto 16px;
    max-width: 520px;
    line-height: 1.5;
}

.rank-index-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.rank-index-hero-stat strong {
    font-size: 20px;
    font-weight: 800;
    color: #fbbf24;
}

.rank-index-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-index-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
}

.rank-index-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
}

.rank-index-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-index-card-icon svg { color: #92400e; }

.rank-index-card-body { flex: 1; min-width: 0; }

.rank-index-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.rank-index-card-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.rank-index-card-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    transition: color 0.2s, transform 0.2s;
}

.rank-index-card:hover .rank-index-card-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* ==================== RANKING DETAIL v3 ==================== */
.rank-detail-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 36px 0;
    text-align: center;
}

.rank-detail-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.rank-detail-hero-star { color: #fbbf24; margin-bottom: 8px; }

.rank-detail-hero h1 {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
}

.rank-detail-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* Podium */
.rank-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.rank-podium-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.rank-podium-1 { border-top: 3px solid #fbbf24; }
.rank-podium-2 { border-top: 3px solid #94a3b8; }
.rank-podium-3 { border-top: 3px solid #cd7f32; }

.rank-podium-medal {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.rank-podium-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.rank-podium-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.rank-podium-name a {
    color: var(--text);
    transition: color 0.2s;
}

.rank-podium-name a:hover { color: var(--primary); }

.rank-podium-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.rank-podium-rating svg { color: #fbbf24; }

.rank-podium-dl {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: var(--download);
    padding: 6px 16px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.rank-podium-dl:hover { opacity: 0.85; }

/* Remaining items */
.rank-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-detail-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 16px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: box-shadow 0.2s;
}

.rank-detail-item:hover { box-shadow: var(--card-hover-shadow); }

.rank-detail-position {
    font-size: 20px;
    font-weight: 800;
    color: #cbd5e1;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 4px;
}

.rank-detail-icon img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    object-fit: contain;
}

.rank-detail-info { flex: 1; min-width: 0; }

.rank-detail-info h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
}

.rank-detail-info h3 a {
    color: var(--text);
    transition: color 0.2s;
}

.rank-detail-info h3 a:hover { color: var(--primary); }

.rank-detail-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 4px;
}

.rank-detail-item-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

.rank-detail-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rank-detail-item-meta svg { color: #fbbf24; }

.rank-detail-action {
    flex-shrink: 0;
    align-self: center;
}

/* ==================== TOOL PAGE v3 ==================== */
.tool-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    padding: 36px 0;
}

.tool-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.tool-hero-emoji {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}

.tool-hero-content { flex: 1; }

.tool-hero-content h1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
}

.tool-hero-content p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 0 12px;
    line-height: 1.5;
}

.tool-hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 4px 10px;
}

.tool-hero-badge-privacy {
    color: #34d399;
    border-color: rgba(52,211,153,0.3);
}

.tool-hero-badge svg { opacity: 0.7; }

/* Tool area */
.tool-area-v3 {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 28px;
    min-height: 200px;
}

/* ==================== TOOL UI COMPONENTS ==================== */

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 48px 28px;
    text-align: center;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    cursor: pointer;
    margin-bottom: 24px;
    position: relative;
}

.drop-zone::before {
    content: '';
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.25s, transform 0.25s;
}

.drop-zone:hover::before {
    opacity: 1;
    transform: translateY(-3px);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.06);
}

.drop-zone-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #bae6fd 0%, #e0f2fe 100%);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.drop-zone-active::before {
    opacity: 1;
    transform: translateY(-6px);
}

.drop-zone-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.drop-zone-btn {
    cursor: pointer;
    transition: transform 0.15s;
}

.drop-zone-btn:hover {
    transform: translateY(-1px);
}

.drop-zone-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 12px;
    letter-spacing: 0.02em;
}

/* --- File loaded indicator --- */
.drop-zone-loaded {
    border-style: solid;
    border-color: var(--download);
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    padding: 20px 28px;
}

.drop-zone-loaded::before {
    content: '';
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    transform: none;
}

.drop-zone-loaded .drop-zone-text {
    color: #065f46;
    font-weight: 600;
}

/* --- Tool Sections --- */
.tool-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.tool-section:last-child {
    border-bottom: none;
}

/* --- Tool Settings & Labels --- */
.tool-settings {
    margin-bottom: 22px;
}

.tool-settings p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.tool-settings p strong {
    color: var(--primary-dark);
}

.tool-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tool-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.5;
}

/* --- Textareas & Inputs --- */
.tool-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #fafbfc;
    border: 1.5px solid var(--border);
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    line-height: 1.7;
}

.tool-textarea:hover {
    border-color: #94a3b8;
}

.tool-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.08), 0 1px 3px rgba(0,0,0,0.04);
}

.tool-textarea::placeholder {
    color: #94a3b8;
}

.tool-textarea-large {
    min-height: 260px;
    font-size: 15px;
    line-height: 1.8;
}

.tool-color-input {
    width: 52px;
    height: 40px;
    padding: 3px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-color-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.08);
}

.tool-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.tool-color-input::-webkit-color-swatch { border: none; }

/* --- Range Slider --- */
.tool-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--border) 0%, #cbd5e1 100%);
    outline: none;
    margin: 10px 0 6px;
}

.tool-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 0 0 1px rgba(2,132,199,0.1);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tool-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 2px rgba(2,132,199,0.15);
}

.tool-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 0 0 1px rgba(2,132,199,0.1);
}

/* --- Format / Size Selector Buttons --- */
.format-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.format-selector .btn {
    min-width: 0;
    white-space: nowrap;
    border: 1.5px solid var(--border);
    margin-left: -1.5px;
    position: relative;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.01em;
    transition: all 0.15s;
}

.format-selector .btn:first-child { margin-left: 0; }

.format-selector .btn.btn-primary {
    border-color: var(--primary);
    z-index: 1;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
}

.format-selector .btn.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    z-index: 1;
}

.format-selector label.btn {
    cursor: pointer;
}

/* --- File List (PDF merge reorder) --- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
    counter-reset: file-counter;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px 11px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 13px;
    cursor: grab;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    counter-increment: file-counter;
}

.file-list-item::before {
    content: counter(file-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 10px;
}

.file-list-item:hover {
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.file-list-item:active {
    cursor: grabbing;
    transform: translateY(0);
}

.file-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}

.file-list-controls {
    display: flex;
    gap: 3px;
    margin-left: 12px;
    flex-shrink: 0;
}

.file-list-controls .btn {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    min-width: 28px;
    font-weight: 600;
}

.file-list-controls .btn[title="Remove"] {
    color: #ef4444;
    border-color: #fecaca;
}

.file-list-controls .btn[title="Remove"]:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* --- Progress Bar --- */
.progress-bar-wrapper[hidden] { display: none; }

.progress-bar-wrapper {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary) 0%, #0ea5e9 50%, var(--primary-dark) 100%);
    background-size: 200% 100%;
    transition: width 0.35s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0) 100%
    );
    background-size: 30px 100%;
    animation: progressShine 1.2s linear infinite;
}

@keyframes progressShine {
    0% { background-position: -30px 0; }
    100% { background-position: 30px 0; }
}

.progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Error & Output --- */
.tool-error[hidden] { display: none; }

.tool-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    font-size: 13px;
    margin: 16px 0;
    line-height: 1.5;
}

.tool-error::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

.tool-output[hidden] { display: none; }

.tool-output {
    margin-top: 24px;
    padding: 28px 24px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    text-align: center;
    position: relative;
}

.tool-output::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.tool-output-success {
    font-size: 15px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 16px;
}

.tool-output .btn {
    margin-top: 4px;
}

/* --- Tool Actions (button row) --- */
.tool-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    margin-top: 4px;
    border-top: 1px solid var(--border-light);
}

.tool-actions .btn-lg {
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: all 0.2s;
}

.tool-actions .btn-lg:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tool-actions .btn-lg:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --- Stats Grid (word counter, minecraft) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 22px 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    text-align: center;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* --- QR Preview --- */
.qr-preview {
    display: flex;
    justify-content: center;
    padding: 28px 0;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--border);
    margin: 16px 0;
}

.qr-preview canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* --- Image Preview (compress/convert) --- */
.preview-container[hidden] { display: none; }

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 22px 0;
    background: var(--border);
    border: 1px solid var(--border);
    overflow: hidden;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px;
    background: var(--card-bg);
}

.preview-panel h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 12px;
}

.preview-panel img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    margin-bottom: 10px;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}

.preview-size {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 4px 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

/* --- PDF to Image results grid --- */
.p2i-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.p2i-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.p2i-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.p2i-result-item img {
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    max-width: 100% !important;
    max-height: 180px !important;
    margin: 0 !important;
}

/* --- Page list (rotate PDF) --- */
.page-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.page-list-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color 0.15s, background 0.15s;
}

.page-list-item:hover {
    border-color: var(--primary);
    background: #f0f9ff;
    color: var(--primary-dark);
}

/* --- Minecraft Circle Controls --- */
.mc-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mc-control-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mc-canvas-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    margin: 8px 0;
}

.mc-canvas-wrapper canvas {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}

/* --- File info badge (shown after file upload) --- */
.tool-file-info[hidden] { display: none; }

.tool-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    margin-bottom: 20px;
    font-size: 13px;
}

.tool-file-info::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.tool-file-info strong {
    color: var(--primary-dark);
}

/* --- Responsive: Tool Components --- */
@media (max-width: 768px) {
    .tool-area-v3 { padding: 20px 16px; }
    .drop-zone { padding: 36px 18px; }
    .drop-zone::before { width: 40px; height: 40px; margin-bottom: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .preview-container { grid-template-columns: 1fr; }
    .format-selector .btn { font-size: 11px; padding: 6px 12px; }
    .stat-value { font-size: 24px; }
    .stat-card { padding: 16px 8px 12px; }
    .tool-textarea-large { min-height: 180px; }
    .p2i-results { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .file-list-name { font-size: 12px; }
    .file-list-controls .btn { padding: 3px 6px; min-width: 24px; font-size: 12px; }
    .file-list-item::before { width: 20px; height: 20px; font-size: 10px; }
    .progress-bar-wrapper { flex-direction: column; gap: 6px; padding: 12px; }
    .progress-text { text-align: left; }
    .tool-output { padding: 20px 16px; }
    .format-selector { gap: 0; }
}

/* ==================== END TOOL UI COMPONENTS ==================== */

.tool-noscript {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
}

/* FAQ v3 */
.tool-faq-v3 h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}

.tool-faq-v3 h2 svg { color: var(--primary); }

.tool-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-faq-item {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.tool-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    transition: background 0.2s;
}

.tool-faq-item summary::-webkit-details-marker { display: none; }
.tool-faq-item summary::marker { display: none; content: ''; }

.tool-faq-item summary:hover { background: #f8fafc; }

.tool-faq-item summary span { flex: 1; }

.tool-faq-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.2s;
}

.tool-faq-item[open] .tool-faq-chevron {
    transform: rotate(180deg);
}

.tool-faq-answer {
    padding: 0 18px 16px;
}

.tool-faq-answer p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Related programs v3 */
.tool-related-v3 h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}

.tool-related-v3 h2 svg { color: var(--primary); }

.tool-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tool-related-card {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tool-related-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--card-hover-shadow);
}

.tool-related-card img {
    flex-shrink: 0;
    object-fit: contain;
}

.tool-related-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.tool-related-ver {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==================== 404 PAGE ==================== */
.error-page {
    text-align: center;
    padding: 80px 24px;
}

.error-page h1 {
    font-size: 96px;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
    margin-bottom: 16px;
}

.error-page p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ==================== PROGRAMS GRID (homepage cards) ==================== */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .hero-float-area {
        display: none;
    }

    .hero-content {
        max-width: 100%;
    }

    .featured-grid,
    .categories-grid,
    .tools-grid,
    .tools-grid-v3,
    .similar-grid,
    .prog-similar-grid,
    .alt-index-grid,
    .rank-podium,
    .tool-related-grid,
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .prog-hero {
        gap: 20px;
    }

    .prog-hero-right {
        min-width: 180px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .page-body {
        flex-direction: column;
        padding: 16px;
    }

    .sidebar {
        width: 100%;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        padding: 8px 0;
        z-index: 99;
    }

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

    .header-nav a {
        height: auto;
        padding: 12px 24px;
        border-bottom: none;
    }

    .menu-toggle {
        display: block;
    }

    .header-inner {
        gap: 12px;
    }

    .lang-dropdown {
        margin-left: 0;
    }

    .hero {
        min-height: 200px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-search {
        height: 44px;
    }

    .featured-grid,
    .categories-grid,
    .tools-grid,
    .tools-grid-v3,
    .similar-grid,
    .prog-similar-grid,
    .alt-index-grid,
    .rank-podium,
    .tool-related-grid,
    .programs-grid {
        grid-template-columns: 1fr;
    }

    .tools-hero-icons { display: none; }

    .tools-hero-content h1,
    .tool-hero-content h1 { font-size: 22px; }

    .tool-hero-inner { flex-direction: column; gap: 12px; }
    .tool-hero-emoji { font-size: 36px; }

    .alt-detail-hero-vs { flex-direction: column; gap: 8px; }
    .alt-detail-hero h1 { font-size: 20px; }

    .alt-detail-item { flex-wrap: wrap; }
    .alt-detail-action { width: 100%; }
    .alt-detail-action .btn { width: 100%; text-align: center; }

    .rank-detail-item { flex-wrap: wrap; }
    .rank-detail-action { width: 100%; }
    .rank-detail-action .btn { width: 100%; text-align: center; }

    .popular-right {
        flex-wrap: wrap;
        gap: 8px;
    }

    .popular-right .popular-downloads {
        display: none;
    }

    /* Program page responsive */
    .prog-hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .prog-hero-badges {
        justify-content: center;
    }

    .prog-hero-stats-row {
        justify-content: center;
    }

    .prog-hero-right {
        width: 100%;
        min-width: auto;
    }

    .prog-hero-bg-icon {
        display: none;
    }

    .prog-toc-bar {
        position: static;
    }

    .prog-content-flow {
        padding: 20px 16px;
    }

    .prog-description-content .pros-cons {
        grid-template-columns: 1fr;
    }

    .prog-qa-form-row--inline {
        flex-direction: column;
    }

    .prog-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .lang-dropdown-trigger .lang-code {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .breadcrumbs {
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .popular-item {
        flex-wrap: wrap;
    }

    .popular-right {
        width: 100%;
        justify-content: flex-start;
        padding-left: 36px;
    }

    .countdown-display {
        font-size: 56px;
    }

    .prog-hero-icon-frame {
        width: 72px;
        height: 72px;
    }

    .prog-hero-name {
        font-size: 22px;
    }

    .prog-hero-dl-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .prog-similar-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== FEATURE PAGE ==================== */

.feat-page-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: center;
}

.feat-page-hero-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.03) 75%);
    background-size: 30px 30px;
    background-position: 0 0, 0 15px, 15px -15px, -15px 0;
}

.feat-page-hero-glow {
    position: absolute;
    top: -60%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.feat-page-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.feat-page-hero-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #0c4a6e;
    background: #bae6fd;
    padding: 4px 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.feat-page-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 8px;
    max-width: 700px;
}

.feat-page-hero-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
}

/* Animated geometric shapes */
.feat-page-hero-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.feat-page-shape {
    position: absolute;
    border: 2px solid rgba(255,255,255,0.06);
}

.feat-page-shape--1 {
    width: 120px;
    height: 120px;
    top: 15%;
    right: 8%;
    transform: rotate(15deg);
    animation: feat-float-1 8s ease-in-out infinite;
}

.feat-page-shape--2 {
    width: 60px;
    height: 60px;
    top: 55%;
    right: 20%;
    transform: rotate(45deg);
    animation: feat-float-2 6s ease-in-out infinite;
    animation-delay: -2s;
}

.feat-page-shape--3 {
    width: 40px;
    height: 40px;
    top: 25%;
    right: 30%;
    border: 2px solid rgba(56, 189, 248, 0.1);
    transform: rotate(60deg);
    animation: feat-float-3 10s ease-in-out infinite;
    animation-delay: -4s;
}

@keyframes feat-float-1 {
    0%, 100% { transform: rotate(15deg) translateY(0); }
    50% { transform: rotate(20deg) translateY(-12px); }
}

@keyframes feat-float-2 {
    0%, 100% { transform: rotate(45deg) translateY(0) scale(1); }
    50% { transform: rotate(50deg) translateY(-8px) scale(1.05); }
}

@keyframes feat-float-3 {
    0%, 100% { transform: rotate(60deg) translateX(0); }
    50% { transform: rotate(55deg) translateX(10px); }
}

/* Container */
.feat-page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.feat-page-content {
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    padding: 32px 40px;
    margin-top: -20px;
    position: relative;
    z-index: 3;
    margin-bottom: 40px;
}

/* Program cards */
.feat-page-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feat-page-card {
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 20px 24px;
    transition: background 0.15s;
}

.feat-page-card:last-child {
    border-bottom: 1px solid var(--border);
}

.feat-page-card:hover {
    background: #f8fafc;
}

.feat-page-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feat-page-card-icon-link {
    flex-shrink: 0;
}

.feat-page-card-icon-link img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.feat-page-card-meta {
    flex: 1;
    min-width: 0;
}

.feat-page-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.feat-page-card-name a {
    color: inherit;
    transition: color 0.15s;
}

.feat-page-card-name a:hover {
    color: var(--primary);
}

.feat-page-card-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.feat-page-card-version {
    font-weight: 500;
}

.feat-page-card-license {
    font-weight: 600;
    color: #059669;
}

.feat-page-card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.feat-page-card-downloads {
    display: flex;
    align-items: center;
    gap: 3px;
}

.feat-page-card-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feat-page-card-dl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--download);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}

.feat-page-card-dl-btn:hover {
    background: var(--download-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.feat-page-card-detail-btn {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    padding: 8px 12px;
    transition: background 0.15s;
}

.feat-page-card-detail-btn:hover {
    background: #f0f9ff;
    color: var(--primary-dark);
}

/* Instruction row */
.feat-page-card-instruction {
    margin-top: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-left: 3px solid var(--primary);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feat-page-card-instr-label {
    font-weight: 700;
    color: var(--primary-deeper);
    margin-right: 6px;
}

/* Related programs grid */
.feat-page-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.feat-page-related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    transition: background 0.15s, transform 0.1s;
}

.feat-page-related-card:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.feat-page-related-card img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
}

.feat-page-related-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.feat-page-related-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feat-page-related-cat {
    font-size: 11px;
    color: var(--text-secondary);
}

.feat-page-related-arrow {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
}

.feat-page-related-card:hover .feat-page-related-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Feature link button in program page table */
.feat-page-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    opacity: 0.7;
    padding: 2px 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    transition: opacity 0.15s, background 0.15s;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
}

.feat-page-link-btn:hover {
    opacity: 1;
    background: #e0f2fe;
    color: var(--primary-dark);
}

/* ---- Feature Page Responsive ---- */

@media (max-width: 1024px) {
    .feat-page-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .feat-page-hero-title {
        font-size: 24px;
    }

    .feat-page-hero-inner {
        padding: 36px 24px;
    }

    .feat-page-hero-shapes {
        display: none;
    }

    .feat-page-content {
        padding: 24px 20px;
        margin-top: -12px;
    }

    .feat-page-card {
        padding: 16px;
    }

    .feat-page-card-header {
        flex-wrap: wrap;
    }

    .feat-page-card-actions {
        width: 100%;
        margin-top: 12px;
    }

    .feat-page-card-dl-btn {
        flex: 1;
        justify-content: center;
    }

    .feat-page-related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .feat-page-hero-title {
        font-size: 20px;
    }

    .feat-page-hero-subtitle {
        font-size: 14px;
    }

    .feat-page-card-icon-link img {
        width: 40px;
        height: 40px;
    }
}

/* ==================== FEATURES INDEX ==================== */

.feat-idx-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    padding: 48px 24px;
    text-align: center;
}

.feat-idx-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.feat-idx-hero h1 {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.feat-idx-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 16px;
}

.feat-idx-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    padding: 6px 16px;
}

.feat-idx-hero-stat strong {
    color: #ffffff;
    font-weight: 700;
}

.feat-idx-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.feat-idx-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    position: sticky;
    top: 60px;
    background: var(--body-bg);
    z-index: 10;
}

.feat-idx-letter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
}

.feat-idx-letter-link:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.feat-idx-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feat-idx-group {
    display: flex;
    gap: 24px;
    scroll-margin-top: 120px;
}

.feat-idx-group-letter {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

.feat-idx-group-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feat-idx-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.feat-idx-item:hover {
    border-color: var(--primary);
    background: #f0f9ff;
    color: var(--primary-dark);
}

.feat-idx-item-name {
    font-weight: 500;
}

.feat-idx-item-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #e0f2fe;
    padding: 1px 6px;
    min-width: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .feat-idx-hero h1 {
        font-size: 24px;
    }

    .feat-idx-group {
        flex-direction: column;
        gap: 8px;
    }

    .feat-idx-letter-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* === Legal pages === */
.legal-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    color: #fff;
    padding: 60px 24px 48px;
    border-radius: 0 0 24px 24px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.legal-hero-inner { max-width: 800px; margin: 0 auto; text-align: center; position: relative; }
.legal-hero h1 { font-size: 36px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.02em; }
.legal-hero-intro { font-size: 16px; color: rgba(255,255,255,0.82); line-height: 1.6; max-width: 640px; margin: 0 auto 18px; }
.legal-hero-meta { font-size: 13px; color: rgba(255,255,255,0.6); }
.legal-hero-meta strong { color: #fde047; }

.legal-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
}
@media (max-width: 900px) {
    .legal-layout { grid-template-columns: 1fr; }
}

.legal-content { min-width: 0; }

.legal-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}
.legal-toc-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 12px;
}
.legal-toc ol {
    margin: 0;
    padding-left: 22px;
    columns: 2;
    column-gap: 24px;
}
@media (max-width: 600px) {
    .legal-toc ol { columns: 1; }
}
.legal-toc li { margin-bottom: 6px; break-inside: avoid; }
.legal-toc a {
    color: #0369a1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.legal-toc a:hover { text-decoration: underline; }

.legal-section { margin-bottom: 40px; scroll-margin-top: 80px; }
.legal-section h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}
.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    border-radius: 9px;
    flex-shrink: 0;
}
.legal-section-body { font-size: 15px; line-height: 1.7; color: #334155; }
.legal-section-body p { margin: 0 0 14px; }
.legal-section-body p:last-child { margin-bottom: 0; }
.legal-section-body ul, .legal-section-body ol { margin: 0 0 16px; padding-left: 22px; }
.legal-section-body li { margin-bottom: 8px; }
.legal-section-body a { color: #0369a1; font-weight: 600; }
.legal-section-body a:hover { text-decoration: underline; }
.legal-section-body code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: #be185d;
}
.legal-section-body strong { color: #0f172a; font-weight: 700; }

.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13px; }
.legal-table thead th {
    background: #f1f5f9;
    text-align: left;
    padding: 10px 14px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
}
.legal-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #475569;
}
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table code { white-space: nowrap; }

.legal-address {
    background: #f8fafc;
    padding: 14px 18px;
    border-left: 4px solid #0369a1;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
}
.legal-big-contact {
    text-align: center;
    margin: 18px 0;
}
.legal-big-contact a {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 22px -8px rgba(3,105,161,0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.legal-big-contact a:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(3,105,161,0.55); text-decoration: none; }

.legal-side { display: flex; flex-direction: column; gap: 16px; }
.legal-side-card, .legal-side-contact {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}
.legal-side-card h3, .legal-side-contact-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
    margin: 0 0 14px;
}
.legal-side-list { list-style: none; margin: 0; padding: 0; }
.legal-side-list li { margin-bottom: 6px; }
.legal-side-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.legal-side-list a:hover { background: #eff6ff; color: #0369a1; }

.legal-side-contact {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-color: #a7f3d0;
}
.legal-side-contact-email {
    display: block;
    padding: 10px 14px;
    background: #fff;
    color: #047857;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    border: 1px solid #a7f3d0;
    transition: background 0.15s ease;
}
.legal-side-contact-email:hover { background: #ecfdf5; }

/* === Tool page sections === */
.tool-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0 0 24px;
}
.tool-section-title svg { color: #0369a1; }

.tool-how {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
}
.tool-how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 720px) { .tool-how-steps { grid-template-columns: 1fr; } }
.tool-how-step { display: flex; gap: 16px; align-items: flex-start; }
.tool-how-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 5px 14px -4px rgba(3,105,161,0.45);
}
.tool-how-step-body { min-width: 0; }
.tool-how-step-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.tool-how-step-text { font-size: 13px; color: #475569; line-height: 1.55; }

.tool-trust {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
}
.tool-trust-card { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.tool-trust-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(16,185,129,0.55);
}
.tool-trust-body h3 { font-size: 18px; font-weight: 800; color: #064e3b; margin: 0 0 6px; letter-spacing: -0.01em; }
.tool-trust-body p { font-size: 14px; color: #047857; margin: 0; line-height: 1.55; }
.tool-trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(16,185,129,0.2);
}
.tool-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #047857;
}
.tool-trust-item svg { color: #10b981; flex-shrink: 0; }

/* Tool area visual treatment */
.tool-area-v3 {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    min-height: 280px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.tool-noscript { color: #b91c1c; font-weight: 600; text-align: center; padding: 40px; }

/* FAQ accordion polish */
.tool-faq-v3 {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
}
.tool-faq-v3 h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 18px;
}
.tool-faq-v3 h2 svg { color: #f59e0b; }
.tool-faq-list { display: flex; flex-direction: column; gap: 8px; }
.tool-faq-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.tool-faq-item[open] { border-color: #0369a1; background: #fff; }
.tool-faq-item summary {
    cursor: pointer;
    padding: 16px 20px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #0f172a;
    font-size: 15px;
    transition: color 0.15s ease;
}
.tool-faq-item summary::-webkit-details-marker { display: none; }
.tool-faq-item summary:hover { color: #0369a1; }
.tool-faq-chevron { color: #94a3b8; transition: transform 0.18s ease, color 0.18s ease; }
.tool-faq-item[open] .tool-faq-chevron { transform: rotate(180deg); color: #0369a1; }
.tool-faq-answer { padding: 0 20px 18px; }
.tool-faq-answer p { font-size: 14px; color: #475569; line-height: 1.65; margin: 0; }

/* Related programs grid */
.tool-related-v3 {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
}
.tool-related-v3 h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 18px;
}
.tool-related-v3 h2 svg { color: #0284c7; }
.tool-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tool-related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}
.tool-related-card:hover { background: #e0f2fe; border-color: #0284c7; transform: translateY(-2px); }
.tool-related-card img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.tool-related-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.tool-related-ver { font-size: 11px; color: #64748b; }

/* === Rich sidebar widgets === */
.side-widget {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.side-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.side-widget-body { display: flex; flex-direction: column; gap: 4px; }
.side-prog {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.side-prog:hover { background: #f1f5f9; }
.side-prog img { border-radius: 6px; flex-shrink: 0; object-fit: contain; }
.side-prog-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-prog-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
}
.side-prog-numbered { padding: 6px 8px; }
.side-prog-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    flex-shrink: 0;
}
.side-cat-list { list-style: none; margin: 0; padding: 0; }
.side-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.side-cat-link:hover { background: #eff6ff; color: #0284c7; }
.side-cat-count {
    font-size: 10px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
}
.side-tools-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.side-tool-chip {
    padding: 5px 11px;
    background: #eff6ff;
    color: #075985;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}
.side-tool-chip:hover { background: #dbeafe; }
.side-widget-promo {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 50%, #0369a1 100%);
    color: #fff;
    border: 0;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 10px 28px -10px rgba(12,74,110,0.45);
    position: relative;
    overflow: hidden;
}
.side-widget-promo::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 14px 14px;
    pointer-events: none;
    opacity: 0.7;
}
.side-promo-icon {
    color: #fde047;
    margin-bottom: 12px;
    position: relative;
    width: 36px;
    height: 36px;
    background: rgba(253,224,71,0.15);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.side-promo-title {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    color: #fff;
    position: relative;
}
.side-promo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.side-promo-list li {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255,255,255,0.88);
    padding-left: 24px;
    position: relative;
}
.side-promo-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    background-color: rgba(253,224,71,0.20);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fde047' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
}

/* === Alternatives & rankings detail polish === */
.alt-detail-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 56px 72px 1fr auto;
    gap: 18px;
    align-items: center;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.alt-detail-item:hover {
    border-color: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px -10px rgba(3,105,161,0.18);
}
.alt-detail-position {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border-radius: 12px;
    box-shadow: 0 6px 16px -6px rgba(3,105,161,0.55);
}
.alt-detail-list .alt-detail-item:nth-child(1) .alt-detail-position {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 16px -6px rgba(245,158,11,0.55);
}
.alt-detail-list .alt-detail-item:nth-child(2) .alt-detail-position {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}
.alt-detail-list .alt-detail-item:nth-child(3) .alt-detail-position {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.alt-detail-icon {
    width: 72px;
    height: 72px;
    background: #f8fafc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.alt-detail-icon img { width: 56px; height: 56px; object-fit: contain; }
.alt-detail-info { min-width: 0; }
.alt-detail-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.alt-detail-info h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; }
.alt-detail-info h2 a { color: #0f172a; text-decoration: none; }
.alt-detail-info h2 a:hover { color: #0369a1; }
.alt-detail-info p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.alt-detail-license {
    display: inline-block;
    padding: 2px 9px;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
}
.alt-detail-meta { display: flex; gap: 12px; align-items: center; }
.alt-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.alt-detail-meta-item svg { color: #fbbf24; }
.alt-detail-action .btn { padding: 12px 22px; font-weight: 700; font-size: 14px; border-radius: 10px; white-space: nowrap; }

@media (max-width: 720px) {
    .alt-detail-item { grid-template-columns: 48px 1fr; padding: 18px; }
    .alt-detail-icon { display: none; }
    .alt-detail-action { grid-column: 1 / -1; }
}

/* === Alternatives detail hero polish === */
/* === Top / popular page === */
.top-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.top-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.top-filter-chip:hover { background: #e0f2fe; color: #0369a1; }
.top-filter-chip.active { background: #0369a1; color: #fff; }
.top-filter-chip-cnt {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
    color: inherit;
}
.top-filter-chip.active .top-filter-chip-cnt { background: rgba(255,255,255,0.25); color: #fff; }

.top-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
}
.top-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    text-decoration: none;
    color: #64748b;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.top-tab:hover { color: #0369a1; }
.top-tab.active { color: #0c4a6e; border-bottom-color: #0284c7; }
.top-tab svg { color: inherit; }

.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.top-row {
    display: grid;
    grid-template-columns: 56px 56px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.top-row:hover {
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -10px rgba(2,132,199,0.18);
}
.top-rank {
    font-size: 22px;
    font-weight: 900;
    color: #94a3b8;
    text-align: center;
    letter-spacing: -0.04em;
}
.top-row-gold { border-color: #fcd34d; }
.top-row-gold .top-rank { color: #b45309; }
.top-row-silver { border-color: #cbd5e1; }
.top-row-silver .top-rank { color: #475569; }
.top-row-bronze { border-color: #fed7aa; }
.top-row-bronze .top-rank { color: #9a3412; }

.top-icon {
    width: 56px;
    height: 56px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.top-icon img { width: 42px; height: 42px; object-fit: contain; }
.top-body { min-width: 0; }
.top-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-name:hover { color: #0369a1; }
.top-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}
.top-meta-sep { color: #cbd5e1; }
.top-cat { color: #0369a1; text-decoration: none; font-weight: 600; }
.top-cat:hover { text-decoration: underline; }

.top-stat { text-align: right; flex-shrink: 0; }
.top-stat-num { font-size: 16px; font-weight: 800; color: #0c4a6e; line-height: 1; }
.top-stat-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-top: 4px; }

.top-action { flex-shrink: 0; }
.top-action .btn { padding: 8px 14px; font-size: 13px; font-weight: 700; border-radius: 8px; }

.top-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 14px;
    color: #64748b;
}
.top-empty p { margin-top: 12px; font-size: 14px; }

.top-cta-bar {
    margin-top: 28px;
    padding: 18px;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    text-align: center;
}
.top-cta-bar-link {
    color: #0369a1;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}
.top-cta-bar-link:hover { color: #0c4a6e; text-decoration: underline; }

@media (max-width: 720px) {
    .top-row { grid-template-columns: 40px 48px 1fr; gap: 12px; padding: 12px; }
    .top-stat, .top-action { grid-column: 1 / -1; }
    .top-stat { text-align: left; padding-left: 60px; }
    .top-action { padding-left: 60px; }
}

/* === Category page hero === */
.cat-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    color: #fff;
    padding: 40px 24px 36px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.cat-hero-inner { max-width: 1280px; margin: 0 auto; position: relative; }
.cat-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fde047;
    margin-bottom: 8px;
}
.cat-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 6px;
    letter-spacing: -0.015em;
}
.cat-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.72);
    margin: 0 auto 14px;
    max-width: 680px;
    line-height: 1.5;
}
.cat-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.10);
    padding: 6px 14px;
    border-radius: 999px;
}
.cat-hero-stat strong { color: #fde047; font-weight: 800; }

/* === Hero (alt-detail / alt-index / rank-index) — match feat-idx-hero === */
.alt-detail-hero,
.alt-index-hero,
.rank-index-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    color: #fff;
    padding: 40px 24px 36px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.alt-detail-hero::before { content: none; }
.alt-detail-hero-inner,
.alt-index-hero-inner,
.rank-index-hero-inner { max-width: 1280px; margin: 0 auto; position: relative; }
.alt-detail-hero h1,
.alt-index-hero h1,
.rank-index-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 6px;
    letter-spacing: -0.015em;
}
.alt-detail-hero p,
.alt-index-hero p,
.rank-index-hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.72);
    margin: 0 auto 14px;
    max-width: 680px;
    line-height: 1.5;
}
.alt-index-hero-icon,
.rank-index-hero-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fde047;
    margin: 0 auto 10px;
    flex-shrink: 0;
}
.alt-index-hero-icon svg,
.rank-index-hero-icon svg { width: 22px; height: 22px; display: block; }
.cat-hero-icon { display: inline-flex; align-items: center; justify-content: center; }
.cat-hero-icon svg { display: block; }
.alt-detail-hero-vs {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    margin-bottom: 0;
}
.alt-detail-paid-label, .alt-detail-free-label { font-size: 12px; font-weight: 700; }
.alt-detail-paid-label { color: #fda4af; }
.alt-detail-free-label { color: #86efac; }
.alt-detail-vs-badge {
    background: #fde047;
    color: #422006;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.04em;
}
.alt-index-hero-stat,
.rank-index-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 999px;
}
.alt-index-hero-stat strong,
.rank-index-hero-stat strong {
    color: #fde047;
    font-weight: 800;
}

/* === Alternatives & ranking cards (rich) === */
.alt-detail-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.alt-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}
.alt-card:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -10px rgba(2,132,199,0.20);
}
.alt-card-top {
    border-color: #fde68a;
}
.alt-card-rank-1 { border-color: #fcd34d; box-shadow: 0 4px 14px -4px rgba(245,158,11,0.20); }
.alt-card-rank-2 { border-color: #cbd5e1; }
.alt-card-rank-3 { border-color: #fed7aa; }

.alt-card-rank {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 8px;
    gap: 6px;
}
.alt-card-rank-num {
    font-size: 26px;
    font-weight: 900;
    color: #64748b;
    line-height: 1;
    letter-spacing: -0.02em;
}
.alt-card-rank-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.alt-card-rank-1 .alt-card-rank {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-right-color: #fcd34d;
}
.alt-card-rank-1 .alt-card-rank-num { color: #b45309; }
.alt-card-rank-1 .alt-card-rank-label { background: #b45309; color: #fff; border-color: #b45309; }
.alt-card-rank-2 .alt-card-rank {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-right-color: #cbd5e1;
}
.alt-card-rank-2 .alt-card-rank-num { color: #475569; }
.alt-card-rank-2 .alt-card-rank-label { background: #475569; color: #fff; border-color: #475569; }
.alt-card-rank-3 .alt-card-rank {
    background: linear-gradient(180deg, #fed7aa 0%, #fdba74 100%);
    border-right-color: #fb923c;
}
.alt-card-rank-3 .alt-card-rank-num { color: #9a3412; }
.alt-card-rank-3 .alt-card-rank-label { background: #9a3412; color: #fff; border-color: #9a3412; }

.alt-card-main {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.alt-card-head {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
    align-items: flex-start;
}
.alt-card-icon {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.alt-card-icon img { width: 48px; height: 48px; object-fit: contain; }
.alt-card-title { min-width: 0; }
.alt-card-title h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.alt-card-title h2 a { color: #0f172a; text-decoration: none; }
.alt-card-title h2 a:hover { color: #0369a1; }
.alt-card-pub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}
.alt-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.alt-card-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}
.alt-card-badge-license { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alt-card-badge-version { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alt-card-badge-size { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.alt-card-rating {
    text-align: right;
    flex-shrink: 0;
}
.alt-card-stars {
    display: inline-flex;
    gap: 1px;
    margin-bottom: 2px;
}
.alt-card-rating-num {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.alt-card-rating-cnt {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 600;
}

.alt-card-desc {
    margin: 0;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alt-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 12px 0 0;
    border-top: 1px dashed #e2e8f0;
}
.alt-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.alt-card-stat svg { color: #94a3b8; flex-shrink: 0; }
.alt-card-stat strong { color: #0f172a; font-weight: 700; }
.alt-card-stat-trust { color: #047857; font-weight: 600; }
.alt-card-stat-trust svg { color: #10b981; }

.alt-card-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.alt-card-dl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 12px -3px rgba(5,150,105,0.40);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.alt-card-dl:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -3px rgba(5,150,105,0.50);
}
.alt-card-more {
    color: #0369a1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
    transition: color 0.15s ease;
}
.alt-card-more:hover { color: #075985; text-decoration: underline; }

@media (max-width: 720px) {
    .alt-card { grid-template-columns: 60px 1fr; }
    .alt-card-rank { padding: 14px 6px; }
    .alt-card-rank-num { font-size: 22px; }
    .alt-card-main { padding: 16px; }
    .alt-card-head { grid-template-columns: 56px 1fr; }
    .alt-card-icon { width: 56px; height: 56px; }
    .alt-card-icon img { width: 44px; height: 44px; }
    .alt-card-rating { grid-column: 1 / -1; text-align: left; padding-top: 4px; }
    .alt-card-foot { flex-wrap: wrap; }
}

/* === Alternatives index (lista paid software) === */
.idx-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    position: sticky;
    top: 70px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.idx-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    text-decoration: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease;
}
.idx-letter:hover { background: #e0f2fe; color: #0369a1; }

.alt-idx-letter-anchor {
    grid-column: 1 / -1;
    height: 0;
    margin-top: -68px;
    padding-top: 68px;
    pointer-events: none;
}

.alt-idx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.alt-idx-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
}
.alt-idx-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #0c4a6e 0%, #0284c7 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.alt-idx-card:hover {
    border-color: #0284c7;
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -12px rgba(2,132,199,0.22);
}
.alt-idx-card:hover::before { transform: scaleX(1); }

.alt-idx-card-head {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}
.alt-idx-card-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.alt-idx-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.alt-idx-card-icon img { width: 38px; height: 38px; object-fit: contain; }
.alt-idx-card-meta { min-width: 0; }
.alt-idx-card-eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.alt-idx-card-name {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.alt-idx-card-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 10px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.alt-idx-card-count strong { font-size: 13px; font-weight: 800; }

.alt-idx-card-previews {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.alt-idx-card-prev-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.alt-idx-card-prev-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.alt-idx-card-prev {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.alt-idx-card-prev-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    flex-shrink: 0;
}
.alt-idx-card-prev:first-child .alt-idx-card-prev-rank { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
.alt-idx-card-prev img { border-radius: 4px; flex-shrink: 0; object-fit: contain; }
.alt-idx-card-prev-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alt-idx-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}
.alt-idx-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #0369a1;
    transition: color 0.15s ease, gap 0.18s ease;
}
.alt-idx-card:hover .alt-idx-card-cta { color: #0c4a6e; gap: 8px; }

/* === Rankings index (lista best-of list) === */
.rank-idx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.rank-idx-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 22px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
}
.rank-idx-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.rank-idx-card:hover {
    border-color: #fbbf24;
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -12px rgba(245,158,11,0.22);
}
.rank-idx-card:hover::before { transform: scaleX(1); }

.rank-idx-card-head {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}
.rank-idx-card-trophy {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(245,158,11,0.55);
}
.rank-idx-card-body { min-width: 0; }
.rank-idx-card-eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}
.rank-idx-card-eye-dot { color: #cbd5e1; }
.rank-idx-card-cat { color: #0369a1; }
.rank-idx-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-idx-card-podium {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin-bottom: 14px;
}
.rank-idx-card-podium-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.rank-idx-card-podium-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.rank-idx-card-podium-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.rank-idx-card-podium-silver { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }
.rank-idx-card-podium-bronze { background: linear-gradient(135deg, #d97706 0%, #9a3412 100%); }
.rank-idx-card-podium img { border-radius: 5px; flex-shrink: 0; object-fit: contain; }
.rank-idx-card-podium-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-idx-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}
.rank-idx-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #b45309;
    transition: color 0.15s ease, gap 0.18s ease;
}
.rank-idx-card:hover .rank-idx-card-cta { color: #92400e; gap: 8px; }
.rank-idx-card-more {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.alt-index-grid, .rank-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.alt-index-card, .rank-index-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}
.alt-index-card { flex-direction: column; align-items: flex-start; text-align: left; }
.alt-index-card:hover, .rank-index-card:hover {
    border-color: #0369a1;
    transform: translateY(-3px);
    box-shadow: 0 14px 32px -10px rgba(3,105,161,0.20);
}
.alt-index-card-name { font-size: 17px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.alt-index-card-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 999px;
}
.rank-index-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 5px 14px -4px rgba(245,158,11,0.45);
}
.rank-index-card-body { flex: 1; min-width: 0; }
.rank-index-card-title { font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.3; margin-bottom: 4px; }
.rank-index-card-count { font-size: 11px; color: #64748b; font-weight: 600; }
.rank-index-card-arrow { color: #cbd5e1; transition: transform 0.18s ease, color 0.18s ease; }
.rank-index-card:hover .rank-index-card-arrow { color: #0369a1; transform: translateX(3px); }

/* === Search results page === */
.search-page { background: #f6f8fc; min-height: 70vh; }
.search-hero {
    background: linear-gradient(145deg, #0c4a6e 0%, #075985 40%, #0369a1 100%);
    color: #fff;
    padding: 40px 0 36px;
}
.search-hero-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.search-hero-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}
.search-hero-form {
    display: flex;
    gap: 8px;
    max-width: 720px;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.search-hero-input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    color: #0f172a;
    outline: none;
    font-family: inherit;
}
.search-hero-btn {
    border: 0;
    background: #0284c7;
    color: #fff;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease;
    font-family: inherit;
}
.search-hero-btn:hover { background: #0369a1; }
.search-hero-meta {
    margin-top: 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}
.search-hero-meta strong { color: #fff; font-weight: 700; font-size: 16px; }
.search-hero-dot { margin: 0 8px; opacity: 0.5; }
.search-hero-query { color: #fde68a; font-weight: 600; margin-left: 4px; }

.search-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
}
@media (max-width: 900px) {
    .search-layout { grid-template-columns: 1fr; }
    .search-sidebar { order: -1; }
}
.search-main { min-width: 0; }
.search-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 10px;
}
.search-category-strip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.search-category-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    color: #075985;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}
.search-category-chip:hover { background: #dbeafe; }
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.search-result-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.search-result-card:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.10);
}
.search-result-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.search-result-icon img { width: 40px; height: 40px; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-pub {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.search-result-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.search-result-chip-soft { background: #ecfdf5; color: #047857; }
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}
.search-page-link {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0284c7;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
}
.search-page-link:hover { background: #eff6ff; border-color: #0284c7; }
.search-page-info { font-size: 14px; color: #64748b; font-weight: 600; }
.search-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}
.search-empty-icon { color: #cbd5e1; margin-bottom: 20px; }
.search-empty-icon-sad { color: #fbbf24; }
.search-empty-text { font-size: 16px; color: #475569; margin-bottom: 24px; }
.search-popular { margin-top: 24px; }
.search-popular-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 600;
}
.search-popular-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.search-popular-chip {
    padding: 6px 14px;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
}
.search-popular-chip:hover { background: #e2e8f0; }
.search-sidebar { display: flex; flex-direction: column; gap: 16px; }
.search-side-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}
.search-side-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    font-weight: 700;
    margin: 0 0 14px;
}
.search-side-list { list-style: none; margin: 0; padding: 0; }
.search-side-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}
.search-side-link:hover { background: #f1f5f9; color: #0284c7; }
.search-side-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.search-side-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.search-side-chip {
    padding: 4px 10px;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.15s ease;
}
.search-side-chip:hover { background: #dbeafe; color: #075985; }

/* === Autocomplete dropdown enhancements === */
.autocomplete-empty {
    padding: 16px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}
.autocomplete-cta {
    display: block;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    color: #0284c7;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border-top: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}
.autocomplete-cta:hover, .autocomplete-cta.highlighted { background: #dbeafe; color: #075985; }
.autocomplete-cta-soft { background: #fafbfc; }
.autocomplete-name mark {
    background: #fef9c3;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

/* Universal icon fit - prevents non-square icons from stretching */
img.program-list-icon,
img.program-icon-large,
img.rank-podium-icon,
.featured-icon img,
.popular-icon img,
.recent-icon img,
.float-card-icon img,
.dotd-icon img,
.trending-icon img,
.rank-detail-icon img,
.tool-related-card img,
.alt-card-icon img,
.alternative-card img,
.sidebar-card img,
.sidebar-similar img,
.similar-card img,
.qa-avatar img,
.program-hero-icon img,
.search-result-icon img {
    object-fit: contain;
    object-position: center;
}

/* ==========================================================================
   SEO/GEO fix additions
   ========================================================================== */

/* Author byline link inside prog-article-meta */
.prog-byline-author {
    color: inherit;
    text-decoration: none;
    font-style: italic;
}
.prog-byline-author:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Discontinued note (kompaktowa, pod trust line w hero) */
.prog-hero-disc-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(254, 243, 199, 0.92);
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 8px;
    font-size: 11.5px;
    line-height: 1.35;
    color: #78350f;
}
.prog-hero-disc-chip {
    display: inline-block;
    padding: 2px 7px;
    background: #b45309;
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
    flex-shrink: 0;
}
.prog-hero-disc-note a {
    color: #b45309;
    font-weight: 700;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
}
.prog-hero-disc-note a:hover { text-decoration: underline; }

/* Discontinued chip in sidebar widget */
.prog-widget-disc-chip {
    display: inline-block;
    padding: 3px 9px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
    margin-bottom: 8px;
    align-self: flex-start;
}

/* "New" badge in hero stats row */
.prog-hero-stat--new {
    color: var(--primary);
    font-weight: 600;
}
.prog-hero-stat--new svg {
    stroke: var(--primary);
}

/* Home USP block */
.home-usp {
    background: var(--card-bg);
    border-top: 3px solid var(--primary);
    padding: 48px 0;
}
.home-usp-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
@media (max-width: 768px) {
    .home-usp-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
.home-usp-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.home-usp-item svg {
    stroke: var(--primary);
    flex-shrink: 0;
}
.home-usp-item h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.home-usp-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Ranking methodology box */
.rank-methodology {
    background: var(--card-bg);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.rank-methodology h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}
.rank-methodology p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0 0 8px;
}
.rank-methodology-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 8px !important;
}

/* Category editorial intro */
.cat-intro {
    margin-bottom: 20px;
}
.cat-intro p,
.cat-intro--generic p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    padding: 14px 16px;
    background: var(--card-bg);
    border-left: 3px solid var(--border);
}

/* Feature page intro */
.feat-intro {
    margin-bottom: 20px;
}
.feat-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    padding: 14px 16px;
    background: var(--card-bg);
    border-left: 3px solid var(--primary);
}
