    :root {
      --bg: #0a0a0a;
      --panel: #141414;
      --panel-glass: rgba(20, 20, 20, 0.7);
      --panel-strong: rgba(18, 18, 18, 0.92);
      --text: #f7f7fb;
      --muted: rgba(255, 255, 255, 0.6);
      --soft: rgba(255, 255, 255, 0.08);
      --soft-strong: rgba(255, 255, 255, 0.14);
      --accent-a: #6c63ff;
      --accent-b: #00d4aa;
      --accent-gradient: linear-gradient(135deg, #6c63ff, #00d4aa);
      --shadow-accent: 0 0 20px rgba(108, 99, 255, 0.3);
      --success: #27d7af;
      --danger: #ff6b8b;
      --radius: 16px;
      --radius-lg: 24px;
      --blur: blur(20px);
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      margin: 0;
      min-height: 100%;
      font-family: "Inter", sans-serif;
      background:
        radial-gradient(circle at top left, rgba(108, 99, 255, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(0, 212, 170, 0.16), transparent 24%),
        var(--bg);
      color: var(--text);
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
      background-size: 40px 40px;
      mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
      opacity: 0.35;
    }

    body::after {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background:
        radial-gradient(circle at 20% 20%, rgba(108, 99, 255, 0.12), transparent 22%),
        radial-gradient(circle at 80% 18%, rgba(0, 212, 170, 0.09), transparent 18%);
      filter: blur(60px);
      opacity: 0.8;
    }

    body,
    button,
    input,
    select,
    textarea,
    iframe,
    a {
      transition: all 0.3s ease;
    }

    button {
      border: 0;
      cursor: pointer;
      font: inherit;
    }

    input,
    textarea,
    select {
      font: inherit;
    }

    [hidden] {
      display: none !important;
    }

    .app-shell {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      padding: 24px;
    }

    .view {
      min-height: calc(100vh - 48px);
    }

    .glass-panel {
      background: var(--panel-glass);
      backdrop-filter: var(--blur);
      -webkit-backdrop-filter: var(--blur);
      border-radius: var(--radius);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
    }

    .brand-button {
      width: fit-content;
      padding: 0;
      text-align: left;
      background: transparent;
      border: 0;
    }

    .brand-link {
      color: inherit;
      text-decoration: none;
    }

    .brand-button:hover {
      transform: translateY(-1px);
    }

    .brand-button:focus-visible {
      outline: 2px solid rgba(108, 99, 255, 0.55);
      outline-offset: 6px;
      border-radius: 16px;
    }

    .brand-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(108, 99, 255, 0.24), rgba(0, 212, 170, 0.14));
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
      flex-shrink: 0;
      color: var(--text);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: -0.04em;
    }

    .brand-icon span {
      color: rgba(255, 255, 255, 0.94);
      font-size: 0.88rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      line-height: 1;
      text-transform: uppercase;
      text-shadow: 0 4px 10px rgba(108, 99, 255, 0.18);
    }

    .brand-text {
      min-width: 0;
    }

    .brand-title {
      margin: 0;
      font-size: clamp(1.5rem, 2vw, 2rem);
      font-weight: 700;
      line-height: 1;
      letter-spacing: -0.04em;
      background: var(--accent-gradient);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      text-shadow: 0 0 18px rgba(108, 99, 255, 0.32);
    }

    .brand-subtitle {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 0.9rem;
      letter-spacing: 0.03em;
    }

    .primary-btn,
    .download-btn,
    .send-btn,
    .auth-tab.active {
      background: var(--accent-gradient);
      color: white;
      box-shadow: 0 10px 30px rgba(4, 5, 12, 0.3);
    }

    .primary-btn,
    .ghost-btn,
    .download-btn {
      min-height: 44px;
      padding: 0 18px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      font-weight: 600;
    }

    .primary-btn:hover,
    .ghost-btn:hover,
    .download-btn:hover,
    .send-btn:hover,
    .project-card:hover,
    .project-delete-btn:hover,
    .auth-tab:hover,
    .topbar-back:hover {
      transform: translateY(-1px);
    }

    .primary-btn:hover,
    .download-btn:hover,
    .send-btn:hover {
      box-shadow: var(--shadow-accent);
    }

    .ghost-btn,
    .auth-tab,
    .topbar-back,
    .user-chip,
    .project-delete-btn {
      color: var(--text);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .primary-btn:disabled,
    .ghost-btn:disabled,
    .download-btn:disabled,
    .send-btn:disabled {
      cursor: not-allowed;
      opacity: 0.55;
      transform: none;
      box-shadow: none;
    }

    .auth-modal {
      position: fixed;
      inset: 0;
      z-index: 40;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(5, 5, 8, 0.72);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .auth-card {
      position: relative;
      width: min(100%, 520px);
      padding: 36px;
    }

    .auth-close {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 38px;
      height: 38px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      color: rgba(255, 255, 255, 0.82);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      font-size: 1.2rem;
      line-height: 1;
    }

    .auth-card .brand {
      justify-content: center;
      margin-bottom: 12px;
    }

    .auth-intro {
      margin: 0 0 24px;
      text-align: center;
      color: var(--muted);
      line-height: 1.6;
    }

    .auth-tabs {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-bottom: 18px;
      padding: 6px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .auth-tab {
      min-height: 46px;
      border-radius: 14px;
      font-weight: 600;
    }

    .auth-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 18px 0;
      color: rgba(255, 255, 255, 0.48);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }

    .auth-divider::before,
    .auth-divider::after {
      content: "";
      flex: 1;
      height: 1px;
      background: rgba(255, 255, 255, 0.08);
    }

    .google-auth-wrap {
      display: grid;
      gap: 10px;
      justify-items: center;
    }

    .google-button-shell {
      width: 100%;
      min-height: 44px;
      display: grid;
      place-items: center;
    }

    .auth-helper {
      margin: 0;
      color: rgba(255, 255, 255, 0.62);
      text-align: center;
      line-height: 1.5;
      font-size: 0.86rem;
    }

    .auth-form {
      display: grid;
      gap: 14px;
    }

    .form-field {
      display: grid;
      gap: 8px;
    }

    .form-label {
      font-size: 0.9rem;
      color: rgba(255, 255, 255, 0.78);
    }

    .input-control {
      width: 100%;
      min-height: 52px;
      padding: 0 16px;
      color: var(--text);
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      outline: none;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .input-control:focus {
      border-color: rgba(108, 99, 255, 0.45);
      box-shadow:
        0 0 0 1px rgba(108, 99, 255, 0.24),
        0 0 20px rgba(108, 99, 255, 0.12);
    }

    .notice {
      margin-bottom: 18px;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      line-height: 1.5;
      font-size: 0.92rem;
    }

    .notice.error {
      background: rgba(255, 107, 139, 0.12);
      color: #ffd9e2;
      border-color: rgba(255, 107, 139, 0.22);
    }

    .notice.success {
      background: rgba(39, 215, 175, 0.12);
      color: #d6fff5;
      border-color: rgba(39, 215, 175, 0.22);
    }

    .dashboard-header,
    .app-header,
    .editor-topbar {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px 18px;
    }

    .dashboard-header {
      justify-content: space-between;
      gap: 14px;
      padding: 10px 14px;
      margin-bottom: 14px;
    }

    .dashboard-header-section {
      flex: 1;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .dashboard-header-section.center {
      justify-content: center;
    }

    .dashboard-header-section.end {
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .user-chip {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
      padding: 0 16px;
      border-radius: 999px;
      color: rgba(255, 255, 255, 0.82);
    }

    .guest-chip {
      color: rgba(255, 255, 255, 0.68);
    }

    .dashboard-content {
      display: grid;
      gap: 18px;
    }

    .dashboard-copy {
      padding: 24px 26px;
    }

    .dashboard-copy h2 {
      margin: 0 0 8px;
      font-size: clamp(1.6rem, 2vw, 2rem);
      letter-spacing: -0.04em;
    }

    .dashboard-copy p {
      margin: 0;
      color: var(--muted);
      line-height: 1.6;
    }

    .projects-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 18px;
    }

    .project-card,
    .empty-projects {
      padding: 22px;
      border-radius: 22px;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 35%),
        var(--panel-glass);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .project-card {
      position: relative;
      display: grid;
      gap: 18px;
      cursor: pointer;
    }

    .project-card h3 {
      margin: 0;
      font-size: 1.08rem;
      letter-spacing: -0.03em;
      padding-right: 44px;
    }

    .project-card p {
      margin: 0;
      color: var(--muted);
      font-size: 0.92rem;
    }

    .project-card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: rgba(255, 255, 255, 0.72);
      font-size: 0.88rem;
    }

    .project-delete-btn {
      position: absolute;
      top: 18px;
      right: 18px;
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      color: #ffd9e2;
      background: rgba(255, 107, 139, 0.1);
      border-color: rgba(255, 107, 139, 0.18);
    }

    .project-delete-btn:hover {
      background: rgba(255, 107, 139, 0.16);
    }

    .empty-projects {
      text-align: center;
      color: var(--muted);
      padding: 40px 24px;
    }

    .editor-topbar {
      justify-content: space-between;
      margin-bottom: 16px;
      position: sticky;
      top: 16px;
      z-index: 12;
    }

    .topbar-back {
      min-height: 34px;
      padding: 0 10px;
      border-radius: 999px;
      white-space: nowrap;
      font-size: 0.84rem;
      color: var(--muted);
    }

    .project-name-chip {
      min-width: 0;
      flex: 1 1 240px;
      min-width: 220px;
      max-width: 420px;
      text-align: left;
      font-size: 0.92rem;
      font-weight: 500;
      letter-spacing: -0.02em;
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 0 0 0 12px;
      border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .save-group {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      min-width: 0;
    }

    .save-status {
      opacity: 0;
      transform: translateY(8px);
      color: #d6fff5;
      font-size: 0.88rem;
      pointer-events: none;
    }

    .save-status.show {
      animation: savedPulse 2.2s ease forwards;
    }

    .app-header {
      justify-content: space-between;
      gap: 14px;
      padding: 10px 14px;
      margin-bottom: 14px;
      position: sticky;
      top: 16px;
      z-index: 10;
    }

    .header-context {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1 1 260px;
    }

    .app-header .brand {
      gap: 10px;
      flex-shrink: 0;
    }

    .app-header .brand-icon {
      width: 36px;
      height: 36px;
      border-radius: 12px;
    }

    .app-header .brand-icon span {
      font-size: 0.76rem;
    }

    .app-header .brand-title {
      font-size: 1.2rem;
    }

    .app-header .ghost-btn,
    .app-header .primary-btn,
    .app-header .download-btn {
      min-height: 38px;
      padding: 0 14px;
      gap: 8px;
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
      min-width: 0;
    }

    .header-session {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .app-header .header-session,
    .dashboard-session {
      padding-left: 12px;
      border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dashboard-header .brand {
      gap: 10px;
    }

    .dashboard-header .brand-icon {
      width: 36px;
      height: 36px;
      border-radius: 12px;
    }

    .dashboard-header .brand-icon span {
      font-size: 0.76rem;
    }

    .dashboard-header .brand-title {
      font-size: 1.2rem;
    }

    .dashboard-header .primary-btn,
    .dashboard-header .ghost-btn {
      min-height: 38px;
      padding: 0 14px;
    }

    .dashboard-header .user-chip {
      min-height: 38px;
      padding: 0 12px;
    }

    .version-badge,
    .file-counter {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.06);
      font-size: 0.82rem;
      white-space: nowrap;
    }

    .app-header .version-badge {
      padding: 7px 10px;
      font-size: 0.76rem;
    }

    .version-badge::before,
    .file-counter::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
      box-shadow: 0 0 14px rgba(108, 99, 255, 0.45);
    }

    .model-picker {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 6px 8px 6px 12px;
      border-radius: 999px;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.06);
      min-height: 38px;
    }

    .model-picker-label {
      font-size: 0.78rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.52);
      white-space: nowrap;
    }

    .model-select {
      min-width: 172px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 999px;
      padding: 8px 34px 8px 12px;
      color: var(--text);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
        rgba(10, 10, 10, 0.85);
      appearance: none;
      -webkit-appearance: none;
      line-height: 1;
      cursor: pointer;
      background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%);
      background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
      background-size: 6px 6px, 6px 6px;
      background-repeat: no-repeat;
      transition: all 0.3s ease;
    }

    .model-select:hover {
      border-color: rgba(108, 99, 255, 0.34);
      box-shadow: 0 0 18px rgba(108, 99, 255, 0.1);
    }

    .model-select:focus {
      outline: none;
      border-color: rgba(108, 99, 255, 0.45);
      box-shadow:
        0 0 0 1px rgba(108, 99, 255, 0.24),
        0 0 20px rgba(108, 99, 255, 0.12);
    }

    .model-select:disabled {
      cursor: not-allowed;
      opacity: 0.6;
    }

    .workspace {
      display: flex;
      gap: 20px;
      min-height: calc(100vh - 140px);
    }

    .workspace-divider {
      display: none;
    }

    @media (min-width: 1101px) {
      .workspace {
        height: calc(100vh - 140px);
        gap: 0;
      }

      .chat-panel,
      .preview-panel {
        min-height: 0;
      }

      .workspace .chat-panel {
        width: var(--workspace-conversation-width, 35%);
        flex: 0 0 var(--workspace-conversation-width, 35%);
      }

      .workspace .preview-panel {
        width: auto;
        min-width: 480px;
        flex: 1 1 0;
      }

      .workspace-divider {
        display: block;
        flex: 0 0 12px;
        cursor: col-resize;
        position: relative;
        touch-action: none;
      }

      .workspace-divider::before {
        content: "";
        position: absolute;
        top: 12px;
        bottom: 12px;
        left: 5px;
        width: 2px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.12);
        transition: background 0.16s ease;
      }

      .workspace-divider:hover::before,
      .workspace.is-resizing .workspace-divider::before {
        background: rgba(108, 99, 255, 0.85);
      }

      .workspace.is-resizing,
      .workspace.is-resizing * {
        cursor: col-resize !important;
        user-select: none;
      }
    }

    .chat-panel {
      width: 40%;
      min-width: 320px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 25%),
        var(--panel-glass);
    }

    .preview-panel {
      width: 60%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 35%),
        var(--panel-glass);
    }

    .panel-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 20px 20px 16px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .preview-panel .panel-head {
      align-items: center;
    }

    .eyebrow {
      display: inline-block;
      margin-bottom: 8px;
      color: rgba(255, 255, 255, 0.55);
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.18em;
    }

    .panel-title {
      margin: 0;
      font-size: 1.1rem;
      letter-spacing: -0.03em;
    }

    .panel-copy {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 0.92rem;
    }

    .agent-status {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: rgba(255, 255, 255, 0.72);
      font-size: 0.88rem;
      white-space: nowrap;
    }

    .agent-status[data-state="working"] {
      color: rgba(255, 255, 255, 0.88);
    }

    .agent-status[data-state="ready"] {
      color: rgba(214, 255, 245, 0.96);
    }

    .agent-status[data-state="error"] {
      color: #ffd5de;
    }

    .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: linear-gradient(135deg, #46ffd3, #00d4aa);
      box-shadow: 0 0 16px rgba(0, 212, 170, 0.55);
      animation: pulse 1.6s ease-in-out infinite;
    }

    .agent-status[data-state="idle"] .status-dot {
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.3));
      box-shadow: 0 0 12px rgba(255, 255, 255, 0.14);
      animation-duration: 2.2s;
    }

    .agent-status[data-state="working"] .status-dot {
      background: linear-gradient(135deg, #7c75ff, #00d4aa);
      box-shadow: 0 0 18px rgba(108, 99, 255, 0.44);
      animation-duration: 1.1s;
    }

    .agent-status[data-state="ready"] .status-dot {
      background: linear-gradient(135deg, #72ffd7, #27d7af);
      box-shadow: 0 0 18px rgba(39, 215, 175, 0.42);
      animation: none;
    }

    .agent-status[data-state="error"] .status-dot {
      background: linear-gradient(135deg, #ff8ca8, #ff6b8b);
      box-shadow: 0 0 18px rgba(255, 107, 139, 0.42);
      animation-duration: 0.9s;
    }

    .messages {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      scroll-behavior: smooth;
    }

    .messages::-webkit-scrollbar {
      width: 10px;
    }

    .messages::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.08);
      border-radius: 999px;
    }

    .message-row,
    .tool-pill {
      animation: slideUp 0.44s ease both, fadeIn 0.44s ease both;
    }

    .message-row {
      display: flex;
      gap: 12px;
      align-items: flex-end;
      max-width: 92%;
    }

    .message-row.user {
      align-self: flex-end;
      flex-direction: row-reverse;
    }

    .message-row.assistant {
      align-self: flex-start;
    }

    .avatar {
      width: 38px;
      height: 38px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(0, 212, 170, 0.16));
      border: 1px solid rgba(255, 255, 255, 0.08);
      position: relative;
      flex-shrink: 0;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .avatar .status-dot {
      position: absolute;
      right: -2px;
      bottom: -2px;
      width: 9px;
      height: 9px;
    }

    .bubble {
      border-radius: 20px;
      padding: 14px 16px;
      line-height: 1.6;
      white-space: pre-wrap;
      word-break: break-word;
      position: relative;
      overflow: hidden;
    }

    .bubble.user {
      background: #1e1e1e;
      color: white;
      border-bottom-right-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.04);
      box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
    }

    .bubble.assistant {
      background:
        linear-gradient(135deg, rgba(108, 99, 255, 0.22), rgba(0, 212, 170, 0.1)),
        rgba(255, 255, 255, 0.04);
      color: rgba(255, 255, 255, 0.96);
      border-bottom-left-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .typing {
      display: inline-flex;
      gap: 5px;
      align-items: center;
      min-height: 22px;
    }

    .typing span {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.62);
      animation: bounce 1s ease-in-out infinite;
    }

    .typing span:nth-child(2) {
      animation-delay: 0.12s;
    }

    .typing span:nth-child(3) {
      animation-delay: 0.24s;
    }

    .tool-pill {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      align-self: flex-start;
      margin-left: 50px;
      padding: 10px 14px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: rgba(255, 255, 255, 0.82);
      font-size: 0.84rem;
      backdrop-filter: blur(10px);
    }

    .tool-pill.done {
      color: rgba(255, 255, 255, 0.7);
      background: rgba(0, 212, 170, 0.08);
    }

    .tool-pill.error {
      background: rgba(255, 107, 139, 0.12);
      color: #ffdce4;
    }

    .spinner {
      width: 14px;
      height: 14px;
      border-radius: 999px;
      border: 2px solid rgba(255, 255, 255, 0.18);
      border-top-color: white;
      animation: spin 0.8s linear infinite;
      flex-shrink: 0;
    }

    .tool-pill.done .spinner,
    .tool-pill.error .spinner {
      animation: none;
      border-color: rgba(255, 255, 255, 0.18);
      border-top-color: rgba(255, 255, 255, 0.18);
      background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
    }

    .composer {
      padding: 18px 20px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      background: linear-gradient(180deg, rgba(20, 20, 20, 0), rgba(20, 20, 20, 0.85));
    }

    .composer-input-row {
      display: flex;
      align-items: center;
    }

    .composer-input-row {
      align-items: flex-end;
      gap: 12px;
    }

    .build-mode-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .build-mode-picker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 34px;
      padding: 4px 7px 4px 10px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.04);
    }

    .build-mode-label,
    .build-mode-note {
      color: rgba(255, 255, 255, 0.56);
      font-size: 0.76rem;
      line-height: 1.35;
    }

    .build-mode-label {
      letter-spacing: 0.06em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .build-mode-note {
      margin: 0;
      text-align: right;
    }

    .build-mode-select {
      min-width: 92px;
      padding: 6px 24px 6px 9px;
      border: 0;
      border-radius: 999px;
      color: var(--text);
      background: rgba(10, 10, 10, 0.72);
      appearance: auto;
      cursor: pointer;
    }

    .build-mode-select:focus {
      outline: 1px solid rgba(108, 99, 255, 0.6);
    }

    .prompt-wrap {
      flex: 1;
      padding: 14px 16px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 18px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .prompt-wrap:focus-within {
      border-color: rgba(108, 99, 255, 0.45);
      box-shadow:
        0 0 0 1px rgba(108, 99, 255, 0.3),
        0 0 28px rgba(108, 99, 255, 0.12);
    }

    .prompt-input {
      width: 100%;
      min-height: 56px;
      max-height: 180px;
      resize: none;
      border: 0;
      outline: none;
      background: transparent;
      color: var(--text);
      line-height: 1.5;
    }

    .prompt-input::placeholder {
      color: rgba(255, 255, 255, 0.45);
    }

    .send-btn {
      width: 56px;
      height: 56px;
      border-radius: 18px;
      flex-shrink: 0;
    }

    .preview-shell {
      position: relative;
      flex: 1;
      padding: 18px;
      min-height: 400px;
    }

    .preview-frame-wrap {
      position: relative;
      height: 100%;
      border-radius: var(--radius-lg);
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
        var(--panel-strong);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 30px 70px rgba(0, 0, 0, 0.35);
    }

    .preview-toolbar {
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      background: rgba(255, 255, 255, 0.03);
    }

    .preview-panel__actions { display: flex; align-items: center; gap: 10px; }
    .static-content-btn { white-space: nowrap; font-size: 0.78rem; padding: 8px 11px; }
    .static-content-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
    .static-content-modal[hidden] { display: none; }
    .static-content-modal__backdrop { position: absolute; inset: 0; background: rgba(3, 5, 12, 0.72); backdrop-filter: blur(8px); }
    .static-content-modal__panel { position: relative; z-index: 1; width: min(880px, 100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; }
    .static-content-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .static-content-modal__head h3 { margin: 4px 0 0; }
    .static-content-modal__body { padding: 20px 24px 24px; }
    .static-content-grid { display: grid; grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.2fr); gap: 20px; }
    .static-content-list { display: grid; gap: 8px; align-content: start; }
    .static-content-list button { width: 100%; text-align: left; }
    .static-content-form { display: grid; gap: 12px; }
    .static-content-form label { display: grid; gap: 6px; color: rgba(255,255,255,0.72); font-size: 0.82rem; }
    .static-content-form input, .static-content-form textarea { width: 100%; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 10px; background: rgba(255,255,255,0.05); color: var(--text); font: inherit; }
    .static-content-form textarea { min-height: 92px; resize: vertical; }
    .static-content-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
    .static-content-note { color: rgba(255,255,255,0.62); line-height: 1.5; }
    @media (max-width: 680px) { .static-content-grid { grid-template-columns: 1fr; } .preview-panel__actions { width: 100%; justify-content: space-between; } }

    .window-dots {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .window-dots span {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.18);
    }

    .window-dots span:first-child {
      background: rgba(255, 107, 139, 0.75);
    }

    .window-dots span:nth-child(2) {
      background: rgba(255, 196, 87, 0.8);
    }

    .window-dots span:nth-child(3) {
      background: rgba(39, 215, 175, 0.85);
    }

    .preview-label {
      color: rgba(255, 255, 255, 0.6);
      font-size: 0.82rem;
      letter-spacing: 0.04em;
    }

    .preview-frame {
      width: 100%;
      height: calc(100% - 44px);
      border: 0;
      background: white;
    }

    .toast-stack {
      position: fixed;
      top: 24px;
      right: 24px;
      z-index: 50;
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-width: 360px;
    }

    .toast {
      padding: 14px 16px;
      border-radius: 16px;
      background: rgba(255, 107, 139, 0.12);
      color: #ffd9e2;
      border: 1px solid rgba(255, 107, 139, 0.24);
      backdrop-filter: blur(18px);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
      animation: slideUp 0.35s ease both, fadeIn 0.35s ease both;
    }

    .error-banner {
      margin: 16px 20px 0;
      padding: 12px 14px;
      border-radius: 14px;
      background: rgba(255, 107, 139, 0.12);
      color: #ffd9e2;
      border: 1px solid rgba(255, 107, 139, 0.22);
      font-size: 0.9rem;
      line-height: 1.5;
      animation: slideUp 0.35s ease both, fadeIn 0.35s ease both;
    }

    .image-banner {
      margin: 12px 20px 0;
      padding: 10px 12px 10px 14px;
      border-radius: 14px;
      background: rgba(255, 171, 64, 0.12);
      border: 1px solid rgba(255, 171, 64, 0.32);
      color: #ffe0b0;
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 10px;
      font-size: 0.85rem;
      line-height: 1.45;
      animation: slideUp 0.35s ease both, fadeIn 0.35s ease both;
    }

    .image-banner strong {
      color: #ffd69c;
      margin-right: 8px;
    }

    .image-banner__text {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .image-banner__close {
      width: 28px;
      height: 28px;
      border: 0;
      border-radius: 8px;
      background: rgba(255, 171, 64, 0.18);
      color: inherit;
      font-size: 1.1rem;
      cursor: pointer;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .image-banner__close:hover {
      background: rgba(255, 171, 64, 0.3);
    }

    .diag-banner {
      margin: 12px 20px 0;
      padding: 14px 14px 14px 16px;
      border-radius: 16px;
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      font-size: 0.85rem;
      line-height: 1.5;
      animation: slideUp 0.35s ease both, fadeIn 0.35s ease both;
      border-width: 1px;
      border-style: solid;
    }

    .diag-banner--neutral {
      background: rgba(14, 116, 144, 0.10);
      border-color: rgba(14, 116, 144, 0.30);
      color: #c8eef6;
    }
    .diag-banner--ok {
      background: rgba(34, 197, 94, 0.10);
      border-color: rgba(34, 197, 94, 0.32);
      color: #c3f5d0;
    }
    .diag-banner--warn {
      background: rgba(234, 179, 8, 0.10);
      border-color: rgba(234, 179, 8, 0.34);
      color: #fff1b9;
    }
    .diag-banner--error {
      background: rgba(239, 68, 68, 0.10);
      border-color: rgba(239, 68, 68, 0.32);
      color: #ffd0d0;
    }

    .diag-banner__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .diag-banner__summary {
      color: inherit;
      font-size: 0.84rem;
      font-weight: 700;
    }

    .diag-banner__actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
    }

    .diag-banner__pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 5px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.10);
      color: rgba(255, 255, 255, 0.92);
      font-weight: 700;
      font-size: 0.78rem;
      letter-spacing: 0.02em;
    }

    .diag-banner--ok .diag-banner__pill { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.40); color: #d3ffe0; }
    .diag-banner--warn .diag-banner__pill { background: rgba(234, 179, 8, 0.18); border-color: rgba(234, 179, 8, 0.42); color: #fff6cf; }
    .diag-banner--error .diag-banner__pill { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.40); color: #ffe1e1; }
    .diag-banner--neutral .diag-banner__pill { background: rgba(14, 116, 144, 0.18); border-color: rgba(14, 116, 144, 0.40); color: #d6f5fb; }

    .diag-banner__close {
      width: 30px; height: 30px;
      border: 0; border-radius: 9px;
      background: rgba(255, 255, 255, 0.06);
      color: inherit; font-size: 1.2rem; cursor: pointer; line-height: 1;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .diag-banner__close:hover { background: rgba(255, 255, 255, 0.10); }

    .diag-banner__toggle {
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 9px;
      background: rgba(255, 255, 255, 0.06);
      color: inherit;
      cursor: pointer;
      font: inherit;
      font-size: 0.76rem;
      font-weight: 700;
      padding: 5px 8px;
    }

    .diag-banner__toggle:hover { background: rgba(255, 255, 255, 0.10); }

    .diag-banner__content {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 8px 18px;
      font-size: 0.82rem;
    }

    .diag-row {
      display: grid;
      grid-template-columns: 150px 1fr;
      gap: 10px;
      align-items: start;
    }
    .diag-row__label {
      color: rgba(255, 255, 255, 0.62);
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 0.70rem;
      margin-top: 2px;
    }
    .diag-row__val {
      color: rgba(255, 255, 255, 0.94);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-size: 0.78rem;
      word-break: break-word;
    }

    .cms-img-modal {
      position: fixed;
      inset: 0;
      z-index: 90;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .cms-img-modal[hidden] { display: none; }
    .cms-img-modal__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(5, 8, 18, 0.72);
      backdrop-filter: blur(4px);
    }
    .cms-img-modal__panel {
      position: relative;
      width: 100%;
      max-width: 720px;
      max-height: 90vh;
      overflow: auto;
      padding: 20px 22px 22px;
      border-radius: 18px;
      box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
      border: 1px solid rgba(255, 255, 255, 0.10);
    }
    .cms-img-modal__head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
      padding-bottom: 14px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .cms-img-modal__head h3 {
      margin: 6px 0 0;
      font-size: 1.15rem;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.96);
    }
    .cms-img-modal__close {
      width: 34px; height: 34px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.05);
      color: rgba(255, 255, 255, 0.9);
      font-size: 1.4rem;
      cursor: pointer;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .cms-img-modal__close:hover { background: rgba(255, 255, 255, 0.12); }
    .cms-img-modal__slot {
      display: grid;
      grid-template-columns: 110px 1fr;
      gap: 10px;
      align-items: center;
      margin-bottom: 14px;
      padding: 10px 14px;
      background: rgba(59, 74, 126, 0.16);
      border: 1px solid rgba(59, 74, 126, 0.30);
      border-radius: 12px;
    }
    .cms-img-modal__slotLabel {
      color: rgba(255, 255, 255, 0.60);
      text-transform: uppercase;
      font-size: 0.70rem;
      font-weight: 600;
      letter-spacing: 0.08em;
    }
    .cms-img-modal__slotId {
      color: rgba(255, 255, 255, 0.94);
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 0.82rem;
      overflow-wrap: anywhere;
    }
    .cms-img-modal__field {
      display: block;
      margin-bottom: 14px;
    }
    .cms-img-modal__fieldLabel {
      display: block;
      margin-bottom: 6px;
      color: rgba(255, 255, 255, 0.74);
      font-size: 0.80rem;
      font-weight: 500;
    }
    .cms-img-modal__input {
      width: 100%;
      padding: 12px 14px;
      border-radius: 11px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.04);
      color: rgba(255, 255, 255, 0.96);
      font-size: 0.92rem;
      outline: none;
      transition: border-color .15s ease, background .15s ease;
    }
    .cms-img-modal__input:focus {
      border-color: rgba(59, 130, 246, 0.7);
      background: rgba(59, 130, 246, 0.08);
    }
    .cms-img-modal__actions {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: flex-end;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }
    .cms-img-modal__previewGrid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-bottom: 10px;
    }
    @media (min-width: 600px) {
      .cms-img-modal__previewGrid { grid-template-columns: repeat(3, 1fr); }
    }
    .cms-img-previewTile {
      position: relative;
      border-radius: 12px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.04);
      border: 2px solid transparent;
      cursor: pointer;
      aspect-ratio: 4 / 3;
      transition: transform .12s ease, border-color .12s ease, opacity .12s ease;
    }
    .cms-img-previewTile:hover { transform: translateY(-2px); opacity: 0.96; }
    .cms-img-previewTile.is-selected { border-color: rgba(234, 179, 8, 0.9); box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.22); }
    .cms-img-previewTile img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .cms-img-previewTile__meta {
      position: absolute;
      inset: auto 0 0 0;
      background: linear-gradient(to top, rgba(0,0,0,0.74), rgba(0,0,0,0));
      padding: 18px 8px 6px;
      color: rgba(255,255,255,0.94);
      font-size: 0.68rem;
      line-height: 1.2;
    }
    .cms-img-modal__status {
      margin-top: 8px;
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 0.82rem;
      line-height: 1.4;
    }
    .cms-img-modal__status.is-error { background: rgba(239, 68, 68, 0.14); color: #ffd3d3; border: 1px solid rgba(239, 68, 68, 0.3); }
    .cms-img-modal__status.is-ok    { background: rgba(34, 197, 94, 0.14); color: #d3ffe0; border: 1px solid rgba(34, 197, 94, 0.30); }
    .cms-img-modal__status.is-busy  { background: rgba(59, 130, 246, 0.12); color: #d9e8ff; border: 1px solid rgba(59, 130, 246, 0.30); }
    .cms-img-edit-fab {
      position: absolute;
      top: 8px;
      right: 8px;
      z-index: 5;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid rgba(20, 241, 149, 0.42);
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(59, 130, 246, 0.90));
      color: #ffffff;
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28), 0 0 0 1px rgba(255,255,255,0.10) inset;
      backdrop-filter: blur(4px);
      user-select: none;
    }
    .cms-img-edit-fab:hover { filter: brightness(1.08); transform: translateY(-1px); }
    .cms-img-edit-fab svg { width: 13px; height: 13px; display: inline-block; }
    .cms-img-fabHost { position: relative; display: inline-block; max-width: 100%; }
    .cms-img-fabHost > img { display: block; max-width: 100%; height: auto; }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(14px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    @keyframes pulse {
      0%,
      100% {
        transform: scale(1);
        opacity: 0.9;
      }

      50% {
        transform: scale(1.22);
        opacity: 1;
      }
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    @keyframes bounce {
      0%,
      80%,
      100% {
        transform: translateY(0);
        opacity: 0.45;
      }

      40% {
        transform: translateY(-4px);
        opacity: 1;
      }
    }

    @keyframes savedPulse {
      0% {
        opacity: 0;
        transform: translateY(8px);
      }

      15%,
      55% {
        opacity: 1;
        transform: translateY(0);
      }

      100% {
        opacity: 0;
        transform: translateY(-6px);
      }
    }

    @media (max-width: 1400px) {
      .app-header {
        flex-direction: column;
        align-items: stretch;
      }

      .app-header .header-actions {
        justify-content: flex-start;
      }
    }

    @media (max-width: 1100px) {
      .dashboard-header {
        flex-direction: column;
        align-items: stretch;
      }

      .dashboard-header-section,
      .dashboard-header-section.center,
      .dashboard-header-section.end {
        justify-content: center;
      }

      .app-header {
        flex-direction: column;
        align-items: stretch;
      }

      .header-actions {
        justify-content: flex-start;
      }

      .workspace {
        flex-direction: column;
      }

      .chat-panel,
      .preview-panel {
        width: 100%;
      }

      .chat-panel {
        min-height: 56vh;
      }

      .preview-panel {
        min-height: 60vh;
      }
    }

    @media (max-width: 768px) {
      .app-shell {
        padding: 16px;
      }

      .auth-card {
        padding: 26px 20px;
      }

      .editor-topbar,
      .app-header,
      .panel-head,
      .composer,
      .preview-shell,
      .messages {
        padding-left: 16px;
        padding-right: 16px;
      }

      .app-header {
        top: 12px;
      }

      .header-context {
        flex-wrap: wrap;
      }

      .project-name-chip {
        order: 3;
        flex-basis: 100%;
        text-align: left;
        padding: 0;
        border-left: 0;
      }

      .save-group {
        min-width: 0;
      }

      .app-header {
        gap: 12px;
      }

      .header-actions {
        width: 100%;
        justify-content: flex-start;
      }

      .model-picker {
        flex: 1 1 100%;
        justify-content: space-between;
      }

      .model-select {
        min-width: 0;
        width: 100%;
      }

      .build-mode-row {
        align-items: flex-start;
        flex-direction: column;
      }

      .build-mode-note {
        text-align: left;
      }

      .message-row,
      .tool-pill {
        max-width: 100%;
      }

      .tool-pill {
        margin-left: 0;
      }

      .send-btn {
        width: 52px;
        height: 52px;
        border-radius: 16px;
      }

    }
