/* ============================================
   ELDAR TATTOO — Generator Page Styles
   ============================================ */

/* Page Header */
.page-header {
    padding: 150px 0 60px;
    text-align: center;
    background: linear-gradient(to bottom, #001a1a 0%, var(--bg-color) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.page-header--compact {
    padding-bottom: 30px;
}

.generator-title {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 2px;
}

.generator-subtitle {
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Generator Layout */
.generator-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 40px;
    align-items: start;
}

.cyrillic-warning {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

/* WORKSPACE PANEL (Sticky) */
.workspace-panel {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CONTROLS (Top Bar) */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: end;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.val-display {
    color: var(--accent-light);
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
    margin-top: 5px;
}

.btn-group-toggle {
    display: flex;
    gap: 5px;
    height: 42px;
}

.btn-toggle {
    flex: 1;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: var(--transition);
}

.btn-toggle.active {
    background: rgba(0, 128, 128, 0.2);
    border-color: var(--accent);
    color: var(--accent-light);
    font-weight: 600;
}

.actions-row {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.actions-row .btn {
    padding: 6px 14px;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.btn-download {
    flex: 3;
}

.btn-svg {
    flex: 2;
    font-size: 0.7rem;
}

.btn-print {
    flex: 1;
}

/* CANVAS AREA */
.canvas-wrapper {
    flex-grow: 1;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
    min-height: 250px;
}

.canvas-wrapper.bg-transparent {
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #fff;
}

.canvas-wrapper.bg-black {
    background-color: #111;
}

.canvas-wrapper.bg-skin {
    background-color: #E5C3A6;
}

#svgResult {
    width: 100%;
    height: 100%;
    max-height: 800px;
}

/* LIBRARY PANEL (Scrollable) */
.library-panel {
    padding-right: 10px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.font-grid::-webkit-scrollbar {
    width: 6px;
}
.font-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.font-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.font-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.font-category-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding-bottom: 15px;
    flex-shrink: 0;
    z-index: 10;
}

.btn-filter {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.btn-filter.active,
.btn-filter:hover {
    border-color: var(--accent);
    color: #fff;
    background: rgba(0, 128, 128, 0.3);
}

/* Font Cards */
.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    padding-right: 10px;
}

.font-card {
    background: #ffffff !important;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 20px 10px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.font-card:hover {
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(0, 128, 128, 0.4);
    transform: translateY(-2px);
}

.font-card.active {
    border: 2px solid #00E5FF;
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25), 0 5px 20px rgba(0, 229, 255, 0.4);
    transform: translateY(-2px);
}

/* Checkmark icon on active font card */
.font-card.active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #00E5FF;
    line-height: 1;
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.8);
    pointer-events: none;
    z-index: 6;
}

.font-name-badge {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.65rem;
    color: #888;
    font-family: var(--font-primary);
}

.favorite-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: none;
    border: none;
    color: rgba(128, 128, 128, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    transition: var(--transition);
    outline: none;
}

.favorite-btn:hover {
    color: rgba(128, 128, 128, 0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.cyrillic-card-warning {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
    background: #ffcc00;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
    cursor: help;
}

.font-card-preview {
    width: 100%;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
    color: #000000 !important;
}

/* ============================================
   SKELETON LOADING FOR FONT CARDS
   ============================================ */
.font-card-loading {
    overflow: hidden;
}

.font-card-loading .font-card-preview {
    visibility: hidden;
}

.font-card-loading::after {
    content: '';
    position: absolute;
    inset: 10px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.font-card-loading .font-name-badge {
    opacity: 0.3;
}

/* ============================================
   CANVAS NAVIGATION ARROWS
   ============================================ */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.nav-arrow:hover {
    background: var(--accent);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.left-arrow {
    left: 15px;
}

.right-arrow {
    right: 15px;
}

#hiddenCanvas {
    display: none;
}

/* ============================================
   CANVAS BOTTOM FONT INFO BAR
   ============================================ */
.canvas-font-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px 16px;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(4px);
    z-index: 11;
    pointer-events: none;
}

#canvasFontName {
    font-weight: 600;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.canvas-font-counter {
    color: rgba(0, 229, 255, 0.75);
    font-size: 0.7rem;
    font-family: var(--font-primary);
    flex-shrink: 0;
}

.mobile-settings-toggle {
    display: none;
    font-weight: 600;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.mobile-settings-toggle:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   FEEDBACK & COMMENTS SECTION
   ============================================ */
.feedback-section {
    margin-top: 60px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.visit-counter {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
}

.pwa-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 25px auto 15px;
    flex-wrap: wrap;
}

.btn-pwa-install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 220px;
    max-width: 280px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}

.btn-pwa-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
    background: linear-gradient(135deg, #2ebd4f, #228e3b);
}

.pwa-admin-clicks {
    background: rgba(255, 202, 40, 0.15);
    border: 1px solid rgba(255, 202, 40, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffca28;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.comments-header {
    margin-bottom: 25px;
    text-align: center;
}

.comments-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 10px auto 0;
    line-height: 1.5;
}

/* Rating Summary Card */
.rating-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.rating-score-box {
    text-align: center;
}

.rating-score-num {
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffc107;
    line-height: 1;
}

.rating-score-stars {
    color: #ffc107;
    font-size: 1.2rem;
    margin: 6px 0;
}

.rating-score-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Rating Star Picker in Form */
.rating-picker-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-picker-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

.rating-picker {
    display: inline-flex;
    gap: 6px;
}

.rating-picker .star {
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
    user-select: none;
}

.rating-picker .star:hover,
.rating-picker .star.hover,
.rating-picker .star.active {
    color: #ffc107;
    transform: scale(1.15);
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
}

/* Comment Box UI */
.comment-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.comment-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.comment-main-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #e91e63);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 1rem;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.comment-avatar.admin-avatar {
    background: linear-gradient(135deg, #ff9800, #f44336);
}

.comment-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.comment-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author {
    color: var(--accent-light);
    font-weight: bold;
    font-size: 0.95rem;
}

.comment-stars {
    color: #ffc107;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.comment-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comment-body {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.82rem;
}

.btn-reply {
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-reply:hover {
    color: var(--accent);
}

.btn-like {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-like:hover, .btn-like.liked {
    border-color: #ff4081;
    color: #ff4081;
    background: rgba(255, 64, 129, 0.12);
}

.comment-reply {
    margin-left: 35px;
    border-left: 2px solid var(--accent);
    padding-left: 15px;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.15);
}

/* Inline Reply Form */
.inline-reply-box {
    margin-top: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent);
    border-radius: 10px;
    animation: fadeIn 0.25s ease;
}

.inline-reply-box textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    min-height: 70px;
    margin-bottom: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
}

.inline-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 14px 22px;
    border-radius: 10px;
    background: #1e1e2d;
    color: #ffffff;
    border-left: 4px solid var(--accent);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    animation: toastSlideIn 0.3s ease forwards;
}

.toast.toast-error {
    border-left-color: #f44336;
}

.toast.toast-success {
    border-left-color: #4caf50;
}

@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-load-more {
    display: block;
    margin: 25px auto 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 10px 28px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    color: var(--accent-light);
}

.add-comment-form {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.add-comment-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 15px;
    border-radius: 6px;
    min-height: 100px;
    margin-bottom: 15px;
    resize: vertical;
    font-family: inherit;
}

.add-comment-form input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-family: inherit;
}

.add-comment-form textarea:focus,
.add-comment-form input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============================================
   UTILITY CLASSES (moved from inline styles)
   ============================================ */
.comment-form-title {
    margin-bottom: 15px;
    color: var(--accent-light);
}

.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cancel-reply-link {
    display: none;
    color: #ff6b6b;
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-submit-comment {
    margin-left: auto;
}

.generator-footer {
    margin-top: 80px;
}

.footer-logo {
    display: block;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-link {
    color: var(--accent);
    font-size: 1.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .generator-container {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 992px) {
    .page-header {
        padding: 120px 0 40px;
    }

    .generator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mobile-settings-toggle {
        display: block;
    }

    .settings-panel {
        display: none;
        margin-bottom: 20px;
    }

    .settings-panel.show {
        display: block;
    }

    .workspace-panel {
        position: sticky;
        top: 70px;
        height: auto;
        max-height: 85vh;
        z-index: 100;
        overflow-y: auto;
        padding: 15px;
        gap: 10px;
    }

    .controls-grid {
        grid-template-columns: 1fr 1fr;
    }

    .col-span-2 {
        grid-column: span 2;
    }

    .col-span-3 {
        grid-column: span 2;
    }

    .font-category-filters {
        position: relative;
        top: 0;
        padding-bottom: 10px;
    }

    .library-panel {
        height: auto;
        max-height: 60vh;
        display: flex;
        flex-direction: column;
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 15px;
        background: var(--bg-surface);
    }

    .font-grid {
        overflow-y: auto;
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: 1;
    }

    .canvas-wrapper {
        min-height: 200px;
    }

    .font-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* Slider Controls */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-row input[type="range"] {
    flex: 1;
}

.btn-reset {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 0 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

/* Thickness disabled tooltip */
.thickness-tooltip-wrapper {
    position: relative;
}

.thickness-tooltip-overlay {
    position: absolute;
    inset: 0;
    cursor: help;
    z-index: 5;
    border-radius: 4px;
}

/* Custom CSS tooltip on hover for disabled slider */
#thicknessGroup .thickness-tooltip-overlay::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: rgba(30, 30, 40, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

#thicknessGroup .thickness-tooltip-overlay:hover::after {
    opacity: 1;
}

.btn-reset:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}


/* ============================================
   MOBILE FULLSCREEN GENERATOR MODE
   ============================================ */

/* Hide mobile-only elements on desktop */
.mobile-enter-btn,
.mobile-generator-actions,
.mobile-fab,
.mobile-fab-download-wrap,
.mobile-fab-menu,
.mobile-control-sheet,
.mobile-tool-hud,
.mobile-ui-overlay-top,
.mobile-ui-overlay-bottom {
    display: none;
}

@media (max-width: 992px) {

    /* --- Mobile Generator Actions --- */
    .mobile-generator-actions {
        display: flex;
        gap: 12px;
        margin-bottom: 15px;
        width: 100%;
    }

    /* --- Mobile Enter Button --- */
    .mobile-enter-btn,
    .mobile-settings-toggle {
        display: block;
        flex: 1;
        padding: 14px;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        text-align: center;
        letter-spacing: 0.5px;
        transition: var(--transition);
    }

    .mobile-enter-btn {
        background: var(--accent);
        color: #fff;
        border: none;
    }

    .mobile-enter-btn:hover {
        background: var(--accent-light);
    }

    /* --- Fullscreen Mode (activated by JS) --- */
    .generator-container.generator-fullscreen {
        position: fixed !important;
        inset: 0;
        z-index: 9999;
        width: 100vw;
        height: var(--visual-height, 100dvh); /* Institutional fix */
        background: #0b1114;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    /* Hide non-generator elements in fullscreen */
    .generator-fullscreen .mobile-generator-actions,
    .generator-fullscreen .workspace-panel .settings-panel,
    .generator-fullscreen .workspace-panel .actions-row,
    .generator-fullscreen .library-panel {
        display: none !important;
    }

    .generator-fullscreen .workspace-panel {
        position: static;
        width: 100%;
        height: 100%;
        padding: 0;
        background: transparent;
        border: none;
        display: flex;
        flex-direction: column;
        z-index: 1;
    }

    /* --- Canvas Viewport --- */
    .generator-fullscreen .canvas-wrapper {
        position: absolute;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding-bottom: 25vh; /* Offset to center above UI */
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    /* --- Mobile Overlay UI --- */
    .generator-fullscreen .mobile-ui-overlay-top {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        pointer-events: none;
        display: flex;
        flex-direction: column;
        padding-top: max(15px, env(safe-area-inset-top));
    }

    .generator-fullscreen .mobile-ui-overlay-bottom {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        pointer-events: none; /* Let clicks pass to canvas */
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    /* --- Floating Nav Row --- */
    .generator-fullscreen .mobile-floating-nav-row {
        pointer-events: auto;
        display: flex;
        align-items: center;
        padding: 10px 12px;
        gap: 12px;
        position: relative;
        z-index: 50;
    }

    .generator-fullscreen .mobile-tools-scroll {
        flex: 1;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-right: 10px;
    }
    
    .generator-fullscreen .mobile-tools-scroll::-webkit-scrollbar {
        display: none;
    }

    .tool-hud-btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: rgba(20, 31, 37, 0.8);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 20px;
        transition: var(--transition);
    }

    .tool-hud-btn span {
        font-size: 0.85rem;
        font-weight: 500;
    }

    .tool-hud-btn svg {
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .tool-hud-btn.active {
        background: rgba(0, 128, 128, 0.2);
        border-color: var(--accent);
        color: var(--accent-light);
    }

    .tool-hud-btn.active svg {
        opacity: 1;
    }

    /* --- Top Actions (Close, Download) --- */
    .generator-fullscreen .mobile-top-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 12px;
        padding: 0 15px;
        pointer-events: auto;
    }

    .generator-fullscreen .mobile-fab {
        display: flex;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        cursor: pointer;
        transition: opacity 0.25s ease, transform 0.2s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .generator-fullscreen .mobile-fab-close {
        background: rgba(11, 17, 20, 0.85); /* Dark background so it's visible */
        backdrop-filter: blur(4px);
        color: #fff;
    }

    .generator-fullscreen .mobile-fab-download-wrap {
        position: relative;
        display: block;
    }

    .generator-fullscreen .mobile-fab-download {
        background: var(--accent);
        color: #fff;
    }

    .generator-fullscreen .mobile-fab:active {
        transform: scale(0.92);
    }

    /* FAB Dropdown Menu */
    .generator-fullscreen .mobile-fab-menu {
        display: none;
        position: absolute;
        top: 50px;
        right: 0;
        background: rgba(20, 31, 37, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        padding: 6px 0;
        min-width: 180px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
        transform-origin: top right;
        z-index: 1000;
    }

    .generator-fullscreen .mobile-fab-menu.show {
        display: block;
        animation: fadeInUp 0.2s ease;
    }

    .generator-fullscreen .mobile-fab-menu button {
        display: block;
        width: 100%;
        padding: 12px 18px;
        background: none;
        border: none;
        color: #fff;
        font-size: 0.9rem;
        text-align: left;
        cursor: pointer;
        transition: background 0.2s;
    }

    .generator-fullscreen .mobile-fab-menu button:hover,
    .generator-fullscreen .mobile-fab-menu button:active {
        background: rgba(0, 128, 128, 0.2);
    }

    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(8px) scale(0.95); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* --- Bottom Panel --- */
    .generator-fullscreen .mobile-bottom-panel {
        pointer-events: auto;
        position: relative;
        background: linear-gradient(to top, rgba(11, 17, 20, 0.98) 50%, rgba(11, 17, 20, 0.8) 100%);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--glass-border);
        min-height: 120px;
    }

    /* Panels Animation */
    .generator-fullscreen .mobile-font-block {
        padding: 12px 16px;
        padding-bottom: calc(var(--safe-bottom-margin, env(safe-area-inset-bottom, 20px)) + 15px); /* Institutional fix */
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .generator-fullscreen .mobile-control-sheet {
        pointer-events: auto;
        position: relative;
        margin: 0 15px 5px 15px;
        background: linear-gradient(to bottom, rgba(11, 17, 20, 0.98), rgba(11, 17, 20, 0.9));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 15px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(20px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
        display: block;
    }

    .generator-fullscreen .mobile-control-sheet.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Control Sheet inner elements */
    .mcs-label {
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 8px;
        display: flex;
        justify-content: space-between;
    }

    .mcs-label .mcs-value {
        color: var(--accent-light);
        font-weight: 700;
    }

    .mcs-slider-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .mcs-slider-row input[type="range"] {
        flex: 1;
        accent-color: var(--accent);
    }

    .mcs-slider-row .btn-reset {
        height: 28px;
        min-width: 28px;
        font-size: 12px;
        padding: 0 6px;
    }

    .mcs-text-input {
        width: 100%;
        padding: 12px 14px;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        color: #fff;
        font-size: 1rem;
        font-family: var(--font-secondary);
        margin-bottom: 10px;
    }

    .mcs-text-input:focus {
        outline: none;
        border-color: var(--accent);
    }

    .mcs-case-buttons {
        display: flex;
        gap: 6px;
        margin-bottom: 8px;
    }

    .mcs-case-btn {
        flex: 1;
        padding: 8px 6px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.8rem;
        text-transform: uppercase;
        transition: var(--transition);
    }

    .mcs-case-btn.active {
        background: rgba(0, 128, 128, 0.2);
        border-color: var(--accent);
        color: var(--accent-light);
        font-weight: 600;
    }

    /* Line Mode Toggle in Control Sheet */
    .mcs-toggle-row {
        display: flex;
        gap: 6px;
        margin-bottom: 12px;
    }

    .mcs-toggle-btn {
        flex: 1;
        padding: 10px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.85rem;
        transition: var(--transition);
    }

    .mcs-toggle-btn.active {
        background: rgba(0, 128, 128, 0.2);
        border-color: var(--accent);
        color: var(--accent-light);
        font-weight: 600;
    }

    /* Background Select in Control Sheet */
    .mcs-select {
        width: 100%;
        padding: 10px 12px;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--glass-border);
        border-radius: 6px;
        color: #fff;
        font-size: 0.9rem;
        font-family: var(--font-secondary);
    }

    .mcs-select:focus {
        outline: none;
        border-color: var(--accent);
    }

    /* --- Font Carousel --- */
    .mcs-font-categories {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mcs-font-categories::-webkit-scrollbar {
        display: none;
    }

    .mcs-cat-btn {
        flex-shrink: 0;
        padding: 5px 12px;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        border-radius: 16px;
        cursor: pointer;
        font-size: 0.75rem;
        white-space: nowrap;
        transition: var(--transition);
    }

    .mcs-cat-btn.active,
    .mcs-cat-btn:hover {
        border-color: var(--accent);
        color: #fff;
        background: rgba(0, 128, 128, 0.3);
    }

    .mcs-font-carousel {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mcs-font-carousel::-webkit-scrollbar {
        display: none;
    }

    .mcs-font-card {
        flex-shrink: 0;
        width: 140px;
        min-height: 95px;
        background: #fff;
        border: 2px solid transparent;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 12px 8px;
        cursor: pointer;
        position: relative;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .mcs-font-card.active {
        border-color: var(--accent);
        box-shadow: 0 4px 12px rgba(0, 128, 128, 0.4);
    }

    .mcs-font-card-preview {
        font-size: 24px;
        color: #000;
        text-align: center;
        word-break: break-all;
        line-height: 1.2;
    }

    .mcs-font-card-num {
        position: absolute;
        bottom: 5px;
        right: 8px;
        font-size: 0.7rem;
        color: #999;
    }

    .mcs-font-card .favorite-btn {
        position: absolute;
        top: 5px;
        left: 5px;
        font-size: 1.1rem;
    }

    /* --- Focus Mode --- */
    .generator-fullscreen.focus-mode .mobile-control-sheet {
        opacity: 0.2;
    }
}
