@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Bengali:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

#custom-builder-wrapper {
    font-family: 'Noto Serif Bengali', sans-serif;
    color: #1f2937;
    width: 100%;
    max-width: 80rem;
    margin: 0.5rem auto;
}

#custom-builder-wrapper .glass-panel { background-color: #ffffff; border: 1px solid rgba(226, 232, 240, 0.5); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02); border-radius: 0.75rem; }
.dark #custom-builder-wrapper .glass-panel { background-color: #1e293b; border-color: rgba(51, 65, 85, 0.4); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }

#custom-builder-wrapper .input-field { background-color: #f8fafc; border: 1px solid #cbd5e1; color: #0f172a; transition: all 0.3s ease; }
.dark #custom-builder-wrapper .input-field { background-color: #0f172a; border-color: #4b5563; color: #f8fafc; }
#custom-builder-wrapper .input-field:focus { background-color: #ffffff; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); outline: none; }
.dark #custom-builder-wrapper .input-field:focus { background-color: #1e293b; }

#workspace-container { background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 20px 20px; transition: background-color 0.3s ease; }
.dark #workspace-container { background-image: radial-gradient(#334155 1px, transparent 1px); }

#workspace-container:fullscreen { background-color: #f8fafc; border: none !important; border-radius: 0 !important; }
.dark #workspace-container:fullscreen { background-color: #0f172a; }

.math-notebook { background-image: linear-gradient(#e2e8f0 1px, transparent 1px); background-size: 100% 2.2rem; background-position: 0 2.1rem; line-height: 2.2rem; padding-top: 0.5rem; }
.dark .math-notebook { background-image: linear-gradient(#334155 1px, transparent 1px); }

.tool-btn { transition: all 0.2s; }
.tool-btn.active { background-color: #4f46e5; color: white; border-color: #4f46e5; }
.dark .tool-btn.active { background-color: #6366f1; border-color: #6366f1; }

.cursor-draw { cursor: crosshair; }
.cursor-move { cursor: move; }
.cursor-curve { cursor: ns-resize; }
.cursor-pan { cursor: grab !important; }
.cursor-pan:active { cursor: grabbing !important; }
.cursor-pointer-exact { cursor: pointer !important; }

.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 20px; }
.dark .custom-scrollbar::-webkit-scrollbar-thumb { background-color: #475569; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.fade-in-up { animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.typing-cursor::after { content: '|'; animation: blink 1s step-end infinite; color: #4f46e5; font-weight: bold; }
@keyframes blink { 50% { opacity: 0; } }

.clearfix::after { content: ""; clear: both; display: table; }

input[type=range] { -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: #4f46e5; cursor: pointer; margin-top: -6px; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #cbd5e1; border-radius: 2px; }
.dark input[type=range]::-webkit-slider-runnable-track { background: #475569; }

/* Tailwind-like utilities used in the template */
.w-full { width: 100%; }
.flex { display: flex; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-auto { margin-left: auto; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-l-2 { border-left-width: 2px; }
.border-dashed { border-style: dashed; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.shrink-0 { flex-shrink: 0; }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-pointer { cursor: pointer; }
.touch-none { touch-action: none; }
.transition-all { transition: all 0.15s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.07); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0,0,0,0.1); }
.shadow-inner { box-shadow: inset 0 2px 4px rgba(0,0,0,0.06); }
.backdrop-blur-md { backdrop-filter: blur(12px); }
.break-all { word-break: break-all; }
.whitespace-nowrap { white-space: nowrap; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }
.block { display: block; }
.inline { display: inline; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flex-1 { flex: 1 1 0%; }
.min-h-screen { min-height: 100vh; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.inset-0 { inset: 0; }

/* Colors */
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-white { color: #ffffff; }
.text-primary { color: #4f46e5; }
.text-emerald-400 { color: #34d399; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-indigo-300 { color: #a5b4fc; }
.text-indigo-400 { color: #818cf8; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: #4f46e5; }
.text-indigo-700 { color: #4338ca; }
.text-orange-400 { color: #fb923c; }
.text-orange-500 { color: #f97316; }
.text-orange-600 { color: #ea580c; }
.text-orange-700 { color: #c2410c; }
.text-blue-400 { color: #60a5fa; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-yellow-500 { color: #eab308; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-red-50 { background-color: #fef2f2; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-primary { background-color: #4f46e5; }

.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-indigo-100 { border-color: #e0e7ff; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-indigo-400 { border-color: #818cf8; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-red-100 { border-color: #fee2e2; }
.border-red-200 { border-color: #fecaca; }
.border-orange-200 { border-color: #fed7aa; }
.border-primary { border-color: #4f46e5; }

.dark .text-gray-200 { color: #e5e7eb; }
.dark .text-gray-300 { color: #d1d5db; }
.dark .text-gray-400 { color: #9ca3af; }
.dark .text-gray-500 { color: #6b7280; }
.dark .text-white { color: #ffffff; }
.dark .bg-slate-800 { background-color: #1e293b; }
.dark .bg-slate-900 { background-color: #0f172a; }
.dark .border-gray-700 { border-color: #374151; }
.dark .border-gray-800 { border-color: #1f2937; }
.dark .border-indigo-600 { border-color: #4f46e5; }

@media print {
    body { visibility: hidden; background-color: #fff !important; margin: 0; padding: 0; }
    #custom-builder-wrapper { margin: 0; padding: 0; box-shadow: none; }
    #print-container { display: block !important; visibility: visible; position: absolute; left: 0; top: 0; width: 100%; background-color: #fff !important; }
    .no-print { display: none !important; }
    .print-step-card { display: flex !important; flex-direction: row-reverse !important; align-items: stretch !important; justify-content: space-between !important; border: 1px solid #cbd5e1 !important; border-radius: 8px !important; padding: 16px !important; margin-bottom: 20px !important; background: #fff !important; box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; }
    .step-text-content { flex: 0 0 60% !important; border-right: 1.5px solid #cbd5e1 !important; padding-right: 20px !important; display: block !important; }
    @page { margin: 8mm; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
@keyframes lmFormulaReveal { from { opacity:0; max-height:0; transform:translateY(-5px) } to { opacity:1; max-height:180px; transform:translateY(0) } }
@keyframes lmFormulaAttention { 0%,100% { box-shadow:0 0 0 0 rgba(245,158,11,0) } 45% { box-shadow:0 0 0 5px rgba(245,158,11,.28); transform:scale(1.015) } }
.lm-curve-help-open { animation:lmFormulaReveal .28s ease both; }
.lm-formula-attention { animation:lmFormulaAttention .85s ease 3; }
.lm-anyshape-reminder { animation:lmFormulaAttention .9s ease infinite; }
.lm-curve-type-btn { position:relative; min-height:48px; padding:8px 24px 7px 8px; border:2px solid #cbd5e1 !important; border-radius:12px; background:#fff !important; color:#64748b !important; font-size:10px; font-weight:900; line-height:1.1; opacity:.78; transition:background .16s ease,color .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease; }
.lm-curve-type-btn small { display:block; margin-top:3px; font-size:7px; opacity:.82; }
.lm-curve-check { position:absolute; top:5px; right:6px; width:17px; height:17px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:#fff; color:#2563eb; font-size:9px; opacity:0; transform:scale(.45); transition:.16s ease; }
.lm-curve-type-btn.is-active { background:#2563eb !important; border-color:#1d4ed8 !important; color:#fff !important; opacity:1 !important; box-shadow:0 0 0 3px rgba(59,130,246,.22),0 6px 14px rgba(37,99,235,.28) !important; transform:translateY(-1px); }
.lm-curve-type-btn.is-active .lm-curve-check { opacity:1; transform:scale(1); }
.dark .lm-curve-type-btn { background:#1e293b !important; color:#94a3b8 !important; border-color:#475569 !important; }
.dark .lm-curve-type-btn.is-active { background:#2563eb !important; color:#fff !important; border-color:#60a5fa !important; }
.lm-measure-strategy{margin-bottom:12px;padding:9px;border:1px solid #bae6fd;border-radius:15px;background:linear-gradient(145deg,#f0f9ff,#fff);box-shadow:0 5px 14px rgba(14,116,144,.08)}
.lm-strategy-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.lm-strategy-btn{min-height:43px;padding:5px;border:1px solid #cbd5e1;border-radius:11px;background:#fff;color:#475569;font-size:10px;font-weight:900}.lm-strategy-btn small{display:block;font-size:7px}.lm-strategy-btn.is-active{border-color:#2563eb;color:#fff;background:linear-gradient(135deg,#2563eb,#4f46e5);box-shadow:0 4px 11px rgba(37,99,235,.24)}.lm-measure-strategy>p{margin:7px 2px 0;color:#64748b;font-size:8px;font-weight:700;line-height:1.45}
.lm-strategy-tabs.has-five{grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}.lm-strategy-tabs.has-five .lm-strategy-btn{padding:4px 2px;font-size:8px;white-space:nowrap;min-width:0}.lm-quad-note{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:7px;padding:7px 8px;border:1px solid #a7f3d0;border-radius:10px;background:#ecfdf5;color:#065f46;font-size:8px;font-weight:800}.lm-quad-help-btn{width:24px;height:24px;flex:0 0 24px;border:1px solid currentColor;border-radius:50%;background:#fff;font-weight:900}.lm-quad-help{margin-top:5px;padding:8px;border:1px solid #bfdbfe;border-radius:10px;background:#fff;color:#334155;font-size:8px;line-height:1.55}
.lm-angle-card{margin-bottom:12px;padding:9px;border:1px solid #fcd34d;border-radius:14px;background:#fffbeb}.lm-angle-pattern{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;gap:6px}.lm-angle-pattern button{height:38px;border:1px solid #fbbf24;border-radius:10px;color:#b45309;background:#fff}.lm-angle-pattern button:disabled{opacity:.35}.lm-angle-pattern b{text-align:center;color:#92400e;font-size:10px}.lm-angle-card>p{margin:6px 0;color:#b45309;font-size:8px;text-align:center}
.lm-angle-input{display:flex;align-items:center;gap:7px;margin-top:7px;padding:6px;border:1px solid #ddd6fe;border-radius:11px;background:#fff}.lm-angle-input span{flex:1;color:#6d28d9;font-size:9px;font-weight:800}.lm-angle-input input{width:105px;height:36px;padding:0 7px;border:1px solid #c4b5fd;border-radius:9px;text-align:center;font-size:11px;font-weight:900;outline:none}.lm-angle-input input:focus{border-color:#7c3aed;box-shadow:0 0 0 3px rgba(124,58,237,.13)}
.lm-tie-input{margin-top:8px;padding:8px;border:1px solid #fed7aa;border-radius:12px;background:#fff}.lm-tie-input>b{display:block;color:#9a3412;font-size:10px}.lm-tie-input>small{display:block;margin-top:2px;color:#c2410c;font-size:7px;line-height:1.4}.lm-tie-input>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:7px}.lm-tie-input label{color:#9a3412;font-size:7px;font-weight:800;text-align:center}.lm-tie-input input{width:100%;height:36px;margin-top:3px;padding:0 4px;border:1px solid #fdba74;border-radius:9px;text-align:center;font-size:10px;font-weight:900;outline:none}
.dark .lm-measure-strategy{border-color:#075985;background:linear-gradient(145deg,#082f49,#0f172a)}.dark .lm-strategy-btn{border-color:#475569;background:#1e293b;color:#cbd5e1}.dark .lm-strategy-btn.is-active{background:linear-gradient(135deg,#2563eb,#4f46e5);color:#fff}.dark .lm-angle-card{border-color:#92400e;background:rgba(120,53,15,.22)}.dark .lm-angle-input,.dark .lm-tie-input{background:#1e293b;border-color:#475569}.dark .lm-angle-input input,.dark .lm-tie-input input{color:#f8fafc;background:#0f172a}
@media(max-width:480px){.lm-tie-input>div{gap:3px}.lm-tie-input label{font-size:6.5px}.lm-tie-input input{height:38px}.lm-angle-input{align-items:stretch;flex-direction:column}.lm-angle-input input{width:100%}}
