:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f0f3f8;
    --text: #141922;
    --muted: #8a93a3;
    --line: #e9edf3;
    --blue: #1677ff;
    --blue-2: #0b63e5;
    --red: #ff4d4f;
    --green: #15a36d;
    --radius: 22px;
    --shadow: 0 10px 30px rgba(31, 45, 61, .08);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8faff 0%, #f4f6fa 100%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--surface);
    position: relative;
    padding-bottom: 92px;
}

.page-header {
    padding: 20px 18px 14px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(233,237,243,.75);
}
.page-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-title { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
    display: grid; place-items: center; font-size: 20px;
}

.content { padding: 16px 16px 28px; }
.section-title { margin: 8px 2px 12px; font-size: 18px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display:none; }
.chip {
    flex: 0 0 auto; padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); font-size: 13px; color: #5e6674;
}
.chip.is-active { background: var(--blue); color: white; border-color: var(--blue); }

.hero-card, .news-card, .market-card, .panel, .profile-card, .detail-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.hero-card { box-shadow: var(--shadow); margin-bottom: 14px; }
.hero-card__media { height: 230px; object-fit: cover; width: 100%; background: var(--surface-2); }
.hero-card__body { padding: 15px 16px 16px; }
.badge { display: inline-flex; align-items:center; gap:5px; padding: 6px 9px; border-radius: 9px; background:#eaf2ff; color:var(--blue); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.hero-card h2 { font-size: 20px; margin: 10px 0 8px; letter-spacing: -.025em; line-height: 1.25; }
.muted { color: var(--muted); }
.meta { display:flex; gap:14px; align-items:center; color: var(--muted); font-size:12px; }
.news-list { display: grid; gap: 10px; }
.news-card { display:flex; min-height:105px; }
.news-card__media { width: 124px; object-fit: cover; background: var(--surface-2); }
.news-card__body { padding: 12px; display:flex; flex-direction:column; justify-content:space-between; min-width:0; }
.news-card__title { margin:0 0 8px; font-size:14px; line-height:1.3; }
.news-card__desc { margin:0 0 8px; color:var(--muted); font-size:12px; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

.bottom-nav {
    position: fixed; z-index: 50; bottom: 0; left: 50%; transform: translateX(-50%);
    width: min(100%, 760px); display:grid; grid-template-columns:repeat(3,1fr);
    background: rgba(255,255,255,.94); backdrop-filter: blur(18px); border-top:1px solid var(--line);
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
}
.bottom-nav__item { display:flex; flex-direction:column; align-items:center; gap:4px; color:#8b94a3; font-size:11px; font-weight:600; }
.bottom-nav__item.is-active { color:var(--blue); }
.nav-icon { font-size: 22px; line-height:1; }

.fab {
    position: fixed; z-index: 45; right: max(20px, calc((100vw - 760px)/2 + 20px)); bottom: 92px;
    width: 56px; height:56px; border-radius:50%; border:0; background:var(--blue); color:#fff; font-size:30px;
    display:grid; place-items:center; box-shadow: 0 12px 25px rgba(22,119,255,.32);
}

.search {
    width:100%; border:1px solid var(--line); border-radius:16px; padding:13px 14px; outline:none; background:#f8fafc;
}
.search:focus { border-color:#bcd5ff; box-shadow:0 0 0 4px #edf4ff; }

.category-strip { display:flex; gap:14px; overflow-x:auto; padding:4px 0 15px; scrollbar-width:none; }
.category-item { min-width:66px; text-align:center; font-size:11px; color:#656d7a; }
.category-icon { width:48px;height:48px;border-radius:16px;background:#f1f5fb;display:grid;place-items:center;margin:0 auto 6px;font-size:20px; }
.category-item.is-active .category-icon { background:#eaf2ff;color:var(--blue); }

.market-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.market-card { position:relative; }
.market-card__image { width:100%; aspect-ratio:1.1/1; object-fit:cover; background:#edf0f4; }
.market-card__body { padding:10px 11px 12px; }
.market-card__price { font-weight:800; font-size:15px; margin-bottom:5px; }
.market-card__title { font-size:12px; line-height:1.3; min-height:31px; }
.market-card__place { color:var(--muted);font-size:11px;margin-top:7px; }
.favorite-btn { position:absolute; right:8px; top:8px; width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.93);font-size:19px; }
.favorite-btn.is-active { color:var(--red); }

.profile-card { padding:18px; box-shadow:var(--shadow); }
.profile-main { display:flex;align-items:center;gap:14px; }
.avatar { width:72px;height:72px;border-radius:50%;object-fit:cover;background:#e9edf3; }
.profile-name { font-size:19px;font-weight:800; }
.profile-handle { margin-top:4px;color:var(--muted);font-size:13px; }
.profile-stats { display:grid;grid-template-columns:repeat(3,1fr);margin-top:18px;padding-top:16px;border-top:1px solid var(--line); }
.stat { text-align:center; }
.stat strong { display:block;color:var(--blue);font-size:18px; }
.stat span { color:var(--muted);font-size:10px; }
.menu-list { margin-top:14px;border:1px solid var(--line);border-radius:20px;overflow:hidden; }
.menu-row { display:flex;align-items:center;gap:12px;padding:15px 16px;border-bottom:1px solid var(--line);background:#fff; }
.menu-row:last-child{border-bottom:0}.menu-row__icon{width:28px}.menu-row__text{flex:1;font-size:14px}.menu-row__chevron{color:#abb2bf}

.backbar { display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--line);position:sticky;top:0;background:rgba(255,255,255,.94);backdrop-filter:blur(16px);z-index:20; }
.back { font-size:24px; }
.detail-hero { width:100%; max-height:420px; object-fit:cover; background:#eef1f5; }
.detail-body { padding:18px 17px 28px; }
.detail-title { font-size:25px;line-height:1.16;letter-spacing:-.035em;margin:10px 0; }
.detail-text { font-size:15px;line-height:1.72;color:#343a44; }
.detail-actions { display:flex;gap:10px;padding-top:16px;margin-top:16px;border-top:1px solid var(--line); }
.action-btn { border:1px solid var(--line);background:#fff;padding:10px 13px;border-radius:13px;color:#5d6674; }

.seller { display:flex;align-items:center;gap:12px;padding:15px;border:1px solid var(--line);border-radius:18px;margin-top:16px; }
.seller .avatar { width:46px;height:46px; }
.primary-btn { width:100%;border:0;border-radius:15px;background:var(--blue);color:white;font-weight:700;padding:14px 16px; }
.secondary-btn { width:100%;border:1px solid var(--blue);border-radius:15px;background:white;color:var(--blue);font-weight:700;padding:13px 16px; }

.form-card { padding:16px; }
.form-group { margin-bottom:14px; }
.form-label { display:block;font-size:12px;font-weight:700;margin-bottom:7px; }
.form-input, .form-textarea, .form-select { width:100%;border:1px solid var(--line);background:#fbfcfe;border-radius:14px;padding:13px 14px;outline:none; }
.form-textarea { min-height:120px;resize:vertical; }
.form-input:focus,.form-textarea:focus,.form-select:focus{border-color:#b8d2ff;box-shadow:0 0 0 4px #edf4ff}
.upload-box { border:1.5px dashed #b9d1fa;border-radius:18px;background:#f8fbff;padding:25px;text-align:center;color:var(--blue); }
.flash { margin:12px 16px;padding:12px 14px;border-radius:14px;background:#ecf9f3;color:#13714e;font-size:13px;border:1px solid #c9efde; }
.empty { text-align:center;padding:45px 20px;color:var(--muted); }

@media (min-width: 761px) {
    body { padding: 24px 0; }
    .app-shell { min-height: calc(100vh - 48px); border-radius: 30px; overflow:hidden; box-shadow:0 24px 80px rgba(28,42,62,.12); }
    .bottom-nav { bottom:24px; border-radius:0 0 30px 30px; }
    .fab { bottom:116px; }
}

/* v2 */
:root[data-theme="dark"] {
    --bg:#0f131a;--surface:#171c24;--surface-2:#202631;--text:#f4f6fa;--muted:#919baa;--line:#2a313d;
    --shadow:0 10px 30px rgba(0,0,0,.24);
}
:root[data-theme="dark"] body{background:linear-gradient(180deg,#10151d,#0d1117)}
:root[data-theme="dark"] .page-header,:root[data-theme="dark"] .backbar,:root[data-theme="dark"] .bottom-nav{background:rgba(23,28,36,.94)}
:root[data-theme="dark"] .menu-row,:root[data-theme="dark"] .action-btn,:root[data-theme="dark"] .chip,:root[data-theme="dark"] .secondary-btn{background:var(--surface)}
:root[data-theme="dark"] .search,:root[data-theme="dark"] .form-input,:root[data-theme="dark"] .form-textarea,:root[data-theme="dark"] .form-select{background:#111720;color:var(--text)}

.notice-link{position:relative}.notice-dot{position:absolute;right:-5px;top:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:var(--red);color:#fff;font-size:10px;font-weight:800;display:grid;place-items:center}
.news-toolbar{display:grid;grid-template-columns:1fr auto;gap:9px;margin-bottom:12px}.small-btn{border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:0 14px;color:var(--text)}
.like-btn.is-active{color:var(--red);border-color:#ffd0d2;background:#fff4f4}
.comment-list{display:grid;gap:10px;margin-top:14px}.comment{padding:13px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}.comment-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px;font-size:12px}.comment-name{font-weight:700}.comment-time{color:var(--muted)}.comment-text{font-size:13px;line-height:1.55}.comment-form{margin-top:16px}
.gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;background:var(--surface-2)}.gallery img{flex:0 0 100%;width:100%;max-height:440px;object-fit:cover;scroll-snap-align:center}.gallery-dots{display:flex;justify-content:center;gap:5px;margin:8px 0}.gallery-dot{width:6px;height:6px;border-radius:50%;background:#c8ced8}.gallery-dot:first-child{background:var(--blue)}
.status-pill{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:700}.status-active{background:#eaf8f1;color:#168158}.status-sold{background:#f2f3f6;color:#6e7581}.status-hidden{background:#fff2e9;color:#b96321}
.owner-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}.danger-btn{width:100%;border:1px solid #ffd0d0;border-radius:15px;background:#fff4f4;color:#c63d3f;font-weight:700;padding:13px 16px}
.tabs{display:flex;gap:8px;margin:12px 0;overflow-x:auto}.tab{padding:9px 12px;border-radius:999px;border:1px solid var(--line);font-size:12px;white-space:nowrap}.tab.is-active{background:var(--blue);color:white;border-color:var(--blue)}
.notification-list{display:grid;gap:10px}.notification{padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}.notification.is-unread{border-color:#c8dcff;background:#f7faff}.notification-title{font-weight:700;font-size:14px}.notification-body{color:var(--muted);font-size:12px;line-height:1.5;margin-top:5px}
.inline-form{display:inline}.help{font-size:11px;color:var(--muted);line-height:1.45;margin-top:6px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.image-previews{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}.image-preview{aspect-ratio:1;border-radius:12px;object-fit:cover;background:var(--surface-2)}
.profile-bio{font-size:12px;color:var(--muted);margin-top:7px;line-height:1.5}.count-badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#eef4ff;color:var(--blue);font-size:10px;font-weight:800;margin-left:6px}
.share-toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%);background:#151922;color:#fff;padding:10px 14px;border-radius:12px;font-size:12px;z-index:100;opacity:0;pointer-events:none;transition:.2s}.share-toast.show{opacity:1}
@media(max-width:480px){.form-grid{grid-template-columns:1fr}.owner-actions{grid-template-columns:1fr}}

/* v3 — Telegram auth + unified news media */
.login-card{border:1px solid var(--line);border-radius:24px;padding:28px 20px;text-align:center;background:var(--surface);box-shadow:var(--shadow);margin:24px 0}.login-card h1,.login-card h2{margin:10px 0 8px;letter-spacing:-.03em}.login-card p{color:var(--muted);font-size:13px;line-height:1.6;max-width:480px;margin:0 auto 18px}.login-logo{width:66px;height:66px;border-radius:22px;background:#eaf3ff;color:var(--blue);display:grid;place-items:center;margin:0 auto;font-size:30px;font-weight:800}.login-main-btn{display:block;text-align:center;margin-top:14px}.login-status{margin-top:18px;min-height:46px;border-radius:15px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;gap:10px;padding:10px 12px;color:var(--muted);font-size:12px}.login-spinner{width:16px;height:16px;border:2px solid #c7d5e8;border-top-color:var(--blue);border-radius:50%;animation:loginSpin .8s linear infinite}@keyframes loginSpin{to{transform:rotate(360deg)}}
.news-gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;background:var(--surface-2);scrollbar-width:none}.news-gallery::-webkit-scrollbar{display:none}.news-gallery>.detail-hero{flex:0 0 100%;scroll-snap-align:center;height:auto;min-height:220px;max-height:520px;object-fit:contain;background:#0d1117}.news-gallery video.detail-hero{width:100%}
:root[data-theme="dark"] .login-logo{background:#172b48}.telegram-connected{color:var(--green);font-weight:700}

/* v4 auth */
.is-hidden{display:none!important}.auth-card{max-width:460px;margin:22px auto}.auth-step{display:flex;flex-direction:column;gap:10px;text-align:left;margin-top:20px}.form-label{font-size:13px;font-weight:700;color:var(--muted,#6b7280)}.form-input{width:100%;box-sizing:border-box;border:1px solid var(--line,#e5e7eb);background:var(--card,#fff);color:var(--text,#111827);border-radius:14px;padding:14px 15px;font:inherit;outline:none}.form-input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.10)}.auth-code-input{font-size:26px;font-weight:800;letter-spacing:8px;text-align:center}.auth-sent{margin:0 0 5px;color:var(--muted,#6b7280);font-size:14px}.text-btn{border:0;background:transparent;color:#2563eb;font:inherit;font-weight:700;padding:8px;cursor:pointer}.auth-error{min-height:22px;color:#dc2626;font-size:14px;margin-top:12px}.auth-debug{margin-top:10px;border:1px dashed #f59e0b;background:rgba(245,158,11,.10);padding:10px 12px;border-radius:12px;font-size:13px;color:var(--text,#111827)}.auth-telegram-user{display:inline-flex;margin-top:8px;padding:8px 11px;border-radius:999px;background:rgba(34,197,94,.12);color:#15803d;font-size:13px;font-weight:700}.miniapp-auth-page{padding-top:max(18px,env(safe-area-inset-top))}.account-methods{background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);border-radius:18px;padding:16px;margin:14px 0}.account-methods h3{margin:0 0 12px}.auth-method{display:flex;align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--line,#e5e7eb)}.auth-method:first-of-type{border-top:0}.auth-method__icon{width:36px;height:36px;border-radius:11px;background:var(--soft,#f3f4f6);display:grid;place-items:center}.auth-method>div{display:flex;flex-direction:column;gap:2px;flex:1}.auth-method small{color:var(--muted,#6b7280);overflow-wrap:anywhere}.auth-method__state{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:var(--soft,#f3f4f6);color:var(--muted,#6b7280);font-weight:800}.auth-method__state.ok{background:rgba(34,197,94,.14);color:#16a34a}

/* v5 — Telegram Mini App adaptive shell */
html.telegram-miniapp,
html.telegram-miniapp body {
    width: 100%;
    min-height: 100%;
    background: var(--surface);
    overscroll-behavior-y: none;
}
html.telegram-miniapp body {
    padding: 0 !important;
    min-height: var(--tg-viewport-height, 100dvh);
}
html.telegram-miniapp .app-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: var(--tg-viewport-height, 100dvh);
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
}
html.telegram-miniapp .page-header,
html.telegram-miniapp .backbar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
}
html.telegram-miniapp .content {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
}
html.telegram-miniapp .bottom-nav {
    left: 0;
    right: 0;
    bottom: 0 !important;
    transform: none;
    width: 100%;
    max-width: none;
    border-radius: 0 !important;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
}
html.telegram-miniapp .fab {
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(88px + env(safe-area-inset-bottom)) !important;
}
html.telegram-miniapp .miniapp-auth-page {
    min-height: calc(var(--tg-viewport-height, 100dvh) - 1px);
    display: grid;
    place-items: center;
    padding-top: max(22px, env(safe-area-inset-top));
    padding-bottom: max(22px, env(safe-area-inset-bottom));
}
html.telegram-miniapp .miniapp-auth-page .auth-card {
    width: min(100%, 520px);
    margin: 0;
}

/* Wide Telegram Desktop: use the available canvas instead of a 760px phone column. */
@media (min-width: 900px) {
    html.telegram-miniapp .page-header__row {
        max-width: 1180px;
        margin: 0 auto;
    }
    html.telegram-miniapp .page-header {
        padding-top: 18px;
        padding-bottom: 14px;
    }
    html.telegram-miniapp .page-title { font-size: 30px; }
    html.telegram-miniapp .hero-card {
        display: grid;
        grid-template-columns: minmax(360px, 1.18fr) minmax(300px, .82fr);
        min-height: 300px;
    }
    html.telegram-miniapp .hero-card__media {
        height: 100%;
        min-height: 300px;
    }
    html.telegram-miniapp .hero-card__body {
        padding: 24px 26px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    html.telegram-miniapp .hero-card h2 { font-size: 26px; }
    html.telegram-miniapp .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    html.telegram-miniapp .news-card { min-height: 126px; }
    html.telegram-miniapp .news-card__media { width: 150px; }
    html.telegram-miniapp .news-card__title { font-size: 15px; }
    html.telegram-miniapp .market-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
    html.telegram-miniapp .market-card__image { aspect-ratio: 1.3 / 1; }
    html.telegram-miniapp .detail-card,
    html.telegram-miniapp .profile-card,
    html.telegram-miniapp .form-card,
    html.telegram-miniapp .panel,
    html.telegram-miniapp .menu-list {
        max-width: 980px;
        margin-left: auto;
        margin-right: auto;
    }
    html.telegram-miniapp .detail-hero { max-height: 600px; }
}

@media (min-width: 1250px) {
    html.telegram-miniapp .market-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
    html.telegram-miniapp .content { max-width: 760px; }
}

/* v6 — full-width desktop website */
@media (min-width: 761px) {
    html:not(.telegram-miniapp),
    html:not(.telegram-miniapp) body {
        width: 100%;
        min-height: 100%;
        background: var(--bg);
    }

    html:not(.telegram-miniapp) body {
        padding: 0;
    }

    html:not(.telegram-miniapp) .app-shell {
        width: 100%;
        max-width: none;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        padding-bottom: 92px;
    }

    html:not(.telegram-miniapp) .page-header,
    html:not(.telegram-miniapp) .backbar {
        width: 100%;
        padding-left: clamp(24px, 4vw, 72px);
        padding-right: clamp(24px, 4vw, 72px);
    }

    html:not(.telegram-miniapp) .page-header__row {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    html:not(.telegram-miniapp) .content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 24px clamp(24px, 4vw, 72px) 42px;
    }

    html:not(.telegram-miniapp) .bottom-nav {
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding-left: clamp(24px, 4vw, 72px);
        padding-right: clamp(24px, 4vw, 72px);
    }

    html:not(.telegram-miniapp) .fab {
        right: clamp(24px, 4vw, 72px);
        bottom: 94px;
    }

    html:not(.telegram-miniapp) .page-title {
        font-size: 32px;
    }

    html:not(.telegram-miniapp) .hero-card {
        display: grid;
        grid-template-columns: minmax(420px, 1.35fr) minmax(330px, .65fr);
        min-height: 340px;
    }

    html:not(.telegram-miniapp) .hero-card__media {
        height: 100%;
        min-height: 340px;
    }

    html:not(.telegram-miniapp) .hero-card__body {
        padding: 30px 32px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    html:not(.telegram-miniapp) .hero-card h2 {
        font-size: clamp(24px, 2vw, 34px);
        line-height: 1.15;
    }

    html:not(.telegram-miniapp) .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    html:not(.telegram-miniapp) .news-card {
        min-height: 138px;
    }

    html:not(.telegram-miniapp) .news-card__media {
        width: 170px;
    }

    html:not(.telegram-miniapp) .news-card__body {
        padding: 16px;
    }

    html:not(.telegram-miniapp) .news-card__title {
        font-size: 16px;
    }

    html:not(.telegram-miniapp) .news-card__desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    html:not(.telegram-miniapp) .market-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }

    html:not(.telegram-miniapp) .market-card__image {
        aspect-ratio: 1.25 / 1;
    }

    html:not(.telegram-miniapp) .market-card__price {
        font-size: 18px;
    }

    html:not(.telegram-miniapp) .market-card__title {
        font-size: 14px;
        min-height: 36px;
    }

    /* Detail pages and editing forms stay readable on very wide monitors. */
    html:not(.telegram-miniapp) .detail-card,
    html:not(.telegram-miniapp) .profile-card,
    html:not(.telegram-miniapp) .form-card,
    html:not(.telegram-miniapp) .panel,
    html:not(.telegram-miniapp) .menu-list,
    html:not(.telegram-miniapp) .login-card,
    html:not(.telegram-miniapp) .account-methods {
        max-width: 1180px;
        margin-left: auto;
        margin-right: auto;
    }

    html:not(.telegram-miniapp) .detail-hero {
        max-height: 680px;
    }
}

@media (min-width: 1180px) {
    html:not(.telegram-miniapp) .news-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    html:not(.telegram-miniapp) .news-card {
        display: block;
    }

    html:not(.telegram-miniapp) .news-card__media {
        width: 100%;
        height: 190px;
    }

    html:not(.telegram-miniapp) .news-card__body {
        min-height: 142px;
    }

    html:not(.telegram-miniapp) .market-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1650px) {
    html:not(.telegram-miniapp) .content,
    html:not(.telegram-miniapp) .page-header,
    html:not(.telegram-miniapp) .backbar {
        padding-left: 84px;
        padding-right: 84px;
    }

    html:not(.telegram-miniapp) .hero-card {
        grid-template-columns: minmax(620px, 1.5fr) minmax(390px, .5fr);
        min-height: 390px;
    }

    html:not(.telegram-miniapp) .hero-card__media {
        min-height: 390px;
    }
}

/* ==========================================================
   v7 — compact desktop website layout
   Full browser width, but readable content density.
   ========================================================== */
.desktop-topbar { display: none; }

@media (min-width: 900px) {
    html:not(.telegram-miniapp) body {
        background: #f6f8fb;
    }

    html:not(.telegram-miniapp) .app-shell {
        min-height: 100vh;
        padding-bottom: 0;
        background: var(--bg);
    }

    html:not(.telegram-miniapp) .desktop-topbar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 80;
        height: 68px;
        background: rgba(255,255,255,.93);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(16px);
    }

    html:not(.telegram-miniapp) .desktop-topbar__inner {
        max-width: 1380px;
        height: 100%;
        margin: 0 auto;
        padding: 0 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 32px;
    }

    html:not(.telegram-miniapp) .desktop-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        color: var(--text);
        text-decoration: none;
        min-width: 205px;
    }

    html:not(.telegram-miniapp) .desktop-brand__mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        display: grid;
        place-items: center;
        background: var(--blue);
        color: #fff;
        font-size: 20px;
        font-weight: 800;
        box-shadow: 0 8px 20px rgba(36,118,255,.2);
    }

    html:not(.telegram-miniapp) .desktop-brand b {
        display: block;
        font-size: 16px;
        letter-spacing: -.02em;
    }

    html:not(.telegram-miniapp) .desktop-brand small {
        display: block;
        margin-top: 1px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 500;
    }

    html:not(.telegram-miniapp) .desktop-nav {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px;
        border-radius: 14px;
        background: var(--surface-2);
    }

    html:not(.telegram-miniapp) .desktop-nav a {
        padding: 9px 16px;
        border-radius: 10px;
        color: var(--muted);
        text-decoration: none;
        font-size: 13px;
        font-weight: 700;
        transition: .18s ease;
    }

    html:not(.telegram-miniapp) .desktop-nav a:hover {
        color: var(--text);
        background: rgba(255,255,255,.65);
    }

    html:not(.telegram-miniapp) .desktop-nav a.is-active {
        color: #fff;
        background: var(--blue);
        box-shadow: 0 4px 12px rgba(36,118,255,.2);
    }

    html:not(.telegram-miniapp) .page-header,
    html:not(.telegram-miniapp) .backbar,
    html:not(.telegram-miniapp) .content {
        width: calc(100% - 40px);
        max-width: 1380px;
        margin-left: auto;
        margin-right: auto;
    }

    html:not(.telegram-miniapp) .page-header,
    html:not(.telegram-miniapp) .backbar {
        padding: 22px 8px 14px;
        border-bottom: 0;
        background: transparent;
    }

    html:not(.telegram-miniapp) .page-title {
        font-size: 27px;
        line-height: 1.05;
    }

    html:not(.telegram-miniapp) .page-subtitle {
        margin-top: 5px;
        font-size: 12px;
    }

    html:not(.telegram-miniapp) .content {
        padding: 4px 8px 44px;
    }

    html:not(.telegram-miniapp) .news-toolbar {
        margin-bottom: 10px;
    }

    html:not(.telegram-miniapp) .search {
        min-height: 42px;
    }

    html:not(.telegram-miniapp) .chips {
        margin-bottom: 14px;
    }

    html:not(.telegram-miniapp) .hero-card {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
        min-height: 0;
        height: 300px;
        margin-bottom: 18px;
        border-radius: 20px;
        overflow: hidden;
    }

    html:not(.telegram-miniapp) .hero-card__media {
        width: 100%;
        height: 300px;
        min-height: 0;
        object-fit: cover;
    }

    html:not(.telegram-miniapp) .hero-card__body {
        padding: 24px 26px;
        justify-content: center;
    }

    html:not(.telegram-miniapp) .hero-card h2 {
        margin: 9px 0 8px;
        font-size: clamp(22px, 1.65vw, 28px);
        line-height: 1.15;
    }

    html:not(.telegram-miniapp) .hero-card .muted {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html:not(.telegram-miniapp) .news-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    html:not(.telegram-miniapp) .news-card {
        display: grid;
        grid-template-columns: 126px minmax(0, 1fr);
        min-height: 118px;
        border-radius: 17px;
        overflow: hidden;
    }

    html:not(.telegram-miniapp) .news-card__media {
        width: 126px;
        height: 100%;
        min-height: 118px;
        object-fit: cover;
    }

    html:not(.telegram-miniapp) .news-card__body {
        min-height: 0;
        padding: 12px 13px;
    }

    html:not(.telegram-miniapp) .news-card__title {
        font-size: 14px;
        line-height: 1.28;
        margin-bottom: 6px;
    }

    html:not(.telegram-miniapp) .news-card__desc {
        font-size: 11px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }

    html:not(.telegram-miniapp) .meta {
        font-size: 10px;
    }

    html:not(.telegram-miniapp) .market-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }

    html:not(.telegram-miniapp) .market-card {
        border-radius: 17px;
        overflow: hidden;
    }

    html:not(.telegram-miniapp) .market-card__image {
        aspect-ratio: 1.45 / 1;
    }

    html:not(.telegram-miniapp) .market-card__body {
        padding: 11px 12px 13px;
    }

    html:not(.telegram-miniapp) .market-card__price {
        font-size: 16px;
    }

    html:not(.telegram-miniapp) .market-card__title {
        font-size: 13px;
        min-height: 34px;
    }

    html:not(.telegram-miniapp) .bottom-nav {
        display: none;
    }

    html:not(.telegram-miniapp) .fab {
        right: max(26px, calc((100vw - 1380px) / 2 + 18px));
        bottom: 26px;
        width: 50px;
        height: 50px;
        font-size: 25px;
        box-shadow: 0 10px 30px rgba(36,118,255,.28);
    }

    html:not(.telegram-miniapp) .detail-card,
    html:not(.telegram-miniapp) .profile-card,
    html:not(.telegram-miniapp) .form-card,
    html:not(.telegram-miniapp) .panel,
    html:not(.telegram-miniapp) .menu-list,
    html:not(.telegram-miniapp) .login-card,
    html:not(.telegram-miniapp) .account-methods {
        max-width: 1000px;
    }

    html:not(.telegram-miniapp) .detail-hero {
        max-height: 520px;
    }
}

@media (min-width: 1500px) {
    html:not(.telegram-miniapp) .news-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    html:not(.telegram-miniapp) .news-card {
        grid-template-columns: 118px minmax(0, 1fr);
    }
    html:not(.telegram-miniapp) .news-card__media {
        width: 118px;
    }
    html:not(.telegram-miniapp) .market-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .desktop-topbar { display: none !important; }
}

:root[data-theme="dark"] .desktop-topbar {
    background: rgba(23,28,36,.94);
}
:root[data-theme="dark"] .desktop-nav a:hover {
    background: rgba(255,255,255,.06);
}
