/* ---- base ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f3f4f6;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
.hidden { display: none !important; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.break-all { word-break: break-all; }
.text-right { text-align: right; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }
.z-10 { z-index: 10; }
.z-\[100\] { z-index: 100; }
.calc-locked #app-header,
.calc-locked #app-main { display: none !important; }
.calc-locked #view-calculator { display: flex !important; }

/* ---- layout ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex: 1 1 auto; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.left-0 { left: 0; }
.top-0 { top: 0; }
.bottom-10 { bottom: 40px; }

.sticky { position: sticky; }
.top-0 { top: 0; }

.grid { display: grid; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }

/* ---- spacing ---- */
.p-1 { padding: 4px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

.pl-3 { padding-left: 12px; }
.pl-10 { padding-left: 40px; }
.pr-3 { padding-right: 12px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.pt-4 { padding-top: 16px; }
.pb-4 { padding-bottom: 16px; }
.pb-5 { padding-bottom: 20px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }

.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }

/* ---- typography ---- */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-6xl { font-size: 3.75rem; }

.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.6; }
.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }

/* ---- colors (subset you use) ---- */
.bg-white { background: #ffffff; }
.bg-black { background: #000000; }
.bg-gray-50 { background: #f9fafb; }
.bg-gray-100 { background: #f3f4f6; }
.bg-gray-200 { background: #e5e7eb; }
.bg-gray-300 { background: #d1d5db; }
.bg-gray-400 { background: #9ca3af; }
.bg-gray-600 { background: #4b5563; }
.bg-gray-700 { background: #374151; }
.bg-gray-900 { background: #111827; }

.bg-blue-50 { background: #eff6ff; }
.bg-blue-100 { background: #dbeafe; }
.bg-blue-600 { background: #2563eb; }
.bg-blue-700 { background: #1d4ed8; }
.bg-blue-800 { background: #1e40af; }

.bg-yellow-50 { background: #fffbeb; }
.bg-yellow-100 { background: #fef3c7; }

.bg-orange-100 { background: #ffedd5; }
.bg-orange-500 { background: #f97316; }
.bg-orange-600 { background: #ea580c; }

.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-300 { color: #d1d5db; }
.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-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }

.text-yellow-600 { color: #d97706; }
.text-yellow-800 { color: #92400e; }

.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-100 { opacity: 1; }

/* ---- borders, radius, shadow ---- */
.border { border: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-none { border: none; }

.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-yellow-200 { border-color: #fde68a; }
.border-yellow-500 { border-color: #eab308; }
.border-blue-100 { border-color: #dbeafe; }
.border-blue-200 { border-color: #bfdbfe; }

.rounded { border-radius: 8px; }
.rounded-md { border-radius: 10px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.shadow-md { box-shadow: 0 4px 10px rgba(0,0,0,0.10); }
.shadow-lg { box-shadow: 0 10px 20px rgba(0,0,0,0.12); }
.shadow-xl { box-shadow: 0 20px 35px rgba(0,0,0,0.16); }

/* ---- simple hover/active you rely on ---- */
.hover\:bg-blue-50:hover { background: #eff6ff; }
.hover\:bg-blue-700:hover { background: #1d4ed8; }
.hover\:bg-blue-800:hover { background: #1e40af; }
.hover\:bg-yellow-100:hover { background: #fef3c7; }
.hover\:bg-gray-50:hover { background: #f9fafb; }
.hover\:bg-gray-300:hover { background: #d1d5db; }
.hover\:text-blue-500:hover { color: #3b82f6; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:opacity-100:hover { opacity: 1; }

.active\:bg-gray-50:active { background: #f9fafb; }
.active\:bg-yellow-50:active { background: #fffbeb; }
.active\:bg-gray-300:active { background: #d1d5db; }
.active\:bg-gray-600:active { background: #4b5563; }
.active\:bg-orange-600:active { background: #ea580c; }
.active\:opacity-80:active { opacity: 0.8; }

/* ---- your Tailwind @apply replacements ---- */
.help-section {
  background: #eff6ff;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #dbeafe;
}
.help-title {
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: white;
  font-size: 26px;
  cursor: pointer;
  padding: 4px;
}

/* ---- keep your existing custom classes from <style> ---- */
.script-text { font-size: 1.125rem; line-height: 1.75rem; }
