:root {
    --c: #38bdf8;
    --d: #0284c7;
    --bg: #f0f9ff;
    --t: #0c2a3d;
    --m: #5b7a8c;
    --card: #fff
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--t);
    padding-bottom: 70px
}

header {
    background: var(--c);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 5
}

header img {
    height: 36px
}

header b {
    font-size: 22px;
    flex: 1;
    color: #fff
}

header button {
    background: #fff;
    color: var(--d);
    border: 0;
    border-radius: 20px;
    padding: 7px 12px;
    font-weight: 600
}

main {
    max-width: 680px;
    margin: auto;
    padding: 14px
}

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 12px;
    margin: 0 0 14px;
    box-shadow: 0 1px 6px #0284c722
}

.card img {
    width: 100%;
    border-radius: 10px;
    display: block;
    margin-bottom: 8px
}

.btn,
button.btn {
    background: var(--d);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-size: 14px
}

.btn.o {
    background: #e0f2fe;
    color: var(--d)
}

input,
textarea {
    width: 100%;
    padding: 9px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin: 4px 0 8px;
    font: inherit
}

label {
    font-size: 13px;
    color: var(--m)
}

h2 {
    margin: 6px 0 12px
}

h3 {
    margin: 0 0 4px
}

.m {
    color: var(--m);
    font-size: 13px
}

.c {
    text-align: center;
    color: var(--m)
}

.tag {
    background: #e0f2fe;
    color: var(--d);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px
}

.bar {
    background: #e0f2fe;
    border-radius: 8px;
    margin: 4px 0;
    position: relative;
    overflow: hidden
}

.bar i {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--c);
    opacity: .5
}

.bar span {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 8px 10px
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

#m {
    position: fixed;
    inset: 0;
    background: #0006;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9;
    padding: 16px
}

#m .card {
    width: 100%;
    max-width: 360px;
    margin: 0
}

summary {
    cursor: pointer;
    list-style: none
}

body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent
}

header {
    padding-top: calc(10px + env(safe-area-inset-top))
}

nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    display: flex;
    border-top: 1px solid #cde;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 6
}

nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    font-size: 11px;
    color: var(--m);
    text-decoration: none
}

nav a svg {
    width: 25px;
    height: 25px
}

nav a.on {
    color: var(--d);
    font-weight: 700
}

nav a.on svg {
    stroke-width: 2.4
}

.btn:active,
nav a:active {
    transform: scale(.95)
}

.demo {
    background: #fef9c3;
    color: #713f12;
    font-size: 12px;
    text-align: center;
    padding: 6px 10px
}

.demo a {
    color: #713f12;
    font-weight: 700
}

.ads {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-bottom: 14px
}

.ad {
    flex: 0 0 100%;
    scroll-snap-align: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: block
}

.ad img {
    width: 100%;
    aspect-ratio: 3/1;
    object-fit: cover;
    display: block
}

.ad small {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #0008;
    color: #fff;
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 10px
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.st {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 1px 6px #0284c722
}

.st b {
    display: block;
    font-size: 24px;
    color: var(--d)
}

.st span {
    color: var(--m);
    font-size: 13px
}

.vb {
    width: 18px;
    height: 18px;
    vertical-align: -3px
}

nav a {
    font-size: 10.5px
}

#th {
    padding: 7px 10px
}

body.dark {
    --bg: #0b1d2a;
    --t: #e6f4fb;
    --m: #8fb3c7;
    --card: #12293a;
    --d: #38bdf8
}

body.dark input,
body.dark textarea {
    background: #0b1d2a;
    color: var(--t);
    border-color: #1e4259
}

body.dark .btn.o,
body.dark .tag,
body.dark .bar {
    background: #16384d
}

body.dark .btn {
    color: #06222f
}

body.dark .btn.o {
    color: #7dd3fc
}

body.dark nav {
    border-color: #1e4259
}

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

.ring {
    background: none;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--t);
    font-size: 12px;
    cursor: pointer
}

.ring img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    padding: 3px;
    border: 3px solid var(--c);
    background: var(--card)
}

.ring.seen img {
    border-color: #9ab
}

#sv {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center
}

#sv img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain
}

#sv p {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    padding: 0 16px;
    text-shadow: 0 1px 4px #000
}

.sb {
    position: absolute;
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 2
}

.sb i {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #fff5
}

.sb i.d {
    background: #fff
}

.sb i.a {
    background: linear-gradient(90deg, #fff 50%, #fff5 50%);
    background-size: 200% 100%;
    animation: sf 5s linear forwards
}

@keyframes sf {
    from {
        background-position: 100% 0
    }

    to {
        background-position: 0 0
    }
}

#sv .x {
    position: absolute;
    top: calc(22px + env(safe-area-inset-top));
    right: 14px;
    color: #fff;
    font-size: 24px;
    z-index: 3;
    text-decoration: none
}

#sv .pv,
#sv .nx {
    position: absolute;
    top: 70px;
    bottom: 70px;
    width: 40%
}

#sv .pv {
    left: 0
}

#sv .nx {
    right: 0
}

.chart {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    height: 140px
}

.chart div {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 2px
}

.chart i {
    width: 100%;
    background: var(--c);
    border-radius: 6px 6px 0 0;
    min-height: 2px
}

.chart small {
    font-size: 9px;
    color: var(--m)
}

.chart span {
    font-size: 11px;
    color: var(--m)
}

.ads {
    scrollbar-width: none
}

.ads::-webkit-scrollbar {
    display: none
}

#sv .sh {
    position: absolute;
    top: calc(22px + env(safe-area-inset-top));
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    z-index: 3;
    text-shadow: 0 1px 4px #000
}

#sv .sh img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    max-width: none;
    max-height: none;
    border: 2px solid #fff
}

#sv .sh span {
    opacity: .75;
    font-size: 13px
}

#sv .vb {
    width: 16px;
    height: 16px;
    vertical-align: 0
}

.ring .vb {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    margin-left: 2px
}