:root {
    color-scheme: dark;
    --bg: #07100f;
    --bg-deep: #050b0b;
    --panel: rgba(17, 28, 29, .86);
    --panel-strong: rgba(20, 32, 34, .96);
    --panel-soft: rgba(23, 36, 37, .62);
    --line: rgba(169, 203, 199, .14);
    --line-strong: rgba(111, 235, 198, .24);
    --text: #f4f7f7;
    --muted: #98a8aa;
    --muted-2: #718184;
    --mint: #63efc0;
    --mint-2: #34dba6;
    --mint-deep: #143d33;
    --gold: #f6d477;
    --red: #ff767d;
    --violet: #bf88ff;
    --shadow: 0 20px 55px rgba(0, 0, 0, .28);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg-deep); }
html, body { margin: 0; min-height: 100%; }
body {
    min-width: 320px;
    min-height: 100dvh;
    color: var(--text);
    background: var(--bg-deep);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    overflow-x: hidden;
}
button, a { font: inherit; }
button { color: inherit; }

.app-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -10; background:
    radial-gradient(circle at 82% 1%, rgba(35, 119, 103, .22), transparent 24%),
    radial-gradient(circle at 16% 62%, rgba(39, 96, 83, .11), transparent 28%),
    linear-gradient(180deg, #091210 0%, #07100f 46%, #060d0d 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .22; }
.orb-one { width: 320px; height: 320px; right: -150px; top: 80px; background: #2bbd96; }
.orb-two { width: 260px; height: 260px; left: -160px; top: 50%; background: #167d69; opacity: .13; }
.planet { position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -270px; top: -185px; border: 1px solid rgba(107, 229, 195, .08); box-shadow: inset 30px -30px 70px rgba(52, 184, 151, .06), 0 0 80px rgba(47, 169, 141, .05); }
.noise { position: absolute; inset: 0; opacity: .03; background-image: radial-gradient(rgba(255,255,255,.7) .55px, transparent .55px); background-size: 7px 7px; }

.page-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: calc(var(--safe-top) + 24px) 20px calc(128px + var(--safe-bottom));
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.brand-lockup { display: flex; align-items: center; min-width: 0; }
.brand-mark {
    position: relative; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 17px;
    display: grid; place-items: center; margin-right: 13px;
    background: linear-gradient(145deg, rgba(30, 55, 53, .94), rgba(13, 27, 27, .98));
    border: 1px solid rgba(113, 233, 201, .08);
    box-shadow: inset 0 1px rgba(255,255,255,.04), 0 14px 30px rgba(0,0,0,.22);
}
.brand-m { font-size: 31px; line-height: 1; font-weight: 900; letter-spacing: -5px; transform: translateX(-2px) rotate(-5deg); color: var(--mint); text-shadow: 0 0 18px rgba(99,239,192,.25); }
.brand-spark { position: absolute; right: 7px; top: 4px; color: var(--mint); font-size: 13px; text-shadow: 0 0 15px var(--mint); }
.brand-name { font-size: clamp(25px, 5vw, 35px); font-weight: 850; letter-spacing: -.9px; white-space: nowrap; }
.brand-name span { color: var(--mint); }
.brand-subtitle { margin-top: 1px; color: var(--muted); font-size: 14px; }
.icon-button { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 17px; border: 1px solid var(--line); background: rgba(20,31,33,.7); display: flex; align-items: center; justify-content: center; gap: 4px; box-shadow: inset 0 1px rgba(255,255,255,.03); }
.icon-button span { width: 4px; height: 4px; border-radius: 50%; background: #95a5a8; }

.glass-card { background: linear-gradient(145deg, rgba(24,37,39,.83), rgba(13,24,25,.86)); border: 1px solid var(--line); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025); }
.hero-card { position: relative; min-height: 150px; border-radius: var(--radius-lg); padding: 24px; display: flex; align-items: center; overflow: hidden; }
.hero-card::before { content: ""; position: absolute; width: 250px; height: 250px; border: 1px solid rgba(99,239,192,.05); border-radius: 50%; right: -120px; top: -95px; box-shadow: inset 20px -20px 50px rgba(57,185,151,.04); }
.hero-user { position: relative; z-index: 1; display: flex; align-items: center; min-width: 0; max-width: 72%; }
.avatar-shell { width: 76px; height: 76px; flex: 0 0 76px; margin-right: 20px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 27px; color: var(--mint); background: radial-gradient(circle at 35% 25%, rgba(104,244,200,.22), rgba(22,64,52,.74)); border: 1px solid rgba(99,239,192,.38); box-shadow: 0 0 0 7px rgba(68,222,178,.04), 0 12px 34px rgba(0,0,0,.2); }
.avatar-shell img { width: 100%; height: 100%; object-fit: cover; }
.hero-title { font-size: clamp(20px, 4.5vw, 30px); font-weight: 820; line-height: 1.18; letter-spacing: -.45px; }
.hero-title span { color: var(--mint); }
.hero-text { color: var(--muted); margin-top: 7px; line-height: 1.45; font-size: 15px; }
.hero-decoration { position: absolute; z-index: 1; right: 24px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 5px; color: #829093; font-size: 9px; letter-spacing: 3.3px; text-align: right; }
.hero-star { color: var(--mint); font-size: 20px; margin-bottom: 2px; text-shadow: 0 0 18px rgba(99,239,192,.55); }

.section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 16px; }
.section-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section h1, .simple-heading h2 { margin: 0; font-size: clamp(25px, 5.5vw, 34px); line-height: 1.1; letter-spacing: -.7px; }
.count-pill { min-width: 39px; height: 34px; border-radius: 12px; display: inline-grid; place-items: center; padding: 0 11px; color: #cbd4d6; background: rgba(94,112,116,.18); border: 1px solid rgba(177,198,199,.07); font-weight: 720; }
.text-button { border: 0; background: transparent; color: var(--mint); padding: 8px 0 8px 10px; display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 15px; }
.text-button:active { opacity: .65; }
.plus { font-size: 27px; line-height: .8; font-weight: 300; }

.groups-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.group-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(24,37,39,.86), rgba(14,25,26,.9)); box-shadow: 0 16px 40px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.023); padding: 21px; display: grid; grid-template-columns: 76px minmax(0,1fr) 30px; gap: 17px; align-items: center; text-align: left; width: 100%; color: inherit; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
button.group-card { cursor: pointer; }
.group-card:active { transform: scale(.992); border-color: var(--line-strong); background: rgba(22,36,36,.94); }
.group-avatar { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(130,166,160,.13); background: linear-gradient(145deg, #122824, #0b1516); color: var(--mint); font-size: 28px; font-weight: 850; text-transform: uppercase; box-shadow: inset 0 1px rgba(255,255,255,.035); }
.group-avatar.variant-1 { background: radial-gradient(circle at 35% 25%, #24443f, #0b1516 65%); }
.group-avatar.variant-2 { background: radial-gradient(circle at 35% 30%, #2c2b47, #10141e 68%); color: #cbb7ff; }
.group-avatar.variant-3 { background: radial-gradient(circle at 35% 30%, #4a3325, #16110d 70%); color: #f6d477; }
.group-main { min-width: 0; }
.group-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.group-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; letter-spacing: -.35px; font-size: 21px; }
.group-description { margin-top: 5px; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-badges { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { height: 30px; border-radius: 11px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid; font-size: 13px; font-weight: 650; }
.badge-rank { color: var(--mint); border-color: rgba(80,220,177,.35); background: rgba(37,134,107,.15); }
.badge-premium { color: #d5adff; border-color: rgba(190,121,255,.37); background: rgba(111,52,158,.16); }
.badge-free { color: #c7d3e5; border-color: rgba(160,181,213,.27); background: rgba(81,100,126,.16); }
.group-card-arrow { font-size: 42px; font-weight: 220; color: #dce6e5; justify-self: end; transform: translateY(-2px); }
.group-meta { grid-column: 1 / -1; border-top: 1px solid rgba(188,210,207,.1); margin-top: 2px; padding-top: 13px; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 13px rgba(99,239,192,.45); }
.meta-spacer { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { border: 1px dashed rgba(120,157,151,.2); border-radius: var(--radius-lg); padding: 28px 22px; text-align: center; color: var(--muted); background: rgba(14,25,25,.5); }
.empty-state strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 7px; }
.error-state { border-color: rgba(255,118,125,.18); }
.show-all-button { margin: 12px auto 0; border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
.show-all-button span { color: var(--mint); font-size: 22px; }

.simple-heading { margin: 0 2px 16px; }
.simple-heading p { margin: 7px 0 0; color: var(--muted); font-size: 15px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quick-card { min-height: 122px; border-radius: var(--radius-md); border: 1px solid var(--line); background: linear-gradient(145deg, rgba(24,37,39,.82), rgba(13,24,25,.88)); box-shadow: 0 14px 35px rgba(0,0,0,.15), inset 0 1px rgba(255,255,255,.02); padding: 17px; display: grid; grid-template-columns: 52px minmax(0,1fr) 18px; gap: 13px; align-items: center; text-align: left; transition: .15s ease; }
.quick-card:active { transform: scale(.985); border-color: var(--line-strong); }
.quick-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 1px solid; }
.quick-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-icon-green { color: var(--mint); border-color: rgba(73,226,182,.24); background: rgba(30,122,97,.19); }
.quick-icon-gold { color: var(--gold); border-color: rgba(246,212,119,.24); background: rgba(129,101,31,.16); }
.quick-icon-red { color: var(--red); border-color: rgba(255,118,125,.22); background: rgba(128,51,56,.16); }
.quick-icon-violet { color: var(--violet); border-color: rgba(191,136,255,.23); background: rgba(91,56,128,.16); }
.quick-copy { min-width: 0; }
.quick-copy strong { display: block; font-size: 17px; margin-bottom: 4px; }
.quick-copy small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.card-arrow { color: #9aabad; font-size: 31px; font-weight: 250; }

.brand-note { margin-top: 23px; min-height: 69px; border-radius: var(--radius-md); padding: 14px 18px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.brand-note-star { color: var(--mint); font-size: 24px; text-shadow: 0 0 16px rgba(99,239,192,.5); }
.brand-note-arrow { margin-left: auto; color: #91a2a4; font-size: 30px; }

.bottom-nav { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; min-height: calc(83px + var(--safe-bottom)); padding: 8px max(12px, env(safe-area-inset-left)) var(--safe-bottom) max(12px, env(safe-area-inset-right)); display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: rgba(8,17,18,.92); border-top: 1px solid rgba(178,210,205,.1); backdrop-filter: blur(20px) saturate(125%); -webkit-backdrop-filter: blur(20px) saturate(125%); box-shadow: 0 -12px 35px rgba(0,0,0,.22); }
.nav-item { position: relative; border: 0; background: transparent; color: #91a0a4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--mint); }
.nav-item i { display: none; position: absolute; bottom: 2px; width: 16px; height: 3px; border-radius: 999px; background: var(--mint); box-shadow: 0 0 12px rgba(99,239,192,.45); }
.nav-item.is-active i { display: block; }

.sheet-backdrop { position: fixed; z-index: 90; inset: 0; background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
.bottom-sheet { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; max-height: min(76dvh, 720px); padding: 10px 18px calc(22px + var(--safe-bottom)); border-radius: 28px 28px 0 0; border: 1px solid var(--line); border-bottom: 0; background: rgba(11,22,23,.98); box-shadow: 0 -22px 70px rgba(0,0,0,.45); transform: translateY(104%); transition: transform .24s ease; overflow: auto; }
.bottom-sheet.is-open { transform: translateY(0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: rgba(176,196,196,.23); margin: 0 auto 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.sheet-kicker { color: var(--mint); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
.sheet-head h2 { margin: 3px 0 0; font-size: 25px; }
.sheet-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: rgba(31,44,45,.7); color: #b9c4c5; font-size: 28px; line-height: 1; }
.sheet-list { display: grid; gap: 10px; }
.sheet-group { width: 100%; border: 1px solid var(--line); border-radius: 17px; background: rgba(20,33,34,.78); padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.sheet-group-avatar { width: 45px; height: 45px; border-radius: 13px; display: grid; place-items: center; background: rgba(40,77,68,.55); color: var(--mint); font-weight: 800; }
.sheet-group-copy { min-width: 0; flex: 1; }
.sheet-group-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-group-copy small { display: block; color: var(--muted); margin-top: 3px; }
.sheet-group-arrow { color: var(--mint); font-size: 25px; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(99px + var(--safe-bottom)); max-width: calc(100% - 36px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 15px; border-radius: 13px; background: rgba(26,39,40,.96); border: 1px solid var(--line); color: #dfe8e8; font-size: 13px; box-shadow: 0 16px 42px rgba(0,0,0,.3); transition: opacity .18s ease, transform .18s ease; text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.skeleton-card { min-height: 156px; }
.skeleton { position: relative; overflow: hidden; background: rgba(106,130,128,.09); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent); animation: shimmer 1.35s infinite; }
.skeleton-avatar { width: 76px; height: 76px; border-radius: 20px; }
.skeleton-content { display: grid; gap: 10px; }
.skeleton-title { width: 65%; height: 20px; border-radius: 8px; }
.skeleton-line { width: 88%; height: 13px; border-radius: 7px; }
.skeleton-badges { width: 45%; height: 27px; border-radius: 10px; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

@media (min-width: 760px) {
    .page-shell { padding-left: 30px; padding-right: 30px; }
    .groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .group-meta { font-size: 11px; }
    .quick-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .quick-card { grid-template-columns: 48px minmax(0,1fr); min-height: 150px; align-content: center; }
    .quick-card .card-arrow { display: none; }
    .quick-icon { width: 48px; height: 48px; }
    .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, 100%); border: 1px solid rgba(178,210,205,.1); border-bottom: 0; border-radius: 26px 26px 0 0; }
}

@media (max-width: 560px) {
    .page-shell { padding-left: 14px; padding-right: 14px; padding-top: calc(var(--safe-top) + 16px); }
    .brand-mark { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
    .brand-m { font-size: 28px; }
    .brand-subtitle { font-size: 12px; }
    .icon-button { width: 45px; height: 45px; flex-basis: 45px; border-radius: 15px; }
    .hero-card { padding: 19px; min-height: 128px; }
    .hero-user { max-width: 100%; }
    .avatar-shell { width: 62px; height: 62px; flex-basis: 62px; margin-right: 14px; }
    .hero-decoration { display: none; }
    .hero-text { font-size: 13px; }
    .section { margin-top: 29px; }
    .section-heading { align-items: flex-end; }
    .text-button { font-size: 13px; }
    .group-card { grid-template-columns: 62px minmax(0,1fr) 22px; gap: 13px; padding: 16px; border-radius: 20px; }
    .group-avatar { width: 62px; height: 62px; border-radius: 17px; font-size: 23px; }
    .group-name { font-size: 18px; }
    .group-description { font-size: 12px; }
    .badge { height: 27px; font-size: 11px; padding: 0 9px; }
    .group-meta { gap: 11px; font-size: 10px; }
    .meta-spacer { display: none; }
    .quick-grid { gap: 10px; }
    .quick-card { min-height: 112px; padding: 13px; grid-template-columns: 44px minmax(0,1fr) 12px; gap: 10px; }
    .quick-icon { width: 44px; height: 44px; border-radius: 14px; }
    .quick-icon svg { width: 23px; height: 23px; }
    .quick-copy strong { font-size: 14px; }
    .quick-copy small { font-size: 10.5px; }
    .card-arrow { font-size: 24px; }
    .brand-note { font-size: 11px; }
}

@media (max-width: 390px) {
    .brand-subtitle { display: none; }
    .section-heading { gap: 8px; }
    .text-button span:last-child { display: none; }
    .quick-grid { grid-template-columns: 1fr; }
    .quick-card { min-height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
