@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* هویت بصری نوتک: سرمه‌ای + مسی */
  --navy: #364f6b; --navy-2: #47688d; --navy-deep: #253649; --copper: #c99383; --copper-light: #d8b2a7; --copper-deep: #9a6454;
  --bg: #f4f6f9; --panel: #ffffff; --side: #253649; --text: #1e2a38; --muted: #667487;
  --line: #dde3ea; --accent: #364f6b; --accent-ink: #fff; --user: #e9eef4; --code: #1b2533; --code-ink: #e6ebf1;
  --red: #b8412c; --red-bg: #fbeae6; --green-bg: #e6edf5; --radius: 14px;
  --side-ink: #e8edf3; --side-muted: #9fb0c4; --side-hover: rgba(255,255,255,.07); --side-line: rgba(255,255,255,.1);
  --link: #47688d; --tint-copper: #f7ede9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #141c27; --panel: #1b2534; --side: #0f1721; --text: #e6ebf1; --muted: #93a1b3;
    --line: #2a3748; --accent: #d8b2a7; --accent-ink: #1a2736; --user: #243246; --code: #0d141d; --code-ink: #e6ebf1;
    --red: #ff8f7a; --red-bg: #3b221e; --green-bg: #26344a; --link: #d8b2a7; --tint-copper: #33282a;
  }
}
:root[data-theme=dark] {
    --bg: #141c27; --panel: #1b2534; --side: #0f1721; --text: #e6ebf1; --muted: #93a1b3;
    --line: #2a3748; --accent: #d8b2a7; --accent-ink: #1a2736; --user: #243246; --code: #0d141d; --code-ink: #e6ebf1;
    --red: #ff8f7a; --red-bg: #3b221e; --green-bg: #26344a; --link: #d8b2a7; --tint-copper: #33282a;
  }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Vazirmatn, Tahoma, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.8; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.pad { padding: 12px; }

/* اجزای عمومی */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 16px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--line); color: var(--text); }
label { display: block; margin: 10px 0; font-size: 14px; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: center; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.alert.error { background: var(--red-bg); color: var(--red); }
.alert.ok { background: var(--green-bg); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 20px; background: var(--user); white-space: nowrap; }
.tag.green { background: var(--green-bg); }
.tag.red { background: var(--red-bg); color: var(--red); }
.bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 4px 0; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar span.hot { background: var(--red); }
dialog { color: var(--text); max-width: 440px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h3 { margin-top: 0; }
.logo-dot { width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(from 90deg, var(--accent), #6ad4b8, var(--accent)); margin: 0 auto 8px; }
.logo-dot.big { width: 64px; height: 64px; }

/* ورود و نصب */
.page-center { display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; text-align: right; }
.auth-card h1 { font-size: 22px; margin: 4px 0; text-align: center; }
.auth-card > .muted { text-align: center; margin-top: 0; }
.auth-card .btn { margin-top: 12px; padding: 10px; }
.checks { list-style: none; padding: 0; font-size: 14px; }
.checks .ok { color: var(--accent); } .checks .bad { color: var(--red); }

/* صفحه‌ی چت */
.chat-page { overflow: hidden; }
.layout { display: flex; height: 100dvh; }
.sidebar { width: 280px; flex: none; background: var(--side); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.side-head { padding: 12px; }
.sidebar .search { margin: 0 12px 8px; width: calc(100% - 24px); padding: 6px 10px; font-size: 14px; }
.side-scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.conv-list { padding: 0 8px; }
.conv { display: flex; align-items: center; gap: 4px; padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.conv:hover, .conv.on { background: var(--line); }
.conv-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-tools { display: none; }
.conv:hover .conv-tools, .conv.on .conv-tools { display: flex; }
.conv-tools .icon-btn { padding: 0 4px; font-size: 13px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; font-size: 14px; }
.me { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.side-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.side-links a { color: var(--muted); text-decoration: none; }
.side-links a:hover { color: var(--text); }
.backdrop { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.topbar .title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menuBtn { display: none; font-size: 20px; }
.model-select { width: auto; margin: 0; padding: 5px 10px; font-size: 13px; direction: ltr; }

.messages { flex: 1; overflow-y: auto; padding: 24px 16px; }
.empty { text-align: center; margin-top: 16vh; }
.empty h2 { margin: 8px 0 0; }
.msg { max-width: 780px; margin: 0 auto 18px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-start; }
.msg.user .bubble { background: var(--user); padding: 10px 16px; border-radius: 18px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant .bubble { padding: 0 2px; word-wrap: break-word; }
.bubble p { margin: 0 0 10px; }
.bubble > :last-child { margin-bottom: 0; }
.bubble h2, .bubble h3, .bubble h4 { margin: 16px 0 8px; line-height: 1.5; }
.bubble h2 { font-size: 20px; } .bubble h3 { font-size: 17px; } .bubble h4 { font-size: 15px; }
.bubble ul, .bubble ol { margin: 0 0 10px; padding-inline-start: 24px; }
.bubble blockquote { margin: 0 0 10px; padding-inline-start: 12px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.bubble code { background: var(--user); padding: 1px 6px; border-radius: 6px; font-size: 13.5px; font-family: ui-monospace, Consolas, monospace; unicode-bidi: embed; }
.bubble .code { margin: 0 0 12px; border-radius: 10px; overflow: hidden; background: var(--code); color: var(--code-ink); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; font-size: 12px; background: rgba(255,255,255,.07); direction: ltr; }
.copy-code { background: none; border: 0; color: inherit; cursor: pointer; font-size: 12px; opacity: .8; }
.bubble pre { margin: 0; padding: 12px 14px; overflow-x: auto; text-align: left; }
.bubble pre code { background: none; padding: 0; color: inherit; font-size: 13px; line-height: 1.6; }
.bubble table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 5px 10px; }
.bubble th { background: var(--user); }
.bubble hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.table-wrap { overflow-x: auto; }
.msg-tools { opacity: 0; transition: .15s; margin-top: 2px; }
.msg:hover .msg-tools { opacity: 1; }
@media (pointer: coarse) { .msg-tools { opacity: 1; } .conv-tools { display: flex; } }
.icon-btn.small { font-size: 12px; padding: 2px 8px; }
.caret { display: inline-block; width: 8px; height: 16px; background: var(--text); vertical-align: middle; margin-inline-start: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.typing i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.composer { padding: 0 16px 10px; }
.composer-box { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 8px 8px 8px 8px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { border: 0; background: transparent; resize: none; margin: 0; padding: 6px 10px; max-height: 220px; line-height: 1.7; }
.send { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; }
.send.stop { background: var(--text); color: var(--bg); font-size: 14px; }
.hint { text-align: center; font-size: 12px; margin-top: 6px; }

@media (max-width: 800px) {
  .sidebar { position: fixed; inset: 0 0 0 auto; z-index: 20; transform: translateX(100%); transition: transform .2s; width: 84%; max-width: 300px; }
  .side-open .sidebar { transform: none; }
  .side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 10; }
  #menuBtn { display: block; }
  .messages { padding: 16px 12px; }
  .composer { padding: 0 10px 8px; }
  .msg.user .bubble { max-width: 92%; }
}

/* پنل مدیریت */
.admin-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.admin-top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-top nav a { text-decoration: none; color: var(--muted); padding: 5px 12px; border-radius: 8px; font-size: 14px; }
.admin-top nav a.on, .admin-top nav a:hover { background: var(--user); color: var(--text); }
.admin-main { max-width: 1150px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-main > .card, .admin-main > section { margin-bottom: 16px; }
.admin-main h3 { margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 24px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat select { margin-top: 4px; direction: ltr; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-head .search { max-width: 320px; margin: 0; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; font-size: 14px; }
.bulk-bar select, .bulk-bar input { width: auto; margin: 0; padding: 5px 10px; }
.small-input { max-width: 140px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-weight: 400; color: var(--muted); font-size: 13px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.off td { opacity: .6; }
.usage-cell { min-width: 170px; }
.cred-scroll { max-width: 460px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.cred-scroll th { position: sticky; top: 0; background: var(--panel); }
.danger-zone { display: flex; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.settings { max-width: 760px; }
.models-tools { margin: -4px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips .alert { flex-basis: 100%; margin: 0; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 20px; padding: 2px 10px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 700px) {
  .tbl.users th:nth-child(5), .tbl.users td:nth-child(5), .tbl.users th:nth-child(6), .tbl.users td:nth-child(6) { display: none; }
}

/* ---------- اجزای مشترک جدید ---------- */
.alert:not(.error):not(.ok) { background: var(--user); }
.center { text-align: center; }
.danger-text { color: var(--red); }
.btn.lg { padding: 11px 22px; font-size: 16px; }
a.btn { display: inline-block; text-decoration: none; color: var(--text); text-align: center; }
a.btn.primary { color: var(--accent-ink); }
.logo-dot.sm { width: 26px; height: 26px; margin: 0; display: inline-block; vertical-align: middle; }
a.logo-dot { display: block; }
dialog.wide { max-width: 680px; }
.settings h4 { margin: 22px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }

/* چت: وضعیت اشتراک */
.sub-box { background: var(--green-bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sub-box.expired { background: var(--red-bg); color: var(--red); }
.sub-box a { font-weight: 700; }
.expired-bar { max-width: 780px; margin: 0 auto 8px; background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 10px 14px; font-size: 14px; width: calc(100% - 32px); }
.expired-bar a { color: inherit; font-weight: 700; }

/* خرید و نتیجه */
.checkout { max-width: 460px; }
.checkout h1 { text-align: right; margin: 8px 0 12px; }
.order-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.order-summary .price { font-weight: 700; font-size: 18px; white-space: nowrap; }
.result { max-width: 460px; }
.result h1 { text-align: center; }
.result .btn { margin-top: 10px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; margin: 0 auto 8px; }
.result-icon.ok { background: var(--green-bg); color: var(--accent); }
.result-icon.bad { background: var(--red-bg); color: var(--red); }
.result-icon.wait { background: var(--user); color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.kv td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.kv td:first-child { color: var(--muted); width: 38%; }
.mono.big { font-size: 18px; letter-spacing: .5px; }

/* ---------- صفحه‌ی معرفی ---------- */
.landing { background: var(--bg); }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.lp-narrow { max-width: 760px; }
.lp-nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lp-nav-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 17px; }
.lp-links { display: flex; gap: 22px; margin-inline-start: auto; }
.lp-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.lp-links a:hover { color: var(--text); }
.lp-hero { padding: 72px 0 64px; background: radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.lp-hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.lp-hero h1 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.35; margin: 0 0 16px; letter-spacing: -.5px; }
.lp-lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; line-height: 2; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-demo { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.08); font-size: 14px; }
.lp-demo-bar { display: flex; gap: 6px; margin-bottom: 14px; direction: ltr; }
.lp-demo-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.lp-demo-msg { padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; line-height: 1.9; }
.lp-demo-msg.user { background: var(--user); margin-inline-start: 18%; }
.lp-demo-msg.bot { border: 1px solid var(--line); margin-inline-end: 8%; }
.lp-demo-typing { padding: 4px 8px; }
.lp-section { padding: 72px 0; }
.lp-section.alt { background: var(--panel); border-block: 1px solid var(--line); }
.lp-h2 { font-size: clamp(24px, 3vw, 32px); text-align: center; margin: 0 0 8px; }
.lp-sub { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 640px; }
.lp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1060px) { .lp-features { grid-template-columns: repeat(2, 1fr); } }
.lp-feature { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.lp-feature h3 { margin: 12px 0 6px; font-size: 17px; }
.lp-feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.lp-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-bg); color: var(--accent); }
.lp-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.lp-steps li { counter-increment: s; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.lp-steps li::before { content: counter(s, persian); width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; margin-bottom: 8px; }
.lp-steps span { color: var(--muted); font-size: 14.5px; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; align-items: stretch; }
.lp-plan { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px 24px; display: flex; flex-direction: column; }
.lp-plan.hot { border: 2px solid var(--accent); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 18%, transparent); }
.lp-plan h3 { margin: 0; font-size: 20px; }
.lp-badge { position: absolute; top: -13px; inset-inline-start: 22px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 20px; }
.lp-price { margin: 16px 0 2px; }
.lp-price b { font-size: 32px; }
.lp-price span { color: var(--muted); }
.lp-plan-list { list-style: none; padding: 0; margin: 18px 0 22px; flex: 1; font-size: 14.5px; }
.lp-plan-list li { padding: 6px 22px 6px 0; position: relative; border-bottom: 1px dashed var(--line); }
.lp-plan-list li::before { content: '✓'; position: absolute; right: 0; color: var(--accent); font-weight: 700; }
#faq details { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
#faq summary { cursor: pointer; font-weight: 700; }
#faq details p { margin: 10px 0 0; color: var(--muted); }
.lp-foot { padding: 28px 0; color: var(--muted); font-size: 14px; }
.lp-foot-in { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.lp-foot a { color: var(--muted); }
@media (max-width: 860px) {
  .lp-hero { padding: 40px 0; }
  .lp-hero-in { grid-template-columns: 1fr; gap: 28px; }
  .lp-features, .lp-steps { grid-template-columns: 1fr; }
  .lp-links { display: none; }
  .lp-nav-in .btn { margin-inline-start: auto; }
  .lp-section { padding: 48px 0; }
}

/* ---------- امکانات جدید گفتگو ---------- */
.block { display: block; }
.composer-box { flex-wrap: wrap; }
.composer-box .tools { display: flex; gap: 2px; align-items: center; order: 3; width: 100%; padding: 2px 4px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.composer-box textarea { flex: 1; order: 1; }
.composer-box .send { order: 2; }
.tool-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid transparent; border-radius: 20px; padding: 4px 10px; color: var(--muted); cursor: pointer; font-size: 13px; }
.tool-btn:hover { background: var(--user); color: var(--text); }
.tool-btn.on { background: var(--green-bg); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.composer.image-mode .composer-box { border-color: var(--accent); }
.composer.drag .composer-box { border-style: dashed; border-color: var(--accent); background: var(--green-bg); }
.pending { max-width: 780px; margin: 0 auto 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 13px; color: var(--text); text-decoration: none; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.att-chip.loading { opacity: .7; }
.att-ic { font-size: 10px; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 1px 4px; direction: ltr; }
.att-thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-img { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.gen-img img { max-width: min(100%, 512px); border-radius: 14px; border: 1px solid var(--line); }
.sources { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; border-inline-start: 3px solid var(--line); padding-inline-start: 10px; }
.sources .src { color: var(--accent); text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.sources .src:hover { text-decoration: underline; }
.status-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.edit-box { width: 100%; min-height: 90px; margin: 0; border-radius: 14px; resize: vertical; }
.msg.user { align-items: flex-start; }
.msg.user .msg-tools { align-self: flex-start; }
.msg-tools { display: flex; gap: 4px; }
body.busy .msg-tools .icon-btn:not(.small) { display: none; }
body.busy .regen, body.busy .msg.user .msg-tools { visibility: hidden; }
.as-chip { background: var(--green-bg); color: var(--accent); font-weight: 700; }
.assistants { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; max-width: 780px; margin: 22px auto 0; text-align: right; }
.as-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: .15s; }
.as-card:hover { border-color: var(--muted); }
.as-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.as-card small { font-size: 12px; line-height: 1.6; }
.as-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--green-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; margin-bottom: 4px; }
.as-ic.sm { width: 26px; height: 26px; display: inline-grid; vertical-align: middle; margin: 0; }
.menu-wrap { position: relative; }
.menu { position: absolute; top: 110%; left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; z-index: 30; min-width: 190px; }
.menu button { display: block; width: 100%; text-align: right; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--user); }
#exportBtn { font-size: 20px; line-height: 1; }
@media (max-width: 800px) {
  .tool-btn span { display: none; }
  .as-chip { display: none; }
  .assistants { grid-template-columns: 1fr 1fr; }
}
[hidden] { display: none !important; }
.att-list { align-items: flex-start; }
.sources .src { text-align: right; display: block; }
@media (max-width: 800px) { .empty { margin-top: 6vh; } .empty .logo-dot.big { width: 48px; height: 48px; } }

/* نوار کناری: ساخت تصویر و پروژه‌ها */
.side-nav { padding: 0 8px 8px; }
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 7px 10px; cursor: pointer; font-size: 14px; text-align: right; }
.side-item:hover, .side-item.on { background: var(--line); }
.side-item svg { color: var(--accent); flex: none; }
.side-sec { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
.side-sec .icon-btn { font-size: 18px; line-height: 1; padding: 0 8px; }
.conv-ic { flex: none; width: 20px; text-align: center; font-size: 14px; }
.conv .count { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 0 7px; }
.conv:hover .count, .conv.on .count { display: none; }
.side-empty { display: block; width: 100%; text-align: right; background: none; border: 1px dashed var(--line); border-radius: 10px; padding: 7px 10px; color: var(--muted); cursor: pointer; font-size: 13px; }
.side-empty:hover { color: var(--accent); border-color: var(--accent); }
.crumb { background: none; border: 0; padding: 2px 6px; border-radius: 8px; color: var(--muted); cursor: pointer; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.crumb:hover { background: var(--line); color: var(--text); }
#projSettingsBtn { font-size: 18px; }

/* خانه‌ی پروژه و صفحه‌ی ساخت تصویر */
.home { max-width: 780px; margin: 6vh auto 0; }
.center { text-align: center; }
.ph-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ph-head h2 { margin: 0; font-size: 24px; }
.ph-icon { width: 60px; height: 60px; border-radius: 18px; background: var(--green-bg); color: var(--accent); display: grid; place-items: center; font-size: 30px; }
.ph-icon svg { width: 30px; height: 30px; }
.ph-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.ph-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ph-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ph-instr { margin: 0; font-size: 14px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ph-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-files p { margin: 0; }
.ph-files .att-chip a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.ph-sub { font-size: 15px; margin: 22px 0 8px; }
.ph-convs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.ph-convs > p { margin: 0; padding: 14px 16px; }
.ph-conv { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; }
.ph-conv:last-child { border-bottom: 0; }
.ph-conv:hover { background: var(--user); }
.ph-conv .conv-title { flex: 1; }
.ih-samples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.g-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; transition: .15s; }
.g-item:hover img { transform: scale(1.02); border-color: var(--accent); }
.mode-chip b { font-weight: 400; margin-inline-start: 2px; }
.composer.image-mode .mode-chip { display: inline-flex; }

/* فرم پروژه */
dialog.wide { max-width: 560px; }
.lbl { font-size: 14px; margin: 10px 0 4px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { margin: 0; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; cursor: pointer; }
.icon-pick input:checked + span { border-color: var(--accent); background: var(--green-bg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.icon-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.row-end.spread { align-items: center; }
.grow { flex: 1; }
@media (max-width: 800px) {
  .ph-cards { grid-template-columns: 1fr; }
  .home { margin-top: 2vh; }
  .crumb { max-width: 30%; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* انتخاب مدل داخل نوار پیام، کنار دکمه‌ی فایل */
.composer-box .tools .model-select { width: auto; max-width: 220px; margin: 0; padding: 3px 26px 3px 10px; border: 1px solid var(--line); border-radius: 20px; background-color: var(--bg); font-size: 13px; color: var(--muted); cursor: pointer; direction: rtl; padding: 3px 10px 3px 26px; text-overflow: ellipsis; }
.composer-box .tools .model-select:hover { color: var(--text); border-color: var(--muted); }
.composer-box .tools .model-select:focus { border-color: var(--accent); color: var(--text); }
@media (max-width: 800px) { .composer-box .tools .model-select { max-width: 185px; font-size: 12px; } }

/* ================= هویت بصری نوتک ================= */
::selection { background: color-mix(in srgb, var(--copper) 45%, transparent); }
.logo-dot { background: var(--navy) url(brand/mark.svg) center / 58% no-repeat; box-shadow: inset 0 0 0 2px rgba(255,255,255,.8), 0 0 0 3px var(--navy), 0 6px 18px rgba(37,54,73,.25); }
.logo-dot.sm { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.8), 0 0 0 2px var(--navy); }
.btn.primary { box-shadow: 0 1px 2px rgba(37,54,73,.15); }
.btn.copper { background: linear-gradient(135deg, var(--copper-light), var(--copper)); border-color: var(--copper); color: var(--navy-deep); font-weight: 700; }

/* نوار کناری سرمه‌ای، مثل سربرگ نوتک */
.sidebar { background: var(--side); color: var(--side-ink); border-left: 0; }
.sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 2px; color: var(--side-ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.sidebar .side-brand img { width: 30px; height: 30px; }
.sidebar .side-brand small { display: block; font-weight: 400; font-size: 11px; color: var(--copper-light); letter-spacing: .3px; line-height: 1.2; }
.sidebar #newChat { background: linear-gradient(135deg, var(--copper-light), var(--copper)); border: 0; color: var(--navy-deep); }
.sidebar #newChat:hover { filter: brightness(1.05); }
.sidebar .search { background: rgba(255,255,255,.06); border-color: var(--side-line); color: var(--side-ink); }
.sidebar .search::placeholder { color: var(--side-muted); }
.sidebar .search:focus { border-color: var(--copper); }
.sidebar .conv, .sidebar .side-item { color: var(--side-ink); }
.sidebar .conv:hover, .sidebar .side-item:hover { background: var(--side-hover); }
.sidebar .conv.on, .sidebar .side-item.on { background: rgba(255,255,255,.1); box-shadow: inset -3px 0 0 var(--copper); }
.sidebar .side-item svg { color: var(--copper); }
.sidebar .side-sec { color: var(--side-muted); }
.sidebar .icon-btn { color: var(--side-muted); }
.sidebar .icon-btn:hover { background: var(--side-hover); color: #fff; }
.sidebar .conv .count { background: rgba(255,255,255,.08); color: var(--side-muted); }
.sidebar .side-empty { border-color: var(--side-line); color: var(--side-muted); }
.sidebar .side-empty:hover { border-color: var(--copper); color: var(--copper-light); }
.sidebar .muted { color: var(--side-muted); }
.sidebar .side-foot { border-top-color: var(--side-line); }
.sidebar .bar { background: var(--side-line); }
.sidebar .bar span { background: linear-gradient(90deg, var(--copper), var(--copper-light)); }
.sidebar .bar span.hot { background: #ff8f7a; }
.sidebar .sub-box { background: rgba(201,147,131,.14); color: var(--side-ink); }
.sidebar .sub-box a { color: var(--copper-light); }
.sidebar .sub-box.expired { background: rgba(255,143,122,.15); color: #ffb3a5; }
.sidebar .avatar { background: linear-gradient(135deg, var(--copper-light), var(--copper)); color: var(--navy-deep); }
.sidebar .side-links a { color: var(--side-muted); }
.sidebar .side-links a:hover { color: #fff; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: var(--side-line); border-radius: 6px; }

/* گفتگو */
.topbar { background: var(--panel); }
.msg.user .bubble { border-bottom-left-radius: 6px; }
.empty .logo-dot.big, .ph-icon { box-shadow: none; }
.empty h2 { color: var(--text); }
.as-ic, .ph-icon, .lp-ic { background: var(--green-bg); color: var(--navy-2); }
.as-card.on { border-color: var(--copper); box-shadow: 0 0 0 2px color-mix(in srgb, var(--copper) 30%, transparent); }
.as-chip { background: var(--tint-copper); color: var(--copper-deep); }
.tool-btn.on { background: var(--tint-copper); color: var(--copper-deep); border-color: color-mix(in srgb, var(--copper) 55%, transparent); }
.composer-box { border-radius: 20px; box-shadow: 0 4px 18px rgba(37,54,73,.08); }
.composer-box:focus-within, .composer.image-mode .composer-box { border-color: var(--navy-2); }
.send { background: var(--navy); color: #fff; }
.chip:hover, .side-empty:hover { border-color: var(--copper); color: var(--copper-deep); }
.g-item:hover img { border-color: var(--copper); }
.sources { border-inline-start-color: var(--copper-light); }
.sources .src { color: var(--link); }
.crumb { color: var(--copper-deep); }
.caret { background: var(--copper); }

/* ورود و صفحه‌های تکی: زمینه‌ی سرمه‌ای با کارت روشن */
body.page-center { background: radial-gradient(800px 500px at 90% 0%, rgba(71,104,141,.55), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); background-attachment: fixed; }
body.page-center .card { box-shadow: 0 24px 60px rgba(10,20,32,.35); border: 0; }
body.page-center .logo-dot { width: 64px; height: 64px; margin-bottom: 12px; }
.auth-foot { text-align: center; color: var(--side-muted); font-size: 12px; margin-top: 14px; }

/* پنل مدیریت */
.admin-top { background: var(--side); border-bottom: 0; color: var(--side-ink); }
.admin-top a, .admin-top b, .admin-top strong { color: var(--side-ink); }
.admin-top nav a { color: var(--side-muted); }
.admin-top nav a.on, .admin-top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-top .btn { background: transparent; color: var(--side-ink); border-color: var(--side-line); }
.admin-top .btn:hover { border-color: var(--copper); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* صفحه‌ی معرفی */
.lp-nav { background: color-mix(in srgb, var(--panel) 90%, transparent); }
.lp-brand .logo-dot.sm { width: 32px; height: 32px; }
.lp-hero { background: radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--navy-2) 22%, transparent), transparent 70%), radial-gradient(600px 300px at 5% 110%, color-mix(in srgb, var(--copper) 18%, transparent), transparent 70%); }
.lp-hero h1 { color: var(--text); }
.lp-kicker { display: inline-flex; align-items: center; gap: 8px; background: var(--tint-copper); color: var(--copper-deep); border-radius: 20px; padding: 3px 12px 3px 6px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.lp-kicker img { width: 22px; height: 22px; }
.lp-demo { border-top: 3px solid var(--copper); }
.lp-plan.hot { border-color: var(--copper); box-shadow: 0 16px 40px color-mix(in srgb, var(--copper) 22%, transparent); }
.lp-badge { background: linear-gradient(135deg, var(--copper-light), var(--copper)); color: var(--navy-deep); }
.lp-plan-list li::before { color: var(--copper-deep); }
.lp-steps li::before { background: var(--navy); color: #fff; }
.lp-foot { background: var(--navy-deep); color: var(--side-muted); padding: 36px 0; }
.lp-foot a { color: var(--copper-light); }
.lp-foot-brand { display: flex; align-items: center; gap: 14px; color: var(--side-ink); }
.lp-foot-brand img { width: 64px; height: auto; }
.lp-foot-in { align-items: center; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .send { background: var(--copper); color: var(--navy-deep); }
  :root:not([data-theme=light]) .as-ic, :root:not([data-theme=light]) .ph-icon, :root:not([data-theme=light]) .lp-ic { color: var(--copper-light); }
  :root:not([data-theme=light]) .composer-box:focus-within, :root:not([data-theme=light]) .composer.image-mode .composer-box { border-color: var(--copper); }
  :root:not([data-theme=light]) .lp-steps li::before { background: var(--copper); color: var(--navy-deep); }
  :root:not([data-theme=light]) .crumb, :root:not([data-theme=light]) .as-chip, :root:not([data-theme=light]) .tool-btn.on, :root:not([data-theme=light]) .lp-kicker { color: var(--copper-light); }
  :root:not([data-theme=light]) .chip.on { background: var(--copper); border-color: var(--copper); color: var(--navy-deep); }
}
:root[data-theme=dark] .send { background: var(--copper); color: var(--navy-deep); }
:root[data-theme=dark] .as-ic, :root[data-theme=dark] .ph-icon, :root[data-theme=dark] .lp-ic { color: var(--copper-light); }
:root[data-theme=dark] .composer-box:focus-within, :root[data-theme=dark] .composer.image-mode .composer-box { border-color: var(--copper); }
:root[data-theme=dark] .lp-steps li::before { background: var(--copper); color: var(--navy-deep); }
:root[data-theme=dark] .crumb, :root[data-theme=dark] .as-chip, :root[data-theme=dark] .tool-btn.on, :root[data-theme=dark] .lp-kicker { color: var(--copper-light); }
:root[data-theme=dark] .chip.on { background: var(--copper); border-color: var(--copper); color: var(--navy-deep); }

.admin-brand { display: inline-flex; align-items: center; gap: 8px; }
body.page-center { flex-direction: column; }

/* ================= نسخه‌ی ۱.۶: امکانات تازه ================= */
:root[data-theme=dark] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { color-scheme: dark; } }

/* دسته‌بندی گفتگوها بر اساس تاریخ */
.conv-group { font-size: 11.5px; color: var(--side-muted); padding: 10px 10px 2px; font-weight: 700; }

/* منوی حساب کاربری */
.acct-wrap { position: relative; }
.sidebar .me { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 7px 8px; margin: 6px 0 0; border-radius: 12px; cursor: pointer; color: var(--side-ink); text-align: right; }
.sidebar .me:hover { background: var(--side-hover); }
.me-name { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; overflow: hidden; }
.me-name small { display: block; font-size: 11.5px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-caret { color: var(--side-muted); font-size: 12px; }
.acct-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; color: var(--text); }
.acct-menu a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.acct-menu a:hover { background: var(--user); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.acct-head { padding: 6px 12px 8px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }

/* گفتگوی موقت */
.temp-btn.on { color: var(--copper-deep); background: var(--tint-copper); }
.temp-chip { background: var(--tint-copper); color: var(--copper-deep); }
body.temp-mode .composer-box { border-style: dashed; border-color: var(--copper); }
body.temp-mode .empty .logo-dot { filter: grayscale(.6); opacity: .8; }

/* نوار ابزار کادر پیام */
.composer-box .tools .grow { flex: 1; }
#micBtn.rec { color: var(--red); background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
#micBtn.rec svg { animation: blink 1s steps(2) infinite; }
#micBtn.busy { opacity: .6; pointer-events: none; }
.rec-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.rec-time:empty { display: none; }
#researchBtn.on { background: var(--tint-copper); color: var(--copper-deep); border-color: color-mix(in srgb, var(--copper) 55%, transparent); }

/* پیام‌ها */
.pii-note { font-size: 12px; color: var(--muted); margin-top: 4px; align-self: flex-start; background: var(--green-bg); padding: 2px 10px; border-radius: 20px; }
.gen-video video { width: min(100%, 640px); max-height: 70vh; border-radius: 14px; border: 1px solid var(--line); background: #000; }
.video-wait { min-width: min(320px, 80vw); display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; }
.vbar span { transition: width .6s; background: linear-gradient(90deg, var(--copper), var(--copper-light)); }
.g-item { position: relative; display: block; }
.g-item video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; background: #000; }
.g-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }

/* گفتگوی صوتی */
.voice-ov { position: fixed; inset: 0; z-index: 60; background: radial-gradient(700px 500px at 50% 35%, #3d5a7c, var(--navy-deep) 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; text-align: center; }
.voice-orb { --lvl: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); box-shadow: 0 0 0 calc(6px + var(--lvl) * 36px) rgba(201,147,131,.18), inset 0 0 0 2px rgba(255,255,255,.7); transition: box-shadow .12s; }
.voice-orb img { width: 58%; }
.voice-orb.thinking { animation: vpulse 1.4s ease-in-out infinite; }
.voice-orb.speaking { animation: vpulse .8s ease-in-out infinite; box-shadow: 0 0 0 18px rgba(201,147,131,.22), inset 0 0 0 2px rgba(255,255,255,.7); }
@keyframes vpulse { 50% { transform: scale(1.07); } }
.voice-status { font-size: 18px; font-weight: 700; }
.voice-heard { color: #c9d4e0; max-width: 560px; font-size: 14px; min-height: 1.5em; }
.voice-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.voice-actions .btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.voice-actions .btn.danger { border-color: #ff9a88; color: #ffc2b7; }

/* کنترل‌های عمومی */
.seg { display: inline-flex; gap: 2px; background: var(--user); border-radius: 12px; padding: 3px; }
.seg-btn { border: 0; background: none; padding: 5px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.seg-btn.on { background: var(--panel); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.auth-card .seg, .lp-seg { display: flex; margin: 8px auto 12px; width: fit-content; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 24px; background: var(--line); cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; right: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--navy-2); }
.switch input:checked + span::before { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 2px solid var(--copper); }

/* پنجره‌ی تنظیمات */
dialog.settings-dlg { max-width: 880px; width: calc(100% - 24px); padding: 0; overflow: hidden; }
dialog.settings-dlg[open] { display: flex; flex-direction: column; height: min(680px, calc(100dvh - 32px)); }
.sd-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sd-head h3 { margin: 0; }
.sd-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.sd-nav { border-left: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; background: var(--bg); }
.sd-tab { text-align: right; background: none; border: 0; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
.sd-tab:hover { background: var(--user); color: var(--text); }
.sd-tab.on { background: var(--user); color: var(--text); font-weight: 700; box-shadow: inset -3px 0 0 var(--copper); }
.sd-pane { overflow-y: auto; padding: 18px 22px 28px; }
.sd-pane h3 { margin: 0 0 10px; }
.sd-pane h4 { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.sd-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sd-line b { font-size: 14.5px; }
.sd-line small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 2px; }
.sd-right { flex: none; }
.mem-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; align-items: flex-start; }
.mem-row, .arc-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; background: var(--bg); }
.mem-row span { flex: 1; }
.arc-row { flex-wrap: wrap; margin-top: 6px; }
.arc-row .conv-title { flex: 1; min-width: 140px; }
.acct-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.acct-top { display: flex; gap: 28px; flex-wrap: wrap; }
.acct-top b { display: block; font-size: 17px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; font-size: 13.5px; margin-top: 4px; }
.acct-grid small { display: block; }
.topups { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.topup { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--panel); transition: .15s; }
.topup:hover { border-color: var(--copper); box-shadow: 0 4px 14px color-mix(in srgb, var(--copper) 18%, transparent); }
.topup span { font-size: 13px; color: var(--muted); }
.topup em { font-style: normal; font-weight: 700; color: var(--copper-deep); margin-top: 4px; }
.voices { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.voice-opt { margin: 0; }
.voice-opt input { position: absolute; opacity: 0; }
.voice-opt span { display: block; text-align: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; direction: ltr; }
.voice-opt input:checked + span { border-color: var(--copper); background: var(--tint-copper); font-weight: 700; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--bg); }
.task-row.off { opacity: .6; }
.task-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-info small { line-height: 1.7; }
.task-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.task-form { margin-top: 12px; padding: 14px 16px; }
.task-form h4 { margin-top: 0; padding-top: 0; border: 0; }
.cred-box { font-family: ui-monospace, Consolas, monospace; white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; text-align: left; font-size: 13px; }
code.copyable { display: block; direction: ltr; text-align: left; background: var(--user); padding: 6px 10px; border-radius: 8px; margin-top: 4px; word-break: break-all; user-select: all; }
.tbl.small { font-size: 13px; }
.tbl tr.off td { opacity: .55; }
.tbl .actions { display: flex; gap: 4px; flex-wrap: wrap; }

@media (max-width: 800px) {
  .sd-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sd-nav { flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .sd-tab { white-space: nowrap; }
  .sd-tab.on { box-shadow: inset 0 -3px 0 var(--copper); }
  .sd-pane { padding: 14px 14px 24px; }
  .sd-line { flex-wrap: wrap; }
  #researchBtn span, #micBtn span.rec-time:empty { display: none; }
  .composer-box .tools { flex-wrap: wrap; }
}
.lp-plans { grid-template-columns: repeat(auto-fit, minmax(270px, 370px)); justify-content: center; }

/* ---------- پشتیبانی (تیکت) ---------- */
.badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-inline-start: 6px; border-radius: 9px; background: var(--copper); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; vertical-align: middle; }
.ticket-thread { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; margin: 10px 0; }
.tmsg { max-width: 88%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.tmsg.user { align-self: flex-start; background: var(--user); border-color: transparent; }
.tmsg.admin { align-self: flex-end; background: var(--tint-copper); border-color: transparent; }
.tmeta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tbody { overflow-wrap: anywhere; }
.tk-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.tk-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: right; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.tk-row:hover { background: var(--user); }
.tk-row small { display: block; color: var(--muted); font-size: 12px; }
.tk-row.unread b { color: var(--link); }
.tk-st { font-size: 12px; white-space: nowrap; padding: 2px 8px; border-radius: 8px; background: var(--red-bg); color: var(--red); }
.tk-st.ok { background: var(--green-bg); color: var(--link); }
.tk-st.off { background: var(--user); color: var(--muted); }

/* ---------- صفحه‌های قانونی ---------- */
.legal-page { background: var(--bg); height: auto; }
.legal-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.legal-head { background: var(--navy-deep); color: var(--side-ink); padding: 14px 0; margin-bottom: 24px; }
.legal-head .legal-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legal-brand { display: flex; align-items: center; gap: 10px; color: var(--side-ink); text-decoration: none; font-weight: 700; }
.legal-brand img { width: 44px; height: auto; }
.legal-head nav { display: flex; gap: 4px; flex-wrap: wrap; }
.legal-head nav a { color: var(--side-muted); text-decoration: none; padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.legal-head nav a.on, .legal-head nav a:hover { color: var(--side-ink); background: var(--side-hover); }
.legal-body { padding: 24px 28px; line-height: 2.1; }
.legal-body h1 { margin-top: 0; font-size: 24px; }
.legal-body h2 { font-size: 17px; margin: 22px 0 6px; color: var(--link); }
.legal-contact { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 16px 0; }
.legal-contact dt { color: var(--muted); }
.legal-contact dd { margin: 0; }
.legal-foot { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 32px; }
.enamad { margin-top: 12px; }
.lp-foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.auth-foot a { color: var(--side-muted); }
@media (max-width: 600px) { .legal-body { padding: 18px 16px; } .legal-contact { grid-template-columns: 1fr; gap: 2px; } .legal-contact dd { margin-bottom: 8px; } }

/* ---------- نسخه‌ی رایگان، سطح تفکر، گزارش مصرف، دستگاه‌ها ---------- */
.free-bar { background: var(--tint-copper); color: var(--text); border-color: transparent; }
.free-bar a { font-weight: 700; }
.sub-box.free { border-color: var(--copper); }
.effort-select { max-width: 150px; }
.lp-free { border-color: var(--copper) !important; }
.use-sum { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; }
.use-kind .use-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.use-kind .use-top small { color: var(--muted); }
.dev-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dev-row.current { border-color: var(--copper); background: var(--tint-copper); }
.dev-ic { font-size: 22px; }
.dev-info { flex: 1; min-width: 0; }
.dev-info small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- ابزارهای زیر پاسخ ---------- */
.bot-tools { gap: 2px; flex-wrap: wrap; }
.mt-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; transition: background .12s, color .12s; }
.mt-btn:hover { background: var(--line); color: var(--text); }
.mt-btn.on { color: var(--copper-deep); }
:root[data-theme=dark] .mt-btn.on { color: var(--copper); }
.mt-btn.on svg path { fill: color-mix(in srgb, currentColor 22%, transparent); }
.mt-btn.ok { color: #2e8b57; }
.mt-btn.playing { color: var(--copper-deep); animation: mtPulse 1.2s ease-in-out infinite; }
.mt-btn.loading { opacity: .5; }
@keyframes mtPulse { 50% { opacity: .45; } }
.pop-menu { position: fixed; z-index: 1000; min-width: 220px; max-width: 300px; max-height: 70vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 14px 36px rgba(10,20,32,.22); }
.pop-menu button { display: block; width: 100%; text-align: right; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.pop-menu button:hover { background: var(--user); }
.pop-menu .pop-head { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; font-weight: 700; }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.toast-box { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--navy-deep); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.25); transition: opacity .35s; }
.toast.out { opacity: 0; }
.fb-form { max-width: 780px; margin: 6px auto 0; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); resize: vertical; }
.share-dlg { max-width: 520px; width: calc(100% - 32px); }
.share-link { display: flex; gap: 8px; margin: 12px 0; }
.share-link input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); font-size: 13px; }
.reader-dlg { width: min(900px, calc(100% - 24px)); max-width: none; height: calc(100% - 40px); max-height: none; padding: 0; border: 0; border-radius: 16px; background: var(--panel); color: var(--text); display: none; flex-direction: column; overflow: hidden; }
.reader-dlg[open] { display: flex; }
.reader-dlg::backdrop { background: rgba(10,20,32,.55); }
.reader-bar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.reader-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-body { flex: 1; overflow-y: auto; padding: 28px clamp(18px, 6vw, 64px) 48px; line-height: 2.1; }
.reader-body.bubble h2 { font-size: 1.35em; } .reader-body.bubble h3 { font-size: 1.15em; }
.reader-body.bubble table, .reader-body.bubble pre code { font-size: .85em; }
.grow { flex: 1; }

/* ---------- دستیارها در نوار کناری ---------- */
.side-toggle { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.side-toggle .tg-caret { transition: transform .15s; font-size: 14px; }
.side-toggle.closed .tg-caret { transform: rotate(90deg); }
.as-list { padding: 0 8px 4px; display: flex; flex-direction: column; gap: 1px; }
.as-item .as-ic { width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 14px; }
.as-item .as-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-chip { cursor: pointer; border: 0; font: inherit; }

/* ---------- صفحه‌ی گفتگوی اشتراکی ---------- */
.share-title { font-size: 22px; margin: 0 0 4px; }
.share-msgs { margin: 20px 0; }
.share-msgs .msg { max-width: none; }
.share-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 24px 0; }
