/* ═══════════════════════════════════════════════════════════
   Imkon AI — системаи дизайн
   ═══════════════════════════════════════════════════════════ */
:root {
    /* бренди Imkon AI (палитраи №1): графит + лаймии сабзтар */
    --accent: #4a53b8;
    --accent-ink: #ffffff;
    --bg: #101214;
    --surface: #17191c;
    --surface-2: #1d2024;
    --surface-3: #262a30;
    --line: #26292e;
    --line-2: #34383f;
    --text: #ffffff;
    --text-2: #c7c9ce;
    --muted: #8a8e96;
    --danger: #ff5d5d;
    --warn: #ffb648;
    --ok: #4ade80;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 18px;
    --r-xl: 26px;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: "Unbounded", "Manrope", system-ui, sans-serif;
    --topbar-h: 60px;
    --tabbar-h: 0px;
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
    margin: 0;
    font: 500 15px/1.5 var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ───────── Тугмаҳо ───────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px; border-radius: var(--r);
    font-weight: 700; font-size: 14px; white-space: nowrap;
    border: 1px solid transparent; transition: transform .12s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 transparent; }
.btn-accent:hover { filter: brightness(1.07); box-shadow: 0 8px 30px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn-white { background: #fff; color: #000; }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 36px; height: 36px; padding: 0 9px; border-radius: 10px;
    color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.pill {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
    border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
    background: var(--surface-3); color: var(--text-2); text-transform: uppercase; white-space: nowrap;
}
.pill-accent { background: var(--accent); color: var(--accent-ink); }
.pill-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* ───────── Шаклҳо ───────── */
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
    padding: 0 14px; height: 46px; transition: border-color .15s, background .15s;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select {
    appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237c7c88' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.error { color: var(--danger); font-size: 13px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.check input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: translateX(16px); background: var(--accent-ink); }

/* ───────── Сарлавҳа ───────── */
.announce {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; background: var(--accent); color: var(--accent-ink);
    font-size: 13px; font-weight: 800; text-align: center;
}
.announce .ic { width: 15px; height: 15px; }
.topbar {
    position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
    display: flex; align-items: center; gap: 20px; padding: 0 20px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; display: grid; place-items: center; }
.logo-mark img { width: 26px; height: 34px; object-fit: contain; display: block; }
.logo-mark .ic { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.logo-text { font-family: "Poppins", var(--font); font-weight: 800; letter-spacing: .02em; font-size: 16px; text-transform: uppercase; }
.logo-text b { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { padding: 8px 13px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-code { font-size: 12px; font-weight: 800; }
.credits {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 4px 0 12px;
    border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px;
}
.credits > .ic { color: var(--accent); fill: var(--accent); stroke: none; width: 15px; height: 15px; }
.credits b { font-variant-numeric: tabular-nums; }
.credits-plus { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.credits-plus .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 14px;
    background: linear-gradient(135deg, var(--accent), #2dd4bf); color: var(--accent-ink);
}

.dropdown { position: relative; }
.menu {
    position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0; min-width: 170px; padding: 6px;
    background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .15s; z-index: 60;
}
.menu-right { left: auto; right: 0; translate: 0; min-width: 230px; }
.dropdown.open .menu { opacity: 1; visibility: visible; transform: none; }
.menu a, .menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px;
    font-weight: 600; font-size: 14px; color: var(--text-2); text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--text); }
.menu a.active { color: var(--accent); justify-content: space-between; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; }
.menu-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.tabbar { display: none; }
.main { min-height: calc(100dvh - var(--topbar-h)); }

/* ───────── Тостҳо ва модалҳо ───────── */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom)); translate: -50% 0; display: grid; gap: 8px; width: min(420px, 100% - 32px); pointer-events: none; }
.toast {
    display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px;
    background: #fff; color: #0a0a0a; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
    animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.modal-back {
    position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px);
    display: grid; place-items: center; padding: 20px; animation: fade .18s;
}
.modal {
    width: min(100%, var(--w, 560px)); max-height: min(88dvh, 860px); display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow);
    animation: pop .22s cubic-bezier(.2, .9, .3, 1.1); overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; font-weight: 800; flex: 1; }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.tabs button, .tabs a { padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; transition: .15s; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ───────── Муқоваи модел ───────── */
.cover {
    --h: 80;
    background:
        radial-gradient(90% 120% at 12% 0%, hsl(var(--h) 95% 62% / .95), transparent 62%),
        radial-gradient(80% 110% at 100% 100%, hsl(calc(var(--h) + 70) 90% 55% / .9), transparent 58%),
        radial-gradient(60% 80% at 70% 10%, hsl(calc(var(--h) - 50) 90% 50% / .7), transparent 60%),
        #101014;
    position: relative; overflow: hidden;
}
.cover::after {
    content: ""; position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ═══════════════ Саҳифаи асосӣ ═══════════════ */
.hero { position: relative; padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); overflow: hidden; isolation: isolate; }
.hero-glow { position: absolute; inset: -20% -10% auto; height: 760px; z-index: -1; pointer-events: none; filter: blur(90px); opacity: .55; }
.hero-glow i { position: absolute; border-radius: 50%; animation: drift 16s ease-in-out infinite alternate; }
.hero-glow i:nth-child(1) { width: 520px; height: 520px; left: 8%; top: 10%; background: var(--accent); opacity: .5; }
.hero-glow i:nth-child(2) { width: 460px; height: 460px; right: 6%; top: 0; background: #7c5cff; opacity: .55; animation-delay: -5s; }
.hero-glow i:nth-child(3) { width: 380px; height: 380px; left: 42%; top: 38%; background: #ff5c8a; opacity: .4; animation-delay: -9s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }
.hero-grid { position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); }
.hero-inner { text-align: center; display: grid; justify-items: center; gap: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--text-2); backdrop-filter: blur(8px); }
.eyebrow b { background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 99px; font-size: 11px; letter-spacing: .05em; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 6.4vw, 78px); line-height: 1.04; letter-spacing: -.035em; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: clamp(15px, 1.6vw, 19px); color: var(--text-2); max-width: 58ch; text-wrap: pretty; }

.promptbox { width: min(760px, 100%); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-2); border-radius: 22px; padding: 10px; backdrop-filter: blur(14px); box-shadow: var(--shadow); text-align: left; margin-top: 6px; }
.promptbox textarea { width: 100%; background: none; border: 0; resize: none; padding: 12px 14px 6px; min-height: 76px; font-size: 16px; outline: none; }
.promptbox textarea::placeholder { color: var(--muted); }
.promptbox-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.promptbox .tabs { background: transparent; border: 0; padding: 0; }
.promptbox .tabs button { display: inline-flex; align-items: center; gap: 6px; }
.promptbox .tabs .ic { width: 15px; height: 15px; }

.vendors { display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: center; margin-top: 18px; color: var(--muted); font-weight: 800; font-size: 14px; letter-spacing: .01em; }
.vendors span { opacity: .8; }

.section { padding: clamp(40px, 6vw, 84px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-size: clamp(24px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1.1; font-weight: 700; }
.section-head p { color: var(--text-2); margin-top: 8px; max-width: 56ch; }

.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tool { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 280px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; border: 1px solid var(--line); transition: transform .25s, border-color .25s; isolation: isolate; }
.tool:hover { transform: translateY(-4px); border-color: var(--line-2); }
.tool .cover { position: absolute; inset: 0; z-index: -2; transition: transform .6s; }
.tool:hover .cover { transform: scale(1.08); }
.tool::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 20%, rgba(9, 9, 11, .92) 88%); }
.tool-ic { position: absolute; top: 18px; left: 18px; width: 44px; height: 44px; border-radius: 14px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(10px); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); }
.tool-ic .ic { width: 22px; height: 22px; }
.tool h3 { font-family: var(--display); font-size: 21px; letter-spacing: -.02em; font-weight: 700; }
.tool p { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.tool-count { position: absolute; top: 22px; right: 20px; }

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.mcard { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s, transform .15s; text-align: left; align-items: center; width: 100%; }
.mcard:hover { border-color: var(--line-2); background: var(--surface-2); }
.mcard.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.mcard .cover { width: 56px; height: 56px; border-radius: 14px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.mcard .cover span { position: relative; z-index: 1; }
.mcard-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.mcard-top { display: flex; align-items: center; gap: 8px; }
.mcard-top b { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard small { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-cost { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.mcard-cost .ic { width: 12px; height: 12px; fill: var(--accent); stroke: none; }
.mcard-cost small { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-right: 1px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step { padding: 26px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); counter-increment: step; }
.step::before { content: "0" counter(step); font-family: var(--display); font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.step h3 { font-size: 19px; font-weight: 800; margin: 14px 0 8px; }
.step p { color: var(--text-2); font-size: 14.5px; }

.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pack { position: relative; padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; text-align: left; transition: border-color .15s, transform .15s; }
.pack:hover { border-color: var(--line-2); }
.pack.popular { border-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.pack.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.pack .pill { position: absolute; top: 18px; right: 18px; }
.pack-name { font-weight: 800; color: var(--text-2); font-size: 14px; }
.pack-credits { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.pack-credits small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.pack-price { font-size: 19px; font-weight: 800; margin-top: 2px; }
.pack-per { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.pack .btn { margin-top: auto; }

.faq { display: grid; gap: 10px; max-width: 820px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 20px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 800; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--muted); transition: transform .2s; font-weight: 400; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq p { color: var(--text-2); padding-bottom: 20px; max-width: 68ch; }

.cta { border-radius: 32px; padding: clamp(34px, 6vw, 72px); text-align: center; position: relative; overflow: hidden; border: 1px solid var(--line-2); isolation: isolate; display: grid; justify-items: center; gap: 18px; }
.cta .cover { position: absolute; inset: 0; z-index: -1; opacity: .5; }
.cta h2 { font-family: var(--display); font-size: clamp(26px, 4.4vw, 52px); letter-spacing: -.03em; line-height: 1.08; max-width: 18ch; font-weight: 700; }
.cta p { color: var(--text-2); max-width: 50ch; }

.footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--muted); font-size: 14px; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ═══════════════ Студия ═══════════════ */
.studio { display: grid; grid-template-columns: 384px 1fr; gap: 0; align-items: start; }
.panel { position: sticky; top: var(--topbar-h); height: calc(100dvh - var(--topbar-h)); overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 16px; font-weight: 700; padding: 4px 2px; }
.panel-title .ic { color: var(--accent); }

.modelpick { position: relative; display: block; width: 100%; height: 112px; border-radius: var(--r-lg); overflow: hidden; text-align: left; border: 1px solid var(--line-2); isolation: isolate; }
.modelpick .cover { position: absolute; inset: 0; z-index: -2; transition: transform .5s; }
.modelpick:hover .cover { transform: scale(1.06); }
.modelpick::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(9, 9, 11, .8), rgba(9, 9, 11, .15)); }
.modelpick-body { position: absolute; left: 16px; bottom: 14px; right: 16px; }
.modelpick-body b { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modelpick-body small { color: rgba(255, 255, 255, .75); font-weight: 600; font-size: 12.5px; }
.modelpick-change { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); font-size: 12px; font-weight: 800; border: 1px solid rgba(255, 255, 255, .16); }
.modelpick-change .ic { width: 13px; height: 13px; }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; }
.box-label { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .05em; }

.refs { display: flex; gap: 8px; flex-wrap: wrap; }
.ref { position: relative; width: 68px; height: 68px; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.ref button .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.ref-add { width: 68px; height: 68px; border-radius: 12px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); transition: .15s; }
.ref-add:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.refs-empty { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 12px; border: 1.5px dashed var(--line-2); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; transition: .15s; }
.refs-empty:hover { border-color: var(--accent); color: var(--text); }
.refs-empty .ic { width: 22px; height: 22px; }
.refs-empty b { display: block; color: var(--text); font-size: 14px; }
.panel.drag .refs-empty, .panel.drag .ref-add { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.prompt { width: 100%; background: none; border: 0; resize: none; outline: none; min-height: 110px; max-height: 280px; font-size: 15px; line-height: 1.5; padding: 0; }
.prompt::placeholder { color: var(--muted); }
.prompt-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-top: 6px; }

.opts { display: grid; gap: 10px; }
.opt-label { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-width: 52px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: .12s; white-space: nowrap; }
.seg button:hover { border-color: var(--line-2); color: var(--text); }
.seg button.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-color: var(--accent); color: var(--accent); }
.ratio-ic { border: 1.6px solid currentColor; border-radius: 3px; display: inline-block; }

.gen-wrap { margin-top: auto; position: sticky; bottom: -16px; padding: 14px 0 16px; background: linear-gradient(180deg, transparent, var(--bg) 26%); }
.btn-generate { height: 56px; font-size: 16px; border-radius: 16px; gap: 12px; }
.btn-generate .cost { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .14); font-size: 14px; }
.btn-generate .cost .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.btn.loading { pointer-events: none; }
.btn.loading > * { opacity: .5; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.4px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: 1 !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.feed { padding: 16px 20px 60px; min-width: 0; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.feed-head h2 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grid.audio { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.masonry { columns: 5 230px; column-gap: 12px; }
.masonry .card { break-inside: avoid; margin-bottom: 12px; }

.card { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.card:hover { border-color: var(--line-2); }
.card-media { position: relative; display: block; width: 100%; background: var(--surface-2); cursor: zoom-in; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; }
.card-media[style*="aspect-ratio"] img, .card-media[style*="aspect-ratio"] video { position: absolute; inset: 0; }
.card-multi { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.card-multi .card-media { aspect-ratio: 1; }
.card-badge { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; pointer-events: none; }
.card-badge .pill { background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); color: #fff; }
.card-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.card-play span { width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .2); transition: .2s; }
.card-play .ic { fill: #fff; stroke: none; width: 18px; height: 18px; margin-left: 2px; }
.card:hover .card-play span { opacity: 0; }
.card-info { padding: 11px 13px 12px; display: grid; gap: 6px; }
.card-prompt { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.card-meta b { color: var(--text); font-weight: 800; }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; z-index: 3; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card-actions button, .card-actions a { width: 32px; height: 32px; border-radius: 10px; background: rgba(0, 0, 0, .65); backdrop-filter: blur(8px); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); }
.card-actions button:hover, .card-actions a:hover { background: #000; }
.card-actions .ic { width: 15px; height: 15px; }
.card-audio { padding: 16px 13px 4px; display: grid; gap: 12px; }
.card-audio .wave { height: 54px; border-radius: 10px; }
audio { width: 100%; height: 38px; }

.card.pending .card-media { cursor: default; display: grid; place-items: center; min-height: 200px; }
.shimmer { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--accent) 14%, transparent) 50%, transparent 70%), var(--surface-2); background-size: 220% 100%, auto; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 180% 0, 0 0; } to { background-position: -40% 0, 0 0; } }
.pending-body { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px; }
.pending-body .spinner { color: var(--accent); width: 26px; height: 26px; }
.pending-body small { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.card.failed .card-media { min-height: 150px; display: grid; align-content: center; gap: 10px; padding: 18px; cursor: default; background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 9%, var(--surface-2)), var(--surface-2)); }
.failed-row { display: flex; gap: 6px; flex-wrap: wrap; }
.failed-msg { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: clamp(40px, 10vh, 110px) 20px; color: var(--muted); }
.empty-ic { width: 76px; height: 76px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.empty-ic .ic { width: 32px; height: 32px; }
.empty h3 { color: var(--text); font-size: 19px; font-weight: 800; }
.empty p { max-width: 42ch; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 720px; margin-top: 8px; }
.idea { padding: 9px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); text-align: left; transition: .15s; }
.idea:hover { border-color: var(--accent); color: var(--text); }
.more { display: grid; place-items: center; padding: 26px 0; }

/* лайтбокс */
.viewer { --w: 1180px; }
.viewer-grid { display: grid; grid-template-columns: 1fr 340px; min-height: 0; flex: 1; }
.viewer-stage { background: #000; display: grid; place-items: center; min-height: 320px; position: relative; overflow: hidden; }
.viewer-stage img, .viewer-stage video { max-height: min(78dvh, 800px); width: auto; max-width: 100%; object-fit: contain; }
.viewer-stage audio { width: min(460px, 86%); }
.viewer-thumbs { position: absolute; bottom: 12px; left: 50%; translate: -50% 0; display: flex; gap: 6px; padding: 6px; background: rgba(0, 0, 0, .6); border-radius: 14px; backdrop-filter: blur(8px); }
.viewer-thumbs button { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; opacity: .55; border: 2px solid transparent; }
.viewer-thumbs button.on { opacity: 1; border-color: var(--accent); }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.viewer-side { padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; border-left: 1px solid var(--line); }
.viewer-prompt { font-size: 14px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.viewer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.viewer-actions .wide { grid-column: 1 / -1; }
.viewer-close { position: absolute; top: 12px; left: 12px; z-index: 5; background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); color: #fff; }

/* интихоби файл */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.pick { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; transition: .12s; }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; }
.pick:hover { border-color: var(--line-2); }
.pick.on { border-color: var(--accent); }
.pick.on::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.pick-upload { display: grid; place-items: center; align-content: center; gap: 6px; border: 1.5px dashed var(--line-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.pick-upload:hover { border-color: var(--accent); color: var(--accent); }
.pick-del { position: absolute; left: 5px; top: 5px; width: 24px; height: 24px; border-radius: 8px; background: rgba(0, 0, 0, .7); display: grid; place-items: center; opacity: 0; transition: .12s; }
.pick:hover .pick-del { opacity: 1; }
.pick-del .ic { width: 13px; height: 13px; }
.searchbar { position: relative; }
.searchbar .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.searchbar .input { padding-left: 42px; }

/* ═══════════════ Чат ═══════════════ */
.chat { display: grid; grid-template-columns: 290px 1fr; height: calc(100dvh - var(--topbar-h) - var(--tabbar-h)); }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 14px; gap: 12px; background: var(--bg); }
.chat-list { overflow-y: auto; display: grid; gap: 2px; align-content: start; flex: 1; margin: 0 -6px; padding: 0 6px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; text-align: left; width: 100%; }
.chat-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-item:hover { background: var(--surface-2); color: var(--text); }
.chat-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.chat-item .del { opacity: 0; color: var(--muted); display: grid; }
.chat-item:hover .del { opacity: 1; }
.chat-item .del:hover { color: var(--danger); }
.chat-item .del .ic { width: 15px; height: 15px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chat-bar .select { width: auto; max-width: 100%; height: 40px; font-weight: 700; background-color: var(--surface); }
.chat-thread { flex: 1; overflow-y: auto; padding: 24px 16px 20px; scroll-behavior: smooth; }
.chat-inner { width: min(780px, 100%); margin-inline: auto; display: grid; gap: 22px; }
.msg { display: grid; gap: 6px; }
.msg-user { justify-items: end; }
.msg-user .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 11px 16px; border-radius: 20px 20px 6px 20px; max-width: 86%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-ai .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.msg-ai .who i { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.msg-ai .who .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.md { line-height: 1.65; overflow-wrap: anywhere; font-size: 15.5px; }
.md > * + * { margin-top: .75em; }
.md h1, .md h2, .md h3 { font-size: 1.12em; font-weight: 800; margin-top: 1.2em; }
.md ul, .md ol { padding-left: 1.4em; margin-block: .6em; }
.md li + li { margin-top: .3em; }
.md code { background: var(--surface-3); padding: 2px 6px; border-radius: 6px; font: 500 .88em/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.md pre { background: #0d0d10; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; position: relative; }
.md pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.md blockquote { border-left: 3px solid var(--line-2); padding-left: 14px; color: var(--text-2); margin: 0; }
.md table { border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.cursor::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.msg-tools { display: flex; gap: 4px; }
.msg-tools button { color: var(--muted); padding: 5px; border-radius: 7px; display: grid; }
.msg-tools button:hover { color: var(--text); background: var(--surface-2); }
.msg-tools .ic { width: 15px; height: 15px; }
.composer-wrap { padding: 8px 16px 18px; }
.composer { width: min(780px, 100%); margin-inline: auto; display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px; padding: 8px 8px 8px 20px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; background: none; border: 0; outline: none; resize: none; max-height: 200px; padding: 10px 0; font-size: 15.5px; line-height: 1.5; }
.composer .send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: .15s; }
.composer .send .ic { stroke-width: 2.4; width: 20px; height: 20px; }
.composer .send:disabled { background: var(--surface-3); color: var(--muted); cursor: default; }
.composer-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chat-welcome { display: grid; justify-items: center; gap: 14px; text-align: center; padding-top: clamp(20px, 12vh, 120px); }
.chat-welcome h2 { font-family: var(--display); font-size: clamp(22px, 3.4vw, 34px); letter-spacing: -.03em; font-weight: 700; }
.chat-toggle { display: none; }

/* ═══════════════ Саҳифаҳои оддӣ ═══════════════ */
.page { padding: clamp(24px, 4vw, 48px) 0 80px; }
.page-head { margin-bottom: 26px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: clamp(26px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.1; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 8px; max-width: 60ch; }
.split > *, .cols-2 > *, .cols-3 > *, .admin-main > * { min-width: 0; }
.cardbox { min-width: 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(18px, 2.4vw, 26px); }
.cardbox > h2, .cardbox > h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 14px 16px; font-size: 14px; color: var(--text-2); white-space: pre-line; }

.auth { min-height: calc(100dvh - var(--topbar-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; isolation: isolate; }
.auth-art .cover { position: absolute; inset: 0; z-index: -1; }
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(9, 9, 11, .85)); }
.auth-art h2 { font-family: var(--display); font-size: clamp(26px, 3vw, 40px); letter-spacing: -.03em; line-height: 1.1; max-width: 14ch; font-weight: 700; }
.auth-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .86); font-weight: 600; }
.auth-art li { display: flex; gap: 10px; align-items: center; }
.auth-art li .ic { color: var(--accent); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-card h1 { font-family: var(--display); font-size: 28px; letter-spacing: -.03em; font-weight: 700; }
.auth-card .sub { color: var(--text-2); margin-top: -8px; }
.auth-alt { text-align: center; color: var(--muted); font-size: 14px; }
.auth-alt a { color: var(--accent); font-weight: 700; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .nowrap { white-space: nowrap; }
.plus { color: var(--ok); font-weight: 800; }
.minus { color: var(--text-2); font-weight: 800; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.pager-info { color: var(--muted); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ═══════════════ Админ ═══════════════ */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.admin-side { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); overflow-y: auto; }
.admin-side .logo { padding: 4px 10px 18px; }
.admin-side a.item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 700; font-size: 14px; }
.admin-side a.item:hover { background: var(--surface-2); color: var(--text); }
.admin-side a.item.active { background: var(--surface-3); color: var(--accent); }
.admin-side a.item .pill { margin-left: auto; }
.admin-side .sep { margin-top: auto; }
.admin-main { padding: clamp(18px, 3vw, 34px); min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--display); font-size: 24px; letter-spacing: -.02em; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 4px; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat small .ic { width: 15px; height: 15px; }
.stat b { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-weight: 700; }
.stat em { font-style: normal; font-size: 12.5px; color: var(--ok); font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars div { flex: 1; display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; min-width: 0; }
.bars i { width: 100%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .9; }
.bars small { font-size: 10.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.bars span { font-size: 11px; font-weight: 800; color: var(--text-2); }
.thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; overflow: hidden; }
.thumb.cover { background: radial-gradient(90% 120% at 12% 0%, hsl(var(--h) 95% 62% / .95), transparent 62%), radial-gradient(80% 110% at 100% 100%, hsl(calc(var(--h) + 70) 90% 55% / .9), transparent 58%), #101014; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.code { font: 500 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.admin-burger { display: none; }

/* ═══════════════ Мобилӣ ═══════════════ */
@media (max-width: 1020px) {
    .tools { grid-template-columns: 1fr 1fr; }
    .tool { min-height: 220px; }
    .viewer-grid { grid-template-columns: 1fr; overflow-y: auto; }
    .viewer-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
    .viewer-stage img, .viewer-stage video { max-height: 56dvh; }
    .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    :root { --tabbar-h: 62px; --topbar-h: 54px; }
    .nav { display: none; }
    .hide-sm { display: none; }
    .logo-text { display: none; }
    .topbar { padding: 0 12px; gap: 8px; }
    .tabbar {
        position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        display: grid; grid-template-columns: repeat(5, 1fr);
        background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
    }
    .tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
    .tabbar a .ic { width: 22px; height: 22px; }
    .tabbar a.active { color: var(--accent); }
    .studio { grid-template-columns: 1fr; }
    .panel { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 12px; }
    .gen-wrap { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 20; margin-inline: -12px; padding: 12px; background: linear-gradient(180deg, transparent, var(--bg) 30%); }
    .feed { padding: 14px 12px 40px; }
    .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .grid.audio { grid-template-columns: 1fr; }
    .masonry { columns: 2; column-gap: 8px; }
    .masonry .card { margin-bottom: 8px; }
    .card-actions { opacity: 1; }
    .card-info { padding: 9px 10px 10px; }
    .steps, .cols-2, .cols-3, .form-grid { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .chat { grid-template-columns: 1fr; }
    .chat-side { position: fixed; z-index: 70; inset: var(--topbar-h) 18% calc(var(--tabbar-h) + env(safe-area-inset-bottom)) 0; transform: translateX(-102%); transition: transform .25s; box-shadow: var(--shadow); }
    .chat.side-open .chat-side { transform: none; }
    .chat-toggle { display: inline-flex; }
    .modal-back { padding: 0; align-items: end; }
    .modal { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; border-bottom: 0; animation-name: sheet; }
    @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
    .admin { grid-template-columns: 1fr; }
    .admin-side { position: fixed; z-index: 80; width: 260px; transform: translateX(-102%); transition: transform .25s; }
    .admin.open .admin-side { transform: none; box-shadow: var(--shadow); }
    .admin-burger { display: inline-flex; }
    .promptbox-row { flex-wrap: wrap; }
    .promptbox .btn { flex: 1; }
}
@media (max-width: 520px) {
    .tools { grid-template-columns: 1fr; }
    .tool { min-height: 170px; }
    .mgrid { grid-template-columns: 1fr; }
    .credits { padding-left: 10px; }
    .viewer-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════ Студияи ягона (саҳифаи асосӣ) ═══════════════ */
.studio-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(36px, 7vw, 90px) 0 20px; }
.studio-wrap { display: grid; gap: 22px; justify-items: center; }
.studio-head { text-align: center; display: grid; justify-items: center; gap: 12px; }
.studio-head h1 { font-family: var(--display); font-size: clamp(26px, 4.4vw, 46px); letter-spacing: -.03em; line-height: 1.1; font-weight: 700; }
.studio-head p { font-size: 15px; max-width: 46ch; }
.logo-mark.big { width: 72px; height: 72px; margin-bottom: 6px; }
.logo-mark.big img { width: 56px; height: 72px; }
.logo-mark.big .ic { width: 30px; height: 30px; }
.studio-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--warn); font-weight: 600; }

.composer-box {
    width: min(760px, 100%); display: grid; gap: 10px; padding: 14px 14px 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line-2); border-radius: 26px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); transition: border-color .15s;
}
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-2)); }
.composer-box.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.composer-box .prompt { min-height: 64px; max-height: 260px; padding: 6px 6px 0; font-size: 16px; }
.composer-static { padding: 14px 6px 4px; color: var(--muted); font-size: 15px; }
.composer-box .refs { padding: 2px 4px 0; }
.composer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cbtn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 12px;
    border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 14px; transition: .15s;
}
.cbtn:hover { background: var(--surface-3); border-color: var(--line-2); }
.cbtn.need { border-color: var(--accent); color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); } }
.cbtn.chip { padding: 0 16px 0 12px; max-width: 220px; }
.cbtn.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbtn .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cbtn.go { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-color: transparent; padding: 0 18px; font-size: 15px; font-weight: 800; }
.cbtn.go:hover { filter: brightness(1.07); box-shadow: 0 8px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.cbtn.go .ic { fill: currentColor; stroke: none; width: 17px; height: 17px; }
.cbtn.go .ic use { stroke: currentColor; }
.cbtn.loading { pointer-events: none; }
.cbtn .spinner { width: 16px; height: 16px; }

.feed-wrap { padding-top: 22px; }
.feed-wrap .feed-head { margin-bottom: 14px; }

/* варақи поён (sheet) */
.modal.sheet .modal-foot { border-top: 0; padding-top: 0; }
.mlist { display: grid; gap: 14px; }
.mgroup { display: grid; gap: 6px; }
.mgroup-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 2px; }
.mgroup-head .ic { width: 15px; height: 15px; }
.mlist .mcard { padding: 9px 10px; }
.mlist .mcard .cover { width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }
.settings { display: grid; gap: 4px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow-label { font-weight: 800; font-size: 15px; flex: 1 1 auto; min-width: 0; }
.srow-label small { font-weight: 600; white-space: normal; }
.settings { overflow: hidden; }
.srow .seg { justify-content: flex-end; flex-wrap: wrap; }
.srow .seg button { flex: 0 0 auto; min-width: 48px; }
.srow .select { width: auto; min-width: 150px; }
.srow.check { cursor: pointer; }
.srow.check .srow-label { font-size: 15px; }

/* корти матн (чат) */
.card.text, .grid.text .card { break-inside: avoid; }
.masonry .card.text { column-span: all; }
.text-card { padding: 14px 16px 12px; display: grid; gap: 12px; }
.text-q { justify-self: end; max-width: 86%; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 18px 18px 6px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.text-a { display: grid; gap: 8px; }
.text-a .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.text-a .who i { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.text-a .who .ic { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.text-card .card-meta { justify-content: space-between; }

/* лайк */
.like { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--muted); font-weight: 800; font-size: 12.5px; padding: 4px 6px; border-radius: 8px; transition: .15s; }
.like:hover { color: var(--text); background: var(--surface-2); }
.like.on { color: #ff5c8a; }
.like.on .ic { fill: #ff5c8a; stroke: #ff5c8a; }
.like .ic { width: 16px; height: 16px; }
.viewer .like { font-size: 14px; height: 40px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line); margin: 0; }

/* занҷираи амалҳо */
.chain-list { display: grid; gap: 6px; }
.chain-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: .15s; }
.chain-item:hover { border-color: var(--accent); }
.chain-item > .cover { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.chain-item > .cover .ic { position: relative; z-index: 1; }
.chain-item > span:nth-child(2) { flex: 1; display: grid; }
.chain-item b { font-size: 14.5px; }
.chain-item small { color: var(--muted); font-size: 12.5px; }
.chain-item > .ic:last-child { color: var(--muted); }

/* шаблонҳо */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tgrid.scroll-x { grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); grid-template-columns: none; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.tgrid.scroll-x .tcard { scroll-snap-align: start; }
.tcard { display: grid; gap: 10px; text-align: left; border-radius: var(--r-lg); transition: transform .2s; }
.tcard:hover { transform: translateY(-3px); }
.tcard-media { aspect-ratio: 1; border-radius: var(--r-lg); display: grid; place-items: center; color: #fff; border: 1px solid var(--line); }
.tcard-media .ic { width: 40px; height: 40px; position: relative; z-index: 1; opacity: .9; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5)); }
.tcard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.tcard-media .pill { position: absolute; top: 10px; left: 10px; z-index: 2; }
.tcard-body { display: grid; gap: 2px; padding: 0 2px; }
.tcard-body b { font-size: 15px; font-weight: 800; }
.tcard-body small { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* тугмаи марказии «Сохтан» дар панели мобилӣ */

@media (max-width: 860px) {
    .studio-hero { padding-top: 28px; }
    .composer-box { padding: 12px 12px 10px; border-radius: 22px; }
    .cbtn.chip { max-width: 150px; }
    .srow { flex-wrap: wrap; }
    .srow .seg { justify-content: flex-start; width: 100%; }
    .tgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tgrid.scroll-x { grid-auto-columns: 46%; }
    .masonry .card.text { column-span: all; }
}

/* ҷавоби чат дар саҳифаи асосӣ ва корти нав дар «Файлҳои ман» */
.answer-wrap { padding-top: 6px; }
.answer { width: min(760px, 100%); margin-inline: auto; }
.answer .card.text { width: 100%; }
.card.hl { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); animation: hl 2.4s ease-out forwards; }
@keyframes hl { to { box-shadow: 0 0 0 0 transparent; } }

/* ═══════════════ Намуд → Оила → Версия → Реҷа ═══════════════ */
.ctype { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.ctype button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); transition: .15s; }
.ctype button .ic { width: 16px; height: 16px; }
.ctype button:hover { color: var(--text); }
.ctype button.on { background: var(--accent); color: var(--accent-ink); }
.sheet-types { margin-bottom: 2px; }
.composer-hint { font-size: 12.5px; color: var(--muted); padding: 0 6px; font-weight: 600; }
.cbtn.mode { max-width: 200px; }
.cbtn .auto { position: absolute; top: -5px; right: -4px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 10px; font-weight: 900; display: grid; place-items: center; }
.ref-n { position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.ref-audio .cover, .pick-audio { display: grid; place-items: center; color: #fff; width: 100%; height: 100%; position: absolute; inset: 0; }
.ref-audio .cover .ic, .pick-audio .ic { position: relative; z-index: 1; width: 26px; height: 26px; }
.ref-video::after { content: "▶"; position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #fff; opacity: .8; }

.flist { display: grid; gap: 8px; }
.frow { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; transition: border-color .15s; }
.frow.selected { border-color: var(--accent); }
.frow-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; }
.frow-main:hover { background: var(--surface-2); }
.frow-main > .cover { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.frow-main > .cover span { position: relative; z-index: 1; }
.frow-main > .ic:last-child { color: var(--muted); transition: transform .2s; }
.frow:has(.fversions:not([hidden])) .frow-main > .ic:last-child { transform: rotate(180deg); }
.fversions { border-top: 1px solid var(--line); background: var(--surface-2); padding: 6px; display: grid; gap: 2px; }
.vrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; transition: .12s; }
.vrow:hover { background: var(--surface-3); }
.vrow.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.vrow > i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: var(--accent-ink); font-style: normal; }
.vrow.on > i { background: var(--accent); border-color: var(--accent); }
.vrow > i .ic { width: 13px; height: 13px; stroke-width: 3; }
.vrow > span { flex: 1; min-width: 0; display: grid; }
.vrow b { font-size: 14px; }
.vrow em { font-style: normal; color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.vrow small { color: var(--muted); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mlist .vrow { background: var(--surface-2); border: 1px solid var(--line); }
.mlist .vrow.on { border-color: var(--accent); }
@media (max-width: 860px) {
    .ctype button span { font-size: 12px; }
    .cbtn.mode { max-width: 140px; }
}

/* ҷойҳои воридот: кадри аввал / охир, видео / аудио барои асбоб */
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.slot { position: relative; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 12px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--muted); font-weight: 700; font-size: 14px; overflow: hidden; transition: .15s; text-align: left; }
.slot:hover { border-color: var(--accent); color: var(--text); }
.slot.need { border-color: var(--accent); color: var(--accent); }
.slot.filled { border-style: solid; border-color: var(--line-2); color: var(--text); padding-left: 8px; }
.slot img, .slot video, .slot > .cover { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; display: grid; place-items: center; color: #fff; }
.slot > .cover .ic { position: relative; z-index: 1; width: 18px; height: 18px; }
.slot > .ic { width: 22px; height: 22px; }
.slot span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot i[data-unslot] { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.slot i[data-unslot] .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.mode-note { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.cap-h { font-size: 15px; font-weight: 800; margin: 22px 0 6px; display: flex; align-items: center; gap: 12px; }
.cap-p { font-size: 13px; margin-bottom: 10px; }
.cap-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.cap-row .input, .cap-row .select { height: 40px; }
.cap-modes td { vertical-align: top; }
.cap-modes .input { height: 36px; padding: 0 8px; font-size: 13px; margin: 2px 0; }
/* нақши акс, элементҳо, multi-shot */
.ref { cursor: pointer; }
.ref-frame { outline: 2px solid var(--accent); outline-offset: -2px; }
.ref-frame .ref-n { background: var(--accent); color: var(--accent-ink); }
.ref .ref-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; font-style: normal; }
.ref .ref-x .ic { width: 11px; height: 11px; stroke-width: 2.6; color: #fff; }
.element { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.element > b { color: var(--accent); font-size: 13px; white-space: nowrap; }
.element .refs { flex: 1; }
.shot { display: grid; grid-template-columns: 24px 1fr 90px 36px; gap: 8px; align-items: start; }
.shot > b { color: var(--accent); padding-top: 12px; text-align: center; }
.shot .textarea { min-height: 56px; }
.modal-foot { flex-wrap: wrap; }
.modal-foot .btn-accent { margin-left: auto; }
/* @-ишора дар тавсиф */
.prompt-wrap { position: relative; }
.mention { position: relative; z-index: 30; margin-top: 6px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.mention-head { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px 4px; }
.mention button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: left; }
.mention button.on, .mention button:hover { background: var(--surface-3); }
.mention img, .mention video, .mention .cover { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; color: #fff; position: relative; }
.mention .cover .ic { width: 16px; height: 16px; position: relative; z-index: 1; }
.mention button > span { display: grid; }
.mention b { font-size: 14px; color: var(--accent); }
.mention small { color: var(--muted); font-size: 12px; }
.composer-hint b { color: var(--accent); font-weight: 800; }
/* давомнокӣ: лағжонак бо тугмаҳои ± */
.srow.dur { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.srow.dur .drange, .srow.dur .ticks { grid-column: 1 / -1; }
.dstep { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dstep button { width: 42px; height: 42px; color: var(--text); font-size: 22px; font-weight: 600; }
.dstep button:hover { background: var(--surface-3); }
.dstep b { font-family: var(--display); font-size: 17px; min-width: 76px; text-align: center; }
.dstep b small { font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 700; }
.drange { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; margin: 10px 0 4px; outline: none; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--surface-3) var(--p, 0%)); }
.drange::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .5); cursor: pointer; }
.drange::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: pointer; }
.ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; padding: 0 2px; }
/* ҷараёни шаблон */
.tflow { display: grid; gap: 14px; }
.tflow-head { display: flex; gap: 14px; align-items: center; }
.tflow-head > div { display: grid; gap: 2px; min-width: 0; }
.tflow-head b { font-size: 17px; font-weight: 800; }
.tflow-head small { color: var(--text-2); font-size: 13px; }
.tflow-cover { width: 72px; height: 72px; border-radius: 16px; flex: none; display: grid; place-items: center; color: #fff; }
.tflow-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.tflow-cover .ic { position: relative; z-index: 1; width: 28px; height: 28px; }
/* рӯйхат (варианти A) */
.llist { display: grid; gap: 6px; }
.lrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.lrow:hover { border-color: var(--line2); }
.lrow.hl { border-color: var(--accent); }
.lmain { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.lthumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--muted); }
.lthumb img, .lthumb video { width: 100%; height: 100%; object-fit: cover; }
.lthumb > .cover { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.lthumb > .cover .ic { position: relative; z-index: 1; }
.lthumb i { position: absolute; right: 4px; bottom: 4px; font-size: 9px; font-style: normal; font-weight: 800; background: rgba(0, 0, 0, .7); color: #fff; border-radius: 4px; padding: 1px 4px; }
.lthumb.fail { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface-3)); }
.lthumb .spinner { position: relative; color: var(--accent); }
.lbody { min-width: 0; display: grid; gap: 2px; }
.lbody b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbody small { color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lbody small em { font-style: normal; color: var(--accent); font-weight: 800; }
.lacts { display: flex; gap: 4px; align-items: center; }
.ib { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.ib:hover { color: var(--text); background: var(--surface-3); }
.ib .ic { width: 16px; height: 16px; }
.lrow .like { margin: 0; }
.lfull { grid-column: 1 / -1; padding: 6px 8px 8px 76px; font-size: 14px; }
@media (max-width: 860px) {
    .lrow { grid-template-columns: 1fr; }
    .lacts { justify-content: flex-end; }
    .lfull { padding-left: 8px; }
}
/* чат — саҳифаи алоҳида */
.is-chat .main { min-height: 0; }
.chat-bar .chip { max-width: 220px; }
.chat-title { flex: 1; min-width: 0; font-weight: 700; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-bar .cbtn { height: 38px; }
.msg-gen .gen-wrap-chat { max-width: 420px; }
.msg-gen .card { background: var(--surface-2); }
.chat-side .searchbar .ic { top: 50%; }
@media (max-width: 860px) { .chat-title { display: none; } }
.msg-err .bubble { background: color-mix(in oklab, var(--danger) 14%, var(--surface)); border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent); color: var(--text); font-size: 13.5px; }
.composer-hint.need { color: var(--accent); font-weight: 700; }
.ref[data-roleable] { cursor: pointer; }
.ref-frame .ref-n { background: var(--accent); color: #111; }
/* Варианти B: менюи боло + табҳои Илҳом + тугмаи ✦ дар таббар */
.inspire-tabs { margin-bottom: 18px; }
.inspire-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.tab-create { position: relative; }
.tab-create > span { width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -26px; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.tab-create > span .ic { width: 24px; height: 24px; }
.tab-create em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); }
/* асбобҳо (варианти C): рӯйхати фишурда + корти асбоб дар композер */
.tools-search { max-width: 520px; margin-bottom: 12px; }
.tools-cats { margin-bottom: 18px; }
.tgroup { margin-bottom: 26px; }
.tgroup h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 10px; }
.tgroup h2 small { color: var(--muted); font-weight: 600; }
.tlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: .15s; }
.trow:hover { border-color: var(--line-2); background: var(--surface-2); }
.trow .tico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); color: var(--accent); display: grid; place-items: center; flex: none; }
.trow .tico .ic { width: 22px; height: 22px; }
.trow .ttx { flex: 1; min-width: 0; display: grid; gap: 1px; }
.trow .ttx b { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.trow .ttx small { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tcost { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.trow .tgo { width: 16px; height: 16px; color: var(--muted); }
.toolcard { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 10px; border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.toolcard .tico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.toolcard .tico .ic { width: 20px; height: 20px; }
.toolcard > div { flex: 1; min-width: 0; }
.toolcard b { display: block; font-size: 14px; }
.toolcard small { display: block; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .trow .tcost { display: none; } .trow .ttx small:last-child { display: none; } }
