  @font-face {
      font-family: 'YekanBakh';
      src: url('/font/yekanbakh/YekanBakh-Regular_0.ttf') format('truetype');
      font-weight: 400;
  }

  @font-face {
      font-family: 'YekanBakh';
      src: url('/font/yekanbakh/YekanBakh-Bold.ttf') format('truetype');
      font-weight: 700;
  }

  * {
      font-family: 'YekanBakh', sans-serif;
      box-sizing: border-box;
  }

  :root {
      --bg-dark: #0b1020;
      --sidebar-bg: #111827;
      --panel-bg: #1f2937;
      --primary: #6366f1;
      --accent: #8b5cf6;
      --success: #10b981;
      --danger: #ef4444;
      --text-main: #f9fafb;
      --text-muted: #94a3b8;
      --border: #2b3548;
  }

  body {
      margin: 0;
      height: 100vh;
      overflow: hidden;
      display: flex;
      background: var(--bg-dark);
      color: var(--text-main);
  }

  #sidebar {
      width: 370px;
      background: var(--sidebar-bg);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 22px;
      gap: 14px;
      flex-shrink: 0;
  }

  .sidebar-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
  }

  .sidebar-header h2 {
      margin: 0;
      font-size: 18px;
      font-weight: 700;
  }

  .top-actions {
      display: flex;
      gap: 8px;
  }

  .small-btn {
      border: 1px solid var(--border);
      background: var(--panel-bg);
      color: white;
      padding: 8px 12px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 12px;
      transition: .2s;
  }

  .small-btn:hover {
      background: var(--primary);
      border-color: var(--primary);
  }

  #home-btn {
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: center;
  }

  textarea {
      width: 100%;
      min-height: 130px;
      resize: none;
      background: var(--panel-bg);
      border: 1px solid var(--border);

      color: white;
      padding: 14px;
      outline: none;
      direction: ltr;
  }

  .textarea {
      border-radius: 14px;
  }

  #gen-btn {
      width: 100%;
      border: none;
      border-radius: 14px;
      padding: 15px;
      background: linear-gradient(135deg, var(--primary), var(--accent));
      color: white;
      font-weight: bold;
      cursor: pointer;
      transition: .25s;
  }

  #gen-btn:hover {
      transform: translateY(-1px);
  }

  #gen-btn:disabled {
      opacity: .5;
      cursor: not-allowed;
  }

  .phase-wrapper {
      background: #0b1220;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 14px;
  }

  .phase-title {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 12px;
  }

  .phase-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
  }

  .phase-item {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #64748b;
      font-size: 13px;
      transition: .25s;
  }

  .phase-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #334155;
      flex-shrink: 0;
      transition: .25s;
  }

  .phase-item.active {
      color: white;
  }

  .phase-item.active .phase-dot {
      background: var(--primary);
      box-shadow: 0 0 12px var(--primary);
  }

  .phase-item.done {
      color: #d1fae5;
  }

  .phase-item.done .phase-dot {
      background: var(--success);
      box-shadow: 0 0 10px var(--success);
  }

  .console-container {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
      min-height: 0;
  }

  .console-label {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 8px;
  }

  .console-logs {
      flex-grow: 1;
      overflow-y: hidden;
      background: #050816;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px;
      color: #c4b5fd;
      font-size: 11px;
      line-height: 1.8;
      white-space: pre-wrap;
      word-break: break-word;
      direction: ltr;
      margin: 0;
  }

  #preview-area {
      flex-grow: 1;
      padding: 20px;
  }

  .canvas-container {
      width: 100%;
      height: 100%;
      border-radius: 20px;
      overflow: hidden;
      position: relative;
      border: 1px solid var(--border);
      background: white;
  }

  #canvas {
      width: 100%;
      height: 100%;
      border: none;
      position: relative;
      z-index: 1;
      background: white;
  }

  #ai-loader {
      position: absolute;
      inset: 0;
      background:
          radial-gradient(circle at top, rgba(99, 102, 241, 0.25), transparent 50%),
          linear-gradient(180deg, #0b1020 0%, #050816 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 18px;
      z-index: 20;
      transition: .4s;
  }

  #ai-loader.hidden {
      opacity: 0;
      pointer-events: none;
  }

  .loader-orb {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--accent));
      position: relative;
      animation: pulse 2s infinite;
      box-shadow: 0 0 40px rgba(99, 102, 241, 0.7);
  }

  .loader-orb::after {
      content: '';
      position: absolute;
      inset: -12px;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 50%;
      animation: spin 5s linear infinite;
  }

  #loader-status {
      font-size: 20px;
      font-weight: bold;
  }

  #loader-info {
      color: var(--text-muted);
      font-size: 13px;
  }

  #finish-message {
      position: absolute;
      bottom: 30px;
      left: 30px;
      background: var(--sidebar-bg);
      border: 1px solid var(--border);
      color: #d1fae5;
      padding: 12px 18px;
      border-radius: 12px;
      backdrop-filter: blur(10px);
      opacity: 0;
      transform: translateY(10px);
      transition: .35s;
      z-index: 30;
  }

  #finish-message.show {
      opacity: 1;
      transform: translateY(0);
  }

  @keyframes pulse {

      0%,
      100% {
          transform: scale(1);
      }

      50% {
          transform: scale(1.08);
      }
  }

  @keyframes spin {
      from {
          transform: rotate(0deg);
      }

      to {
          transform: rotate(360deg);
      }
  }