:root {
    --font-body: "Manrope", sans-serif;
    --font-display: "Playfair Display", serif;
    --bg: #d4d8de;
    --bg-tint: rgba(241, 244, 248, 0.28);
    --surface: rgba(240, 243, 247, 0.26);
    --surface-strong: rgba(246, 248, 251, 0.38);
    --surface-soft: rgba(255, 255, 255, 0.1);
    --shadow: 0 28px 80px rgba(40, 49, 70, 0.14);
    --text: #1a2232;
    --muted: #606d84;
    --heading: #111827;
    --accent: #45d2c5;
    --accent-2: #6698ff;
    --line: rgba(255, 255, 255, 0.18);
}

.darkmode {
    --bg: #020308;
    --bg-tint: rgba(7, 9, 15, 0.46);
    --surface: rgba(10, 13, 20, 0.54);
    --surface-strong: rgba(13, 17, 26, 0.72);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
    --text: #e5e9f5;
    --muted: #8792a8;
    --heading: #fbfcff;
    --accent: #56e4d4;
    --accent-2: #6ea8ff;
    --line: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text);
    font-family: var(--font-body);
}

*::selection {
    background: rgba(86, 228, 212, 0.16);
    color: var(--heading);
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(102, 152, 255, 0.14), transparent 28%),
        linear-gradient(180deg, var(--bg-tint), rgba(255,255,255,0.02)),
        var(--bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

button {
    cursor: pointer;
    font: inherit;
}

.page-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -3;
}

.backdrop-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(44px);
}

.orb-one {
    width: 34rem;
    height: 34rem;
    top: -12rem;
    left: -10rem;
    background: rgba(86, 228, 212, 0.12);
}

.orb-two {
    width: 30rem;
    height: 30rem;
    right: -8rem;
    top: 18%;
    background: rgba(110, 168, 255, 0.14);
}

.backdrop-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 84px 84px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 88%);
}

.sidebar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: min(22rem, calc(100vw - 2rem));
    height: calc(100vh - 2rem);
    padding: 1.4rem 1rem 1rem;
    border-radius: 1.9rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    transform: translateX(0);
    transition: transform 0.32s ease, opacity 0.32s ease;
    z-index: 30;
}

.sidebar.closed {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    pointer-events: none;
}

.sidebar h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--heading);
    line-height: 1;
}

.sidebar ul {
    list-style: none;
    display: grid;
    gap: 0.85rem;
}

.sidebar li {
    display: flex;
}

.sidebar a,
.dark-mode-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 1rem 1.05rem;
    border-radius: 1.15rem;
    background: var(--surface-soft);
    color: var(--text);
}

.sidebar a {
    font-weight: 700;
}

#menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: var(--heading);
}

.dark-mode-toggle {
    justify-content: space-between;
}

.theme-switch {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.theme-switch span {
    color: var(--muted);
    font-weight: 700;
}

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

.slider {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    min-width: 3.5rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.slider::before {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0.22rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.28s ease;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

input:checked + .slider::before {
    transform: translateX(1.46rem);
}

.saved-shell {
    width: min(1200px, calc(100% - 2rem));
    min-height: 100vh;
    margin: 0 auto;
    padding: 1rem 0 2rem;
    display: grid;
    gap: 1.5rem;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0 1.2rem;
}

header h1 a {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 4.8rem);
    color: var(--heading);
    letter-spacing: -0.03em;
    line-height: 1;
}

#util,
#h_icons {
    display: flex;
    align-items: center;
}

#profile-icon {
    width: 3.3rem;
    height: 3.3rem;
    border-radius: 999px;
    border: 0;
    background: var(--surface-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--heading);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.saved-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 0.55rem;
}

.saved-toolbar h2 {
    color: var(--heading);
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.create-card-button {
    min-height: 3.35rem;
    padding: 0 1.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 16px 36px rgba(83, 157, 255, 0.24);
}

#CardContainer {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
}

.Cards {
    min-height: 360px;
    width: 100%;
    flex: 0 1 240px;
    max-width: 240px;
    padding: 1.15rem;
    border-radius: 1.7rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.4rem;
}

#internalcontainer {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.4rem;
}

#internalcontainer #Name {
    color: var(--heading);
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

#btns {
    display: flex;
    gap: 0.75rem;
}

#btns a {
    min-height: 3rem;
    padding: 0 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

#btns a:first-child {
    background: var(--surface-strong);
    color: var(--heading);
}

#btns a:last-child {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
}

.skeleton-card {
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

@media (max-width: 900px) {
    .saved-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .Cards {
        max-width: none;
        flex-basis: 220px;
    }
}

@media (max-width: 720px) {
    .sidebar {
        width: calc(100vw - 1rem);
        top: 0.5rem;
        right: 0.5rem;
        height: calc(100vh - 1rem);
    }

    .saved-shell {
        width: min(100%, calc(100% - 1rem));
    }

    #CardContainer {
        flex-direction: column;
    }

    .Cards {
        min-height: 150px;
        max-width: none;
        flex-basis: auto;
    }

    #internalcontainer {
        gap: 1rem;
    }

    #btns {
        flex-wrap: wrap;
    }
}

.sidebar-title {
    font-family: var(--font-body) !important;
    font-size: 0.78rem !important;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted) !important;
}

.brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    width: clamp(5.2rem, 10vw, 7.5rem);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.12));
}
