:root {
    --bg: #f2f2f7;
    --card: #ffffff;
    --tx: #1c1c1e;
    --tx2: #8e8e93;
    --line: #e5e5ea;
    --pu: #8b6cff;
    --gr: #30d158;
    --bl: #0a84ff;
    --red: #ff453a;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.10);

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-xl: 28px;

    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #000;
        --card: #1c1c1e;
        --tx: #f2f2f7;
        --line: #2c2c2e;
        --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
        --shadow-md: 0 4px 16px rgba(0,0,0,.5);
        --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
    }
}

:root[data-theme="dark"] {
    --bg: #000;
    --card: #1c1c1e;
    --tx: #f2f2f7;
    --line: #2c2c2e;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.5);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.6);
}

* {
  
 
}

html {
    scroll-padding-top: env(safe-area-inset-top, 0px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px 60px;
    box-sizing: border-box;
}

.top {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 5;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--line);
}

.logo {
    border: 0;
    background: 0;
    padding: 0;
    cursor: pointer;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo i {
    font-style: normal;
    background: linear-gradient(135deg, var(--pu), var(--bl));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sbar {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--card);
    border-radius: var(--r-md);
    padding: 0 12px;
    box-shadow: var(--shadow-sm);
    border: 0.5px solid var(--line);
}

.sbar input {
    background: 0;
    padding: 10px 0;
}

.sbar input:focus {
    box-shadow: none;
}

.card {
    background: var(--card);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    border: 0.5px solid var(--line);
}

.card > .btn.pu {
    display: block;
    margin: 0 auto 20px;
}

.btn {
    border: 0;
    border-radius: var(--r-md);
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bl);
    color: #fff;
    transition: transform .12s cubic-bezier(.25,.1,.25,1),
                opacity .12s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(.96);
    opacity: .85;
}

.btn.soft {
    background: color-mix(in srgb, var(--bl) 14%, transparent);
    color: var(--bl);
}

.btn.gray {
    background: var(--line);
    color: var(--tx);
}

.btn.pu {
    background: linear-gradient(135deg, var(--pu), var(--bl));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--pu) 35%, transparent);
}

.btn.ic {
    padding: 8px 12px;
    font-size: 18px;
}

input, textarea {
    width: 100%;
    border: 0.5px solid var(--line);
    background: var(--bg);
    border-radius: var(--r-md);
    padding: 13px 15px;
    outline: 0;
    resize: vertical;
    transition: box-shadow .15s;
    box-sizing: border-box;
}

input:focus, textarea:focus, .btn:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bl) 45%, transparent);
    border-color: transparent;
}

.av {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 38px;
    font-weight: 700;
    flex: none;
    box-shadow: var(--shadow-md);
}

.av.s {
    width: 44px;
    height: 44px;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
}

.head {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nm {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0;
}

.sub {
    color: var(--tx2);
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 18px 0;
}

.stat {
    border: 0;
    color: inherit;
    background: var(--bg);
    border-radius: var(--r-md);
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    border: 0.5px solid var(--line);
}

.stat b {
    display: block;
    font-size: 20px;
}

.stat span {
    font-size: 12px;
    color: var(--tx2);
}

.stat.pw {
    cursor: default;
    background: linear-gradient(135deg, var(--pu), var(--bl));
    border: 0;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--pu) 35%, transparent);
}

.stat.pw b {
    font-size: 26px;
    color: #fff;
}

.stat.pw span {
    color: #fffc;
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.lbl {
    font-weight: 700;
    margin: 0 0 10px;
    font-size: 19px;
    letter-spacing: -0.3px;
}

.bio {
    word-break: break-word;
}

.msgs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.m {
    display: flex;
    flex-direction: column;
    max-width: 84%;
}

.m.media {
    max-width: 100%;
    width: 90%;
}

.m.media .b {
    width: 100%;
    max-width: 90%;
}

.m.o {
    align-self: flex-start;
    align-items: flex-start;
}

.m.f {
    align-self: flex-end;
    align-items: flex-end;
}

.who {
    background: 0;
    border: 0;
    padding: 0 8px 3px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.b {
    position: relative;
    padding: 10px 15px;
    border-radius: 20px;
    color: #fff;
    word-break: break-word;
    max-width: 100%;
    isolation: isolate;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
}

.o .b {
    background: var(--pu);
    border-bottom-left-radius: 6px;
}

.f .b {
    background: var(--gr);
    border-bottom-right-radius: 6px;
}

.o .b::after,
.f .b::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 14px;
    height: 18px;
    background: inherit;
    z-index: -1;
}

.o .b::after {
    left: -6px;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.f .b::after {
    right: -6px;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

iframe {
    width: 100%;
    min-width: 240px;
    aspect-ratio: 16/10;
    border: 0;
    border-radius: var(--r-md);
    margin-top: 6px;
    background: #000;
    display: block;
    box-shadow: var(--shadow-md);
}

.lk {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    background: rgba(127, 127, 127, .15);
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-sizing: border-box;
}

.lk small {
    display: block;
    font-weight: 400;
    opacity: .7;
    word-break: break-all;
}

.lk .av {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background .15s;
}

.item:hover {
    background: var(--bg);
}

.item .g {
    margin-left: auto;
    color: var(--tx2);
    font-size: 13px;
    text-align: right;
}

.err {
    color: var(--red);
    font-size: 14px;
    min-height: 18px;
}

.ov {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 20;
}

.pop {
    background: var(--card);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: clamp(440px, 60vw, 800px);
    box-shadow: var(--shadow-lg);
}

.pop .in {
    padding: 18px;
}

.hint {
    color: var(--tx2);
    font-size: 13px;
    margin: 6px 2px 0;
}

.clamp {
    max-height: 4.6em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 45%, transparent);
    mask-image: linear-gradient(#000 45%, transparent);
}

.more {
    border: 0;
    background: 0;
    color: var(--bl);
    font-weight: 600;
    padding: 8px 0 0;
    cursor: pointer;
}

.x {
    border: 0;
    background: 0;
    font-size: 16px;
    cursor: pointer;
    color: var(--tx2);
    padding: 6px;
}

.empty {
    text-align: center;
    color: var(--tx2);
    padding: 18px 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    background: var(--tx);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    z-index: 30;
    max-width: 92vw;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s cubic-bezier(.25,.1,.25,1);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.profile-grid .card {
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .wrap {
        max-width: 1100px;
    }
    .profile-grid {
        grid-template-columns: 1fr 1.5fr;
        align-items: start;
    }
}

@media (min-width: 1280px) {
    .wrap {
        max-width: 1280px;
    }
    .profile-grid {
        grid-template-columns: 1fr 2fr;
    }
}

@media (min-width: 1600px) {
    .wrap {
        max-width: 1500px;
    }
    .profile-grid {
        grid-template-columns: 1fr 3fr;
    }
}

@media (min-width: 1280px) {
    iframe {
        aspect-ratio: 16/9;
    }
}

@media (min-width: 1600px) {
    iframe {
        aspect-ratio: 21/9;  
    }
}

#ed {
    width: 100%;
    min-height: clamp(120px, 20vh, 300px);
    resize: vertical;
    box-sizing: border-box;
}