:root {
    --bg: #0d1117;
    --card: #161b22;
    --fg: #e6edf3;
    --muted: #8b949e;
    --accent: #ff6a00;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
    background:
        radial-gradient(
            1200px 800px at 10% -10%,
            rgba(255, 106, 0, 0.08),
            transparent 60%
        ),
        radial-gradient(
            1000px 700px at 110% 10%,
            rgba(255, 106, 0, 0.06),
            transparent 60%
        ),
        var(--bg);
    color: var(--fg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
}
body.noscroll {
    position: fixed;
    left: 0;
    right: 0;
    overflow: hidden;
    touch-action: none;
}
.accent-bar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.65;
    pointer-events: none;
}

header {
    width: min(100%, 720px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 8px 0 8px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-wrap {
    height: 46px;
    width: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, #1b222c, #0b0f14);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
}
header img {
    height: 28px;
    width: 28px;
    object-fit: contain;
}
h1 {
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    margin: 0;
    letter-spacing: 0.2px;
}

.authbar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.authbar .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 10px;
}
.auth-status {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Mobile My Links row */
.utilitybar {
    width: min(100%, 720px);
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
}
.utilitybar .btn {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    width: 100%;
}

/* Show on header >=768px */
.authbar .btn.my-links {
    display: none;
}
@media (min-width: 768px) {
    .authbar .btn.my-links {
        display: inline-flex;
    }
    .utilitybar {
        display: none;
    }
}

.card,
form,
#resultCard,
#donate,
#quotaTop {
    width: min(100%, 720px);
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
}
#quotaTop {
    margin-top: 10px;
    display: none;
    font-size: 0.95rem;
}
.quota-strong {
    color: var(--fg);
    font-weight: 700;
}
.muted {
    color: var(--muted);
}
.small {
    font-size: 0.9rem;
}
.monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

form {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}
label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}
input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: var(--fg);
    font-size: 1rem;
    width: 100%;
}
input:focus {
    outline: none;
    border-color: var(--accent);
}
#aliasGroup {
    display: grid;
    gap: 8px;
}
.form-actions {
    display: block;
}
.form-actions button {
    width: 100%;
}

/* Buttons */
button,
.btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition:
        filter 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}
.btn.primary {
    background: var(--accent);
    color: #fff;
}
.btn.neutral {
    background: #30363d;
    color: #fff;
}
.btn.danger {
    background: #e5484d;
    color: #fff;
}
.btn.convert {
    background: #ff6a00;
    color: #0b0f14;
}
button:hover,
.btn:hover {
    filter: brightness(1.03);
}
button:active,
.btn:active {
    transform: translateY(1px) scale(0.995);
}
.btn:focus-visible {
    outline: 2px solid #fff2;
    outline-offset: 2px;
}

/* Fancy loading */
.btn.loading {
    position: relative;
    background: linear-gradient(135deg, #ff6a00 0%, #ffa245 100%);
    color: #0b0f14;
    box-shadow: 0 10px 28px rgba(255, 106, 0, 0.36);
    overflow: hidden;
    pointer-events: none;
}
.btn.loading .btn-txt {
    opacity: 0.95;
}
.btn.loading .dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.btn.loading .dots b {
    width: 0.42em;
    height: 0.42em;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.7;
    transform: translateY(0);
    animation: dot-bounce 1s infinite ease-in-out;
}
.btn.loading .dots b:nth-child(2) {
    animation-delay: 0.15s;
}
.btn.loading .dots b:nth-child(3) {
    animation-delay: 0.3s;
}
@keyframes dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
.btn.loading::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: btn-shine 1.2s linear infinite;
    mix-blend-mode: screen;
}
@keyframes btn-shine {
    to {
        transform: translateX(100%);
    }
}

/* Copy badge */
.btn-copy {
    position: relative;
    z-index: 2;
}
.btn-copy::after {
    content: "Copied!";
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    font-size: 0.78rem;
    background: #23c552;
    color: #0b0f14;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(35, 197, 82, 0.35);
    opacity: 0;
    transform: translateY(4px) scale(0.94);
    pointer-events: none;
    filter: saturate(0.9);
    transition:
        opacity 320ms cubic-bezier(0.2, 0.7, 0.1, 1),
        transform 380ms cubic-bezier(0.2, 0.7, 0.1, 1),
        filter 320ms ease;
}
.btn-copy.copied::after {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
}
@media (prefers-reduced-motion: reduce) {
    .btn-copy::after {
        transition: none;
    }
}

#resultCard {
    margin-top: 16px;
    display: none;
}
.row {
    display: grid;
    gap: 8px;
}
.result-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}
.result-line a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

#donate {
    margin-top: 16px;
}
#donate h2 {
    margin: 0;
    font-size: 1.15rem;
    text-align: center;
}
#donate .sub {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}
#donate .sub .heart {
    color: var(--accent);
}
.donate-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.donate-card {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.donate-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.btncol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.momo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.qr-img {
    width: 180px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
    background: #0f141b;
    padding: 8px;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
}

.hidden {
    display: none !important;
}

/* -------- No-expiry UI -------- */
/* Disabled state */
#noExpiry:disabled {
    cursor: not-allowed;
    accent-color: #555;
}
#noExpiryGroup.disabled {
    opacity: 0.6;
    filter: grayscale(10%);
}

.card-ish {
    background: #0f141b;
    border: 1px solid #ffffff12;
    border-radius: 12px;
    padding: 14px;
}
.noexp {
    display: grid;
    gap: 14px;
}
.noexp-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.noexp-title {
    font-weight: 700;
}
.noexp .switch {
    position: relative;
    width: 56px;
    height: 34px;
    display: inline-block;
}
.noexp .switch input {
    display: none;
}
.noexp .switch .slider {
    position: absolute;
    inset: 0;
    background: #232a34;
    border: 2px solid #39424f;
    border-radius: 999px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}
.noexp .switch .slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transition:
        transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        background 0.2s ease,
        box-shadow 0.2s ease;
}
.noexp .switch input:checked + .slider {
    background: #1c232c;
    border-color: #ff6a00;
    box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.15);
}
.noexp .switch input:checked + .slider::before {
    transform: translateX(22px);
    background: linear-gradient(180deg, #fff, #ffe7d6);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.35);
}

/* Buy panel */
.buy-panel {
    border-top: 1px dashed #ffffff12;
    padding-top: 10px;
    display: grid;
    gap: 10px;
}
.buy-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.buy-title {
    font-weight: 700;
}

/* Stepper */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #1b222c;
    border: 1px solid #ffffff18;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: #30363d;
    color: #fff;
    font-size: 0;
    position: relative;
    display: block;
    cursor: pointer;
    transition:
        filter 0.15s ease,
        transform 0.08s ease,
        background 0.18s ease;
}
.stepper-btn:hover {
    filter: brightness(1.05);
}
.stepper-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Perfectly centered icons */
.stepper-btn.minus::before,
.stepper-btn.plus::before,
.stepper-btn.plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
}
.stepper-btn.minus::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px; /* horizontal bar length */
    height: 2px; /* bar thickness */
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
}
.stepper-btn.plus::before {
    width: 14px;
    height: 2px;
} /* horizontal */
.stepper-btn.plus::after {
    width: 2px;
    height: 14px;
} /* vertical */

.stepper-val {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* Mobile tweaks */
@media (max-width: 560px) {
    .buy-head {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }
    .stepper {
        justify-self: start;
    }
    .stepper-btn {
        width: 32px;
        height: 32px;
    }
    .stepper-val {
        min-width: 24px;
    }

    .result-line {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* -------- Overlay My Links -------- */
.overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 40;
    overscroll-behavior: contain;
}
.overlay.hidden {
    display: none;
}
.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: saturate(1.2) blur(2px);
    opacity: 0;
    animation: fadeIn 0.18s forwards;
}
.overlay-panel {
    position: relative;
    width: min(100%, 900px);
    max-height: 84vh;
    background: var(--card);
    border: 1px solid #ffffff10;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    transform: translateY(10px) scale(0.98);
    opacity: 0.8;
    animation: panelIn 0.2s forwards;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (max-width: 560px) {
    .overlay-panel {
        max-height: 88svh;
    }
}
.overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.links-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 18px 8px 8px;
}
.overlay-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* Link card */
.link-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #ffffff12;
    border-radius: 12px;
    background: #0f141b;
    transition:
        transform 0.12s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}
.link-item:hover {
    transform: translateY(-1px);
}
.link-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.link-url {
    word-break: break-all;
}
.link-target {
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.link-meta {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
    flex-wrap: wrap;
}
.link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Skeleton */
.skel {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #0f141b;
    border: 1px solid #ffffff12;
    padding: 14px;
}
.skel .bar {
    height: 14px;
    background: #131923;
    border-radius: 6px;
}
.skel .bar.big {
    height: 18px;
}
.shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
@keyframes panelIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}
.modal.hidden {
    display: none;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    animation: fadeIn 0.18s forwards;
}
.modal-panel {
    position: relative;
    margin: 8vh auto 0;
    max-width: 480px;
    background: var(--card);
    border: 1px solid #ffffff12;
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    transform: translateY(14px) scale(0.98);
    opacity: 0.8;
    animation: panelIn 0.2s forwards;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

:root {
    --bg: #0d1117;
    --card: #161b22;
    --fg: #e6edf3;
    --muted: #8b949e;
    --accent: #ff6a00;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.36);

    /* Glass-on-hover tokens */
    --glass-hover-border: rgba(255, 255, 255, 0.16);
    --glass-hover-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
    --glass-hover-blur: 8px;
    --glass-hover-sat: 1.12;

    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
    background:
        radial-gradient(
            1200px 800px at 10% -10%,
            rgba(255, 106, 0, 0.08),
            transparent 60%
        ),
        radial-gradient(
            1000px 700px at 110% 10%,
            rgba(255, 106, 0, 0.06),
            transparent 60%
        ),
        var(--bg);
    color: var(--fg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
}
body.noscroll {
    position: fixed;
    left: 0;
    right: 0;
    overflow: hidden;
    touch-action: none;
}
.accent-bar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.65;
    pointer-events: none;
}

header {
    width: min(100%, 720px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 8px 0 8px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-wrap {
    height: 46px;
    width: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, #1b222c, #0b0f14);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
}
header img {
    height: 28px;
    width: 28px;
    object-fit: contain;
}
h1 {
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    margin: 0;
    letter-spacing: 0.2px;
}

.authbar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.authbar .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 10px;
}
.auth-status {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Mobile My Links row */
.utilitybar {
    width: min(100%, 720px);
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
}
.utilitybar .btn {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    width: 100%;
}

/* Show on header >=768px */
.authbar .btn.my-links {
    display: none;
}
@media (min-width: 768px) {
    .authbar .btn.my-links {
        display: inline-flex;
    }
    .utilitybar {
        display: none;
    }
}

.card,
form,
#resultCard,
#donate,
#quotaTop {
    width: min(100%, 720px);
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
}
#quotaTop {
    margin-top: 10px;
    display: none;
    font-size: 0.95rem;
}
.quota-strong {
    color: var(--fg);
    font-weight: 700;
}
.muted {
    color: var(--muted);
}
.small {
    font-size: 0.9rem;
}
.monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

form {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}
label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}
input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: var(--fg);
    font-size: 1rem;
    width: 100%;
}
input:focus {
    outline: none;
    border-color: var(--accent);
}
#aliasGroup {
    display: grid;
    gap: 8px;
}
.form-actions {
    display: block;
}
.form-actions button {
    width: 100%;
}

/* Buttons */
button,
.btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition:
        filter 0.15s ease,
        transform 0.08s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}
.btn.primary {
    background: var(--accent);
    color: #fff;
}
.btn.neutral {
    background: #30363d;
    color: #fff;
}
.btn.danger {
    background: #e5484d;
    color: #fff;
}
.btn.convert {
    background: #ff6a00;
    color: #0b0f14;
}
button:hover,
.btn:hover {
    filter: brightness(1.03);
    transform: translateY(-1px) scale(1.015); /* phóng nhẹ như giọt nước */
    box-shadow: var(--glass-hover-shadow);
    border-color: var(--glass-hover-border);
}
/* Tinh chỉnh theo variant để không đổi palette gốc */
.btn.neutral:hover {
    background: rgba(48, 54, 61, 0.72); /* hơi trong suốt để thấy glass */
}
.btn.primary:hover {
    /* giữ màu accent, chỉ làm sáng nhẹ */
    filter: brightness(1.05);
}
.btn.danger:hover,
.btn.convert:hover {
    filter: brightness(1.04);
}
/* Glass real khi trình duyệt hỗ trợ */
@supports (backdrop-filter: blur(1px)) {
    button:hover,
    .btn:hover {
        backdrop-filter: saturate(var(--glass-hover-sat))
            blur(var(--glass-hover-blur));
    }
}
button:active,
.btn:active {
    transform: translateY(1px) scale(0.995);
}
.btn:focus-visible {
    outline: 2px solid #fff2;
    outline-offset: 2px;
}

/* Fancy loading */
.btn.loading {
    position: relative;
    background: linear-gradient(135deg, #ff6a00 0%, #ffa245 100%);
    color: #0b0f14;
    box-shadow: 0 10px 28px rgba(255, 106, 0, 0.36);
    overflow: hidden;
    pointer-events: none;
}
.btn.loading .btn-txt {
    opacity: 0.95;
}
.btn.loading .dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.btn.loading .dots b {
    width: 0.42em;
    height: 0.42em;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.7;
    transform: translateY(0);
    animation: dot-bounce 1s infinite ease-in-out;
}
.btn.loading .dots b:nth-child(2) {
    animation-delay: 0.15s;
}
.btn.loading .dots b:nth-child(3) {
    animation-delay: 0.3s;
}
@keyframes dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
.btn.loading::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: btn-shine 1.2s linear infinite;
    mix-blend-mode: screen;
}
@keyframes btn-shine {
    to {
        transform: translateX(100%);
    }
}

/* Copy badge */
.btn-copy {
    position: relative;
    z-index: 2;
}
.btn-copy::after {
    content: "Copied!";
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    font-size: 0.78rem;
    background: #23c552;
    color: #0b0f14;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(35, 197, 82, 0.35);
    opacity: 0;
    transform: translateY(4px) scale(0.94);
    pointer-events: none;
    filter: saturate(0.9);
    transition:
        opacity 320ms cubic-bezier(0.2, 0.7, 0.1, 1),
        transform 380ms cubic-bezier(0.2, 0.7, 0.1, 1),
        filter 320ms ease;
}
.btn-copy.copied::after {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
}
@media (prefers-reduced-motion: reduce) {
    .btn-copy::after {
        transition: none;
    }
}

#resultCard {
    margin-top: 16px;
    display: none;
}
.row {
    display: grid;
    gap: 8px;
}
.result-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}
.result-line a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

#donate {
    margin-top: 16px;
}
#donate h2 {
    margin: 0;
    font-size: 1.15rem;
    text-align: center;
}
#donate .sub {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}
#donate .sub .heart {
    color: var(--accent);
}
.donate-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.donate-card {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.donate-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.btncol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.momo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.qr-img {
    width: 180px;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
    background: #0f141b;
    padding: 8px;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
}

.hidden {
    display: none !important;
}

/* -------- No-expiry UI -------- */
/* Disabled state */
#noExpiry:disabled {
    cursor: not-allowed;
    accent-color: #555;
}
#noExpiryGroup.disabled {
    opacity: 0.6;
    filter: grayscale(10%);
}

.card-ish {
    background: #0f141b;
    border: 1px solid #ffffff12;
    border-radius: 12px;
    padding: 14px;
}
.noexp {
    display: grid;
    gap: 14px;
}
.noexp-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.noexp-title {
    font-weight: 700;
}
.noexp .switch {
    position: relative;
    width: 56px;
    height: 34px;
    display: inline-block;
}
.noexp .switch input {
    display: none;
}
.noexp .switch .slider {
    position: absolute;
    inset: 0;
    background: #232a34;
    border: 2px solid #39424f;
    border-radius: 999px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}
.noexp .switch .slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transition:
        transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        background 0.2s ease,
        box-shadow 0.2s ease;
}
.noexp .switch input:checked + .slider {
    background: #1c232c;
    border-color: #ff6a00;
    box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.15);
}
.noexp .switch input:checked + .slider::before {
    transform: translateX(22px);
    background: linear-gradient(180deg, #fff, #ffe7d6);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.35);
}

/* Buy panel */
.buy-panel {
    border-top: 1px dashed #ffffff12;
    padding-top: 10px;
    display: grid;
    gap: 10px;
}
.buy-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.buy-title {
    font-weight: 700;
}

/* Stepper */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #1b222c;
    border: 1px solid #ffffff18;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: #30363d;
    color: #fff;
    font-size: 0;
    position: relative;
    display: block;
    cursor: pointer;
    transition:
        filter 0.15s ease,
        transform 0.08s ease,
        background 0.18s ease;
}
.stepper-btn:hover {
    filter: brightness(1.05);
}
.stepper-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Perfectly centered icons */
.stepper-btn.minus::before,
.stepper-btn.plus::before,
.stepper-btn.plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
}
.stepper-btn.minus::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px; /* horizontal bar length */
    height: 2px; /* bar thickness */
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 2px;
}
.stepper-btn.plus::before {
    width: 14px;
    height: 2px;
} /* horizontal */
.stepper-btn.plus::after {
    width: 2px;
    height: 14px;
} /* vertical */

.stepper-val {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* Mobile tweaks */
@media (max-width: 560px) {
    .buy-head {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }
    .stepper {
        justify-self: start;
    }
    .stepper-btn {
        width: 32px;
        height: 32px;
    }
    .stepper-val {
        min-width: 24px;
    }

    .result-line {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* -------- Overlay My Links -------- */
.overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 40;
    overscroll-behavior: contain;
}
.overlay.hidden {
    display: none;
}
.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: saturate(1.2) blur(2px);
    opacity: 0;
    animation: fadeIn 0.18s forwards;
}
.overlay-panel {
    position: relative;
    width: min(100%, 900px);
    max-height: 84vh;
    background: var(--card);
    border: 1px solid #ffffff10;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    transform: translateY(10px) scale(0.98);
    opacity: 0.8;
    animation: panelIn 0.2s forwards;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (max-width: 560px) {
    .overlay-panel {
        max-height: 88svh;
    }
}
.overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.links-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 18px 8px 8px;
}
.overlay-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* Link card */
.link-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #ffffff12;
    border-radius: 12px;
    background: #0f141b;
    transition:
        transform 0.12s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}
.link-item:hover {
    transform: translateY(-1px);
}
.link-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.link-url {
    word-break: break-all;
}
.link-target {
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.link-meta {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
    flex-wrap: wrap;
}
.link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Skeleton */
.skel {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #0f141b;
    border: 1px solid #ffffff12;
    padding: 14px;
}
.skel .bar {
    height: 14px;
    background: #131923;
    border-radius: 6px;
}
.skel .bar.big {
    height: 18px;
}
.shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
@keyframes panelIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}
.modal.hidden {
    display: none;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    animation: fadeIn 0.18s forwards;
}
.modal-panel {
    position: relative;
    margin: 8vh auto 0;
    max-width: 480px;
    background: var(--card);
    border: 1px solid #ffffff12;
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    transform: translateY(14px) scale(0.98);
    opacity: 0.8;
    animation: panelIn 0.2s forwards;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
