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

:root {
    /* Gemini-style dark theme */
    --bg: #1e1e1e;
    --bg-elevated: #2d2d2d;
    --bg-surface: #252525;
    --primary: #8ab4f8;
    --primary-dark: #7aa3e8;
    --primary-light: #a8c7fa;
    --secondary: #b48bf8;
    --success: #81c995;
    --warning: #f5c542;
    --danger: #f28b82;
    --text: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #5f6368;
    --border: #3c4043;
    --border-subtle: #2d2d2d;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 2px 6px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 16px 48px rgb(0 0 0 / 0.5);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Layout */
.layout {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Ad Spaces - fixed skyscraper size, behind content */
.ad-space {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    z-index: 0;
}

.ad-link {
    display: block;
    width: 160px;
    max-width: 160px;
    height: 600px;
    max-height: 600px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.ad-link:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(138, 180, 248, 0.2);
}

.ad-image {
    width: 100%;
    height: 100%;
    max-width: 160px;
    max-height: 600px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Mobile Ad - hidden on desktop, lives outside .layout to avoid flex duplication */
.ad-mobile {
    display: none;
}

@media (max-width: 1200px) {
    .layout {
        flex-direction: column;
        align-items: stretch;
    }

    .ad-space {
        display: none !important;
    }

    .ad-mobile {
        display: block;
        width: 100%;
        max-width: 100vw;
        max-height: 120px;
        margin: 0 auto 20px;
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
        z-index: 0;
    }

    .ad-mobile-link {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: 120px;
        border-radius: var(--radius);
        overflow: hidden;
        border: 1px solid var(--border);
        transition: var(--transition);
        box-sizing: border-box;
    }

    .ad-mobile-link:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(138, 180, 248, 0.2);
    }

    .ad-mobile-image {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: 120px;
        height: auto;
        vertical-align: top;
        object-fit: contain;
        object-position: top center;
    }
}

/* Main Content - above ads in stacking order */
.main-content {
    flex: 1;
    max-width: 900px;
    min-width: 0;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Quote Container */
.quote-container {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Sections */
.section {
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
}

.section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.2rem;
}

.optional {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
    min-width: 140px;
}

.form-row .form-group-full {
    flex: 1 1 100%;
    min-width: 0;
}

/* Same width as one form-group in a 4-column form-row (e.g. Quote #) */
.form-row .form-group-same-width {
    flex: 0 0 auto;
    width: calc((100% - 48px) / 4);
    min-width: 140px;
}

.quote-details-section .form-row:not(:first-child) {
    margin-top: 24px;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* Pill toggle (checkbox styled as pill) */
.pill-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    user-select: none;
}

.pill-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pill-toggle-pill {
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pill-toggle-pill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.2s ease, background 0.2s ease;
}

.pill-toggle-input:checked + .pill-toggle-pill {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.pill-toggle-input:checked + .pill-toggle-pill::after {
    transform: translateX(22px);
    background: #1e1e1e;
}

.pill-toggle-input:focus-visible + .pill-toggle-pill {
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.4);
}

.pill-toggle-label:hover .pill-toggle-pill {
    border-color: var(--text-muted);
}

.pill-toggle-text {
    line-height: 1.3;
}

.checkbox-label {
    font-weight: 500;
}

.checkbox-label .pill-toggle-text {
    font-size: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input, select, textarea {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-surface);
    transition: var(--transition);
}

input:hover, select:hover, textarea:hover {
    border-color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%239aa0a6' d='M7 7l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select optgroup {
    font-weight: 700;
    color: var(--text);
}

select optgroup[label="Most popular"] {
    font-weight: 800;
}

/* Logo upload row */
.logo-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.logo-upload-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.logo-file-input {
    padding: 8px 12px;
    font-size: 0.875rem;
    max-width: 100%;
}

.logo-file-input::file-selector-button {
    padding: 6px 12px;
    margin-right: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
}

.logo-clear-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.logo-upload-preview {
    margin-top: 10px;
    padding: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Items Section */
.items-header {
    display: grid;
    grid-template-columns: 1fr 80px 120px 120px 50px;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 120px 50px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
    border: 1px solid transparent;
}

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

.item-row:hover {
    background: var(--bg);
    border-color: var(--border);
}

.item-row input {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.item-row .item-total {
    font-weight: 600;
    color: var(--text);
    text-align: right;
    padding-right: 8px;
}

.delete-item-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.delete-item-btn:hover {
    background: var(--danger);
    color: var(--white);
}

.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(138, 180, 248, 0.08);
}

/* Responsive Items */
@media (max-width: 700px) {
    .items-header {
        display: none;
    }

    .item-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .item-row input {
        width: 100%;
    }

    .item-row::before {
        content: attr(data-label);
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-transform: uppercase;
    }
}

/* Totals Section */
.totals-section {
    background: var(--bg-surface);
}

.totals-container {
    max-width: 350px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.total-row span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tax-row input, .discount-row input {
    width: 60px;
    padding: 6px 8px;
    font-size: 0.85rem;
    text-align: center;
}

.shipping-row input {
    width: 80px;
    padding: 6px 8px;
    font-size: 0.85rem;
    text-align: right;
}

.tax-on-shipping-row {
    padding: 8px 0 !important;
}

.tax-on-shipping-label {
    font-weight: 400;
    color: var(--text-secondary);
}

.tax-on-shipping-label .pill-toggle-text {
    font-size: 0.9rem;
}

.grand-total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.grand-total span:last-child {
    color: var(--primary);
}

/* Actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 28px 32px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #1e1e1e;
    box-shadow: 0 2px 8px rgba(138, 180, 248, 0.3);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138, 180, 248, 0.4);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg);
}

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

.btn-outline:hover {
    background: rgba(138, 180, 248, 0.15);
    color: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--danger);
    background: rgba(242, 139, 130, 0.15);
}

/* Footer */
/* Support / Buy me a coffee */
.support-section {
    text-align: center;
    padding: 28px 24px;
    margin-top: 24px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.support-inner {
    max-width: 360px;
    margin: 0 auto;
}

.support-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 14px 0;
}

.btn-support {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ffdd00 0%, #f5b700 100%);
    color: #1a1a1a;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-support:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 183, 0, 0.4);
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* Quote Preview */
.quote-preview {
    padding: 40px;
    background: var(--bg-surface);
    border-radius: var(--radius);
}

.quote-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary);
}

.quote-preview-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.quote-preview-business {
    text-align: right;
}

.quote-preview-business h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 4px;
}

.quote-preview-business p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.quote-preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.quote-preview-client h4,
.quote-preview-details h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.quote-preview-client p,
.quote-preview-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.quote-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.quote-preview-table th {
    background: var(--bg);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.quote-preview-table th:last-child,
.quote-preview-table td:last-child {
    text-align: right;
}

.quote-preview-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.quote-preview-totals {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.quote-preview-totals-table {
    width: 280px;
}

.quote-preview-totals-table .row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.quote-preview-totals-table .row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.quote-preview-totals-table .row.total span:last-child {
    color: var(--primary);
}

.quote-preview-notes {
    background: var(--bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
    border: 1px solid var(--border);
}

.quote-preview-notes h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.quote-preview-notes p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    white-space: pre-wrap;
}

/* Print Styles - keep quote content light for printing */
@media print {
    body {
        background: white !important;
    }

    .layout {
        display: block;
        padding: 0;
    }

    .ad-space, .header, .footer, .modal-close, .modal-actions {
        display: none !important;
    }

    .quote-container, .actions {
        display: none;
    }

    .modal {
        display: block !important;
        position: static;
        background: none !important;
    }

    .modal-content {
        box-shadow: none;
        max-height: none;
        background: white !important;
        border: none !important;
    }

    .quote-preview {
        padding: 0;
        background: white !important;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        padding: 20px 16px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .section {
        padding: 20px 16px;
    }

    .actions {
        padding: 20px 16px;
    }

    .btn {
        flex: 1;
        min-width: 140px;
    }

    .quote-preview {
        padding: 20px;
    }

    .quote-preview-header {
        flex-direction: column;
        gap: 20px;
    }

    .quote-preview-business {
        text-align: left;
    }

    .quote-preview-meta {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Template Modal */
.template-modal-content {
    max-width: 700px;
    padding: 40px;
}

.template-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
    text-align: center;
}

.template-modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 30px 0;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 500px) {
    .template-grid {
        grid-template-columns: 1fr;
    }
}

.template-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-surface);
}

.template-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-card.selected {
    border-color: var(--primary);
    background: rgba(138, 180, 248, 0.1);
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

.template-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 12px 0 4px 0;
}

.template-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Template Preview Thumbnails */
.template-preview {
    height: 120px;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.tp-header {
    padding: 12px;
}

.tp-bar {
    height: 4px;
    width: 60%;
    border-radius: 2px;
}

.tp-title {
    height: 8px;
    width: 40%;
    border-radius: 2px;
    margin: 0 auto;
}

.tp-content {
    padding: 0 12px 12px 12px;
}

.tp-line {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 6px;
}

.tp-line.short {
    width: 50%;
}

.tp-line.thin {
    height: 3px;
    background: var(--text-muted);
}

.tp-table {
    height: 30px;
    background: var(--bg-surface);
    border-radius: 4px;
    margin: 10px 0;
}

.tp-table.bordered {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.tp-table.minimal {
    background: transparent;
    border-top: 2px solid var(--text);
    border-radius: 0;
}

.tp-total {
    height: 16px;
    width: 60%;
    margin-left: auto;
    border-radius: 4px;
}

.tp-total.minimal {
    background: transparent;
    border-top: 2px solid var(--text);
    height: 8px;
    border-radius: 0;
}

/* Template Bold Preview */
.template-bold .tp-header {
    padding: 15px 12px;
}

/* Template Modal Actions */
.template-modal-actions {
    display: flex;
    justify-content: center;
}

.btn-lg {
    padding: 14px 48px;
    font-size: 1rem;
}

/* SEO Content Section */
.seo-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    margin-top: 24px;
    border: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px 0;
}

.seo-content h2:not(:first-child) {
    margin-top: 32px;
}

.seo-content > p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Supported currencies list: indexable for SEO, subtle on page */
.seo-currencies {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.seo-currencies h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.seo-currencies p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* More free tools */
.more-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.more-tools-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.more-tools-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.more-tools-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.more-tools-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.more-tools-url {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.feature {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    counter-reset: step;
}

.steps-list li {
    position: relative;
    padding: 12px 0 12px 50px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-secondary);
    counter-increment: step;
}

.steps-list li:last-child {
    border-bottom: none;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #1e1e1e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.steps-list li strong {
    color: var(--text);
}

.use-cases {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.use-cases li {
    background: var(--bg-surface);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.use-cases li strong {
    color: var(--text);
}

/* Enhanced Footer */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-secondary);
}

.footer-content {
    max-width: 400px;
    margin: 0 auto;
}

.footer-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.footer-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 600px) {
    .seo-content {
        padding: 24px 16px;
    }

    .seo-content h2 {
        font-size: 1.25rem;
    }

    .steps-list li {
        padding-left: 44px;
    }

    .steps-list li::before {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}
