body {
    font-family: Segoe UI;
    margin: 0
}

html{
    scrollbar-gutter:stable;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand h3 {
    font-family: Unbounded;
    font-weight: 300
}

.brand,
.brand *{
    user-select:none;
    -webkit-user-select:none;
    -webkit-touch-callout:none;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.logo {
    width: 38px
}

.circle,
.modalClose {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0
}

.plus {
    background: #FF9F0A;
    color: #fff;
    font-size: 21px
}

.user-btn {
    background: #7096bc;
    color: #fff;
}

.panel {
    background: #F2F2F7;
    padding: 18px;
    border-radius: 22px;
    margin: 16px 0
}

.hidden {
    display: none
}

.types,
.colorRow {
    display: flex;
    gap: 8px
}

.types button,
#addBtn{
    width:100%;
    height:48px;
    border:0;
    border-radius:14px;
}

.types button{
    position:relative;
    transition:all .25s ease;
}

.types button::after{
    content:'';
    position:absolute;
    left:50%;
    bottom:0;
    width:0;
    height:3px;
    background:#0A84FF;
    border-radius:999px;
    transform:translateX(-50%);
    transition:all .25s ease;
}

.types button.active{
    color:#0A84FF;
}

.types button.active::after{
    width:50%;
}

.types{
    display:flex;
    gap:0px;
}

.types button{
    background:none;
    border:none;
    border-bottom:3px solid transparent;
    border-radius:0;
    height:48px;
    color:#666;
}

#addBtn {
    background: #FF9F0A;
    color: #fff
}

.nameRow{
    display:flex;
    gap:8px;
    align-items:center;
    margin-bottom:8px;
}

.nameRow #name{
    flex:1;
    margin:0;
}

#cardColor{
    position:absolute;
    inset:0;
    opacity:0;
    width:100%;
    height:100%;
    cursor:pointer;
}

input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    margin: 8px 0;
    border: 0;
    border-radius: 16px
}

#search {
    background: #F2F2F7
}

#cards{
    display:grid;
    grid-template-columns:
        repeat(4, 1fr);
    gap:16px;
}

@media(max-width:1024px){
    #cards{
        grid-template-columns:
            repeat(3, 1fr);
    }
}

@media(max-width:768px){
    #cards{
        grid-template-columns:
            repeat(2, 1fr);
    }

    .card h3{
        font-size:34px;
    }
}

.card {
    height:120px;
    border-radius:20px;
    position:relative;
    padding:10px 20px;
    display:flex;
    align-items:flex-end;
    border:1px solid #E5E5EA;
    box-sizing:border-box;
    min-width:0;
}

.card h3,
#thumbnailPreviewTitle {
    font-family:'Archivo Black';
    color:#fff;
    opacity:.75;
    margin:0;
    font-size:28px;
    line-height:1.1;
    max-width:70%;
    overflow:hidden;
    text-overflow:ellipsis;

    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    word-break:break-word;
}

.action {
    position: absolute;
    top: 10px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .3);
    border: 0;
    color: #fff;
    font-size: 21px
}

.fav {
    right: 10px;
}

.modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);

    overflow-y:auto;
    padding-bottom:100px;
    box-sizing:border-box;
}

.dangerZone{
    margin-top:20px;
    border-top:1px solid #eee;
    padding-top:16px;
    padding-bottom:80px;
}

.modal-content {
    background: white;
    width: min(90vw, 700px);
    margin: 30px auto;
    padding: 20px;
    border-radius: 24px;
    text-align: center;
}

.modal-content{
    max-height:85vh;
    overflow-y:auto;
    scrollbar-width:none;
}

.modal-content::-webkit-scrollbar{
    display:none;
}

.modalClose {
    width:42px;
    height:42px;
    border-radius:50%;
    background: rgba(0, 0, 0, .15);
    color: #fff;
    font-size:21px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-left: auto
}

.closeRow {
    display: flex;
    justify-content: flex-end
}

hr {
    border: 0;
    height: 1px;
    background: #E5E5EA
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding-bottom: 20px;
    color: #999;
    font-size: 10px
}

#barSvg{
    display:block;
    margin:20px auto;
}

#qrCanvas{
    display:block;
    margin:20px auto 0 auto;
}

#colorPickerBtn{
    position:relative;
    overflow:hidden;
}

#colorPickerBtn,
#scanBtn{
    width:36px;
    height:36px;
    flex-shrink:0;
    border-radius:50%;
}

.rainbow{
    background:
        conic-gradient(
        red,
        orange,
        yellow,
        lime,
        cyan,
        blue,
        purple,
        red
        );
}

#qrText{
    margin-top:8px;
    font-size:18px;
    color:#000;
    font-family:monospace;
    letter-spacing:1px;
    word-break:break-all;
}

.header-actions{
    display:flex;
    gap:8px;
    align-items:center;
}

.sheet{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:9999;
}

.sheet.hidden{
    display:none;
}

.sheetContent{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    background:white;
    border-radius:24px 24px 0 0;
    padding:24px;
    animation:sheetUp .25s ease;
}

.sheetHandle{
    width:40px;
    height:4px;
    background:#D1D1D6;
    border-radius:999px;
    margin:0 auto 16px;
}

.loginBtn{
    width:100%;
    height:52px;
    border:none;
    border-radius:16px;
    margin-top:10px;
    font-size:16px;
    font-weight:600;
}

.google{
    background:#4285F4;
    color:white;
}

.apple{
    background:black;
    color:white;
}

.profileBlock{
    text-align:center;
    margin-bottom:20px;
}

.avatarCircle{
    width:64px;
    height:64px;
    border-radius:50%;
    object-fit:cover;
    display:block;
    margin:auto;
    background:#7096bc;
}

#userName{
    font-size:18px;
    font-weight:600;
    margin-top:12px;
}

#userEmail{
    margin-top:4px;
    color:#666;
}

#vipBadge{
    margin-top:8px;
    color:#FF9F0A;
}

.logoutBtn{
    width:100%;
    height:52px;
    border:none;
    border-radius:16px;
    background:#FF3B30;
    color:white;
    font-weight:600;
}

@keyframes sheetUp{
    from{
        transform:translateY(100%);
    }
    to{
        transform:translateY(0%);
    }
}

.errorText{
    display:none;
    color:#FF3B30;
    font-size:12px;
    margin-bottom:8px;
    padding-left:4px;
}

.inputError{
    border:2px solid #FF3B30 !important;
}

#nameError{
    padding-top:4px;
}

.codeRow{
    display:flex;
    gap:8px;
    align-items:center;
    margin-bottom:8px;
}

.codeRow #code{
    flex:1;
    margin:0;
}

#scanBtn{
    background:#7096bc;
    color:white;
    border:none;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}

.loadingOverlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.4);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    z-index:99999;
}

.loadingOverlay.hidden{
    display:none;
}

.loadingSpinner{
    width:50px;
    height:50px;
    border:4px solid
        rgba(255,255,255,.3);
    border-top-color:#fff;
    border-radius:50%;
    animation:spin 1s linear infinite;
}

.loadingText{
    margin-top:12px;
    color:white;
    font-size:14px;
}

@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}

.skeleton{
    height:130px;
    border-radius:18px;
    margin-bottom:12px;
    background:
        linear-gradient(
            90deg,
            #ececec 25%,
            #f6f6f6 50%,
            #ececec 75%
        );
    background-size:200% 100%;
    animation:
        shimmer 1.4s infinite;
}

@keyframes shimmer{
    0%{
        background-position:
            200% 0;
    }
    100%{
        background-position:
            -200% 0;
    }
}

button:disabled{
    pointer-events:none;
    opacity:.5;
}

#modalTitle{
    text-align:center;
    font-size:24px;
    font-weight:700;
    margin:16px 0 8px;
}

#editCardBtn{
    display:block;
    margin:0 auto 16px;
    background:none;
    border:none;
    color:#7096bc;
    font-weight:600;
}

.dangerZone{
    margin-top:20px;
    border-top:1px solid #eee;
    padding-top:16px;
}

#deleteCardBtn{
    width:100%;
    height:48px;
    border:none;
    border-radius:14px;
    background:#FF3B30;
    color:white;
    font-weight:600;
}

#confirmDeleteBtn{
    width:100%;
    height:48px;
    border:none;
    border-radius:14px;
    background:#FF3B30;
    color:white;
    font-weight:600;
}

#cancelDeleteBtn{
    width:100%;
    height:48px;
    margin-top:8px;
    border:none;
    border-radius:14px;
    background:#F2F2F7;
}

#deleteSheet{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    display:flex;
    align-items:flex-end;
    justify-content:center;
    z-index:2000;
}

#deleteSheet.hidden{
    display:none;
}

.sheetCard{
    width:100%;
    max-width:480px;
    background:white;
    border-radius:24px 24px 0 0;
    padding:24px;
    box-sizing:border-box;
}

.sheetCard h3{
    margin:0 0 8px;
    text-align:center;
}

.sheetCard p{
    text-align:center;
    color:#666;
    margin-bottom:20px;
}

#cloudStatusRow{

    display:flex;

    justify-content:center;

    align-items:center;

    gap:6px;

    margin-top:8px;

    font-size:13px;

    font-weight:600;
}

#cloudStatus{
    color:#34C759;
}

#retrySyncBtn{
    display:none;
    color:#0A84FF;
    cursor:pointer;
    user-select:none;
}

.settingsRow{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px 0;
    border-top:1px solid #eee;
}

.langSwitch{
    display:flex;
    align-items:center;
    gap:8px;
}

.langSwitch button{
    background:none;
    border:none;
    cursor:pointer;
    color:#8E8E93;
    font-weight:600;
}

.langActive{
    color:#0A84FF !important;
}

#bottomNav{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    height:70px;
    background:white;
    border-top:1px solid #E5E5EA;
    display:flex;
    z-index:1000;
}

.navItem{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:4px;
    text-decoration:none;
    color:#8E8E93;
    font-size:12px;
}

.navItem.active{
    color:#FF9F0A;
    font-weight:700;
}

.navIcon{
    width:24px;
    height:24px;
    opacity:.45;
    transition:.2s;
}

.navItem.active .navIcon{
    opacity:1;
}

#detailIssuer{
    font-size:22px;
    font-weight:600;
}

#detailAnnualFee{
    color:#666;
}

#thumbnailSection{
    margin:12px 0;
}

.cardThumb{
    position:absolute;

    top:10px;
    left:10px;

    width:42px;
    height:42px;

    border-radius:10px;

    object-fit:cover;
}

#previewFrame{
    height:140px;
    overflow:hidden;
    border-radius:16px;
    position:relative;
    background:#eee;
}

#thumbnailPreview{
    width:100%;
    height:140px;
    border-radius:16px;
    background-size:cover;
    background-repeat:no-repeat;
    background-position:50% 50%;
}

#thumbnailPreviewCard{
    height:120px;
    border-radius:20px;
    position:relative;
    overflow:hidden;
    padding:10px 20px;
    box-sizing:border-box;
    display:flex;
    align-items:flex-end;
    margin:12px 0;
    border:1px solid #E5E5EA;
    background:
        linear-gradient(
            135deg,
            #0A84FF,
            #72B0FF
        );
}

#thumbnailPreviewActions{
    position:absolute;
    top:10px;
    right:10px;
    display:flex;
    gap:8px;
}

#changeBackgroundBtn,
#removeBackgroundBtn{
    width:36px;
    height:36px;
    border:none;
    border-radius:50%;
    background:
        rgba(255,255,255,.3);
    color:white;
    cursor:pointer;
}

#thumbnailPreviewTitle{
    position:absolute;
    left:20px;
    bottom:12px;
}

#removeBackgroundBtn{
    display:none;
}

#thumbnailPreviewCard{
    touch-action:none;
}