/* =================================================================
   هوشی — استایل‌های اختصاصی صفحه‌ها
   ================================================================= */

/* ============ هدر عمومی ============ */
.site-header {
  position: sticky; top: 0; z-index: 100; padding: 14px 0;
  transition: padding .3s, background .3s;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 20px; border-radius: var(--r-pill);
}
.site-header.scrolled .bar { box-shadow: var(--glass-shadow); }
.brand-logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; }
.brand-logo .mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad-brand); display: grid; place-items: center;
  color: #fff; box-shadow: 0 8px 20px -8px rgba(124,58,237,.6); position: relative; overflow: hidden;
}
.brand-logo .mark svg { width: 22px; height: 22px; }
.brand-logo small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-faint); margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 9px 15px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--ink-soft); transition: var(--t); }
.nav-links a:hover { background: var(--glass-2); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ============ صفحه‌ی فرود (Landing) ============ */
.hero { position: relative; overflow: hidden; padding: clamp(70px, 12vw, 150px) 0 clamp(50px, 8vw, 90px); text-align: center; }
.hero .eyebrow { display: inline-flex; margin-bottom: 22px; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { max-width: 640px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.hero-stat .n { font-size: 30px; font-weight: 800; }
.hero-stat .l { font-size: 13px; color: var(--ink-faint); }

/* پیش‌نمایش شناور چت در هیرو */
.hero-orbits { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-orbits span { position: absolute; border-radius: 50%; border: 1px solid var(--line); }
.hero-orbits span:nth-child(1) { width: 460px; height: 460px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.hero-orbits span:nth-child(2) { width: 700px; height: 700px; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: .6; }

/* شبکه‌ی ابزارها */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1080px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  padding: 26px 22px; border-radius: var(--r-lg); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px; min-height: 188px; transition: var(--t);
}
.tool-card .glow {
  position: absolute; width: 160px; height: 160px; border-radius: 50%; filter: blur(50px); opacity: .35;
  top: -50px; right: -40px; background: var(--grad-brand); transition: var(--t);
}
.tool-card:hover .glow { opacity: .55; transform: scale(1.2); }
.tool-card h3 { font-size: 17px; }
.tool-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; flex: 1; }
.tool-card .go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--violet); }
.tool-card .go svg { width: 15px; height: 15px; transition: var(--t); }
.tool-card:hover .go svg { transform: translateX(-4px); }

/* بخش‌های توضیحی */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px) { .feature-row { grid-template-columns: 1fr; } }
.feature { padding: 28px 24px; }
.feature h3 { margin: 16px 0 8px; }
.feature p { color: var(--ink-soft); font-size: 14px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 880px) { .steps { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 24px; position: relative; }
.step .n { width: 40px; height: 40px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--glass-brd); display: grid; place-items: center; font-weight: 800; color: var(--violet); margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* مقایسه‌ی پلن عادی و ابرینا */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .plan-grid { grid-template-columns: 1fr; } }
.plan { padding: 32px 28px; position: relative; overflow: hidden; }
.plan.featured { border-color: rgba(124,58,237,.4); }
.plan.featured::after { content: ""; position: absolute; inset: 0; background: var(--grad-aurora1); opacity: .14; pointer-events: none; }
.plan .ptitle { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.plan .price { font-size: 44px; font-weight: 800; line-height: 1; margin: 14px 0 4px; }
.plan .price small { font-size: 15px; font-weight: 600; color: var(--ink-faint); }
.plan ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.plan li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.plan li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--green); }

/* CTA پایانی */
.cta-band { padding: clamp(50px,8vw,90px) clamp(24px,5vw,70px); text-align: center; position: relative; overflow: hidden; border-radius: var(--r-xl); }
.cta-band::before { content: ""; position: absolute; inset: 0; background: var(--grad-brand); opacity: .12; }

/* فوتر */
.site-footer { padding: 56px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: 13px; color: var(--ink-faint); margin: 0 0 14px; font-weight: 700; }
.footer-grid a { display: block; padding: 5px 0; font-size: 14px; color: var(--ink-soft); transition: var(--t); }
.footer-grid a:hover { color: var(--violet); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--ink-faint); font-size: 13px; }

/* ============ پوسته‌ی اپلیکیشن (App Shell) ============ */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.app-sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid var(--line); overflow-y: auto;
}
.app-sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 18px; font-weight: 800; font-size: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r); font-size: 14.5px;
  font-weight: 600; color: var(--ink-soft); transition: var(--t); position: relative;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .8; }
.side-nav a:hover { background: var(--glass-2); color: var(--ink); }
.side-nav a.active { background: var(--glass); color: var(--ink); box-shadow: var(--glass-shadow); }
.side-nav a.active::before { content: ""; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 4px; background: var(--grad-brand); }
.side-section { font-size: 11px; font-weight: 700; color: var(--ink-faint); padding: 16px 14px 6px; letter-spacing: .04em; }

.side-tools { display: flex; flex-direction: column; gap: 2px; }
.side-tools a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r); font-size: 13.5px; color: var(--ink-soft); transition: var(--t); }
.side-tools a:hover { background: var(--glass-2); color: var(--ink); }
.side-tools a.active { background: var(--glass); color: var(--ink); }
.side-tools a .ti { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--glass-2); flex-shrink: 0; }
.side-tools a .ti svg { width: 15px; height: 15px; }

.side-foot { margin-top: auto; padding-top: 14px; }
.limit-card { padding: 14px; border-radius: var(--r); }
.limit-card .lc-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 9px; }
.limit-card .lc-bar { height: 8px; border-radius: 999px; background: var(--glass-2); overflow: hidden; }
.limit-card .lc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); transition: width .5s cubic-bezier(.22,1,.36,1); }
.limit-card .lc-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; padding: 14px clamp(18px,3vw,34px); }
.app-topbar .menu-toggle { display: none; }
.app-topbar h1 { font-size: 19px; font-weight: 700; margin: 0; }
.app-content { padding: clamp(18px,3vw,34px); padding-top: 10px; flex: 1; }

.user-pill { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--r-pill); }
.user-pill .av { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.user-pill .ui { font-size: 12.5px; line-height: 1.3; }
.user-pill .ui b { font-size: 13.5px; }

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; right: 0; top: 0; width: 280px; z-index: 200; transform: translateX(100%); transition: transform .3s; background: var(--bg-solid); }
  .app-sidebar.open { transform: none; box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); }
  .app-topbar .menu-toggle { display: inline-grid; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

/* ============ داشبورد ============ */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px)  { .dash-grid { grid-template-columns: 1fr; } }
.stat-card { padding: 22px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat-card .sv { font-size: 32px; font-weight: 800; }
.stat-card .sl { font-size: 13px; color: var(--ink-soft); }
.stat-card .si { position: absolute; top: 18px; left: 18px; opacity: .9; }

.ring-wrap { display: flex; align-items: center; gap: 22px; }
.ring { --p: 0; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--violet) calc(var(--p)*1%), var(--glass-2) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--bg-solid); }
.ring .rv { position: relative; text-align: center; }
.ring .rv b { font-size: 26px; font-weight: 800; display: block; line-height: 1; }
.ring .rv span { font-size: 11px; color: var(--ink-faint); }

.dash-2col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
@media (max-width: 1024px) { .dash-2col { grid-template-columns: 1fr; } }
.panel { padding: 24px; }
.panel .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel .panel-head h3 { font-size: 16px; }

.bars { display: flex; align-items: flex-end; gap: 7px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--grad-cool); border-radius: 7px 7px 3px 3px; min-height: 4px; position: relative; transition: var(--t); opacity: .85; }
.bars .bar:hover { opacity: 1; transform: scaleY(1.03); }
.bars .bar .bv { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; opacity: 0; transition: var(--t); white-space: nowrap; }
.bars .bar:hover .bv { opacity: 1; }
.bars-x { display: flex; gap: 7px; margin-top: 8px; }
.bars-x span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-faint); }

.act-list { display: flex; flex-direction: column; gap: 4px; }
.act-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r); transition: var(--t); }
.act-item:hover { background: var(--glass-2); }
.act-item .ai { width: 34px; height: 34px; border-radius: 10px; background: var(--glass-2); display: grid; place-items: center; flex-shrink: 0; }
.act-item .ai svg { width: 17px; height: 17px; color: var(--violet); }
.act-item .at { flex: 1; min-width: 0; }
.act-item .at b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-item .at span { font-size: 11.5px; color: var(--ink-faint); }

.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.quick { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r); transition: var(--t); }
.quick:hover { transform: translateY(-3px); }
.quick b { font-size: 14px; display: block; }
.quick span { font-size: 12px; color: var(--ink-soft); }

/* ============ صفحه‌ی ابزار ============ */
.tool-layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
@media (max-width: 980px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-form-card { position: static; top: auto; order: 0; }
  .tool-result { order: 1; min-height: 0; }
  .result-empty { padding: 40px 20px; }
}
.tool-form-card { padding: 26px; }
/* چسبیدنِ کارت فرم فقط در دسکتاپ؛ در موبایل/تبلت هرگز sticky نمی‌شود تا روی نتیجه نیفتد */
@media (min-width: 981px) { .tool-form-card { position: sticky; top: 88px; } }
.tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.tool-head h2 { font-size: 19px; } .tool-head p { font-size: 12.5px; color: var(--ink-faint); margin: 2px 0 0; }

.tool-result { min-height: 300px; }
.result-empty { padding: 70px 30px; text-align: center; color: var(--ink-faint); }
.result-empty .ico { width: 72px; height: 72px; border-radius: 22px; background: var(--glass-2); display: grid; place-items: center; margin: 0 auto 18px; }
.result-empty .ico svg { width: 34px; height: 34px; opacity: .6; }

.result-loading { padding: 50px; text-align: center; }
.result-card { padding: 26px; }

/* رندر خروجی ابزارها */
.rec-card { padding: 18px; border-radius: var(--r); margin-bottom: 12px; border-right: 4px solid var(--violet); position: relative; }
.rec-card.high { border-right-color: var(--red); }
.rec-card.medium { border-right-color: var(--amber); }
.rec-card.low { border-right-color: var(--green); }
.rec-card h4 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.rec-card .why { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 10px; }
.rec-card .action { font-size: 13px; background: var(--glass-2); padding: 9px 13px; border-radius: var(--r-sm); display: flex; gap: 8px; align-items: flex-start; }
.rec-card .action svg { width: 16px; height: 16px; color: var(--violet); flex-shrink: 0; margin-top: 2px; }

.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
.domain-card { padding: 16px; border-radius: var(--r); transition: var(--t); cursor: default; }
.domain-card:hover { transform: translateY(-3px); }
.domain-card .dn { font-size: 16px; font-weight: 700; word-break: break-all; }
.domain-card .dn .tld { color: var(--violet); }
.domain-card .dr { font-size: 12px; color: var(--ink-soft); margin: 6px 0 10px; min-height: 32px; }
.domain-card .dm { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.domain-card .dm .mbar { flex: 1; height: 5px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.domain-card .dm .mbar i { display: block; height: 100%; background: var(--grad-cool); }

.swot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 560px) { .swot { grid-template-columns: 1fr; } }
.swot-box { padding: 16px; border-radius: var(--r); }
.swot-box h5 { margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.swot-box ul { margin: 0; padding-right: 18px; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.swot-box.s { background: rgba(16,185,129,.08); } .swot-box.s h5 { color: var(--green); }
.swot-box.w { background: rgba(239,68,68,.07); }  .swot-box.w h5 { color: var(--red); }
.swot-box.o { background: rgba(38,53,217,.07); }   .swot-box.o h5 { color: var(--blue); }
.swot-box.t { background: rgba(245,158,11,.08); }  .swot-box.t h5 { color: var(--amber); }

.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 12px; margin-bottom: 18px; }
.score-item { text-align: center; padding: 16px 10px; border-radius: var(--r); }
.score-item .sn { font-size: 28px; font-weight: 800; }
.score-item .sl { font-size: 12px; color: var(--ink-faint); }
.score-ring { --p: 0; --c: var(--violet); width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p)*1%), var(--glass-2) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg-solid); }
.score-ring b { position: relative; font-size: 20px; font-weight: 800; }

.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border-radius: var(--r); }
.check-item .ci { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; }
.check-item .ci svg { width: 15px; height: 15px; }
.check-item.done .ci { background: rgba(16,185,129,.16); color: var(--green); }
.check-item.action .ci { background: rgba(245,158,11,.18); color: var(--amber); }
.check-item.critical .ci { background: rgba(239,68,68,.16); color: var(--red); }
.check-item .ct b { font-size: 14px; display: block; }
.check-item .ct span { font-size: 12.5px; color: var(--ink-soft); }

.stack-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.stack-item { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 13px 15px; border-radius: var(--r); align-items: center; }
.stack-item .sl-layer { font-weight: 700; font-size: 13.5px; color: var(--violet); }
.stack-item .sl-choice b { font-size: 14px; } .stack-item .sl-choice span { font-size: 12.5px; color: var(--ink-soft); display: block; }

.sitemap-tree { padding: 4px; }
.sitemap-node { padding: 11px 15px; border-radius: var(--r-sm); background: var(--glass-2); margin-bottom: 7px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sitemap-children { padding-right: 22px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.sitemap-children span { padding: 6px 12px; border-radius: var(--r-pill); background: var(--glass-2); font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line); }

.brand-board { display: grid; gap: 16px; }
.palette { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 88px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.swatch .sw-color { height: 60px; } .swatch .sw-meta { padding: 7px 9px; font-size: 11px; }
.swatch .sw-meta b { display: block; font-size: 11.5px; } .swatch .sw-meta span { color: var(--ink-faint); }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-list .mi { padding: 11px 14px; border-radius: var(--r); background: var(--glass-2); font-size: 13.5px; display: flex; gap: 9px; align-items: flex-start; }
.msg-list .mi svg { width: 16px; height: 16px; color: var(--violet); flex-shrink: 0; margin-top: 2px; }

/* بلوک کد */
.code-block { border-radius: var(--r); overflow: hidden; border: 1px solid var(--glass-brd); background: #0d1227; margin: 12px 0; }
[data-theme="light"] .code-block { background: #0f1535; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08); }
.code-head .lang { font-size: 12px; color: #9aa3d4; font-family: ui-monospace, monospace; }
.code-head .copy-btn { background: rgba(255,255,255,.08); border: 0; color: #cdd3f5; font-size: 12px; padding: 5px 12px; border-radius: 8px; display: flex; align-items: center; gap: 5px; transition: var(--t); }
.code-head .copy-btn:hover { background: rgba(255,255,255,.16); }
.code-block pre { margin: 0; padding: 16px; overflow-x: auto; direction: ltr; text-align: left; }
.code-block code { font-family: ui-monospace, 'Fira Code', monospace; font-size: 13px; line-height: 1.7; color: #e6e9ff; white-space: pre; }

.result-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* ============ چت ============ */
/* صفحه‌ی چت به ارتفاع نمایشگر قفل می‌شود: نوار بالا ثابت، پیام‌ها اسکرول، کادر ارسال همیشه پایین می‌چسبد */
.page-chat .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.page-chat .app-main { height: 100vh; height: 100dvh; min-height: 0; }
.page-chat .app-topbar { flex-shrink: 0; }
.page-chat .app-content { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-stream { flex: 1; min-height: 0; overflow-y: auto; padding: clamp(18px,3vw,34px); }
.chat-composer { flex-shrink: 0; }
.chat-inner { width: min(820px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.chat-welcome { text-align: center; padding: clamp(30px,6vw,70px) 20px 30px; }
.chat-welcome .wl-orb { width: 76px; height: 76px; border-radius: 24px; background: var(--grad-brand); display: grid; place-items: center; margin: 0 auto 20px; box-shadow: 0 16px 40px -14px rgba(124,58,237,.6); animation: floaty 4s ease-in-out infinite; }
.chat-welcome .wl-orb svg { width: 38px; height: 38px; color: #fff; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.chat-welcome h2 { margin-bottom: 8px; }
.chat-welcome p { color: var(--ink-soft); max-width: 480px; margin: 0 auto; }
.suggestions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 600px; margin: 28px auto 0; }
@media (max-width: 560px) { .suggestions { grid-template-columns: 1fr; } }
.suggestion { padding: 14px 18px; border-radius: var(--r); text-align: right; font-size: 13.5px; color: var(--ink-soft); transition: var(--t); border: 1px solid var(--glass-brd); background: var(--glass-2); }
.suggestion:hover { background: var(--glass-hi); transform: translateY(-2px); color: var(--ink); }

.msg { display: flex; gap: 13px; animation: fadeUp .4s ease both; }
.msg .avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: 14px; }
.msg.user .avatar { background: var(--glass); border: 1px solid var(--glass-brd); color: var(--ink); }
.msg.bot .avatar { background: var(--grad-brand); color: #fff; }
.msg .bubble { padding: 14px 18px; border-radius: var(--r-lg); max-width: 100%; }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--grad-brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot .bubble { background: var(--glass); border: 1px solid var(--glass-brd); border-bottom-left-radius: 6px; }
.msg .bubble p { margin: 0 0 10px; } .msg .bubble p:last-child { margin: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 8px 0; padding-right: 20px; }
.msg .bubble li { margin: 4px 0; }
.msg .bubble a { color: var(--cyan); text-decoration: underline; }
.msg.user .bubble a { color: #fff; }

.chat-typing { display: flex; gap: 13px; }
.chat-typing .avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.chat-typing .bubble { padding: 16px 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-brd); }

.chat-composer { padding: 14px clamp(18px,3vw,34px) 22px; }
.composer-inner { width: min(820px,100%); margin: 0 auto; }
.composer-box { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 16px; border-radius: var(--r-xl); }
.composer-box textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; font-family: inherit; font-size: 15px; color: var(--ink); max-height: 160px; line-height: 1.7; padding: 8px 0; }
.composer-box textarea::placeholder { color: var(--ink-faint); }
.composer-send { width: 44px; height: 44px; border-radius: 50%; background: var(--grad-brand); color: #fff; border: 0; display: grid; place-items: center; flex-shrink: 0; transition: var(--t); box-shadow: 0 8px 20px -8px rgba(124,58,237,.6); }
.composer-send:hover:not(:disabled) { transform: scale(1.06); }
.composer-send:disabled { opacity: .5; cursor: not-allowed; }
.composer-send svg { width: 20px; height: 20px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding: 0 6px; font-size: 11.5px; color: var(--ink-faint); }

/* ============ احراز هویت ============ */
.page-auth { display: grid; place-items: center; min-height: 100vh; padding: 30px 20px; }
.auth-card { width: min(440px,100%); padding: 38px 34px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-logo .mark { width: 56px; height: 56px; border-radius: 18px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; box-shadow: 0 14px 34px -12px rgba(124,58,237,.6); }
.auth-logo .mark svg { width: 30px; height: 30px; }
.auth-card h1 { font-size: 23px; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.spam-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.28);
  color: var(--red); border-radius: 12px; padding: 11px 13px;
  font-size: 13px; line-height: 1.9; margin: 0 0 22px; text-align: right;
}
.spam-note [data-icon] { flex: 0 0 auto; margin-top: 3px; }
.spam-note b { font-weight: 700; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-img { height: 52px; border-radius: var(--r-sm); border: 1px solid var(--glass-brd); background: #fff; overflow: hidden; flex-shrink: 0; }
.captcha-img img, .captcha-img svg { height: 52px; display: block; }
.captcha-refresh { flex-shrink: 0; }
.otp-inputs { display: flex; gap: 9px; direction: ltr; justify-content: center; margin: 8px 0 4px; }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; padding: 0; border-radius: var(--r); background: var(--glass-2); border: 1px solid var(--glass-brd); color: var(--ink); transition: var(--t); }
.otp-inputs input:focus { border-color: var(--violet-400); box-shadow: var(--ring); outline: none; }
.auth-step { animation: fadeUp .4s ease both; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.resend { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 16px; }
.resend a { color: var(--violet); font-weight: 600; }
.alert { padding: 11px 15px; border-radius: var(--r); font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.alert.err { background: rgba(239,68,68,.1); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.alert.ok { background: rgba(16,185,129,.1); color: var(--green); border: 1px solid rgba(16,185,129,.25); }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 22px; }

/* ============ پنل ادمین ============ */
.admin-sidebar { background: var(--glass); }
.admin-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--grad-warm); color: #fff; }
.adm-table-wrap { overflow-x: auto; border-radius: var(--r); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-table th { text-align: right; padding: 13px 14px; font-size: 12px; color: var(--ink-faint); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.adm-table tr:hover td { background: var(--glass-2); }
.adm-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { padding: 5px 11px; font-size: 12px; border-radius: 8px; border: 1px solid var(--glass-brd); background: var(--glass-2); color: var(--ink); font-weight: 600; transition: var(--t); }
.mini-btn:hover { background: var(--glass-hi); }
.mini-btn.danger { color: var(--red); border-color: rgba(239,68,68,.3); }
.mini-btn.primary { background: var(--grad-brand); color: #fff; border-color: transparent; }
.admin-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-filters .input, .admin-filters .select { width: auto; min-width: 180px; }
.adm-form { display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.adm-form .field { margin-bottom: 18px; }
.mono { font-family: ui-monospace, monospace; direction: ltr; }
.log-level { display: inline-flex; width: 8px; height: 8px; border-radius: 50%; }
.log-level.info { background: var(--blue); } .log-level.warning { background: var(--amber); } .log-level.error { background: var(--red); }
.api-key-display { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: var(--r); background: var(--glass-2); font-family: ui-monospace, monospace; direction: ltr; font-size: 13px; }

/* انتقال نرم ورود اجزا */
.reveal-list > * { animation: fadeUp .5s cubic-bezier(.22,1,.36,1) both; }
.reveal-list > *:nth-child(2) { animation-delay: .05s; }
.reveal-list > *:nth-child(3) { animation-delay: .1s; }
.reveal-list > *:nth-child(4) { animation-delay: .15s; }
.reveal-list > *:nth-child(5) { animation-delay: .2s; }
.reveal-list > *:nth-child(6) { animation-delay: .25s; }

/* ============================================================
   اصلاحات ریسپانسیو و مهار سرریز (موبایل / لپ‌تاپ / دسکتاپ)
   هدف: هیچ محتوایی — به‌خصوص جدول و کدِ پاسخ هوش مصنوعی —
   نباید چیدمان را به‌هم بریزد یا سایدبار را جابه‌جا کند.
   ============================================================ */

/* هیچ‌چیز از عرض صفحه بیرون نزند (body در glass.css هم overflow-x: hidden دارد) */
html, body { max-width: 100%; }
html { overflow-x: clip; }
body { overflow-x: hidden; }

/* اجازه‌ی جمع‌شدن آیتم‌های فلکس/گرید تا سرریز نکنند */
.app-main, .app-content,
.tool-layout > *, .dash-2col > *, .panel,
.msg, .msg .bubble, .chat-inner, .chat-stream,
.tool-result, .result-card, .stat-card, .quick { min-width: 0; }

.app-main, .app-content { max-width: 100%; overflow-x: hidden; }

/* ---------- چت: حباب پیام ---------- */
.msg .bubble {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg .bubble > * { max-width: 100%; }
.msg .bubble p, .msg .bubble li { overflow-wrap: anywhere; }

/* ---------- جدول‌ها در خروجی هوش مصنوعی (چت و ابزار) ---------- */
/* خود جدول به‌صورت بلوک و قابل‌اسکرول افقی می‌شود تا چیدمان را پهن نکند */
.msg .bubble table,
.result-card table,
.chat-inner table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.msg .bubble th, .msg .bubble td,
.result-card th, .result-card td,
.chat-inner th, .chat-inner td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: right;
  white-space: nowrap;
}
.msg .bubble thead th, .result-card thead th { background: var(--glass-2); font-weight: 700; }

/* ---------- کد و pre در خروجی ---------- */
.msg .bubble pre, .result-card pre, .chat-inner pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}
.msg .bubble :not(pre) > code,
.result-card :not(pre) > code {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.code-block { max-width: 100%; }

/* کارت نتیجه نباید سرریز کند */
.result-card { overflow: hidden; }
.tool-result { max-width: 100%; }

/* جدول‌های ادمین فقط داخل wrapper خودشان اسکرول شوند */
.adm-table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }

/* لینک/دامنه‌های طولانی بشکنند */
.domain-card .dn, .api-key-display { overflow-wrap: anywhere; word-break: break-all; }

/* نمودار میله‌ای در صفحه‌ی کوچک قابل اسکرول */
.bars { max-width: 100%; }

/* ---------- ریزتنظیم‌های موبایل ---------- */
@media (max-width: 600px) {
  .app-content { padding: 16px 14px; }
  .result-card { padding: 18px 16px; }
  .panel { padding: 18px 16px; }
  .msg .bubble { padding: 12px 14px; }
  .otp-inputs { gap: 7px; }
  .otp-inputs input { width: 40px; height: 48px; font-size: 20px; }
  .swatch { width: 72px; }
  .bars { overflow-x: auto; padding-bottom: 6px; }
  .bars .bar { min-width: 14px; }
  .app-topbar h1 { font-size: 16px; }
  .hero-stats { gap: 18px; flex-wrap: wrap; }
}

/* جدول‌های ادمین در موبایل کمی فشرده‌تر */
@media (max-width: 600px) {
  .adm-table th, .adm-table td { padding: 10px 9px; font-size: 12.5px; }
}

/* لپ‌تاپ‌های باریک: سایدبار کمی جمع‌تر تا فضای محتوا بیشتر شود */
@media (min-width: 1025px) and (max-width: 1280px) {
  .app-shell { grid-template-columns: 240px 1fr; }
}

/* ============================================================
   ریسپانسیو جامع — تبلت و موبایل (همه‌ی بخش‌ها)
   ============================================================ */

/* تبلت (سایدبار جمع‌شده): فرم‌ها و فیلترهای ادمین تمام‌عرض */
@media (max-width: 1024px) {
  .admin-filters { gap: 8px; }
  .admin-filters .input, .admin-filters .select { min-width: 0; flex: 1 1 160px; }
  .adm-form { max-width: 100%; }
  .ring-wrap { gap: 18px; }
  .tool-layout { grid-template-columns: 1fr; }
}

/* تبلت کوچک / موبایل بزرگ */
@media (max-width: 780px) {
  .ring-wrap { flex-direction: column; text-align: center; align-items: stretch; }
  .ring-wrap .score-ring, .ring-wrap .ring { margin: 0 auto; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 26px; }
  .plan .price { font-size: 38px; }
  .tool-head h2 { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* موبایل */
@media (max-width: 600px) {
  .app-topbar { padding: 12px 14px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .admin-filters { flex-direction: column; }
  .admin-filters .input, .admin-filters .select, .admin-filters .btn { width: 100%; flex: 1 1 100%; }
  .adm-table .actions { gap: 5px; }
  .quick-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .composer-box { padding: 6px 6px 6px 12px; }
  .composer-send { width: 40px; height: 40px; }
  .composer-send svg { width: 18px; height: 18px; }
  .composer-foot { font-size: 10.5px; gap: 8px; }
  .captcha-row { flex-wrap: wrap; }
  .captcha-row .input { flex: 1 1 100%; order: 3; }
  .auth-card { padding: 28px 20px; }
  .tool-head .icon-orb { width: 46px; height: 46px; }
  .tool-form-card, .panel, .result-card { padding: 18px 16px; }
  .plan { padding: 26px 20px; }
  .stat-card { padding: 16px 14px; }
  .side-brand, .app-topbar h1 { font-size: 16px; }
}

/* موبایل کوچک */
@media (max-width: 420px) {
  .app-content { padding: 14px 11px; }
  .otp-inputs { gap: 6px; }
  .otp-inputs input { width: 38px; height: 46px; font-size: 18px; }
  .stat-card .sv { font-size: 22px; }
  .msg .avatar, .chat-typing .avatar { width: 32px; height: 32px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* روی صفحه‌های پهن سایدبارِ آف‌کنواس عرض راحت‌تری بگیرد */
@media (max-width: 1024px) and (min-width: 480px) {
  .app-sidebar { width: 300px; }
}
@media (max-width: 380px) {
  .app-sidebar { width: 86vw; }
}

/* ============================================================
   اتصال سایت — استایل‌های افزوده
   ============================================================ */
.chip.on { background: rgba(26,127,55,.12); color: #1a7f37; border-color: rgba(26,127,55,.3); }
.site-card { transition: transform .2s ease, box-shadow .2s ease; }
.site-card:hover { transform: translateY(-3px); }
.site-badge { backdrop-filter: blur(8px); }
[data-theme="dark"] .chip.on { background: rgba(52,211,103,.15); color: #4ade80; }
.hooshi-modal code { font-family: 'Vazirmatn', monospace; }
.connect-steps .step .n,
.connect-steps .step .n span { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr !important; }
  .connect-steps { grid-template-columns: 1fr !important; }
  .adm-stats { grid-template-columns: 1fr !important; }
}
