/* UPI MDR Calculator — Indian passbook / QR-counter desk */

.upi-mdr-workspace {
    --upi-ink: #14333a;
    --upi-paper: #f6f1e8;
    --upi-saffron: #e07a2f;
    --upi-teal: #0f766e;
    --upi-credit: #047857;
    --upi-debit: #be123c;
    position: relative;
    z-index: 10;
}

html.dark .upi-mdr-workspace {
    --upi-ink: #e2e8f0;
    --upi-paper: #121820;
}

.upi-glass-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: 0 12px 28px -18px rgba(20, 51, 58, 0.28);
}

html.dark .upi-mdr-workspace .upi-glass-card {
    background: rgba(18, 24, 38, 0.78);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.7);
}

.upi-disclaimer-capsule {
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: rgba(15, 118, 110, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

html.dark .upi-disclaimer-capsule {
    border-color: rgba(45, 212, 191, 0.22);
    background: rgba(15, 118, 110, 0.12);
}

.upi-disclaimer-capsule summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem 0.4rem 0.55rem;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #3f3f46;
    min-height: 32px;
    user-select: none;
}

html.dark .upi-disclaimer-capsule summary {
    color: #d4d4d8;
}

.upi-disclaimer-capsule summary::-webkit-details-marker {
    display: none;
}

.upi-disclaimer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0f766e;
    flex-shrink: 0;
}

.upi-disclaimer-chevron {
    margin-left: auto;
    font-size: 9px;
    color: #71717a;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.upi-disclaimer-capsule[open] {
    border-radius: 1rem;
}

.upi-disclaimer-capsule[open] .upi-disclaimer-chevron {
    transform: rotate(180deg);
}

.upi-disclaimer-body {
    padding: 0 0.85rem 0.75rem;
    font-size: 11px;
    line-height: 1.55;
    color: #52525b;
}

html.dark .upi-disclaimer-body {
    color: #a1a1aa;
}

.upi-disclaimer-body p + p {
    margin-top: 0.45rem;
}

/* Passbook result */
.upi-passbook {
    background: var(--upi-paper);
    border: 1px solid rgba(20, 51, 58, 0.12);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 18px 40px -24px rgba(20, 51, 58, 0.45);
}

html.dark .upi-passbook {
    background: #161d27;
    border-color: rgba(255, 255, 255, 0.08);
}

.upi-passbook-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: linear-gradient(90deg, #0f766e, #0d9488);
    color: #fff;
}

.upi-passbook-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.7rem 1.15rem;
    font-size: 0.8rem;
}

.upi-passbook-row + .upi-passbook-row {
    border-top: 1px dashed rgba(20, 51, 58, 0.12);
}

html.dark .upi-passbook-row + .upi-passbook-row {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.upi-passbook-total {
    background: rgba(15, 118, 110, 0.08);
    font-weight: 800;
}

html.dark .upi-passbook-total {
    background: rgba(15, 118, 110, 0.16);
}

/* Category chips */
.upi-cat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

@media (min-width: 640px) {
    .upi-cat-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.upi-cat-btn {
    text-align: left;
    padding: 0.7rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid #e4e4e7;
    background: #fff;
    cursor: pointer;
    min-height: 3.4rem;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

html.dark .upi-cat-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #d4d4d8;
}

.upi-cat-btn:hover {
    border-color: #0f766e;
}

.upi-cat-btn.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.1);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.25);
}

.upi-cat-btn:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

.upi-cat-btn strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: #14333a;
}

html.dark .upi-cat-btn strong {
    color: #f4f4f5;
}

.upi-cat-btn span {
    display: block;
    font-size: 0.62rem;
    color: #71717a;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.upi-amount-field:focus-within {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.upi-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background: #e4e4e7;
    outline: none;
}

html.dark .upi-range-slider {
    background: #27272a;
}

.upi-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f766e;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.45);
}

.upi-range-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f766e;
    cursor: pointer;
    border: none;
}

.upi-slider-scale {
    position: relative;
    height: 1.15rem;
    margin-top: 0.1rem;
}

.upi-tick {
    position: absolute;
    top: 0;
    font-size: 10px;
    font-weight: 600;
    color: #71717a;
    white-space: nowrap;
    transform: translateX(-50%);
}

html.dark .upi-tick {
    color: #a1a1aa;
}

.upi-tick-start {
    transform: none;
}

.upi-tick-end {
    transform: translateX(-100%);
}

.upi-preset-btn {
    min-height: 2.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 12px;
    font-weight: 700;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    color: #3f3f46;
    transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

html.dark .upi-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #d4d4d8;
}

.upi-preset-btn.is-active,
.upi-preset-btn[aria-pressed="true"] {
    background: #0f766e !important;
    color: #ffffff !important;
    border-color: #0d5e58 !important;
}

html.dark .upi-preset-btn.is-active,
html.dark .upi-preset-btn[aria-pressed="true"] {
    background: #0f766e;
    color: #ffffff;
    border-color: #5eead4;
}

.upi-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.upi-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.upi-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #d4d4d8;
    transition: 0.25s ease;
    border-radius: 24px;
}

html.dark .upi-toggle-slider {
    background-color: #3f3f46;
}

.upi-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s ease;
    border-radius: 50%;
}

.upi-toggle-switch input:checked + .upi-toggle-slider {
    background-color: #0f766e;
}

.upi-toggle-switch input:checked + .upi-toggle-slider:before {
    transform: translateX(20px);
}

.upi-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.upi-table {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
}

.upi-table th,
.upi-table td {
    padding: 0.8rem 0.9rem;
    text-align: left;
    white-space: nowrap;
}

.upi-table tbody tr:hover {
    background-color: rgba(15, 118, 110, 0.05);
}

.upi-source-links a {
    color: #0f766e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

html.dark .upi-source-links a {
    color: #5eead4;
}

@media print {
    header,
    nav,
    footer,
    .no-print,
    .hide-print,
    #navbar,
    #sidebar,
    .tool-ad-slot,
    .ai-dock,
    .ai-modal,
    .upi-mobile-dock,
    #export-dropdown,
    .fin-action-btn,
    .tool-navigation {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .fin-glass-card,
    .fin-result-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
    }

    #upi-print-report {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .upi-cat-btn,
    .upi-preset-btn,
    .upi-range-slider::-webkit-slider-thumb {
        transition: none !important;
    }
}

