@import url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/Vazirmatn-font-face.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1b2340;
  --soft: #6b7699;
  --line: #e3e8f4;
  --brand: #2f6bff;
  --brand-2: #00b894;
  --card: #ffffff;
}

html, body { height: 100%; }

body {
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 100% 0%, #dff3ff 0%, transparent 60%),
    radial-gradient(800px 500px at 0% 100%, #e2fbf1 0%, transparent 60%),
    #f7f9ff;
  display: flex;
  justify-content: center;
  padding: 18px;
  min-height: 100%;
}

.wrap {
  width: 100%;
  max-width: 780px;
  height: calc(100vh - 36px);
  max-height: 920px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(36, 64, 130, 0.13);
}

/* ---------- سربرگ ---------- */

.head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #ffffff, #f2f7ff);
}

.logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.3);
}

.titles { flex: 1 1 auto; min-width: 0; }

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 15px;
  object-fit: cover;
}

.titles h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  direction: ltr;
  text-align: right;
}

.titles p {
  font-size: 12px;
  color: var(--soft);
  margin-top: 3px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--soft);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.18s;
}

.icon-btn:hover { color: var(--brand); border-color: #c9d8ff; background: #f4f8ff; }

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

.stage {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #fbfdff, #f7f9ff);
}

.stage::-webkit-scrollbar { width: 8px; }
.stage::-webkit-scrollbar-thumb { background: #d8e0f3; border-radius: 99px; }

.row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 88%;
  animation: rise 0.25s ease both;
}

.row.bot { align-self: flex-start; }
.row.me { align-self: flex-end; flex-direction: row-reverse; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.mini {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
}

.row.me .mini { background: #dfe6f7; color: #4a5a80; }

.say {
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.95;
  white-space: pre-line;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(40, 70, 140, 0.06);
}

.row.me .say {
  color: #fff;
  background: linear-gradient(140deg, #2f6bff, #4f8bff);
  border-color: transparent;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 6px;
  box-shadow: 0 8px 20px rgba(47, 107, 255, 0.25);
}

.say a {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

/* ---------- کارت هوا ---------- */

.weather .say {
  padding: 0;
  overflow: hidden;
  border-color: #cfe9ff;
  background: linear-gradient(150deg, #f2f9ff, #eefcf7);
}

.w-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.w-emoji { font-size: 34px; line-height: 1; }

.w-city { font-size: 14px; font-weight: 700; }

.w-cond { font-size: 12.5px; color: var(--soft); margin-top: 2px; }

.w-temp {
  margin-inline-start: auto;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.w-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.w-pill {
  font-size: 11.5px;
  color: #3c4a6b;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e2eefb;
  border-radius: 999px;
  padding: 5px 10px;
}

/* ---------- کارت قیمت دلار ---------- */

.price .say {
  padding: 0;
  overflow: hidden;
  border-color: #ffe1a8;
  background: linear-gradient(150deg, #fffaf0, #f4fdf8);
}

.p-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  flex-wrap: wrap;
}

.p-emoji { font-size: 30px; line-height: 1; }

.p-title { font-size: 14px; font-weight: 800; }

.p-src { font-size: 11.5px; color: var(--soft); margin-top: 3px; }

.p-amount {
  margin-inline-start: auto;
  font-size: 26px;
  font-weight: 800;
  direction: ltr;
  background: linear-gradient(140deg, #f5a01f, #d98200);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.p-unit {
  font-size: 12.5px;
  font-weight: 700;
  color: #a9720b;
  -webkit-text-fill-color: #a9720b;
  direction: rtl;
}

.p-change {
  font-size: 12px;
  color: #3c4a6b;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ffe1a8;
  border-radius: 999px;
  padding: 5px 10px;
  margin: 0 16px 10px;
  display: inline-block;
}

.p-note {
  font-size: 11.5px;
  color: var(--soft);
  padding: 0 16px 10px;
  line-height: 1.9;
}

.p-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.p-links a {
  font-size: 11.5px;
  font-weight: 700;
  color: #a9720b;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ffe1a8;
  border-radius: 999px;
  padding: 5px 10px;
}

.p-links a:hover { background: #fff; color: #7d5407; }

.p-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 12px;
}

.p-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #ffe9c4;
}

.p-row-label {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: #3c4a6b;
  margin-inline-end: auto;
}

.p-row-value {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 800;
  color: #a9720b;
  direction: ltr;
}

.p-row-unit {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--soft);
}

/* ---------- نقشهٔ خانه ---------- */

.row.plan { max-width: 97%; width: 97%; }

.plan .say {
  padding: 0;
  overflow: hidden;
  border-color: #cfe0f5;
  background: linear-gradient(150deg, #fbfdff, #f3f8ff);
}

.plan-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-head { font-size: 13.5px; font-weight: 800; color: #22304f; }

.plan-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 230px;
  padding: 5px;
  border-radius: 14px;
  background: #eef3fb;
  border: 1px solid #dbe6f6;
}

.plan-row {
  display: flex;
  gap: 5px;
  flex: 1 1 0;
  min-height: 0;
}

.room {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 9px;
  border: 1.5px solid #c7d5ea;
  display: grid;
  place-items: center;
  padding: 3px;
  overflow: hidden;
}

.room-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #2b3b5c;
  line-height: 1.5;
  text-align: center;
}

.room-living { background: #e7f1ff; border-color: #b6cdf2; }
.room-kitchen { background: #fff2e2; border-color: #f0cf9f; }
.room-bed { background: #e8f9ef; border-color: #a9dfc2; }
.room-bath { background: #e5f6fb; border-color: #a2d8e8; }
.room-wc { background: #eef1fa; border-color: #c2cbe6; }
.room-parking { background: #f0f1f4; border-color: #cdd1da; }
.room-yard { background: #eef9e5; border-color: #bce0a4; }
.room-balcony { background: #f6f0ff; border-color: #d3c3f0; }
.room-store { background: #fdf3ea; border-color: #e6c9b3; }
.room-office { background: #eaf6ff; border-color: #b3d9f4; }

.plan-note {
  font-size: 11px;
  color: var(--soft);
  line-height: 1.9;
}

/* ---------- عکس ساخته‌شده ---------- */

.row.image { max-width: 82%; }

.image .say {
  padding: 0;
  overflow: hidden;
  border-color: #e6d3f7;
  background: linear-gradient(150deg, #fdf7ff, #f6f8ff);
}

.img-card { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.img-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
  color: #22304f;
}

.img-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.img-badge.ai { background: #f4ecff; color: #7d4bd4; border: 1px solid #e2d2f8; }
.img-badge.photo { background: #eefaf4; color: #17795a; border: 1px solid #c9ecdc; }

.img-note {
  font-size: 11px;
  color: var(--soft);
  line-height: 1.9;
}

.img-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 170px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef3fb;
  border: 1px solid #e0e7f5;
}

.img-frame img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.img-frame img.on { opacity: 1; }

.img-loading {
  position: absolute;
  font-size: 12px;
  color: #6b7699;
  padding: 10px;
  text-align: center;
}

.img-prompt {
  font-size: 11px;
  color: var(--soft);
  direction: ltr;
  text-align: right;
  overflow-wrap: anywhere;
}

.img-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.img-links a {
  font-size: 11.5px;
  font-weight: 700;
  color: #7d4bd4;
  text-decoration: none;
  background: #f4ecff;
  border: 1px solid #e2d2f8;
  border-radius: 999px;
  padding: 5px 10px;
}

.img-links a:hover { background: #ece0ff; }

/* ---------- کارت جستجو ---------- */

.row.search { max-width: 92%; }

.search .say {
  padding: 0;
  overflow: hidden;
  border-color: #cfe3d6;
  background: linear-gradient(150deg, #f6fdf8, #f4f8ff);
}

.search-card { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

.search-head { font-size: 13px; font-weight: 800; color: #1f3b56; }

.search-answer {
  font-size: 12.5px;
  line-height: 1.95;
  color: #33415c;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e4eef7;
  border-radius: 11px;
  padding: 9px 11px;
}

.search-src { font-size: 11px; color: var(--soft); }

.search-links { display: flex; flex-wrap: wrap; gap: 7px; }

.search-links a {
  font-size: 11.5px;
  font-weight: 700;
  color: #17795a;
  text-decoration: none;
  background: #eefaf4;
  border: 1px solid #c9ecdc;
  border-radius: 999px;
  padding: 5px 10px;
}

.search-links a:hover { background: #e2f7ec; }

/* ---------- کارت فیلم ---------- */

.row.video { max-width: 94%; }

.video .say {
  padding: 0;
  overflow: hidden;
  border-color: #2a355c;
  background: linear-gradient(150deg, #101a36, #0c1428);
}

.video-card { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

.video-head { font-size: 13px; font-weight: 800; color: #eef2ff; }

.video-status { font-size: 11.5px; color: #a8b3d9; }

.video-holder { display: flex; flex-direction: column; gap: 8px; }

.made-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #000;
}

.video-dl {
  font-size: 12px;
  font-weight: 800;
  color: #10142c;
  background: linear-gradient(135deg, #ffcf5c, #ff9f43);
  border-radius: 999px;
  padding: 9px 12px;
  text-align: center;
  text-decoration: none;
}

.video-dl:hover { filter: brightness(1.05); }

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

.dots { display: flex; gap: 5px; padding: 4px 2px; }

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa7c7;
  animation: pulse 1.2s infinite;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.suggest {
  display: flex;
  gap: 8px;
  padding: 4px 18px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.suggest::-webkit-scrollbar { display: none; }

.tag {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 12.5px;
  color: #3d4a6d;
  background: #f2f6ff;
  border: 1px solid #e0e8f9;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.18s;
}

.tag:hover { background: #e6eeff; border-color: #bfd1ff; color: var(--brand); }

.bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.bar input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #f5f8ff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: 0.18s;
}

.bar input::placeholder { color: #98a3c0; }

.bar input:focus {
  background: #fff;
  border-color: #b7cbff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.go {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(47, 107, 255, 0.3);
  transition: 0.18s;
}

.go:hover { filter: brightness(1.06); transform: translateY(-2px); }
.go:active { transform: scale(0.96); }

.pick {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: #4a5a80;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s;
}

.pick:hover { border-color: #c9d8ff; background: #f4f8ff; transform: translateY(-2px); }
.pick:active { transform: scale(0.96); }

/* ---------- عکسی که کاربر می‌فرستد ---------- */

.photo-wrap { display: flex; flex-direction: column; gap: 6px; }

.me-photo {
  display: block;
  width: 100%;
  max-width: 230px;
  border-radius: 12px;
  cursor: zoom-in;
}

.photo-cap { font-size: 12.5px; color: #33415c; line-height: 1.8; }

.stage.drag { outline: 2px dashed var(--brand); outline-offset: -8px; }

.note {
  text-align: center;
  font-size: 11px;
  color: #939dbb;
  padding: 0 0 10px;
}

.note a { color: #6e7ea6; }

/* ---------- نشان کاربر ویژه / لینک مدیریت ---------- */

.vip-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff6e0;
  color: #a9720b;
  border: 1px solid #ffd98a;
  white-space: nowrap;
}

.vip-badge[hidden] { display: none; }

.foot-link {
  color: #6e7ea6;
  text-decoration: none;
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: #b9c5e2;
  text-underline-offset: 3px;
}

.foot-link:hover { color: var(--brand); }

.admin-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #a9720b;
  background: #fff6e0;
  border: 1px solid #ffd98a;
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 6px;
}

@media (max-width: 520px) {
  body { padding: 0; }
  .wrap { height: 100vh; max-height: none; border-radius: 0; border: none; }
  .row { max-width: 93%; }
  .head { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .titles { flex: 1 1 auto; }
  .vip-badge { order: 2; padding: 8px 9px; }
  .vip-text { display: none; }
  .head .icon-btn { order: 3; flex: 1 1 auto; text-align: center; }
  .p-row { flex-wrap: wrap; font-size: 12px; }
  .p-row-value { font-size: 12.5px; }
  .plan-grid { height: 200px; }
  .room-name { font-size: 10.5px; }
  .row.image { max-width: 94%; }
  .search-answer { font-size: 12px; }
  .img-frame img { max-height: 260px; }
}