:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
}

body {
    background-color: #f8fafc;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.toolistfy-embed {
    overflow: hidden;
    background: #fff;
}

body.toolistfy-embed .tool-header,
body.toolistfy-embed .tool-footer,
body.toolistfy-embed .hero-section,
body.toolistfy-embed #templateSection {
    display: none !important;
}

body.toolistfy-embed #editorSection {
    display: block !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.toolistfy-embed #editorSection > .container-fluid {
    max-width: 1220px;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

body.toolistfy-embed .form-card {
    max-height: 650px;
}

body.toolistfy-embed .preview-viewport {
    max-height: 600px;
}

body.toolistfy-embed .preview-panel {
    top: 0;
}

.tool-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.toolistify-brand {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.toolistify-brand-logo {
    width: 156px;
    height: auto;
    display: block;
}

.tool-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.hero-section {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.template-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.template-card:hover {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}

.template-preview {
    height: 180px;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
}

.template-preview-modern {
    background: linear-gradient(90deg, #1e40af 32%, #fff 32%);
}

.template-preview-modern .tp-sidebar {
    width: 30%;
}

.template-preview-minimal {
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.tp-main {
    flex: 1;
    padding-top: 0.5rem;
}

.tp-line {
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 85%;
}

.template-preview-minimal .tp-line {
    background: #cbd5e1;
}

.tp-line-lg {
    height: 14px;
    width: 60%;
}

.tp-line-sm {
    width: 45%;
    height: 6px;
}

.tp-dark {
    background: #94a3b8 !important;
}

.form-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.form-section {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.repeat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.8125rem;
}

.tag-chip button {
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.preview-panel {
    top: 1rem;
}

.preview-viewport {
    background: #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    overflow: auto;
    max-height: calc(100vh - 200px);
    display: block;
}

#previewScaler {
    width: max-content;
    min-width: min-content;
    margin: 0 auto;
    transition: width 0.15s ease, height 0.15s ease;
}

.preview-pages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    transform-origin: top left;
    transition: transform 0.15s ease;
}

.preview-toolbar {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.col-xl-45 {
    flex: 0 0 auto;
    width: 45%;
}

.col-xl-55 {
    flex: 0 0 auto;
    width: 55%;
}

@media (max-width: 1199px) {
    .col-xl-45, .col-xl-55 {
        width: 100%;
    }

    .form-card {
        max-height: none;
    }

    .preview-viewport {
        max-height: 700px;
    }
}

@media (max-width: 991px) {
    .preview-viewport {
        max-height: 600px;
    }
}

.print-only {
    display: none;
}

