:root {
  --bg: #07080c;
  --bg-2: #10131a;
  --card: rgba(16, 18, 26, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f6f8;
  --muted: #9aa1b0;
  --violet: #8b6cff;
  --mint: #3ee0c5;
  --danger: #ff5d73;
  --warn: #f5c16c;
  --ok: #3ee0c5;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(139, 108, 255, 0.22), transparent 55%),
    radial-gradient(700px 420px at -10% 20%, rgba(62, 224, 197, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.app-hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(16px);
  background: rgba(7, 8, 12, 0.72);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.03em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.brand span { font-size: 18px; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav button, .btn, .ghost, .primary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}
.primary {
  border: 0;
  background: linear-gradient(135deg, var(--violet), #5b8cff 55%, var(--mint));
  color: #071018;
  font-weight: 700;
}
.ghost:hover, .nav button:hover, .btn:hover { border-color: rgba(255,255,255,.2); }
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 36px;
  padding: 54px 7vw 30px;
  align-items: center;
}
.kicker {
  display: inline-flex; gap: 8px; align-items: center;
  color: var(--mint); font-size: 13px; letter-spacing: .08em;
}
h1 { font-size: clamp(34px, 5vw, 62px); line-height: 1.15; margin: 10px 0 12px; letter-spacing: -0.04em; }
.lede { color: var(--muted); font-size: 18px; line-height: 1.9; max-width: 640px; }
.cta-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0c0e14;
}
.hero-card img { height: 360px; width: 100%; object-fit: cover; }
.hero-meta { display: flex; justify-content: space-between; padding: 14px 16px; color: var(--muted); font-size: 13px; }
.grid-3, .grid-4 { display: grid; gap: 14px; padding: 10px 7vw 50px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 8px; }
.card p, .muted { color: var(--muted); line-height: 1.8; }
.price { font-size: 28px; font-weight: 800; margin: 8px 0; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh - 65px); }
.side {
  border-left: 1px solid var(--line);
  padding: 18px 12px;
  background: rgba(8, 9, 14, .65);
}
.side button {
  width: 100%; text-align: right; margin-bottom: 6px;
  background: transparent; color: var(--text);
  border: 0; border-radius: 12px; padding: 11px 12px; cursor: pointer;
}
.side button.active, .side button:hover { background: rgba(139, 108, 255, .16); }
.main { padding: 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.credits { display: flex; gap: 8px; }
.pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  color: var(--muted); font-size: 12px; background: rgba(255,255,255,.03);
}
.workspace { display: grid; grid-template-columns: 280px 1fr; gap: 14px; min-height: 68vh; }
.list, .panel {
  background: rgba(12, 14, 20, .8);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.list { padding: 10px; overflow: auto; }
.thread, .job {
  padding: 10px; border-radius: 12px; cursor: pointer; margin-bottom: 6px;
}
.thread.active, .thread:hover, .job:hover { background: rgba(255,255,255,.04); }
.chat {
  display: flex; flex-direction: column; min-height: 68vh;
}
.messages { flex: 1; padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 76%; padding: 12px 14px; border-radius: 16px; line-height: 1.85; white-space: pre-wrap;
}
.bubble.user { align-self: flex-start; background: linear-gradient(135deg, rgba(139,108,255,.9), rgba(91,140,255,.85)); color: white; }
.bubble.ai { align-self: flex-end; background: #171a22; border: 1px solid var(--line); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
textarea, input, select {
  width: 100%; background: #0d1016; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
textarea { min-height: 74px; resize: vertical; }
.form { display: grid; gap: 10px; }
label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.62);
  display: flex; align-items: center; justify-content: center; z-index: 40; padding: 18px;
}
.modal { width: min(460px, 100%); background: #12151c; border: 1px solid var(--line); border-radius: 22px; padding: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 6px; text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.shot { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0c0e14; }
.shot img { height: 240px; width: 100%; object-fit: cover; }
.shot div { padding: 10px; font-size: 12px; color: var(--muted); }
.player {
  position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #000; min-height: 320px;
}
.player img { width: 100%; height: 420px; object-fit: cover; animation: ken 8s ease-in-out infinite alternate; }
.player .badge {
  position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.55);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 12px;
}
@keyframes ken { from { transform: scale(1); } to { transform: scale(1.08); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat b { display: block; font-size: 26px; margin-top: 4px; }
.toast {
  position: fixed; bottom: 18px; left: 18px; background: #151821; border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 12px; z-index: 50; max-width: 320px;
}
.danger { color: var(--danger); }
.small { font-size: 12px; color: var(--muted); }
footer.note { color: var(--muted); text-align: center; padding: 10px 20px 28px; font-size: 13px; }
@media (max-width: 980px) {
  .hero, .grid-3, .grid-4, .shell, .workspace, .stats { grid-template-columns: 1fr; }
  .side { border-left: 0; border-bottom: 1px solid var(--line); }
  .hero-card img, .player img { height: 240px; }
}
