.labs-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--md-sys-color--surface-container-low, #f6f8fc);
  font-family: Roboto, 'Helvetica Neue', sans-serif;
  overflow: hidden;
  box-sizing: border-box;
  color: var(--md-sys-color--on-surface, #1f1f1f);

  * {
    box-sizing: border-box;
  }
}

.labs-header {
  padding: 14px 24px 8px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  user-select: none;

  .header-left {
    display: flex;
    flex-direction: column;

    .labs-back-btn {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 10.5px;
      color: #9aa0a6;
      background: transparent;
      border: none;
      padding: 0;
      margin-bottom: 8px;
      cursor: pointer;
      transition: color 0.2s ease;
      width: max-content;

      &:hover {
        color: #3c4043;
      }

      mat-icon {
        font-size: 13px;
        width: 13px;
        height: 13px;
      }

      span {
        font-weight: 500;
      }
    }

    h1 {
      margin: 0;
      font-size: 22px;
      font-weight: 600;
      color: #202124;
      letter-spacing: -0.5px;
    }

    p {
      margin: 4px 0 0 0;
      font-size: 12px;
      color: #5f6368;
      max-width: 768px;
      line-height: 1.6;
    }
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-shrink: 0;

    .labs-create-btn,
    .playground-review-btn {
      background-color: var(--md-sys-color--primary, #0b57d0);
      color: white;
      border-radius: 9999px;
      padding: 8px 16px;
      font-size: 11px;
      font-weight: 500;
      border: none;
      display: flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      transition:
        filter 0.2s ease,
        opacity 0.2s ease;

      &:hover:not(:disabled) {
        filter: brightness(0.95);
      }

      &:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }

      mat-icon {
        font-size: 14px;
        width: 14px;
        height: 14px;
      }
    }

    .playground-draft-btn {
      background-color: white;
      border: 1px solid #dadce0;
      color: #3c4043;
      border-radius: 9999px;
      padding: 6px 14px;
      font-size: 10.5px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      transition:
        background-color 0.2s ease,
        opacity 0.2s ease;

      &:hover:not(:disabled) {
        background-color: #f8f9fa;
      }

      &:disabled {
        opacity: 0.4;
        cursor: not-allowed;
      }

      mat-icon {
        font-size: 12px;
        width: 12px;
        height: 12px;
      }
    }

    .playground-discard-btn {
      background: transparent;
      border: none;
      color: #9aa0a6;
      width: 32px;
      height: 32px;
      border-radius: 9999px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;

      &:hover {
        color: #d93025;
        background-color: #fce8e6;
      }

      mat-icon {
        font-size: 17px;
        width: 17px;
        height: 17px;
      }
    }
  }
}

.labs-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  user-select: none;
  background-color: white;
  border-radius: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin: 8px 16px 16px 16px;

  .labs-tabs {
    padding: 0 24px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    gap: 24px;
    font-size: 13px;
    background-color: rgba(248, 249, 250, 0.5);
    flex-shrink: 0;

    .labs-tab-btn {
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: #5f6368;
      font-weight: 500;
      padding: 12px 4px;
      cursor: pointer;
      transition: all 0.15s ease;

      &:hover {
        color: #202124;
      }

      &.active {
        border-bottom-color: var(--md-sys-color--primary, #0b57d0);
        color: var(--md-sys-color--primary, #0b57d0);
      }
    }
  }

  .search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background-color: rgba(248, 249, 250, 0.3);
    user-select: none;
    border-bottom: 1px solid #f1f3f4;

    .market-filter-chips {
      display: flex;
      align-items: center;
      gap: 8px;

      .filter-chip {
        padding: 6px 14px;
        border-radius: 9999px;
        font-size: 10.5px;
        font-weight: 500;
        border: 1px solid #dadce0;
        color: #5f6368;
        background-color: white;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          background-color: #f8f9fa;
        }

        &.active {
          background-color: var(--md-sys-color--primary-container, #c2e7ff);
          color: var(--md-sys-color--on-primary-container, #001d35);
          border-color: transparent;
        }
      }
    }

    .controls-right {
      display: flex;
      align-items: center;
      gap: 10px;

      .search-container {
        position: relative;
        width: 260px;
        display: flex;
        align-items: center;

        ::ng-deep .market-search-form-field {
          width: 100%;
          height: 32px;
          margin: 0;
          padding: 0;

          [class*='mat-mdc-text-field-wrapper'] {
            padding: 0 12px;
            min-height: unset;
            height: 100%;
            display: flex;
            align-items: center;
            background-color: #f8f9fa;
            border: 1px solid #dadce0;
            border-radius: 9999px;
            box-sizing: border-box;
            transition: all 0.2s ease;

            &:hover:not(:focus-within) {
              background-color: rgba(241, 243, 244, 0.7);
            }

            &:focus-within {
              background-color: white;
              border-color: var(--md-sys-color--primary, #0b57d0);
            }
          }

          [class*='mdc-notched-outline'] {
            display: none;
          }

          [class*='mat-mdc-form-field-flex'] {
            padding: 0;
            min-height: unset;
            height: 100%;
            display: flex;
            align-items: center;
            width: 100%;
          }

          [class*='mat-mdc-form-field-infix'] {
            padding: 0;
            min-height: unset;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
          }

          [class*='mat-mdc-form-field-icon-prefix'] {
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
            color: #9aa0a6;

            mat-icon {
              font-size: 16px;
              width: 16px;
              height: 16px;
            }
          }

          [class*='mat-mdc-form-field-subscript-wrapper'] {
            display: none;
          }
        }

        .market-search-input {
          width: 100%;
          height: 100%;
          background: transparent;
          border: none;
          outline: none;
          padding: 0;
          font-size: 11px;
          color: #202124;

          &::placeholder {
            color: #9aa0a6;
          }
        }

        .market-search-clear-btn {
          position: absolute;
          right: 12px;
          background: transparent;
          border: none;
          padding: 0;
          color: #9aa0a6;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;

          &:hover {
            color: #5f6368;
          }

          mat-icon {
            font-size: 16px;
            width: 16px;
            height: 16px;
          }
        }
      }

      .view-toggle-group {
        display: flex;
        background-color: #f1f3f4;
        border-radius: 9999px;
        padding: 2px;
        border: 1px solid #dadce0;
        user-select: none;

        button {
          width: 28px;
          height: 28px;
          border-radius: 9999px;
          display: flex;
          align-items: center;
          justify-content: center;
          border: none;
          background: transparent;
          color: #5f6368;
          cursor: pointer;
          transition: all 0.2s ease;

          &:hover {
            color: #3c4043;
          }

          &.active {
            background-color: white;
            color: var(--md-sys-color--primary, #0b57d0);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
          }

          mat-icon {
            font-size: 15px;
            width: 15px;
            height: 15px;
          }
        }
      }
    }
  }

  .tabs-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: rgba(248, 249, 250, 0.3);

    .search-results-header {
      margin-bottom: 16px;
      user-select: none;

      h4 {
        margin: 0;
        font-size: 12px;
        font-weight: 600;
        color: #202124;
      }
    }

    // Grid View
    .labs-tab-panel.grid-view {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 20px;

      .labs-table-header {
        display: none;
      }

      .labs-tool-card {
        background-color: var(--md-sys-color--surface-container, #f0f4f9);
        border-radius: 16px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: background-color 0.15s ease;
        position: relative;
        border: 1px solid transparent;

        &:hover {
          background-color: var(
            --md-sys-color--surface-container-high,
            #e9eef6
          );
          .card-title {
            color: var(--md-sys-color--primary, #0b57d0);
          }
        }

        .card-top {
          .card-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;

            .card-icon-box {
              width: 40px;
              height: 40px;
              border-radius: 12px;
              display: flex;
              align-items: center;
              justify-content: center;
              transition: transform 0.15s ease;

              mat-icon {
                font-size: 20px;
                width: 20px;
                height: 20px;
              }

              &.blue {
                background-color: #e8f0fe;
                color: #1a73e8;
              }
              &.purple {
                background-color: #f3e8ff;
                color: #9333ea;
              }
              &.amber {
                background-color: #fef3c7;
                color: #d97706;
              }
              &.teal {
                background-color: #ccfbf1;
                color: #0d9488;
              }
              &.red {
                background-color: #fee2e2;
                color: #dc2626;
              }
            }

            .card-fav-btn {
              background: transparent;
              border: none;
              color: #dadce0;
              cursor: pointer;
              transition: color 0.2s ease;
              display: flex;
              align-items: center;
              justify-content: center;
              padding: 4px;

              &:hover,
              &.favorite {
                color: #fbbc05;
              }

              mat-icon {
                font-size: 18px;
                width: 18px;
                height: 18px;
              }
            }
          }

          &:hover .card-icon-box {
            transform: scale(1.05);
          }

          .card-title {
            margin: 0 0 4px 0;
            font-size: 14px;
            font-weight: 600;
            color: #202124;
            transition: color 0.15s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }

          .card-desc {
            margin: 0 0 16px 0;
            font-size: 11.5px;
            color: #5f6368;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            height: 34px;
          }

          .card-category-container {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 14px;
            user-select: none;

            span {
              font-size: 9px;
              font-weight: 600;
              letter-spacing: 0.5px;
              text-transform: uppercase;
              padding: 2px 8px;
              border-radius: 4px;

              &.blue {
                background-color: #e8f0fe;
                color: #1a73e8;
                border: 1px solid #d2e3fc;
              }
              &.purple {
                background-color: #f3e8ff;
                color: #9333ea;
                border: 1px solid #e9d5ff;
              }
              &.amber {
                background-color: #fef3c7;
                color: #d97706;
                border: 1px solid #fde68a;
              }
              &.teal {
                background-color: #ccfbf1;
                color: #0d9488;
                border: 1px solid #99f6e4;
              }
              &.red {
                background-color: #fee2e2;
                color: #dc2626;
                border: 1px solid #fecaca;
              }
            }
          }
        }

        .governance-metadata {
          border-top: 1px solid #dadce0;
          padding-top: 12px;
          display: grid;
          grid-template-columns: 16px 1fr;
          gap: 6px 4px;
          align-items: center;
          font-size: 10px;
          color: #5f6368;

          mat-icon {
            font-size: 12px;
            width: 12px;
            height: 12px;
            color: #9aa0a6;
          }

          .card-owner {
            font-weight: 500;
            color: #3c4043;
          }
          .card-buganizer {
            color: #1a73e8;
            text-decoration: none;
            &:hover {
              text-decoration: underline;
            }
          }
          .card-lifecycle-text {
            font-weight: 500;
            &.curated {
              color: #137333;
            }
            &.incubation {
              color: #b06000;
            }
            &.community {
              color: #0d9488;
            }
          }
          .mau-text {
            color: #9aa0a6;
            font-family: monospace;
          }
        }

        .card-status-container {
          display: flex;
          align-items: center;
          user-select: none;
          margin-top: 8px;

          span {
            font-size: 9px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 9999px;
            &.active {
              background-color: #e6f4ea;
              color: #137333;
              border: 1px solid #ceead6;
            }
            &.experimental {
              background-color: #fef7e0;
              color: #b06000;
              border: 1px solid #fde293;
            }
            &.verified {
              background-color: #e6f4ea;
              color: #137333;
              border: 1px solid #ceead6;
            }
          }
        }

        .card-actions {
          border-top: 1px solid #dadce0;
          margin-top: 16px;
          padding-top: 12px;
          display: flex;
          justify-content: flex-end;
          align-items: center;
          gap: 8px;

          .launch-btn {
            padding: 6px 16px;
            border-radius: 9999px;
            font-size: 11px;
            font-weight: 500;
            background-color: var(--md-sys-color--primary, #0b57d0);
            color: white;
            border: none;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            transition: filter 0.2s ease;

            &:hover {
              filter: brightness(0.95);
            }
          }

          .card-more-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            width: 32px;
            height: 32px;
            border-radius: 9999px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;

            &:hover {
              color: #3c4043;
              background-color: rgba(60, 64, 67, 0.08);
            }

            mat-icon {
              font-size: 18px;
              width: 18px;
              height: 18px;
            }
          }
        }
      }
    }

    // List View
    .labs-tab-panel.list-view {
      display: flex;
      flex-direction: column;
      gap: 12px;

      .labs-table-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 8px 16px;
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #74777f;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 8px;
        background-color: #f9fafb;
        position: sticky;
        top: 0;
        z-index: 20;

        .col-1 {
          display: flex;
          align-items: center;
          gap: 20px;
          flex: 1;
          min-width: 0;
          .h-icon {
            width: 70px;
          }
          .h-title {
            width: 150px;
          }
          .h-desc {
            flex: 1;
            min-width: 150px;
          }
          .h-cat {
            width: 140px;
          }
        }
        .col-2 {
          display: flex;
          align-items: center;
          gap: 20px;
          width: 352px;
          flex-shrink: 0;
          .h-owner {
            width: 90px;
            margin-left: 32px;
          }
          .h-bug {
            width: 80px;
          }
          .h-life {
            width: 110px;
          }
        }
        .col-3 {
          width: 90px;
          flex-shrink: 0;
        }
        .col-4 {
          width: 120px;
          flex-shrink: 0;
          text-align: left;
        }
      }

      .labs-tool-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 16px;
        gap: 20px;
        background-color: var(--md-sys-color--surface-container, #f0f4f9);
        border-radius: 12px;
        transition: background-color 0.15s ease;

        &:hover {
          background-color: var(
            --md-sys-color--surface-container-high,
            #e9eef6
          );
          .card-title {
            color: var(--md-sys-color--primary, #0b57d0);
          }
        }

        .card-top {
          display: flex;
          align-items: center;
          gap: 20px;
          flex: 1;
          min-width: 0;

          .card-header-row {
            width: 70px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 0;

            .card-icon-box {
              width: 32px;
              height: 32px;
              border-radius: 8px;
              display: flex;
              align-items: center;
              justify-content: center;
              order: 2;

              mat-icon {
                font-size: 16px;
                width: 16px;
                height: 16px;
              }
              &.blue {
                background-color: #e8f0fe;
                color: #1a73e8;
              }
              &.purple {
                background-color: #f3e8ff;
                color: #9333ea;
              }
              &.amber {
                background-color: #fef3c7;
                color: #d97706;
              }
              &.teal {
                background-color: #ccfbf1;
                color: #0d9488;
              }
              &.red {
                background-color: #fee2e2;
                color: #dc2626;
              }
            }

            .card-fav-btn {
              background: transparent;
              border: none;
              color: #dadce0;
              cursor: pointer;
              display: flex;
              align-items: center;
              justify-content: center;
              padding: 2px;
              order: 1;

              &:hover,
              &.favorite {
                color: #fbbc05;
              }
              mat-icon {
                font-size: 18px;
                width: 18px;
                height: 18px;
              }
            }
          }

          .card-title {
            margin: 0;
            width: 150px;
            flex-shrink: 0;
            font-size: 12.5px;
            font-weight: 600;
            color: #202124;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .card-desc {
            margin: 0;
            flex: 1;
            min-width: 150px;
            font-size: 11.5px;
            color: #5f6368;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            height: auto;
          }
          .card-category-container {
            margin: 0;
            width: 140px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: wrap;
            span {
              font-size: 9px;
              font-weight: 600;
              padding: 2px 8px;
              border-radius: 4px;
              text-transform: uppercase;
              &.blue {
                background-color: #e8f0fe;
                color: #1a73e8;
                border: 1px solid #d2e3fc;
              }
              &.purple {
                background-color: #f3e8ff;
                color: #9333ea;
                border: 1px solid #e9d5ff;
              }
              &.amber {
                background-color: #fef3c7;
                color: #d97706;
                border: 1px solid #fde68a;
              }
              &.teal {
                background-color: #ccfbf1;
                color: #0d9488;
                border: 1px solid #99f6e4;
              }
              &.red {
                background-color: #fee2e2;
                color: #dc2626;
                border: 1px solid #fecaca;
              }
            }
          }
        }

        .governance-metadata {
          border-top: none;
          padding-top: 0;
          display: flex;
          align-items: center;
          gap: 20px;
          width: 352px;
          flex-shrink: 0;
          font-size: 10px;

          mat-icon {
            display: none;
          }
          .card-owner {
            width: 90px;
            flex-shrink: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-left: 32px;
            font-weight: 500;
            color: #3c4043;
          }
          .card-buganizer {
            width: 80px;
            flex-shrink: 0;
            color: #1a73e8;
            text-decoration: none;
            &:hover {
              text-decoration: underline;
            }
          }
          .card-lifecycle-container {
            width: 110px;
            flex-shrink: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            .card-lifecycle-text {
              font-weight: 500;
              &.curated {
                color: #137333;
              }
              &.incubation {
                color: #b06000;
              }
              &.community {
                color: #0d9488;
              }
            }
            .mau-text {
              color: #9aa0a6;
              font-family: monospace;
            }
          }
        }

        .card-status-container {
          margin-top: 0;
          width: 90px;
          flex-shrink: 0;
          span {
            font-size: 9px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 9999px;
            &.active {
              background-color: #e6f4ea;
              color: #137333;
              border: 1px solid #ceead6;
            }
            &.experimental {
              background-color: #fef7e0;
              color: #b06000;
              border: 1px solid #fde293;
            }
            &.verified {
              background-color: #e6f4ea;
              color: #137333;
              border: 1px solid #ceead6;
            }
          }
        }

        .card-actions {
          border-top: none;
          margin-top: 0;
          padding-top: 0;
          width: 120px;
          flex-shrink: 0;
          display: flex;
          justify-content: flex-start;
          align-items: center;
          gap: 8px;

          .launch-btn {
            padding: 6px 16px;
            border-radius: 9999px;
            font-size: 11px;
            font-weight: 500;
            background-color: var(--md-sys-color--primary, #0b57d0);
            color: white;
            border: none;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            transition: filter 0.2s ease;
            &:hover {
              filter: brightness(0.95);
            }
          }
          .card-more-btn {
            background: transparent;
            border: none;
            color: #9aa0a6;
            width: 32px;
            height: 32px;
            border-radius: 9999px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            &:hover {
              color: #3c4043;
              background-color: rgba(60, 64, 67, 0.08);
            }
            mat-icon {
              font-size: 18px;
              width: 18px;
              height: 18px;
            }
          }
        }
      }
    }

    // Empty States
    .empty-state {
      padding: 80px 24px 64px 24px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 12px;
      user-select: none;

      .empty-icon-box {
        width: 64px;
        height: 64px;
        border-radius: 9999px;
        display: flex;
        align-items: center;
        justify-content: center;

        mat-icon {
          font-size: 32px;
          width: 32px;
          height: 32px;
        }
        &.blue {
          background-color: #e8f0fe;
          color: #1a73e8;
        }
        &.amber {
          background-color: #fef3c7;
          color: #d97706;
        }
        &.gray {
          background-color: #f1f3f4;
          color: #5f6368;
        }
      }

      h4 {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: #202124;
      }
      p {
        margin: 0;
        font-size: 11.5px;
        color: #5f6368;
        max-width: 320px;
        line-height: 1.5;
      }

      .empty-state-create-btn {
        background-color: var(--md-sys-color--primary-container, #c2e7ff);
        color: var(--md-sys-color--on-primary-container, #001d35);
        border-radius: 9999px;
        padding: 8px 16px;
        font-size: 11px;
        font-weight: 500;
        border: none;
        display: flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        margin-top: 4px;
        transition: filter 0.2s ease;

        &:hover {
          filter: brightness(0.95);
        }
        mat-icon {
          font-size: 13px;
          width: 13px;
          height: 13px;
        }
      }
    }
  }
}

.create-tool-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  user-select: none;
  background-color: white;
  border-radius: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin: 8px 16px 16px 16px;
  padding: 24px;

  .warning-banner {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #fef7e0;
    border: 1px solid #fde293;
    border-radius: 12px;
    font-size: 10.5px;
    color: #b06000;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;

    mat-icon {
      font-size: 16px;
      width: 16px;
      height: 16px;
      color: #e37400;
      flex-shrink: 0;
      margin-top: 2px;
    }
    strong {
      font-weight: 700;
    }
  }

  .playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 400px;

    @media (max-width: 1024px) {
      grid-template-columns: 1fr;
    }

    .playground-panel {
      display: flex;
      flex-direction: column;
      background-color: var(--md-sys-color--surface-container, #f0f4f9);
      border-radius: 16px;
      overflow: hidden;

      .panel-header {
        padding: 0 16px;
        height: 44px;
        background-color: var(--md-sys-color--surface-container-high, #e9eef6);
        border-bottom: 1px solid rgba(196, 199, 208, 0.3);
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11px;
        color: #5f6368;
        font-family: monospace;

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

          .playground-status {
            font-size: 10px;
            color: #137333;
            font-family: monospace;
          }
          .playground-run-btn {
            background-color: #137333;
            color: white;
            border-radius: 4px;
            padding: 2px 8px;
            display: flex;
            align-items: center;
            gap: 2px;
            border: none;
            font-size: 10px;
            font-family: Roboto, sans-serif;
            font-weight: 500;
            cursor: pointer;
            transition: opacity 0.2s ease;

            &:hover:not(:disabled) {
              opacity: 0.9;
            }
            &:disabled {
              opacity: 0.4;
              cursor: not-allowed;
            }
            mat-icon {
              font-size: 12px;
              width: 12px;
              height: 12px;
            }
          }
        }
      }

      .code-area {
        flex: 1;
        padding: 16px;
        position: relative;
        font-family: monospace;
        font-size: 11px;
        color: #202124;

        .ai-spinner {
          position: absolute;
          inset: 0;
          background-color: rgba(255, 255, 255, 0.7);
          display: flex;
          align-items: center;
          justify-content: center;
          z-index: 10;

          .spinner-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;

            mat-icon {
              font-size: 24px;
              width: 24px;
              height: 24px;
              color: var(--md-sys-color--primary, #0b57d0);
              animation: spin 1s linear infinite;
            }
            span {
              font-size: 10px;
              color: #5f6368;
              font-family: Roboto, sans-serif;
            }
          }
        }

        textarea {
          width: 100%;
          height: 100%;
          background: transparent;
          resize: none;
          outline: none;
          border: none;
          line-height: 1.6;
          font-family: monospace;
          font-size: 11px;
          color: #202124;
        }
      }

      .ai-prompt-bar {
        border-top: 1px solid rgba(196, 199, 208, 0.3);
        padding: 12px;
        background-color: var(--md-sys-color--surface-container-low, #f6f8fc);
        display: flex;
        align-items: center;
        gap: 8px;

        mat-icon {
          font-size: 16px;
          width: 16px;
          height: 16px;
          color: var(--md-sys-color--primary, #0b57d0);
        }
        input {
          flex: 1;
          background-color: white;
          border: 1px solid #dadce0;
          border-radius: 8px;
          padding: 6px 12px;
          outline: none;
          font-size: 11.5px;
          color: #202124;
          transition: border-color 0.2s ease;

          &:focus {
            border-color: var(--md-sys-color--primary, #0b57d0);
          }
          &::placeholder {
            color: #9aa0a6;
          }
        }

        .ask-ai-btn {
          background-color: var(--md-sys-color--primary, #0b57d0);
          color: white;
          border-radius: 8px;
          padding: 6px 12px;
          font-size: 11px;
          font-weight: 500;
          border: none;
          cursor: pointer;
          transition: filter 0.2s ease;

          &:hover {
            filter: brightness(0.95);
          }
        }
      }

      .chart-container {
        flex: 1;
        padding: 24px;
        display: flex;
        align-items: center;
        justify-content: center;

        .default-chart-state {
          text-align: center;
          display: flex;
          flex-direction: column;
          align-items: center;
          gap: 8px;
          max-width: 320px;

          mat-icon {
            font-size: 36px;
            width: 36px;
            height: 36px;
            color: #dadce0;
          }
          h4 {
            margin: 0;
            font-size: 12.5px;
            font-weight: 600;
            color: #5f6368;
          }
          p {
            margin: 0;
            font-size: 11px;
            color: #9aa0a6;
            line-height: 1.5;
          }
        }
      }
    }
  }
}

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