/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a1a;
    background: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    padding: 48px 0 24px;
    border-bottom: 1px solid #e5e7eb;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #111;
}

.site-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.filter-bar .container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.filter-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ── Tier Sections ────────────────────────────────────────── */
.tier-section {
    padding: 40px 0 16px;
}

.tier-header {
    margin-bottom: 24px;
}

.tier-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.tier-desc {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.tier-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tier-dot--free { background: #22c55e; }
.tier-dot--api { background: #f59e0b; }
.tier-dot--pro { background: #8b5cf6; }

/* ── App Grid ─────────────────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ── App Card ─────────────────────────────────────────────── */
.app-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.15s ease;
}

.app-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.app-card-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    text-transform: lowercase;
}

.app-icon--tikscribe { background: #2563eb; }
.app-icon--cleandictate { background: #059669; }
.app-icon--prattle { background: #7c3aed; }

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

.app-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.app-tagline {
    font-size: 14px;
    color: #4b5563;
    margin-top: 2px;
    line-height: 1.4;
}

/* ── Card Body ────────────────────────────────────────────── */
.app-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.app-platforms {
    display: flex;
    gap: 6px;
}

.platform-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.platform-badge--android {
    background: #dcfce7;
    color: #166534;
}

.platform-badge--windows {
    background: #dbeafe;
    color: #1e40af;
}

.platform-badge--ios {
    background: #f3e8ff;
    color: #6b21a8;
}

.app-version {
    font-size: 13px;
    color: #9ca3af;
}

.api-indicator {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.app-ready-label {
    font-size: 13px;
    color: #16a34a;
    font-weight: 500;
}

/* ── Card Actions ─────────────────────────────────────────── */
.app-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
}

.btn--primary {
    background: #1a1a1a;
    color: #fff;
}

.btn--primary:hover {
    background: #333;
}

.btn--outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn--outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ── Coming Soon Box ──────────────────────────────────────── */
.coming-soon-box {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 32px;
    text-align: center;
}

.coming-soon-text {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.coming-soon-sub {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Platform Note ────────────────────────────────────────── */
.platform-note {
    padding: 32px 0;
    text-align: center;
}

.platform-note p {
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
}

/* ── Setup Guide Modal ────────────────────────────────────── */
.guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.guide-overlay.hidden {
    display: none;
}

.guide-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.guide-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.guide-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
    line-height: 1;
}

.guide-close:hover {
    color: #111;
}

.guide-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.guide-step {
    display: none;
}

.guide-step.active {
    display: block;
}

.guide-step h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.guide-step p {
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 12px;
}

.guide-step ol, .guide-step ul {
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
    padding-left: 20px;
    margin-bottom: 12px;
}

.guide-step li {
    margin-bottom: 8px;
}

.guide-step a {
    color: #2563eb;
    text-decoration: underline;
}

.guide-step a:hover {
    color: #1d4ed8;
}

.guide-step .option-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.guide-step .option-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.guide-step .option-card p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
}

.guide-step .pro-tag {
    color: #16a34a;
    font-weight: 600;
    font-size: 12px;
}

.guide-step .con-tag {
    color: #dc2626;
    font-weight: 600;
    font-size: 12px;
}

.guide-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.guide-progress {
    font-size: 13px;
    color: #9ca3af;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}

.site-footer p {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

/* ── TicketDeck Bug Widget ────────────────────────────────── */
#bug-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transition: all 0.2s;
    z-index: 200;
}

#bug-fab:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.bug-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: bugSlideUp 0.2s ease-out;
}

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

.bug-panel.hidden { display: none; }

.bug-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.bug-panel-header h3 {
    font-size: 1rem;
    color: #111;
    font-weight: 600;
}

.bug-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.bug-close:hover { color: #111; }

#bug-form input,
#bug-form textarea,
#bug-form select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #1a1a1a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

#bug-form input:focus,
#bug-form textarea:focus,
#bug-form select:focus {
    border-color: #dc2626;
}

#bug-form input::placeholder,
#bug-form textarea::placeholder {
    color: #9ca3af;
}

.bug-row { display: flex; gap: 8px; }
.bug-row select { flex: 1; }

.bug-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    background: transparent;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bug-attach-btn:hover {
    border-color: #dc2626;
    color: #374151;
}

.bug-file-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.bug-file-previews:empty { display: none; }

.bug-file-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.bug-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bug-file-preview .remove-bug-file {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.bug-upload-area { margin-bottom: 8px; }

.bug-submit {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #dc2626;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.bug-submit:hover { background: #b91c1c; }
.bug-submit:disabled { background: #d1d5db; cursor: not-allowed; }

.bug-status-msg {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 10px;
    padding: 8px;
    border-radius: 8px;
}

.bug-status-msg.hidden { display: none; }
.bug-status-msg.success { color: #16a34a; background: rgba(22, 163, 74, 0.08); }
.bug-status-msg.error { color: #dc2626; background: rgba(220, 38, 38, 0.08); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-header { padding: 32px 0 16px; }
    .site-title { font-size: 24px; }
    .app-grid { grid-template-columns: 1fr; }
    .filter-bar .container { gap: 6px; }
    .filter-btn { padding: 6px 12px; font-size: 13px; }
    .guide-modal { max-height: 90vh; }
}
