/* Medical Appointment System - Shared Styles */

/* Font Family for Chinese Text */
body, html {
    font-family: "Kaiti", "楷体", "STKaiti", "华文楷体", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

/* Brand Color System (Modern Blue Medical Theme) */
:root {
    /* Primary Blues - Main brand colors */
    --brand-600: #3D7FD9; /* Deep blue */
    --brand-500: #5B9FFF; /* Main blue - lighter, more vibrant */
    --brand-450: #6EADFF; /* Mid blue */
    --brand-400: #7FB8FF; /* Light blue */
    --brand-350: #91C3FF; /* Lighter blue */
    --brand-300: #A8D4FF; /* Very light blue */
    --brand-250: #BBDDFF; /* Pale blue */
    --brand-200: #CEE8FF; /* Super pale blue */
    --brand-150: #E0F2FF; /* Ultra pale blue */
    --brand-100: #F0F8FF; /* Almost white blue */
    
    /* Neutral Colors */
    --neutral-1000: #1F2937; /* Dark gray */
    --neutral-100: #FFFFFF; /* White */
    
    /* Text Colors */
    --logo-text: #FFFFFF; /* White text on blue */
    --logo-contrast: #1F2937; /* Dark gray for contrast */
    
    /* Accent Colors */
    --accent-teal: #4ECDC4;
    --accent-green: #5FD8B4;
    --accent-pink: #FF6B9D;
    
    /* UI Colors */
    --background-gray: #F5F7FA;
    --light-gray: #E8ECF2;
    --medium-gray: #9CA3AF;
    --dark-gray: #374151;
}

/* Public theme overrides (exclude admin by not adding .theme-brand there) */
.theme-brand .bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--brand-600), var(--brand-300)) !important;
}

/* Recolor inline SVGs and images using CSS vars where possible */
.theme-brand img[alt="Logo"] {
    /* keep original artwork, but ensure surrounding accents match brand */
    background: var(--neutral-100);
    border-radius: 9999px;
    padding: 4px;
    border: 2px solid var(--brand-500);
}

/* Brand logo text helper */
.brand-logo-text {
    color: var(--logo-text) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Slightly stronger shadow for big desktop hero title */
h1.brand-logo-text {
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

/* Fixed-size ad card styles for public grid */
.promo-card {
    height: 330px;
    display: flex;
    flex-direction: column;
}
.promo-card img { height: 140px; }
.promo-card .promo-body { flex: 1; display: flex; flex-direction: column; }
.promo-card .promo-body .promo-cta { margin-top: auto; }
.promo-card .promo-title { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.promo-card .promo-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Home page: map generic white text to white for blue backgrounds */
.home-brand :where(h1,h2,h3,h4,h5,h6,p,span,div,li,small,strong,em,blockquote).text-white,
.home-brand :where(h1,h2,h3,h4,h5,h6,p,span,div,li,small,strong,em,blockquote) .text-white {
    color: #FFFFFF !important;
}
.home-brand button.text-white,
.home-brand a.text-white,
.home-brand i.text-white,
.home-brand svg.text-white { color: #ffffff !important; }

/* Home page specific overrides for requested elements */
/* Tagline under the main title */
.home-brand .text-blue-100 { color: #FFFFFF !important; opacity: 0.9 !important; }
/* "了解更多" buttons in ad cards */
.home-brand .promo-cta { color: #FFFFFF !important; border: 1px solid rgba(255, 255, 255, 0.3); }
.home-brand .promo-cta i { color: #FFFFFF !important; }

/* Booking: Confirm button text color */
.booking-confirm-btn { color: #FFFFFF !important; }

/*
   Public pages mapping: convert white text utilities to white for blue backgrounds
   Only under .theme-brand so Admin panel remains unchanged.
*/
.theme-brand :where(h1,h2,h3,h4,h5,h6,p,span,div,li,small,label,strong,em,blockquote)
  .text-white, /* nested variant */
.theme-brand :where(h1,h2,h3,h4,h5,h6,p,span,div,li,small,label,strong,em,blockquote).text-white {
    color: #FFFFFF !important;
}

/* Keep controls and icons white unless explicitly styled (public pages only) */
.theme-brand button.text-white,
.theme-brand a.text-white,
.theme-brand i.text-white,
.theme-brand svg.text-white,
.theme-brand .btn.text-white {
    color: #ffffff !important;
}

/* Crop-only-top variant for the homepage logo */
.logo-crop {
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    border: 2px solid var(--brand-500);
    background: var(--neutral-100);
    display: inline-flex;
    align-items: flex-start; /* anchor to top */
    justify-content: center;
    overflow: hidden; /* crop to circle */
}

.logo-crop img.logo-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: none;
}

/* Larger desktop variant */
.logo-lg { width: 140px; height: 140px; }
@media (min-width: 1024px) {
  .logo-lg { width: 180px; height: 180px; }
}

.theme-brand .text-purple-600,
.theme-brand .text-blue-600,
.theme-brand .text-green-600,
.theme-brand .text-indigo-600,
.theme-brand .text-violet-600,
.theme-brand .text-emerald-600 {
    color: var(--brand-600) !important;
}

.theme-brand .bg-purple-600,
.theme-brand .bg-blue-600,
.theme-brand .bg-green-600,
.theme-brand .bg-indigo-600,
.theme-brand .bg-violet-600,
.theme-brand .bg-emerald-600 {
    background-color: var(--brand-500) !important;
    border-color: var(--brand-500) !important;
}

.theme-brand .hover\:bg-purple-700:hover,
.theme-brand .hover\:bg-blue-700:hover,
.theme-brand .hover\:bg-green-700:hover,
.theme-brand .hover\:bg-indigo-700:hover,
.theme-brand .hover\:bg-violet-700:hover,
.theme-brand .hover\:bg-emerald-700:hover {
    background-color: var(--brand-600) !important;
}

.theme-brand .focus\:ring-purple-500:focus,
.theme-brand .focus\:ring-blue-500:focus,
.theme-brand .focus\:ring-green-500:focus,
.theme-brand .focus\:ring-indigo-500:focus,
.theme-brand .focus\:ring-violet-500:focus,
.theme-brand .focus\:ring-emerald-500:focus {
    --tw-ring-color: var(--brand-500) !important;
}

.theme-brand .bg-blue-50,
.theme-brand .bg-purple-50,
.theme-brand .bg-orange-50,
.theme-brand .bg-green-50,
.theme-brand .bg-indigo-50,
.theme-brand .bg-violet-50,
.theme-brand .bg-emerald-50 {
    background-color: var(--brand-100) !important;
}

.theme-brand .border-blue-200,
.theme-brand .border-purple-200,
.theme-brand .border-green-200,
.theme-brand .border-indigo-200,
.theme-brand .border-violet-200,
.theme-brand .border-emerald-200 {
    border-color: var(--brand-200) !important;
}

.theme-brand .from-blue-600 { --tw-gradient-from: var(--brand-600) !important; }
.theme-brand .to-indigo-600 { --tw-gradient-to: var(--brand-300) !important; }
.theme-brand .from-green-600 { --tw-gradient-from: var(--brand-600) !important; }
.theme-brand .to-emerald-600 { --tw-gradient-to: var(--brand-300) !important; }
.theme-brand .from-purple-600 { --tw-gradient-from: var(--brand-600) !important; }
.theme-brand .to-violet-600 { --tw-gradient-to: var(--brand-300) !important; }

/* Map service-card gradients to brand palette (mobile + desktop) */
.theme-brand .from-green-500, 
.theme-brand .from-purple-500,
.theme-brand .from-blue-500,
.theme-brand .from-orange-500 {
  --tw-gradient-from: var(--brand-600) !important;
}
.theme-brand .to-emerald-500,
.theme-brand .to-emerald-600,
.theme-brand .to-violet-600,
.theme-brand .to-indigo-600,
.theme-brand .to-red-500,
.theme-brand .to-red-600,
.theme-brand .to-orange-500,
.theme-brand .to-orange-600 {
  --tw-gradient-to: var(--brand-300) !important;
}

/* Make gradient text/overlays legible on brand background */
.theme-brand .text-blue-100,
.theme-brand .text-green-100,
.theme-brand .text-purple-100,
.theme-brand .text-orange-100 {
  color: #FFFFFF !important;
  opacity: 0.9 !important;
}

/* Font Size Control Variables */
:root {
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;
    --font-size-5xl: 48px;
}

/* Font Size Control Classes */
.font-size-small {
    --font-size-base: 12px;
    --font-size-small: 10px;
    --font-size-large: 14px;
    --font-size-xl: 16px;
    --font-size-2xl: 18px;
    --font-size-3xl: 22px;
    --font-size-4xl: 28px;
    --font-size-5xl: 36px;
}

.font-size-large {
    --font-size-base: 20px;
    --font-size-small: 18px;
    --font-size-large: 22px;
    --font-size-xl: 24px;
    --font-size-2xl: 30px;
    --font-size-3xl: 36px;
    --font-size-4xl: 42px;
    --font-size-5xl: 60px;
}

.font-size-extra-large {
    --font-size-base: 24px;
    --font-size-small: 22px;
    --font-size-large: 26px;
    --font-size-xl: 28px;
    --font-size-2xl: 36px;
    --font-size-3xl: 42px;
    --font-size-4xl: 48px;
    --font-size-5xl: 72px;
}

/* Apply font sizes to all text elements */
body.font-size-small h1 { font-size: var(--font-size-4xl); }
body.font-size-small h2 { font-size: var(--font-size-3xl); }
body.font-size-small h3 { font-size: var(--font-size-2xl); }
body.font-size-small h4 { font-size: var(--font-size-xl); }
body.font-size-small h5 { font-size: var(--font-size-large); }
body.font-size-small h6 { font-size: var(--font-size-base); }
body.font-size-small p { font-size: var(--font-size-small); }
body.font-size-small span { font-size: var(--font-size-small); }
body.font-size-small div { font-size: var(--font-size-small); }
body.font-size-small button { font-size: var(--font-size-small); }
body.font-size-small input { font-size: var(--font-size-small); }
body.font-size-small textarea { font-size: var(--font-size-small); }
body.font-size-small select { font-size: var(--font-size-small); }
body.font-size-small label { font-size: var(--font-size-small); }

body.font-size-large h1 { font-size: var(--font-size-4xl); }
body.font-size-large h2 { font-size: var(--font-size-3xl); }
body.font-size-large h3 { font-size: var(--font-size-2xl); }
body.font-size-large h4 { font-size: var(--font-size-xl); }
body.font-size-large h5 { font-size: var(--font-size-large); }
body.font-size-large h6 { font-size: var(--font-size-base); }
body.font-size-large p { font-size: var(--font-size-large); }
body.font-size-large span { font-size: var(--font-size-large); }
body.font-size-large div { font-size: var(--font-size-large); }
body.font-size-large button { font-size: var(--font-size-large); }
body.font-size-large input { font-size: var(--font-size-large); }
body.font-size-large textarea { font-size: var(--font-size-large); }
body.font-size-large select { font-size: var(--font-size-large); }
body.font-size-large label { font-size: var(--font-size-large); }

body.font-size-extra-large h1 { font-size: var(--font-size-4xl); }
body.font-size-extra-large h2 { font-size: var(--font-size-3xl); }
body.font-size-extra-large h3 { font-size: var(--font-size-2xl); }
body.font-size-extra-large h4 { font-size: var(--font-size-xl); }
body.font-size-extra-large h5 { font-size: var(--font-size-large); }
body.font-size-extra-large h6 { font-size: var(--font-size-base); }
body.font-size-extra-large p { font-size: var(--font-size-large); }
body.font-size-extra-large span { font-size: var(--font-size-large); }
body.font-size-extra-large div { font-size: var(--font-size-large); }
body.font-size-extra-large button { font-size: var(--font-size-large); }
body.font-size-extra-large input { font-size: var(--font-size-large); }
body.font-size-extra-large textarea { font-size: var(--font-size-large); }
body.font-size-extra-large select { font-size: var(--font-size-large); }
body.font-size-extra-large label { font-size: var(--font-size-large); }

/* Large font spacing adjustments to prevent overlapping */
body.font-size-large {
    line-height: 1.6 !important;
}

/* Extra large font spacing adjustments to prevent overlapping */
body.font-size-extra-large {
    line-height: 1.7 !important;
}

/* Increase spacing for form elements */
body.font-size-large .space-y-6 > * + * {
    margin-top: 1.5rem !important;
}

body.font-size-large .space-y-4 > * + * {
    margin-top: 1.25rem !important;
}

body.font-size-large .space-y-3 > * + * {
    margin-top: 1rem !important;
}

body.font-size-large .space-y-2 > * + * {
    margin-top: 0.75rem !important;
}

/* Form field spacing */
body.font-size-large .mb-4 {
    margin-bottom: 1.25rem !important;
}

body.font-size-large .mb-3 {
    margin-bottom: 1rem !important;
}

body.font-size-large .mb-2 {
    margin-bottom: 0.75rem !important;
}

body.font-size-large .mb-6 {
    margin-bottom: 1.5rem !important;
}

/* Input field spacing */
body.font-size-large input,
body.font-size-large textarea,
body.font-size-large select {
    margin-bottom: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    line-height: 1.5 !important;
}

/* Button spacing */
body.font-size-large button {
    padding: 0.75rem 1rem !important;
    line-height: 1.5 !important;
}

/* Card and container spacing */
body.font-size-large .p-4 {
    padding: 1.25rem !important;
}

body.font-size-large .p-6 {
    padding: 1.5rem !important;
}

body.font-size-large .px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

body.font-size-large .px-4 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

body.font-size-large .py-2 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

body.font-size-large .py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.font-size-large .py-4 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

/* Grid spacing */
body.font-size-large .gap-2 {
    gap: 0.75rem !important;
}

body.font-size-large .gap-3 {
    gap: 1rem !important;
}

body.font-size-large .gap-4 {
    gap: 1.25rem !important;
}

body.font-size-large .gap-6 {
    gap: 1.5rem !important;
}

/* Section spacing for form sections */
body.font-size-large .bg-blue-50,
body.font-size-large .bg-purple-50,
body.font-size-large .bg-orange-50,
body.font-size-large .bg-gray-50 {
    margin-bottom: 1.25rem !important;
    padding: 1.25rem !important;
}

/* Radio button grid spacing */
body.font-size-large .grid.grid-cols-2 {
    gap: 0.75rem !important;
}

body.font-size-large .grid.grid-cols-3 {
    gap: 0.75rem !important;
}

/* Progress indicator spacing */
body.font-size-large .flex.items-center.justify-between {
    padding: 0.75rem 1rem !important;
}

/* Header spacing */
body.font-size-large .bg-gradient-to-r {
    padding: 1.25rem !important;
}

/* Label spacing */
body.font-size-large label {
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Ensure proper line height for all text elements */
body.font-size-large h1,
body.font-size-large h2,
body.font-size-large h3,
body.font-size-large h4,
body.font-size-large h5,
body.font-size-large h6 {
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
}

body.font-size-large p {
    line-height: 1.6 !important;
    margin-bottom: 0.75rem !important;
}

/* Additional spacing for form sections */
body.font-size-large .space-y-6 > div:not(:last-child) {
    margin-bottom: 1.5rem !important;
}

body.font-size-large .space-y-4 > div:not(:last-child) {
    margin-bottom: 1.25rem !important;
}

/* Comprehensive spacing fixes for all Tailwind classes */
body.font-size-large .space-y-1 > * + * {
    margin-top: 0.5rem !important;
}

body.font-size-large .space-y-2 > * + * {
    margin-top: 0.75rem !important;
}

body.font-size-large .space-y-3 > * + * {
    margin-top: 1rem !important;
}

body.font-size-large .space-y-4 > * + * {
    margin-top: 1.25rem !important;
}

body.font-size-large .space-y-5 > * + * {
    margin-top: 1.5rem !important;
}

body.font-size-large .space-y-6 > * + * {
    margin-top: 1.5rem !important;
}

body.font-size-large .space-y-8 > * + * {
    margin-top: 2rem !important;
}

/* Margin bottom classes */
body.font-size-large .mb-1 {
    margin-bottom: 0.5rem !important;
}

body.font-size-large .mb-2 {
    margin-bottom: 0.75rem !important;
}

body.font-size-large .mb-3 {
    margin-bottom: 1rem !important;
}

body.font-size-large .mb-4 {
    margin-bottom: 1.25rem !important;
}

body.font-size-large .mb-5 {
    margin-bottom: 1.5rem !important;
}

body.font-size-large .mb-6 {
    margin-bottom: 1.5rem !important;
}

body.font-size-large .mb-8 {
    margin-bottom: 2rem !important;
}

/* Margin top classes */
body.font-size-large .mt-1 {
    margin-top: 0.5rem !important;
}

body.font-size-large .mt-2 {
    margin-top: 0.75rem !important;
}

body.font-size-large .mt-3 {
    margin-top: 1rem !important;
}

body.font-size-large .mt-4 {
    margin-top: 1.25rem !important;
}

body.font-size-large .mt-5 {
    margin-top: 1.5rem !important;
}

body.font-size-large .mt-6 {
    margin-top: 1.5rem !important;
}

body.font-size-large .mt-8 {
    margin-top: 2rem !important;
}

/* Padding classes */
body.font-size-large .p-1 {
    padding: 0.5rem !important;
}

body.font-size-large .p-2 {
    padding: 0.75rem !important;
}

body.font-size-large .p-3 {
    padding: 1rem !important;
}

body.font-size-large .p-4 {
    padding: 1.25rem !important;
}

body.font-size-large .p-5 {
    padding: 1.5rem !important;
}

body.font-size-large .p-6 {
    padding: 1.5rem !important;
}

body.font-size-large .p-8 {
    padding: 2rem !important;
}

/* Horizontal padding */
body.font-size-large .px-1 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

body.font-size-large .px-2 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

body.font-size-large .px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

body.font-size-large .px-4 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

body.font-size-large .px-5 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

body.font-size-large .px-6 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

body.font-size-large .px-8 {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

/* Vertical padding */
body.font-size-large .py-1 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

body.font-size-large .py-2 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

body.font-size-large .py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.font-size-large .py-4 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

body.font-size-large .py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

body.font-size-large .py-6 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

body.font-size-large .py-8 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Gap classes for flexbox and grid */
body.font-size-large .gap-1 {
    gap: 0.5rem !important;
}

body.font-size-large .gap-2 {
    gap: 0.75rem !important;
}

body.font-size-large .gap-3 {
    gap: 1rem !important;
}

body.font-size-large .gap-4 {
    gap: 1.25rem !important;
}

body.font-size-large .gap-5 {
    gap: 1.5rem !important;
}

body.font-size-large .gap-6 {
    gap: 1.5rem !important;
}

body.font-size-large .gap-8 {
    gap: 2rem !important;
}

/* Space between classes */
body.font-size-large .space-x-1 > * + * {
    margin-left: 0.5rem !important;
}

body.font-size-large .space-x-2 > * + * {
    margin-left: 0.75rem !important;
}

body.font-size-large .space-x-3 > * + * {
    margin-left: 1rem !important;
}

body.font-size-large .space-x-4 > * + * {
    margin-left: 1.25rem !important;
}

body.font-size-large .space-x-5 > * + * {
    margin-left: 1.5rem !important;
}

body.font-size-large .space-x-6 > * + * {
    margin-left: 1.5rem !important;
}

body.font-size-large .space-x-8 > * + * {
    margin-left: 2rem !important;
}

/* Text size classes */
body.font-size-large .text-xs {
    font-size: 0.875rem !important;
}

body.font-size-large .text-sm {
    font-size: 1rem !important;
}

body.font-size-large .text-base {
    font-size: 1.125rem !important;
}

body.font-size-large .text-lg {
    font-size: 1.25rem !important;
}

body.font-size-large .text-xl {
    font-size: 1.5rem !important;
}

body.font-size-large .text-2xl {
    font-size: 1.75rem !important;
}

body.font-size-large .text-3xl {
    font-size: 2rem !important;
}

body.font-size-large .text-4xl {
    font-size: 2.5rem !important;
}

body.font-size-large .text-5xl {
    font-size: 3rem !important;
}

/* Specific fixes for common layout issues */
body.font-size-large .flex.space-x-2 {
    gap: 0.75rem !important;
}

body.font-size-large .flex.space-x-3 {
    gap: 1rem !important;
}

body.font-size-large .flex.space-x-4 {
    gap: 1.25rem !important;
}

/* Fix for text elements that might overlap */
body.font-size-large p {
    margin-bottom: 0.75rem !important;
    line-height: 1.6 !important;
}

body.font-size-large .text-gray-500 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for labels */
body.font-size-large label {
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Fix for form sections */
body.font-size-large .bg-blue-50,
body.font-size-large .bg-purple-50,
body.font-size-large .bg-orange-50,
body.font-size-large .bg-gray-50 {
    margin-bottom: 1.25rem !important;
    padding: 1.25rem !important;
}

/* Fix for navigation tabs */
body.font-size-large nav button {
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for input groups */
body.font-size-large .flex input {
    margin-right: 0.75rem !important;
}

body.font-size-large .flex button {
    margin-left: 0.75rem !important;
}

/* Icon fixes for large font - ensure icons stay in frame */
body.font-size-large button i {
    font-size: 0.875rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

body.font-size-large .fas,
body.font-size-large .far,
body.font-size-large .fab {
    font-size: 0.875rem !important;
    line-height: 1 !important;
}

/* Specific fixes for search button icons */
body.font-size-large button[class*="search"] i,
body.font-size-large button:has(.fa-search) i {
    font-size: 0.625rem !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Fix for dropdown arrow icons */
body.font-size-large select + i,
body.font-size-large .fa-chevron-down,
body.font-size-large .fa-caret-down {
    font-size: 0.625rem !important;
    line-height: 1 !important;
}

/* Ensure button content doesn't overflow */
body.font-size-large button {
    min-height: 2.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Fix for square buttons (like search button) */
body.font-size-large button[class*="square"],
body.font-size-large button:has(.fa-search) {
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix for navigation icons */
body.font-size-large nav i,
body.font-size-large .nav-icon {
    font-size: 0.875rem !important;
    line-height: 1 !important;
}

/* Fix for font control panel icons */
body.font-size-large .font-control-panel i {
    font-size: 0.75rem !important;
    line-height: 1 !important;
    margin-right: 0.375rem !important;
}

/* Ensure all icons maintain proper sizing */
body.font-size-large i {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Extra Large Font Spacing Rules */
/* Increase spacing for form elements */
body.font-size-extra-large .space-y-6 > * + * {
    margin-top: 2rem !important;
}

body.font-size-extra-large .space-y-4 > * + * {
    margin-top: 1.75rem !important;
}

body.font-size-extra-large .space-y-3 > * + * {
    margin-top: 1.5rem !important;
}

body.font-size-extra-large .space-y-2 > * + * {
    margin-top: 1.25rem !important;
}

/* Form field spacing */
body.font-size-extra-large .mb-4 {
    margin-bottom: 1.75rem !important;
}

body.font-size-extra-large .mb-3 {
    margin-bottom: 1.5rem !important;
}

body.font-size-extra-large .mb-2 {
    margin-bottom: 1.25rem !important;
}

body.font-size-extra-large .mb-6 {
    margin-bottom: 2rem !important;
}

/* Input field spacing */
body.font-size-extra-large input,
body.font-size-extra-large textarea,
body.font-size-extra-large select {
    margin-bottom: 1rem !important;
    padding: 1rem 1.25rem !important;
    line-height: 1.6 !important;
}

/* Button spacing */
body.font-size-extra-large button {
    padding: 1rem 1.25rem !important;
    line-height: 1.6 !important;
}

/* Card and container spacing */
body.font-size-extra-large .p-4 {
    padding: 1.75rem !important;
}

body.font-size-extra-large .p-6 {
    padding: 2rem !important;
}

body.font-size-extra-large .px-3 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

body.font-size-extra-large .px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

body.font-size-extra-large .py-2 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.font-size-extra-large .py-3 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

body.font-size-extra-large .py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* Grid spacing */
body.font-size-extra-large .gap-2 {
    gap: 1rem !important;
}

body.font-size-extra-large .gap-3 {
    gap: 1.25rem !important;
}

body.font-size-extra-large .gap-4 {
    gap: 1.5rem !important;
}

body.font-size-extra-large .gap-6 {
    gap: 2rem !important;
}

/* Section spacing for form sections */
body.font-size-extra-large .bg-blue-50,
body.font-size-extra-large .bg-purple-50,
body.font-size-extra-large .bg-orange-50,
body.font-size-extra-large .bg-gray-50 {
    margin-bottom: 1.75rem !important;
    padding: 1.75rem !important;
}

/* Radio button grid spacing */
body.font-size-extra-large .grid.grid-cols-2 {
    gap: 1rem !important;
}

body.font-size-extra-large .grid.grid-cols-3 {
    gap: 1rem !important;
}

/* Progress indicator spacing */
body.font-size-extra-large .flex.items-center.justify-between {
    padding: 1rem 1.25rem !important;
}

/* Header spacing */
body.font-size-extra-large .bg-gradient-to-r {
    padding: 1.75rem !important;
}

/* Label spacing */
body.font-size-extra-large label {
    margin-bottom: 0.75rem !important;
    display: block !important;
}

/* Ensure proper line height for all text elements */
body.font-size-extra-large h1,
body.font-size-extra-large h2,
body.font-size-extra-large h3,
body.font-size-extra-large h4,
body.font-size-extra-large h5,
body.font-size-extra-large h6 {
    line-height: 1.4 !important;
    margin-bottom: 1rem !important;
}

body.font-size-extra-large p {
    line-height: 1.7 !important;
    margin-bottom: 1rem !important;
}

/* Additional spacing for form sections */
body.font-size-extra-large .space-y-6 > div:not(:last-child) {
    margin-bottom: 2rem !important;
}

body.font-size-extra-large .space-y-4 > div:not(:last-child) {
    margin-bottom: 1.75rem !important;
}

/* Comprehensive spacing fixes for all Tailwind classes */
body.font-size-extra-large .space-y-1 > * + * {
    margin-top: 0.75rem !important;
}

body.font-size-extra-large .space-y-2 > * + * {
    margin-top: 1rem !important;
}

body.font-size-extra-large .space-y-3 > * + * {
    margin-top: 1.25rem !important;
}

body.font-size-extra-large .space-y-4 > * + * {
    margin-top: 1.5rem !important;
}

body.font-size-extra-large .space-y-5 > * + * {
    margin-top: 1.75rem !important;
}

body.font-size-extra-large .space-y-6 > * + * {
    margin-top: 2rem !important;
}

body.font-size-extra-large .space-y-8 > * + * {
    margin-top: 2.5rem !important;
}

/* Margin bottom classes */
body.font-size-extra-large .mb-1 {
    margin-bottom: 0.75rem !important;
}

body.font-size-extra-large .mb-2 {
    margin-bottom: 1rem !important;
}

body.font-size-extra-large .mb-3 {
    margin-bottom: 1.25rem !important;
}

body.font-size-extra-large .mb-4 {
    margin-bottom: 1.5rem !important;
}

body.font-size-extra-large .mb-5 {
    margin-bottom: 1.75rem !important;
}

body.font-size-extra-large .mb-6 {
    margin-bottom: 2rem !important;
}

body.font-size-extra-large .mb-8 {
    margin-bottom: 2.5rem !important;
}

/* Margin top classes */
body.font-size-extra-large .mt-1 {
    margin-top: 0.75rem !important;
}

body.font-size-extra-large .mt-2 {
    margin-top: 1rem !important;
}

body.font-size-extra-large .mt-3 {
    margin-top: 1.25rem !important;
}

body.font-size-extra-large .mt-4 {
    margin-top: 1.5rem !important;
}

body.font-size-extra-large .mt-5 {
    margin-top: 1.75rem !important;
}

body.font-size-extra-large .mt-6 {
    margin-top: 2rem !important;
}

body.font-size-extra-large .mt-8 {
    margin-top: 2.5rem !important;
}

/* Padding classes */
body.font-size-extra-large .p-1 {
    padding: 0.75rem !important;
}

body.font-size-extra-large .p-2 {
    padding: 1rem !important;
}

body.font-size-extra-large .p-3 {
    padding: 1.25rem !important;
}

body.font-size-extra-large .p-4 {
    padding: 1.5rem !important;
}

body.font-size-extra-large .p-5 {
    padding: 1.75rem !important;
}

body.font-size-extra-large .p-6 {
    padding: 2rem !important;
}

body.font-size-extra-large .p-8 {
    padding: 2.5rem !important;
}

/* Horizontal padding */
body.font-size-extra-large .px-1 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

body.font-size-extra-large .px-2 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

body.font-size-extra-large .px-3 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

body.font-size-extra-large .px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

body.font-size-extra-large .px-5 {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
}

body.font-size-extra-large .px-6 {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

body.font-size-extra-large .px-8 {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
}

/* Vertical padding */
body.font-size-extra-large .py-1 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

body.font-size-extra-large .py-2 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.font-size-extra-large .py-3 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

body.font-size-extra-large .py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

body.font-size-extra-large .py-5 {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
}

body.font-size-extra-large .py-6 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

body.font-size-extra-large .py-8 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

/* Gap classes for flexbox and grid */
body.font-size-extra-large .gap-1 {
    gap: 0.75rem !important;
}

body.font-size-extra-large .gap-2 {
    gap: 1rem !important;
}

body.font-size-extra-large .gap-3 {
    gap: 1.25rem !important;
}

body.font-size-extra-large .gap-4 {
    gap: 1.5rem !important;
}

body.font-size-extra-large .gap-5 {
    gap: 1.75rem !important;
}

body.font-size-extra-large .gap-6 {
    gap: 2rem !important;
}

body.font-size-extra-large .gap-8 {
    gap: 2.5rem !important;
}

/* Space between classes */
body.font-size-extra-large .space-x-1 > * + * {
    margin-left: 0.75rem !important;
}

body.font-size-extra-large .space-x-2 > * + * {
    margin-left: 1rem !important;
}

body.font-size-extra-large .space-x-3 > * + * {
    margin-left: 1.25rem !important;
}

body.font-size-extra-large .space-x-4 > * + * {
    margin-left: 1.5rem !important;
}

body.font-size-extra-large .space-x-5 > * + * {
    margin-left: 1.75rem !important;
}

body.font-size-extra-large .space-x-6 > * + * {
    margin-left: 2rem !important;
}

body.font-size-extra-large .space-x-8 > * + * {
    margin-left: 2.5rem !important;
}

/* Text size classes */
body.font-size-extra-large .text-xs {
    font-size: 1rem !important;
}

body.font-size-extra-large .text-sm {
    font-size: 1.125rem !important;
}

body.font-size-extra-large .text-base {
    font-size: 1.25rem !important;
}

body.font-size-extra-large .text-lg {
    font-size: 1.5rem !important;
}

body.font-size-extra-large .text-xl {
    font-size: 1.75rem !important;
}

body.font-size-extra-large .text-2xl {
    font-size: 2rem !important;
}

body.font-size-extra-large .text-3xl {
    font-size: 2.5rem !important;
}

body.font-size-extra-large .text-4xl {
    font-size: 3rem !important;
}

body.font-size-extra-large .text-5xl {
    font-size: 3.5rem !important;
}

/* Specific fixes for common layout issues */
body.font-size-extra-large .flex.space-x-2 {
    gap: 1rem !important;
}

body.font-size-extra-large .flex.space-x-3 {
    gap: 1.25rem !important;
}

body.font-size-extra-large .flex.space-x-4 {
    gap: 1.5rem !important;
}

/* Fix for text elements that might overlap */
body.font-size-extra-large p {
    margin-bottom: 1rem !important;
    line-height: 1.7 !important;
}

body.font-size-extra-large .text-gray-500 {
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

/* Fix for labels */
body.font-size-extra-large label {
    margin-bottom: 0.75rem !important;
    display: block !important;
}

/* Fix for form sections */
body.font-size-extra-large .bg-blue-50,
body.font-size-extra-large .bg-purple-50,
body.font-size-extra-large .bg-orange-50,
body.font-size-extra-large .bg-gray-50 {
    margin-bottom: 1.75rem !important;
    padding: 1.75rem !important;
}

/* Fix for navigation tabs */
body.font-size-extra-large nav button {
    padding: 1rem 1.25rem !important;
    margin-bottom: 0.75rem !important;
}

/* Fix for input groups */
body.font-size-extra-large .flex input {
    margin-right: 1rem !important;
}

body.font-size-extra-large .flex button {
    margin-left: 1rem !important;
}

/* Icon fixes for extra large font - ensure icons stay in frame */
body.font-size-extra-large button i {
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

body.font-size-extra-large .fas,
body.font-size-extra-large .far,
body.font-size-extra-large .fab {
    font-size: 1rem !important;
    line-height: 1 !important;
}

/* Specific fixes for search button icons */
body.font-size-extra-large button[class*="search"] i,
body.font-size-extra-large button:has(.fa-search) i,
body.font-size-extra-large button i.fa-search {
    font-size: 0.875rem !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Fix for dropdown arrow icons */
body.font-size-extra-large select + i,
body.font-size-extra-large .fa-chevron-down,
body.font-size-extra-large .fa-caret-down {
    font-size: 0.75rem !important;
    line-height: 1 !important;
}

/* Ensure button content doesn't overflow */
body.font-size-extra-large button {
    min-height: 3rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Fix for square buttons (like search button) */
body.font-size-extra-large button[class*="square"],
body.font-size-extra-large button:has(.fa-search),
body.font-size-extra-large button:has(i.fa-search) {
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: -0.25rem !important;
    transform: translateX(-0.125rem) !important;
}

/* Fix for navigation icons */
body.font-size-extra-large nav i,
body.font-size-extra-large .nav-icon {
    font-size: 1rem !important;
    line-height: 1 !important;
}

/* Fix for font control panel icons */
body.font-size-extra-large .font-control-panel i {
    font-size: 0.875rem !important;
    line-height: 1 !important;
    margin-right: 0.5rem !important;
}

/* Ensure all icons maintain proper sizing */
body.font-size-extra-large i {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Additional fix for search buttons in extra large font */
body.font-size-extra-large .bg-purple-600 i.fa-search,
body.font-size-extra-large button.bg-purple-600 i {
    font-size: 0.875rem !important;
    line-height: 1 !important;
}

body.font-size-extra-large .bg-purple-600,
body.font-size-extra-large button.bg-purple-600 {
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: -0.25rem !important;
    transform: translateX(-0.125rem) !important;
}

/* Modal Scroll Fix */
.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

.modal-content {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Font Size Control Button Styles */
.font-control-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    /* Match header brand gradient */
    background: linear-gradient(to right, var(--brand-600), var(--brand-300));
    color: var(--logo-contrast); /* #6B4E2E */
    border: 2px solid var(--brand-500);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.font-control-btn:hover {
    background: linear-gradient(to right, var(--brand-450), var(--brand-200));
    transform: scale(1.1);
}

.font-control-btn.active {
    background: rgba(34, 197, 94, 0.9);
}

.font-control-btn.active:hover {
    background: rgba(34, 197, 94, 1);
}

/* Font Size Control Panel */
.font-control-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 120px;
    display: none;
}

.font-control-panel.show {
    display: block;
}

.font-control-panel button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.font-control-panel button:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

.font-control-panel button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .font-control-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .font-control-panel {
        top: 70px;
        right: 15px;
        padding: 12px;
        min-width: 100px;
    }
    
    /* Large font responsive adjustments for mobile */
    body.font-size-large {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    body.font-size-large h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    body.font-size-large h2 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    body.font-size-large h3 {
        font-size: 1.125rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    body.font-size-large h4 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    body.font-size-large p,
    body.font-size-large span,
    body.font-size-large div,
    body.font-size-large button,
    body.font-size-large input,
    body.font-size-large textarea,
    body.font-size-large select,
    body.font-size-large label {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
    
    /* Reduce spacing on mobile for large font */
    body.font-size-large .space-y-6 > * + * {
        margin-top: 1rem !important;
    }
    
    body.font-size-large .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }
    
    body.font-size-large .space-y-3 > * + * {
        margin-top: 0.5rem !important;
    }
    
    body.font-size-large .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    body.font-size-large .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    body.font-size-large .mb-2 {
        margin-bottom: 0.375rem !important;
    }
    
    body.font-size-large .mb-6 {
        margin-bottom: 1rem !important;
    }
    
    /* Reduce padding on mobile */
    body.font-size-large .p-4 {
        padding: 0.75rem !important;
    }
    
    body.font-size-large .p-6 {
        padding: 1rem !important;
    }
    
    body.font-size-large .px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    body.font-size-large .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    body.font-size-large .py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    body.font-size-large .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    body.font-size-large .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    /* Reduce input field padding on mobile */
    body.font-size-large input,
    body.font-size-large textarea,
    body.font-size-large select {
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.4 !important;
    }
    
    body.font-size-large button {
        padding: 0.5rem 0.75rem !important;
        line-height: 1.4 !important;
    }
    
    /* Reduce section spacing */
    body.font-size-large .bg-blue-50,
    body.font-size-large .bg-purple-50,
    body.font-size-large .bg-orange-50,
    body.font-size-large .bg-gray-50 {
        margin-bottom: 0.75rem !important;
        padding: 0.75rem !important;
    }
    
    /* Reduce grid gaps */
    body.font-size-large .gap-2 {
        gap: 0.5rem !important;
    }
    
    body.font-size-large .gap-3 {
        gap: 0.5rem !important;
    }
    
    body.font-size-large .gap-4 {
        gap: 0.75rem !important;
    }
    
    body.font-size-large .gap-6 {
        gap: 0.75rem !important;
    }
    
    /* Reduce header padding */
    body.font-size-large .bg-gradient-to-r {
        padding: 0.75rem !important;
    }
    
    /* Ensure text doesn't overflow */
    body.font-size-large .text-xs {
        font-size: 0.75rem !important;
    }
    
    body.font-size-large .text-sm {
        font-size: 0.875rem !important;
    }
    
    /* Fix specific mobile layout issues */
    body.font-size-large .max-w-md {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix ID number input section for mobile */
    body.font-size-large .flex.space-x-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    body.font-size-large .flex.space-x-2 input {
        width: 100% !important;
        flex: none !important;
    }
    
    body.font-size-large .flex.space-x-2 button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Fix date picker section for mobile */
    body.font-size-large .flex.items-center.space-x-2 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    body.font-size-large .flex.items-center.space-x-2 input[type="date"] {
        width: 100% !important;
    }
    
    body.font-size-large .flex.items-center.space-x-2 button {
        align-self: flex-end !important;
    }
}

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    /* Even more aggressive font size reduction for very small screens */
    body.font-size-large {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    body.font-size-large h1 {
        font-size: 1.25rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    body.font-size-large h2 {
        font-size: 1.125rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    body.font-size-large h3 {
        font-size: 1rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    body.font-size-large p,
    body.font-size-large span,
    body.font-size-large div,
    body.font-size-large button,
    body.font-size-large input,
    body.font-size-large textarea,
    body.font-size-large select,
    body.font-size-large label {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    /* Further reduce spacing on very small screens */
    body.font-size-large .space-y-6 > * + * {
        margin-top: 0.75rem !important;
    }
    
    body.font-size-large .space-y-4 > * + * {
        margin-top: 0.5rem !important;
    }
    
    body.font-size-large .space-y-3 > * + * {
        margin-top: 0.375rem !important;
    }
    
    body.font-size-large .p-4 {
        padding: 0.5rem !important;
    }
    
    body.font-size-large .p-6 {
        padding: 0.75rem !important;
    }
    
    body.font-size-large .bg-blue-50,
    body.font-size-large .bg-purple-50,
    body.font-size-large .bg-orange-50,
    body.font-size-large .bg-gray-50 {
        margin-bottom: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    body.font-size-large input,
    body.font-size-large textarea,
    body.font-size-large select {
        padding: 0.375rem 0.5rem !important;
        margin-bottom: 0.375rem !important;
        line-height: 1.3 !important;
    }
    
    body.font-size-large button {
        padding: 0.375rem 0.5rem !important;
        line-height: 1.3 !important;
    }
    
    /* Ensure text wrapping */
    body.font-size-large * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Prevent horizontal overflow */
    body.font-size-large {
        overflow-x: hidden !important;
    }
    
    body.font-size-large .max-w-md {
        max-width: 100vw !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Fix ID number input section responsive layout */
    body.font-size-large .flex.space-x-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    body.font-size-large .flex.space-x-2 input {
        width: 100% !important;
        flex: none !important;
    }
    
    body.font-size-large .flex.space-x-2 button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Fix date picker section */
    body.font-size-large .flex.items-center.space-x-2 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    body.font-size-large .flex.items-center.space-x-2 input[type="date"] {
        width: 100% !important;
    }
    
    body.font-size-large .flex.items-center.space-x-2 button {
        align-self: flex-end !important;
    }
}

/* Ensure Chinese text uses the correct font */
h1, h2, h3, h4, h5, h6, p, span, div, button, input, textarea, select, label, a {
    font-family: "Kaiti", "楷体", "STKaiti", "华文楷体", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

/* Final homepage color overrides (ensure take precedence) */
.home-brand .text-blue-100 { color: #FFFFFF !important; opacity: 0.9 !important; }
.home-brand .promo-cta { color: #FFFFFF !important; }
.home-brand .promo-cta i { color: #FFFFFF !important; }

/* Mobile touch optimization for promo buttons */
.promo-cta {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.promo-card {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
