@font-face {
    font-display: swap;
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 400;
    src: url('/assets/fonts/inter-tight-v7-latin-regular.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 500;
    src: url('/assets/fonts/inter-tight-v7-latin-500.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 700;
    src: url('/assets/fonts/inter-tight-v7-latin-700.woff2') format('woff2');
}

:root {
    --bg-color: #ffffff;
    --text-primary: #000000;
    --text-secondary: #555555;
    --accent-color: #000000;
    --card-bg: rgba(255, 255, 255, 0.8);
    --destructive: #ff0000;
    --border-color: #e0e0e0;
    --border-focus: #000000;
    --success-color: #008000;

    --shadow-soft: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-stack: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

body {
    font-family: var(--font-stack);
    background-color: #f8f8f8;

    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulseBorder {
    0% {
        border-color: transparent;
    }

    50% {
        border-color: #000;
    }

    100% {
        border-color: transparent;
    }
}

.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
}

.text-success {
    color: var(--success-color);
    font-weight: 600;
}

.text-error {
    color: var(--destructive);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.logo-area h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tagline-container {
    display: inline-flex;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
    vertical-align: middle;
    margin-left: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
}

.tagline-pill {
    padding: 1px 5px;
    background: #e5e5e5;
    color: #333;
    display: flex;
    align-items: center;
    letter-spacing: 0;
}

.tagline-pill.update {
    background: #000;
    color: #fff;
    cursor: pointer;
    border: none;
    font-weight: 700;
    transition: background 0.2s;
}

.tagline-pill.update:hover {
    background: #333;
}

.tagline-pill.hidden {
    display: none;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    background: #eee;
    padding: 3px;
    border-radius: 50px;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn.active {
    color: white;
    background: #000;
}

main {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 1rem 1.25rem 2rem 1.25rem;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

.home-top-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.upi-info-card {
    flex: 1;

    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 0;

}

.upi-info-card.glow-animate {
    animation: pulseBorder 1.5s ease-in-out;
}

.upi-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.payee-name {
    font-weight: 700;
    color: #000;
    margin-bottom: 0.1rem;
}

.upi-id {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
}

.qr-preview-card {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.1s;
    min-width: 140px;

    margin-bottom: 0;
}

.qr-preview-card:active {
    transform: scale(0.98);
}

#preview-qr-container {
    width: 80px;

    height: 80px;
    margin-bottom: 0.5rem;
}

#preview-qr-container svg {
    width: 100% !important;
    height: 100% !important;
}

.qr-preview-text {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.qr-preview-text svg {
    height: 1rem;
    width: 1rem;
}

.amount-entry-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.amount-display-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    font-weight: 700;
    color: #000;
    font-family: var(--font-stack);
}

.currency-symbol {
    color: #888;
    margin-right: 2px;
    font-weight: 400;
    font-family: var(--font-stack);
}

.amount-field-container {
    border: none;
    background: transparent;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    min-width: 1ch;
    text-align: left;
    outline: none;
    letter-spacing: -1px;
    font-family: var(--font-stack);
    padding: 0;
    margin: 0;
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
}

.amount-digit {
    display: inline-block;
}

.amount-digit.anim-enter {
    animation: anim-float-down 0.2s ease-out forwards;
}

.amount-digit.anim-exit {
    animation: anim-float-up 0.2s ease-in forwards;
}

.amount-placeholder {
    color: #ddd;
    animation: fade-in 0.2s ease forwards;
}

@keyframes anim-float-down {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes anim-float-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--destructive);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
}

.toast.error {
    background-color: var(--destructive);
}

.toast.success {
    background-color: #22c55e;
}

.toast.anim-enter {
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.anim-exit {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -100%);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes toast-out {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
    column-gap: 5px;
    position: relative;
    margin: auto;
    margin-top: 10px;
    margin-bottom: 10px;
}

.key {
    padding: 17px 0;
    font-size: 25px;
    font-weight: bold;
    text-align: center;
    background-color: #444;
    border-radius: 20px;
    transition: 0.1s ease;
    color: #fff;
    box-shadow: 0px 6px #333;
    border: none;
    font-family: var(--font-stack);
}

.key:active {
    transform: translate(0px, 6px);
    box-shadow: 0px 0px #000;
}

.key:disabled {
    pointer-events: none;
}

#key-backspace {
    font-size: 1.2rem;
    background-color: red;
    box-shadow: 0px 6px #bd0000;
}

#key-backspace:active {
    transform: translate(0px, 6px);
    box-shadow: 0px 0px #000;
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    border: 1px solid transparent;
}

.settings-item:active {
    background: #f5f5f5;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-group {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.settings-group h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.settings-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.setting-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.setting-control:last-child {
    margin-bottom: 0;
}

.sheet-handle-bar {
    width: 100%;
    height: 32px;

    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
}

.sheet-handle-pill {
    width: 40px;
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 5px;
}

.custom-select {
    position: relative;
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    color: #000;
}

.custom-select:focus {
    outline: none;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f9f9f9;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-trigger::after {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.custom-select.open .select-trigger {
    border-color: #000;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.custom-option:hover {
    background: #f0f0f0;
}

.custom-option.selected {
    background: #e6f7ff;

    font-weight: 600;
}

.logo-presets-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;

}

.btn-preset-logo {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.btn-preset-logo img {
    height: 24px;
    width: auto;
    object-fit: contain;
    display: block;
}

.btn-preset-logo:hover {
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;
    background: #f9f9f9;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.logo-preview-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-preview-left p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.logo-preview-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 8px;

    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#btn-remove-logo,
#btn-remove-bg {
    width: 32px;

    height: 32px;
    color: var(--destructive);
    background: rgba(255, 0, 0, 0.05);
    border-color: transparent;
    padding: 0;
}

#btn-remove-logo:hover,
#btn-remove-bg:hover {
    background: rgba(255, 0, 0, 0.1);
}

input[type=range] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 24px;

    margin: 0;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 6px;
    border: none;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 6px;
    border: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #000;

    margin-top: -7px;

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #000;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

select:focus {
    border-color: #000;
    outline: none;
}

.color-preview {
    width: 42px;

    height: 42px;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    flex-shrink: 0;
}

.logo-import-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

#logo-url-input,
#bg-url-input {
    flex: 1;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: #f9f9f9;
    min-width: 0;
}

#logo-url-input:focus,
#bg-url-input:focus {
    border-color: #000;
    outline: none;
    background: white;
}

.btn-sm,
.btn-primary,
.btn-secondary,
.btn-destructive {
    font-family: inherit;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

label.btn-secondary {
    display: flex;
}

.btn-sm {
    height: 38px;

    padding: 0 0.75rem;
    font-size: 0.8rem;
    background: #000;
    color: white;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-sm:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-icon {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 1px solid #ddd;
    color: #000;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;

    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.btn-primary {
    background: #000;
    color: white;
    padding: 0.9rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
    opacity: 0.9;
}

.btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #000;
    border: 1px solid #000;
    padding: 0.9rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
}

.btn-secondary:active:not(:disabled) {
    background: #f0f0f0;
}

.btn-destructive {
    background: transparent;
    color: var(--destructive);
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    width: 100%;
    font-size: 0.9rem;
}

.btn-destructive:active {
    background: rgba(255, 0, 0, 0.05);
}

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.bottom-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: calc(600px - 2rem);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(-50%) translateY(100%);

    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.bottom-sheet-overlay.open .bottom-sheet {
    transform: translateX(-50%) translateY(0);

}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.sheet-header h2 {
    font-size: 1.2rem;
    margin: 0;
    flex: 1;
    text-align: center;
}

.btn-close-sheet {
    background: #ddd;
    border: none;
    padding: 0.5rem 0 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    height: 2rem;
    width: 2rem;
    color: #888;
    display: flex;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}

.sheet-tabs {
    background: #f0f0f0;
    padding: 3px;
    border-radius: 12px;
    display: flex;
    margin-bottom: 1.5rem;
}

.sheet-tab {
    flex: 1;
    padding: 0.6rem;
    border-radius: 9px;
    background: transparent;
    border: none;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sheet-tab.active {
    background: white;
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sheet-tab-content {
    display: none !important;
}

.sheet-tab-content.active {
    display: block !important;
    animation: fadeIn 0.2s;
}

.sheet-content {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.4rem;
    display: block;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

#scanner-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: #000;
    margin-bottom: 1rem;
}

.scanner-controls {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

.scanner-controls button {
    flex: 1;
}

.scan-status {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    height: 1.2em;
}

.qr-capture-area {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 25px 15px;

    gap: 5px;
    width: 450px;
    aspect-ratio: 4/5;
    overflow: hidden;
    font-family: 'Inter Tight';
    font-weight: normal;
    box-shadow: var(--shadow-soft);
    border-radius: 15px;
    z-index: 0;
    transition: color 0.2s, text-shadow 0.2s;
}

.qr-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: inherit;
    pointer-events: none;
}

.qr-header-info,
.large-qr-container,
.qr-context-text,
.qr-footer {
    position: relative;
    z-index: 1;
}

.bg-presets-container {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    gap: 0.5rem;
}

.bg-presets-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.bg-presets-scroll::-webkit-scrollbar {
    display: none;
}

.btn-preset-theme {
    width: 8rem;
    height: 10rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-preset-theme img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-preset-theme.active {
    border-color: #000;

    transform: scale(0.95);
}

.btn-preset-theme:active {
    transform: scale(0.95);
}

.btn-preset-theme.loading-theme {
    pointer-events: none;
    opacity: 0.7;
}

.theme-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.theme-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.theme-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.65rem;
    text-align: center;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-preset-bg {
    flex: 0 0 8rem;
    aspect-ratio: 4/5;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: all 0.2s;

}

.btn-preset-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-preset-bg:hover {
    border-color: #000;
    transform: scale(1.05);
}

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: #333;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.bg-presets-container:hover .scroll-arrow {
    opacity: 1;
}

.scroll-arrow.left {
    left: -10px;
}

.scroll-arrow.right {
    right: -10px;
}

.scroll-arrow:hover {
    background: #fff;
    color: #000;
}

.qr-header-info {
    gap: 3px;
    display: flex;
    font-size: 10px;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
}

.qr-header-info span {
    text-wrap: nowrap;
}

.large-qr-container {
    padding: 10px 9px 2px 10px;
    margin: 10px 10px 0;
    border: 2px solid #000;
    border-radius: 20px;
    background-color: transparent;

    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;

}

.qr-layer-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background-color: transparent;

    pointer-events: none;
}

#glass-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;

    transition: opacity 0.2s;

}

.qr-layer-glass.active #glass-bg-image {
    filter: blur(8px);
    transform: scale(1.1);

}

.qr-layer-glass.active {
    filter: blur(8px);
    transform: scale(1.1);
}

.qr-layer-glass.active {
    filter: blur(8px);
    transform: scale(1.1);

}

.qr-layer-tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #ffffff;

    transition: background-color 0.2s;
}

#preview-qr-container {
    background-color: #ffffff;
    border-radius: 8px;

}

.large-qr-container svg {
    width: 100%;
    height: auto;
}

.qr-context-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

.qr-context-text {
    font-size: 14px;
    text-align: center;
}

.qr-amount-large {
    display: block;
    font-family: 'Inter Tight';
    font-size: 40px;
    font-weight: 700;
}

.qr-payee-highlight {
    font-family: 'Inter Tight';
    font-size: 15px;
    font-weight: 700;
    text-wrap: balance;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    word-break: break-word;
    max-width: 100%;
}

.qr-footer {
    font-size: 9px;
    text-align: center;
    text-wrap: nowrap;
    margin-top: 10px;
}

.sheet-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sheet-actions button {
    flex: 1;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: black;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 360px) {
    main {
        padding: 1rem 0.75rem 2rem 0.75rem;
    }

    .keypad {
        gap: 0.5rem;
    }

    .key {
        padding: 0.85rem;
        font-size: 1.25rem;
    }

    .amount-display-wrapper {
        font-size: 2.25rem;
    }

    .bottom-sheet {
        padding: 1.25rem 1rem 2rem 1rem;
    }

    .share-tool-row #btn-share-tool {
        flex: 1;
    }
}

.share-tool-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.icon-only {
    flex: 0 0 auto;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.settings-links-list {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.settings-link-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    position: relative;
}

.settings-link-item:last-child {
    border-bottom: none;
}

.settings-link-item:hover {
    background: #f0f0f0;
}

.settings-link-item::after {
    content: '›';
    position: absolute;
    right: 16px;
    color: #999;
    font-size: 1.2rem;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked+.toggle-slider {
    background-color: #2196F3;
}

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

input:focus+.toggle-slider {
    box-shadow: 0 0 1px #2196F3;
}

.settings-separator {
    height: 1px;
    background-color: #f0f0f0;
    margin: 1rem -1rem;

    width: calc(100% + 2rem);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #888;
    margin: 1.5rem 0 0.5rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-subsection {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.label-control {
    font-size: 0.9rem;
    font-weight: normal;
    color: #000;
}

.label-slider {
    margin: 0;
    font-size: 0.8rem;
    font-weight: normal;
    color: #555;
}

.logo-import-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    width: 100%;
}

.logo-import-row input[type="text"] {
    flex: 1;
    width: auto;

}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;

}

.logo-preview-left p {
    white-space: nowrap;
    margin-right: 0.5rem;
}

.pwa-instructions-container {
    margin-top: 1.5rem;
}

.pwa-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pwa-tabs::-webkit-scrollbar {
    display: none;
}

.pwa-tab-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-stack);
    font-weight: 600;
}

.pwa-tab-btn.active {
    background: #000;
    color: white;
}

.pwa-instruction-content {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    transition: background 0.3s;
}

.pwa-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
}

.pwa-step:last-child {
    margin-bottom: 0;
}

.pwa-step p {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.3;
    margin-bottom: 0;
}

.step-icon {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.step-icon svg {
    width: 18px;
    height: 18px;
}

.qr-bottom-options {
    position: sticky;
    bottom: 0;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 1.25rem;
    margin-top: 1rem;
}

.custom-select-container {
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 150px;
    position: relative;
    transition: all 0.2s;
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
}

.custom-select-trigger:hover,
.custom-select-trigger.active {
    border-color: #bbb;
    background: #fafafa;
}

.custom-select-trigger span {
    margin-right: 0.5rem;
    font-weight: 500;
}

.custom-select-options {
    position: absolute;
    bottom: 100%;

    right: 0;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    width: 100%;
    min-width: 150px;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;

    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-options.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.custom-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.custom-option:hover {
    background: #f5f5f5;
}

.custom-option.selected {
    background: #f0f0f0;
    font-weight: 600;
}

.custom-option.selected::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--text-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-left: 8px;
}

#theme-options-menu .custom-option {
    justify-content: left;
}

.color-picker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.cp-picker-area {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
    height: 200px;
    touch-action: none;
}

.cp-sb-grid {
    width: 200px;
    height: 200px;
    position: relative;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    background-color: red;

    background-image:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, transparent);
    cursor: crosshair;
}

.cp-sb-handle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cp-hue-slider {
    width: 30px;
    height: 100%;
    position: relative;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(to bottom,
            #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    cursor: ns-resize;
}

.cp-hue-handle {
    width: 110%;
    height: 10px;
    border: 2px solid white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    position: absolute;
    left: -5%;
    top: 0;
    transform: translateY(-50%);
    border-radius: 4px;
    pointer-events: none;
}

.cp-preview-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    background: #f5f5f5;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cp-color-preview-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
    background-color: #000;
    flex-shrink: 0;
}

.cp-hex-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.cp-hex-prefix {
    position: absolute;
    left: 10px;
    color: #888;
    font-family: monospace;
    font-size: 1.1rem;
    pointer-events: none;
}

.cp-hex-input {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 25px;

    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 1.1rem;
    text-transform: uppercase;
    background: white;
}

.cp-hex-input:focus {
    outline: none;
    border-color: #000;
}

.cp-hex-input.error {
    border-color: var(--destructive);
    color: var(--destructive);
}

.cp-presets-container {
    width: 100%;
}

.cp-presets-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cp-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.btn-cp-preset {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
}

.btn-cp-preset:hover {
    transform: scale(1.1);
    z-index: 2;
}

.btn-cp-preset:active {
    transform: scale(0.95);
}

.btn-cp-preset.light-border {
    border: 1px solid rgba(0, 0, 0, 0.1);
}