
    /* ecosystem palette (brand.css tokens) */
:root{
  color-scheme: dark;
  --bg:#041F3D; --surface:#08305A; --surface-2:#0b3b6b; --border:#17466F;
  --text:#EAF3FB; --muted:#A5BDD3;
  --primary:#00B4FF; --secondary:#00E5BB; --success:#00E5BB; --danger:#ff6577;
  --radius:18px; --shadow:0 18px 60px rgba(0,0,0,.28);
  /* tokens used by /shared/css/agent.css */
  --blue:#00B4FF; --tq:#00E5BB; --gold:#FFD700; --line:#17466F; --panel:#08305A;
  --blue-rgb:0,180,255; --gold-rgb:255,215,0; --tq-rgb:0,229,187; --ease:cubic-bezier(.22,.9,.3,1);
}
@font-face{font-family:"Vazirmatn";src:local("Vazirmatn"),url("/shared/fonts/Vazirmatn-VF.woff2") format("woff2");font-weight:100 900;font-display:swap}
a.button{text-decoration:none;display:inline-block}

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(ellipse at 85% 0%, rgba(0,180,255,.13), transparent 40%),
        var(--bg);
      color: var(--text);
      font-family: "Vazirmatn", Tahoma, sans-serif;
      line-height: 1.8;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible,
    select:focus-visible, textarea:focus-visible {
      outline: 2px solid var(--secondary);
      outline-offset: 3px;
    }

    .container { width: min(1240px, 92%); margin: auto; }

    header {
      border-bottom: 1px solid rgba(154,171,199,.13);
      background: rgba(8,13,25,.78);
      backdrop-filter: blur(18px);
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      min-height: 76px;
    }

    .brand { display: flex; align-items: center; gap: 12px; }
    .brand-icon {
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      border-radius: 14px;
      background: linear-gradient(135deg, var(--primary), #00E5BB);
      font-size: 23px;
      box-shadow: 0 8px 25px rgba(0,180,255,.3);
    }

    .brand strong { display: block; font-size: 15px; }
    .brand small { color: var(--muted); font-size: 11px; }

    .nav-actions { display: flex; align-items: center; gap: 8px; }

    .button {
      border: 1px solid var(--border);
      border-radius: 11px;
      padding: 10px 15px;
      background: var(--surface-2);
      color: var(--text);
      transition: .2s ease;
    }

    .button:hover { transform: translateY(-1px); border-color: #5875aa; }
    .button.primary {
      border-color: transparent;
      background: linear-gradient(120deg, var(--primary), #00E5BB);
      font-weight: 700;
    }

    .button.ghost { background: transparent; }
    .button.small { padding: 7px 11px; font-size: 12px; }
    .button:disabled { opacity: .5; cursor: not-allowed; }

    .hero { padding: 46px 0 28px; }

    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 5px 11px;
      border: 1px solid rgba(0,212,255,.22);
      border-radius: 999px;
      background: rgba(0,212,255,.06);
      color: #72e8ff;
      font-size: 12px;
    }

    h1 {
      margin: 15px 0 8px;
      font-size: clamp(28px, 4vw, 44px);
      line-height: 1.4;
      letter-spacing: -.8px;
    }

    .gradient-text {
      background: linear-gradient(90deg, #79e9ff, #7da5ff, #b39aff);
      color: transparent;
      background-clip: text;
      -webkit-background-clip: text;
    }

    .hero p { max-width: 700px; color: var(--muted); margin: 0; }

    .features {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 20px;
      margin-top: 20px;
      color: #b7c7e0;
      font-size: 12px;
    }

    .features span::before { content: "✓"; color: var(--success); margin-left: 7px; }

    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 20px;
      padding: 12px 0 45px;
      align-items: start;
    }

    .panel {
      min-width: 0;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: rgba(16,24,42,.91);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 19px 21px;
      border-bottom: 1px solid var(--border);
    }

    .panel-head h2 { font-size: 16px; margin: 0; }
    .step { color: var(--secondary); font-size: 12px; }

    .panel-body { padding: 21px; }

    .field { margin-bottom: 18px; }
    .field:last-child { margin-bottom: 0; }

    label, .field-label {
      display: block;
      margin-bottom: 8px;
      color: #d9e5fa;
      font-size: 13px;
      font-weight: 600;
    }

    .hint { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }

    input, select, textarea {
      display: block;
      width: 100%;
      color: var(--text);
      background: #0b1323;
      border: 1px solid #2a3954;
      border-radius: 11px;
      padding: 12px 13px;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(0,180,255,.12);
    }

    textarea { resize: vertical; min-height: 92px; }
    select option { background: #10182a; }

    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

    .category-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 9px;
    }

    .category {
      min-width: 0;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #0b1323;
      color: #c9d6eb;
      padding: 12px 5px;
      font-size: 11px;
      text-align: center;
      transition: .2s ease;
    }

    .category .emoji { display: block; font-size: 22px; margin-bottom: 5px; }
    .category.active {
      border-color: var(--primary);
      background: rgba(0,180,255,.13);
      color: #fff;
      box-shadow: inset 0 0 0 1px rgba(0,180,255,.14);
    }

    .form-footer { display: flex; gap: 10px; margin-top: 22px; }
    .form-footer .button { flex: 1; }

    .output-panel { position: sticky; top: 94px; }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: #8ce8b0;
      font-size: 11px;
    }

    .status-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
    }

    .output-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }

    .output {
      min-height: 390px;
      max-height: 660px;
      overflow: auto;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      padding: 18px;
      border: 1px solid #2a3954;
      border-radius: 13px;
      background: #090f1d;
      color: #dbe7fa;
      font-family: "Vazirmatn", Tahoma, sans-serif;
      font-size: 13px;
      line-height: 2.1;
      direction: rtl;
    }

    .output:empty::before {
      content: "پرامپت نهایی پس از تکمیل فرم در این بخش نمایش داده می‌شود.";
      color: #788ba9;
    }

    .output-meta {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
      margin-top: 12px;
    }

    .notice {
      margin-top: 16px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid rgba(0,212,255,.18);
      background: rgba(0,212,255,.05);
      color: #a9dce9;
      font-size: 11px;
    }

    .section { padding: 8px 0 42px; }
    .section-title { margin: 0 0 16px; font-size: 19px; }

    .template-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .template-card {
      padding: 17px;
      border: 1px solid var(--border);
      border-radius: 15px;
      background: var(--surface);
    }

    .template-card .emoji { font-size: 24px; }
    .template-card h3 { font-size: 14px; margin: 8px 0 5px; }
    .template-card p { font-size: 12px; color: var(--muted); margin: 0 0 14px; }

    .saved-list { display: grid; gap: 9px; }
    .saved-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
    }

    .saved-item strong { font-size: 12px; }
    .saved-item small { display: block; color: var(--muted); font-size: 10px; }
    .saved-actions { display: flex; flex-wrap: wrap; gap: 6px; }

    .empty-state { color: var(--muted); font-size: 12px; padding: 12px 0; }

    footer {
      border-top: 1px solid var(--border);
      padding: 23px 0;
      color: var(--muted);
      font-size: 11px;
    }

    .footer-inner {
      display: flex;
      justify-content: space-between;
      gap: 15px;
      flex-wrap: wrap;
    }

    .toast {
      position: fixed;
      bottom: 22px;
      left: 22px;
      z-index: 50;
      max-width: min(360px, calc(100vw - 44px));
      padding: 12px 17px;
      border: 1px solid #344665;
      border-radius: 12px;
      background: #17233a;
      box-shadow: var(--shadow);
      color: white;
      font-size: 12px;
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
      transition: .22s ease;
    }

    .toast.show { opacity: 1; transform: translateY(0); }

    body.light {
      color-scheme: light;
      --bg: #f4f7fc;
      --surface: #fff;
      --surface-2: #edf2fb;
      --border: #dbe3f0;
      --text: #17233a;
      --muted: #64748b;
      background: #f4f7fc;
    }

    body.light header { background: rgba(255,255,255,.9); }
    body.light .panel { background: #fff; }
    body.light input, body.light select, body.light textarea,
    body.light .category, body.light .output {
      background: #f8faff;
      color: #17233a;
      border-color: #dbe3f0;
    }
    body.light .category { color: #334155; }
    body.light .category.active { background: #eaf0ff; color: #173c91; }
    body.light .template-card, body.light .saved-item { background: #fff; }
    body.light .panel-head h2, body.light label { color: #17233a; }

    @media (max-width: 900px) {
      .workspace { grid-template-columns: 1fr; }
      .output-panel { position: static; }
      .output { min-height: 280px; }
    }

    @media (max-width: 600px) {
      .container { width: 94%; }
      .hero { padding-top: 30px; }
      .nav { min-height: 66px; }
      .nav-actions .button { padding: 8px 10px; font-size: 11px; }
      .panel-head, .panel-body { padding: 15px; }
      .grid-2 { grid-template-columns: 1fr; gap: 0; }
      .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .template-grid { grid-template-columns: 1fr; }
      .form-footer { flex-direction: column; }
      .output-toolbar .button { flex: 1; }
      .saved-item { align-items: flex-start; flex-direction: column; }
    }

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