:root {
    --bg: #e6eaf3;
    --card: #e6eaf3;
    --line: rgba(110, 120, 150, .2);
    --ink: #1e2433;
    --mute: #566078;
    --ac: #4f46e5;
    --acl: rgba(79, 70, 229, .12);
    --ok: #16a34a;
    --sh-d: #c3c9da;
    --sh-l: #ffffff;
    --glass: rgba(255, 255, 255, .42);
    --glass-line: rgba(255, 255, 255, .7);
    --glass-sh: 0 10px 34px rgba(70, 80, 125, .2);
    --b1: rgba(99, 102, 241, .32);
    --b2: rgba(34, 211, 238, .26);
    --b3: rgba(244, 114, 182, .22);
    --raise: 7px 7px 16px var(--sh-d), -7px -7px 16px var(--sh-l);
    --raise-s: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l);
    --inset: inset 3px 3px 7px var(--sh-d), inset -3px -3px 7px var(--sh-l);
    color-scheme: light
}

:root[data-theme="dark"] {
    --bg: #1a1e2c;
    --card: #1a1e2c;
    --line: rgba(255, 255, 255, .09);
    --ink: #e6e9f5;
    --mute: #98a1bb;
    --ac: #8b93ff;
    --acl: rgba(139, 147, 255, .16);
    --ok: #4ade80;
    --sh-d: #0f121b;
    --sh-l: #262b40;
    --glass: rgba(28, 33, 54, .5);
    --glass-line: rgba(255, 255, 255, .13);
    --glass-sh: 0 10px 34px rgba(0, 0, 0, .5);
    --b1: rgba(99, 102, 241, .3);
    --b2: rgba(34, 211, 238, .14);
    --b3: rgba(244, 114, 182, .14);
    color-scheme: dark
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    line-height: 1.55
}

aside {
    width: 280px;
    background: var(--card);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: 20px 12px;
    flex-shrink: 0
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0 10px 18px;
    font-weight: 700
}

.brand i {
    background: var(--ac);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center
}

.brand small {
    display: block;
    color: var(--mute);
    font-weight: 400;
    font-size: .72rem
}

.lbl {
    font-size: .68rem;
    letter-spacing: .08em;
    color: var(--mute);
    padding: 16px 10px 6px;
    font-weight: 600
}

.nav {
    display: grid;
    grid-template-columns: 22px 1fr 18px;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .88rem;
    color: var(--ink);
    white-space: nowrap
}

.nav span {
    overflow: hidden;
    text-overflow: ellipsis
}

.nav .n {
    color: var(--mute);
    font-size: .75rem;
    font-weight: 600
}

.nav .c {
    color: var(--ok);
    visibility: hidden
}

.nav .bdg {
    background: var(--ac);
    color: #fff;
    font-size: .68rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    padding: 0 5px
}

.nav.done .c {
    visibility: visible
}

.nav:hover {
    background: var(--bg)
}

.nav.on {
    background: var(--acl);
    color: var(--ac);
    font-weight: 600
}

.nav.on .n {
    color: var(--ac)
}

main {
    flex: 1;
    min-width: 0;
    padding: 36px 32px
}

#m {
    max-width: 860px;
    margin: 0 auto
}

h1 {
    font-size: 1.8rem;
    letter-spacing: -.5px;
    margin-bottom: 4px
}

h2 {
    font-size: 1.05rem;
    margin: 26px 0 12px
}

.sub {
    color: var(--mute);
    margin-bottom: 22px
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 8px
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px
}

.stat b {
    display: block;
    font-size: 1.7rem
}

.stat span {
    color: var(--mute);
    font-size: .8rem
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px
}

.tc {
    cursor: pointer;
    transition: border-color .15s
}

.tc:hover {
    border-color: var(--ac)
}

.tag {
    font-size: .7rem;
    font-weight: 600;
    color: var(--ac);
    background: var(--acl);
    padding: 2px 8px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 8px
}

.bar {
    height: 6px;
    background: var(--line);
    border-radius: 9px;
    overflow: hidden;
    margin-top: 12px
}

.bar i {
    display: block;
    height: 100%;
    background: var(--ac);
    transition: width .3s
}

.bar.ok i {
    background: var(--ok)
}

.tabs {
    overflow-x: auto;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin: 18px 0 22px
}

.tab {
    white-space: nowrap;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--mute);
    font-size: .9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    gap: 6px;
    align-items: center
}

.tab.on {
    color: var(--ac);
    border-color: var(--ac);
    font-weight: 600
}

.item {
    display: flex;
    gap: 14px;
    margin-bottom: 12px
}

.chk {
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    color: #fff;
    font-size: .9rem
}

.chk.on {
    background: var(--ok);
    border-color: var(--ok)
}

.item h3 {
    font-size: .98rem;
    margin-bottom: 4px
}

.item p {
    color: #3d4658;
    font-size: .9rem
}

.btn {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: .8rem;
    padding: 6px 11px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px
}

.btn:hover {
    border-color: var(--ac);
    color: var(--ac)
}

.btn.yt i {
    color: #e11d48
}

.ans {
    display: none;
    margin-top: 10px;
    background: var(--acl);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .88rem
}

.ans.show {
    display: block
}

.back {
    cursor: pointer;
    color: var(--mute);
    font-size: .85rem;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 12px
}

.tip {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: .9rem
}

.tip i {
    color: var(--ac)
}

.drop {
    border: 1.5px dashed var(--line);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    color: var(--mute);
    cursor: pointer;
    margin-bottom: 18px
}

.drop:hover {
    border-color: var(--ac)
}

.doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px
}

.doc span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.ib {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--mute);
    font-size: 1.1rem
}

.ib:hover {
    color: var(--ac)
}

iframe,
.view img {
    width: 100%;
    height: 75vh;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff
}

.view img {
    height: auto
}

.view pre {
    white-space: pre-wrap;
    background: var(--card);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .85rem
}

.vid {
    display: block;
    position: relative;
    max-width: 260px;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden
}

.vid img {
    width: 100%;
    display: block
}

.vid i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
    text-shadow: 0 1px 8px #0008
}

.top,
.sc {
    display: none
}

.opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
    font: inherit;
    color: var(--ink)
}

.opt:hover {
    border-color: var(--ac)
}

.opt.good {
    border-color: var(--ok);
    background: #f0fdf4
}

.opt.bad {
    border-color: #dc2626;
    background: #fef2f2
}

.ta {
    width: 100%;
    min-height: 64px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: .88rem;
    resize: vertical;
    background: var(--card);
    color: var(--ink)
}

.dgw {
    margin-top: 14px;
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px
}

.dg {
    width: 100%;
    min-width: 300px;
    max-width: 620px;
    height: auto;
    display: block
}

.st {
    fill: var(--card);
    stroke: var(--ink);
    stroke-width: 1.5
}

.ed {
    fill: none;
    stroke: #475467;
    stroke-width: 1.5
}

.el {
    font-size: 12px;
    fill: var(--ac);
    font-weight: 600
}

.sl {
    font-size: 12px;
    fill: var(--ink);
    font-weight: 600
}

.tb {
    border-collapse: collapse;
    font-size: .82rem;
    margin-top: 8px
}

.tb td,
.tb th {
    border: 1px solid var(--line);
    padding: 4px 12px;
    text-align: center
}

.tb th {
    background: var(--bg)
}

.cap {
    font-size: .72rem;
    color: var(--mute);
    margin-top: 4px
}

.gr {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px
}

@media(max-width:860px) {
    body {
        display: block
    }

    .top {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 20;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        background: var(--card);
        border-bottom: 1px solid var(--line);
        font-weight: 700
    }

    aside {
        position: fixed;
        z-index: 30;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .2s
    }

    aside.open {
        transform: none
    }

    .sc.open {
        display: block;
        position: fixed;
        inset: 0;
        background: #0006;
        z-index: 25
    }

    main {
        padding: 22px 16px
    }

    h1 {
        font-size: 1.5rem
    }
}


/* ---------- Glass + soft-UI theme ---------- */
body {
    background: var(--bg)
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(40vmax 40vmax at 8% 6%, var(--b1), transparent 70%),
        radial-gradient(36vmax 36vmax at 92% 24%, var(--b2), transparent 70%),
        radial-gradient(42vmax 42vmax at 38% 100%, var(--b3), transparent 70%)
}

aside,
.top,
.pill {
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%)
}

aside {
    border-right: 1px solid var(--glass-line);
    box-shadow: var(--glass-sh)
}

.top {
    border-bottom: 1px solid var(--glass-line)
}

.brand i {
    box-shadow: 0 4px 12px rgba(79, 70, 229, .4)
}

.nav {
    border-radius: 12px;
    transition: box-shadow .15s, background .15s
}

.nav:hover {
    background: transparent;
    box-shadow: var(--raise-s)
}

.nav.on {
    background: transparent;
    box-shadow: var(--inset)
}

.card,
.dgw,
.view pre {
    background: var(--card);
    border: 0;
    border-radius: 18px;
    box-shadow: var(--raise)
}

.dgw {
    box-shadow: var(--inset)
}

.tc {
    transition: box-shadow .15s
}

.tc:hover {
    border-color: transparent;
    box-shadow: var(--raise-s)
}

.tc:active {
    box-shadow: var(--inset)
}

.bar {
    height: 9px;
    background: var(--bg);
    box-shadow: var(--inset)
}

.bar i {
    background: linear-gradient(90deg, #6366f1, var(--ac));
    border-radius: 9px
}

.bar.ok i {
    background: var(--ok)
}

.tabs {
    border: 0;
    background: var(--bg);
    box-shadow: var(--inset);
    padding: 5px;
    border-radius: 14px;
    gap: 4px
}

.tab {
    border: 0;
    margin: 0;
    border-radius: 10px;
    transition: box-shadow .15s
}

.tab.on {
    background: var(--bg);
    box-shadow: var(--raise-s)
}

.chk {
    border: 0;
    border-radius: 8px;
    background: var(--bg);
    box-shadow: var(--inset)
}

.chk.on {
    background: var(--ok);
    box-shadow: var(--raise-s)
}

.item p {
    color: var(--ink);
    opacity: .85
}

.btn,
.opt {
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--raise-s);
    transition: box-shadow .12s, color .12s
}

.btn:hover,
.opt:hover {
    border-color: transparent;
    color: var(--ac)
}

.btn:active,
.opt:active {
    box-shadow: var(--inset)
}

.opt.good {
    background: rgba(22, 163, 74, .14);
    box-shadow: inset 0 0 0 1.5px var(--ok)
}

.opt.bad {
    background: rgba(220, 38, 38, .13);
    box-shadow: inset 0 0 0 1.5px #ef4444
}

.ans {
    border-radius: 12px;
    box-shadow: var(--inset)
}

.ta,
.card input:not([type="checkbox"]) {
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--inset);
    color: var(--ink)
}

.drop {
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1.5px dashed var(--glass-line);
    border-radius: 18px
}

iframe,
.view img {
    border: 0;
    box-shadow: var(--raise);
    border-radius: 14px
}

.ed {
    stroke: var(--mute)
}

.tb th {
    background: transparent
}

.tag {
    border-radius: 8px
}

/* fixed glass credit bar + theme toggle */
.gbar {
    position: fixed;
    left: 280px;
    right: 0;
    bottom: 14px;
    z-index: 15;
    display: flex;
    justify-content: center;
    pointer-events: none
}

.pill {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 8px 7px 20px;
    border-radius: 999px;
    border: 1px solid var(--glass-line);
    box-shadow: var(--glass-sh);
    font-size: .82rem;
    color: var(--mute)
}

.pill a {
    color: var(--ac);
    font-weight: 600;
    text-decoration: none
}

.pill a:hover {
    text-decoration: underline
}

.pill a i {
    vertical-align: middle
}

.tg {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: var(--bg);
    color: var(--ink);
    font-size: 1.05rem;
    box-shadow: var(--raise-s)
}

.tg:active {
    box-shadow: var(--inset)
}

.tg .su,
:root[data-theme="dark"] .tg .mo {
    display: none
}

:root[data-theme="dark"] .tg .su {
    display: inline
}

main {
    padding-bottom: 100px
}

:focus-visible {
    outline: 2px solid var(--ac);
    outline-offset: 2px
}

@media(max-width:860px) {
    .gbar {
        left: 0
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {

    aside,
    .top,
    .pill,
    .drop {
        background: var(--bg)
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important
    }
}

/* ---------- Progress rings ---------- */
.rings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px;
    margin-bottom: 8px
}

.ring {
    --rc: var(--ac);
    --p: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 8px 0
}

.ring:nth-child(2) {
    --rc: #22d3ee
}

.ring:nth-child(3) {
    --rc: #f472b6
}

.ring>span {
    color: var(--mute);
    font-size: .82rem;
    font-weight: 600
}

.rg {
    position: relative;
    width: clamp(112px, 16vw, 140px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg);
    box-shadow: var(--inset)
}

.rg::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: conic-gradient(var(--rc) calc(var(--p) * 1%), transparent 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rc) 55%, transparent))
}

.rg::after {
    content: "";
    position: absolute;
    inset: 17%;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--raise-s), 0 0 1.1em .5em color-mix(in srgb, var(--rc) 20%, transparent)
}

.rg b {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    white-space: nowrap
}

.rg small {
    font-size: .7rem;
    font-weight: 500;
    opacity: .7;
    margin-left: 1px
}