:root {
            --bg-color: #F5F5F7;
            --card-bg: #ffffff;
            --btn-grey: #F2F2F7;
            --btn-active: #E5E5EA;
            --text-main: #333;
            --text-dim: #bbb;
            --accent: #34c759;
            --danger: #ff3b30;
        }
		
		* {
			box-sizing: border-box; 
			-webkit-tap-highlight-color: transparent; 
		}
		
		html, body {
				height: 100%;
				margin: 0;
				padding: 0;
				overflow: hidden; 
			}
			
        body {
            background-color: var(--bg-color);
			display: flex; 
			justify-content: center; 
			align-items: center;
			min-height: 100vh; 
			margin: 0; 
			font-family: 'Segoe UI', system-ui, sans-serif;
			overflow: hidden;
        }
		body.dark-theme {
			--bg-color: #1C1C1E;
			--card-bg: #2C2C2E;
			--btn-grey: #3A3A3C;
			--btn-active: #48484A;
			--text-main: #FFFFFF;
			--text-dim: #8E8E93;
		}

        .calculator {
            background-color: var(--card-bg);
			padding: 20px;
			border-radius: 35px;
			box-shadow: 0px 20px 50px rgba(0,0,0,0.1);
			width: 360px; 
			height: 640px; 
			position: relative;
			display: flex;
			flex-direction: column;
			z-index: 10;
		}
		
		@media (max-width: 600px) {
				body {
					background-color: var(--card-bg); 
				}

				.calculator {
					position: fixed !important;
					top: 0 !important;
					left: 0 !important;
					width: 100% !important;
					height: 100% !important;
					border-radius: 0 !important;
					padding: 15px; /* मोबाइल पर थोड़ी कम पैडिंग ताकि बटन्स बड़े दिखें */
					margin: 0 !important;
					max-width: none !important;
					box-shadow: none;
				}
			}
		
		button.calc-btn {
			width: 100%; 
			height: 100%; 
			min-height: 60px; 
			font-size: 1.6rem;
			border: none;
			border-radius: 8px;
			cursor: pointer;
			background-color: var(--btn-grey);
			color: var(--text-main);
			transition: transform 0.1s;
		}

        /* डिस्प्ले एरिया */
        .display-container { flex: 0 0 160px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; }
        #input-view { font-size: 2.5rem; color: var(--text-main); font-weight: 400; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; height: 105px; line-height: 1.2; transition: font-size 0.3s ease; width: 100%; text-align: right; display: block; }
        #input-view::-webkit-scrollbar { display: none; }
        #result-preview {
			display: flex;
			justify-content: space-between;
			align-items: center;
			min-height: 1.8rem;
			margin-top: 5px;
			width: 100%;
		}

		/* बाईं तरफ item count */
		#item-count-preview {
			font-size: 1.2rem;
			color: #666;
			font-weight: 600;
		}

		/* दाईं तरफ result */
		#live-result-value {
			font-size: 1.6rem;
			color: green;
			font-weight: 700;
		}
        .cursor { display: inline-block; width: 2px; height: 2.4rem; background-color: var(--accent); animation: blink 1.2s infinite; vertical-align: middle; }
        @keyframes blink { 50% { opacity: 0; } }

        /* कंट्रोल बार */
        .control-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid #f2f2f2; margin-top: 10px; }
        .icon-btn { background: none; border: none; cursor: pointer; color: #8e8e93; padding: 8px; display: flex; align-items: center; transition: 0.2s; }
        .icon-btn:hover { color: var(--text-main); }

        /* कीपैड */
        .keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex-grow: 1; }
        button.calc-btn { height: 60px; font-size: 1.8rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; background-color: var(--btn-grey); color: var(--text-main); transition: 0.1s; }
        button.calc-btn:active { background-color: var(--btn-active); transform: scale(0.95); }
		.special-btn { background-color: var(--btn-active); font-weight: 600; }
        .equal-btn { background-color: var(--accent) !important; color: white !important; font-weight: 600;}

        /* एंट्री पेज */
        #entry-page { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; border-radius: 0px; flex-direction: column; z-index: 50; padding: 20px 5px; box-sizing: border-box; }
        .entry-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid #eee; }
        .entry-list { flex-grow: 1; overflow-y: auto; margin-top: 10px; padding-right: 5px; }
        .entry-list::-webkit-scrollbar { width: 4px; }
        .entry-list::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }

        /* एंट्री आइटम स्टाइल */
        .entry-card { border-bottom: 1px solid rgba(0,0,0,0.06) !important; border-radius: 0 !important; margin: 0;  !important; box-shadow: none !important; }
		.entry-card .icon-btn { padding: 12px; margin-right: -10px; }
		.entry-card .icon-btn span { font-size: 32px !important; color: #666; font-weight: bold; }
        .entry-content { flex-grow: 1; text-align: right; overflow: hidden; min-width: 0; padding-right: 8px;}
        .entry-title-row { font-weight: 600; font-size: 0.9rem; color: #888; display: flex; justify-content: space-between; align-items: center; }
        .entry-math-row { font-size: 1.15rem; color: #333; margin: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;}
        .entry-time-footer { font-size: 0.65rem; color: #ccc; text-align: center; margin-top: 5px; letter-spacing: 0.5px; }
		.entry-card:last-child { border-bottom: none !important; }
        
        .select-checkbox { display: none; width: 20px; height: 20px; accent-color: var(--accent); }
		
		.date-group-header {
			font-size: 0.85rem;
			font-weight: 700;
			color: var(--text-dim);
			margin: 18px 0 8px 12px;
			letter-spacing: 0.3px;
		}
		.group-wrapper {
			background: var(--card-bg); 
			border-radius: 18px; 
			margin: 0 4px 15px 4px;
			border: 1px solid rgba(0,0,0,0.04);
			overflow: hidden;
			box-shadow: 0 1px 3px rgba(0,0,0,0.05);
		}

        /* कस्टम पॉप-अप मॉडल्स */
        .modal-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); z-index: 100; justify-content: center; align-items: center; backdrop-filter: blur(2px); border-radius: 0px; }
        .modal-box { background: white; width: 280px; border-radius: 30px; text-align: center; padding: 30px 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); animation: slideUp 0.3s ease-out; }
        @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
        
        .modal-title { font-weight: 700; margin-bottom: 15px; text-align: center; color: #333; }
        .modal-btn { width: 100%; padding: 12px; margin-top: 8px; border: none; border-radius: 12px; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--btn-grey); color: #555; transition: 0.2s; }
        .modal-btn:hover { background: var(--btn-active); }
        .modal-btn.danger { color: var(--danger); }
        .modal-input { width: 100%; padding: 12px; border: 1px solid #eee; border-radius: 12px; margin-bottom: 15px; box-sizing: border-box; font-size: 1rem; outline: none; }
        .modal-input:focus { border-color: var(--accent); }

        .hidden { display: none; }
        .multi-delete-bar { display: none; justify-content: space-between; align-items: center; padding: 10px; background: #fff5f5; border-radius: 15px; margin-top: 10px; }
    
	/* सेटिंग्स और टूल्स पेज को फुल स्क्रीन बनाना (एंट्री पेज की तरह) */

#settings-page, #tools-page {
    position: fixed; /* absolute से बेहतर है क्योंकि यह स्क्रॉल को लॉक करता है */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 0; /* इसे 35px से 0 करना ही असली फिक्स है */
    z-index: 2000;    /* सबसे ऊपर दिखाने के लिए */
    margin: 0;
    padding: 0;
    display: none;    /* डिफ़ॉल्ट रूप से छिपा हुआ */
    flex-direction: column;
	overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px 15px 15px; 
    border-bottom: 1px solid var(--btn-grey);
    margin-bottom: 0px;
    background: var(--card-bg);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid var(--btn-grey);
}

/* मोडाल (पॉप-अप) का बैकग्राउंड */
.modal {
    display: none; /* डिफ़ॉल्ट रूप से छिपा हुआ */
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); /* पीछे का हिस्सा काला और पारदर्शी */
    backdrop-filter: blur(4px); /* पीछे का हिस्सा धुंधला */
    justify-content: center;
    align-items: center;
}

/* पॉप-अप बॉक्स */
.modal-content.small-modal {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    width: 85%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* सेटिंग्स पेज के विशिष्ट स्टाइल */
.settings-container {
    overflow-y: auto;
    flex: 1;
	padding: 0 15px;
    padding-bottom: 30px;
}

.settings-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 10px;
    letter-spacing: 1px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 12px;
    background: var(--btn-grey);
    border-radius: 18px;
    margin-bottom: 8px;
    transition: 0.2s;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-info span.icon {
    color: var(--text-main);
    font-size: 22px;
}

.setting-label {
    display: flex;
    flex-direction: column;
}

.label-main { font-size: 1rem; color: var(--text-main); }
.label-sub { font-size: 0.75rem; color: var(--text-dim); }

/* सुंदर टॉगल स्विच */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(21px); }

/* यूनिवर्सल टूल पेज स्टाइल */
#tool-detail-page {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: var(--card-bg); 
    border-radius: 0; 
    flex-direction: column; 
    z-index: 2500; 
    box-sizing: border-box;
}

.tool-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* टूल के अंदर के इनपुट बॉक्स का स्टाइल */
.tool-input-group {
    margin-bottom: 20px;
}

.tool-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.tool-field {
    width: 100%;
    background: var(--btn-grey);
    border: 1px solid transparent;
    border-radius: 15px;
    padding: 15px;
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 15px;
    outline: none;
    box-sizing: border-box;
}

.tool-field:focus {
    border-color: var(--accent);
}

.divider {
    text-align: center;
    color: var(--text-dim);
    margin: 10px 0;
    font-size: 0.8rem;
    position: relative;
}

#user-text {
    outline: none;             
    display: inline-block;
    min-width: 5px;
	width: 100%;
    caret-color: var(--accent); 
    word-break: break-all;      
	transition: font-size 0.2s ease;
}

#user-text:empty::before {
    content: '';
    display: inline-block;
}

/* पुरानी .cursor वाली एनीमेशन हटा दें क्योंकि अब इसकी जरूरत नहीं है */
.cursor { display: none; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 15px;
    top: 40px;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 2000;
    overflow: hidden;
}
.dropdown-content.show { display: block; animation: fadeIn 0.2s ease-out;}
.dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--danger);
}
.dropdown-content button:active { background-color: var(--btn-active); }

/* टूल्स के लिए विशेष स्टाइल */
.tool-label {
    display: block;
    margin: 15px 0 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.tool-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #ffffff; 
    color: var(--text-main);
    font-size: 1.1rem;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02); 
}

.tool-input:focus {
    border: 1px solid #34c759; /* फोकस होने पर हरा बॉर्डर */
}

.tool-divider {
    text-align: center;
    margin: 20px 0;
    border-bottom: 1px solid var(--btn-grey);
    line-height: 0.1em;
}

.tool-divider span {
    background: var(--card-bg);
    padding: 0 10px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.result-container {
    background: rgba(52, 199, 89, 0.1); /* हल्का हरा बैकग्राउंड */
    padding: 20px;
    border-radius: 18px;
    margin-top: 25px;
    text-align: center;
    border: 1px dashed #34c759;
}

.result-text {
    font-size: 1.25rem;
    color: var(--text-main);
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GST टूल के बटन्स के लिए */
.gst-type-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #333; /* काला बॉर्डर */
    background: #fff;       /* सफ़ेद बैकग्राउंड */
    color: #333;            /* काला टेक्स्ट */
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.gst-type-btn.active {
    background: #333;       /* एक्टिव होने पर काला बैकग्राउंड */
    color: #fff;            /* सफ़ेद टेक्स्ट */
}

/* इनपुट पर फोकस होने पर हरा रंग */
.tool-input:focus {
    border: 2px solid #34c759 !important; /* हरा फोकस */
}

/* सेलेक्ट बॉक्स के लिए */
select.tool-input {
    appearance: none;
    cursor: pointer;
}

/* तारीख इनपुट के डिब्बे */
.date-input-group {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.date-input-field {
    border: none !important;
    background: transparent !important;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
    padding: 5px !important;
    outline: none;
}

/* रिजल्ट का नया लुक */
.result-badge-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.result-badge {
    background: var(--bg-color);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.badge-val {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.badge-lbl {
    font-size: 0.7rem;
    color: gray;
    text-transform: uppercase;
}

.selected-mark{
    float:right;
    color:#34c759;
    font-weight:bold;
}

#shortcut-tool-modal .modal-content{
	max-height:70vh;
	overflow-y:auto;
}


.tossing-animation {
    animation: tossOut 2s cubic-bezier(.42,0,.58,1) forwards;
}

@keyframes tossOut {
    0% {
        transform: scale(1) rotateX(0deg);
    }
    50% {
        transform: scale(1.8) rotateX(1080deg);
    }
    100% {
        transform: scale(1) rotateX(var(--final-rotation));
    }
}

.call-btn.selected {
    background: #27ae60;
}


.btn{
	border:none;
	border-radius:8px;
	padding:16px 28px;
	background: #bdc3c7;
	color:#fff;
	font-size: 26px;
	font-weight:800;
	cursor:pointer;
	box-shadow:0 8px 18px rgba(0,0,0,.08)
}
