/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066CC;
    --primary-dark: #0052A3;
    --primary-light: #3385D6;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --text-primary: #1A1A1A;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --border-color: rgba(102, 126, 234, 0.2);
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    --font-family: 'Lato', Roboto, RobotoDraft, Helvetica, Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-xxs: 0.50rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --shadow-sm: 0 2px 4px rgba(102, 126, 234, 0.1);
    --shadow-md: 0 8px 16px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 15px 30px rgba(102, 126, 234, 0.2);
    --transition-base: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 71px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(239, 246, 255, 0.84) 100%);
    border-bottom: 1px solid rgba(191, 219, 254, 0.85);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    width: 100%;
    transition: transform 0.24s ease, opacity 0.24s ease, visibility 0.24s ease, box-shadow 0.24s ease;
}

body.show-sidebar-controls-header .navbar {
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    min-height: 70px;
}

.logo a {
    font-size: var(--font-size-xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all var(--transition-base);
    gap: var(--spacing-sm);
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo-invoice {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 0.25rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #1E3A8A;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.92);
    padding: 8px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.nav-text-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.55);
    flex-shrink: 0;
}

.nav-pdf-dropdown {
    position: relative;
}

.nav-pdf-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #1E3A8A;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.92);
    padding: 8px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    line-height: 1;
}

.nav-pdf-dropdown:hover .nav-pdf-trigger,
.nav-pdf-dropdown:focus-within .nav-pdf-trigger {
    border-color: #93C5FD;
    background: rgba(219, 234, 254, 0.95);
}

.nav-pdf-caret {
    transition: transform 0.2s ease;
}

.nav-pdf-dropdown:hover .nav-pdf-caret,
.nav-pdf-dropdown:focus-within .nav-pdf-caret {
    transform: rotate(180deg);
}

.nav-pdf-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 188px;
    margin: 0;
    padding: 8px;
    list-style: none;
    border: 1px solid rgba(191, 219, 254, 0.95);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-pdf-dropdown:hover .nav-pdf-menu,
.nav-pdf-dropdown:focus-within .nav-pdf-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-pdf-menu li + li {
    margin-top: 4px;
}

.nav-pdf-menu button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-pdf-menu button:hover {
    background: #eff6ff;
    color: #1e3a8a;
}

.nav-pdf-menu button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

.btn-free-trial {
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.26s ease, box-shadow 0.26s ease, filter 0.26s ease;
    font-family: var(--font-family);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.34);
    letter-spacing: 0.01em;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4), 0 0 0 0 rgba(66, 133, 244, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(66, 133, 244, 0.6), 0 0 0 8px rgba(66, 133, 244, 0);
        transform: scale(1.02);
    }
}


.btn-free-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 22px rgba(30, 64, 175, 0.36);
    filter: brightness(1.03);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 0;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 999px;
    transition: all var(--transition-base);
}

.hamburger:hover {
    background: rgba(219, 234, 254, 0.7);
}

.hamburger.active {
    background: rgba(219, 234, 254, 0.85);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hamburger:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
}

/* Estimate Generator Styles */
.estimate-generator-container {
    min-height: calc(100vh - 71px);
}

.generator-header {
    max-width: none;
    width: 100%;
    margin: 18px 0 var(--spacing-xl);
    text-align: left;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(239, 246, 255, 0.7) 100%);
    border: 1px solid rgba(191, 219, 254, 0.75);
    border-radius: 22px;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.header-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E40AF;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: rgba(219, 234, 254, 0.95);
    border: 1px solid rgba(147, 197, 253, 0.88);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.header-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.6);
}

.generator-header h1 {
    font-size: clamp(2rem, 3.7vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 10px;
    padding-top: 0;
    background: linear-gradient(90deg, #0E1B56 0%, #1D4ED8 58%, #0EA5E9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.generator-header .subtitle {
    color: #334155;
    font-size: var(--font-size-base);
    line-height: 1.7;
    margin: 0 0 14px 0;
    max-width: none;
    white-space: nowrap;
}

.header-rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid rgba(147, 197, 253, 0.88);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.header-rating-stars {
    color: #F59E0B !important;
    letter-spacing: 1px;
    font-size: 0.92rem;
    line-height: 1;
}

.header-rating-score,
.header-rating-count {
    color: #1E3A8A;
    font-size: var(--font-size-xs);
    font-weight: 700;
    line-height: 1;
}

.header-rating-divider {
    color: #64748B;
    font-size: 0.78rem;
    line-height: 1;
}

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

.header-badges > span {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #1E3A8A;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    padding: 7px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.generator-header {
    margin-bottom: var(--spacing-xl);
}

.generator-wrapper {
    display: block;
    max-width: 1400px;
    margin: 0 auto var(--spacing-xxl);
}

.generator-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
}

.editable-estimate-panel {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
}

/* Fixed Right Sidebar */
.fixed-sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
    width: 100%;
    order: -1;
}

.sidebar-controls {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(239, 246, 255, 0.9) 100%);
    border-radius: 14px;
    padding: clamp(7px, 0.9vw, 10px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    position: relative;
    top: 0;
    align-items: stretch;
    border: 1px solid rgba(147, 197, 253, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
    overflow: hidden;
    isolation: isolate;
}

.sidebar-controls.sidebar-controls-nav-fixed {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1200px, calc(100vw - (var(--spacing-md) * 2)));
    z-index: 1100;
    margin: 0;
}

.sidebar-controls .theme-selector,
.sidebar-controls .font-selector,
.sidebar-controls .share-section,
.sidebar-controls .action-buttons {
    height: 100%;
}

.sidebar-controls .action-buttons {
    margin-top: 0;
    align-self: stretch;
}

.sidebar-controls .action-buttons .btn-secondary {
    min-height: 40px;
}

@media (max-width: 1280px) {
    .sidebar-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-controls .action-buttons {
        grid-column: 1 / -1;
    }
}

.sidebar-controls::before,
.sidebar-controls::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.sidebar-controls::before {
    width: 210px;
    height: 210px;
    top: -124px;
    right: -92px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 70%);
}

.sidebar-controls::after {
    width: 180px;
    height: 180px;
    bottom: -108px;
    left: -76px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.16) 0%, rgba(14, 165, 233, 0) 72%);
}

.sidebar-controls > * {
    position: relative;
    z-index: 1;
}

.panel-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.logo-upload {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.logo-preview {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: none;
    align-items: center;
    justify-content: center;
}

.logo-preview[style*="display: flex"],
.logo-preview[style*="display: block"] {
    display: flex !important;
}

.logo-image-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    z-index: 1;
}

.logo-preview img {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}

.logo-preview img:hover {
    opacity: 0.8;
}

.btn-remove-logo {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: all var(--transition-base);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: auto;
    line-height: 1;
}

.btn-remove-logo:hover {
    background: #b91c1c;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-remove-logo svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 2.5;
}

.btn-upload {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-base);
    align-self: flex-start;
}

.btn-upload:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.upload-warning {
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    padding: 8px;
    background-color: #fee2e2;
    border: 1px solid #dc2626;
    border-radius: 4px;
    display: none;
    width: 100%;
    text-align: center;
}

.line-items-container {
    margin-bottom: var(--spacing-md);
}

.line-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    align-items: start;
}

.line-item input,
.line-item select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: var(--font-size-sm);
}

.line-item .item-description {
    grid-column: 1;
}

.line-item .item-quantity {
    grid-column: 2;
}

.line-item .item-rate {
    grid-column: 3;
}

.line-item .item-tax {
    grid-column: 4;
}

.line-item .item-amount {
    grid-column: 5;
    font-weight: 600;
    padding: 8px;
    background: var(--bg-secondary);
    border: none;
}

.btn-remove-item {
    grid-column: 6;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.btn-remove-item:hover {
    background: #dc2626;
}

.btn-add-item {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-add-item:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Preview Panel */
.preview-panel {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.preview-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-right: var(--spacing-md);
}

.logo-upload-inline {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-upload-inline {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.btn-upload-inline:hover {
    background: var(--border-color);
}

.template-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.template-selector label {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.template-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-sm);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.sidebar-controls .theme-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(191, 219, 254, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 255, 0.86) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 5px 12px rgba(30, 64, 175, 0.07);
}

.sidebar-controls .theme-selector label,
.sidebar-controls .font-selector label,
.sidebar-controls .share-section label {
    font-weight: 800;
    font-size: 0.62rem;
    color: #334155;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
}

.theme-colors {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    position: relative;
    z-index: 2;
}

.theme-color-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.88);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
    z-index: 2;
    padding: 0;
    background: none;
    box-shadow: 0 4px 9px rgba(15, 23, 42, 0.12);
    pointer-events: auto;
}

.theme-color-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.18);
}

.theme-color-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px rgba(37, 99, 235, 0.95), 0 12px 22px rgba(30, 64, 175, 0.28);
    transform: scale(1.02);
}

.theme-color-btn.active .checkmark {
    display: block;
}

.theme-color-btn .checkmark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Theme color backgrounds */
.theme-color-btn[data-theme="black"] {
    background-color: #000000;
}

.theme-color-btn[data-theme="grey"] {
    background-color: #6B7280;
}

.theme-color-btn[data-theme="orange"] {
    background-color: #FF6B35;
}

.theme-color-btn[data-theme="blue"] {
    background-color: #2563EB;
}

.theme-color-btn[data-theme="teal"] {
    background-color: #14B8A6;
}

.theme-color-btn[data-theme="red"] {
    background-color: #DC2626;
}

.sidebar-controls .logo-upload-inline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.sidebar-controls .btn-upload-inline {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.sidebar-controls .btn-upload-inline:hover {
    background: var(--border-color);
}

.sidebar-controls .btn-primary,
.sidebar-controls .btn-secondary {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

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

.sidebar-controls .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.sidebar-controls .btn-secondary {
    border: 1px solid rgba(30, 64, 175, 0.18);
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0ea5e9 100%);
    color: #ffffff;
    box-shadow: 0 8px 14px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sidebar-controls .btn-secondary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 52%, #22d3ee 100%);
    border-color: rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.sidebar-controls .btn-secondary:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.65);
    outline-offset: 2px;
}

.sidebar-controls #printBtnDirect svg {
    width: 15px;
    height: 15px;
    margin-right: 4px !important;
}

.sidebar-controls .action-buttons {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: 0;
}

.sidebar-controls .action-buttons .btn-secondary {
    flex: 1;
    width: 100%;
}

.sidebar-controls .action-buttons #printBtnDirect {
    flex: 0 0 auto;
    width: min(220px, 78%);
    margin: 0 auto;
}

/* Share Section */
.sidebar-controls .font-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(191, 219, 254, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 255, 0.86) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 5px 12px rgba(30, 64, 175, 0.07);
}

/* Consolidated label styling above */

.sidebar-controls .font-select {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1px solid rgba(147, 197, 253, 0.75);
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: var(--font-family);
    background-color: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    appearance: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231e3a8a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 13px;
}

.sidebar-controls .font-select:hover {
    border-color: rgba(96, 165, 250, 0.9);
    background-color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(30, 64, 175, 0.1);
}

.sidebar-controls .font-select:focus {
    outline: none;
    border-color: #2563eb;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.sidebar-controls .share-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(191, 219, 254, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 255, 0.86) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 5px 12px rgba(30, 64, 175, 0.07);
}

/* Consolidated label styling above */

.share-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
}

.share-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
    border: 1px solid rgba(191, 219, 254, 0.85);
    background: rgba(255, 255, 255, 0.86);
    color: #475569;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
    border-color: transparent;
}

.share-btn:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.62);
    outline-offset: 2px;
}

.share-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.3s ease;
}

.share-btn:hover svg {
    transform: scale(1.1);
}

.share-whatsapp:hover {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.share-linkedin:hover {
    background: linear-gradient(135deg, #0077B5 0%, #004182 100%);
    color: white;
}

.share-email:hover {
    background: #34A853;
    color: white;
    border-color: #34A853;
}

.share-facebook:hover {
    background: #1877F2;
    color: white;
    border-color: #1877F2;
}

.share-instagram:hover {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
    color: white;
    border-color: #dd2a7b;
}

.share-twitter:hover {
    background: #0F172A;
    color: white;
    border-color: #0F172A;
}

/* PDF Lock Section */
.sidebar-controls .pdf-lock-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.sidebar-controls .pdf-lock-section label {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pdf-lock-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pdf-password-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: var(--font-size-sm);
    background: white;
    color: var(--text-primary);
    transition: all var(--transition-base);
    font-family: var(--font-family);
}

.pdf-password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.pdf-password-input::placeholder {
    color: #adb5bd;
    font-size: var(--font-size-xs);
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: color var(--transition-base);
}

.toggle-password-btn:hover {
    color: var(--primary-color);
}

.toggle-password-btn svg {
    width: 18px;
    height: 18px;
}

.btn-lock-pdf {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-lock-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.btn-lock-pdf:active {
    transform: translateY(0);
}

.btn-lock-pdf svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-lock-pdf:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    color: #0c5460;
    font-size: var(--font-size-xs);
    font-weight: 500;
    margin-top: 4px;
}

.lock-status svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #0c5460;
}

.lock-status span {
    flex: 1;
}

.btn-unlock {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c5460;
    transition: all var(--transition-base);
    border-radius: 4px;
}

.btn-unlock:hover {
    background: rgba(12, 84, 96, 0.1);
    color: #0a4550;
}

.btn-unlock svg {
    width: 14px;
    height: 14px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
}

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

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

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

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

.estimate-preview {
    background: white;
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.estimate-preview.editable {
    padding: var(--spacing-xl);
}

.estimate-template {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.estimate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    min-height: 140px;
}

.header-left {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 300px;
}

.estimate-logo {
    width: 120px;
    height: 120px;
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
    z-index: 1;
}

.estimate-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.editable-logo {
    cursor: pointer;
}

.logo-placeholder {
    width: 100%;
    height: 100%;
    border: 2px dashed #667eea;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    background: var(--bg-secondary);
    transition: all var(--transition-base);
    padding: 8px;
    box-sizing: border-box;
}

.logo-placeholder span {
    display: block;
    line-height: 1.4;
}

.logo-text-main {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.logo-text-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.logo-placeholder:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.estimate-company {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 250px;
    justify-content: flex-start;
    align-items: flex-start;
}

.editable-input {
    width: 100%;
    min-width: 200px;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    padding: 4px 6px;
    margin-bottom: 6px;
    margin-top: 0;
    transition: all var(--transition-base);
    line-height: 1.5;
    text-align: left;
    box-sizing: border-box;
    border-radius: 4px;
}

.editable-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Keep company city/state/contact/email/GSTIN aligned in form panel */
#estimatePreview #companyCity,
#estimatePreview #companyState,
#estimatePreview #companyContact,
#estimatePreview #companyEmail,
#estimatePreview #companyGSTIN {
    font-size: var(--font-size-base);
    height: 42px;
    min-height: 42px;
}

#estimatePreview #companyName::placeholder,
#estimatePreview #companyCity::placeholder,
#estimatePreview #companyContact::placeholder,
#estimatePreview #companyEmail::placeholder,
#estimatePreview #companyGSTIN::placeholder {
    font-size: var(--font-size-sm);
}

.state-code-input {
    display: none !important;
    font-weight: 600;
    color: #1E3A8A;
    background: rgba(239, 246, 255, 0.88);
    border-color: #BFDBFE;
}

.state-code-input[readonly] {
    cursor: default;
}

.state-code-input:focus {
    background: rgba(239, 246, 255, 0.95);
    border-bottom: 1px solid #60A5FA;
}

/* Remove dropdown arrow from city input fields */
.editable-input.company-city,
.editable-input.client-city,
.editable-input.ship-city,
.editable-input.client-contact,
.editable-input.ship-contact,
.editable-input.client-email,
.editable-input.ship-email,
.editable-input.company-contact,
.editable-input.company-email {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none !important;
    background-repeat: no-repeat;
    background-position: unset;
}

.editable-input:hover {
    outline: none;
    border-color: #4285f4;
    background: transparent;
    border-radius: 4px;
}

.editable-input:focus {
    outline: none;
    border-bottom: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    text-align: left;
}

.editable-textarea {
    width: 100%;
    min-width: 200px;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    padding: 4px 6px;
    margin-bottom: 0;
    margin-top: 0;
    resize: vertical;
    transition: all var(--transition-base);
    box-sizing: border-box;
    line-height: 1.6;
    text-align: left;
    border-radius: 4px;
}

.editable-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.editable-select {
    width: 100%;
    min-width: 200px;
    border: 1px solid #E5E7EB;
    background-color: transparent;
    font-family: var(--font-family);
    padding: 4px 6px;
    margin-bottom: 0;
    margin-top: 0;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    box-sizing: border-box;
    font-size: var(--font-size-sm);
    cursor: pointer;
    line-height: 1.5;
    text-align: left;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 20px;
    border-radius: 4px;
}

.editable-select:hover {
    outline: none;
    border-color: #4285f4;
    background-color: transparent;
    border-radius: 4px;
}

.editable-select:focus {
    outline: none;
    border-bottom: 1px solid var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
    padding: 4px 8px;
    padding-right: 20px;
    border-radius: 4px;
    text-align: left;
}

.editable-select option {
    color: var(--text-primary);
    background: white;
    padding: 8px;
}

.editable-textarea:hover {
    outline: none;
    border-color: #4285f4;
    background: transparent;
    border-radius: 4px;
}

.editable-textarea:focus {
    outline: none;
    border-bottom: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    text-align: left;
}

.company-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 0;
    padding: 4px 6px;
    border: 1px solid #E5E7EB;
    background: transparent;
    color: var(--text-primary);
    line-height: 1.4;
    width: 100%;
    text-align: left;
    border-radius: 4px;
    box-sizing: border-box;
}

.company-name::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 400;
}

.company-name:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    padding: 4px 6px;
    border-radius: 4px;
    text-align: left;
}

.company-address,
.client-address {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    min-height: 50px;
    margin-bottom: 6px;
    margin-top: 0;
    padding: 4px 6px;
    line-height: 1.6;
    width: 100%;
    text-align: left;
    resize: vertical;
}

.company-address::placeholder,
.client-address::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.company-state {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 6px;
    margin-top: 0;
    padding: 4px 6px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    transition: all var(--transition-base);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
    border-radius: 4px;
    box-sizing: border-box;
}

.company-state:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
    border-radius: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.company-gstin,
.client-gstin {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: 6px;
    margin-top: 0;
    padding: 4px 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
}

.company-gstin::placeholder,
.client-gstin::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.client-name {
    font-weight: 700;
    font-size: var(--font-size-base);
    margin-bottom: 6px;
    margin-top: 0;
    color: var(--text-primary);
    padding: 4px 6px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
    border: 1px solid #E5E7EB;
    background: transparent;
    border-radius: 4px;
    box-sizing: border-box;
}

.client-name::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 400;
}

.client-name:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    border-radius: 4px;
}

.place-supply,
.client-city,
.ship-city,
.ship-place,
.client-contact,
.ship-contact,
.client-email,
.ship-email,
.company-contact,
.company-email {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-top: 0px;
    margin-bottom: 5px;
    padding: 4px 6px;
    padding-right: 30px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    transition: all var(--transition-base);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    border-radius: 4px;
    box-sizing: border-box;
}

.place-supply:focus,
.ship-place:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
    border-radius: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.inline-input {
    display: inline-block;
    width: auto;
    min-width: 120px;
    margin-left: 0;
    font-size: var(--font-size-sm);
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 400;
}

.date-input {
    min-width: 140px;
    text-align: right;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: var(--font-size-sm);
    justify-content: flex-end;
    width: 100%;
    white-space: nowrap;
}

.meta-item strong {
    color: var(--text-primary);
    font-weight: 600;
    min-width: fit-content;
}

.date-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    pointer-events: none;
    opacity: 0.6;
}

.date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.estimate-title {
    text-align: right;
    margin: 0;
    flex-shrink: 0;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.estimate-title h1 {
    font-size: calc(var(--font-size-4xl, 1.5rem));
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    text-align: right;
    letter-spacing: 2px;
    color: var(--text-primary);
    line-height: 1.1;
    outline: none;
    border: 1px solid #E5E7EB;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-base);
    cursor: text;
    min-height: 1.1em;
}

.estimate-title h1:focus {
    border: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.estimate-title h1:empty:before {
    content: "ESTIMATE";
    color: var(--text-muted);
    opacity: 0.5;
}

.estimate-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    font-size: var(--font-size-sm);
    width: 100%;
}

.estimate-parties {
    margin: var(--spacing-xl) 0;
}

.parties-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: flex-start;
    margin-top: var(--spacing-md);
}

.estimate-bill-to,
.estimate-ship-to {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    width: 100%;
    padding-left: 0;
}

.estimate-bill-to h3,
.estimate-ship-to h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
    color: var(--text-primary);
    line-height: 1.4;
    text-align: left;
}

.ship-to-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
    padding-right: 2px;
}

.ship-to-header h3 {
    margin-bottom: 0;
    flex: 1;
    line-height: 1.1;
    letter-spacing: 0.03em;
}

.ship-to-header .toggle-switch {
    margin-left: 0;
    flex: 0 0 auto;
}

.ship-to-fields {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.ship-to-fields.enabled {
    opacity: 1;
    pointer-events: auto;
}

.ship-to-fields input:disabled,
.ship-to-fields textarea:disabled,
.ship-to-fields select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ship-to-fields.enabled input:disabled,
.ship-to-fields.enabled textarea:disabled,
.ship-to-fields.enabled select:disabled {
    opacity: 1;
    cursor: text;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 58px;
    height: 32px;
    margin-left: 0;
    border-radius: 999px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #dbe4ef 0%, #c6d2e1 100%);
    border: 1px solid #b9c6d8;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.35);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}

.toggle-switch:hover .toggle-slider {
    border-color: #9aaaca;
    box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.4), 0 0 0 2px rgba(148, 163, 184, 0.14);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    border-color: rgba(37, 99, 235, 0.85);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24), 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(26px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.28);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.24);
}

.estimate-bill-to p,
.estimate-ship-to p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 4px;
}

.ship-name,
.ship-address,
.ship-gstin,
.ship-place {
    width: 100%;
}

.ship-name {
    font-weight: 700;
    font-size: var(--font-size-base);
    margin-bottom: 6px;
    margin-top: 0;
    color: var(--text-primary);
    padding: 4px 6px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
}

.ship-name::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 400;
}

.ship-address {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    min-height: 50px;
    margin-bottom: 6px;
    margin-top: 0;
    padding: 4px 6px;
    line-height: 1.6;
    width: 100%;
    text-align: left;
    resize: vertical;
}

.ship-address::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.ship-gstin {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: 6px;
    margin-top: 0;
    padding: 4px 6px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: left;
    line-height: 1.5;
}

.ship-gstin::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    table-layout: fixed;
}

.items-table th {
    background: #000000;
    color: #FFFFFF;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: var(--font-size-sm);
    transition: background-color 0.2s ease;
}

.items-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    vertical-align: top;
}

/* Column Widths (apply to header/body only, not footer rows) */
.items-table thead th:nth-child(1),
.items-table tbody td:nth-child(1) {
    width: 29%;
    /* Description */
}

.items-table thead th:nth-child(2),
.items-table tbody td:nth-child(2) {
    width: 10%;
    /* Quantity */
}

.items-table thead th:nth-child(3),
.items-table tbody td:nth-child(3) {
    width: 11%;
    /* Rate */
}

.items-table thead th:nth-child(4),
.items-table tbody td:nth-child(4) {
    width: 10%;
    /* Discount */
}

.items-table thead th:nth-child(5),
.items-table tbody td:nth-child(5) {
    width: 10%;
    /* Tax % */
}

.items-table thead th:nth-child(6),
.items-table tbody td:nth-child(6) {
    width: 24%;
    /* Amount */
}

.items-table thead th:nth-child(7),
.items-table tbody td:nth-child(7) {
    width: 6%;
    /* Remove button */
}

.editable-table td input,
.editable-table td select {
    width: 100%;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    padding: 10px 8px;
    transition: all var(--transition-base);
    border-radius: 4px;
    box-sizing: border-box;
    min-height: 40px;
}

.editable-table td input:hover,
.editable-table td select:hover {
    outline: none;
    border-color: #4285f4;
    background: transparent;
    border-radius: 4px;
}

.editable-table td input:focus,
.editable-table td select:focus {
    outline: none;
    background: rgba(0, 102, 204, 0.05);
    border-radius: 4px;
}

/* Hide spinner arrows from number inputs */
.editable-table td input[type="number"]::-webkit-inner-spin-button,
.editable-table td input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.editable-table td input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Specific classes for tax, rate, and quantity fields */
.item-quantity::-webkit-inner-spin-button,
.item-quantity::-webkit-outer-spin-button,
.item-rate::-webkit-inner-spin-button,
.item-rate::-webkit-outer-spin-button,
.item-discount::-webkit-inner-spin-button,
.item-discount::-webkit-outer-spin-button,
.item-tax::-webkit-inner-spin-button,
.item-tax::-webkit-outer-spin-button,
.item-tax-sgst::-webkit-inner-spin-button,
.item-tax-sgst::-webkit-outer-spin-button,
.item-tax-cgst::-webkit-inner-spin-button,
.item-tax-cgst::-webkit-outer-spin-button,
.item-tax-utgst::-webkit-inner-spin-button,
.item-tax-utgst::-webkit-outer-spin-button,
.item-tax-igst::-webkit-inner-spin-button,
.item-tax-igst::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.item-quantity,
.item-rate,
.item-discount,
.item-tax,
.item-tax-sgst,
.item-tax-cgst,
.item-tax-utgst,
.item-tax-igst {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Keep tax dropdown arrow clean and right-aligned */
.editable-table td select.item-tax {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
    text-align: left;
}

.editable-table .item-amount {
    font-weight: 600;
    background: var(--bg-secondary) !important;
    text-align: right;
}

.btn-remove-item-inline {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.btn-remove-item-inline:hover {
    background: #dc2626;
}

.amount-in-words-section {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.amount-in-words-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    white-space: nowrap;
}

.amount-in-words-value {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    text-transform: capitalize;
    flex: 1;
}

.btn-add-item-inline {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: var(--spacing-md);
}

.btn-add-item-inline:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-textarea {
    width: 100%;
    border: 1px solid #E5E7EB;
    background: transparent;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    padding: 8px;
    resize: vertical;
    transition: all var(--transition-base);
    line-height: 1.5;
    text-align: left;
    min-height: 40px;
    border-radius: 4px;
    box-sizing: border-box;
}

.footer-textarea:focus {
    outline: none;
    border: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    padding: 8px;
    border-radius: 4px;
}

.footer-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.items-table tfoot td {
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

.items-table .text-right {
    text-align: right;
}

.items-table .roundoff-row td {
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

.items-table .total-row td {
    background: var(--bg-secondary);
    font-size: var(--font-size-lg);
}

/* Editable Subtotal and Total */
#subtotalLabel,
#totalLabel,
#previewSubtotal,
#previewTotal {
    outline: none;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    transition: all var(--transition-base);
    cursor: text;
    display: inline-block;
    min-width: 60px;
    padding: 2px 4px;
}

#previewSubtotal,
#previewTotal,
#previewDiscount,
#previewTax,
#previewSGST,
#previewCGST,
#previewIGST,
#previewUTGST,
#previewRoundOff {
    text-align: right;
    width: 100%;
    display: block;
}

#subtotalLabel:focus,
#totalLabel:focus,
#previewSubtotal:focus,
#previewTotal:focus {
    border: 1px solid var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

#subtotalLabel:empty:before,
#totalLabel:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    opacity: 0.5;
}

#previewSubtotal:empty:before,
#previewTotal:empty:before {
    content: "₹ 0.00";
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl) !important;
    font-style: italic;
}

.estimate-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.estimate-notes,
.estimate-terms,
.estimate-payment-terms,
.estimate-signatory {
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.footer-section-hidden {
    display: none !important;
}

.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--spacing-md);
}

.footer-action-hidden {
    display: none;
}

.footer-action-btn {
    border: 1px solid rgba(30, 64, 175, 0.25);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-action-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: rgba(30, 64, 175, 0.35);
}

.footer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.footer-section-header .footer-heading {
    margin: 0;
    flex: 1;
}

.footer-remove-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(30, 64, 175, 0.28);
    border-radius: 999px;
    background: #fff;
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex: 0 0 24px;
    transition: all 0.2s ease;
}

.footer-remove-btn:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    border-color: rgba(30, 64, 175, 0.45);
}

.estimate-notes:last-child,
.estimate-terms:last-child,
.estimate-payment-terms:last-child,
.estimate-signatory:last-child {
    margin-bottom: 0;
}

.estimate-notes .footer-heading::before,
.estimate-notes .footer-heading::after,
.estimate-terms .footer-heading::before,
.estimate-terms .footer-heading::after,
.estimate-payment-terms .footer-heading::before,
.estimate-payment-terms .footer-heading::after,
.estimate-signatory .footer-heading::before,
.estimate-signatory .footer-heading::after {
    content: none !important;
    display: none !important;
}

.footer-heading {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    margin-top: 0;
    line-height: 1.4;
    text-align: left;
}

.footer-heading[contenteditable="true"] {
    cursor: text;
    outline: none;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-heading[contenteditable="true"]:hover {
    border-color: #4285f4;
    background-color: transparent;
}

.footer-heading[contenteditable="true"]:focus {
    background-color: rgba(66, 133, 244, 0.08);
    border: 1px solid rgba(66, 133, 244, 0.3);
}

.estimate-footer-text {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
}

.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.powered-by-text {
    font-size: calc(var(--font-size-xs));
    color: var(--text-muted);
    font-weight: 400;
}

.thinkogic-link {
    color: var(--text-muted);
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
}

.thinkogic-link:hover {
    text-decoration: underline;
    color: #4285f4;
}

.thinkogic-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.thinkogic-logo-link:hover {
    opacity: 0.8;
}

.thinkogic-logo {
    height: 30px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    vertical-align: middle;
}

/* Professional Editor Form Refresh (UI only) */
@media screen {
    .editable-estimate-panel {
        border-radius: 18px;
        border: 1px solid rgba(191, 219, 254, 0.72);
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
        overflow: hidden;
    }

    #estimatePreview {
        position: relative;
        border: 1px solid rgba(191, 219, 254, 0.74);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 255, 0.95) 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
        padding: clamp(16px, 2.2vw, 22px);
    }

    #estimatePreview::before {
        content: "";
        position: absolute;
        top: -120px;
        right: -90px;
        width: 220px;
        height: 220px;
        border-radius: 999px;
        pointer-events: none;
        background: radial-gradient(circle at center, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 72%);
    }

    #estimatePreview .estimate-template {
        position: relative;
        z-index: 1;
    }

    #estimatePreview .estimate-header {
        margin-bottom: 18px;
        padding: 0;
        border-radius: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        gap: 16px;
        min-height: auto;
    }

    #estimatePreview .header-left {
        gap: 14px;
        min-width: 0;
        padding: 12px;
        border-radius: 14px;
        border: 1px solid rgba(191, 219, 254, 0.92);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    }

    #estimatePreview .estimate-logo {
        width: 108px;
        height: 108px;
        border-radius: 14px;
        background: #ffffff;
        border: 1px solid rgba(191, 219, 254, 0.92);
        padding: 6px;
        box-shadow: 0 8px 14px rgba(15, 23, 42, 0.08);
    }

    #estimatePreview .logo-placeholder {
        border: 1.5px dashed rgba(59, 130, 246, 0.55);
        border-radius: 12px;
        background: linear-gradient(180deg, #f8fbff 0%, #ecf4ff 100%);
        color: #475569;
    }

    #estimatePreview .logo-placeholder:hover {
        border-color: #2563eb;
        background: linear-gradient(180deg, #eff6ff 0%, #e0ecff 100%);
    }

    #estimatePreview .estimate-company {
        gap: 6px;
    }

    #estimatePreview .editable-input,
    #estimatePreview .editable-textarea,
    #estimatePreview .editable-select {
        border: 1px solid #d5e2f3;
        background-color: #f8fbff;
        border-radius: 10px;
        padding: 8px 10px;
        margin-bottom: 0;
        color: #0f172a;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    #estimatePreview .editable-input:hover,
    #estimatePreview .editable-textarea:hover,
    #estimatePreview .editable-select:hover {
        border-color: #93c5fd;
        background-color: #ffffff;
    }

    #estimatePreview .editable-input:focus,
    #estimatePreview .editable-textarea:focus,
    #estimatePreview .editable-select:focus {
        border: 1px solid #2563eb;
        background-color: #ffffff;
        padding: 8px 10px;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    }

    #estimatePreview .company-state,
    #estimatePreview .place-supply,
    #estimatePreview .ship-place {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 12px;
        padding-right: 30px;
    }

    #estimatePreview .company-name {
        font-size: 1.42rem;
        line-height: 1.22;
        letter-spacing: -0.01em;
        font-weight: 800;
        color: #0b1f4d;
        border-width: 1.5px;
    }

    #estimatePreview .client-gstin,
    #estimatePreview .ship-gstin {
        font-family: 'Courier New', monospace;
        letter-spacing: 0.35px;
        font-size: 0.9rem;
    }

    #estimatePreview .company-gstin {
        font-family: var(--font-family);
        letter-spacing: normal;
        font-size: var(--font-size-base);
    }

    #estimatePreview .state-code-input {
        font-weight: 700;
        color: #1d4ed8;
        border-color: rgba(147, 197, 253, 0.95);
        background: linear-gradient(180deg, #eff6ff 0%, #e3efff 100%);
    }

    #estimatePreview .estimate-title {
        min-width: 330px;
        width: 45%;
        border-radius: 14px;
        border: 1px solid rgba(191, 219, 254, 0.92);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
        padding: 14px;
        align-self: stretch;
    }

    #estimatePreview .estimate-title h1 {
        color: #0b1f4d;
        border: 1px solid #E5E7EB;
        border-radius: 4px;
        background: #ffffff;
        padding: 8px 10px;
        margin-bottom: 16px;
        font-size: clamp(2rem, 3vw, 2.7rem);
        letter-spacing: 0.06em;
        width: 100%;
        box-sizing: border-box;
    }

    #estimatePreview .estimate-title h1:focus {
        border: 1px solid #4285f4;
        border-radius: 4px;
        background: rgba(0, 102, 204, 0.05);
    }

    #estimatePreview .estimate-title h1:hover {
        border-color: #4285f4;
    }

    #estimatePreview .estimate-meta {
        gap: 8px;
    }

    #estimatePreview .meta-item {
        width: 100%;
        border: 1px solid #d8e3f5;
        border-radius: 8px;
        padding: 7px 8px;
        min-height: 36px;
        background: #ffffff;
        gap: 8px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    #estimatePreview .meta-item:focus-within {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
        background: #ffffff;
    }

    #estimatePreview .meta-item strong {
        color: #1e3a8a;
        font-weight: 700;
    }

    #estimatePreview .meta-item .inline-input {
        border: none;
        border-bottom: none;
        border-radius: 0;
        background: transparent;
        color: #0f172a;
        font-weight: 600;
        padding: 2px 0;
    }

    #estimatePreview .meta-item .inline-input:focus {
        border: none;
        border-bottom: none;
        box-shadow: none;
        padding: 2px 0;
    }

    #estimatePreview .calendar-icon {
        color: #1d4ed8;
        opacity: 0.85;
    }

    #estimatePreview .parties-container {
        gap: 14px;
        margin-top: 0;
    }

    #estimatePreview .estimate-bill-to,
    #estimatePreview .estimate-ship-to {
        gap: 6px;
        border: 1px solid rgba(191, 219, 254, 0.88);
        border-radius: 15px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        padding: 14px;
        box-shadow: 0 8px 16px rgba(30, 64, 175, 0.08);
    }

    #estimatePreview .estimate-bill-to h3,
    #estimatePreview .estimate-ship-to h3 {
        font-size: 0.86rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #1e3a8a;
        font-weight: 800;
        margin-bottom: 4px;
    }

    #estimatePreview .ship-to-header {
        position: relative;
        width: 100%;
        margin-bottom: 4px;
        padding-right: 74px;
        align-items: flex-start;
        min-height: 0;
    }

    #estimatePreview .ship-to-header h3 {
        margin-bottom: 0;
        line-height: 1.4;
    }

    #estimatePreview .ship-to-header .toggle-switch {
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        margin: 0;
    }

    #estimatePreview .ship-to-fields {
        gap: 6px;
    }

    #estimatePreview .items-table {
        margin: 18px 0 12px;
        border-collapse: separate;
        border-spacing: 0;
        border: 1px solid rgba(191, 219, 254, 0.96);
        border-radius: 14px;
        overflow: hidden;
        background: #ffffff;
    }

    #estimatePreview .items-table th {
        border-bottom: 1px solid #dbeafe;
        font-size: 0.76rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-weight: 700;
        padding: 10px 10px;
    }

    #estimatePreview .items-table td {
        border-bottom: 1px solid #e5edf8;
        padding: 10px 10px;
    }

    #estimatePreview .items-table tbody tr:nth-child(even) td {
        background: #f8fbff;
    }

    #estimatePreview .editable-table td input,
    #estimatePreview .editable-table td select {
        min-height: 36px;
        border: 1px solid #d8e3f5;
        border-radius: 8px;
        background: #ffffff;
        padding: 7px 8px;
    }

    #estimatePreview .editable-table td select.item-tax {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 14px;
        padding-right: 32px;
    }

    #estimatePreview .editable-table td input:focus,
    #estimatePreview .editable-table td select:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
        background: #ffffff;
    }

    #estimatePreview .editable-table .item-amount {
        background: #eff6ff !important;
        border-color: rgba(147, 197, 253, 0.95);
        color: #0f172a;
        font-weight: 700;
    }

    #estimatePreview .btn-remove-item-inline {
        border-radius: 8px;
        width: 30px;
        height: 30px;
        padding: 0;
        font-size: 1.1rem;
        line-height: 1;
        box-shadow: 0 6px 10px rgba(220, 38, 38, 0.2);
    }

    #estimatePreview .btn-remove-item-inline:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 12px rgba(220, 38, 38, 0.28);
    }

    #estimatePreview .amount-in-words-section {
        margin: 10px 0 0;
        border: 1px solid rgba(147, 197, 253, 0.76);
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(219, 234, 254, 0.65) 0%, rgba(239, 246, 255, 0.78) 100%);
        padding: 10px 12px;
    }

    #estimatePreview .amount-in-words-label {
        font-size: 0.9rem;
        color: #1e3a8a;
        font-weight: 800;
    }

    #estimatePreview .amount-in-words-value {
        font-size: 0.92rem;
        color: #0f172a;
        font-weight: 700;
    }

    #estimatePreview .btn-add-item-inline {
        margin-top: 12px;
        border-radius: 12px;
        background: linear-gradient(135deg,
                var(--add-line-start, #1d4ed8) 0%,
                var(--add-line-mid, #2563eb) 52%,
                var(--add-line-end, #0ea5e9) 100%);
        border: 1px solid var(--add-line-border, rgba(30, 64, 175, 0.2));
        box-shadow: 0 12px 20px var(--add-line-shadow, rgba(37, 99, 235, 0.24)),
            inset 0 1px 0 rgba(255, 255, 255, 0.24);
        letter-spacing: 0.01em;
    }

    #estimatePreview .btn-add-item-inline:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 24px var(--add-line-shadow-hover, rgba(37, 99, 235, 0.28)),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        filter: brightness(1.03);
    }

    #estimatePreview .estimate-footer {
        margin-top: 18px;
        padding-top: 14px;
        border-top: 1px solid rgba(191, 219, 254, 0.95);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #estimatePreview .estimate-notes,
    #estimatePreview .estimate-terms,
    #estimatePreview .estimate-payment-terms,
    #estimatePreview .estimate-signatory {
        margin: 0;
        border: 1px solid rgba(191, 219, 254, 0.86);
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        padding: 12px;
        box-shadow: 0 6px 14px rgba(30, 64, 175, 0.06);
    }

    #estimatePreview .footer-actions {
        grid-column: 1 / -1;
        margin: 0;
        padding: 0;
    }

    #estimatePreview .footer-action-btn {
        border-color: rgba(37, 99, 235, 0.32);
        background: linear-gradient(135deg, #eef4ff 0%, #dbeafe 100%);
        color: #1e3a8a;
    }

    #estimatePreview .footer-section-header {
        margin-bottom: 8px;
    }

    #estimatePreview .footer-section-header .footer-heading {
        margin-bottom: 0;
    }

    #estimatePreview .footer-remove-btn {
        border-color: rgba(37, 99, 235, 0.35);
        color: #1e3a8a;
        background: #fff;
        width: 22px;
        height: 22px;
        font-size: 14px;
    }

    #estimatePreview .footer-heading {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: #1e3a8a;
        font-weight: 800;
        margin-bottom: 8px;
    }

    #estimatePreview .footer-heading[contenteditable="true"] {
        border: 1px solid #d8e3f5;
        border-radius: 8px;
        background: #ffffff;
        padding: 7px 8px;
        margin-bottom: 0;
        box-shadow: none;
    }

    #estimatePreview .footer-heading[contenteditable="true"]:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
        background: #ffffff;
    }

    #estimatePreview .footer-textarea {
        border: 1px solid #d8e3f5;
        border-radius: 8px;
        background: #ffffff;
        padding: 7px 8px;
        min-height: 62px;
        font-size: 0.86rem;
        color: #1e293b;
    }

    #estimatePreview .footer-textarea:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
        background: #ffffff;
        padding: 7px 8px;
    }

    #estimatePreview .signature-upload-area {
        max-width: 100%;
    }

    #estimatePreview .signature-placeholder,
    #estimatePreview .signature-preview {
        border: 1px solid #d8e3f5;
        border-radius: 8px;
        background: #ffffff;
    }

    #estimatePreview .estimate-footer-text {
        grid-column: 1 / -1;
        margin-top: 2px;
        padding-top: 10px;
        border-top: 1px dashed rgba(147, 197, 253, 0.84);
    }

    #estimatePreview .toggle-slider {
        background: linear-gradient(135deg, #dbe4ef 0%, #c6d2e1 100%);
        border: 1px solid #b9c6d8;
        box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.35);
    }

    #estimatePreview .toggle-slider:before {
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
    }

    #estimatePreview .toggle-switch input:checked + .toggle-slider {
        background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
        border-color: rgba(37, 99, 235, 0.8);
    }

    #estimatePreview .field-invalid {
        border-color: #dc2626 !important;
        background-color: rgba(220, 38, 38, 0.06) !important;
        box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
    }
}

@media screen and (max-width: 1024px) {
    #estimatePreview .estimate-header {
        padding: 0;
        gap: 12px;
    }

    #estimatePreview .header-left {
        width: 100%;
    }

    #estimatePreview .estimate-title {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
    }

    #estimatePreview .estimate-title h1 {
        text-align: left;
        font-size: clamp(1.7rem, 6vw, 2.3rem);
    }

    #estimatePreview .estimate-meta {
        align-items: stretch;
    }

    #estimatePreview .meta-item {
        justify-content: space-between;
    }

    #estimatePreview .estimate-footer {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 640px) {
    #estimatePreview {
        padding: 12px;
        border-radius: 12px;
    }

    #estimatePreview .header-left,
    #estimatePreview .estimate-bill-to,
    #estimatePreview .estimate-ship-to {
        border-radius: 12px;
        padding: 10px;
    }

    #estimatePreview .estimate-logo {
        width: 92px;
        height: 92px;
    }

    #estimatePreview .items-table {
        border-radius: 12px;
    }

    #estimatePreview .editable-table td select.item-tax {
        background-position: right 6px center;
        background-size: 11px;
        padding-right: 20px;
    }
}

/* Authorised Signatory Section */
.estimate-signatory {
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.signature-container {
    width: 100%;
    margin-top: var(--spacing-xs);
}

.signature-upload-area {
    width: 100%;
    max-width: 260px;
    min-height: 92px;
    position: relative;
    display: block;
    cursor: pointer;
    transition: all var(--transition-base);
}

.signature-placeholder,
.signature-preview {
    width: 100%;
    min-height: 92px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.signature-preview {
    border-style: solid;
    border-color: var(--border-color);
    background: #fff;
    padding: 6px;
}

.signature-preview-image {
    width: 100%;
    height: 78px;
    object-fit: contain;
    border-radius: 4px;
}

.signature-placeholder svg {
    color: #667eea;
    opacity: 0.7;
}

.signature-text-main {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.signature-text-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.signature-placeholder:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.signature-upload-area:hover .signature-placeholder {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

/* Template Variations */
.spreadsheet-template .estimate-header {
    border-bottom: 3px solid var(--primary-color);
}

.spreadsheet-template .items-table th {
    background: var(--primary-color);
}

/* Redesigned Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Base Modal Content */
.modal-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content.redesigned-modal {
    max-width: 600px;
    /* Reduced width to prevent overflow on small screens, adjust as needed */
    padding: 0;
    /* Removing default padding to use internal layout */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    /* Change to white because header is dark */
    z-index: 10;
    transition: color 0.2s;
    opacity: 0.8;
}

.modal-close:hover {
    color: var(--error-color);
    opacity: 1;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    text-align: center;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
}

.modal-header p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

/* Form Layout */
.trial-form-grid {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Specific gap */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Floating Labels */
.floating-label {
    position: relative;
    margin-bottom: 0;
    /* Reset */
}

.floating-label input,
.floating-label textarea {
    width: 100%;
    padding: 12px 16px;
    /* Increased padding */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background: #f9fafb;
    transition: all 0.2s ease;
    resize: none;
    /* For textarea */
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

.floating-label input:placeholder-shown+label,
.floating-label textarea:placeholder-shown+label {
    /* If placeholder is shown (meaning empty), label is inside */
    top: 12px;
    left: 16px;
    font-size: 1rem;
    color: var(--text-muted);
    background: transparent;
}

.floating-label input:focus,
.floating-label textarea:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    outline: none;
}

.floating-label label {
    position: absolute;
    left: 14px;
    top: -9px;
    /* Floating position */
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    pointer-events: none;
    background: white;
    /* Important to hide border behind */
    padding: 0 4px;
    margin: 0;
    z-index: 1;
}

/* Logic for floating label: Use :placeholder-shown trick */
/* Reset placeholder opacity so we can use it for detection but not show it */
.floating-label input::placeholder,
.floating-label textarea::placeholder {
    color: transparent;
}

/* Active State for Label (Focus or Has Content) */
.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label,
.floating-label textarea:focus+label,
.floating-label textarea:not(:placeholder-shown)+label {
    top: -9px;
    left: 14px;
    font-size: 0.85rem;
    color: var(--primary-color);
    background: white;
    font-weight: 600;
}

.full-width {
    width: 100%;
    grid-column: span 2;
    /* Span both columns if in grid */
}

/* Submit Button */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn-submit-trial {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-submit-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-submit-trial svg {
    transition: transform 0.3s ease;
}

.btn-submit-trial:hover svg {
    transform: translateX(4px);
}

.btn-submit-trial:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Status Message */
.form-status {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
    border-radius: 6px;
    padding: 0 10px;
    display: none;
    /* Hide when empty */
}

.form-status.active {
    display: block;
    padding: 10px;
}

.form-status.success {
    color: #065f46;
    background-color: #d1fae5;
    border: 1px solid #34d399;
}

.form-status.error {
    color: #991b1b;
    background-color: #fee2e2;
    border: 1px solid #f87171;
}

/* In-page popup (replaces browser alerts for print flow) */
.in-page-popup-stack {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 12000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: min(92vw, 520px);
}

.in-page-popup {
    min-width: 0;
    max-width: none;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: linear-gradient(180deg, #fff6f6 0%, #ffe8e8 100%);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    color: #7f1d1d;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.in-page-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.in-page-popup.is-success {
    border-color: rgba(52, 211, 153, 0.45);
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    color: #14532d;
}

.in-page-popup-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
    background: rgba(220, 38, 38, 0.14);
    color: #b91c1c;
}

.in-page-popup.is-success .in-page-popup-icon {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.in-page-popup-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.4;
    font-weight: 600;
}

.in-page-popup-close {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-size: 18px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.in-page-popup-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
    .in-page-popup-stack {
        bottom: 12px;
        width: min(96vw, 520px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content.redesigned-modal {
        width: 95%;
        max-width: 95%;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 15px;
    }

    .trial-form-grid {
        padding: var(--spacing-md);
        gap: 15px;
    }

    .full-width {
        grid-column: span 1;
    }
}



.compact-template {
    font-size: var(--font-size-xs);
}

.compact-template .estimate-title h1 {
    font-size: var(--font-size-2xl);
}

.compact-template .items-table th,
.compact-template .items-table td {
    padding: 8px;
}

/* Footer */
.footer {
    background: #1A1A1A;
    color: #FFFFFF;
    padding: var(--spacing-xl) 0 var(--spacing-md);

}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.footer-links a {
    color: #FFFFFF;
    text-decoration: none;
    transition: all var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-separator {
    color: #666;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid #333;
    font-size: var(--font-size-sm);
    color: #999;
}

/* Modal Styles */
.modal-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.trial-form .form-group {
    margin-bottom: var(--spacing-md);
}

.trial-form label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.trial-form input,
.trial-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: var(--spacing-md);
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.save-modal,
.print-modal {
    max-width: 500px;
}

.save-options {
    margin: var(--spacing-lg) 0;
}

.save-option-group {
    margin-bottom: var(--spacing-lg);
}

.save-option-label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.save-options-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.save-option-item {
    display: block;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.save-option-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.save-option-item input[type="radio"] {
    display: none;
}

.save-option-item input[type="radio"]:checked+.option-content {
    color: var(--primary-color);
    font-weight: 600;
}

.save-option-item input[type="radio"]:checked~.option-content,
.save-option-item:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.1);
}

.option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.option-content svg {
    flex-shrink: 0;
}

.email-input-group {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.email-input-group label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.email-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-base);
}

.email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    justify-content: flex-end;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 12px 24px;
    font-size: var(--font-size-base);
}

.print-options {
    margin: var(--spacing-lg) 0;
}

.print-options label {
    display: block;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.print-options label:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.print-options input[type="radio"] {
    margin-right: var(--spacing-sm);
}

.print-options small {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-top: 4px;
}

.print-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.print-actions button {
    flex: 1;
    min-width: 120px;
}

body.print-template-modal-open {
    overflow: hidden;
}

.print-template-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(5, 10, 20, 0.66);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.print-template-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.print-template-modal-content {
    width: min(920px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 18px;
    border: 1px solid #dbe4ef;
    box-shadow: 0 40px 80px rgba(8, 15, 30, 0.3);
    padding: 28px;
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.print-template-modal-overlay.active .print-template-modal-content {
    transform: translateY(0) scale(1);
}

.print-template-modal-close {
    border: none;
    background: #eef2f8;
    color: #1f2937;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    top: 14px;
    right: 14px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.print-template-modal-close:hover {
    transform: rotate(90deg);
    background: #dfe7f2;
}

.print-template-modal-header {
    margin-bottom: 20px;
    padding-right: 46px;
}

.print-template-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #1d4ed8;
    margin: 0 0 8px;
}

.print-template-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1d4ed8;
}

.print-template-modal-header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.print-template-modal-header p {
    margin: 0;
    color: #334155;
    font-size: 0.75rem;
}

.print-template-slider-shell {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.print-template-card-track {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.print-template-card-track::-webkit-scrollbar {
    height: 8px;
}

.print-template-card-track::-webkit-scrollbar-thumb {
    background: #c4d3e8;
    border-radius: 999px;
}

.print-template-card-track::-webkit-scrollbar-track {
    background: #ecf2fb;
    border-radius: 999px;
}

.print-template-slider-btn {
    align-self: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #c6d8f2;
    background: #f5f9ff;
    color: #1d4ed8;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.print-template-slider-btn:hover {
    transform: translateY(-1px);
    border-color: #93b5ea;
    background: #ebf2ff;
}

.print-template-slider-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.print-template-card {
    border: 1.5px solid #d8e1ec;
    border-radius: 14px;
    background: white;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    flex: 0 0 min(390px, calc(100% - 8px));
    min-width: 320px;
    scroll-snap-align: start;
}

.print-template-card:hover {
    transform: translateY(-3px);
    border-color: #7aa5e9;
    box-shadow: 0 14px 30px rgba(30, 64, 175, 0.14);
}

.print-template-card.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.print-template-card-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #0f172a;
    background: #e2e8f0;
    z-index: 2;
}

.print-template-live-frame {
    display: block;
    width: min(100%, 255px);
    aspect-ratio: 210 / 297;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid #d5dfeb;
    overflow: hidden;
    background: #ffffff;
    pointer-events: none;
}

.print-template-live-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #ffffff;
    pointer-events: none;
}

.print-template-card-copy strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    margin-bottom: 3px;
}

.print-template-card-copy small {
    display: block;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.42;
}

.print-template-color-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #f8fbff;
}

.print-template-color-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
}

.print-template-color-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.print-template-modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.print-template-modal-actions .btn-secondary,
.print-template-modal-actions .btn-primary {
    min-width: 148px;
}

@media (max-width: 860px) {
    .print-template-modal-content {
        padding: 20px;
    }

    .print-template-card {
        flex-basis: 100%;
        min-width: 0;
    }

    .print-template-live-frame {
        width: min(100%, 235px);
    }

    .print-template-slider-btn {
        display: none;
    }

    .print-template-modal-actions {
        justify-content: stretch;
    }

    .print-template-modal-actions .btn-secondary,
    .print-template-modal-actions .btn-primary {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .print-template-modal-overlay {
        padding: 12px;
    }

    .print-template-modal-content {
        border-radius: 14px;
        padding: 18px 14px;
    }

    .print-template-modal-header h2 {
        font-size: 1.2rem;
    }

    .print-template-live-frame {
        width: min(100%, 220px);
    }
}

/* Responsive Styles */
/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .generator-header {
        margin: 14px 0 var(--spacing-lg);
        padding: 20px 18px;
    }

    .generator-header h1 {
        font-size: clamp(1.8rem, 4.2vw, 2.2rem);
    }

    .generator-header .subtitle {
        max-width: 100%;
        white-space: normal;
    }

    .generator-wrapper {
        max-width: 100%;
    }

    .generator-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .fixed-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .sidebar-controls {
        position: relative;
        top: 0;
    }

    .parties-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .estimate-header {
        flex-direction: column;
        gap: var(--spacing-md);
        min-height: auto;
    }

    .header-left {
        width: 100%;
        min-width: auto;
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .estimate-logo {
        width: 100px;
        height: 100px;
    }

    .estimate-company {
        min-width: auto;
        width: 100%;
    }

    .estimate-title {
        width: 100%;
        text-align: left;
        min-width: auto;
        margin-top: 0;
    }

    .estimate-title h1 {
        text-align: left;
        font-size: var(--font-size-2xl);
    }

    .estimate-meta {
        align-items: flex-start;
    }

    .meta-item {
        justify-content: flex-start;
    }

    .editable-estimate-panel {
        padding: var(--spacing-md);
    }

    .items-table {
        font-size: var(--font-size-xs);
    }

    .items-table th,
    .items-table td {
        padding: 8px 6px;
    }
}

/* Hide nav text on mobile */
@media (max-width: 768px) {
    .fixed-sidebar {
        width: 100%;
        margin: 0;
    }

    .sidebar-controls {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 14px;
    }

    .sidebar-controls::before,
    .sidebar-controls::after {
        display: none;
    }

    .sidebar-controls .action-buttons {
        grid-column: auto;
        justify-content: center;
    }

    .sidebar-controls .theme-selector,
    .sidebar-controls .font-selector,
    .sidebar-controls .share-section,
    .sidebar-controls .action-buttons {
        padding: 10px;
        border-radius: 12px;
    }

    .sidebar-controls .theme-selector label,
    .sidebar-controls .font-selector label,
    .sidebar-controls .share-section label {
        font-size: 0.64rem;
        margin-bottom: 6px;
    }

    .sidebar-controls .theme-colors {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .sidebar-controls .share-buttons {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .sidebar-controls .share-btn {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .sidebar-controls .action-buttons #printBtnDirect {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .nav-text {
        display: none !important;
    }

    .nav-wrapper {
        min-height: 64px;
        padding: 6px 0;
    }

    .hamburger {
        display: inline-flex;
        z-index: 1310;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -320px;
        width: min(84vw, 320px);
        height: 100dvh;
        padding: 82px 14px 16px;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        border-left: 1px solid rgba(191, 219, 254, 0.95);
        box-shadow: -16px 0 32px rgba(15, 23, 42, 0.2);
        overflow-y: auto;
        transition: right 0.26s ease;
        z-index: 1305;
    }

    .nav-menu.active {
        right: 0;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.34);
        z-index: 990;
    }

    .nav-menu .nav-pdf-dropdown {
        width: 100%;
    }

    .nav-menu .nav-pdf-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
        font-size: var(--font-size-sm);
    }

    .nav-menu .nav-pdf-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        min-width: 100%;
        margin-top: 0;
        border-radius: 10px;
        border: 0 solid transparent;
        box-shadow: none;
        padding: 0 6px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.24s ease, opacity 0.2s ease, margin-top 0.2s ease, padding 0.2s ease, border-width 0.2s ease;
    }

    .nav-menu .nav-pdf-dropdown.is-open .nav-pdf-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 8px;
        border-width: 1px;
        border-color: #dbeafe;
        padding: 6px;
        max-height: 280px;
    }

    .nav-menu .nav-pdf-dropdown.is-open .nav-pdf-caret {
        transform: rotate(180deg);
    }

    .nav-menu .btn-free-trial {
        width: 100%;
    }

    .logo-image {
        height: 42px;
    }

    .btn-free-trial {
        padding: 8px 14px;
        font-size: var(--font-size-xs);
    }

    .generator-header {
        margin: 10px 0 var(--spacing-lg);
        padding: 16px 14px;
        border-radius: 16px;
    }

    .header-kicker {
        font-size: 0.68rem;
        padding: 7px 10px;
    }

    .generator-header h1 {
        font-size: var(--font-size-2xl);
    }

    .generator-header .subtitle {
        font-size: var(--font-size-sm);
        line-height: 1.6;
        margin-bottom: 10px;
        white-space: normal;
    }

    .header-rating {
        margin: 0;
        padding: 7px 10px;
        gap: 6px;
    }

    .header-rating-stars {
        font-size: 0.82rem;
        letter-spacing: 0.8px;
    }

    .header-rating-score,
    .header-rating-count {
        font-size: 0.66rem;
    }

    .header-rating-divider {
        font-size: 0.7rem;
    }

    .header-badges {
        gap: 6px;
    }

    .header-badges > span {
        font-size: 0.68rem;
        padding: 6px 9px;
    }
}

/* Print Styles */
@media print {
    .container {
        padding: 0 var(--spacing-xs);
    }

    .nav-wrapper {
        padding: 6px var(--spacing-xs);
    }

    .logo-image {
        height: 35px;
    }

    .btn-free-trial {
        padding: 5px 10px;
        font-size: var(--font-size-xxs);
    }

    .generator-header h1 {
        font-size: var(--font-size-xl);
    }

    .generator-header .subtitle {
        font-size: var(--font-size-sm);
    }

    .editable-estimate-panel {
        padding: var(--spacing-xs);
        border-radius: 6px;
    }

    .estimate-logo {
        width: 60px;
        height: 60px;
    }

    .logo-placeholder {
        padding: 4px;
    }

    .logo-text-main {
        font-size: var(--font-size-xs);
    }

    .logo-text-sub {
        font-size: var(--font-size-xxs);
    }

    .estimate-company {
        width: 100% !important;
    }

    .company-name {
        font-size: var(--font-size-sm);
    }

    .estimate-title {
        width: 100% !important;
        margin-top: var(--spacing-sm);
        align-items: flex-start !important;
    }

    .estimate-title h1 {
        font-size: var(--font-size-lg);
        text-align: left !important;
    }

    .estimate-meta {
        font-size: var(--font-size-xxs);
        width: 100%;
        align-items: flex-start !important;
    }

    .meta-item {
        width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 4px;
    }

    .meta-item strong {
        width: 100%;
    }

    .inline-input,
    .date-input-wrapper {
        width: 100% !important;
    }

    .date-input {
        width: 100% !important;
        text-align: left;
    }

    .items-table {
        min-width: 500px;
        font-size: var(--font-size-xxs);
    }

    .items-table th,
    .items-table td {
        padding: 4px 2px;
    }

    /* SGST/CGST structure on small mobile */
    .items-table.sgst-cgst-structure {
        min-width: 600px;
    }

    .items-table.sgst-cgst-structure thead th:nth-child(1),
    .items-table.sgst-cgst-structure tbody td:nth-child(1) {
        width: 22% !important;
        min-width: 100px;
    }

    .items-table.sgst-cgst-structure thead th:nth-child(5),
    .items-table.sgst-cgst-structure tbody td:nth-child(5) {
        width: 7% !important;
        min-width: 40px;
    }

    .items-table.sgst-cgst-structure thead th:nth-child(4),
    .items-table.sgst-cgst-structure tbody td:nth-child(4),
    .items-table.sgst-cgst-structure thead th:nth-child(6),
    .items-table.sgst-cgst-structure tbody td:nth-child(6) {
        width: 7% !important;
        min-width: 40px;
    }

    .items-table.sgst-cgst-structure thead th:nth-child(7),
    .items-table.sgst-cgst-structure tbody td:nth-child(7) {
        width: 20% !important;
        min-width: 80px;
    }

    .editable-table td input,
    .editable-table td select {
        font-size: var(--font-size-xxs);
        padding: 4px 2px;
        min-height: 28px;
    }

    .editable-table td select.item-tax {
        padding-right: 18px;
        background-position: right 5px center;
        background-size: 11px;
    }

    .amount-in-words-section {
        padding: var(--spacing-xs);
    }

    .amount-in-words-label,
    .amount-in-words-value {
        font-size: var(--font-size-xs);
    }

    .btn-add-item-inline {
        padding: 8px;
        font-size: var(--font-size-xs);
    }

    .footer-textarea {
        font-size: var(--font-size-xxs);
        padding: 4px 6px;
    }

    .signature-upload-area {
        max-width: 220px;
        min-height: 78px;
    }

    .signature-placeholder,
    .signature-preview {
        min-height: 78px;
    }

    .signature-preview-image {
        height: 64px;
    }

    .footer-action-btn {
        font-size: 0.72rem;
        padding: 6px 10px;
    }

    .footer-remove-btn {
        width: 20px;
        height: 20px;
        font-size: 13px;
    }

    .sidebar-controls {
        padding: var(--spacing-sm);
    }

    .panel-section h3 {
        font-size: var(--font-size-base);
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 12px;
        font-size: var(--font-size-xs);
    }
}

/* Print Styles */
@media print {

    .navbar,
    .form-panel,
    .preview-controls,
    .fixed-sidebar,
    .footer,
    .btn-add-item,
    .btn-remove-item,
    .seo-rich-section,
    .seo-content-section,
    .testimonials-section,
    .faq-section {
        display: none !important;
    }

    .estimate-generator-container {
        padding: 0;
    }

    .preview-panel {
        box-shadow: none;
        padding: 0;
    }

    .estimate-preview {
        border: none;
    }

    body {
        padding-top: 0;
    }

    /* Hide Powered by Thinkogic footer in PDF export */
    .estimate-footer-text,
    .powered-by,
    .powered-by-text,
    .thinkogic-link,
    .thinkogic-logo,
    .thinkogic-logo-link {
        display: none !important;
    }

    .footer-actions {
        display: none !important;
    }

    /* Optimize spacing for Notes and Terms sections to fit on first page */
    .estimate-notes,
    .estimate-terms,
    .estimate-payment-terms,
    .estimate-signatory {
        margin-bottom: 8px !important;
        margin-top: 0 !important;
        padding-bottom: 0 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        orphans: 1 !important;
        widows: 1 !important;
    }

    .estimate-footer {
        margin-top: 5px !important;
        padding-top: 3px !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .items-table {
        margin: 10px 0 5px 0 !important;
    }

    .amount-in-words-section {
        margin: 5px 0 !important;
        padding: 6px 10px !important;
    }

    .estimate-header {
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
    }
}

/* SEO Content Sections */
.seo-rich-section {
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
}

.seo-rich-section .container {
    position: relative;
    z-index: 2;
}

.seo-reveal {
    opacity: 0;
    transform: translateY(36px) scale(0.98);
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.seo-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.thinkogic-solution-section {
    border-top: 1px solid #E2E8F0;
}

.thinkogic-solution-frame {
    max-width: 1160px;
    margin: 0 auto;
    border: 1px solid rgba(191, 219, 254, 0.7);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(9px);
    padding: clamp(16px, 2.6vw, 24px);
}

.thinkogic-solution-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(30px, 5vw, 56px);
    align-items: stretch;
}

.thinkogic-solution-copy {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(191, 219, 254, 0.7);
    border-radius: 20px;
    padding: clamp(18px, 2.8vw, 28px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

.thinkogic-problem-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.thinkogic-problem-strip strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: #0F172A;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #BFDBFE;
    background: linear-gradient(180deg, #EFF6FF 0%, #DBEAFE 100%);
}

.thinkogic-problem-strip span {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #1E3A8A;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid #DBEAFE;
    background: #FFFFFF;
}

.thinkogic-solution-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.thinkogic-step-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #DBEAFE;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.thinkogic-step-number {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.26);
}

.thinkogic-step-card h3 {
    margin: 0 0 4px 0;
    color: #0E1B56;
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.35;
}

.thinkogic-step-card p {
    margin: 0;
    color: #475569;
    font-size: var(--font-size-xs);
    line-height: 1.5;
}

.thinkogic-step-card:hover {
    transform: translateY(-3px);
    border-color: #93C5FD;
    box-shadow: 0 14px 22px rgba(37, 99, 235, 0.14);
}

.thinkogic-solution-note {
    margin: 0;
    color: #334155;
    font-size: var(--font-size-sm);
    line-height: 1.65;
}

.thinkogic-proof-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.thinkogic-proof-row span {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #1E3A8A;
    background: rgba(219, 234, 254, 0.95);
    border: 1px solid rgba(147, 197, 253, 0.9);
    border-radius: 999px;
    padding: 7px 10px;
}

.thinkogic-solution-visual {
    height: auto;
    align-self: start;
}

.thinkogic-solution-visual::before {
    display: none;
}

.thinkogic-solution-visual .seo-photo-img {
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
    transform: none !important;
    filter: none !important;
}

.thinkogic-solution-visual .seo-photo-label {
    display: none;
}

.seo-content-section {
    background: radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.18), transparent 38%),
        radial-gradient(circle at 88% 90%, rgba(14, 165, 233, 0.16), transparent 38%),
        linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 58%, #EEF4FF 100%);
    margin-top: var(--spacing-xxl);
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

.seo-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(20px, 4vw, 38px);
    align-items: center;
}

.seo-hero-copy {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(191, 219, 254, 0.6);
    border-radius: 22px;
    padding: clamp(22px, 3vw, 34px);
    box-shadow: 0 16px 40px rgba(30, 64, 175, 0.08);
    backdrop-filter: blur(8px);
}

.seo-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E40AF;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(219, 234, 254, 0.92);
    border: 1px solid rgba(147, 197, 253, 0.9);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.seo-content-title,
.seo-rich-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(90deg, #0E1B56 0%, #1D4ED8 58%, #0EA5E9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.seo-rich-title-left {
    text-align: left;
}

.seo-content-intro,
.seo-rich-subtitle {
    color: #1F2A44;
    font-size: var(--font-size-lg);
    line-height: 1.7;
    text-align: center;
    margin: 0 auto 18px;
    max-width: 900px;
    text-wrap: pretty;
}

.seo-rich-subtitle-left {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.seo-keyword-grid {
    display: none;
}

.seo-quick-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.seo-quick-points span {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: #0F172A;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    padding: 8px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.seo-hero-visual {
    margin: 0;
    animation: seoFloat 6s ease-in-out infinite;
}

.seo-hero-visual .seo-photo-img {
    height: clamp(320px, 34vw, 460px);
}

.seo-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.seo-keyword-chip {
    background: linear-gradient(180deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #93C5FD;
    border-radius: 999px;
    color: #1E40AF;
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1;
    padding: 8px 12px;
    text-transform: lowercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seo-keyword-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.18);
}

.seo-content-links {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.65;
    margin: 0;
}

.seo-content-links a {
    color: #1D4ED8;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(29, 78, 216, 0.4);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.seo-content-links a:hover {
    color: #1E3A8A;
    text-decoration-color: rgba(30, 58, 138, 0.8);
}

/* Shared Visual Blocks */
.seo-split-layout,
.seo-comparison-layout,
.seo-local-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(18px, 3.8vw, 34px);
    align-items: center;
}

.seo-split-content,
.seo-comparison-content,
.seo-local-copy {
    min-width: 0;
}

.seo-section-visual,
.seo-template-visual,
.seo-local-visual {
    margin: 0;
}

.seo-section-visual-centered {
    max-width: 820px;
    margin: 0 auto 22px;
}

.seo-photo-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, 0.55);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.2);
    background: #0f172a;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.seo-photo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.08) 15%, rgba(2, 6, 23, 0.58) 100%);
    z-index: 2;
    pointer-events: none;
}

.seo-photo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 76% 12%, rgba(255, 255, 255, 0.25) 0%, transparent 34%);
    z-index: 3;
    pointer-events: none;
}

.seo-photo-img {
    width: 100%;
    height: clamp(260px, 32vw, 410px);
    display: block;
    object-fit: cover;
    transform: scale(1.02);
    filter: saturate(1.06) contrast(1.03);
    transition: transform 0.45s ease, filter 0.45s ease;
}

.seo-photo-svg {
    object-fit: contain;
    transform: none !important;
    filter: none !important;
}

.seo-photo-label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 28px);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(219, 234, 254, 0.72);
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(8px);
    color: #f8fbff;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.seo-photo-card:hover {
    transform: translateY(-6px);
    border-color: rgba(147, 197, 253, 0.95);
    box-shadow: 0 28px 48px rgba(30, 64, 175, 0.24);
}

.seo-photo-card:hover .seo-photo-img {
    transform: scale(1.06);
    filter: saturate(1.1) contrast(1.05);
}

.seo-photo-card:hover .seo-photo-svg {
    transform: none !important;
    filter: none !important;
}

/* Industries Section */
.seo-industries-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%, #EEF2FF 100%);
    border-bottom: 1px solid #DBEAFE;
}

.seo-industries-section .industries-svg-card::before,
.seo-industries-section .industries-svg-card::after {
    display: none;
}

.seo-industries-section .industries-photo-svg {
    height: auto;
    aspect-ratio: 1200 / 760;
}

.seo-industry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.seo-industry-card {
    position: relative;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #DBEAFE;
    border-radius: 14px;
    padding: 14px 14px 14px 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.seo-industry-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #2563EB 0%, #0EA5E9 100%);
}

.seo-industry-card h3 {
    color: #0E1B56;
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.seo-industry-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin: 0;
}

.seo-industry-card:hover {
    transform: translateY(-5px);
    border-color: #93C5FD;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.15);
}

/* Steps Section */
.seo-steps-section {
    background: linear-gradient(140deg, #0E1B56 0%, #1E3A8A 58%, #1D4ED8 100%);
}

.seo-steps-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.35;
    z-index: 1;
}

.seo-steps-section .seo-rich-title {
    margin-bottom: 10px;
    background: none;
    -webkit-text-fill-color: #FFFFFF;
}

.seo-steps-section .seo-rich-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 18px;
}

.seo-steps-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    position: relative;
}

.seo-step-card {
    position: relative;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(191, 219, 254, 0.8);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 16px 28px rgba(3, 7, 18, 0.2);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.seo-step-number {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    color: #FFFFFF;
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.seo-step-card h3 {
    color: #0E1B56;
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.seo-step-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
    line-height: 1.5;
}

.seo-step-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 35px rgba(30, 64, 175, 0.26);
}

/* Comparison Section */
.seo-comparison-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 58%, #EEF2FF 100%);
}

.seo-comparison-section .seo-photo-card::before {
    display: none;
}

.seo-comparison-cards {
    display: grid;
    gap: 12px;
}

.seo-compare-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #DBEAFE;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.seo-compare-card h3 {
    color: #0E1B56;
    font-size: var(--font-size-lg);
    margin-bottom: 6px;
}

.seo-compare-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.seo-compare-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.14);
}

/* Template Section */
.seo-template-section {
    background: linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 48%, #E0E7FF 100%);
}

.seo-template-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 30px);
    align-items: start;
    margin-bottom: 14px;
}

.seo-template-main {
    background: #FFFFFF;
    border: 1px solid #DBEAFE;
    border-radius: 18px;
    padding: clamp(20px, 2.8vw, 30px);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
}

.seo-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.seo-checklist li {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #DBEAFE;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    padding: 12px 14px 12px 36px;
    position: relative;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.seo-checklist li::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2563EB 0%, #0EA5E9 100%);
    position: absolute;
    left: 14px;
    top: 18px;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.seo-checklist li:hover {
    transform: translateX(2px);
    border-color: #93C5FD;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.12);
}

.seo-template-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.seo-template-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #BFDBFE;
    border-radius: 14px;
    padding: var(--spacing-md);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.seo-template-card h3 {
    color: #0E1B56;
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.seo-template-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin: 0;
}

.seo-template-card:hover {
    transform: translateY(-4px);
    border-color: #93C5FD;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.15);
}

/* Local Intent Section */
.seo-local-section {
    background: linear-gradient(140deg, #060B1D 0%, #11245D 40%, #1E3A8A 100%);
}

.seo-local-section::before,
.seo-local-section::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    z-index: 1;
}

.seo-local-section::before {
    width: 320px;
    height: 320px;
    top: -140px;
    right: -110px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.36) 0%, rgba(96, 165, 250, 0) 70%);
}

.seo-local-section::after {
    width: 280px;
    height: 280px;
    bottom: -120px;
    left: -90px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.24) 0%, rgba(14, 165, 233, 0) 70%);
}

.seo-local-title {
    color: #FFFFFF;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.seo-local-subtitle {
    color: rgba(255, 255, 255, 0.92);
    font-size: var(--font-size-base);
    line-height: 1.65;
    text-align: center;
    margin: 0 auto 16px;
    max-width: 900px;
}

.seo-local-pillars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.seo-local-pillar {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(219, 234, 254, 0.32);
    border-radius: 12px;
    padding: 14px;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.25);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.seo-local-pillar strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.seo-local-pillar span {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.88);
}

.seo-local-pillar:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(219, 234, 254, 0.55);
}

.seo-chip-marquee {
    margin-top: 14px;
    border-radius: 999px;
    border: 1px solid rgba(191, 219, 254, 0.4);
    background: rgba(30, 64, 175, 0.25);
    overflow: hidden;
    padding: 10px 0;
}

.seo-chip-track {
    width: max-content;
    display: flex;
    gap: 10px;
    padding-left: 12px;
    animation: seoMarquee 28s linear infinite;
}

.seo-chip-track span {
    font-size: var(--font-size-sm);
    color: #E0EAFF;
    border: 1px solid rgba(191, 219, 254, 0.42);
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(59, 130, 246, 0.23);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.seo-chip-track span:hover {
    transform: translateY(-1px);
    border-color: rgba(219, 234, 254, 0.7);
    background: rgba(59, 130, 246, 0.34);
}

@keyframes seoMarquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes seoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@media (max-width: 1024px) {

    .thinkogic-solution-layout,
    .seo-hero-layout,
    .seo-split-layout,
    .seo-comparison-layout,
    .seo-local-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .thinkogic-solution-frame {
        border-radius: 22px;
        padding: 14px;
    }

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

    .seo-steps-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seo-local-pillars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seo-template-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .seo-template-cards {
        grid-template-columns: 1fr;
    }

    .thinkogic-solution-copy,
    .seo-hero-copy {
        border-radius: 18px;
    }

    .thinkogic-solution-visual .seo-photo-img {
        width: 100%;
        height: auto !important;
        object-fit: contain !important;
        transform: none !important;
        filter: none !important;
    }
}

@media (max-width: 768px) {

    .seo-content-intro,
    .seo-rich-subtitle,
    .seo-local-subtitle {
        font-size: var(--font-size-base);
        line-height: 1.6;
    }

    .seo-content-title,
    .seo-rich-title,
    .seo-local-title {
        font-size: var(--font-size-2xl);
    }

    .seo-industry-grid,
    .seo-steps-track,
    .seo-local-pillars,
    .seo-template-cards {
        grid-template-columns: 1fr;
    }

    .seo-industry-card,
    .seo-step-card,
    .seo-template-card {
        padding: var(--spacing-sm);
    }

    .thinkogic-solution-copy,
    .seo-hero-copy,
    .seo-template-main {
        padding: var(--spacing-md);
    }

    .thinkogic-solution-frame {
        border-radius: 18px;
        padding: 10px;
    }

    .thinkogic-problem-strip {
        gap: 6px;
    }

    .thinkogic-problem-strip strong,
    .thinkogic-problem-strip span,
    .thinkogic-proof-row span {
        padding: 6px 9px;
    }

    .thinkogic-step-card {
        grid-template-columns: 34px minmax(0, 1fr);
        padding: 10px;
    }

    .thinkogic-step-number {
        width: 28px;
        height: 28px;
        font-size: 0.62rem;
    }

    .thinkogic-proof-row {
        gap: 6px;
    }

    .thinkogic-solution-note {
        font-size: var(--font-size-xs);
        line-height: 1.6;
    }

    .thinkogic-solution-visual .seo-photo-img {
        width: 100%;
        height: auto !important;
        object-fit: contain !important;
        transform: none !important;
        filter: none !important;
    }

    .seo-photo-img {
        height: clamp(230px, 56vw, 320px);
    }

    .seo-hero-visual .seo-photo-img {
        height: clamp(250px, 58vw, 340px);
    }

    .seo-photo-label {
        font-size: 0.68rem;
        padding: 7px 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .seo-kicker {
        font-size: 0.68rem;
        padding: 7px 10px;
    }

    .seo-keyword-list {
        gap: 8px;
    }

    .seo-keyword-chip,
    .seo-chip-track span {
        font-size: var(--font-size-xs);
        padding: 6px 10px;
    }

    .seo-rich-title-left,
    .seo-rich-subtitle-left {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .seo-checklist li {
        font-size: var(--font-size-sm);
    }
}

@media (prefers-reduced-motion: reduce) {

    .seo-reveal,
    .seo-hero-visual,
    .seo-photo-card,
    .seo-photo-img,
    .seo-keyword-chip,
    .seo-industry-card,
    .seo-step-card,
    .seo-checklist li,
    .seo-template-card,
    .seo-local-pillar,
    .seo-chip-track,
    .seo-chip-track span {
        transition: none;
        animation: none;
    }
}

/* Testimonials Section */
.testimonials-section {
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 50%, #EEF4FF 100%);
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    padding: var(--spacing-xxl) 0;
}

.testimonials-shell {
    max-width: 1120px;
    margin: 0 auto;
}

.testimonials-header {
    text-align: center;
    margin-bottom: clamp(20px, 3vw, 28px);
}

.testimonials-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E40AF;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: rgba(219, 234, 254, 0.95);
    border: 1px solid rgba(147, 197, 253, 0.85);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.testimonials-header h2 {
    font-size: var(--font-size-3xl);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #0E1B56 0%, #1D4ED8 60%, #0EA5E9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.testimonials-header p {
    margin: 0 auto;
    max-width: 760px;
    color: #334155;
    font-size: var(--font-size-base);
    line-height: 1.65;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: #93C5FD;
    box-shadow: 0 20px 32px rgba(37, 99, 235, 0.14);
}

.testimonial-rating {
    width: fit-content;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #1E40AF;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 999px;
    padding: 6px 10px;
    margin-bottom: 10px;
}

.testimonial-text {
    margin: 0 0 14px 0;
    color: #1E293B;
    font-size: var(--font-size-sm);
    line-height: 1.65;
}

.testimonial-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.testimonial-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(140deg, #2563EB 0%, #0EA5E9 100%);
    box-shadow: 0 8px 14px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
}

.testimonial-name {
    display: block;
    color: #0F172A;
    font-size: var(--font-size-sm);
    line-height: 1.2;
}

.testimonial-role {
    display: block;
    color: #64748B;
    font-size: var(--font-size-xs);
    line-height: 1.35;
    margin-top: 2px;
}

@media (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .testimonials-header h2 {
        font-size: var(--font-size-2xl);
    }

    .testimonials-header p {
        font-size: var(--font-size-sm);
    }

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

/* Explore More Free Tools Section */
.free-tools-section {
    background: linear-gradient(180deg, #F6FAFF 0%, #FFFFFF 52%, #F1F7FF 100%);
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    padding: var(--spacing-xxl) 0;
}

.free-tools-shell {
    max-width: 1120px;
    margin: 0 auto;
}

.free-tools-header {
    text-align: center;
    margin-bottom: clamp(20px, 3vw, 28px);
}

.free-tools-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1E40AF;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: rgba(219, 234, 254, 0.95);
    border: 1px solid rgba(147, 197, 253, 0.85);
    border-radius: 999px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.free-tools-header h2 {
    font-size: var(--font-size-3xl);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #0E1B56 0%, #1D4ED8 60%, #0EA5E9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.free-tools-header p {
    margin: 0 auto;
    max-width: 760px;
    color: #334155;
    font-size: var(--font-size-base);
    line-height: 1.65;
}

.free-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.free-tool-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.free-tool-card:hover {
    transform: translateY(-5px);
    border-color: #93C5FD;
    box-shadow: 0 20px 32px rgba(37, 99, 235, 0.14);
}

.free-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1D4ED8;
    background: linear-gradient(140deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #BFDBFE;
    margin-bottom: 10px;
}

.free-tool-card h3 {
    margin: 0 0 8px;
    color: #0F172A;
    font-size: var(--font-size-lg);
    line-height: 1.3;
}

.free-tool-card p {
    margin: 0 0 12px;
    color: #334155;
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.free-tool-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: #1E3A8A;
    text-decoration: none;
    border: 1px solid #BFDBFE;
    background: rgba(239, 246, 255, 0.92);
    border-radius: 999px;
    padding: 8px 12px;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.free-tool-link:hover {
    transform: translateY(-1px);
    background: #DBEAFE;
    border-color: #93C5FD;
}

@media (max-width: 768px) {
    .free-tools-header h2 {
        font-size: var(--font-size-2xl);
    }

    .free-tools-header p {
        font-size: var(--font-size-sm);
    }

    .free-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Section */
.faq-section {
    background: radial-gradient(circle at 14% 14%, rgba(37, 99, 235, 0.12), transparent 34%),
        radial-gradient(circle at 86% 84%, rgba(14, 165, 233, 0.1), transparent 32%),
        linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 52%, #EEF4FF 100%);
    padding: var(--spacing-xxl) 0;
    margin-top: var(--spacing-xxl);
    border-top: 1px solid #E2E8F0;
}

.faq-section .container {
    max-width: 1020px;
}

.faq-section .section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(90deg, #0E1B56 0%, #1D4ED8 58%, #0EA5E9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-item {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #DBEAFE;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
    transition: transform 0.26s ease, box-shadow 0.26s ease, border-color 0.26s ease;
}

.faq-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #2563EB 0%, #0EA5E9 100%);
    opacity: 0;
    transition: opacity 0.26s ease;
}

.faq-item:hover {
    transform: translateY(-3px);
    border-color: #93C5FD;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.14);
}

.faq-question {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.faq-question span:first-child {
    flex: 1;
    line-height: 1.4;
}

.faq-answer {
    color: #334155;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease, margin-top 0.32s ease, padding-top 0.32s ease, border-top-color 0.32s ease;
    font-size: var(--font-size-sm);
    font-weight: 400;
    margin-top: 0;
    padding: 0;
    border-top: 1px solid transparent;
}

.faq-item.active .faq-answer {
    max-height: 740px;
    margin-top: 12px;
    padding-top: 12px;
    border-top-color: #E2E8F0;
}

.faq-toggle {
    color: #1E3A8A;
    transition: transform 0.3s ease;
    margin-left: 6px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #BFDBFE;
    background: linear-gradient(180deg, #EFF6FF 0%, #DBEAFE 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-item.active {
    border-color: #93C5FD;
}

.faq-item.active::before {
    opacity: 1;
}

.faq-answer a,
.faq-link {
    color: #1D4ED8;
    text-decoration: underline;
    text-decoration-color: rgba(29, 78, 216, 0.45);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.faq-answer a:hover,
.faq-link:hover {
    color: #1E3A8A;
    text-decoration-color: rgba(30, 58, 138, 0.8);
}

@media (max-width: 768px) {
    .faq-section .section-title {
        font-size: var(--font-size-2xl);
        margin-bottom: 16px;
    }

    .faq-item {
        padding: 14px;
        border-radius: 14px;
    }

    .faq-question {
        font-size: var(--font-size-sm);
    }

    .faq-answer {
        font-size: var(--font-size-xs);
        line-height: 1.55;
    }

    .faq-toggle {
        width: 24px;
        height: 24px;
    }
}


/* Validation Styles */
.field-invalid {
    border-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.05) !important;
}

.field-invalid:hover {
    border-color: #4285f4 !important;
    background-color: transparent !important;
}

.field-invalid:focus {
    border-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.1) !important;
}

.btn-disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn-disabled:hover,
button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Editable Fields Highlight Animation */
@keyframes highlightEditable {
    0% {
        border-color: #93c5fd;
        box-shadow: 0 0 0 0 rgba(147, 197, 253, 0.3);
        background-color: rgba(147, 197, 253, 0.03);
    }

    50% {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(147, 197, 253, 0);
        background-color: rgba(147, 197, 253, 0.05);
    }

    100% {
        border-color: #93c5fd;
        box-shadow: 0 0 0 0 rgba(147, 197, 253, 0);
        background-color: rgba(147, 197, 253, 0.03);
    }
}

.field-highlight-animation {
    animation: highlightEditable 2s ease-in-out infinite;
    border-width: 1px !important;
}

/* Remove animation after 5 seconds */
.field-highlight-animation.animation-complete {
    animation: none;
    border-color: #E5E7EB !important;
    background-color: transparent !important;
    border-width: 1px !important;
    transition: all 0.3s ease;
}
