/* ===================== Ko Ai — main website styles ===================== */
:root {
  --bg: #f8f7fd;
  --bg-soft: #f3f1fb;
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --border: #ebe8f4;
  --border-strong: #ddd8ec;
  --text: #141a3a;
  --text-2: #3b4163;
  --muted: #6e7491;
  --faint: #9aa0b8;
  --primary: #6b3ef6;
  --primary-2: #8b4cf7;
  --pink: #e23fb4;
  --primary-soft: #efe9ff;
  --primary-soft-2: #f6f2ff;
  --primary-text: #5b2ee6;
  --pink-soft: #fdebf6;
  --pink-text: #d6339f;
  --blue-soft: #e8f1ff;
  --blue-text: #2f6fe0;
  --green: #16a36a;
  --green-soft: #e6f7ef;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #d98a00;
  --amber-soft: #fff5e0;
  --grad: linear-gradient(100deg, #6b3ef6 0%, #8f45f2 45%, #d03fd0 100%);
  --grad-text: linear-gradient(90deg, #6b3ef6 0%, #a43ff0 50%, #ec3fae 100%);
  --shadow-sm: 0 1px 2px rgba(30, 20, 80, .05);
  --shadow: 0 8px 30px rgba(60, 40, 140, .07);
  --shadow-lg: 0 24px 60px rgba(40, 20, 110, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 258px;
  --topbar: 64px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0b1a; --bg-soft: #141127; --surface: #17142b; --surface-2: #1c1834; --border: #2a2547; --border-strong: #383160;
  --text: #f2f0ff; --text-2: #d3cfee; --muted: #a29dc4; --faint: #77729a;
  --primary-soft: #2a2152; --primary-soft-2: #211a43; --primary-text: #b9a2ff; --pink-soft: #3a1838; --pink-text: #ff8fd3;
  --blue-soft: #16264a; --blue-text: #8db7ff; --green-soft: #12332a; --red-soft: #3b1a20; --amber-soft: #3a2c10;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-text); text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.boot-loader { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 18px 26px 60px; flex: 1; }

/* Brand */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 6px; color: inherit; }
.brand-mark { width: 98px; height: 98px; }
.brand-name { font-family: Arial, 'Helvetica Neue', var(--font); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: .5px; margin-top: 4px; color: var(--text); }
.brand-name b { color: var(--primary); font-weight: 800; }
.brand-tag { margin-top: 7px; font-size: 12.5px; font-weight: 700; letter-spacing: 1.4px; color: #6b7088; }
.brand-tag i { color: var(--pink); font-style: normal; margin: 0 2px; }
.brand-img { max-width: 160px; max-height: 120px; object-fit: contain; }

.nav { display: grid; gap: 2px; }
.nav-grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin: 10px 18px 4px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 12px; }
.nav a { display: flex; align-items: center; gap: 16px; padding: 11px 18px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 15.5px; transition: background .15s, color .15s; }
.nav a .ic { width: 22px; height: 22px; color: var(--text-2); }
.nav a:hover { background: var(--primary-soft-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav a.active .ic { color: var(--primary); }

.upgrade-card { margin-top: auto; border: 1px solid var(--border); border-radius: 16px; padding: 20px 18px 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.upgrade-card .head { display: flex; gap: 12px; align-items: center; }
.crown-emoji { font-size: 30px; line-height: 1; filter: saturate(1.2); }
.upgrade-card h4 { font-size: 16.5px; line-height: 1.25; color: var(--primary-text); }
.upgrade-card ul { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; gap: 7px; font-size: 14px; color: var(--text-2); }
.upgrade-card li { display: flex; gap: 9px; align-items: center; }
.upgrade-card li .ic { width: 16px; height: 16px; color: var(--green); }
.plan-active { font-size: 13px; color: var(--muted); margin: 10px 0 14px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.topnav { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 11px; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.topnav a .ic { width: 19px; height: 19px; }
.topnav a:hover { background: var(--primary-soft-2); }
.topnav a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.topnav a.active .ic { color: var(--primary); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--primary-soft-2); }
.menu-btn { display: none; }
.mobile-brand { display: none; align-items: center; gap: 8px; font-family: Arial, var(--font); font-weight: 800; font-size: 20px; color: var(--text); }
.mobile-brand svg, .mobile-brand img { width: 34px; height: 34px; object-fit: contain; }
.mobile-brand b { color: var(--primary); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; padding: 11px 18px; font-weight: 600; font-size: 14.5px; line-height: 1.2; white-space: nowrap; transition: transform .12s, box-shadow .15s, background .15s, opacity .15s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(107, 62, 246, .28); }
.btn-grad:hover { box-shadow: 0 10px 28px rgba(107, 62, 246, .38); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); }
.btn-outline { background: var(--surface); color: var(--primary-text); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.btn-outline:hover { background: var(--primary-soft-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-light:hover { border-color: var(--border-strong); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 15px 22px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }

.user-chip { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px 4px 4px; border-radius: 12px; text-align: left; position: relative; }
.user-chip:hover { background: var(--primary-soft-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); flex: none; font-weight: 700; font-size: 15px; }
.avatar.filled { background: var(--grad); color: #fff; border: 0; }
.user-chip .who { line-height: 1.2; }
.user-chip .who b { display: block; font-size: 14px; color: var(--text); }
.user-chip .who span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: none; color: var(--text-2); font-size: 14px; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--primary-soft-2); }
.dropdown .credit-line { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .credit-line b { font-size: 20px; font-family: var(--font-head); }

.announce { background: var(--grad); color: #fff; text-align: center; font-size: 13.5px; font-weight: 500; padding: 8px 16px; }
.announce a { color: #fff; text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 0 6px 18px 34px; }
.hero h1 { font-size: clamp(32px, 3.15vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 16.5px; color: var(--text-2); margin: 18px 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 14px; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--primary-soft); color: var(--primary-text); }
.chip .ic { width: 18px; height: 18px; }
.chip.pink { background: var(--pink-soft); color: var(--pink-text); }
.chip.blue { background: var(--blue-soft); color: var(--blue-text); }

.collage { position: relative; height: 250px; }
.collage::before { content: ''; position: absolute; inset: 12% 0 4% 2%; border-radius: 60px; background: radial-gradient(60% 70% at 30% 40%, rgba(202, 160, 255, .55), transparent 70%), radial-gradient(50% 60% at 75% 55%, rgba(255, 160, 220, .5), transparent 70%); filter: blur(18px); }
.collage .card-img { position: absolute; width: 27%; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 16px 34px rgba(80, 40, 160, .22); background: var(--bg-soft); cursor: pointer; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.collage .card-img img { width: 100%; height: 100%; object-fit: cover; }
.collage .c1 { left: 3%; top: 14%; transform: rotate(-6deg); width: 28%; aspect-ratio: 1/1; }
.collage .c2 { left: 27%; top: 2%; transform: rotate(4deg); z-index: 2; width: 29%; aspect-ratio: 1/1.05; }
.collage .c3 { left: 52%; top: -2%; transform: rotate(-5deg); z-index: 3; }
.collage .c4 { left: 74%; top: 18%; transform: rotate(8deg); z-index: 2; width: 24%; }
.collage .card-img:hover { transform: rotate(0) translateY(-6px) scale(1.04); z-index: 5; }
[data-theme="dark"] .collage .card-img { border-color: var(--surface-2); }

/* ---------- Cards / studio ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); }
.studio { padding: 16px 20px 20px; }
.tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 10px; border: 1px solid transparent; background: var(--bg-soft); color: var(--text-2); padding: 10px 26px 10px 22px; border-radius: 11px; font-weight: 500; font-size: 14px; }
.tab .ic { width: 18px; height: 18px; }
.tab:hover { background: var(--primary-soft-2); }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(107, 62, 246, .28); font-weight: 600; }

.prompt-box { position: relative; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.prompt-box:focus-within { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.prompt-box textarea { width: 100%; min-height: 96px; resize: vertical; border: 0; background: transparent; padding: 16px 170px 16px 18px; line-height: 1.6; font-size: 15.5px; outline: none; color: var(--text); border-radius: 14px; }
.prompt-box textarea::placeholder { color: var(--faint); }
.prompt-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.enhance-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); padding: 8px 13px; font-size: 13.5px; font-weight: 600; }
.enhance-btn:hover { background: color-mix(in srgb, var(--primary-soft) 75%, var(--primary) 12%); }
.enhance-btn .ic { width: 17px; height: 17px; }
.prompt-meta { position: absolute; bottom: 8px; right: 14px; font-size: 12px; color: var(--faint); pointer-events: none; }

.settings-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin-top: 16px; }
.setting { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.setting > .ic { width: 28px; height: 28px; color: var(--muted); margin-bottom: 6px; stroke-width: 1.6; }
.setting label, .field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; width: 100%; min-width: 150px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; padding: 9px 38px 9px 13px; font-size: 14.5px; color: var(--text); }
.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.generate-btn { margin-left: auto; min-width: 290px; padding: 17px 26px; font-size: 17px; border-radius: 13px; font-weight: 700; }
.generate-btn .ic { width: 22px; height: 22px; }
.cost-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.cost-note .ic { width: 15px; height: 15px; color: var(--amber); }
.cost-note b { color: var(--text-2); }

.style-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.style-tile { border: 0; background: transparent; padding: 0; text-align: center; border-radius: 12px; }
.style-tile .thumb { aspect-ratio: 13/8.2; border-radius: 9px; overflow: hidden; border: 2px solid transparent; background: var(--bg-soft); transition: border-color .15s, transform .15s; }
.style-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.style-tile span { display: block; margin-top: 7px; font-size: 13.5px; color: var(--text-2); padding: 4px 2px; border-radius: 0 0 9px 9px; }
.style-tile:hover .thumb { transform: translateY(-2px); }
.style-tile.active .thumb { border-color: var(--primary); }
.style-tile.active span { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; margin-top: 0; padding-top: 10px; border-radius: 0 0 10px 10px; }
.style-tile.active { background: var(--primary-soft); padding-bottom: 0; }
.style-none .thumb { display: grid; place-items: center; color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.pill:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); color: var(--primary-text); }
.pill.active { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); font-weight: 600; }
.pill .ic { width: 15px; height: 15px; }
.label-sm { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 16px 0 0; display: flex; align-items: center; gap: 7px; }

/* Upload zone */
.dropzone { position: relative; border: 2px dashed color-mix(in srgb, var(--primary) 30%, var(--border)); border-radius: 14px; background: var(--primary-soft-2); padding: 22px; display: flex; align-items: center; gap: 18px; margin-bottom: 14px; transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--primary); box-shadow: var(--shadow-sm); flex: none; }
.dropzone .dz-icon .ic { width: 26px; height: 26px; }
.dropzone b { display: block; font-size: 15px; }
.dropzone small { color: var(--muted); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.has-file { cursor: default; padding: 12px; background: var(--surface); border-style: solid; border-color: var(--border); }
.dz-preview { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-soft); }
.dz-info { flex: 1; min-width: 0; }
.dz-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dz-progress { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 10px; }
.dz-progress i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .2s; }

/* ---------- Tool pages ---------- */
.page-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.page-head .ph-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(107, 62, 246, .25); flex: none; }
.page-head .ph-icon .ic { width: 26px; height: 26px; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { margin: 3px 0 0; color: var(--muted); }
.page-head .ph-right { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); padding: 4px; border-radius: 12px; gap: 4px; }
.seg a, .seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); display: inline-flex; gap: 7px; align-items: center; }
.seg .active { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.seg .ic { width: 16px; height: 16px; }

.tool-layout { display: grid; grid-template-columns: minmax(380px, 470px) minmax(0, 1fr); gap: 22px; align-items: start; }
.tool-panel { padding: 20px; position: sticky; top: calc(var(--topbar) + 16px); }
.tool-panel .settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool-panel .setting { display: block; }
.tool-panel .setting > .ic { display: none; }
.tool-panel .select select { min-width: 0; }
.tool-panel .generate-btn { margin: 18px 0 0; width: 100%; min-width: 0; }
.tool-panel .style-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tool-panel .style-tile span { font-size: 12.5px; }
.tool-panel .prompt-box textarea { min-height: 130px; padding: 16px 16px 40px; }
.tool-panel .prompt-tools { top: auto; bottom: 8px; right: 8px; }
.tool-panel .prompt-meta { left: 16px; right: auto; }
.section-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.section-label:first-child { margin-top: 0; }

.results { min-height: 420px; padding: 20px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.results-head h3 { font-size: 18px; }
.empty-state { display: grid; place-items: center; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .es-art { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; margin-bottom: 18px; }
.empty-state .es-art img { width: 84px; height: 110px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.empty-state .es-art img:nth-child(2) { transform: translateY(-10px); }
.empty-state h3 { color: var(--text); font-size: 19px; margin-bottom: 6px; }

/* Job result cards */
.job { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface-2); margin-bottom: 16px; }
.job-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.job-prompt { font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.run { background: var(--primary-soft); color: var(--primary-text); }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.job-grid.one { grid-template-columns: minmax(0, 1fr); }
.job-grid.one .media { max-width: 100%; margin: 0 auto; }
.media { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-soft); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media.contain img, .media.contain video { object-fit: contain; background: #0b0a14; }
.media .ov { position: absolute; inset: auto 0 0 0; padding: 30px 10px 10px; display: flex; gap: 6px; justify-content: flex-end; background: linear-gradient(transparent, rgba(10, 6, 30, .65)); opacity: 0; transition: opacity .2s; }
.media:hover .ov, .media:focus-within .ov { opacity: 1; }
.ov .ob { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .92); color: #1b1640; display: grid; place-items: center; }
.ov .ob:hover { background: #fff; }
.ov .ob .ic { width: 17px; height: 17px; }
.media .badge-play { position: absolute; top: 10px; left: 10px; background: rgba(10, 6, 30, .6); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 8px; display: flex; gap: 5px; align-items: center; }
.media .badge-play .ic { width: 13px; height: 13px; }
@media (hover: none) { .media .ov { opacity: 1; } }

.skeleton { position: relative; overflow: hidden; background: linear-gradient(110deg, var(--bg-soft) 30%, color-mix(in srgb, var(--primary-soft) 80%, var(--surface)) 50%, var(--bg-soft) 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -220% 0; } }
.gen-wait { display: grid; place-items: center; text-align: center; padding: 18px; color: var(--muted); }
.gen-wait .orb { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; animation: pulse 1.8s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(107, 62, 246, .45); }
.gen-wait .orb .ic { width: 28px; height: 28px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(107, 62, 246, .45); } 70% { box-shadow: 0 0 0 18px rgba(107, 62, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(107, 62, 246, 0); } }
.gen-wait b { color: var(--text); font-size: 15px; margin-top: 12px; display: block; }
.progress { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; width: min(320px, 90%); margin: 12px auto 6px; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .6s ease; }
.job-wait-box { display: grid; place-items: center; }
.job-error { display: flex; gap: 10px; align-items: flex-start; background: var(--red-soft); color: var(--red); padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.job-error .ic { margin-top: 1px; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Gallery ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 30px 0 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 800; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.gallery-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.gallery-row .gitem { aspect-ratio: 7/10.4; }
.gitem { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-soft); cursor: pointer; border: 0; padding: 0; }
.gitem img, .gitem video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.gitem:hover img, .gitem:hover video { transform: scale(1.06); }
.gitem .gcap { position: absolute; inset: auto 0 0 0; padding: 34px 12px 11px; color: #fff; text-align: left; font-size: 13px; font-weight: 600; background: linear-gradient(transparent, rgba(8, 5, 25, .72)); opacity: 0; transition: opacity .2s; }
.gitem:hover .gcap { opacity: 1; }
.gitem .vbadge { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; border-radius: 50%; background: rgba(10, 6, 30, .55); color: #fff; display: grid; place-items: center; }
.gitem .vbadge .ic { width: 14px; height: 14px; }
.masonry { columns: 4 240px; column-gap: 14px; }
.masonry .gitem { display: block; width: 100%; margin-bottom: 14px; break-inside: avoid; }
.masonry .gitem img, .masonry .gitem video { height: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Tools hub ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tool-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; transition: transform .2s, box-shadow .2s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tool-card .tc-img { height: 170px; overflow: hidden; position: relative; }
.tool-card .tc-img img { width: 100%; height: 100%; object-fit: cover; }
.tool-card .tc-ic { position: absolute; left: 14px; bottom: -20px; width: 46px; height: 46px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; border: 3px solid var(--surface); }
.tool-card .tc-body { padding: 28px 18px 18px; }
.tool-card h3 { font-size: 17px; margin-bottom: 6px; }
.tool-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.tool-card .go { color: var(--primary-text); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.tool-card .go .ic { width: 16px; height: 16px; }
.soon { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); margin-left: 6px; vertical-align: middle; }

/* ---------- Prompt tool ---------- */
.prompt-results { display: grid; gap: 14px; }
.prompt-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.prompt-card p { margin: 0 0 12px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }
.prompt-card .pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prompt-card .pc-head b { font-size: 13px; color: var(--primary-text); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 20px; justify-content: center; }
.plan { padding: 26px 24px; position: relative; display: flex; flex-direction: column; }
.plan.hl { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--shadow); }
.plan .pbadge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.plan h3 { font-size: 20px; }
.plan .price { font-family: var(--font-head); font-size: 40px; font-weight: 800; margin: 12px 0 2px; letter-spacing: -.03em; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.plan .pcredits { color: var(--primary-text); font-weight: 600; font-size: 14px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; flex: 1; align-content: start; }
.plan li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.plan li .ic { width: 18px; height: 18px; color: var(--green); margin-top: 2px; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cost-table td { padding: 12px 6px; border-bottom: 1px solid var(--border); }
.cost-table td:last-child { text-align: right; font-weight: 700; }
.pay-logos { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 13px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }

/* ---------- Forms / auth ---------- */
.field { margin-bottom: 14px; }
.input, .textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); padding: 12px 14px; font-size: 15px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.input-wrap .input { padding-left: 40px; }
.auth { max-width: 440px; margin: 20px auto; padding: 30px; }
.auth h2 { font-size: 25px; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin: 0 0 22px; }
.auth .switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.form-error { background: var(--red-soft); color: var(--red); padding: 10px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.form-ok { background: var(--green-soft); color: var(--green); padding: 10px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.bonus { display: flex; gap: 10px; align-items: center; background: var(--primary-soft-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }
.bonus .ic { color: var(--primary); }

/* Account */
.acc-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.acc-card { padding: 22px; }
.acc-card h3 { font-size: 17px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.stat-big { font-family: var(--font-head); font-size: 42px; font-weight: 800; line-height: 1; }
.list-rows { display: grid; }
.list-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list-rows > div:last-child { border-bottom: 0; }
.plus { color: var(--green); font-weight: 700; }
.minus { color: var(--red); font-weight: 700; }

/* Doc pages */
.doc { max-width: 820px; padding: 30px; margin: 0 auto; }
.doc p { color: var(--text-2); line-height: 1.75; white-space: pre-wrap; }

/* ---------- Modal / lightbox / toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(12, 8, 30, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); position: relative; animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal .x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.modal-body { padding: 28px; }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(6, 4, 18, .94); display: grid; grid-template-columns: minmax(0, 1fr) 340px; animation: fade .15s; }
.lb-stage { display: grid; place-items: center; padding: 30px; min-height: 0; position: relative; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 60px); object-fit: contain; border-radius: 10px; }
.lb-side { background: var(--surface); padding: 26px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.lb-side h3 { font-size: 18px; }
.lb-side .lb-prompt { font-size: 14px; color: var(--text-2); line-height: 1.6; background: var(--bg-soft); border-radius: 12px; padding: 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; }
.lb-close { position: absolute; top: 14px; left: 14px; background: rgba(255, 255, 255, .12); color: #fff; }
.lb-close:hover { background: rgba(255, 255, 255, .22); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .12); color: #fff; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-actions { display: grid; gap: 8px; }
.toasts { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 10px; max-width: min(400px, calc(100vw - 36px)); }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s; }
.toast.err { background: var(--red); color: #fff; }
.toast.ok { background: #13824f; color: #fff; }
.toast .ic { width: 18px; height: 18px; margin-top: 1px; }

.footer { border-top: 1px solid var(--border); padding: 22px 26px 30px; color: var(--muted); font-size: 13px; display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.footer a { color: var(--muted); margin-left: 14px; }
.footer a:hover { color: var(--primary-text); }

.bottom-nav { display: none; }
.drawer-back { display: none; }
.notice-bar { display: flex; gap: 10px; align-items: center; background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.notice-bar .ic { width: 18px; height: 18px; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  .topnav a .ic { display: none; }
  .topnav a { padding: 10px 13px; }
}
@media (max-width: 1360px) {
  .topnav a { padding: 10px 10px; }
  .generate-btn { min-width: 240px; }
}
@media (max-width: 1200px) {
  :root { --sidebar: 232px; }
  .topnav { display: none; }
  .style-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { padding-left: 10px; }
  .tool-layout { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .drawer-back.open { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(12, 8, 30, .45); }
  .menu-btn { display: grid; }
  .mobile-brand { display: flex; }
  .hero { grid-template-columns: 1fr; padding: 4px 4px 18px; }
  .collage { height: 230px; max-width: 620px; width: 100%; margin: 0 auto; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-panel { position: static; }
  .acc-grid { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-side { max-height: 42vh; border-radius: 18px 18px 0 0; }
  .user-chip .who { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .content { padding: 14px 14px 96px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .top-right { gap: 4px; }
  .top-right .btn-upgrade span { display: none; }
  .top-right .btn-upgrade { padding: 10px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 15px; margin: 12px 0 16px; }
  .chips { gap: 8px; }
  .chip { padding: 8px 12px; font-size: 13px; }
  .collage { height: 190px; }
  .studio { padding: 12px; }
  .tabs { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 9px 14px; font-size: 13px; white-space: nowrap; }
  .prompt-box textarea { padding: 14px 14px 46px; min-height: 120px; }
  .prompt-tools { top: auto; bottom: 8px; right: 8px; }
  .prompt-meta { left: 14px; right: auto; }
  .settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .setting { display: block; }
  .setting > .ic { display: none; }
  .select select { min-width: 0; }
  .generate-btn { grid-column: 1 / -1; width: 100%; min-width: 0; margin: 4px 0 0; }
  .style-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .style-tile span { font-size: 11.5px; }
  .gallery-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masonry { columns: 2 140px; column-gap: 10px; }
  .masonry .gitem { margin-bottom: 10px; }
  .page-head h1 { font-size: 22px; }
  .page-head .ph-icon { width: 44px; height: 44px; }
  .page-head .ph-right { margin-left: 0; width: 100%; }
  .section-head h2 { font-size: 20px; }
  .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results { padding: 14px; min-height: 0; }
  .tool-panel { padding: 14px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .bottom-nav a .ic { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary-text); }
  .bottom-nav a.mid .ic { width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: var(--grad); color: #fff; margin-top: -18px; box-shadow: 0 8px 20px rgba(107, 62, 246, .35); }
  .toasts { left: 14px; right: 14px; bottom: 84px; max-width: none; }
  .auth { padding: 22px; margin: 6px auto; }
  .modal-body { padding: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .footer { padding: 18px 14px 100px; }
  .footer a { margin: 0 14px 0 0; }
  .dropzone { flex-direction: column; text-align: center; }
  .dropzone.has-file { flex-direction: row; text-align: left; }
  .dz-preview { width: 90px; height: 90px; }
}

/* ===================== AI Chat ===================== */
body[data-route="chat"] .footer { display: none; }
body[data-route="chat"] .content { max-width: none; padding: 14px 16px; }
.chat-wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; height: calc(100vh - var(--topbar) - 28px); min-height: 480px; }
.chat-side { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-search .input { padding: 9px 12px 9px 38px; font-size: 14px; }
.chat-list { overflow-y: auto; display: grid; gap: 2px; align-content: start; margin: 0 -6px; padding: 0 6px; flex: 1; min-height: 0; }
.chat-item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.chat-item:hover { background: var(--primary-soft-2); }
.chat-item.active { background: var(--primary-soft); }
.chat-item .ci-main { min-width: 0; flex: 1; }
.chat-item b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.chat-item small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .ci-del { width: 30px; height: 30px; opacity: 0; color: var(--muted); }
.chat-item:hover .ci-del, .chat-item.active .ci-del { opacity: 1; }
.chat-item .ci-del .ic { width: 16px; height: 16px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-list-btn { display: none; }
.chat-title { margin-left: auto; color: var(--muted); font-size: 13.5px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pick { position: relative; min-width: 0; }
.model-btn { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 11px; padding: 8px 12px; font-weight: 600; font-size: 14.5px; color: var(--text); max-width: 100%; }
.model-btn:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.model-btn .mb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.model-btn .ic { width: 16px; height: 16px; color: var(--muted); }
.fam-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #9aa0b8; }
.fam-gpt { background: #10a37f; } .fam-claude { background: #d97757; } .fam-gemini { background: #4285f4; } .fam-llama { background: #0866ff; } .fam-deepseek { background: #4d6bfe; } .fam-mistral { background: #fa520f; }
.tier-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex: none; }
.t-free { background: var(--green-soft); color: var(--green); }
.t-basic { background: var(--blue-soft); color: var(--blue-text); }
.t-standard { background: var(--primary-soft); color: var(--primary-text); }
.t-premium { background: var(--pink-soft); color: var(--pink-text); }
.model-pop { position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mp-search { padding: 10px; border-bottom: 1px solid var(--border); }
.mp-search .ic { left: 23px; }
.mp-search .input { padding: 10px 12px 10px 40px; font-size: 14px; }
.mp-list { max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; }
.mp-grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.mp-row { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 10px; text-align: left; }
.mp-row:hover { background: var(--primary-soft-2); }
.mp-row.active { background: var(--primary-soft); }
.mp-n { min-width: 0; flex: 1; }
.mp-n b { display: block; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-n small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.chat-msgs { max-width: 820px; margin: 0 auto; padding: 22px 18px 10px; display: grid; gap: 18px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { max-width: 80%; background: var(--primary-soft); color: var(--text); padding: 11px 15px; border-radius: 18px 18px 4px 18px; line-height: 1.55; white-space: normal; word-wrap: break-word; }
.msg.ai { display: flex; gap: 12px; align-items: flex-start; }
.ai-av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.ai-av svg { width: 26px; height: 26px; }
.ai-body { min-width: 0; flex: 1; }
.ai-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-note { display: inline-flex; gap: 5px; align-items: center; font-weight: 500; color: var(--amber); background: var(--amber-soft); padding: 2px 8px; border-radius: 999px; }
.fb-note .ic { width: 13px; height: 13px; }
.ai-actions { display: flex; gap: 6px; margin-top: 6px; }
.md { line-height: 1.68; color: var(--text); word-wrap: break-word; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 14px 0 8px; font-size: 16.5px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md-pre { background: #151229; color: #e8e6f5; border-radius: 12px; overflow: hidden; margin: 6px 0 12px; }
.md-pre code { display: block; background: none; color: inherit; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.md-lang { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 14px; font-size: 12px; color: #a9a3cf; background: rgba(255, 255, 255, .05); }
.md-copy { border: 0; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 6px; font-size: 12px; padding: 3px 9px; }
.md blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid var(--primary); background: var(--primary-soft-2); border-radius: 0 8px 8px 0; }
.md a { text-decoration: underline; }
.caret { display: inline-block; width: 8px; height: 16px; background: var(--primary); border-radius: 2px; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .4; animation: tdot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes tdot { 40% { opacity: 1; transform: translateY(-3px); } }
.chat-composer { padding: 10px 16px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.composer-box { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--border-strong); border-radius: 16px; padding: 8px 8px 8px 16px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.composer-box textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; font-size: 15.5px; line-height: 1.5; padding: 8px 0; max-height: 220px; color: var(--text); }
.send-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(107, 62, 246, .3); }
.send-btn .ic { width: 19px; height: 19px; }
.send-btn.stop { background: var(--text); }
.composer-meta { max-width: 820px; margin: 7px auto 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.composer-meta .ic { width: 14px; height: 14px; color: var(--amber); }
.composer-meta b { color: var(--text-2); }
.cm-hint { margin-left: auto; }
.chat-empty { text-align: center; padding: 6vh 10px 20px; }
.chat-empty .ce-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); }
.chat-empty .ce-icon svg { width: 54px; height: 54px; }
.chat-empty .ce-icon .ic { width: 34px; height: 34px; }
.chat-empty h2 { font-size: 26px; margin-bottom: 6px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; margin: 22px auto 0; }
.sg { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--text-2); transition: border-color .15s, transform .15s; }
.sg:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-2px); }
.sg .ic { color: var(--primary); width: 18px; height: 18px; margin-top: 1px; }
.chat-back { display: none; }
@media (max-width: 900px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - var(--topbar) - 24px); }
  .chat-side { position: fixed; z-index: 85; top: 0; left: 0; bottom: 0; width: 290px; border-radius: 0 18px 18px 0; transform: translateX(-104%); transition: transform .25s; }
  .chat-side.open { transform: none; box-shadow: var(--shadow-lg); }
  .chat-back.open { display: block; position: fixed; inset: 0; z-index: 84; background: rgba(12, 8, 30, .4); }
  .chat-list-btn { display: grid; }
  .chat-title { display: none; }
  .model-btn .mb-name { max-width: 46vw; }
}
@media (max-width: 700px) {
  body[data-route="chat"] .content { padding: 8px 8px 0; }
  .chat-wrap { height: calc(100dvh - var(--topbar) - 76px); }
  .chat-msgs { padding: 14px 10px 6px; }
  .msg.user .bubble { max-width: 88%; }
  .ai-av { display: none; }
  .suggest { grid-template-columns: 1fr; }
  .cm-hint { display: none; }
  .chat-composer { padding: 8px 8px 10px; }
  .chat-empty h2 { font-size: 21px; }
}

/* ===================== Connections ===================== */
.secure-note { display: flex; gap: 12px; align-items: flex-start; background: var(--green-soft); color: #0f6b47; border-radius: 14px; padding: 13px 16px; font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
.secure-note .ic { color: var(--green); width: 22px; height: 22px; flex: none; margin-top: 1px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.conn-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s, transform .2s; min-width: 0; }
.conn-card:hover { box-shadow: var(--shadow); }
.conn-card.st-connected { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.conn-card.st-reconnect { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.cc-top { display: flex; gap: 12px; align-items: center; }
.p-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
.p-ic .ic { width: 55%; height: 55%; }
.cc-name b { display: block; font-size: 16px; font-family: var(--font-head); }
.st-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; margin-top: 4px; }
.st-pill .ic { width: 13px; height: 13px; }
.st-pill.ok { background: var(--green-soft); color: var(--green); }
.st-pill.warn { background: var(--amber-soft); color: var(--amber); }
.st-pill.off { background: var(--bg-soft); color: var(--muted); }
.cc-note { display: flex; gap: 7px; font-size: 12.5px; color: var(--muted); background: var(--bg-soft); padding: 8px 10px; border-radius: 10px; line-height: 1.4; }
.cc-note .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--primary); }
.acc-rows { display: grid; gap: 6px; }
.acc-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 11px; padding: 7px 6px 7px 8px; min-width: 0; }
.acc-row .btn { padding: 7px 9px; flex: none; }
.acc-row.bad { background: var(--amber-soft); border-color: transparent; }
.acc-row img, .acc-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.acc-av { background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.acc-n { min-width: 0; flex: 1; }
.acc-n b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-n small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-btn { margin-top: auto; }
@media (max-width: 700px) { .conn-grid { grid-template-columns: minmax(0, 1fr); } }
.hide-sm { display: none; }

/* ===================== Create Post ===================== */
.cp-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 20px; align-items: start; }
.cp-main, .cp-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.cp-side { position: sticky; top: calc(var(--topbar) + 16px); }
.cp-sec { padding: 18px 20px; min-width: 0; }
.cp-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cp-h h3 { font-size: 17px; }
.cp-hint { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.cp-hint .ic { width: 15px; height: 15px; }
.cp-n { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.cp-row3 { display: grid; grid-template-columns: 1fr 1.3fr 1.1fr; gap: 12px; align-items: end; }
.cp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cp-row3 .field, .cp-row2 .field { margin-bottom: 12px; }
.cp-count { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.bad { color: var(--red); }
.cp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cp-media:empty { display: none; }
.cp-mi { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-soft); }
.cp-mi img, .cp-mi video { width: 100%; height: 100%; object-fit: cover; }
.cp-mx { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(10, 6, 30, .7); color: #fff; display: grid; place-items: center; }
.cp-mx .ic { width: 15px; height: 15px; }
.vtag { position: absolute; left: 6px; bottom: 6px; display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 600; color: #fff; background: rgba(10, 6, 30, .6); padding: 3px 7px; border-radius: 7px; }
.vtag .ic { width: 12px; height: 12px; }
.tg-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tg { border: 1px solid var(--border); border-radius: 13px; padding: 10px 12px; transition: border-color .15s, background .15s; min-width: 0; }
.tg.on { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: var(--primary-soft-2); }
.tg.bad { opacity: .75; }
.tg-main { display: flex; align-items: center; gap: 11px; cursor: pointer; min-width: 0; }
.tg-main input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.tg-n { min-width: 0; flex: 1; }
.tg-n b { display: block; font-size: 14.5px; }
.tg-n small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-extra { margin: 10px 0 2px 29px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tg-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 2px 29px; font-size: 13px; color: var(--text-2); }
.pv-tabs { display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 12px; padding-bottom: 4px; scrollbar-width: thin; }
.pv-tab { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px 6px 7px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--text-2); position: relative; }
.pv-tab.active { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-text); }
.pv-tab .p-ic { border-radius: 7px; box-shadow: none; }
.dot-bad { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.pv-empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.pv-empty .ic { width: 30px; height: 30px; color: var(--faint); }
.pv-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.pv-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.pv-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.pv-top b { display: block; font-size: 14px; }
.pv-top small { color: var(--muted); font-size: 12px; }
.pv-text { padding: 0 12px 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--text); word-wrap: break-word; max-height: 260px; overflow: auto; }
.pv-title { padding: 10px 12px 4px; font-weight: 700; font-size: 15px; }
.pv-media { position: relative; background: #0b0a14; }
.pv-media img, .pv-media video { width: 100%; max-height: 380px; object-fit: contain; display: block; }
.pv-none { display: grid; place-items: center; gap: 6px; height: 140px; color: #a9a3cf; font-size: 13px; }
.pv-more { position: absolute; right: 10px; top: 10px; background: rgba(10, 6, 30, .7); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.pv-youtube .pv-text, .pv-pinterest .pv-text { padding-top: 0; color: var(--text-2); font-size: 13.5px; }
.pv-rules { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.pv-rules li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.pv-rules li .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.pv-rules li.ok { color: var(--green); }
.pv-rules li.bad { color: var(--red); font-weight: 500; }
.pv-rules.problems { margin: 0 0 14px; background: var(--bg-soft); padding: 10px 12px; border-radius: 12px; }
.pv-custom { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.pv-custom summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; gap: 7px; align-items: center; color: var(--primary-text); }
.pv-custom summary .ic { width: 16px; height: 16px; }
.pv-custom .field, .pv-custom textarea { margin-top: 10px; }
.cp-mode { display: flex; width: 100%; margin-bottom: 12px; }
.cp-mode button { flex: 1; justify-content: center; }
.cp-when { margin-bottom: 12px; }
.cp-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.cp-wait { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--muted); background: var(--primary-soft-2); padding: 10px 12px; border-radius: 12px; }
.cp-results { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.res-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; flex-wrap: wrap; }
.res-n { min-width: 0; flex: 1; }
.res-n b { display: block; font-size: 14px; }
.res-n small { color: var(--muted); font-size: 12.5px; }
.st-pill.bad { background: var(--red-soft); color: var(--red); }
.st-pill.sched { background: var(--blue-soft); color: var(--blue-text); }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.pk-item { position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; background: var(--bg-soft); }
.pk-item:hover { border-color: var(--primary); }
.pk-item img, .pk-item video { width: 100%; height: 100%; object-fit: cover; }

/* ===================== My Posts ===================== */
.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pill-n { font-size: 11px; background: rgba(0, 0, 0, .06); padding: 1px 7px; border-radius: 999px; }
.post-list { display: grid; gap: 14px; }
.post-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 14px; }
.pc-media { position: relative; width: 150px; height: 150px; border-radius: 12px; overflow: hidden; background: var(--bg-soft); }
.pc-media img, .pc-media video { width: 100%; height: 100%; object-fit: cover; }
.pc-text-only { display: grid; place-items: center; height: 100%; color: var(--faint); }
.pc-text-only .ic { width: 34px; height: 34px; }
.pc-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-top .st-pill { margin: 0; }
.pc-title { font-size: 15px; }
.pc-text { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.pchips { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); color: var(--text-2); }
.pchip .p-ic { border-radius: 50%; box-shadow: none; }
.pchip > .ic { width: 13px; height: 13px; }
.pchip.ok { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); color: var(--green); }
.pchip.bad { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); color: var(--red); }
.pchip.sched { border-color: color-mix(in srgb, var(--blue-text) 35%, var(--border)); color: var(--blue-text); }
a.pchip:hover { background: var(--green-soft); }
.pstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); font-weight: 600; }
.pstats span { display: inline-flex; gap: 5px; align-items: center; }
.pstats .ic { width: 15px; height: 15px; color: var(--primary); }
.perr { display: flex; gap: 8px; font-size: 13px; color: var(--red); background: var(--red-soft); padding: 8px 10px; border-radius: 10px; }
.perr .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
@media (max-width: 1100px) {
  .cp-layout { grid-template-columns: 1fr; }
  .cp-side { position: static; }
}
@media (max-width: 700px) {
  .cp-row3, .cp-row2 { grid-template-columns: 1fr; }
  .cp-sec { padding: 14px; }
  .post-card { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .pc-media { width: 88px; height: 88px; }
  .tg-extra { grid-template-columns: 1fr; margin-left: 0; }
  .tg-check { margin-left: 0; }
  .cp-actions { grid-template-columns: 1fr; }
}

/* ---------- UPI / bank transfer checkout ---------- */
.pay-amount { font-size: 34px; font-weight: 800; text-align: center; margin: 14px 0 8px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pay-qr { width: 210px; height: 210px; margin: 4px auto 0; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 16px; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.pay-qr svg { width: 100%; height: 100%; display: block; }
.pay-box { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); padding: 4px 12px; margin-top: 12px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.pay-row:last-child { border-bottom: 0; }
.pay-row span { color: var(--muted); font-size: 13.5px; flex: none; min-width: 108px; }
.pay-row b { font-weight: 700; font-size: 14.5px; word-break: break-all; flex: 1; min-width: 0; }
.pay-row .btn { flex: none; padding: 6px 8px; }
.pay-bank { margin-top: 14px; }
.pay-bank summary { cursor: pointer; font-weight: 700; color: var(--primary-text); display: flex; align-items: center; gap: 8px; list-style: none; }
.pay-bank summary::-webkit-details-marker { display: none; }
.pay-form { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pay-form label { font-size: 14px; color: var(--text-2); }
@media (max-width: 480px) { .pay-row span { min-width: 92px; } .pay-amount { font-size: 30px; } }
.pay-qr-img { width: 230px; height: 230px; padding: 8px; }
.pay-qr-img img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
