/* Anna App Store — styles
 * Reuses Anna design tokens from navbar.css / dashboard-chat.css.
 */

/* Map the App Store's local token names onto the shared theme tokens
 * defined in navbar.css so they react to dark/light mode. Without this,
 * the bare fallbacks (#fff, #e5e7eb, …) lock the page to light colors. */
:root {
    --surface: var(--surface-color, #fff);
    --surface-alt: var(--hover-bg, #f3f4f6);
    --border: var(--border-color, #e5e7eb);
}

.apps-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    color: var(--text-primary, #1f2328);
}

.apps-hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 36px 32px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(236,72,153,0.08));
    margin-bottom: 28px;
}

.hero-content { display: flex; flex-direction: column; gap: 8px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--surface-alt, rgba(255,255,255,0.6));
    width: fit-content; font-size: 12px; font-weight: 600;
    color: var(--text-secondary, #6b7280);
}
.hero-title { font-size: 28px; font-weight: 700; margin: 0; }
.hero-subtitle { color: var(--text-secondary, #6b7280); margin: 0; max-width: 720px; }
.hero-search { width: 100%; max-width: 520px; }
.search-wrapper {
    position: relative; display: flex; align-items: center;
    background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px; padding: 0 12px; height: 44px;
}
.search-icon { width: 18px; height: 18px; color: var(--text-secondary, #6b7280); }
.search-input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 14px; padding: 0 12px; color: inherit;
}
.search-clear-btn {
    background: none; border: none; cursor: pointer; color: var(--text-secondary, #6b7280);
    padding: 4px;
}
.search-clear-btn svg { width: 16px; height: 16px; }
.hidden { display: none !important; }

.apps-categories {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 28px;
}
.cat-pill {
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--surface, #fff); cursor: pointer;
    font-size: 13px; color: var(--text-primary, #1f2328);
    transition: all .15s;
}
.cat-pill:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }
.cat-pill.active {
    background: var(--accent, #6366f1); color: #fff; border-color: var(--accent, #6366f1);
}

.apps-section { margin-bottom: 36px; }

/* Review queue (App reviewers only) */
.review-queue-hint {
    margin: -4px 0 14px;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}
.review-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
}
.section-header {
    display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; margin: 0; }
.section-count { font-size: 13px; color: var(--text-secondary, #6b7280); }

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

.app-card {
    display: flex; flex-direction: column; justify-content: space-between;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px; padding: 18px; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border-color: var(--accent, #6366f1);
}

.card-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.card-logo {
    width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
    background: var(--surface-alt, #f3f4f6);
}
.card-title-block { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.card-tagline {
    font-size: 13px; color: var(--text-secondary, #6b7280);
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary, #6b7280); }
.meta-item { display: inline-flex; align-items: center; }
.meta-rating { color: #f59e0b; font-weight: 600; }
.btn-install {
    margin-left: auto;
    background: var(--accent, #6366f1); color: #fff;
    border: none; border-radius: 8px; padding: 6px 12px; font-size: 12px;
    font-weight: 600; cursor: pointer;
}
.btn-install:hover { filter: brightness(1.05); }
.btn-install:disabled { opacity: 0.6; cursor: progress; }
.btn-install.installed {
    background: var(--success-bg, #ecfdf5); color: var(--success, #059669);
    cursor: default;
}
.btn-install.installed:hover { filter: none; }

.apps-empty, .apps-loading { padding: 32px; text-align: center; color: var(--text-secondary, #6b7280); }
.apps-load-more { display: flex; justify-content: center; margin-top: 20px; }

/* ── App detail modal ──────────────────────────────────────────────── */
.app-modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
}
body.app-modal-open { overflow: hidden; }

.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    opacity: 0;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-modal.open .modal-backdrop { opacity: 1; }
.app-modal.closing .modal-backdrop { opacity: 0; }

.modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: min(88vh, 920px);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 22px;
    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.06),
        0 24px 70px -12px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    display: flex; flex-direction: column;
    /* Entrance state */
    opacity: 0;
    transform: translateY(24px) scale(0.94);
    transition:
        opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-modal.open .modal-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.app-modal.closing .modal-panel {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transition:
        opacity 0.22s ease,
        transform 0.24s ease;
}
@media (prefers-reduced-motion: reduce) {
    .modal-panel, .modal-backdrop { transition: opacity 0.12s linear; transform: none !important; }
}

.modal-close {
    position: absolute; top: 16px; right: 16px; z-index: 5;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary, #1f2328);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, background 0.15s ease;
}
.modal-close:hover { transform: rotate(90deg); background: #fff; }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
    overflow-y: auto;
    padding: 0 28px 36px;
    scroll-behavior: smooth;
}
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-thumb {
    background: var(--border, #e5e7eb); border-radius: 999px;
    border: 3px solid var(--surface, #fff);
}

.modal-loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 80px 0; color: var(--text-secondary, #6b7280); font-size: 14px;
}
.modal-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid var(--border, #e5e7eb);
    border-top-color: var(--accent, #6366f1);
    animation: apps-spin 0.7s linear infinite;
}

/* Staggered reveal of detail sections once the modal content mounts. */
.app-modal.open .detail-section,
.app-modal.open .app-install-progress:not(:empty) {
    animation: detail-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.app-modal.open .detail-section:nth-of-type(1) { animation-delay: 0.06s; }
.app-modal.open .detail-section:nth-of-type(2) { animation-delay: 0.12s; }
.app-modal.open .detail-section:nth-of-type(3) { animation-delay: 0.18s; }
.app-modal.open .detail-section:nth-of-type(4) { animation-delay: 0.24s; }
.app-modal.open .detail-section:nth-of-type(5) { animation-delay: 0.30s; }
@keyframes detail-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .app-modal.open .detail-section { animation: none; }
}

/* Decorative gradient banner behind the header. */
.detail-banner {
    height: 96px; margin: 0 -28px 0;
    background:
        radial-gradient(120% 160% at 12% -40%, rgba(99,102,241,0.30), transparent 60%),
        radial-gradient(120% 160% at 92% -30%, rgba(236,72,153,0.26), transparent 58%),
        linear-gradient(120deg, rgba(99,102,241,0.16), rgba(236,72,153,0.12));
}

.detail-header {
    display: grid; grid-template-columns: auto 1fr auto;
    gap: 18px; align-items: start;
    margin-top: -40px; padding-bottom: 4px;
}
.detail-logo {
    width: 84px; height: 84px; border-radius: 20px; object-fit: cover;
    background: var(--surface, #fff);
    border: 3px solid var(--surface, #fff);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}
.detail-title-block { padding-top: 44px; min-width: 0; }
.detail-name { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }

/* ── Publisher byline (App Store-style "seller" line under the title) ── */
.detail-publisher {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 3px; padding: 0; border: none; background: none; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--accent, #6366f1);
}
.detail-publisher:hover .detail-publisher-name { text-decoration: underline; }
.verified-badge { width: 14px; height: 14px; color: var(--accent, #6366f1); flex-shrink: 0; }

.detail-tagline { margin: 5px 0 0; color: var(--text-secondary, #6b7280); font-size: 13.5px; line-height: 1.5; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.detail-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    background: var(--surface-alt, #f3f4f6);
    color: var(--text-primary, #1f2328);
    border: 1px solid var(--border, #e5e7eb);
}
.detail-chip svg { width: 13px; height: 13px; }
.detail-chip-sub { color: var(--text-secondary, #6b7280); font-weight: 500; }
.detail-chip-rating { color: #d97706; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.22); }
.detail-chip-rating svg { color: #f59e0b; }
.detail-chip-cat { text-transform: capitalize; color: var(--accent, #6366f1); background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.22); }

.detail-actions { padding-top: 48px; }
.detail-actions .btn-primary {
    background: var(--accent, #6366f1); color: #fff;
    border: none; border-radius: 12px;
    padding: 11px 22px; font-weight: 600; font-size: 14px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.detail-actions .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.42); filter: brightness(1.03); }
.detail-actions .btn-primary:active { transform: translateY(0); }
.detail-actions .btn-uninstall {
    background: var(--surface-alt, #f3f4f6); color: var(--text-secondary, #6b7280);
    box-shadow: none; border: 1px solid var(--border, #e5e7eb);
}
.detail-actions .btn-uninstall:hover {
    color: #dc2626; border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.06); box-shadow: none;
}

.detail-screenshots-section {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    background: var(--surface-alt, #f9fafb);
}
.detail-screenshots {
    display: flex; gap: 12px; overflow-x: auto;
    padding: 6px 2px 8px;
    scroll-snap-type: x proximity;
}
.detail-screenshots::-webkit-scrollbar { height: 8px; }
.detail-screenshots::-webkit-scrollbar-thumb {
    background: var(--border, #e5e7eb); border-radius: 999px;
}
.screenshot-thumb {
    position: relative; flex-shrink: 0; padding: 0; margin: 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px; overflow: hidden; cursor: zoom-in;
    background: var(--surface, #fff);
    scroll-snap-align: start;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.screenshot-thumb:hover {
    transform: translateY(-2px);
    border-color: var(--accent, #6366f1);
    box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}
.screenshot-thumb:focus-visible {
    outline: 2px solid var(--accent, #6366f1); outline-offset: 2px;
}
.detail-screenshots .screenshot {
    display: block; width: 220px; height: 140px; object-fit: cover;
}
.screenshot-zoom {
    position: absolute; right: 8px; bottom: 8px;
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(17,24,39,0.55); color: #fff;
    opacity: 0; transition: opacity 0.15s ease;
    pointer-events: none;
}
.screenshot-zoom svg { width: 16px; height: 16px; }
.screenshot-thumb:hover .screenshot-zoom,
.screenshot-thumb:focus-visible .screenshot-zoom { opacity: 1; }

/* Full-screen screenshot lightbox */
.screenshot-lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
    /* Frosted scrim — light in light mode so the page doesn't go black. */
    background: rgba(241, 245, 249, 0.70);
    backdrop-filter: blur(16px) saturate(125%);
    -webkit-backdrop-filter: blur(16px) saturate(125%);
    animation: lightbox-fade 0.18s ease;
}
:root[data-theme="dark"] .screenshot-lightbox {
    background: rgba(8, 11, 20, 0.66);
}
.screenshot-lightbox.hidden { display: none; }
.screenshot-lightbox .lightbox-img {
    max-width: 92vw; max-height: 88vh;
    object-fit: contain; border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(15, 23, 42, 0.08);
    animation: lightbox-zoom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="dark"] .screenshot-lightbox .lightbox-img {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}
.screenshot-lightbox .lightbox-close {
    position: absolute; top: 20px; right: 24px;
    width: 40px; height: 40px; border: none; cursor: pointer;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.08); color: var(--text-primary, #1f2328);
    border: 1px solid rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}
.screenshot-lightbox .lightbox-close:hover { background: rgba(15, 23, 42, 0.16); transform: rotate(90deg); }
:root[data-theme="dark"] .screenshot-lightbox .lightbox-close {
    background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.18);
}
:root[data-theme="dark"] .screenshot-lightbox .lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightbox-zoom { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

.detail-section { margin-top: 24px; }
.detail-section h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; text-transform: uppercase; color: var(--text-secondary, #6b7280); letter-spacing: 0.06em; }

/* ── Rendered Markdown prose (app description) ──────────────────────── */
.md-prose { line-height: 1.68; font-size: 14.5px; color: var(--text-primary, #1f2328); }
.md-prose > *:first-child { margin-top: 0; }
.md-prose > *:last-child { margin-bottom: 0; }
.md-prose p { margin: 0 0 12px; }
.md-prose h1, .md-prose h2, .md-prose h3,
.md-prose h4, .md-prose h5, .md-prose h6 {
    margin: 22px 0 10px; line-height: 1.3; font-weight: 700;
    color: var(--text-primary, #1f2328); text-transform: none; letter-spacing: 0;
}
.md-prose h1 { font-size: 20px; }
.md-prose h2 { font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--border, #e5e7eb); }
.md-prose h3 { font-size: 15px; }
.md-prose h4, .md-prose h5, .md-prose h6 { font-size: 13.5px; color: var(--text-secondary, #6b7280); }
.md-prose ul, .md-prose ol { margin: 0 0 12px; padding-left: 22px; }
.md-prose li { margin: 4px 0; }
.md-prose li::marker { color: var(--accent, #6366f1); }
.md-prose a { color: var(--accent, #6366f1); text-decoration: none; font-weight: 500; border-bottom: 1px solid rgba(99,102,241,0.3); transition: border-color 0.15s ease; }
.md-prose a:hover { border-bottom-color: var(--accent, #6366f1); }
.md-prose strong { font-weight: 700; }
.md-prose del { color: var(--text-secondary, #6b7280); }
.md-prose hr { border: none; border-top: 1px solid var(--border, #e5e7eb); margin: 18px 0; }
.md-prose blockquote {
    margin: 12px 0; padding: 8px 14px;
    border-left: 3px solid var(--accent, #6366f1);
    background: var(--surface-alt, #f3f4f6); border-radius: 0 8px 8px 0;
    color: var(--text-secondary, #4b5563);
}
.md-prose blockquote p { margin: 0; }
.md-prose code.md-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em; padding: 2px 6px; border-radius: 6px;
    background: var(--surface-alt, #f3f4f6); border: 1px solid var(--border, #e5e7eb);
}
.md-prose pre.md-pre {
    margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; overflow-x: auto;
    background: #0f172a; border: 1px solid rgba(148,163,184,0.18);
}
.md-prose pre.md-pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.6; color: #e2e8f0; background: none; border: none; padding: 0;
}
.md-prose img.md-img { max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; }
.md-prose .muted { color: var(--text-secondary, #6b7280); }

.bundled-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bundled-item {
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--surface-alt, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
}
.bundled-main { display: flex; align-items: center; gap: 10px; }
.bundled-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.bundled-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; word-break: break-word; }
.bundled-tag { flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.bundled-tag.req { background: rgba(99,102,241,0.12); color: var(--accent, #6366f1); }
.bundled-tag.opt { background: var(--surface, #fff); color: var(--text-secondary, #6b7280); border: 1px solid var(--border, #e5e7eb); }
.bundled-runtime {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding-left: 26px;
}
.bundled-dist {
    font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
    background: rgba(17,24,39,0.05); border: 1px solid var(--border, #e5e7eb);
    color: var(--text-secondary, #6b7280); text-transform: uppercase; letter-spacing: 0.04em;
}

/* Runtime environments section */
.detail-section-hint { font-size: 12px; color: var(--text-secondary, #6b7280); margin: 0 0 12px; }
.platform-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Publisher card (App Store "Information / Seller" block) ──────── */
.publisher-card {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; border-radius: 14px;
    background: var(--surface-alt, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
}
.publisher-avatar {
    position: relative; flex-shrink: 0;
    width: 48px; height: 48px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(99,102,241,0.85), rgba(236,72,153,0.75));
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}
.publisher-avatar-letter { font-size: 20px; font-weight: 700; color: #fff; }
.publisher-avatar img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.publisher-info { flex: 1; min-width: 160px; }
.publisher-name-row { display: flex; align-items: center; gap: 5px; }
.publisher-name { font-size: 15px; font-weight: 700; color: var(--text-primary, #1f2328); }
.publisher-name-row .verified-badge { width: 16px; height: 16px; }
.publisher-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.publisher-handle { font-size: 12.5px; color: var(--text-secondary, #6b7280); }
.publisher-chip {
    font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
}
.publisher-chip.verified { background: rgba(99,102,241,0.10); color: var(--accent, #6366f1); border: 1px solid rgba(99,102,241,0.22); }
.publisher-chip.first-party { background: rgba(16,185,129,0.10); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.publisher-links { display: flex; flex-wrap: wrap; gap: 8px; }
.publisher-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; text-decoration: none;
    padding: 6px 12px; border-radius: 8px;
    color: var(--accent, #6366f1);
    background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.publisher-link:hover { border-color: var(--accent, #6366f1); box-shadow: 0 2px 8px rgba(99,102,241,0.15); }
.publisher-link svg { width: 14px; height: 14px; }

/* Platform pills — two sizes share the same anatomy */
.platform-badge, .platform-chip {
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: 8px; white-space: nowrap;
    background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
}
.platform-badge { font-size: 12.5px; padding: 6px 12px; }
.platform-chip  { font-size: 11px;   padding: 3px 9px;  gap: 6px; }
.platform-badge .pf-os, .platform-chip .pf-os { font-weight: 600; color: var(--text-primary, #111827); }
.platform-badge .pf-arch, .platform-chip .pf-arch { color: var(--text-secondary, #6b7280); }
.platform-chip .pf-arch { font-size: 10px; }
.pf-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--text-secondary, #9ca3af); }
.pf-dot.darwin  { background: #a1a1aa; }
.pf-dot.linux   { background: #f59e0b; }
.pf-dot.windows { background: #3b82f6; }
.pf-dot.any     { background: #10b981; }
.platform-chip .pf-dot { width: 6px; height: 6px; }

/* In-drawer install progress (hosts the shared install-console panel) */
.app-install-progress { margin: 12px 0 4px; }
.app-install-progress:empty { display: none; }
.app-install-progress .install-console { margin-top: 0; }

/* Pending panel shown while the install POST resolves/wakes the agent. */
.app-install-pending .install-console-header { margin-bottom: 0; }
.install-pending-spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: apps-spin 0.6s linear infinite;
    opacity: 0.8; flex: 0 0 auto;
}
.btn-primary.installing {
    position: relative; opacity: 0.85; cursor: default;
}
.btn-primary.installing::before {
    content: ''; display: inline-block; width: 12px; height: 12px;
    margin-right: 7px; vertical-align: -2px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: apps-spin 0.6s linear infinite;
}
@keyframes apps-spin { to { transform: rotate(360deg); } }

/* Toast (compatible with executa.css pattern) */
.toast {
    position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92); color: #fff;
    padding: 10px 16px; border-radius: 10px; font-size: 13px;
    opacity: 0; pointer-events: none; transition: opacity .2s;
    z-index: 200;
}
.toast.show { opacity: 1; }
.toast.error { background: #dc2626; }
.toast.success { background: #059669; }

@media (max-width: 720px) {
    .apps-hero { padding: 24px 20px; }
    .hero-title { font-size: 22px; }
    .app-modal { padding: 0; align-items: flex-end; }
    .modal-panel {
        width: 100%; max-height: 94vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(40px);
    }
    .app-modal.open .modal-panel { transform: translateY(0); }
    .app-modal.closing .modal-panel { transform: translateY(30px); }
    .modal-body { padding: 0 18px 28px; }
    .detail-banner { margin: 0 -18px; }
    .detail-header { grid-template-columns: auto 1fr; gap: 14px; }
    .detail-logo { width: 72px; height: 72px; }
    .detail-actions { grid-column: 1 / -1; padding-top: 4px; }
    .detail-actions .btn-primary { width: 100%; }
    .publisher-links { width: 100%; }
}
