/* AMISVET Calc Vet Styles */
:root {
    --primary-color: #5b2c6f; /* Deep purple */
    --primary-light: #7b4397;
    --bg-color: #f5f0f6; /* Light gray with a touch of purple */
    --text-dark: #2c3e50;
    --text-light: #6c7a89;
    --white: #ffffff;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    --border-radius: 20px;
    --accent-blue: #4a90e2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none !important;
    /* Security: Anti-seleção de texto */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Security: Anti-drag */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Security: Permitir seleção em inputs */
input, textarea, select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Security: Impedir arrastar imagens */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Security: Imagens fora de botões não capturam cliques */
img:not(button img):not(.profile-btn img) {
    pointer-events: none;
}

/* Security: Bloquear impressão - página em branco */
@media print {
    * {
        display: none !important;
        visibility: hidden !important;
    }
    html, body {
        background: white !important;
    }
    body::after {
        display: block !important;
        visibility: visible !important;
        content: '🛡️ Impressão bloqueada por segurança.';
        font-family: Inter, sans-serif;
        font-size: 1.2rem;
        color: #5b2c6f;
        text-align: center;
        padding-top: 40vh;
    }
}

*::-webkit-scrollbar {
    display: none !important;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    background-color: #e9e4ea;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* App Container (Mobile Simulator for Desktop, Fullscreen for Mobile) */
#app-container {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: appEntrance 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes appEntrance {
    0% { opacity: 0; transform: scale(0.95) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Phone simulator frame — only between 450px and 767px (above largest phones, below tablets) */
@media (min-width: 450px) and (max-width: 767px) {
    #app-container {
        max-width: 414px;
        height: 90vh;
        max-height: 896px;
        border-radius: 40px;
        border: 8px solid #333;
    }
}

/* Header */
.app-header {
    position: relative;
    padding: 30px 20px 45px 20px;
    text-align: center;
    z-index: 40;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    border-radius: 0; /* Let the parent container's overflow: hidden clip the corners */
    overflow: hidden;
}

.parallax > use {
    animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite;
}
.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }

@keyframes move-forever {
    0% { transform: translate3d(-90px, 0, 0); }
    100% { transform: translate3d(85px, 0, 0); }
}

.wave-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    z-index: 1;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: -550px;
    left: 50%;
    width: 800px;
    height: 800px;
    background: var(--bg-color);
    border-radius: 43%;
    transform: translateX(-50%);
    animation: rotateWave 10s infinite linear;
}

.wave1 { animation-duration: 12s; opacity: 1; border-radius: 43%; }
.wave2 { animation-duration: 15s; opacity: 0.6; border-radius: 45%; }
.wave3 { animation-duration: 20s; opacity: 0.3; border-radius: 40%; }

@keyframes rotateWave {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

.header-config-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: white;
    border: none;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    z-index: 20;
}

.math-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--bg-color);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

.math-fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
}

.math-numerator {
    border-bottom: 2px solid var(--text-dark);
    padding: 2px 8px;
}

.math-denominator {
    padding: 2px 8px;
}

.header-config-btn:hover {
    transform: scale(1.05);
}

.header-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.5px;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 5;
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease;
}

.logo-circle {
    background: var(--white);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Tab Sections */
.tab-section {
    display: none !important;
    animation: fadeInTab 0.4s ease-out forwards;
    flex: 1;
    min-height: 0;
    padding: 20px;
    padding-bottom: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-section.active {
    display: block !important;
}

.tab-section.active.center-content {
    display: flex !important;
}

#tab-inicio.active {
    display: flex !important;
    flex-direction: column;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-text {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.3;
}

/* Carousel */
.carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    touch-action: pan-y;
    will-change: transform;
}

.carousel-page {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 15px 0 10px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(91, 44, 111, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* Fixed Parâmetros Button */
.fixed-params-btn {
    display: flex;
    width: calc(100% - 40px);
    margin: 20px auto 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(91, 44, 111, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.fixed-params-btn > div {
    width: 100%;
}

.fixed-params-btn:hover, .fixed-params-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 44, 111, 0.4);
}

/* Grid Options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    align-content: center;
}

.grid-btn {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--border-radius);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(91, 44, 111, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.grid-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(91,44,111,0.08), rgba(123,67,151,0.04));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.grid-btn:hover::before, .grid-btn:active::before {
    opacity: 1;
}

.grid-btn:hover, .grid-btn:active {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 30px rgba(91, 44, 111, 0.18);
    border-color: rgba(91,44,111,0.15);
}

.grid-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.grid-btn.full-width {
    grid-column: 1 / -1;
}

.btn-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(91,44,111,0.12), rgba(123,67,151,0.06));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    color: var(--primary-color);
    transition: transform 0.3s ease, background 0.3s ease;
}

.grid-btn:hover .btn-icon, .grid-btn:active .btn-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, rgba(91,44,111,0.2), rgba(123,67,151,0.1));
}

.btn-icons-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-icons-row svg {
    color: var(--primary-light);
    background: var(--bg-color);
    border-radius: 50%;
    padding: 5px;
}

.btn-icons-row svg:nth-child(1) { color: #8e44ad; } /* Cat */
.btn-icons-row svg:nth-child(2) { color: #d35400; } /* Dog */
.btn-icons-row svg:nth-child(3) { color: #e74c3c; } /* Heart */

/* Screens & Modals */
.screen-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.screen-modal.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    flex: 1;
    padding: 20px 20px 90px 20px; /* Extra padding bottom for the nav menu */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.center-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-top: 15px;
    flex-shrink: 0;
}

.back-btn {
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    color: var(--text-dark);
    margin-right: 15px;
    flex-shrink: 0;
}

.absolute-back {
    position: absolute;
    top: 40px;
    left: 20px;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* Animal Selector */
.animal-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-shrink: 0;
}

.animal-btn {
    flex: 1;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-light);
}

.animal-btn .animal-emoji {
    font-size: 2.5rem;
    margin-bottom: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animal-btn.active {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(91,44,111,0.03), rgba(123,67,151,0.08));
    color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(91, 44, 111, 0.12);
}

.animal-btn.active .animal-emoji {
    transform: scale(1.25) translateY(-4px);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
    background: var(--white);
    padding: 16px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 10px;
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: border 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
    background: var(--white);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    outline: none;
}

.input-wrapper .unit {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 10px;
}

.search-icon {
    color: var(--text-light);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.small-input {
    width: 70px;
    padding: 5px;
}

.small-input input {
    text-align: center;
    padding: 5px 0;
}

/* Result Card */
.result-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    margin-top: 16px;
    position: sticky;
    bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    flex-shrink: 0;
}

.result-glow {
    display: none;
}

.result-card h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.result-values {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.result-values .divider {
    color: var(--text-light);
    font-weight: 400;
    margin: 0 5px;
}

.construction-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 50;
    flex-shrink: 0;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    gap: 4px;
    transition: color 0.2s;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Parametros Vitais Redesign */
.param-toggle-card {
    background: var(--white);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.param-toggle-card span {
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.3s;
}
.param-toggle-card span.active {
    color: var(--primary-color);
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--primary-color);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(24px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Param Grid */
.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.param-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.param-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}
.param-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}
.param-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* --- REDESIGN OVERRIDES --- */
body {
    background-color: #f7f7f9;
}
#app-container {
    background-color: #f7f7f9;
}
.app-header-new {
    background: #623073;
    padding: 20px 20px 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    border-radius: 0;
}
.header-left-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.header-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    z-index: 10;
}
.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10;
}
.header-config-btn {
    background: none; border: none; cursor: pointer; display: flex;
}
.top-banner-img {
    width: 100%;
    height: 160px;
    background: url('https://images.unsplash.com/photo-1599443015574-be5fe8a05783?auto=format&fit=crop&w=600&q=80') center/cover;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.bg-watermarks-new {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Corrige o dropdown interceptando clicks acidentais quando oculto */
.profile-dropdown:not(.show) {
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
.bg-watermarks-new span {
    position: absolute; font-size: 4rem; filter: grayscale(100%);
}
#tab-inicio {
    padding: 20px 20px 100px 20px !important;
    position: relative;
    display: flex !important;
    flex-direction: column;
}
.options-grid-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    margin-bottom: 20px;
}
.grid-row {
    display: flex;
    gap: 12px;
}
.grid-btn-new {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.8rem;
    line-height: 1.2;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 70px;
}
.grid-btn-new:active {
    transform: scale(0.97);
}
.grid-btn-new.active-glow {
    box-shadow: 0 0 15px rgba(123, 67, 151, 0.3);
    border: 1px solid rgba(123, 67, 151, 0.2);
}
.grid-btn-new.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(40%);
}
.btn-text {
    flex: 1; text-align: center; margin: 0 5px;
}
.left-icon, .right-icon {
    font-size: 1.4rem;
}
.fixed-params-btn-new {
    width: 100%;
    margin-top: auto;
    background: linear-gradient(90deg, #4b1e59 0%, #a476bc 100%);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 8px 20px rgba(91, 44, 111, 0.3);
    z-index: 20;
    cursor: pointer;
}
/* Animated Floating Bottom Nav */
.bottom-scroll-blur {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    z-index: 50; /* below bottom-nav-new */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    mask-image: linear-gradient(to bottom, transparent 0%, black 20px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20px);
}

.bottom-nav-new {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 8px 15px;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 75px;
    border-radius: 40px;
    box-shadow: 0 15px 35px rgba(91, 44, 111, 0.2), 0 5px 15px rgba(0,0,0,0.05);
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, transform 0.3s ease;
}

body.hide-bottom-nav .bottom-nav-new {
    bottom: -100px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.95); /* Slight shrink effect */
}

.bottom-nav-new .nav-item {
    background: none; border: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1;
    color: #9aa5b1;
    font-weight: 600; font-size: 0.8rem;
    gap: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.bottom-nav-new .nav-item:active {
    transform: scale(0.9);
}

.bottom-nav-new .nav-item.active {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.bottom-nav-new .nav-item.active svg {
    filter: drop-shadow(0 4px 6px rgba(123, 67, 151, 0.4));
}

.bottom-nav-new .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}
/* Hide the old bottom nav items that we removed from HTML */
.bottom-nav-pill, .bottom-nav {
    display: none !important;
}

/* ==========================================================================
   DESKTOP BACKGROUND
   ========================================================================== */
.desktop-bg {
    display: none;
}

@media (min-width: 1024px) {
    body {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
        perspective: 1500px;
    }
    
    .desktop-bg {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 40vh;
        min-height: 300px;
        z-index: -1;
        pointer-events: none;
    }
    
    .desktop-waves {
        width: 100%;
        height: 100%;
    }
    
    .desktop-parallax > use {
        animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite;
    }
    .desktop-parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
    .desktop-parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
    .desktop-parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
    .desktop-parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }

    #app-container {
        position: relative;
        z-index: 1;
        transform-origin: center bottom;
        animation: desktopPhonePickUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        opacity: 0;
    }
    
    @keyframes desktopPhonePickUp {
        0% {
            opacity: 0;
            transform: translateY(150px) scale(0.85) rotateX(25deg) rotateY(15deg);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        60% {
            opacity: 1;
            transform: translateY(-10px) scale(1.02) rotateX(-2deg) rotateY(-2deg);
            box-shadow: 0 30px 60px rgba(0,0,0,0.5);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1) rotateX(0) rotateY(0);
            box-shadow: 0 15px 50px rgba(0,0,0,0.4);
        }
    }
    
    .header-config-btn {
        display: none !important;
    }
}

/* Customizations for Bulário Categories */
.med-group {
    border: 1px solid rgba(123, 67, 151, 0.1) !important;
    background: #fff !important;
    margin-top: 25px !important;
    margin-bottom: 35px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
}

.med-category {
    padding: 12px 15px !important;
    background: var(--primary-color) !important;
    font-weight: 700 !important;
    color: white !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0 !important;
    border-left: none !important;
}

/* Hide header on mobile */
.mobile-title {
    display: none;
}
@media (max-width: 768px) {
    .mobile-title {
        display: block !important;
    }
}

/* SAC Form */
.sac-form {
    text-align: left;
    margin-top: 20px;
}
.sac-form-group {
    margin-bottom: 15px;
}
.sac-form-label {
    display: block;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 6px;
    font-weight: 600;
}
.sac-form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}
.sac-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91,44,111, 0.1);
}
.sac-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}
.sac-btn:hover {
    background: var(--primary-light);
}

/* Spinner Animation for SAC Button */
.spinner {
  animation: rotate 2s linear infinite;
}
.spinner .path {
  stroke: #ffffff;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
  100% { transform: rotate(360deg); }
}
@keyframes dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ===== UNIFIED CALCULATOR DESIGN SYSTEM ===== */
/* Match all calculator screens to Parâmetros/Bulário visual identity */

/* Calculator screen backgrounds */
[id^="calc-"] > .modal-content {
    background: #f8f6f9;
    padding: 15px 15px 85px 15px; /* more compact padding */
}

/* Calculator modal headers — unified purple bar style */
[id^="calc-"] > .modal-content > .modal-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    margin: -15px -15px 15px -15px;
    padding: 25px 15px 25px 15px !important;
    border-radius: 0;
}

[id^="calc-"] > .modal-content > .modal-header h2 {
    color: #fff !important;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

[id^="calc-"] > .modal-content > .modal-header .back-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: none;
}
[id^="calc-"] > .modal-content > .modal-header .back-btn svg {
    stroke: #fff;
}

/* Form groups inside calculators — card style with border */
[id^="calc-"] .form-group {
    background: #fff;
    border: 1px solid rgba(123, 67, 151, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    padding: 12px 14px;
    margin-bottom: 10px;
}

[id^="calc-"] .form-group label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Input wrappers inside calculators */
[id^="calc-"] .input-wrapper {
    background: #f8f6f9;
    border: 1px solid rgba(123, 67, 151, 0.08);
    border-radius: 10px;
    padding: 2px 10px;
}
[id^="calc-"] .input-wrapper input {
    padding: 4px 0;
    font-size: 0.95rem;
}
[id^="calc-"] .input-wrapper .unit {
    font-size: 0.8rem;
}
[id^="calc-"] .form-group label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}
[id^="calc-"] .result-card h3 {
    font-size: 0.8rem;
    margin-bottom: 5px;
}
[id^="calc-"] .result-values {
    font-size: 1.4rem;
}
[id^="calc-"] .input-wrapper:focus-within {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91,44,111,0.06);
}

/* Result cards inside calculators — premium look */
[id^="calc-"] .result-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 12px;
    padding: 16px 12px;
    position: relative;
    bottom: auto;
    overflow: hidden;
}

[id^="calc-"] .result-card::before {
    display: none;
}

/* Override inline colors for a formal look */
.result-card h3 {
    color: #444444 !important;
}
.result-values span {
    color: #222222 !important;
}
.result-card div {
    color: #555555;
}

[id^="calc-"] .result-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 700;
}

/* Observation/info boxes inside calculators — remove old override */
[id^="calc-"] > .modal-content > div[style*="border-left"] {
    background: #fff !important;
    border: 1px solid rgba(123, 67, 151, 0.1) !important;
    border-left: 4px solid var(--primary-color) !important;
    border-radius: 0 12px 12px 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* ===== ELEGANT OBSERVATION BOX ===== */
.elegant-obs-box {
    background-color: rgba(123, 67, 151, 0.05); /* very soft purple */
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    color: #4a3b52;
    font-size: 0.85rem;
    line-height: 1.5;
    position: relative;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.elegant-obs-box ul {
    margin: 0;
    padding-left: 20px;
}

.elegant-obs-box li {
    margin-bottom: 8px;
    position: relative;
    list-style-type: none;
}

.elegant-obs-box li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0.6;
}

.elegant-obs-box li:last-child {
    margin-bottom: 0;
}

.elegant-obs-box strong {
    color: var(--primary-color);
}

/* Slidedown animation for success message */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Select for Mobile */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
}
.custom-select-trigger:focus, .custom-select-wrapper.open .custom-select-trigger {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91,44,111, 0.1);
}
.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: all 0.2s ease-out;
    max-height: 250px;
    overflow-y: auto;
}
.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}
.custom-option {
    display: block;
    padding: 12px 15px;
    font-size: 0.95rem;
    color: #555;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background: #f8f6f9;
}
.custom-option.selected {
    color: var(--primary-color);
    font-weight: 600;
    background: #f8f6f9;
}
.arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #888;
    transition: transform 0.2s;
}
.custom-select-wrapper.open .arrow {
    transform: rotate(180deg);
}

/* Mobile Spacing for Custom Selects */
@media (max-width: 768px) {
    .custom-select-trigger {
        padding: 16px 20px;
        font-size: 1.05rem;
    }
    .custom-option {
        padding: 16px 20px;
        font-size: 1.05rem;
    }
    .custom-options {
        max-height: 300px;
    }
}

/* Compact animal selectors for calculators */
[id^="calc-"] .animal-selector {
    gap: 10px;
    margin-bottom: 12px;
}

[id^="calc-"] .animal-btn {
    padding: 10px 5px;
    border-radius: 12px;
}

[id^="calc-"] .animal-btn .animal-emoji {
    font-size: 2rem;
    margin-bottom: 4px;
}

[id^="calc-"] .animal-btn.active .animal-emoji {
    transform: scale(1.15) translateY(-2px);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: 85px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    width: 210px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: rgba(91, 44, 111, 0.05);
    color: var(--primary-color);
}

.dropdown-item svg {
    color: var(--primary-light);
    transition: transform 0.2s;
}

.dropdown-item:hover svg {
    transform: scale(1.1);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item.disabled:hover {
    background: transparent;
    color: var(--text-dark);
}

.dropdown-item.disabled:hover svg {
    transform: none;
}

.dropdown-divider {
    height: 1px;
    background: rgba(0,0,0,0.08);
    margin: 0;
}

/* Custom Toast Notification */
.custom-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    padding: 16px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.custom-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Minimalist Mode */
body.minimalist .desktop-bg,
body.minimalist .bg-watermarks-new,
body.minimalist .waves-container,
body.minimalist .waves,
body.minimalist #fluid-wave-container,
body.minimalist .desktop-waves,
body.minimalist .desktop-parallax {
    display: none !important;
}

body.minimalist {
    background: #fdfdfd !important;
}

body.minimalist .app-header {
    background: var(--primary-color) !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* ===========================================================================
   RESPONSIVE DESIGN SYSTEM
   Covers: 320px → 360px → 393px → 768px → 1024px → 1366px → 1920px+
   =========================================================================== */

/* --- EXTRA SMALL: 320px (iPhone SE 1st gen, iPhone 5/5S) --- */
@media (max-width: 359px) {
    .app-header {
        padding: 20px 12px 35px 12px;
    }
    .app-header .user-greeting {
        font-size: 1.05rem !important;
    }
    #tab-inicio {
        padding: 12px 10px 90px 10px !important;
    }
    .options-grid-new {
        gap: 8px;
    }
    .grid-row {
        gap: 8px;
    }
    .grid-btn-new {
        padding: 10px 8px;
        min-height: 58px;
        border-radius: 14px;
        font-size: 0.7rem;
    }
    .form-group {
        padding: 12px 10px;
        margin-bottom: 10px;
    }
    .input-wrapper input {
        font-size: 0.95rem;
    }
    .result-values {
        font-size: 1.4rem;
    }
    .modal-content {
        padding: 12px 10px 85px 10px;
    }
    .modal-header h2 {
        font-size: 1rem;
    }
    .bottom-nav-new {
        width: 94%;
        bottom: 12px;
        height: 65px;
        padding: 6px 8px;
        border-radius: 30px;
    }
    .bottom-scroll-blur {
        height: 77px;
    }
    .bottom-nav-new .nav-item {
        font-size: 0.7rem;
        gap: 3px;
    }
    .bottom-nav-new .nav-item svg {
        width: 20px;
        height: 20px;
    }
    .profile-dropdown {
        top: 70px;
        right: 10px;
        width: 190px;
    }
    .dropdown-item {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
    /* Splash screen adjustments */
    #splash-welcome-screen h1 {
        font-size: 1.6rem !important;
    }
    #splash-welcome-screen p {
        font-size: 0.75rem !important;
    }
    #splash-welcome-screen img {
        width: 140px !important;
    }
    .custom-toast {
        padding: 12px 18px;
        font-size: 0.85rem;
        max-width: 280px;
    }
    [id^="calc-"] > .modal-content > .modal-header {
        padding: 18px 10px 18px 10px !important;
    }
    [id^="calc-"] > .modal-content > .modal-header h2 {
        font-size: 0.95rem;
    }
    [id^="calc-"] .result-values {
        font-size: 1.2rem;
    }
}

/* --- SMALL: 360px – 389px (70%+ of Androids: Xiaomi, Redmi, Samsung Galaxy A/M, Motorola) --- */
@media (min-width: 360px) and (max-width: 389px) {
    .app-header {
        padding: 25px 15px 40px 15px;
    }
    #tab-inicio {
        padding: 15px 14px 100px 14px !important;
    }
    .options-grid-new {
        gap: 10px;
    }
    .grid-row {
        gap: 10px;
    }
    .grid-btn-new {
        padding: 12px 10px;
        min-height: 65px;
        font-size: 0.75rem;
    }
    .bottom-nav-new {
        width: 92%;
        bottom: 18px;
        height: 68px;
    }
    .bottom-scroll-blur {
        height: 86px;
    }
    .bottom-nav-new .nav-item {
        font-size: 0.75rem;
    }
    .modal-content {
        padding: 15px 14px 90px 14px;
    }
}

/* --- MEDIUM: 390px – 429px (Modern iPhones: 15/14/13/12 and iPhone Pro) --- */
@media (min-width: 390px) and (max-width: 429px) {
    .app-header {
        padding: 28px 18px 42px 18px;
    }
    #tab-inicio {
        padding: 18px 16px 105px 16px !important;
    }
    .options-grid-new {
        gap: 12px;
    }
    .grid-btn-new {
        padding: 14px 12px;
        min-height: 70px;
        font-size: 0.8rem;
    }
    .bottom-nav-new {
        width: 90%;
        bottom: 22px;
        height: 72px;
    }
    .bottom-scroll-blur {
        height: 94px;
    }
}

/* --- LARGE PHONE: 430px – 449px (iPhone Pro Max / Plus) --- */
@media (min-width: 430px) and (max-width: 449px) {
    #app-container {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    .app-header {
        padding: 30px 20px 45px 20px;
    }
    #tab-inicio {
        padding: 20px 18px 110px 18px !important;
    }
    .grid-btn-new {
        padding: 15px 14px;
        min-height: 72px;
        font-size: 0.82rem;
    }
    .bottom-nav-new {
        width: 88%;
        bottom: 25px;
    }
    .bottom-scroll-blur {
        height: 97px; /* 72px + 25px */
    }
}

/* --- Safe area insets for iOS notched devices --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav-new {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .bottom-scroll-blur {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(100px + env(safe-area-inset-bottom));
    }
    #tab-inicio {
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    }
    .modal-content {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }
    .tab-section {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }
}

/* --- TABLETS PORTRAIT: 768px – 1023px (iPads, Samsung Tab, Android tablets) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    html, body {
        overflow: auto;
    }
    body {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
        align-items: flex-start;
    }
    #app-container {
        max-width: 600px;
        height: auto;
        min-height: 100vh;
        margin: 0 auto;
        border-radius: 0;
        border: none;
        box-shadow: 0 0 40px rgba(0,0,0,0.15);
    }
    .app-header {
        padding: 35px 30px 50px 30px;
    }
    .app-header .user-greeting {
        font-size: 1.5rem !important;
    }
    #tab-inicio {
        padding: 25px 30px 110px 30px !important;
    }
    .options-grid-new {
        gap: 14px;
    }
    .grid-row {
        gap: 14px;
    }
    .grid-btn-new {
        padding: 18px 16px;
        min-height: 80px;
        font-size: 0.9rem;
        border-radius: 22px;
    }
    .form-group {
        padding: 20px 18px;
        border-radius: 16px;
    }
    .input-wrapper input {
        font-size: 1.15rem;
        padding: 12px 0;
    }
    .result-values {
        font-size: 2rem;
    }
    .modal-content {
        padding: 25px 30px 100px 30px;
    }
    .modal-header h2 {
        font-size: 1.4rem;
    }
    .bottom-nav-new {
        width: 70%;
        max-width: 450px;
        bottom: 25px;
        height: 78px;
    }
    .bottom-scroll-blur {
        height: 103px;
    }
    .bottom-nav-new .nav-item {
        font-size: 0.85rem;
        gap: 6px;
    }
    .bottom-nav-new .nav-item svg {
        width: 26px;
        height: 26px;
    }
    .profile-dropdown {
        top: 90px;
        right: 30px;
        width: 240px;
    }
    .dropdown-item {
        padding: 16px 20px;
        font-size: 1rem;
    }
    [id^="calc-"] > .modal-content {
        padding: 20px 25px 100px 25px;
    }
    [id^="calc-"] > .modal-content > .modal-header {
        margin: -20px -25px 20px -25px;
        padding: 30px 25px 30px 25px !important;
    }
    [id^="calc-"] .form-group {
        padding: 16px 18px;
    }
    [id^="calc-"] .input-wrapper input {
        font-size: 1.05rem;
        padding: 8px 0;
    }
    [id^="calc-"] .result-values {
        font-size: 1.8rem;
    }
    /* Splash screen for tablet */
    #splash-welcome-screen > div:first-of-type {
        max-width: 420px !important;
        padding: 45px 35px 40px 35px !important;
    }
    #splash-welcome-screen img {
        width: 220px !important;
    }
    #splash-welcome-screen h1 {
        font-size: 2.4rem !important;
    }
    #splash-welcome-screen p {
        font-size: 0.95rem !important;
        max-width: 320px !important;
    }
    /* Welcome modal for tablet */
    #welcome-modal > div {
        max-width: 420px !important;
        padding: 40px 30px 30px 30px !important;
    }
    .custom-toast {
        font-size: 1.05rem;
        padding: 18px 28px;
    }
    .bg-watermarks-new span {
        font-size: 5rem;
    }
    .elegant-obs-box {
        padding: 20px 25px;
        font-size: 0.95rem;
    }
}

/* --- TABLETS LANDSCAPE / SMALL LAPTOPS: 1024px – 1365px --- */
@media (min-width: 1024px) and (max-width: 1365px) {
    html, body {
        overflow: auto;
    }
    #app-container {
        max-width: 420px;
        height: calc(100vh - 40px);
        max-height: 900px;
        margin: 20px auto;
        border-radius: 30px;
        border: 6px solid #2a2a2a;
        box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    }
    .bottom-nav-new {
        width: 88%;
        max-width: 370px;
        bottom: 18px;
        height: 70px;
    }
    .bottom-scroll-blur {
        height: 88px;
    }
}

/* --- LAPTOPS: 1366px – 1919px (Corporate notebooks, Windows laptops) --- */
@media (min-width: 1366px) and (max-width: 1919px) {
    html, body {
        overflow: auto;
    }
    #app-container {
        max-width: 414px;
        height: calc(100vh - 50px);
        max-height: 896px;
        margin: 25px auto;
        border-radius: 35px;
        border: 7px solid #333;
        box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    }
    .bottom-nav-new {
        width: 88%;
        max-width: 370px;
        bottom: 20px;
        height: 72px;
    }
    .bottom-scroll-blur {
        height: 92px;
    }
}

/* --- FULL HD AND ABOVE: 1920px+ (Monitors, 4K at various scale levels) --- */
@media (min-width: 1920px) {
    html, body {
        overflow: auto;
    }
    body {
        max-width: 100%;
    }
    #app-container {
        max-width: 414px;
        height: calc(100vh - 60px);
        max-height: 896px;
        margin: 30px auto;
        border-radius: 40px;
        border: 8px solid #333;
        box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    }
    .bottom-nav-new {
        width: 88%;
        max-width: 370px;
        bottom: 22px;
        height: 75px;
    }
    .bottom-scroll-blur {
        height: 97px;
    }
}

/* --- VERY SHORT SCREENS (landscape phones, small height) --- */
@media (max-height: 600px) and (max-width: 767px) {
    .app-header {
        padding: 12px 15px 25px 15px;
    }
    .waves-container {
        height: 25px !important;
    }
    #tab-inicio {
        padding: 10px 12px 85px 12px !important;
    }
    .grid-btn-new {
        min-height: 55px;
        padding: 8px 8px;
    }
    .bottom-nav-new {
        bottom: 8px;
        height: 60px;
        border-radius: 25px;
    }
    .bottom-scroll-blur {
        height: 68px;
    }
    .modal-content {
        padding: 10px 12px 75px 12px;
    }
    .modal-header {
        padding-top: 8px;
        margin-bottom: 8px;
    }
}

/* --- GALAXY Z FOLD OPEN (884px wide, special case) --- */
@media (min-width: 820px) and (max-width: 900px) and (min-height: 1000px) {
    #app-container {
        max-width: 600px;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }
    .options-grid-new {
        gap: 14px;
    }
    .grid-btn-new {
        min-height: 78px;
        font-size: 0.88rem;
    }
}

/* --- GALAXY Z FOLD CLOSED (narrow + tall, 345px) --- */
@media (min-width: 340px) and (max-width: 350px) and (min-height: 880px) {
    .grid-btn-new {
        padding: 11px 8px;
        font-size: 0.72rem;
        min-height: 60px;
    }
    .app-header .user-greeting {
        font-size: 1.1rem !important;
    }
}

/* --- ULTRAWIDE MONITORS (21:9 aspect ratio, 2560px+ wide) --- */
@media (min-width: 2560px) {
    #app-container {
        max-width: 414px;
        max-height: 896px;
    }
}

/* --- PRINT --- */
@media print {
    .bottom-nav-new,
    .desktop-bg,
    .bg-watermarks-new,
    #splash-welcome-screen,
    #fluid-wave-container {
        display: none !important;
    }
    #app-container {
        max-width: 100%;
        height: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .modal-content {
        padding-bottom: 20px;
    }
}
