/* AMIR STUDIO — پایه‌ی رابط چت. رنگ‌ها و حال‌وهوا در themes/*.css تعریف می‌شود. */

@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
	font-family: var(--font-body, "Vazirmatn"), system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 15.5px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- چیدمان ---------- */

.app { display: flex; height: 100dvh; width: 100%; }

.sidebar {
	width: 286px;
	flex: none;
	background: var(--bg-side);
	border-inline-end: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	padding: 14px 12px 12px;
	gap: 10px;
	transition: transform .28s cubic-bezier(.2,.8,.2,1), margin .28s cubic-bezier(.2,.8,.2,1);
	z-index: 40;
}

.app.side-collapsed .sidebar { margin-inline-start: -286px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.scrim { display: none; }

/* ---------- نوار کناری ---------- */

.side-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; }
.brand-mark {
	width: 38px; height: 38px; border-radius: 12px; flex: none;
	display: grid; place-items: center;
	background: var(--accent-soft); color: var(--accent);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { min-width: 0; flex: 1; line-height: 1.25; }
.brand-title { font-weight: 800; letter-spacing: .02em; font-size: 15px; direction: ltr; text-align: start; }
.brand-sub { font-size: 11.5px; color: var(--muted); direction: ltr; text-align: start; }

.icon-btn {
	width: 38px; height: 38px; border-radius: 10px; flex: none;
	display: grid; place-items: center; color: var(--muted);
	transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.new-chat {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px; border-radius: 12px;
	font-weight: 600; color: var(--text);
	border: 1px solid var(--border);
	background: var(--bg-elev);
	transition: background .15s, border-color .15s, transform .1s;
}
.new-chat:hover { background: var(--hover); }
.new-chat:active { transform: scale(.985); }
.new-chat svg { width: 18px; height: 18px; color: var(--accent); }

.search {
	width: 100%; padding: 9px 12px; border-radius: 10px;
	border: 1px solid transparent; background: var(--hover);
	font-size: 13.5px;
}
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent); background: var(--bg-elev); }

.conv-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 2px 4px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.conv-group { font-size: 11.5px; color: var(--muted); padding: 12px 10px 4px; font-weight: 600; }

.conv {
	position: relative; display: flex; align-items: center; gap: 4px;
	border-radius: 10px; padding-inline-end: 4px;
}
.conv:hover, .conv.active { background: var(--hover); }
.conv.active { background: var(--active); }
.conv-title {
	flex: 1; min-width: 0; text-align: start; padding: 8px 10px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px;
}
.conv-actions { display: none; gap: 0; }
.conv:hover .conv-actions, .conv:focus-within .conv-actions { display: flex; }
.conv-actions button { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.conv-actions button:hover { background: var(--border); color: var(--text); }
.conv-actions svg { width: 15px; height: 15px; }
.conv-empty { padding: 18px 10px; color: var(--muted); font-size: 13px; text-align: center; }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

.meter { padding: 4px 6px; font-size: 12px; color: var(--muted); }
.meter-bar { height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 6px; }
.meter-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }

.other-ws { display: flex; flex-direction: column; gap: 2px; }
.other-ws a {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13.5px;
}
.other-ws a:hover { background: var(--hover); }
.other-ws a span:first-child { direction: ltr; font-weight: 600; }
.other-ws a span:last-child { color: var(--muted); font-size: 12px; }

.user-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; }
.avatar {
	width: 34px; height: 34px; border-radius: 50%; flex: none;
	display: grid; place-items: center; font-weight: 700; font-size: 13px;
	background: var(--accent); color: var(--accent-contrast);
}
.user-name { flex: 1; min-width: 0; font-size: 13.5px; direction: ltr; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.disclaimer { font-size: 11px; color: var(--muted); line-height: 1.7; padding: 2px 6px; }

/* ---------- نوار بالا ---------- */

.topbar {
	display: flex; align-items: center; gap: 6px;
	padding: 10px 14px; min-height: 58px;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	position: relative; z-index: 20;
}
.top-spacer { flex: 1; }

.model-picker { position: relative; }
.model-btn {
	display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
	font-weight: 700; font-size: 15.5px; direction: ltr;
	transition: background .15s;
}
.model-btn:hover, .model-btn[aria-expanded="true"] { background: var(--hover); }
.model-btn svg { width: 16px; height: 16px; color: var(--muted); }

.menu {
	position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 250px; z-index: 50;
	background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px;
	box-shadow: var(--shadow-lg); padding: 6px;
	animation: pop .14s ease-out;
}
.menu button {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
	padding: 10px 12px; border-radius: 10px; direction: ltr; text-align: start; font-weight: 600;
}
.menu button:hover { background: var(--hover); }
.menu button svg { width: 17px; height: 17px; color: var(--accent); }
.menu button.locked { opacity: .62; }
.menu button.locked svg { color: var(--muted); }
.menu .menu-id { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 9px 18px; border-radius: 99px; font-weight: 700; font-size: 14px;
	background: var(--accent); color: var(--accent-contrast);
	transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.danger { background: #d92d20; color: #fff; }

/* ---------- گفتگو ---------- */

.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.thread-inner { max-width: 780px; margin: 0 auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 14px; animation: rise .28s ease-out both; }
.msg.user { justify-content: flex-start; }
.msg .bubble {
	max-width: 85%; padding: 10px 16px; border-radius: 20px;
	background: var(--user-bubble); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.msg.assistant { align-items: flex-start; }
.msg .ava {
	width: 32px; height: 32px; border-radius: 50%; flex: none; margin-top: 2px;
	display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.msg .ava svg { width: 18px; height: 18px; }
.msg .body { flex: 1; min-width: 0; }
.msg .actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .actions, .msg:focus-within .actions { opacity: 1; }
.msg .actions button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.msg .actions button:hover { background: var(--hover); color: var(--text); }
.msg .actions svg { width: 16px; height: 16px; }
@media (hover: none) { .msg .actions { opacity: 1; } }

.msg.error .body { color: #c0392b; }
.errbox {
	border: 1px solid color-mix(in srgb, #d92d20 40%, var(--border));
	background: color-mix(in srgb, #d92d20 7%, transparent);
	color: var(--text); padding: 10px 14px; border-radius: 14px; font-size: 14px;
}

/* متن مارک‌داون */
.md { word-break: break-word; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.5; margin: 1.3em 0 .5em; font-weight: 800; }
.md h1 { font-size: 1.4em; } .md h2 { font-size: 1.22em; } .md h3 { font-size: 1.08em; } .md h4 { font-size: 1em; }
.md ul, .md ol { margin: 0 0 .85em; padding-inline-start: 1.5em; }
.md li { margin: .22em 0; }
.md li > ul, .md li > ol { margin: .2em 0 .2em; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.md blockquote { margin: 0 0 .85em; padding: 2px 14px; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md strong { font-weight: 800; }
.md code:not(pre code) {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: isolate;
	background: var(--hover); padding: .12em .42em; border-radius: 6px;
}
.md .tbl { overflow-x: auto; margin: 0 0 .9em; border: 1px solid var(--border); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: .93em; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: start; }
.md th { background: var(--hover); font-weight: 700; }
.md tr:last-child td { border-bottom: 0; }

.codebox { margin: 0 0 .95em; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--code-bg); direction: ltr; }
.codebox-head {
	display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px;
	background: var(--code-head); color: var(--code-muted); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.codebox-head button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; color: var(--code-muted); font-size: 12px; font-family: inherit; }
.codebox-head button:hover { background: rgba(127,127,127,.18); color: var(--code-text); }
.codebox-head svg { width: 14px; height: 14px; }
.codebox pre { margin: 0; padding: 12px 14px; overflow-x: auto; color: var(--code-text); font-size: 13.5px; line-height: 1.65; }
.codebox code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.caret { display: inline-block; width: 9px; height: 1.05em; vertical-align: -.18em; background: var(--accent); border-radius: 2px; margin-inline-start: 3px; animation: blink 1s steps(2) infinite; }
.typing { display: inline-flex; gap: 5px; padding: 8px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }

/* ---------- حالت خالی ---------- */

.empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 20px 40px; gap: 6px; }
.empty-logo {
	width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 14px;
	background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 7%, transparent);
}
.empty-logo svg { width: 34px; height: 34px; }
.empty h1 { font-size: clamp(24px, 4.2vw, 34px); margin: 0; font-weight: 800; line-height: 1.5; font-family: "Vazirmatn", system-ui, sans-serif; }
.empty p { margin: 0; color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 640px; margin-top: 26px; }
.chip {
	text-align: start; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev);
	font-size: 14px; line-height: 1.7; color: var(--text);
	transition: background .15s, border-color .15s, transform .12s;
}
.chip:hover { background: var(--hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }

/* ---------- ورودی پیام ---------- */

.composer-wrap { padding: 0 16px calc(12px + env(safe-area-inset-bottom)); }
.composer {
	max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px;
	background: var(--composer-bg); border: 1px solid var(--composer-border); border-radius: var(--composer-radius, 26px);
	padding: 8px 8px 8px 10px; box-shadow: var(--shadow);
	transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--composer-border)); box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.composer textarea {
	flex: 1; resize: none; border: 0; outline: none; background: transparent; padding: 9px 10px; max-height: 220px; min-height: 26px; line-height: 1.7; font-size: 15.5px;
}
.composer textarea::placeholder { color: var(--muted); }
.send-btn {
	width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
	background: var(--send-bg); color: var(--send-fg); transition: transform .12s, opacity .15s, filter .15s;
}
.send-btn:hover { filter: brightness(1.12); }
.send-btn:active { transform: scale(.94); }
.send-btn[disabled] { opacity: .3; cursor: not-allowed; }
.send-btn svg { width: 19px; height: 19px; }
.composer-note { max-width: 780px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--muted); }

.to-bottom {
	position: absolute; inset-inline: 0; margin: 0 auto; bottom: 118px; width: 38px; height: 38px; border-radius: 50%;
	display: none; place-items: center; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 10;
}
.to-bottom.show { display: grid; }
.to-bottom svg { width: 18px; height: 18px; }

/* ---------- مودال و اعلان ---------- */

.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 12, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .16s ease-out; }
.modal {
	width: 100%; max-width: 410px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 24px; padding: 28px 26px 24px;
	box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.9,.3,1.1); text-align: center;
}
.modal .m-logo { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 17px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.modal .m-logo svg { width: 29px; height: 29px; }
.modal h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.field {
	width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); text-align: center;
	font-size: 18px; letter-spacing: .08em; direction: ltr;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.field.code { font-size: 26px; letter-spacing: .5em; padding-inline-start: calc(16px + .5em); }
.modal .btn { width: 100%; margin-top: 14px; padding: 13px; }
.modal .row { display: flex; gap: 10px; margin-top: 10px; }
.modal .row .btn { margin-top: 4px; }
.m-error { min-height: 22px; margin-top: 10px; color: #d92d20; font-size: 13px; }
.m-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.m-link { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 10px; }
.m-testcode { margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; direction: ltr; }

.toast { position: fixed; inset-inline: 0; bottom: 96px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 13.5px; z-index: 120; animation: rise .22s ease-out; box-shadow: var(--shadow-lg); }

/* ---------- واکنش‌گرا ---------- */

@media (max-width: 860px) {
	.sidebar {
		position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 320px); margin-inline-start: 0 !important;
		transform: translateX(100%); box-shadow: none; border-inline-end: 0; visibility: hidden;
		transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s;
	}
	.app.side-open .sidebar { transform: none; box-shadow: var(--shadow-lg); visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
	.app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,10,12,.45); z-index: 30; animation: fade .18s; }
	.chips { grid-template-columns: 1fr; }
	.thread-inner { padding: 14px 14px 22px; }
	.msg .bubble { max-width: 92%; }
	.to-bottom { bottom: 112px; }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

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


/* ---------- پیوست فایل ---------- */

.composer { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 8px 8px 10px; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.attach-btn { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.attach-btn:hover { background: var(--hover); color: var(--text); }
.attach-btn svg { width: 21px; height: 21px; }

.attach-row { display: none; flex-wrap: wrap; gap: 8px; padding: 4px 4px 10px; }
.att-chip { position: relative; display: flex; align-items: center; gap: 10px; max-width: 260px; padding: 6px 8px 6px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); overflow: hidden; }
.att-chip.err { border-color: #d92d20; }
.att-chip.err .att-sub { color: #d92d20; }
.chip-thumb { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.chip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chip-ico svg { width: 22px; height: 22px; }
.att-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.att-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; direction: ltr; text-align: start; }
.att-sub { font-size: 11.5px; color: var(--muted); }
.chip-x { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--muted); background: var(--hover); }
.chip-x:hover { color: var(--text); background: var(--border); }
.chip-x svg { width: 12px; height: 12px; }
.chip-bar { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .15s; }

.msg.user .user-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 85%; min-width: 0; }
.msg.user .user-col .bubble { max-width: 100%; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-imglink { display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--hover); }
.att-img { display: block; max-width: min(320px, 70vw); max-height: 260px; object-fit: cover; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); text-decoration: none; max-width: 280px; }
.att-file:hover { background: var(--hover); }
.att-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.att-ico svg { width: 20px; height: 20px; }

.drop-hint { position: absolute; inset: 10px; z-index: 60; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--accent); border-radius: 24px; background: color-mix(in srgb, var(--bg) 88%, var(--accent)); color: var(--text); pointer-events: none; }
.drop-hint svg { width: 34px; height: 34px; color: var(--accent); }
.drop-hint span { color: var(--muted); font-size: 13px; }
.main.dragging .drop-hint { display: flex; }

.cb-actions { display: inline-flex; gap: 2px; }


/* ---------- کشوی تعویض محیط ---------- */

.ws-switch {
	position: relative; display: flex; direction: ltr; gap: 2px; padding: 3px; flex: none;
	border-radius: 99px; background: var(--hover); border: 1px solid var(--border);
}
.ws-thumb {
	position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 99px; z-index: 0;
	background: var(--bg-elev); box-shadow: 0 1px 5px rgba(0, 0, 0, .16), 0 0 0 1px var(--border);
	transition: transform .34s cubic-bezier(.3, .9, .3, 1), width .34s cubic-bezier(.3, .9, .3, 1);
}
.ws-switch button {
	position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px;
	font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--muted); line-height: 1.6; transition: color .2s;
}
.ws-switch button:hover { color: var(--text); }
.ws-switch button.on { color: var(--text); }
.ws-switch .ws-ico svg { width: 17px; height: 17px; }
.ws-switch button.on .ws-ico { color: var(--accent); }

@media (min-width: 1280px) {
	.ws-switch { position: absolute; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 1100px) {
	.ws-switch button { padding: 6px 10px; }
	.ws-switch button:not(.on) .ws-label { display: none; }
}

.model-btn .mb-logo svg { width: 18px; height: 18px; color: var(--accent); }
.menu { max-height: min(72vh, 520px); overflow-y: auto; }
.menu-group {
	display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; direction: ltr;
	font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted);
}
.menu-group:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; }
.menu-group .mg-ico svg { width: 14px; height: 14px; color: var(--accent); }

/* ---------- کاشی‌های Hub ---------- */

.fam-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 640px; margin-top: 22px; }
.fam-tile {
	display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico name" "ico model";
	column-gap: 12px; align-items: center; text-align: start; padding: 12px 14px; border-radius: 16px;
	border: 1px solid var(--border); background: var(--bg-elev);
	transition: border-color .15s, box-shadow .15s, transform .12s;
}
.fam-tile:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.fam-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.fam-tile .ft-ico { grid-area: ico; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fam-tile .ft-ico svg { width: 21px; height: 21px; }
.fam-tile .ft-name { grid-area: name; font-weight: 800; font-size: 13px; letter-spacing: .06em; direction: ltr; text-align: start; }
.fam-tile .ft-model { grid-area: model; font-size: 12px; color: var(--muted); direction: ltr; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
	.topbar { flex-wrap: wrap; padding: 8px 10px; row-gap: 2px; }
	.topbar > .icon-btn { order: 1; }
	.topbar > .ws-switch { order: 2; margin-inline: auto; }
	.topbar > .top-spacer { display: none; }
	.topbar > .top-right { order: 3; }
	.topbar > .model-picker { order: 4; flex-basis: 100%; }
	.fam-tiles { gap: 8px; margin-top: 18px; }
	.fam-tile { grid-template-columns: 1fr; grid-template-areas: "ico" "name" "model"; justify-items: center; text-align: center; row-gap: 2px; padding: 10px 6px; }
	.fam-tile .ft-name, .fam-tile .ft-model { text-align: center; max-width: 100%; }
	.fam-tile .ft-ico { margin-bottom: 4px; }
}


/* ---------- ساخت فایل و تصویر ---------- */

.msg .actions button.lbl { width: auto; padding: 0 9px 0 8px; gap: 5px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; direction: ltr; }
.msg .actions button.lbl svg { width: 15px; height: 15px; }

.img-btn.on { color: var(--accent); background: var(--accent-soft); }
.composer.img-mode { border-color: color-mix(in srgb, var(--accent) 55%, var(--composer-border)); }

.img-skel {
	width: min(340px, 80vw); aspect-ratio: 1 / 1; border-radius: 18px; display: grid; place-items: center; text-align: center; padding: 18px;
	font-size: 13px; color: var(--muted); line-height: 1.8;
	background: linear-gradient(110deg, var(--hover) 30%, color-mix(in srgb, var(--accent) 12%, var(--hover)) 50%, var(--hover) 70%);
	background-size: 220% 100%; animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.att-list.gen { margin-top: 10px; }
.gen-img { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.gen-img .att-img { max-width: min(420px, 82vw); max-height: 440px; }
.img-dl {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
	border: 1px solid var(--border); color: var(--text); text-decoration: none; background: var(--bg-elev);
}
.img-dl:hover { background: var(--hover); }
.img-dl svg { width: 15px; height: 15px; color: var(--accent); }

/* ---------- کارت فایل‌های Office ---------- */
.filecard { margin: 12px 0; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elev); overflow: hidden; max-width: 100%; }
.filecard .fc-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.filecard.building, .filecard.failed { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.filecard.failed { border-color: #c0392b66; }
.fc-ico { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font: 800 11px/1 system-ui, sans-serif; letter-spacing: .04em; color: #fff; }
.fc-ico.k-pptx { background: #d24726; }
.fc-ico.k-xlsx { background: #1d6f42; }
.fc-ico.k-docx { background: #2b579a; }
.fc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fc-meta b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta > span { font-size: 12px; color: var(--muted); }
.fc-bar { display: block; height: 5px; border-radius: 4px; background: linear-gradient(90deg, var(--border), var(--accent), var(--border)); background-size: 200% 100%; animation: fcshimmer 1.3s linear infinite; max-width: 220px; }
@keyframes fcshimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fc-btns { display: flex; gap: 6px; flex: none; }
.fc-dl { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-contrast); font: 700 12.5px/1 inherit; cursor: pointer; }
.fc-dl svg { width: 15px; height: 15px; }
.fc-dl.alt { background: var(--hover); color: var(--text); }
.fc-dl:hover { filter: brightness(1.08); }
.fc-preview { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--bg-side); }
.fc-slides { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; direction: ltr; }
.fc-slide { flex: none; width: 168px; aspect-ratio: 16 / 9; border-radius: 8px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); overflow: hidden; text-align: start; direction: rtl; }
.fc-slide b { font-size: 10.5px; line-height: 1.35; font-weight: 800; }
.fc-slide span { font-size: 8px; opacity: .85; }
.fc-slide i { display: block; height: 4px; border-radius: 3px; opacity: .55; width: 88%; }
.fc-slide i:nth-child(3) { width: 70%; } .fc-slide i:nth-child(4) { width: 80%; }
.fc-slide u { display: block; height: 30px; border: 1.5px solid; border-radius: 3px; opacity: .6; }
.fc-slide em { font-style: normal; font-weight: 800; font-size: 20px; }
.fc-more { flex: none; align-self: center; font-size: 12px; color: var(--muted); padding: 0 8px; }
.fc-sheet { overflow-x: auto; }
.fc-sheet table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.fc-sheet th, .fc-sheet td { border: 1px solid var(--border); padding: 5px 9px; text-align: start; white-space: nowrap; }
.fc-sheet th { background: #1d6f42; color: #fff; }
.fc-tabs { display: flex; gap: 6px; margin-top: 8px; }
.fc-tabs span { font-size: 11.5px; padding: 3px 10px; border-radius: 7px 7px 0 0; background: var(--hover); color: var(--muted); }
.fc-doc { max-height: 150px; overflow: hidden; font-size: 13px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fc-doc h1, .fc-doc h2, .fc-doc h3 { font-size: 15px; margin: 4px 0; }
@media (max-width: 560px) { .filecard .fc-top { flex-wrap: wrap; } .fc-btns { width: 100%; } .fc-dl { flex: 1; justify-content: center; } }
.fc-mchart { width: 100%; height: 62px; }
.fc-mchart svg { width: 100%; height: 100%; display: block; }
.fc-mchart.big { width: 150px; height: 80px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.fc-xcharts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fc-mimg { flex: 1; min-height: 28px; border-radius: 5px; opacity: .85; }
.fc-msteps { display: flex; gap: 4px; align-items: center; }
.fc-msteps span { width: 12px; height: 12px; border-radius: 50%; opacity: .8; }
.fc-badges { display: flex; gap: 6px; margin-top: 8px; }
.fc-badge { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.fc-dl:disabled { opacity: .7; cursor: progress; }

/* ---------- استودیوی Gamma ---------- */
.studio-mode .composer-wrap, .studio-mode .model-picker, .studio-mode .new-chat, .studio-mode .search, .studio-mode .conv-list { display: none; }
.studio-mode .sidebar { justify-content: space-between; }
.gm-wrap { max-width: 760px; margin-inline: auto; padding-bottom: 48px; }
.gm-card { width: 100%; text-align: start; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.gm-topic { width: 100%; resize: vertical; min-height: 110px; max-height: 360px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; line-height: 1.8; padding: 4px; }
.gm-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.gm-seg button { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 99px; padding: 8px 16px; cursor: pointer; font: inherit; font-size: 14px; }
.gm-seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.gm-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gm-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.gm-field select { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); padding: 9px 10px; font: inherit; font-size: 14px; }
.gm-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gm-quota { font-size: 13px; color: var(--muted); }
.gm-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 99px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--accent-soft); color: var(--accent); }
.gm-btn svg { width: 18px; height: 18px; }
.gm-btn.primary { background: var(--grad, var(--accent)); color: #fff; }
.gm-btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.gm-btn:disabled { opacity: .6; cursor: default; }
.gm-err { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: color-mix(in srgb, #e5484d 12%, transparent); color: var(--text); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.gm-list { width: 100%; text-align: start; margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.gm-h { font-size: 15px; margin: 0 0 4px; color: var(--muted); font-weight: 600; }
.gm-item { border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; background: var(--bg-elev); display: flex; flex-direction: column; gap: 10px; }
.gm-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.gm-item-top strong { font-size: 15px; line-height: 1.6; }
.gm-tag { font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
.gm-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gm-sub { font-size: 13px; color: var(--muted); }
.gm-sub.bad { color: #e5484d; }
.gm-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: gmspin .9s linear infinite; }
@keyframes gmspin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .gm-row { grid-template-columns: 1fr; } .gm-card { padding: 12px; } }

/* ---------- پیام ویژه‌ی کاربران پریمیوم ---------- */
.gm-card.locked { opacity: .55; pointer-events: none; filter: saturate(.7); }
.gm-lock { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--grad, var(--accent)); border-radius: 99px; padding: 10px 18px; box-shadow: 0 8px 24px rgba(109, 61, 245, .28); }
.gm-lock svg { width: 17px; height: 17px; }
.pm-box { position: relative; width: min(420px, 100%); border-radius: 28px; overflow: hidden; background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg); animation: pmin .28s cubic-bezier(.2, .9, .3, 1.2); text-align: center; }
@keyframes pmin { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.pm-hero { position: relative; height: 150px; display: grid; place-items: center; background: linear-gradient(135deg, #6d3df5 0%, #c13bd6 55%, #ff6b8b 100%); overflow: hidden; }
.pm-orb { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.pm-orb.a { width: 190px; height: 190px; top: -70px; inset-inline-start: -50px; }
.pm-orb.b { width: 120px; height: 120px; bottom: -50px; inset-inline-end: -20px; background: rgba(255, 255, 255, .12); }
.pm-crown { position: relative; width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(60, 10, 120, .35); }
.pm-crown svg { width: 40px; height: 40px; }
.pm-badge { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 11px; letter-spacing: .22em; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .22); border-radius: 99px; padding: 3px 12px; }
.pm-body { padding: 24px 24px 22px; }
.pm-body h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; line-height: 1.6; }
.pm-body p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.pm-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: start; }
.pm-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.7; }
.pm-list svg { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 50%; color: #fff; background: var(--grad, var(--accent)); margin-top: 2px; }
.pm-actions { display: flex; flex-direction: column; gap: 10px; }
.pm-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; border: 1px solid transparent; border-radius: 16px; padding: 13px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pm-btn svg { width: 18px; height: 18px; }
.pm-btn.primary { color: #fff; background: linear-gradient(135deg, #6d3df5, #c13bd6 60%, #ff6b8b); box-shadow: 0 10px 26px rgba(109, 61, 245, .35); }
.pm-btn.primary:hover { filter: brightness(1.06); }
.pm-btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.pm-btn.ghost:hover { background: var(--hover); }
.pm-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(0, 0, 0, .22); }
.pm-x svg { width: 16px; height: 16px; }

/* ---------- حالت خودکار ---------- */
.auto-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 8px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.auto-tag b { font-weight: 700; }
.auto-tag span::after { content: " ←"; }

/* ---------- مقایسه‌ی مدل‌ها ---------- */
.cmp-box { width: min(1180px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column; background: var(--bg); color: var(--text); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pmin .25s ease-out; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cmp-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.cmp-title svg { width: 22px; height: 22px; color: var(--accent); }
.cmp-scroll { overflow: auto; padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.cmp-chip .cc-ico svg { width: 16px; height: 16px; display: block; }
.cmp-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.cmp-chip:disabled { opacity: .6; cursor: default; }
.cmp-q { width: 100%; resize: vertical; min-height: 78px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elev); color: var(--text); font: inherit; font-size: 15px; line-height: 1.8; padding: 12px 14px; outline: 0; }
.cmp-q:focus { border-color: var(--accent); }
.cmp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmp-note { font-size: 12px; color: var(--muted); }
.cmp-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cmp-grid.n2 { grid-template-columns: repeat(2, 1fr); } .cmp-grid.n3 { grid-template-columns: repeat(3, 1fr); } }
.cmp-col { border: 1px solid var(--border); border-radius: 18px; background: var(--bg-elev); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.cmp-col.win { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.cmp-col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.cmp-status { font-size: 12px; color: var(--muted); }
.cmp-status.ok { color: #1a9a52; } .cmp-status.bad { color: #e5484d; }
.cmp-body { padding: 12px 14px; font-size: 14px; max-height: 46vh; overflow: auto; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.cmp-actions .gm-btn { padding: 7px 12px; font-size: 13px; }
.cmp-judge { border: 1px solid var(--accent); border-radius: 18px; background: var(--accent-soft); padding: 12px 16px; }
.cmp-judge-h { font-weight: 800; font-size: 14px; margin-bottom: 6px; color: var(--accent); }
.attach-btn.cmp-open svg { width: 20px; height: 20px; }

/* ---------- پروژه‌ها ---------- */
.proj-box { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.amirai-theme-flow .proj-box { display: none; }
.gm-proj { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.gm-proj svg { width: 16px; height: 16px; }
.fl-lib { display: flex; flex-direction: column; gap: 1px; padding-inline-start: 8px; }
.fl-lib button { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: #cfcfcf; font: 500 13px/1.2 inherit; font-family: inherit; text-align: start; cursor: pointer; }
.fl-lib button svg { width: 16px; height: 16px; flex: none; }
.fl-lib button:hover { background: #141414; }
.fl-lib .fl-empty-lib { padding: 6px 12px; color: #777; font-size: 12px; }
.proj-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.proj-head button { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.proj-head button:hover { background: var(--hover); color: var(--text); }
.proj-head svg { width: 15px; height: 15px; }
.proj-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: start; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 14px; }
.proj-item:hover { background: var(--hover); }
.proj-item .pi-ico svg { width: 17px; height: 17px; color: var(--accent); display: block; }
.proj-item .pi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-empty { padding: 6px 10px 8px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.proj-cur { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; background: var(--hover); }
.proj-cur button { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); flex: none; }
.proj-cur button:hover { background: var(--border); }
.proj-cur svg { width: 17px; height: 17px; }
.proj-cur-name { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; }
.proj-cur-name span { display: flex; }
.proj-cur-name svg { color: var(--accent); }
.proj-cur-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-sub { padding: 4px 12px 2px; font-size: 12px; color: var(--muted); }
.pj-modal { max-height: 90vh; overflow: auto; text-align: start; }
.pj-l { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 600; }
.pj-ins { width: 100%; resize: vertical; min-height: 110px; line-height: 1.8; direction: rtl; font-size: 14px; letter-spacing: 0; }
.pj-files { display: flex; flex-direction: column; gap: 6px; }
.pj-file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 7px 10px; font-size: 13px; }
.pj-file svg { width: 16px; height: 16px; flex: none; color: var(--muted); display: block; }
.pj-fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-file button { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.pj-file button:hover { background: var(--hover); color: var(--text); }
.pj-none { font-size: 12.5px; color: var(--muted); }
.pj-busy { font-size: 12.5px; color: var(--accent); margin-top: 6px; }
.modal .btn.danger { background: transparent; color: #e5484d; border: 1px solid rgba(229,72,77,.4); }
.pj-modal .field { text-align: start; }

.bot-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.bot-btn:hover { background: var(--hover); color: var(--text); }
.bot-btn svg { width: 16px; height: 16px; flex: none; }
.bot-row { border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.bot-name { display: flex; justify-content: space-between; align-items: center; }
.bot-st { font-size: 12px; color: var(--muted); }
.bot-st.on { color: #15803d; font-weight: 600; }
.bot-act { display: flex; flex-direction: column; gap: 8px; }
.bot-act .btn { text-align: center; text-decoration: none; }
.bot-code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; padding: 9px 12px; border-radius: 10px; background: var(--hover); text-align: center; user-select: all; }

/* ---------- پیشرفت ساخت فایل و بازی مارپله ---------- */
.fc-slot { display: block; }
.filecard.building { flex-wrap: wrap; }
.filecard.building .fc-meta { flex: 1; min-width: 180px; }
.fc-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fc-track { position: relative; flex: 1; max-width: 260px; height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; }
.fc-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); transition: width .7s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.fc-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: fcsweep 1.4s ease-in-out infinite; }
@keyframes fcsweep { to { transform: translateX(100%); } }
.fc-pct { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; min-width: 38px; color: var(--accent); direction: ltr; }
.fc-stage { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.fc-play { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fc-play:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.img-skel .fc-play { margin-inline-start: 10px; }

.gdock { position: fixed; z-index: 90; inset-inline-end: 18px; bottom: 96px; width: 360px; max-width: calc(100vw - 24px); display: none; flex-direction: column; gap: 8px; padding: 12px; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .2s ease-out; direction: rtl; }
.gdock.show { display: flex; }
.g-head { display: flex; align-items: center; gap: 10px; }
.g-head b { font-size: 15px; }
.g-prog { flex: 1; display: flex; align-items: center; gap: 8px; }
.g-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; display: block; }
.g-bar u { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .5s; text-decoration: none; }
.g-pct { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); min-width: 34px; direction: ltr; text-align: end; }
.g-x { width: 28px; height: 28px; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--muted); }
.g-x:hover { background: var(--hover); color: var(--text); }
.g-task { font-size: 12.5px; color: var(--muted); }
.g-task.ok { color: #15803d; font-weight: 600; }
.g-board { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; direction: ltr; background: var(--bg); }
.g-board .sq.a { fill: color-mix(in srgb, var(--accent) 10%, var(--bg-elev)); }
.g-board .sq.b { fill: color-mix(in srgb, var(--accent) 3%, var(--bg-elev)); }
.g-board .num { font-size: 9px; fill: var(--muted); font-family: "Vazirmatn", system-ui, sans-serif; }
.g-board .rail { stroke: #b98b4a; stroke-width: 3; stroke-linecap: round; }
.g-board .rung { stroke: #d4a862; stroke-width: 2.4; stroke-linecap: round; }
.g-board .snake { fill: none; stroke-width: 7; stroke-linecap: round; opacity: .9; }
.g-board .snake.s0 { stroke: #e5484d; } .g-board .snake.s1 { stroke: #7c5cff; } .g-board .snake.s2 { stroke: #16a34a; }
.g-board .shead.s0 { fill: #e5484d; } .g-board .shead.s1 { fill: #7c5cff; } .g-board .shead.s2 { fill: #16a34a; }
.g-board .tok { stroke: #fff; stroke-width: 2.5; transition: transform .22s ease-out; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.g-board .tok.me { fill: #f97316; } .g-board .tok.cpu { fill: #3b82f6; }
.g-msg { min-height: 22px; font-size: 13.5px; text-align: center; font-weight: 600; }
.g-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; }
.g-die { font-size: 44px; line-height: 1; }
.g-die.rolling { animation: gdie .14s linear infinite; }
@keyframes gdie { 50% { transform: rotate(18deg) scale(1.1); } }
.g-roll { padding: 10px 22px; border-radius: 99px; font-weight: 700; background: var(--accent); color: var(--accent-contrast); }
.g-roll[disabled] { opacity: .5; }
@media (max-width: 700px) { .gdock { inset-inline: 8px; bottom: 82px; width: auto; max-height: 72vh; } }

/* ---------- عملیات روی پیام کاربر: ارسال دوباره، ویرایش، کپی ---------- */
.msg.user .user-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.u-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.msg.user:hover .u-actions, .msg.user:focus-within .u-actions { opacity: 1; }
.u-actions button { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.u-actions button:hover { background: var(--hover); color: var(--text); }
.u-actions svg { width: 15px; height: 15px; }
@media (hover: none) { .u-actions { opacity: 1; } }
.u-editbox { width: min(640px, 100%); border: 1px solid var(--border); background: var(--bg-elev); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.u-edit { width: 100%; resize: none; border: 0; outline: none; background: transparent; line-height: 1.7; font-size: 15px; min-height: 70px; }
.u-editrow { display: flex; gap: 8px; justify-content: flex-end; }
.u-editrow .btn { padding: 7px 16px; font-size: 13.5px; }
.amirai-theme-claude .msg.user .user-col { align-items: flex-end; }

/* انتخاب بازی و بازی مار */
.g-tabs { display: flex; gap: 6px; }
.g-tab { flex: 1; padding: 7px 10px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.g-tab.on { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.sn-hud { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding-bottom: 6px; }
.sn-wrap { position: relative; border-radius: 12px; overflow: hidden; direction: ltr; }
.sn-cv { display: block; width: 100%; aspect-ratio: 1; touch-action: none; background: #223328; }
.sn-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(5, 20, 10, .66); color: #fff; text-align: center; padding: 16px; direction: rtl; }
.sn-ov.hide { display: none; }
.sn-ov b { font-size: 20px; } .sn-ov span { font-size: 12.5px; opacity: .85; }
.sn-ov button { margin-top: 6px; padding: 9px 26px; border-radius: 99px; border: 0; background: #22c55e; color: #052e16; font-weight: 800; font-size: 14px; cursor: pointer; }
.sn-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-areas: ". up ." "left . right" ". down ."; gap: 6px; justify-content: center; padding-top: 10px; direction: ltr; }
.sn-pad button { height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 16px; cursor: pointer; }
.sn-pad button:active { background: var(--accent); color: var(--accent-contrast); }
.sn-pad button:nth-child(1) { grid-area: up; } .sn-pad button:nth-child(2) { grid-area: left; } .sn-pad button:nth-child(3) { grid-area: right; } .sn-pad button:nth-child(4) { grid-area: down; }
@media (hover: hover) and (pointer: fine) { .sn-pad { display: none; } }

/* درصد روی خود تصویر در حال ساخت */
.img-skel { position: relative; }
.img-skel .is-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(34px, 9vw, 64px); font-weight: 800; letter-spacing: -.02em; color: var(--text); opacity: .85; pointer-events: none; text-shadow: 0 2px 20px var(--bg); }
.img-skel .is-bar { position: absolute; inset-inline: 0; bottom: 0; height: 5px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.img-skel .is-bar i { display: block; height: 100%; width: 0; background: var(--grad, var(--accent)); border-radius: 0 3px 3px 0; transition: width .9s ease; }

.img-skel .is-foot { position: absolute; inset-inline: 10px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.img-skel { overflow: hidden; }
@media (max-width: 700px) {
	.gdock { overflow-y: auto; max-height: 80vh; }
	.sn-wrap { width: min(100%, 46vh); margin-inline: auto; }
	.sn-pad { grid-template-columns: repeat(4, 1fr); grid-template-areas: none; gap: 8px; padding-top: 8px; }
	.sn-pad button { grid-area: auto !important; height: 40px; }
	.sn-pad button:nth-child(1) { order: 2; } .sn-pad button:nth-child(2) { order: 1; } .sn-pad button:nth-child(3) { order: 4; } .sn-pad button:nth-child(4) { order: 3; }
}

/* انتقال گفتگو/پروژه به محیط دیگر */
.mv-box { max-width: 420px; }
.mv-note { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.mv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mv-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); color: var(--text); cursor: pointer; text-align: start; font-family: inherit; }
.mv-item:hover { background: var(--hover); border-color: var(--accent); }
.mv-ico svg { width: 24px; height: 24px; color: var(--accent); display: block; }
.mv-txt { display: flex; flex-direction: column; gap: 2px; }
.mv-txt b { font-size: 14.5px; } .mv-txt small { color: var(--muted); font-size: 12px; }

.top-move { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.top-move svg { width: 16px; height: 16px; }
.top-move:hover { background: var(--hover); }
@media (max-width: 700px) { .top-move span { display: none; } .top-move { padding: 8px; } }

/* مهارت‌ها */
.skill-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 2px 6px 4px; padding: 5px 6px 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--text); font-size: 12.5px; font-weight: 600; max-width: 100%; }
.skill-chip .sc-ico svg { width: 15px; height: 15px; display: block; color: var(--accent); }
.skill-chip .sc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.skill-chip button svg { width: 12px; height: 12px; }
.skill-chip button:hover { background: var(--hover); }
.sk-open.on { color: var(--accent); }
.composer { position: relative; }
.sk-menu { position: absolute; inset-inline: 8px; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; }
.sk-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: start; cursor: pointer; font-family: inherit; }
.sk-item.on, .sk-item:hover { background: var(--hover); }
.sk-i svg { width: 18px; height: 18px; color: var(--accent); display: block; }
.sk-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sk-t b, .sk-item > b { font-size: 14px; } .sk-t small, .sk-item > small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-t em, .sk-meta em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-inline-start: 6px; }
.sk-box { max-width: 520px; width: calc(100vw - 32px); max-height: 86vh; overflow-y: auto; }
.sk-box .field { width: 100%; margin-bottom: 10px; box-sizing: border-box; }
.sk-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); }
.sk-row.sample { border-style: dashed; }
.sk-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sk-meta b { font-size: 14.5px; } .sk-meta small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.sk-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.btn.sm { padding: 6px 14px; font-size: 12.5px; }
.sk-quota { color: var(--muted); font-size: 12.5px; padding-bottom: 8px; }
.sk-global { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 12px; }

.sk-title { display: flex; align-items: center; gap: 6px; }
.sk-box .btn svg { width: 16px; height: 16px; flex: none; }
.sk-box .row { display: flex; gap: 10px; margin-top: 4px; }
.sk-box .row .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 99px; }
.sk-box .sk-acts .btn { flex: none; }
.sk-box .icon-btn { width: 32px; height: 32px; } .sk-box .icon-btn svg { width: 16px; height: 16px; }

/* میزگرد */
.rt-box { max-width: 900px; }
.rt-setup { display: flex; flex-direction: column; gap: 8px; }
.rt-row { display: flex; align-items: center; gap: 8px; }
.rt-row select, .rt-rounds select { flex: 1; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-family: inherit; font-size: 14px; }
.rt-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12px; flex: none; }
.rt-ctr { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-rounds { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rt-rounds select { flex: none; padding: 7px 12px; }
.rt-seats { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 14px 0 6px; }
.rt-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-elev); transition: transform .25s, box-shadow .25s, border-color .25s; }
.rt-seat b { font-size: 13.5px; } .rt-seat small { color: var(--muted); font-size: 11.5px; }
.rt-seat.on { transform: translateY(-4px) scale(1.05); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.rt-ava { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.rt-ava svg { width: 24px; height: 24px; }
.rt-ava.sm { width: 34px; height: 34px; flex: none; } .rt-ava.sm svg { width: 18px; height: 18px; }
.rt-prog { position: relative; height: 22px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.rt-prog i { display: block; height: 100%; width: 0; background: var(--grad, var(--accent)); transition: width .5s ease; }
.rt-prog span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; }
.rt-feed { display: flex; flex-direction: column; gap: 12px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; }
.rt-msg { display: flex; gap: 10px; align-items: flex-start; }
.rt-body { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 16px; background: var(--hover); }
.rt-msg.c1 .rt-body { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.rt-msg.c2 .rt-body { background: color-mix(in srgb, #f59e0b 12%, var(--bg)); }
.rt-msg.c3 .rt-body { background: color-mix(in srgb, #10b981 12%, var(--bg)); }
.rt-who { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.rt-text { font-size: 14.5px; line-height: 1.9; }
.rt-mod { border: 1px solid var(--accent); border-radius: 16px; padding: 14px 16px; background: var(--accent-soft); }
.rt-mod-h { font-weight: 800; font-size: 14px; margin-bottom: 8px; color: var(--accent); }
.rt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.rt-feed { max-height: none; overflow: visible; }
.rt-run .rt-setup, .rt-run .cmp-q, .rt-run .cmp-note, .rt-run .rt-topic-gap { display: none; }
.rt-run .rt-seats { padding-top: 4px; }

/* بوم زنده */
.cb-live { color: var(--accent); font-weight: 700; }
.canvas-panel { width: min(48%, 760px); flex: none; display: flex; flex-direction: column; background: var(--bg-elev); border-inline-start: 1px solid var(--border); min-width: 0; direction: rtl; }
.cv-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cv-title { flex: 1; min-width: 80px; font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-tabs { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--hover); }
.cv-tabs button { padding: 5px 14px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font: 700 12.5px/1.4 inherit; font-family: inherit; cursor: pointer; }
.cv-tabs button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.cv-ver { padding: 5px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-family: inherit; font-size: 12px; }
.cv-stage { flex: 1; min-height: 0; display: flex; justify-content: center; background: repeating-conic-gradient(var(--hover) 0 25%, transparent 0 50%) 0 0 / 18px 18px; overflow: auto; }
.cv-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.cv-frame.mobile { width: 390px; max-width: 100%; margin: 14px 0; height: calc(100% - 28px); border-radius: 22px; box-shadow: 0 0 0 8px #1c1c20, var(--shadow-lg); }
.cv-code { flex: 1; margin: 0; padding: 14px; overflow: auto; background: var(--code-bg); color: var(--code-text); font-size: 12.5px; line-height: 1.7; direction: ltr; text-align: left; white-space: pre; }
.cv-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cv-foot .btn { display: inline-flex; align-items: center; gap: 6px; } .cv-foot .btn svg { width: 15px; height: 15px; }
.cv-hint { color: var(--muted); font-size: 11.5px; flex: 1; min-width: 160px; }
.cv-share { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--accent-soft); }
.cv-share input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); direction: ltr; font-size: 12px; }
@media (max-width: 900px) { .canvas-panel { position: fixed; inset: 0; width: auto; z-index: 85; } .app.canvas-open .main { display: none; } }
.cb-actions button, .cb-live span { white-space: nowrap; }
.cb-actions { flex-wrap: wrap; }
.cv-title { flex: 1 1 100px; }
.cv-tabs, .cv-head .icon-btn { flex: none; }
.cv-head .icon-btn { width: 32px; height: 32px; }
.cv-title { flex: 1 1 100%; order: -1; }
.cv-head .icon-btn:last-child { margin-inline-start: auto; }
.app.canvas-open .ws-switch { display: none; }

/* پادکست */
.pd-box { width: min(640px, 94vw); max-height: 90vh; overflow: auto; text-align: right; }
.pd-head { display: flex; align-items: center; justify-content: space-between; }
.pd-sub { color: var(--muted); font-size: 12.5px; line-height: 1.9; margin: 4px 0 10px; }
.pd-src { width: 100%; min-height: 120px; resize: vertical; }
.pd-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pd-status { margin: 10px 0 4px; }
.pd-feed { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 38vh; overflow: auto; }
.pd-line { padding: 9px 12px; border-radius: 14px; border: 1px solid var(--border); font-size: 13.5px; line-height: 1.9; cursor: pointer; display: flex; flex-direction: column; gap: 2px; opacity: .6; transition: opacity .2s, box-shadow .2s; }
.pd-line b { font-size: 11px; color: var(--muted); }
.pd-line.a { background: var(--accent-soft); margin-inline-end: 28px; }
.pd-line.b { background: var(--hover); margin-inline-start: 28px; }
.pd-line.ready { opacity: 1; }
.pd-line.busy { opacity: 1; animation: pdp 1s infinite alternate; }
.pd-line.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
@keyframes pdp { to { opacity: .55; } }
.pd-player { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.rs-box .rs-state { color: var(--accent); font-size: 13px; margin: 8px 0; min-height: 4px; }

/* مغز دوم */
.mm-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 40vh; overflow: auto; }
.mm-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--hover); }
.mm-t { flex: 1; font-size: 13.5px; line-height: 1.8; }
.mm-src { font-size: 10.5px; color: var(--muted); padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); white-space: nowrap; }
.mm-item .icon-btn { width: 30px; height: 30px; flex: none; }
.pd-row .field { flex: 1; min-width: 160px; }

/* گفتگوی صوتی */
.vc-box { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: radial-gradient(120% 90% at 50% 20%, var(--accent-soft), var(--bg) 70%); color: var(--text); overflow: auto; }
.vc-x { position: absolute; top: 14px; inset-inline-start: 14px; }
.vc-title { font-weight: 800; font-size: 15px; color: var(--muted); }
.vc-orb { position: relative; width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #14b8a6); box-shadow: 0 10px 40px rgba(80, 70, 230, .35); transition: transform .2s; }
.vc-orb span { position: relative; z-index: 2; } .vc-orb span svg { width: 46px; height: 46px; }
.vc-orb i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.vc-orb:active { transform: scale(.95); }
.vc-orb.listening i { animation: vcr 1.8s infinite; } .vc-orb.listening i:nth-child(2) { animation-delay: .6s; } .vc-orb.listening i:nth-child(3) { animation-delay: 1.2s; }
.vc-orb.speaking { animation: vcb .9s infinite alternate ease-in-out; }
.vc-orb.thinking { animation: vcs 1.2s infinite linear; filter: saturate(.7); }
.vc-orb.idle { filter: grayscale(.35); }
@keyframes vcr { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes vcb { to { transform: scale(1.1); box-shadow: 0 10px 60px rgba(20, 184, 166, .5); } }
@keyframes vcs { to { transform: rotate(360deg); } }
.vc-st { font-size: 13.5px; color: var(--muted); min-height: 22px; }
.vc-you { min-height: 28px; max-width: 560px; font-size: 16px; font-weight: 700; line-height: 1.9; }
.vc-bot { max-width: 620px; font-size: 15px; line-height: 2; color: var(--text); opacity: .85; max-height: 26vh; overflow: auto; }
.vc-left { font-size: 11.5px; color: var(--muted); }
.vc-end { margin-top: 6px; }

/* پژوهش عمیق */
.rs-box { width: min(760px, 95vw); }
.rs-map { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rs-root { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), #14b8a6); color: #fff; font-size: 13.5px; line-height: 1.8; }
.rs-root svg { width: 18px; height: 18px; flex: none; }
.rs-branch { margin-inline-start: 18px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--hover); position: relative; }
.rs-branch::before { content: ''; position: absolute; inset-inline-end: -12px; top: 18px; width: 12px; border-top: 2px solid var(--border); }
.rs-branch.run { border-color: var(--accent); animation: pdp 1s infinite alternate; }
.rs-bq { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rs-bq svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.rs-bq b { flex: 1; font-weight: 700; direction: auto; }
.rs-bst { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rs-chip { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); text-decoration: none; direction: ltr; animation: rsin .35s both; }
@keyframes rsin { from { opacity: 0; transform: translateY(4px); } }
.rs-report { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; max-height: 50vh; overflow: auto; }
.rs-report sup a { color: var(--accent); font-weight: 700; text-decoration: none; padding: 0 2px; }
.rs-src { margin-top: 12px; } .rs-src h4 { margin: 0 0 6px; font-size: 13px; }
.rs-s { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 3px 0; }
.rs-s a { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-s small { color: var(--muted); direction: ltr; }

/* ===== کیف پول و درگاه پرداخت ===== */
.wl-sb small { margin-inline-start: auto; font-size: 11px; color: var(--accent); font-weight: 800; }
.wl-box { width: min(560px, 96vw); max-height: 92vh; overflow: auto; padding: 18px 18px 22px; text-align: right; }
.wl-card { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 20px 16px; color: #fff; margin: 4px 0 14px; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #0ea5e9 100%); box-shadow: 0 18px 40px -12px rgba(79, 70, 229, .55); }
.wl-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.18), transparent 40%); pointer-events: none; }
.wl-orb { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .55; }
.wl-orb.a { width: 150px; height: 150px; background: #22d3ee; top: -60px; inset-inline-start: -40px; }
.wl-orb.b { width: 130px; height: 130px; background: #f0abfc; bottom: -60px; inset-inline-end: -30px; }
.wl-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); font-size: 12px; font-weight: 700; }
.wl-chip svg { width: 16px; height: 16px; }
.wl-plan { font-size: 11.5px; font-weight: 800; padding: 4px 12px; border-radius: 99px; background: rgba(0,0,0,.22); }
.wl-bal { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; margin: 14px 0 12px; }
.wl-bal b { font-size: 36px; font-weight: 900; letter-spacing: -.5px; line-height: 1.2; }
.wl-bal span { font-size: 13px; opacity: .85; }
.wl-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wl-stats > div { padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 1px; }
.wl-stats b { font-size: 15px; } .wl-stats small { font-size: 10.5px; opacity: .8; }
.wl-meter { position: relative; z-index: 1; height: 5px; border-radius: 9px; background: rgba(255,255,255,.22); margin-top: 12px; overflow: hidden; }
.wl-meter i { display: block; height: 100%; border-radius: 9px; background: #fff; }
.wl-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--hover); margin-bottom: 14px; }
.wl-tabs button { flex: 1; padding: 9px 6px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: 700 13px/1.4 inherit; font-family: inherit; cursor: pointer; transition: .2s; }
.wl-tabs button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.wl-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wl-pc { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--bg-elev); }
.wl-pc.hot { border-color: transparent; background: linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box, linear-gradient(135deg, #7c3aed, #0ea5e9) border-box; box-shadow: 0 12px 30px -14px rgba(124,58,237,.6); }
.wl-pc.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-ribbon { position: absolute; top: -9px; inset-inline-start: 12px; font-size: 10.5px; font-weight: 800; color: #fff; padding: 2px 10px; border-radius: 99px; background: linear-gradient(135deg, #7c3aed, #0ea5e9); }
.wl-pn { font-weight: 900; font-size: 15px; }
.wl-pp { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; } .wl-pp b { font-size: 21px; } .wl-pp span { font-size: 11px; color: var(--muted); }
.wl-pc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.wl-pc li { font-size: 12.3px; line-height: 1.7; color: var(--text); padding-inline-start: 18px; position: relative; }
.wl-pc li::before { content: ''; position: absolute; inset-inline-start: 0; top: 8px; width: 9px; height: 5px; border-inline-start: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.wl-cur { font-size: 12px; font-weight: 800; color: var(--accent); min-height: 18px; }
.wl-buy, .wl-pay { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border: 0; border-radius: 14px; color: #fff; font: 800 14px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; background: linear-gradient(135deg, #5b4ff0, #0ea5e9); box-shadow: 0 10px 24px -10px rgba(79,70,229,.7); transition: transform .15s, filter .15s; }
.wl-buy:hover, .wl-pay:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.wl-pay { width: 100%; margin-top: 14px; padding: 15px; font-size: 15px; }
.wl-pay:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.wl-pay svg { width: 17px; height: 17px; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wl-chip2 { padding: 10px 16px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--bg-elev); color: var(--text); font: 800 13.5px/1 inherit; font-family: inherit; cursor: pointer; transition: .15s; }
.wl-chip2:hover { border-color: var(--accent); } .wl-chip2.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.wl-amt { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--bg-elev); color: var(--text); font: 800 18px/1 inherit; font-family: inherit; direction: ltr; text-align: center; box-sizing: border-box; }
.wl-amt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.wl-hint { text-align: center; color: var(--muted); font-size: 12.5px; min-height: 22px; margin-top: 6px; }
.wl-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 12.3px; line-height: 1.9; }
.wl-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font: 700 12.5px/1 inherit; font-family: inherit; cursor: pointer; padding: 6px 0; margin-bottom: 8px; }
.wl-back svg { width: 15px; height: 15px; transform: scaleX(-1); }
.wl-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--hover); border: 1px solid var(--border); }
.wl-sum small { display: block; color: var(--muted); font-size: 11.5px; } .wl-sum b { font-size: 14.5px; }
.wl-sum-p { display: flex; align-items: baseline; gap: 5px; } .wl-sum-p b { font-size: 22px; color: var(--accent); } .wl-sum-p span { font-size: 11.5px; color: var(--muted); }
.wl-co h4 { margin: 16px 2px 8px; font-size: 13px; }
.wl-gws { display: flex; flex-direction: column; gap: 8px; }
.wl-gw { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--bg-elev); color: var(--text); text-align: right; cursor: pointer; font-family: inherit; transition: .15s; }
.wl-gw:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.wl-gw.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.wl-gw:disabled { opacity: .5; cursor: not-allowed; }
.wl-gb { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; font: 900 18px/1 inherit; flex: none; box-shadow: 0 6px 14px -6px rgba(0,0,0,.4); }
.wl-gb svg { width: 21px; height: 21px; }
.wl-gt { flex: 1; display: flex; flex-direction: column; gap: 2px; } .wl-gt b { font-size: 14px; } .wl-gt small { font-size: 11.5px; color: var(--muted); }
.wl-rad { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex: none; position: relative; }
.wl-gw.on .wl-rad { border-color: var(--accent); } .wl-gw.on .wl-rad::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.wl-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 11.5px; } .wl-secure svg { width: 14px; height: 14px; }
.wl-cc { position: relative; overflow: hidden; border-radius: 20px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #1f2937, #4c1d95 60%, #6d28d9); box-shadow: 0 16px 34px -14px rgba(76,29,149,.7); min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 14px; }
.wl-cc-b { font-weight: 800; opacity: .9; } .wl-cc-n { font: 800 21px/1.3 'Courier New', monospace; letter-spacing: 2px; text-align: left; margin: 14px 0 8px; position: relative; z-index: 1; } .wl-cc-h { font-size: 13px; opacity: .9; position: relative; z-index: 1; }
.wl-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wl-steps > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 13px; background: var(--hover); font-size: 13px; }
.wl-steps b { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }
.wl-steps strong { color: var(--accent); }
.wl-copy { margin-inline-start: auto; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 99px; padding: 5px 12px; font: 700 11.5px/1 inherit; font-family: inherit; cursor: pointer; }
.wl-co .field { margin-top: 8px; width: 100%; box-sizing: border-box; }
.wl-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 6px 8px; }
.wl-center h3 { margin: 8px 0 0; font-size: 18px; }
.wl-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: vcs 1s linear infinite; margin: 20px auto; }
.wl-done { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 14px 34px -10px rgba(34,197,94,.7); animation: wlpop .5s cubic-bezier(.2,1.4,.4,1) both; }
.wl-done.wait { background: linear-gradient(135deg, #f59e0b, #ea580c); box-shadow: 0 14px 34px -10px rgba(245,158,11,.7); } .wl-done.bad { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 14px 34px -10px rgba(239,68,68,.7); }
.wl-done svg { width: 42px; height: 42px; }
@keyframes wlpop { from { transform: scale(.3); opacity: 0; } }
.wl-hist { display: flex; flex-direction: column; gap: 8px; } .wl-hist h4 { margin: 10px 2px 2px; font-size: 13px; }
.wl-tx { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elev); }
.wl-tx > div:first-child { display: flex; flex-direction: column; gap: 2px; } .wl-tx small { color: var(--muted); font-size: 11.5px; }
.wl-amt2 { font-weight: 900; font-size: 14.5px; } .wl-amt2.pos { color: #16a34a; } .wl-amt2.neg { color: #dc2626; }
.wl-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .wl-plans { grid-template-columns: 1fr; } .wl-box { padding: 14px; } .wl-bal b { font-size: 30px; } }
.modal.wl-box { max-width: 580px; width: min(580px, 96vw); }
.wl-pc li { font-size: 12px; }

/* ---------- مربی گفتار ---------- */
.vc-timer { font-size: 13px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.co-pg { position: absolute; inset: 0; z-index: 30; background: var(--bg); overflow: auto; padding: 22px 16px 56px; }
.co-pg-in { max-width: 760px; margin: 0 auto; }
.co-box { text-align: right; }
.co-back { margin-bottom: 8px; }
.co-box .m-logo { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 17px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.co-box .m-logo svg { width: 29px; height: 29px; }
.co-box > p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.co-box h3 { margin: 4px 0 6px; text-align: center; }
.co-box > p { text-align: center; }
.co-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.co-card { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: right; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elev); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.co-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.co-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.co-card b { font-size: 13.5px; }
.co-card small { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.co-card em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); margin-top: auto; }
.co-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.co-card.on .co-ic { background: var(--accent); color: #fff; }
.co-ic svg { width: 18px; height: 18px; }
.co-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.co-seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--hover); gap: 2px; }
.co-seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 16px; border-radius: 99px; cursor: pointer; }
.co-seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.co-lbl { display: block; font-size: 13px; color: var(--muted); margin: 6px 0; }
.co-go { width: 100%; justify-content: center; margin: 12px 0 8px; }
.co-prog { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.co-prog:empty { display: none; }
.co-ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.co-ph b { display: block; font-size: 14px; }
.co-ph small { color: var(--muted); font-size: 12px; }
.co-spark { width: 120px; height: 34px; color: var(--accent); }
.co-hist { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: right; }
.co-hist:hover { background: var(--hover); }
.co-hist .co-ht { flex: 1; font-size: 13.5px; font-weight: 600; }
.co-hist small { color: var(--muted); font-size: 11.5px; }
.co-mini { min-width: 36px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; font-size: 13px; color: #fff; }
.co-mini.good, .co-track i.good { background: #16a34a; }
.co-mini.mid, .co-track i.mid { background: #d97706; }
.co-mini.low, .co-track i.low { background: #dc2626; }
.co-top { display: flex; gap: 18px; align-items: center; margin: 8px 0 16px; }
.co-top-t { flex: 1; }
.co-top-t h3 { text-align: right; margin: 0 0 6px; }
.co-sum { font-size: 14px; line-height: 1.95; color: var(--text); }
.co-delta { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.co-delta.up { background: color-mix(in srgb, #16a34a 16%, transparent); color: #16a34a; }
.co-delta.down { background: color-mix(in srgb, #dc2626 14%, transparent); color: #dc2626; }
.co-ring { --c: #16a34a; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--bg-elev) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--hover) 0); }
.co-ring.mid { --c: #d97706; } .co-ring.low { --c: #dc2626; }
.co-ring b { font-size: 34px; line-height: 1; }
.co-ring small { font-size: 11px; color: var(--muted); }
.co-bars { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.co-bar { display: grid; grid-template-columns: 112px 1fr 32px; gap: 10px; align-items: center; font-size: 13px; }
.co-bar b { text-align: left; font-size: 13px; }
.co-track { height: 9px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.co-track i { display: block; height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.co-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.co-chipst { padding: 9px 4px; border-radius: 14px; background: var(--hover); text-align: center; }
.co-chipst b { display: block; font-size: 16px; }
.co-chipst small { font-size: 10.5px; color: var(--muted); line-height: 1.5; display: block; }
.co-sec { margin-top: 14px; }
.co-sec h4 { margin: 0 0 8px; font-size: 14px; }
.co-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.co-list li { position: relative; padding-inline-start: 22px; font-size: 13.5px; line-height: 1.9; }
.co-list.ok li::before { content: '✓'; position: absolute; inset-inline-start: 0; color: #16a34a; font-weight: 800; }
.co-imp { padding: 10px 12px; border-radius: 14px; background: var(--hover); margin-bottom: 8px; }
.co-imp b { font-size: 13.5px; }
.co-imp p { margin: 4px 0 0; font-size: 13px; line-height: 1.9; color: var(--muted); }
.co-rw { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.co-said { padding: 9px 12px; font-size: 13px; color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, #dc2626 55%, transparent); }
.co-better { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; font-size: 13.5px; font-weight: 700; background: color-mix(in srgb, #16a34a 10%, transparent); }
.co-next { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.9; }
.co-next b { color: var(--accent); }
.co-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.co-wait { text-align: center; }
.co-wait .typing { display: inline-flex; margin: 10px 0; }
@media (max-width: 560px) {
	.co-grid { grid-template-columns: repeat(2, 1fr); }
	.co-top { flex-direction: column; text-align: center; }
	.co-top-t h3 { text-align: center; }
	.co-bar { grid-template-columns: 88px 1fr 28px; }
	.co-chips { grid-template-columns: repeat(3, 1fr); }
}

.co-pg-in.wide { max-width: 1100px; }
.co-pg .modal, .co-pg .cmp-box { position: static; width: auto !important; max-width: none !important; max-height: none !important; overflow: visible; background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 0; animation: none; display: block; }
.co-pg .cmp-box { display: flex; flex-direction: column; }
.co-pg .wl-box, .co-pg .pj-modal { padding: 0; }

/* ---------- حالت مطالعه ---------- */
.st-root h3 { margin: 4px 0 6px; }
.st-build { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-elev); }
.st-ta { min-height: 130px; }
.st-brow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.st-cnt { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.st-cnt select { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; padding: 6px 10px; }
.st-files { display: flex; flex-wrap: wrap; gap: 6px; }
.st-files:empty { display: none; }
.st-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--hover); font-size: 12.5px; }
.st-file button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.st-file svg { width: 12px; height: 12px; }
.st-go { width: 100%; justify-content: center; }
.st-status { min-height: 18px; text-align: center; }
.st-lh { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 8px; }
.st-lh small { color: var(--muted); font-size: 12px; }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-deck { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elev); color: var(--text); font: inherit; text-align: right; cursor: pointer; transition: border-color .15s, transform .15s; }
.st-deck:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.st-dt b { display: block; font-size: 14.5px; }
.st-dt small { color: var(--muted); font-size: 12px; }
.st-dr { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 128px; }
.st-due { font-size: 11.5px; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.st-ok { font-size: 11.5px; color: #16a34a; font-weight: 700; }
.st-bar { width: 100%; height: 6px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: #16a34a; border-radius: 99px; }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.st-top .co-back { margin-bottom: 0; }
.st-acts { display: flex; gap: 4px; }
.st-title { margin: 6px 0 12px !important; text-align: right !important; font-size: 21px; }
.st-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.st-tabs button { flex: 1; }
.st-sum { margin: 0 0 14px; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 2; }
.st-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.st-all { margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; padding: 4px 12px; }
.st-all summary { cursor: pointer; padding: 8px 0; font-weight: 700; font-size: 14px; }
.st-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.9; }
.st-row b { font-weight: 700; } .st-row span { color: var(--muted); } .st-row small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.st-prog { height: 5px; border-radius: 99px; background: var(--hover); overflow: hidden; margin-bottom: 16px; }
.st-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.st-cnt2 { color: var(--muted); font-size: 13px; font-weight: 700; }
.st-flash { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 28px 22px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg-elev); box-shadow: var(--shadow); cursor: pointer; margin-bottom: 14px; }
.st-q { font-size: 20px; font-weight: 800; line-height: 2; }
.st-ans { font-size: 16px; line-height: 2.1; color: var(--text); padding-top: 16px; border-top: 1px dashed var(--border); width: 100%; animation: fade .2s; }
.st-rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-rate button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; cursor: pointer; }
.st-rate button small { font-size: 11px; color: var(--muted); }
.st-rate .bad:hover { background: color-mix(in srgb, #dc2626 12%, transparent); border-color: #dc2626; }
.st-rate .mid:hover { background: color-mix(in srgb, #d97706 12%, transparent); border-color: #d97706; }
.st-rate .good:hover { background: color-mix(in srgb, #16a34a 12%, transparent); border-color: #16a34a; }
.st-qq { font-size: 18px; font-weight: 800; line-height: 2.1; margin: 4px 0 16px; }
.st-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.st-opt { text-align: right; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.9; cursor: pointer; transition: background .15s, border-color .15s; }
.st-opt:hover { border-color: var(--accent); }
.st-opt.ok { background: color-mix(in srgb, #16a34a 16%, transparent); border-color: #16a34a; }
.st-opt.bad { background: color-mix(in srgb, #dc2626 14%, transparent); border-color: #dc2626; }
.st-opt.dim { opacity: .55; }
.st-exp { padding: 12px 14px; border-radius: 14px; background: var(--hover); font-size: 13.5px; line-height: 2; margin-bottom: 12px; }
.st-h { margin: 14px 0 8px; font-size: 14px; }
.st-dist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; text-align: center; }
.st-dcol { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; }
.st-dcol i { display: block; width: 70%; border-radius: 8px 8px 0 0; background: var(--accent); }
.st-dcol b { font-size: 14px; } .st-dcol small { font-size: 10.5px; color: var(--muted); }
.st-spark { text-align: center; margin: 6px 0 10px; } .st-spark .co-spark { width: 220px; height: 56px; }
@media (max-width: 560px) { .st-chips { grid-template-columns: repeat(2, 1fr); } .st-row { grid-template-columns: 1fr; gap: 2px; } .st-dr { min-width: 96px; } .st-dist { gap: 4px; } }

/* ---------- ورودی پیام در موبایل: متن در یک خط کامل، دکمه‌ها زیر آن ---------- */
@media (max-width: 640px) {
	.composer-row { flex-wrap: wrap; align-items: center; row-gap: 2px; column-gap: 2px; }
	.composer-row textarea { order: -1; flex: 1 1 100%; width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; }
	.composer-row .attach-btn { width: 38px; height: 38px; }
	.composer-row .model-picker { margin-inline-start: auto; min-width: 0; }
	.composer-row .send-btn { margin-inline-start: 4px; }
	.composer { padding: 6px 8px 8px; }
}

/* ---------- پایان‌نامه ---------- */
.th-root { max-width: 1040px; margin: 0 auto; }
.th-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.th-h { margin: 0; font-size: 22px; } .th-sub { color: var(--text-dim, var(--muted, #777)); font-size: 13.5px; }
.th-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.th-title { flex: 1; font-weight: 700; font-size: 16px; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-status { font-size: 12px; color: var(--text-dim, #888); }
.th-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.th-tab { flex: none; border: 0; background: transparent; padding: 9px 14px; border-radius: 99px; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap; }
.th-tab.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.th-pane { display: flex; flex-direction: column; gap: 12px; }
.th-sec-t { font-weight: 700; font-size: 15px; margin-top: 10px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.th-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.th-fl { font-size: 13px; color: var(--text-dim, #777); }
.th-hint { font-size: 12px; color: var(--text-dim, #888); line-height: 1.7; }
.th-in, .th-sel, .th-ta, .th-edit { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 14.5px; }
.th-ta, .th-edit { resize: vertical; line-height: 1.9; }
.th-edit { min-height: 420px; font-size: 15px; }
.th-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .th-row > .th-f, .th-row > .th-in, .th-row > textarea { flex: 1 1 220px; }
.th-grow { flex: 1; }
.th-chk { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.th-list, .th-reflist { display: flex; flex-direction: column; gap: 10px; }
.th-card, .th-item, .th-ref { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--bg-elev); display: flex; flex-direction: column; gap: 8px; }
.th-card-t { font-weight: 700; } .th-card-m { font-size: 13px; color: var(--text-dim, #777); } .th-card-a { display: flex; gap: 8px; }
.th-new { border: 1px dashed var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.th-chs { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.th-side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 8px; }
.th-ch { display: flex; gap: 6px; align-items: baseline; text-align: right; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.th-ch.on { border-color: var(--accent); background: var(--accent-soft); } .th-ch span { flex: 1; } .th-ch small { color: var(--text-dim, #888); font-size: 11px; }
.th-total { font-size: 12px; color: var(--text-dim, #888); margin-top: 6px; }
.th-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.th-tools, .th-ctr { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.th-tb { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 10px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.th-tb:hover { border-color: var(--accent); color: var(--accent); }
.th-wc { font-size: 12px; color: var(--text-dim, #888); margin-inline-start: auto; }
.th-pv { border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; background: #fff; color: #111; line-height: 2; font-size: 15px; min-height: 300px; }
.th-pv h2, .th-pv h3, .th-pv h4 { margin: 16px 0 6px; } .th-pv blockquote { margin: 8px 24px; font-style: italic; } .th-pv figure { margin: 12px 0; text-align: center; } .th-pv figcaption, .th-cap { font-weight: 700; font-size: 13px; text-align: center; margin: 6px 0; }
.th-t3 { width: 100%; border-collapse: collapse; border-top: 2px solid #000; border-bottom: 2px solid #000; font-size: 13px; } .th-t3 th { border-bottom: 1px solid #000; padding: 5px 8px; } .th-t3 td { padding: 4px 8px; text-align: center; }
.th-note { font-size: 12px; margin-top: 4px; } .th-warn { color: #b3261e; font-size: 13.5px; line-height: 1.8; }
.th-pick { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 8px; }
.th-pk { display: flex; gap: 10px; text-align: right; align-items: baseline; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; } .th-pk:hover { border-color: var(--accent); } .th-pk b { flex: none; color: var(--accent); }
.th-pop-bg { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 14px; }
.th-pop { background: var(--bg, #fff); color: var(--text); border-radius: 20px; padding: 18px; width: min(720px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.th-pop-t { display: flex; justify-content: space-between; align-items: center; } .th-x { border: 0; background: transparent; font-size: 24px; color: var(--text); cursor: pointer; }
.th-out { min-height: 220px; }
.th-ref-t code { direction: ltr; unicode-bidi: embed; font-size: 12px; color: var(--accent); } .th-ref-b { line-height: 1.9; font-size: 14px; }
.th-chips { display: flex; gap: 6px; flex-wrap: wrap; } .th-chip { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; } .th-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.th-scroll { overflow: auto; max-width: 100%; } .th-dt { border-collapse: collapse; font-size: 12.5px; } .th-dt th, .th-dt td { border: 1px solid var(--border); padding: 4px 8px; white-space: nowrap; } .th-dt th { background: var(--accent-soft); }
.th-prev { margin: 4px 0; } .th-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.th-res { display: flex; flex-direction: column; gap: 10px; } .th-restitle { font-weight: 700; } .th-interp { line-height: 2; font-size: 14.5px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.th-advice { font-size: 13.5px; line-height: 1.9; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--accent); }
.th-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; } .th-chart { background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--border); } .th-chart svg { max-width: 100%; height: auto; display: block; }
.th-checks { display: flex; flex-direction: column; gap: 4px; } .th-chk-i { font-size: 14px; } .th-chk-i.ok { color: #1b7a43; } .th-chk-i.no { color: #b3261e; }
@media (max-width: 760px) { .th-chs { grid-template-columns: 1fr; } .th-side { position: static; } .th-edit { min-height: 320px; } }

/* ---------- درون‌ریزی (2.13) ---------- */
.im-root { max-width: 820px; margin: 0 auto; text-align: right; }
.im-head { margin-bottom: 14px; } .im-h { margin: 0 0 4px; font-size: 21px; } .im-sub { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.im-drop { border: 2px dashed var(--border); border-radius: 18px; padding: 30px 18px; text-align: center; cursor: pointer; background: var(--bg-elev); transition: border-color .15s, background .15s; }
.im-drop:hover, .im-drop.on, .im-drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.im-drop-t { font-weight: 700; font-size: 15.5px; margin-bottom: 6px; } .im-drop-s { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.im-sec-t { font-weight: 700; font-size: 15px; margin: 18px 0 8px; } .im-sec { margin-top: 12px; }
.im-hows { display: flex; flex-direction: column; gap: 8px; }
.im-how { border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; background: var(--bg-elev); }
.im-how summary { cursor: pointer; font-size: 14px; } .im-how ol { margin: 8px 0 6px; padding-inline-start: 20px; font-size: 13.5px; line-height: 2; }
.im-note { font-size: 12.5px; color: var(--muted); line-height: 1.9; margin: 6px 0; }
.im-err { background: rgba(220, 60, 60, .12); color: #d33; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin: 10px 0; line-height: 1.8; }
.im-status { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0; }
.im-sum { font-size: 14px; margin: 8px 0 12px; }
.im-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.im-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.im-row:last-child { border-bottom: 0; } .im-row:hover { background: var(--hover); }
.im-row input, .im-prow input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.im-rt { display: flex; flex-direction: column; min-width: 0; } .im-rtt { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .im-rts { font-size: 12px; color: var(--muted); }
.im-prow { display: flex; gap: 10px; align-items: center; margin: 6px 0; flex-wrap: wrap; } .im-prow .th-in { flex: 1 1 200px; width: auto; }
.im-acts { display: flex; gap: 8px; margin-top: 8px; } .im-foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; }
.im-bar { height: 8px; border-radius: 99px; background: var(--hover); overflow: hidden; margin: 16px 0 6px; } .im-bar-i { height: 100%; width: 0; background: var(--grad, var(--accent)); transition: width .25s; }
.im-res { line-height: 2.1; font-size: 14.5px; padding-inline-start: 20px; }

/* ---------- منابع آنلاین ---------- */
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: hbspin .7s linear infinite; vertical-align: -3px; }
@keyframes hbspin { to { transform: rotate(360deg); } }
.attach-btn.hb-open.on { color: var(--accent); background: var(--accent-soft); }
.hb-chip button { margin-inline-start: 6px; }
.hb-chip svg { width: 15px; height: 15px; vertical-align: -3px; }
.composer { position: relative; }
.hb-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; width: min(340px, 94vw); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.25); z-index: 40; display: flex; flex-direction: column; gap: 4px; animation: pop .15s ease; }
.hb-mh { font-size: 12px; color: var(--muted); padding: 6px 8px 8px; line-height: 1.8; }
.hb-menu button { text-align: right; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; color: var(--text); }
.hb-menu button:hover, .hb-menu button.on { background: var(--accent-soft); }
.hb-menu button b { font-size: 13.5px; } .hb-menu small { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.hb-menu .hb-all { color: var(--accent); font-size: 13px; font-weight: 600; flex-direction: row; justify-content: center; }
.hb-st { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.hb-st svg, .hb-uc svg { width: 15px; height: 15px; }
.hb-used { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hb-uc { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--border); color: var(--muted); }
.hb-uc.ok { color: #12a05c; border-color: color-mix(in srgb, #12a05c 45%, var(--border)); }
.hb-uc.bad { color: #d92d20; border-color: color-mix(in srgb, #d92d20 45%, var(--border)); }
.hb-uc.run { opacity: .7; }
.hb-ask { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); }
.hb-ask-i { display: flex; flex-direction: column; gap: 2px; font-size: 13px; } .hb-ask-i code { direction: ltr; text-align: left; font-size: 11.5px; color: var(--muted); }
.hb-ask-b { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-root { text-align: right; }
.hb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hb-h { margin: 0 0 4px; font-size: 20px; } .hb-sub { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.hb-quota { flex: none; font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 4px 12px; }
.hb-search { width: 100%; box-sizing: border-box; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; margin-bottom: 10px; }
.hb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hb-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; color: var(--text); }
.hb-tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); font-weight: 600; }
.hb-list { display: grid; gap: 8px; }
.hb-card { border: 1px solid var(--border); border-radius: 16px; background: var(--bg-elev); overflow: hidden; }
.hb-card.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.hb-ct { width: 100%; text-align: right; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.hb-ct b { font-size: 13.5px; line-height: 1.8; } .hb-ct code { direction: ltr; text-align: left; font-size: 11px; color: var(--muted); }
.hb-form { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.hb-desc { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.hb-fs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.hb-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.hb-f > span { color: var(--muted); direction: ltr; text-align: right; }
.hb-f input[type=text], .hb-f input[type=number], .hb-f select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.hb-f small { color: var(--muted); font-size: 11px; line-height: 1.7; }
.hb-act { display: flex; gap: 8px; }
.hb-out { display: flex; flex-direction: column; gap: 10px; }
.hb-note { margin: 0; font-size: 11.5px; color: var(--muted); }
.hb-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-bar .gm-btn { padding: 7px 14px; font-size: 13px; }
.hb-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; } .hb-empty.bad { color: #d92d20; }
.hb-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.hb-tbl { border-collapse: collapse; width: 100%; font-size: 12px; }
.hb-tbl th, .hb-tbl td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: top; }
.hb-tbl td { white-space: normal; min-width: 70px; max-width: 320px; }
.hb-tbl th { background: var(--hover); font-weight: 600; direction: ltr; }
.hb-dl { margin: 0; display: grid; gap: 4px; font-size: 12.5px; } .hb-dl.in { margin-inline-start: 6px; padding-inline-start: 10px; border-inline-start: 2px solid var(--border); }
.hb-kv { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; } .hb-kv.big { flex-direction: column; align-items: stretch; gap: 2px; }
.hb-kv dt { color: var(--muted); direction: ltr; font-size: 11.5px; min-width: 90px; } .hb-kv dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hb-ul { margin: 0; padding-inline-start: 18px; font-size: 12.5px; } .hb-nil { color: var(--muted); }

/* ---------- دکمه‌ی «+» و منوی ابزارهای ورودی ---------- */
.plus-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s, transform .2s; }
.plus-btn svg { width: 20px; height: 20px; }
.plus-btn:hover { background: var(--hover); color: var(--text); }
.plus-btn[aria-expanded="true"] { transform: rotate(45deg); color: var(--accent); background: var(--accent-soft); }
.plus-btn.on { color: var(--accent); }
.plus-menu { display: none; position: absolute; bottom: calc(100% + 10px); inset-inline-start: 0; width: min(260px, 92vw); padding: 6px; flex-direction: column; gap: 2px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 16px 44px rgba(0,0,0,.28); z-index: 45; }
.plus-menu.open { display: flex; animation: pop .15s ease; }
.plus-menu .attach-btn { direction: rtl; width: 100%; height: auto; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; color: var(--text); text-align: start; }
.plus-menu .attach-btn[style*="display: none"], .plus-menu .attach-btn[style*="display:none"] { display: none !important; }
.plus-menu .attach-btn svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.plus-menu .attach-btn::after { content: attr(aria-label); font-size: 13.5px; font-weight: 500; }
.plus-menu .attach-btn:hover { background: var(--hover); }
.plus-menu .attach-btn:hover svg, .plus-menu .attach-btn.on svg { color: var(--accent); }
.plus-menu .attach-btn.on { background: var(--accent-soft); }

/* ---------- کادر گرادیانت چرخشیِ ۶ رنگ دور باکس‌های پیام ---------- */
@property --amirai-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes amirai-gb-spin { to { --amirai-ang: 360deg; } }
.composer, .u-editbox { position: relative; border-color: transparent !important; }
.composer::before, .u-editbox::before {
	content: ''; position: absolute; inset: -1px; padding: 2px; border-radius: inherit; pointer-events: none; z-index: 0;
	background: conic-gradient(from var(--amirai-ang), #10b981, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #f59e0b, #10b981);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor;
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude;
	animation: amirai-gb-spin 4s linear infinite; opacity: .9;
}
.composer:focus-within::before, .u-editbox:focus-within::before { opacity: 1; animation-duration: 2.4s; }
@media (prefers-reduced-motion: reduce) { .composer::before, .u-editbox::before { animation: none; } }

/* ---------- داشبورد نمای کلی (بازار و بورس) ---------- */
.hd-root { margin-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.hd-load, .hd-none { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.hd-warn { padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--border); color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.hd-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hd-age { font-size: 11.5px; color: var(--muted); }
.hd-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.hd-live { width: 8px; height: 8px; border-radius: 50%; background: #16c784; box-shadow: 0 0 0 0 rgba(22,199,132,.6); animation: hdpulse 1.8s infinite; }
@keyframes hdpulse { 70% { box-shadow: 0 0 0 9px rgba(22,199,132,0); } 100% { box-shadow: 0 0 0 0 rgba(22,199,132,0); } }
.hd-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--hover); }
.hd-seg button { padding: 6px 14px; border-radius: 99px; font-size: 12.5px; color: var(--muted); font-weight: 600; transition: background .15s, color .15s; }
.hd-seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.hd-seg.sm button { padding: 4px 11px; font-size: 12px; }
.hd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.hd-card, .hd-dc { position: relative; text-align: right; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 10px; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, var(--bg-elev)), var(--bg-elev)); overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; }
.hd-card { cursor: pointer; } .hd-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.14); }
.hd-card.on { border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 30px color-mix(in srgb, var(--accent) 14%, transparent); }
.hd-ch { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hd-cp { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; } .hd-cp small, .hd-kv small { font-size: 11px; font-weight: 500; color: var(--muted); }
.hd-sp { width: 100%; height: 34px; display: block; }
.hd-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.hd-chip.up { color: #16c784; background: rgba(22,199,132,.12); } .hd-chip.down { color: #ea3943; background: rgba(234,57,67,.12); } .hd-chip.flat { color: var(--muted); background: var(--hover); }
.hd-panel { padding: 16px 16px 14px; border-radius: 22px; border: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--bg-elev)), var(--bg-elev)); }
.hd-panel h3 { margin: 0 0 10px; font-size: 14px; }
.hd-ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .hd-ph h3 { margin: 0 0 4px; font-size: 15px; }
.hd-pv { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; } .hd-pv small { font-size: 12px; color: var(--muted); font-weight: 500; }
.hd-cv { position: relative; height: 260px; touch-action: pan-y; cursor: crosshair; }
.hd-cv svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hd-gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.hd-cx { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: 0; pointer-events: none; transition: opacity .12s; }
.hd-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: currentColor; border: 2px solid var(--bg); opacity: 0; pointer-events: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 25%, transparent); }
.hd-tip { position: absolute; top: 4px; opacity: 0; pointer-events: none; padding: 6px 11px; border-radius: 12px; background: #12141f; color: #fff; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 8px 22px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 1px; font-size: 12px; transition: opacity .12s; white-space: nowrap; z-index: 2; } .hd-tip b { font-size: 13px; direction: ltr; } .hd-tip span { opacity: .75; font-size: 11px; }
.hd-ax { position: absolute; font-size: 10.5px; color: var(--muted); pointer-events: none; background: color-mix(in srgb, var(--bg-elev) 70%, transparent); padding: 0 4px; border-radius: 6px; font-variant-numeric: tabular-nums; direction: ltr; }
.hd-ax.hi { top: 0; inset-inline-end: 4px; } .hd-ax.lo { bottom: 18px; inset-inline-end: 4px; } .hd-ax.l { bottom: -2px; inset-inline-start: 2px; } .hd-ax.r { bottom: -2px; inset-inline-end: 2px; }
.hd-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; } .hd-stats > div { flex: 1; min-width: 92px; padding: 8px 12px; border-radius: 14px; background: var(--hover); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; } .hd-stats small { color: var(--muted); font-size: 11px; }
.hd-sub { margin: 4px 2px 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.hd-der { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.hd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hd-kpi { padding: 12px 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-elev); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .hd-kpi small { color: var(--muted); font-size: 12px; font-weight: 600; }
.hd-kpi.lead { grid-column: span 2; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 16%, var(--bg-elev)), var(--bg-elev)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.hd-kv { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; } .hd-kpi.lead .hd-kv { font-size: 30px; letter-spacing: -.02em; } .hd-kv.sm { font-size: 16px; }
.hd-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.hd-gwrap { position: relative; width: 190px; margin: 0 auto 6px; } .hd-gauge { width: 100%; display: block; } .hd-gl2 { position: absolute; inset: 34px 0 0; display: flex; flex-direction: column; align-items: center; } .hd-gl2 b { font-size: 26px; line-height: 1; } .hd-gl2 small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hd-stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin-top: 8px; } .hd-stack i { display: block; min-width: 3px; }
.hd-lg, .hd-lg2 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; color: var(--muted); } .hd-lg2 b { color: var(--text); }
.hd-mv { margin-bottom: 9px; } .hd-mv i { display: block; height: 4px; border-radius: 99px; margin-top: 5px; opacity: .85; }
.hd-mvh { display: flex; align-items: center; gap: 8px; font-size: 13px; } .hd-mvh b { flex: 1; } .hd-mvh span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; } .hd-mvh.row { padding: 7px 0; border-bottom: 1px solid var(--border); } .hd-mvh.row:last-child { border: 0; }
@media (max-width: 640px) { .hd-cv { height: 210px; } .hd-kpi.lead { grid-column: span 1; } .hd-cards { grid-template-columns: repeat(2, 1fr); } }

/* ---------- فرم‌ها: هم‌ارتفاع و حلقه‌ی چرخشیِ ۶ رنگ هنگام فوکوس ---------- */
.th-in, .th-sel { height: 46px; min-height: 0; resize: none; line-height: 1.4; }
.th-grid .th-in, .th-grid .th-sel { height: 46px; }
.th-in, .th-sel, .th-ta, .th-edit, .cmp-q {
	border: 2px solid transparent !important; outline: 0;
	background: linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box, linear-gradient(var(--border), var(--border)) border-box;
	transition: box-shadow .2s;
}
.th-in:focus, .th-sel:focus, .th-ta:focus, .th-edit:focus, .cmp-q:focus {
	background: linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box, conic-gradient(from var(--amirai-ang), #10b981, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #f59e0b, #10b981) border-box;
	animation: amirai-gb-spin 3s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .th-in:focus, .th-sel:focus, .th-ta:focus, .th-edit:focus, .cmp-q:focus { animation: none; } }
