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

:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --primary-bg: #f0eeff;
    --bg: #f8f9fc;
    --surface: #ffffff;
    --text: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    --border: #e0e4e8;
    --border-light: #f0f2f5;
    --success: #00b894;
    --danger: #e17055;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== App Container ===== */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Top Bar ===== */
.kp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 249, 252, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.kp-topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.kp-topbar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.kp-topbar-brand {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.kp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kp-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.kp-btn-marketplace {
    background: var(--primary);
    color: #fff;
}

.kp-btn-marketplace:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.kp-btn-lang {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    padding: 5px 10px;
}

.kp-btn-lang:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Profile button */
.kp-profile-wrap {
    position: relative;
}

.kp-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.kp-profile-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.kp-profile-btn.logged-in {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
}

.kp-profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    z-index: 200;
    overflow: hidden;
    animation: kpDropIn 0.2s ease;
}

.kp-profile-dropdown.show {
    display: block;
}

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

.kp-profile-dropdown .kp-dd-header {
    padding: 16px;
    background: linear-gradient(135deg, #6c5ce7 0%, #8b5cf6 100%);
    color: #fff;
}

.kp-profile-dropdown .kp-dd-header .kp-dd-name {
    font-weight: 700;
    font-size: 14px;
}

.kp-profile-dropdown .kp-dd-header .kp-dd-email {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.kp-profile-dropdown .kp-dd-header .kp-dd-balance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.kp-profile-dropdown .kp-dd-links {
    padding: 8px;
}

.kp-profile-dropdown .kp-dd-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.kp-profile-dropdown .kp-dd-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.kp-profile-dropdown .kp-dd-link i {
    font-size: 16px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.kp-profile-dropdown .kp-dd-link:hover i {
    color: var(--primary);
}

.kp-profile-dropdown .kp-dd-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 12px;
}

.kp-profile-dropdown .kp-dd-link.danger {
    color: var(--danger);
}

.kp-profile-dropdown .kp-dd-link.danger i {
    color: var(--danger);
}

/* Guest state in dropdown */
.kp-dd-guest {
    padding: 20px 16px;
    text-align: center;
}

.kp-dd-guest p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.kp-dd-guest .kp-dd-guest-btns {
    display: flex;
    gap: 8px;
}

.kp-dd-guest .kp-dd-guest-btns a {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.kp-dd-guest .kp-dd-guest-btns .btn-login {
    background: var(--primary);
    color: #fff;
}

.kp-dd-guest .kp-dd-guest-btns .btn-login:hover {
    background: var(--primary-dark);
}

.kp-dd-guest .kp-dd-guest-btns .btn-register {
    background: var(--surface);
    color: var(--primary);
    border: 1.5px solid var(--primary-light);
}

.kp-dd-guest .kp-dd-guest-btns .btn-register:hover {
    background: var(--primary-bg);
}

/* ===== Hero Section ===== */
.kp-hero {
    position: relative;
    text-align: center;
    padding: 36px 16px 28px;
    overflow: hidden;
}

.kp-hero-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.kp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 14px;
}

.kp-hero-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.kp-hero-highlight {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kp-hero-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto 16px;
}

.kp-hero-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.kp-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-bg);
}

.kp-chip i {
    font-size: 12px;
}

.kp-hide-xs { }

/* Legacy header classes (kept for compatibility) */
.app-header { text-align: center; padding: 40px 0 24px; }
.logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.logo-img { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; }
.logo i { font-size: 32px; color: var(--primary); }
.logo h1 { font-size: 28px; font-weight: 700; color: var(--text); }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.header-actions-right { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.marketplace-btn { background: #6c5ce7; color: #fff; padding: 0.4rem 0.8rem; border-radius: 8px; text-decoration: none; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.marketplace-btn:hover { background: var(--primary-dark); }
.lang-toggle { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: inherit; flex-shrink: 0; }

.lang-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.tagline {
    color: var(--text-secondary);
    font-size: 15px;
}

.tagline .mobile-br {
    display: none;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.card-body {
    padding: 20px;
}

.step-badge {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 44px;
}

.btn-icon-inline {
    display: inline;
    background: none;
    border: none;
    cursor: pointer;
    color: #22c55e;
    font-size: 14px;
    padding: 0;
    margin-left: 4px;
    vertical-align: baseline;
    transition: color 0.2s;
}

.btn-icon-inline:hover {
    color: #16a34a;
}

.input-with-icon .btn-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}

.input-with-icon .btn-icon:hover {
    color: var(--text);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.form-hint a {
    color: var(--primary);
    text-decoration: none;
}

.link-small {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 400;
}

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

/* ===== Option Cards ===== */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-grid.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

.option-card {
    cursor: pointer;
    display: block;
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    gap: 4px;
}

.option-content i {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 2px;
    transition: color var(--transition);
}

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

.option-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.option-card input:checked + .option-content {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.option-card input:checked + .option-content i {
    color: var(--primary);
}

.option-card:hover .option-content {
    border-color: var(--primary-light);
}

/* Disabled option cards */
.option-card.disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.4;
}

.option-card.disabled .option-content {
    background: var(--border-light);
    border-color: var(--border);
}

/* Validation warning */
.validation-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #f57f17;
    animation: fadeIn 0.2s ease;
}

.validation-warning i {
    flex-shrink: 0;
}

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

/* ===== GAS Mode ===== */
/* gas-mode-panel styles removed — settings moved to Google Web App Wizard modal */

.gas-option-grid {
    margin-bottom: 10px;
}

.gas-inline-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.gas-auto-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

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

.btn-outline:hover {
    background: var(--primary-bg);
}

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

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===== Generate Section ===== */
.generate-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}

.skill-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.skill-item:hover {
    border-color: var(--primary-light);
}

.skill-item input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

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

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

.skill-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.skill-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.skill-badge-live {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    vertical-align: middle;
    margin-left: 6px;
    letter-spacing: 0.3px;
}

.skill-badge-local {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
    margin-left: 6px;
    letter-spacing: 0.3px;
}

/* ===== Loading ===== */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Result ===== */
.result-content {
    border-radius: var(--radius-sm);
    overflow: auto;
}

.result-textarea {
    width: 100%;
    min-height: 300px;
    max-height: 600px;
    background: #1e1e2e;
    color: #cdd6f4;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 20px;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.result-textarea:focus {
    border-color: var(--primary);
}

.signature-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.signature-warning i {
    font-size: 18px;
    flex-shrink: 0;
}

/* ===== Footer ===== */
.app-footer {
    text-align: center;
    padding: 0 0 32px;
    color: var(--text-muted);
    font-size: 13px;
}

.app-footer i {
    color: var(--danger);
}

.footer-bottom {
    padding-top: 16px;
}

/* ===== Vote Card ===== */
.vote-card {
    position: relative;
    margin-top: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fdf2f8, #faf5ff, #eff6ff);
    border: 2px solid #e9d5ff;
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.vote-card:hover {
    border-color: #c084fc;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.1);
}

.vote-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.vote-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vote-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.vote-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.vote-heart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e9d5ff;
    border-radius: 50px;
    background: white;
    cursor: pointer;
    font-size: 20px;
    color: #d1d5db;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

.vote-heart-btn:hover {
    transform: scale(1.08);
    border-color: #f472b6;
    color: #f472b6;
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.2);
}

.vote-heart-btn:active {
    transform: scale(0.95);
}

.vote-heart-btn.voted {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    border-color: transparent;
    color: white;
    animation: voteHeartPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vote-heart-btn.voted:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
}

.vote-count {
    font-size: 15px;
    font-weight: 700;
}

@keyframes voteHeartPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Vote particles */
.vote-particles {
    position: absolute;
    right: 80px;
    top: 50%;
    pointer-events: none;
}

.vote-particle {
    position: absolute;
    font-size: 18px;
    animation: voteParticleFloat 1.2s ease-out forwards;
    opacity: 0;
}

@keyframes voteParticleFloat {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translate(var(--x), var(--y)) scale(1.2);
    }
    100% {
        transform: translate(var(--x), calc(var(--y) - 30px)) scale(0.5);
        opacity: 0;
    }
}

@media (max-width: 576px) {
    .vote-content {
        flex-direction: column;
        text-align: center;
    }
    .vote-particles {
        right: 50%;
    }
}

/* ===== Footer Stats ===== */
.footer-stats-section {
    max-width: 100%;
    margin: 0 0 8px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
    box-sizing: border-box;
}

.footer-stats-title {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.footer-stats-title i {
    color: var(--primary) !important;
}

.footer-stat-heart {
    color: #ec4899 !important;
}

.footer-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.footer-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-stat-breakdown {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.footer-stat-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-stat-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.footer-stat-bar-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-muted);
    text-align: right;
}

.footer-stat-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.footer-stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.footer-stat-bar-count {
    width: 28px;
    text-align: right;
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
}

@media (max-width: 576px) {
    .footer-stats-section {
        margin: 0;
        padding: 16px;
    }
    .footer-stat-bar-label {
        width: 80px;
        font-size: 11px;
    }
}

.footer-github {
    display: inline-block;
    margin-top: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-github:hover {
    color: var(--primary);
}

.footer-github i {
    color: inherit;
}

/* ===== Custom Confirm Modal ===== */
.kp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 16px;
}

.kp-modal-overlay.show {
    opacity: 1;
}

.kp-modal-overlay.closing {
    opacity: 0;
}

.kp-modal {
    background: white;
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.9) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kp-modal-overlay.show .kp-modal {
    transform: scale(1) translateY(0);
}

.kp-modal-overlay.closing .kp-modal {
    transform: scale(0.95) translateY(5px);
}

.kp-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    background: var(--primary-bg);
    color: var(--primary);
}

.kp-modal-danger .kp-modal-icon {
    background: #fef2f2;
    color: #ef4444;
}

.kp-modal-info .kp-modal-icon {
    background: #eff6ff;
    color: #3b82f6;
}

.kp-modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 24px;
}

.kp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.kp-modal-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 90px;
}

.kp-modal-cancel {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.kp-modal-cancel:hover {
    background: var(--border-light);
    color: var(--text);
}

.kp-modal-confirm {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 92, 252, 0.3);
}

.kp-modal-confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.4);
}

.kp-modal-confirm:active {
    transform: translateY(0);
}

.kp-modal-danger .kp-modal-confirm {
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.kp-modal-danger .kp-modal-confirm:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Dark mode support */
[data-theme="dark"] .kp-modal {
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* btn-magic removed — Google Web App Wizard is now a mode-btn */

/* ===== Wizard Modal ===== */
.wizard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wizard-overlay.active {
    display: flex;
}

.wizard-modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: wizardSlideIn 0.3s ease;
}

@keyframes wizardSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wizard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}

.wizard-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-header h3 i {
    color: var(--primary);
}

.wizard-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wizard-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.wizard-close:hover {
    color: var(--text);
    background: var(--border-light);
}

.wizard-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.wizard-summary {
    padding: 12px 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    border-left: 3px solid var(--primary);
}

.wizard-item {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.wizard-item-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 14px;
    background: var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-item-options {
    display: flex;
    flex-direction: column;
}

.wizard-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all var(--transition);
    border-top: 1px solid var(--border-light);
    font-family: inherit;
}

.wizard-option:first-child {
    border-top: none;
}

.wizard-option:hover {
    background: #fafbfc;
}

.wizard-option.selected {
    background: var(--primary-bg);
}

.wizard-option-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.wizard-option.selected .wizard-option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.wizard-option.selected .wizard-option-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.wizard-option-content {
    flex: 1;
    min-width: 0;
}

.wizard-option-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.wizard-option-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.wizard-option-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wizard-option-badge.recommended {
    background: #e8f5e9;
    color: #2e7d32;
}

.wizard-option-badge.alternative {
    background: #fff3e0;
    color: #e65100;
}

.wizard-option-reason {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

.wizard-error {
    text-align: center;
    padding: 24px;
    color: var(--danger);
}

.wizard-error i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.wizard-error p {
    font-size: 14px;
    margin-bottom: 12px;
}

/* ===== GAS Wizard Sections ===== */
.gas-wiz-autofill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0edff, #e8f5e9);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--primary-bg);
}

.gas-wiz-autofill-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.gas-wiz-autofill-text i {
    font-size: 18px;
    color: var(--primary);
}

.gas-wiz-settings-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-bg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gas-wiz-settings-title i {
    color: var(--primary);
}

.gas-wiz-section {
    margin-bottom: 20px;
}

.gas-wiz-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

.gas-wiz-rules {
    background: var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.gas-wiz-rules .gas-wiz-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.gas-wiz-rules .gas-wiz-label i {
    color: #2e7d32;
}

@media (max-width: 600px) {
    .gas-wiz-autofill {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* ===== Mode Toggle ===== */
.mode-toggle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: left;
}

.mode-btn:hover {
    border-color: var(--primary-light);
}

.mode-btn.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.mode-btn i {
    font-size: 24px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.mode-btn.active i {
    color: var(--primary);
}

.mode-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.mode-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.mode-btn-gas i {
    color: #6c5ce7;
}

.mode-btn-gas.active {
    border-color: #6c5ce7;
    background: linear-gradient(135deg, #f0edff, #e8e4ff);
}

.mode-btn-gas.active i {
    color: #6c5ce7;
}

/* ===== Chat Mode ===== */
.chat-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: chatFadeIn 0.3s ease;
}

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

.chat-bubble.ai {
    align-self: flex-start;
    background: var(--border-light);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai .chat-sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.chat-bubble.system {
    align-self: center;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 13px;
    text-align: center;
    border-radius: 8px;
    max-width: 100%;
}

.chat-typing {
    align-self: flex-start;
    padding: 12px 16px;
    background: var(--border-light);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-typing .dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    min-height: unset;
    padding: 8px 12px;
    font-size: 14px;
}

.chat-input-area .btn {
    padding: 8px 16px;
    align-self: flex-end;
}

.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.chat-quick-reply {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.chat-quick-reply:hover {
    background: var(--primary-bg);
}

/* ===== AI Wizard Mode ===== */
.wizard-step {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.wizard-step.active {
    opacity: 1;
}

.wizard-step.completed {
    opacity: 0.8;
}

.wiz-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--border-light);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.wiz-step-num {
    width: 24px;
    height: 24px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.wizard-step.active .wiz-step-num {
    background: var(--primary);
}

.wizard-step.completed .wiz-step-num {
    background: var(--success);
}

.wiz-step-body {
    padding: 16px;
    display: none;
}

.wizard-step.active .wiz-step-body {
    display: block;
}

.wizard-step.completed .wiz-step-body {
    display: block;
}

.wiz-analysis-card {
    background: var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.wiz-analysis-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wiz-analysis-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.wiz-tech-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.wiz-tech-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 100px;
    flex-shrink: 0;
}

.wiz-tech-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.wiz-tech-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wiz-summary-box {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}

.wiz-step-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .app-header {
        padding: 24px 0 16px;
    }

    .header-top {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .logo h1 {
        font-size: 22px;
    }

    .header-actions-right {
        justify-content: center;
    }

    .marketplace-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    .tagline {
        font-size: 13px;
    }

    .tagline .mobile-br {
        display: inline;
    }

    /* Top bar mobile */
    .kp-topbar-brand {
        font-size: 13px;
    }

    .kp-hide-xs {
        display: none;
    }

    .kp-btn-marketplace {
        padding: 6px 8px;
    }

    .kp-hero {
        padding: 24px 8px 20px;
    }

    .kp-hero-title {
        font-size: 22px;
    }

    .kp-hero-desc {
        font-size: 13px;
    }

    .kp-chip {
        font-size: 11px;
        padding: 3px 10px;
    }

    .mobile-br {
        display: inline;
    }

    .kp-profile-dropdown {
        width: 240px;
        right: -8px;
    }

    .option-grid {
        grid-template-columns: 1fr 1fr;
    }

    .option-grid.three-cols {
        grid-template-columns: 1fr 1fr;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .option-content {
        padding: 10px 8px;
    }

    .option-content i {
        font-size: 20px;
    }

    .mode-toggle {
        grid-template-columns: 1fr;
    }

    .chat-body {
        height: 400px;
    }

    .chat-bubble {
        max-width: 90%;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== GAS Wizard Consult AI Chat ===== */
.gas-wiz-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.gas-wiz-chat-msg {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.gas-wiz-chat-user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.gas-wiz-chat-ai {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.gas-wiz-typing {
    opacity: 0.6;
    animation: gasWizPulse 1s infinite;
}

@keyframes gasWizPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

.gas-wiz-chat-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.gas-wiz-chat-input textarea {
    flex: 1;
    resize: none;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

.gas-wiz-chat-input textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== GAS Wizard Editable Analysis ===== */
.gas-wiz-editable-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gas-wiz-editable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.gas-wiz-editable-item:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.gas-wiz-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gas-wiz-edit-name,
.gas-wiz-edit-model-name {
    font-weight: 600;
    font-size: 14px;
    border: none;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text);
    width: 100%;
}

.gas-wiz-edit-desc,
.gas-wiz-edit-model-fields {
    font-size: 13px;
    color: var(--text-muted);
    border: none;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    width: 100%;
}

.gas-wiz-edit-name:focus,
.gas-wiz-edit-desc:focus,
.gas-wiz-edit-model-name:focus,
.gas-wiz-edit-model-fields:focus {
    outline: none;
    background: var(--bg);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.gas-wiz-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.gas-wiz-priority-select {
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
}

.btn-icon.gas-wiz-delete-btn,
.btn-icon.gas-wiz-delete-model-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 14px;
}

.btn-icon.gas-wiz-delete-btn:hover,
.btn-icon.gas-wiz-delete-model-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.gas-wiz-add-btn {
    margin-top: 8px;
}

@media (max-width: 576px) {
    .gas-wiz-editable-item {
        flex-direction: column;
        align-items: stretch;
    }
    .gas-wiz-item-actions {
        justify-content: flex-end;
    }
}

/* ===== GAS Wizard Template Picker ===== */
.gas-wiz-template-picker {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--primary-bg);
}

.gas-wiz-template-picker .template-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .gas-wiz-template-picker .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.template-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.template-card i {
    font-size: 1.5rem;
    color: var(--primary);
}

.template-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.template-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ===== Description Helper ===== */
.desc-helper-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    align-self: center;
}

.desc-helper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.desc-helper-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.desc-helper-chip:hover {
    background: var(--primary);
    color: white;
}

.desc-helper-chip i {
    font-size: 0.7rem;
}

/* ===== Post-Generate Guide ===== */
.usage-guide {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0eeff 0%, #e8f5e9 100%);
    border-radius: var(--radius);
    border: 1px solid var(--primary-light);
}

.usage-guide-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.usage-guide-steps {
    list-style: none;
    counter-reset: guide-step;
}

.usage-guide-steps li {
    counter-increment: guide-step;
    padding: 8px 0 8px 32px;
    position: relative;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
}

.usage-guide-steps li::before {
    content: counter(guide-step);
    position: absolute;
    left: 0;
    top: 8px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.usage-guide-steps li code {
    background: rgba(108, 92, 231, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-dark);
}

.usage-guide-steps li + li {
    border-top: 1px solid rgba(108, 92, 231, 0.1);
}
