.generate-hero-row{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: row;
    background: #0F1429;
    padding: 48px 0 38px 0;
    /* min-height: 480px; */
    margin: calc(-1 * var(--notification-height)) -30px 40px 0;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    column-gap: 36px;
}

.generate-hero-title{
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #FFFFFF;
    text-align-last: center;
}

.generate-hero-text{
    font-size: 18px;
    line-height: 1.6;
    color: #7c7c7c;
    text-align-last: left;
}

.generate-hero-left{
    max-width: 480px;
    min-width: 300px;
}

.generate-hero-right{
    min-width: 480px;
    max-width: 480px;
    /* max-width: 560px; */
    width: 100%;
    margin-right: -5px;
}

.generate-subtext{
    font-size: 18px;
    margin: 0 0 48px 0;
    text-align: center;
    line-height: 36px;
}

.generate-wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    /* height: 600px; */
    /* max-height: 600px; */
}

.generate-step1-wrapper{
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.generate-content{
    position: relative;
    background: #f2f4ff;
    padding: 0 8px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    text-align: center;
    height: 670px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.generate-scrollable-content{
    height: calc(770px - 70px - 15px);
    overflow-y: auto;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    overflow-x: clip;
}

.generate-fixed-footer{
    background: #f2f4ff;
    padding: 0 15px;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-radius: 0 0 12px 12px;
    position: absolute; /* Pin to bottom */
    bottom: 0;
    left: 0;
    right: 0;
}

.templates-button-combined{
    background-color: #31edb2;
    border: none;
    border-radius: 14px;
    color: lightseagreen;
    min-width: 100%;
    max-width: 100%;
    padding: 0 0 8px 0;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: none !important;
    transform: none !important;
    outline: none;
}
.templates-button-combined:focus,
.templates-button-combined:focus-visible,
.templates-button-combined:active {
    outline: none !important;
    box-shadow: none !important;
}


.templates-button-combined:hover{
    background-color: #ffba83;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    color: #ff9138;
}

.templates-button-combined::before{
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.templates-button-combined:hover::before{
    opacity: 1;
}

.templates-thumb-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 3 / 1;
}

.templates-thumb-preview {
    border-radius: 14px;
    margin-top: 3px;
    filter: blur(5px);
    min-height: 150px;
}

.templates-thumb-skeleton {
    width: 68.945%;
    height: 100%;
    min-height: 150px;

    border-radius: 14px;
    margin-top: 3px;

    background: linear-gradient(
            90deg,
            #e0e0e0 0%,
            #ffffff 40%,
            #e0e0e0 100%
    );


    background-size: 300% 100%;
    animation: thumbShimmer 0.8s ease-in-out infinite;
}

@keyframes thumbShimmer {
    0% { background-position: -300% 0; }
    100% { background-position: 300% 0; }
}


.templates-default-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
}

.templates-button-header{
    /* margin-top: -5px; */
}
.generate-button{
    width: 100%;
    padding: 10px;
    background-color: #4f46e5;
    color: #fff;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

/* Hover state */
.generate-button:hover:enabled, .generate-skip-icon:hover{
    background-color: #4338ca;
}

/* Disabled state */
.generate-button:disabled{
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-skip-icon{
    position: absolute;
    top: 10px;
    right: 30px;
    z-index: 20;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #4F46E5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.generate-skip-icon span{
    margin-right: 5px;
}

.generate-fixed-skip{
    background: #f2f4ff;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
    border-radius: 12px 12px 0 0;
    position: absolute; /* Pin to top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.generate-policy{
    font-size: 9px;
    font-weight: 600;
    color: #aaa;
    /* margin: -5px 0 -20px 0; */
    margin: 0;
    padding: 0;
}

/* Header */
.generate-content h2{
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #333;
}

/* Textarea base */
/* Default border = pink */
.generate-textarea_brief,
.generate-textarea_audience {
    width: 100%;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    border: 2px solid #FA2F9A;
    transition: border-color 0.25s ease;
}

/* Brief = 2 lines (NO resizing) */
.generate-textarea_brief {
    min-height: 60px;      /* ~2 lines */
    line-height: 1.4;
    resize: none;          /* 🚫 disable resizing */
}

/* Audience = 1 line */
.generate-textarea_audience {
    height: 32px;          /* single-line height */
    resize: none;          /* already correct */
    margin-bottom: 16px;
}

/* When 3+ characters entered → blue */
.generate-textarea_brief.filled,
.generate-textarea_audience.filled {
    border-color: #31EDB2;
}

/* Focus always blue */
.generate-textarea_brief:focus,
.generate-textarea_audience:focus {
    border-color: #31EDB2;
}


.generate-select-box select{
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px !important;
    box-sizing: border-box;
    height: 32px;
    padding: 0 15px;
    border: 1px solid #ccc;
    transition: border-color 0.15s;
}

.generate-slides{
    width: 25%;
    text-indent: 5px;
    padding: 0 15px;
}

.generate-slides-id{
    width: 100%;
}

.generate-slides:focus{
    border-color: #b39ddb;
    outline: none;
}

.generate-select-admin-wrapper{
    display: flex;
    align-items: baseline;
    column-gap: 12px;
}

.generate-format-label{
    display: block;
    font-weight: medium;
    margin-bottom: 0.5rem;
}

.generate-radio-label{
    display: inline-flex;
    align-items: center;
    margin-right: 1.5rem;
}

.generate-radio{
    height: 1rem;
    width: 1rem;
    margin-right: 0.5rem;
}

.generate-radio-text{
    margin-left: 0.5rem;
}

.generate-md-prompt{
    margin-top: 1rem;
}

.generate-md-label{
    display: block;
    font-weight: medium;
    margin-bottom: 0.25rem;
}

.generate-version-number{
    position: fixed;
    bottom: 10px;
    right: 10px;
}

/* Link */
.generate-link{
    display: block;
    margin-top: 20px;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.generate-link:hover{
    text-decoration: underline;
}

.generate-result-container{
    margin: 84px 0 auto 0;
}

.generate-result-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    width: 100%;
}

.generate-result-buttons{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
    width: 100%;
}

.generate-result-button{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(90deg, #10b981, #34d399);
    color: white !important;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.3s ease;
    width: 100%;
    max-width: 300px;
    height: 50px;
}

.generate-result-button:hover{
    background: linear-gradient(90deg, #059669, #2bb981);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    text-decoration: none;
}

.generate-success-icon{
    font-size: 14px;
    font-weight: 600;
}

.generate-copy-button{
    display: inline-block;
    background-color: #6b48ff;
    color: #ffffff !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    transition: background-color 0.2s ease;
    position: absolute;
    bottom: -8px;
    right: 32px !important;
    border: none;
}

.generate-copy-button:hover{
    background-color: #5a3ed6;
}

.generate-powered-text{
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    margin-top: 0;
    margin-bottom: 0;
}

/* Top-right floating reset icon */
.generate-reset-icon{
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border: none;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: #374151;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}

.generate-reset-icon:hover{
    background: #f3f4f6;
    color: #111827;
}

.generate-reset-confirm{
    margin: -24px 30px 16px 30px;
    background: #fff;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
}

.generate-reset-actions{
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.generate-reset-cancel{
    background: #e5e7eb;
    color: #111;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.generate-reset-confirm-button{
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.generate-loader-container{
    position: relative;
    width: 100%;
    height: 100%;
}

.generate-loader-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.generate-loader-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.generate-loader-spinner{
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
}

.generate-head-spinner{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 150px;
    /* height: 140px; */
    margin: 0 auto;
    position: relative;
    transform: translateZ(0); /* iOS GPU fix */
    -webkit-transform: translate3d(0, 0, 0);
}

.generate-loader-text{
    font-size: 20px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 16px;
    text-align: center;
}

.generate-loader-sub{
    margin-top: 20px;
    text-align: center;
    width: 100%;
    font-size: 14px;
}

.generate-loader-sub h4{
    font-size: 14px;
    color: #111827;
    margin-bottom: 10px;
}

.generate-loader-resources{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.generate-loader-scaled{
    transform: scale(0.75);
    transform-origin: top center;
    display: inline-block;
    margin-bottom: -65px;
    width: 800px;
}

.generate-ready-animation{
    width: 200px;
    height: 200px;
    margin-bottom: 24px;
    justify-self: center;
}

.generate-select{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20,40 70,90 120,40' stroke='%232d4456' stroke-width='20' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    color: #2d4456 !important;
    font-family: "Lato", sans-serif !important;
    padding-right: 2rem; /* make space for the arrow */
}

/* customized skeleton for loader resources scaled down */
.generate-loader-scaled .loader-skeleton.skeleton-wrapper{
    display: flex;
    flex-direction: row;
    width: 100%;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.generate-loader-scaled .rlv-left-col-wrapper{
    position: relative;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.generate-loader-scaled:hover{
    cursor: pointer;
    opacity: 0.90;
}

.generate-toggle-wrapper{
    text-align: center;
    margin: 30px 0 10px;
}

.generate-toggle-button{
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4f46e5;
    border: 2px solid #c7d2fe;
    cursor: pointer;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: inline-block;
}

.generate-toggle-button:hover{
    background: linear-gradient(135deg, #dbeafe, #c7d2fe);
    color: #3730a3;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

/* ADD: page header styles */
.generate-form-header{
    text-align: left;
    margin: 48px 0 16px 0;
}

.generate-page-title{
    margin: -28px 0 6px 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
    color: #111827;
}

.generate-page-subtitle{
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ADD: label + field helpers */
.generate-label{
    display: block;
    text-align: left;
    font-weight: 700; /* bold */
    font-size: 0.95rem;
    color: #111827;
    margin: 0 0 8px; /* exact 8px gap to the control below */
}

.generate-field{
    text-align: left;
}

.generate-placeholders{
    display: flex;
    margin: 15px 0;
    flex-direction: column;
}

/* 3 dots animations */
.dot-animate{
    display: inline-block;
    margin-left: 4px;
}

.dot-animate span{
    display: inline-block;
    animation: blink 1.2s infinite;
    font-weight: bold;
    font-size: 1.2rem;
    color: #4f46e5;
}

.dot-animate span:nth-child(2){
    animation-delay: 0.2s;
}

.dot-animate span:nth-child(3){
    animation-delay: 0.4s;
}

@keyframes blink{
    0%{
        opacity: 0;
    }
    20%{
        opacity: 1;
    }
    100%{
        opacity: 0;
    }
}

/* END of 3 dots animations */

/* Personalized Options Panel */
.po-options-panel{
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin: 60px auto 5px auto;
}

.po-option-group{
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #f7f3ff;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.po-option-group h4{
    font-size: 13px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    text-align: left;
    line-height: 1.2;
}

.po-option-group label{
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #444;
    cursor: pointer;
    line-height: 1.2;
}

.po-option-group input[type="radio"],
.po-option-group input[type="checkbox"]{
    width: 12px;
    height: 12px;
    accent-color: #6b48ff;
    cursor: pointer;
    margin: 0;
}

.po-option-group select{
    width: 100%;
    padding: 4px;
    font-size: 12px;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="none" stroke="%23555" stroke-width="2"><path d="M2 3l3 3 3-3"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.po-option-group input[type="range"]{
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    appearance: none;
    cursor: pointer;
    margin: 2px 0;
}

.po-option-group input[type="range"] + span{
    font-size: 12px;
    color: #555;
    margin-top: 1px;
    display: block;
    text-align: center;
}

.po-option-group input[type="text"]{
    width: 100%;
    padding: 4px;
    font-size: 12px;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* Text input focus state */
.po-option-group input[type="text"]:focus{
    outline: none;
    border-color: #6b48ff;
}

/* Ensure no overflow */
.po-options-panel *{
    box-sizing: border-box;
    word-wrap: break-word;
}

.generate-loader-timer{
    margin-bottom: 1rem;
    text-align: center;
}

/* Blur main UI when loader is active */
.blur-content {
    filter: blur(5px);
    pointer-events: none;   /*prevents clicks under loader */
    user-select: none;      /* prevents text selection under blur */
}


.countdown-text{
    font-size: 18px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar-wrapper{
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    width: 200px;
    margin: 0 auto;
}

.progress-bar-track{
    width: 100%;
    height: 100%;
    background: #eee;
}

.progress-bar-fill{
    height: 100%;
    background: #6b48ff;
    transition: width 0.2s linear;
}

.version-number{
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #888;
}

/* Styling for template gallery */

.template-modal-backdrop{
    position: fixed;
    inset: 0;
    /* keep modal clear of alert + navbar; honor safe areas */
    padding: calc(var(--notification-height) + var(--navbar-height)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start; /* sit below bars */
    justify-content: center;
    overflow: auto; /* overlay scroll if card hits max-height */
    z-index: 9999;
}

.template-modal-card{
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(900px, 92vw);
    /* full viewport minus bars & paddings; prevents bottom cutoff */
    max-height: calc(
            100dvh - (var(--notification-height) + var(--navbar-height)) - 32px
            - env(safe-area-inset-bottom, 0px)
    );
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    padding: 20px 20px 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* header/close fixed; grid scrolls */
}

.template-modal-title{
    font-size: 1.5rem;
    margin: 0 0 12px;
    text-align: center;
}

.template-modal-scroll{
    overflow: auto; /* inner scroll area */
    padding-right: 4px; /* room for scrollbar */
}

.template-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    justify-items: center;
}

/* Card + anchored badge */
.template-card{
    position: relative; /* anchor for badge */
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    background: #fff;
}


.template-card.selected{
    border-color: #007bff;
    background: #f0f8ff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}


.template-card:hover{
    /* transform: translateY(-1px); */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}


.template-badge{
    position: absolute;
    top: 6px;
    left: 6px;
    background: #10b981;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .70rem;
    font-weight: 700;
    line-height: 1.6;
    z-index: 2;
}

.template-thumbnail{
    width: 100%;
    height: fit-content;
    object-fit: cover;
    border-radius: 4px;
    filter: blur(5px);
}

.custom-placeholder{
    font-size: 2rem;
    color: #4f46e5;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-name{
    margin: 6px 0 0 0;
    font-size: 0.9rem;
    color: #333;
}

/* Close button stays visible */
.template-modal-close{
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.template-modal-close:hover{
    color: #111827;
}

.template-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    justify-items: center;
    padding: 30px 0;
}


.custom-placeholder{
    font-size: 2rem;
    color: #007bff;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-name{
    margin: 5px 0;
    font-size: 0.9rem;
    color: #333;
}

/* tempalte carousel styling */

/* ==== Template Carousel ==== */
.tmpl-wrapper{
    margin-top: 6px;
}

.tmpl-header{
    text-align: left;
    margin-bottom: 8px;
}

.tmpl-title{
    font-weight: 700;
    font-size: 14px;
    color: #111827;
}

.tmpl-subtitle{
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.tmpl-rail{
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
}

/* default: no scroll container; show full content */
.tmpl-viewport{
    overflow: visible;
}

/* only add horizontal scrolling (and hide scrollbar) when needed */
.tmpl-viewport--scroll{
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}

.tmpl-viewport--scroll::-webkit-scrollbar{
    display: none;
}

/* Chrome */

/* hide nav buttons altogether when not scrollable */
.tmpl-rail[data-scrollable="false"] .tmpl-nav{
    display: none;
}

.tmpl-track{
    display: flex;
    gap: 14px;
    padding: 6px 4px;
}

.tmpl-card{
    width: 168px;
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 4px 4px 0 4px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.tmpl-card:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
    border-color: #d1d5db;
}

.tmpl-card.is-selected{
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

.tmpl-thumb{
    width: 100%;
    /* height: 96px; */
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
}

.tmpl-name{
    margin-top: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmpl-badge{
    position: absolute;
    top: 8px;
    left: 8px;
    background: #10b981;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

.tmpl-nav{
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s ease, transform .15s ease;
}

.tmpl-nav:hover{
    opacity: 1;
    transform: translateY(-1px);
}

.tmpl-nav:disabled{
    opacity: .35;
    cursor: default;
}

.tmpl-nav--left{
    justify-self: start;
}

.tmpl-nav--right{
    justify-self: end;
}

.tmpl-empty{
    font-size: 12px;
    color: #6b7280;
    padding: 6px 0;
}

@keyframes tmpl-shimmer{
    0%{
        background-position: -200% 0;
    }
    100%{
        background-position: 200% 0;
    }
}

/* inline carousel skeleton (no horizontal scroll) */
.tmpl-skeleton{
    display: flex;
    gap: 12px;
    padding: 4px 0;
    overflow: hidden;
}

.tmpl-skel-card{
    width: 208px; /* match card width */
    height: 140px; /* match card height */
    border-radius: 12px;
    border: 1px solid #e6eaf1;
    background: linear-gradient(90deg, #eef1f7 25%, #f5f7fb 37%, #eef1f7 63%);
    background-size: 400% 100%;
    animation: tmplShimmer 1.2s ease-in-out infinite;
    box-sizing: border-box;
}

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

/* Compact app picker */
.app-wrapper{
    margin-top: 6px;
}

.app-rail{
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-rail[data-scrollable="false"] .app-nav{
    display: none;
}

.app-nav{
    width: 28px;
    height: 28px;
    line-height: 28px;
    border: none;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    font-size: 18px;
    opacity: .65;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
}

.app-nav:disabled{
    opacity: .3;
    cursor: default;
}

.app-nav:hover:not(:disabled){
    opacity: 1;
    transform: translateY(-1px);
}

.app-viewport{
    overflow: visible;
}

.app-viewport--scroll{
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-viewport--scroll::-webkit-scrollbar{
    display: none;
}

.app-track{
    display: flex;
    gap: 12px;
    padding: 4px 2px;
    margin-bottom: 8px;
}

.app-card{
    width: 84px;
    height: 84px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid transparent;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.app-card:hover{
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.app-card.is-selected{
    border-color: #6f7cff;
    box-shadow: 0 0 0 4px rgba(111, 124, 255, .12);
}

.app-card.is-disabled{
    opacity: .45;
    filter: grayscale(1);
    cursor: not-allowed;
}

.app-thumb{
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-badge{
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e9eef5;
    color: #5b6b7a;
}

/* show a checkmark on the selected template card (top-right) */
.tmpl-card{
    position: relative;
}

.app-card {
    position: relative;
}

.tmpl-card.is-selected::after,
.app-card.is-selected::after{
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: #4f46e5;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 0, 0, .15);
    pointer-events: none;
    z-index: 2;
}
