/* ZapCount - Base Styles */

:root {
    /* Core Palette */
    --primary: #4f46e5;      /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary: #0ea5e9;    /* Sky 500 */
    --accent: #f43f5e;       /* Rose 500 */
    
    /* Neutrals */
    --bg-body: #f8fafc;      /* Slate 50 */
    --bg-surface: #ffffff;
    --text-main: #0f172a;    /* Slate 900 */
    --text-muted: #64748b;   /* Slate 500 */
    --text-light: #94a3b8;   /* Slate 400 */
    --border: #e2e8f0;       /* Slate 200 */
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --container-width: 1200px;
    --header-height: 70px;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    display: inline-block;
    width: 1em;
    height: 1em;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1;
}

/* Utilities */
.lc-hidden, .hidden { display: none !important; }

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.lc-header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lc-logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.lc-logo img {
    margin-right: -3px;
    transform: translateY(-2px);
}

.lc-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lc-cta-button {
    background: var(--text-main);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.lc-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: #000;
}

/* Container */
.lc-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.lc-section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lc-section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 4rem;
}

/* Hero Section */
.lc-hero {
    padding: 4rem 0 4rem;
    background: radial-gradient(50% 50% at 50% 10%, rgba(79, 70, 229, 0.1) 0%, transparent 100%);
    position: relative;
    overflow: hidden;
}

.lc-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), transparent);
}

/* Hero Background Icons */
.lc-hero-background-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lc-floating-icon {
    position: absolute;
    opacity: 0.15;
    color: var(--primary);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.lc-floating-icon .material-symbols-outlined {
    font-size: 48px;
    width: 100%;
    height: 100%;
}

/* Icon Specifics */
.lc-icon-1 { top: 15%; left: 8%; }
.lc-icon-2 { bottom: 20%; right: 8%; }
.lc-icon-3 { top: 12%; right: 15%; }
.lc-icon-4 { bottom: 15%; left: 20%; }
.lc-icon-5 { top: 50%; left: 50%; margin-left: -20px; margin-top: -20px; }
.lc-icon-6 { top: 30%; left: 5%; }
.lc-icon-7 { top: 60%; right: 12%; }
.lc-icon-8 { bottom: 10%; left: 50%; margin-left: -20px; }
.lc-icon-9 { bottom: 35%; left: 10%; }
.lc-icon-10 { top: 25%; right: 35%; }

/* Animation classes applied to children */
.lc-floating-icon span {
    animation: scurry var(--duration, 10s) linear infinite;
}

@keyframes scurry {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(var(--tx-1, 30px), var(--ty-1, -30px)) rotate(var(--r-1, 10deg)); }
    40% { transform: translate(var(--tx-2, -20px), var(--ty-2, 20px)) rotate(var(--r-2, -20deg)); }
    60% { transform: translate(var(--tx-3, 40px), var(--ty-3, 10px)) rotate(var(--r-3, 40deg)); }
    80% { transform: translate(var(--tx-4, -10px), var(--ty-4, -40px)) rotate(var(--r-4, -10deg)); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* Individual variations */
.lc-icon-1 span { animation-duration: 45s; animation-delay: -12s; }
.lc-icon-2 span { animation-duration: 55s; animation-delay: -37s; }
.lc-icon-3 span { animation-duration: 50s; animation-delay: -22s; }
.lc-icon-4 span { animation-duration: 48s; animation-delay: -41s; }
.lc-icon-5 span { animation-duration: 52s; animation-delay: -5s; }
.lc-icon-6 span { animation-duration: 40s; animation-delay: -28s; }
.lc-icon-7 span { animation-duration: 47s; animation-delay: -33s; }
.lc-icon-8 span { animation-duration: 46s; animation-delay: -19s; }
.lc-icon-9 span { animation-duration: 53s; animation-delay: -15s; }
.lc-icon-10 span { animation-duration: 49s; animation-delay: -25s; }

.lc-hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.lc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 100px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.lc-hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.04em;
}

.lc-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Demo Widget Styles (Ported) */
.demo-widget {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: left;
    border: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

[dir="rtl"] .demo-widget {
    text-align: right;
}

.file-input-wrapper {
    position: relative;
    border: 3px dashed rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    background: rgba(79, 70, 229, 0.02);
    cursor: pointer;
    transition: all 0.2s;
}

.file-input-wrapper:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.file-input-wrapper.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    transform: scale(1.01);
}

/* Demo Carousel */
.demo-carousel-container {
    margin-top: 1.5rem;
    text-align: center;
    position: relative;
}

.demo-arrow-wrapper {
    position: absolute;
    bottom: -130px;
    right: -60px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--accent);
    pointer-events: none;
    z-index: 10;
    animation: arrow-bounce 2s infinite ease-in-out;
}

[dir="rtl"] .demo-arrow-wrapper {
    right: auto;
    left: -60px;
    align-items: flex-start;
}

[dir="rtl"] .fancy-arrow {
    transform: scaleX(-1);
}

.fancy-arrow {
    color: var(--accent);
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

.click-animation {
    position: absolute;
    top: 62px;
    left: 38px;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.click-animation .ripple {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: ripple-effect 2s infinite ease-out;
}

@keyframes arrow-bounce {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5px, -5px) rotate(-2deg); }
}

@keyframes ripple-effect {
    0%, 55% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@media (max-width: 640px) {
    .demo-arrow-wrapper {
        right: 0;
        bottom: -90px;
        transform: scale(0.8);
    }
    [dir="rtl"] .demo-arrow-wrapper {
        right: auto;
        left: 0;
    }
}

.demo-carousel-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.demo-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start; /* Align start to prevent cut-off on overflow */
}

.demo-carousel::-webkit-scrollbar {
    height: 6px;
}

.demo-carousel::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-radius: 3px;
}

.demo-carousel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.demo-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s;
    background-color: var(--bg-body);
}

.demo-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.demo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.demo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 6px 4px;
    backdrop-filter: blur(2px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hidden { display: none; }

.status-row {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.status-text {
    font-size: 1.5rem;
}

.status-row.loading .status-text::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary);
    border-right-color: transparent;
    border-radius: 50%;
    margin-right: 12px;
    animation: spin 1s linear infinite;
}

[dir="rtl"] .status-row.loading .status-text::before {
    margin-right: 0;
    margin-left: 12px;
}

.feedback-title {
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.25rem;
}

.feedback-subtitle {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

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

#result {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.result-container {
    margin-top: 1.5rem;
    text-align: center;
}

.count-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.count-display #count {
    font-size: 3.5rem;
}

.count-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.preview-wrapper {
    position: relative;
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.preview-img {
    width: 100%;
    display: block;
}

canvas#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.price-note {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.accuracy-hint {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0.75rem 0 0.5rem;
    text-align: center;
}

.annotation-btn {
    margin-top: 0.5rem;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px dashed var(--border);
    color: var(--text-main);
}

.annotation-btn.annotation-btn-highlight {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
}

.annotation-btn.annotation-btn-highlight:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.annotation-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
}

.annotation-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    color: var(--text-main);
    border-color: var(--border);
    background: rgba(0, 0, 0, 0.02);
}

.lc-trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.lc-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lc-trust-item .material-symbols-outlined {
    color: var(--primary);
    font-size: 20px;
}

.lc-hero-image {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.hero-img {
    max-width: 70%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

/* Features Section */
.lc-features {
    padding: 6rem 0;
    background: white;
}

.lc-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.lc-feature-card {
    padding: 2rem;
    background: var(--bg-body);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.lc-feature-card:hover {
    background: white;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

body.modal-open {
    overflow: hidden;
}

.bbox-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.bbox-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 12, 34, 0.72);
    backdrop-filter: blur(6px);
}

.bbox-modal__dialog {
    position: relative;
    width: min(960px, 100%);
    max-height: 90vh;
    background: white;
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(5, 7, 19, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bbox-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem 2rem 0;
    flex-shrink: 0;
}

.bbox-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.bbox-modal__subtitle {
    margin-top: 0.5rem;
    color: var(--text-muted);
    max-width: 48ch;
}

.bbox-close {
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
}

.bbox-close:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.bbox-modal__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar for modal body */
.bbox-modal__body::-webkit-scrollbar {
    width: 8px;
}

.bbox-modal__body::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-radius: 4px;
}

.bbox-modal__body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.bbox-modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.bbox-stage-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-body);
    height: 60vh;
    min-height: 300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bbox-stage {
    position: relative;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
}

.bbox-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

#bbox-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.bbox-stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,247,255,0.9));
}

.bbox-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bbox-toolbar__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}

.bbox-toolbar__submit {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
}

.bbox-recount-btn-wide {
    min-width: 200px;
    justify-content: center;
    font-size: 1rem;
    padding: 0.75rem 2rem;
}

.bbox-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.bbox-box-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-grow: 1;
    align-items: center;
}

.bbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.bbox-chip button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.bbox-chip button:hover {
    color: var(--primary);
}

.bbox-box-empty {
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 768px) {
    .bbox-modal {
        padding: 1rem;
    }

    .bbox-modal__header {
        padding: 1.5rem 1.5rem 0;
    }

    .bbox-modal__body {
        padding: 1rem 1.5rem 1.5rem;
    }

    .bbox-toolbar__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .bbox-stage-container {
        min-height: 200px;
        max-width: 100%;
    }
}

.lc-feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
}

.lc-icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.lc-icon-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.lc-icon-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.lc-feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.lc-feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Steps Section */
.lc-steps {
    padding: 6rem 0;
    background: var(--bg-body);
}

.lc-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.lc-step-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.lc-step-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-body);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
}

[dir="rtl"] .lc-step-badge {
    right: auto;
    left: 1.5rem;
}

.lc-step-icon {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.lc-step-icon .material-symbols-outlined {
    font-size: 3rem;
}

.lc-step-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.lc-step-card p {
    color: var(--text-muted);
}

/* Use Cases */
.lc-use-cases {
    padding: 6rem 0;
    background: white;
}

.lc-use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.lc-use-case {
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    background: var(--bg-body);
    transition: transform 0.3s;
}

.lc-use-case:hover {
    transform: translateY(-4px);
    background: white;
    box-shadow: var(--shadow-md);
}

.lc-use-case-icon {
    width: 4rem;
    height: 4rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

/* FAQ */
.lc-faq {
    padding: 6rem 0;
    background: var(--bg-body);
}

.lc-faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.lc-faq-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.lc-faq-question {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.lc-faq-question .material-symbols-outlined {
    color: var(--secondary);
}

.lc-faq-answer {
    color: var(--text-muted);
    margin-left: 2.5rem;
}

[dir="rtl"] .lc-faq-answer {
    margin-left: 0;
    margin-right: 2.5rem;
}

/* Final CTA */
.lc-final-cta {
    padding: 6rem 0;
    background: white;
}

.lc-cta-box {
    background-color: #4338ca;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.15) 1.5px, transparent 1.5px),
        radial-gradient(circle at top right, #4f46e5, #4338ca);
    background-size: 24px 24px, 100% 100%;
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.lc-cta-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(4px);
}

.lc-cta-box h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.lc-cta-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.lc-cta-box .lc-btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    padding: 1rem 2rem;
    font-size: 1.125rem;
    gap: 0.75rem;
    text-decoration: none;
}

.lc-cta-box .lc-btn-primary:hover {
    background: white;
    color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: #0f172a;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

.lc-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.lc-footer-brand h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0;
}

.lc-footer-brand h3 img {
    margin-right: -2px;
    transform: translateY(-2px);
}

.lc-footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
    margin-bottom: 1.5rem;
}

.lc-footer-col h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lc-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lc-footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.lc-footer-links a:hover {
    color: white;
    transform: translateX(2px);
}

[dir="rtl"] .lc-footer-links a:hover {
    transform: translateX(-2px);
}

.lc-footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lc-footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
}

.lc-footer-bottom a:hover {
    color: white;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .lc-footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .lc-footer-brand p {
        margin: 0 auto 1.5rem;
    }

    .lc-footer-brand h3 {
        justify-content: center;
    }

    .lc-footer-links {
        align-items: center;
    }

    .lc-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Page Drop Overlay */
.page-drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(79, 70, 229, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.page-drop-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.page-drop-message {
    background: white;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.page-drop-overlay:not(.hidden) .page-drop-message {
    transform: translateY(0);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .lc-hero-title { font-size: 2.5rem; }
    .lc-hero-ctas { flex-direction: column; }
    .lc-trust-badges { flex-direction: column; gap: 0.5rem; }
    .lc-floating-icon { display: none; } /* Simplify on mobile */
    .hero-img { max-width: 100%; }
}

/* Input Container */
.bbox-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-sm);
}

.bbox-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.glass-input {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    width: 150px;
    outline: none;
    padding: 0.25rem 0;
}

.glass-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-size: 0.85rem;
}

.input-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.input-clear-btn:hover {
    color: var(--text-main);
}

.input-clear-btn.hidden {
    display: none;
}

.recount-btn-glass {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    opacity: 1; /* Always visible */
}

.recount-btn-glass:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.recount-btn-glass .material-symbols-outlined {
    font-size: 18px;
}

/* Override default focus ring for this specific input */
.glass-input:focus {
    box-shadow: none;
}

/* Hide original result container elements if any remain */
.object-name-input {
    /* styles from previous implementation might need reset if used elsewhere, 
       but we changed the class on the input so it should be fine. 
       Actually we kept class="object-name-input glass-input". 
       Let's check if object-name-input has conflicting styles. */
}

/* Points Toggle & Confidence Legend */
.points-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 0 12px 0;
    margin-top: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    width: 100%;
}

/* RTL adjustment removed as position is no longer absolute */


.toggle-label {
    white-space: nowrap;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Confidence Slider */
.confidence-slider-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

[dir="rtl"] .confidence-slider-container {
    margin-left: 0;
    margin-right: 8px;
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 1px solid var(--border);
}

.legend-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.slider-track {
    position: relative;
    width: 135px;
    height: 14px;
}

.slider-track-gradient {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    border-radius: 4px;
    background: linear-gradient(to right, 
        rgb(0, 0, 255),      /* Blue - 0% */
        rgb(0, 255, 255),    /* Cyan - 25% */
        rgb(0, 255, 0),      /* Green - 50% */
        rgb(255, 255, 0),    /* Yellow - 75% */
        rgb(255, 0, 0)       /* Red - 100% */
    );
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.confidence-range {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.confidence-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.confidence-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.confidence-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.confidence-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.confidence-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.confidence-range::-moz-range-track {
    background: transparent;
}

.confidence-range:focus {
    outline: none;
}

.confidence-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    .points-toggle-container {
        padding: 0 0 8px 0;
        gap: 8px;
        font-size: 0.75rem;
    }

    /* [dir="rtl"] .points-toggle-container { } - Removed */

    .points-toggle-container .toggle-label {
        display: none;
    }

    .confidence-slider-container {
        flex: 1;
        margin-left: 0;
        padding-left: 8px;
        border-left: 1px solid var(--border);
    }

    [dir="rtl"] .confidence-slider-container {
        margin-right: 0;
        padding-right: 8px;
        margin-left: 0;
        padding-left: 0;
        border-right: 1px solid var(--border);
        border-left: none;
    }

    .slider-track {
        width: auto;
        flex: 1;
    }

    .legend-label {
        font-size: 0.6rem;
    }
    
    .switch {
        width: 32px;
        height: 18px;
    }
    
    .slider:before {
        height: 12px;
        width: 12px;
    }
    
    input:checked + .slider:before {
        transform: translateX(14px);
    }
}

/* ========================================
   Image Cropper Modal
   ======================================== */

.cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cropper-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 12, 34, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cropper-modal__dialog {
    position: relative;
    width: min(900px, 100%);
    height: min(85vh, 700px);
    max-height: 95vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cropperModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cropper-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: white;
    position: relative;
    z-index: 1;
}

.cropper-modal__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.15rem;
}

.cropper-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.cropper-modal__subtitle {
    display: none; /* Hide on mobile, shown on larger screens */
}

.cropper-close {
    border: 1px solid var(--border);
    background: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}

.cropper-close:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.cropper-modal__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    background: var(--bg-body);
}

.cropper-stage {
    flex: 1;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
    border: 1px solid var(--border);
}

#cropper-canvas {
    display: block;
    cursor: crosshair;
    touch-action: none;
    /* Dimensions controlled entirely by JavaScript */
}

.cropper-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.cropper-toolbar__options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cropper-toolbar .btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.cropper-toolbar .btn-sm .material-symbols-outlined {
    font-size: 18px;
}

.cropper-toolbar__actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.cropper-toolbar__actions .btn {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    gap: 0.35rem;
}

[dir="rtl"] .cropper-toolbar__actions {
    margin-left: 0;
    margin-right: auto;
}

.cropper-toolbar__actions .btn .material-symbols-outlined {
    font-size: 18px;
}

/* Show subtitle on larger screens */
@media (min-width: 641px) {
    .cropper-modal__subtitle {
        display: block;
        margin-top: 0.25rem;
        color: var(--text-muted);
        font-size: 0.85rem;
        max-width: 50ch;
        line-height: 1.3;
    }
    
    .cropper-modal__header {
        padding: 1.25rem 1.5rem;
    }
    
    .cropper-modal__title {
        font-size: 1.25rem;
    }
}

/* Responsive cropper */
@media (max-width: 640px) {
    .cropper-modal {
        padding: 0.75rem;
    }
    
    .cropper-modal__dialog {
        max-height: 100%;
        height: 100%;
        border-radius: 16px;
    }
    
    .cropper-modal__header {
        padding: 0.75rem 1rem;
    }
    
    .cropper-modal__title {
        font-size: 1rem;
    }
    
    .cropper-modal__body {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .cropper-stage {
        min-height: 150px;
    }
    
    .cropper-toolbar {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .cropper-toolbar__options {
        width: 100%;
        justify-content: center;
    }
    
    .cropper-toolbar__actions {
        width: 100%;
        justify-content: stretch;
        margin-left: 0;
    }
    
    [dir="rtl"] .cropper-toolbar__actions {
        margin-right: 0;
    }
    
    .cropper-toolbar__actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Touch-friendly handles on mobile */
@media (pointer: coarse) {
    #cropper-canvas {
        cursor: default;
    }
}

/* ========================================
   Point Edit Toolbar
   ======================================== */

.edit-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 10px;
    background: var(--bg-body);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
    transition: opacity 0.2s, transform 0.2s;
}

.edit-toolbar.hidden {
    display: none;
}

.edit-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.edit-tool-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-main);
}

.edit-tool-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
}

.edit-tool-btn.active {
    background: rgba(79, 70, 229, 0.85);
    color: white;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.edit-tool-btn .material-symbols-outlined {
    font-size: 18px;
}

.edit-toolbar-divider {
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 2px;
}

/* Interactive overlay canvas */
.overlay-interactive {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.overlay-interactive.tool-active {
    pointer-events: auto;
}

/* Custom cursors for tools */
.overlay-interactive.tool-add {
    cursor: crosshair;
}

.overlay-interactive.tool-eraser {
    cursor: none; /* We'll draw a custom cursor */
}

/* Eraser cursor indicator */
.eraser-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    width: 28px;
    height: 28px;
    border: 2.5px solid #fff;
    background: rgba(239, 68, 68, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.eraser-cursor::before {
    content: "−";
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.eraser-cursor.visible {
    display: flex;
}

/* Point count badge on toolbar (for undo count) */
.undo-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.undo-count.hidden {
    display: none;
}

/* Mobile adjustments for edit toolbar */
@media (max-width: 480px) {
    .edit-toolbar {
        padding: 4px 8px;
        gap: 2px;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .edit-tool-btn {
        width: 28px;
        height: 28px;
        border-radius: 5px;
    }
    
    .edit-tool-btn .material-symbols-outlined {
        font-size: 16px;
    }
    
    .edit-toolbar-divider {
        height: 16px;
        margin: 0 1px;
    }
}

/* ========================================
   Tooltips
   ======================================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    background: var(--text-main);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-main);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::before,
[data-tooltip]:focus::before {
    opacity: 1;
    visibility: visible;
}

/* Tooltip position variants */
[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: var(--text-main);
}

[data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-pos="bottom"]:focus::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip-pos="left"]::after {
    bottom: auto;
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
}

[data-tooltip-pos="left"]::before {
    bottom: auto;
    left: auto;
    right: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: var(--text-main);
}

[data-tooltip-pos="left"]:hover::after,
[data-tooltip-pos="left"]:focus::after {
    transform: translateY(-50%) translateX(0);
}

[data-tooltip-pos="right"]::after {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]::before {
    bottom: auto;
    left: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: var(--text-main);
}

[data-tooltip-pos="right"]:hover::after,
[data-tooltip-pos="right"]:focus::after {
    transform: translateY(-50%) translateX(0);
}

/* Disabled elements should still show tooltip */
[data-tooltip]:disabled::after,
[data-tooltip]:disabled::before {
    pointer-events: none;
}

/* Tooltip wrapper for elements that can't have pseudo-elements (like inputs) */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

/* Confidence slider container tooltip */
.confidence-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Hide tooltips on touch devices to avoid sticky tooltips */
@media (hover: none) {
    [data-tooltip]::after,
    [data-tooltip]::before {
        display: none;
    }
}
