.app-shell {
  height: 100vh;
  padding: 14px;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  gap: 14px;
}

.app-topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #6d5dfc);
  color: #fff;
  font-weight: 950;
  font-size: 22px;
}

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

.brand-copy h1 {
  margin-bottom: 3px;
  font-size: 20px;
  line-height: 1.1;
}

.brand-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-controls {
  display: flex;
  align-items: end;
  gap: 9px;
}

.app-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 14px;
}

.panel,
.workbench {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.panel {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
}

.workbench {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
}

@media (max-width: 1260px) {
  body {
    overflow-y: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
  }

  .app-main {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .panel-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .workbench {
    height: 720px;
  }
}

@media (max-width: 860px) {
  .app-topbar,
  .app-main,
  .panel-right {
    display: block;
  }

  .project-controls {
    margin-top: 10px;
    flex-wrap: wrap;
  }

  .brand-copy p {
    white-space: normal;
  }

  .workbench {
    height: 640px;
    margin: 14px 0;
  }
}
